Skip to content

Commit

Permalink
add dedicated api client (#254)
Browse files Browse the repository at this point in the history
Signed-off-by: FingerLeader <wanxfinger@gmail.com>
  • Loading branch information
FingerLeader authored Nov 25, 2024
1 parent 2e57e1a commit 8e2a11b
Show file tree
Hide file tree
Showing 94 changed files with 43,293 additions and 5 deletions.
24 changes: 19 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ addcopy: ## Add copyright to all files
@scripts/add-copy.sh

.PHONY: generate-v1beta1-client
generate-v1beta1-client: install-openapi-generator ## Generate v1beta1 client
generate-v1beta1-client: generate-v1beta1-serverless-client generate-v1beta1-iam-client generate-v1beta1-dedicated-client ## Generate v1beta1 client

.PHONY: generate-v1beta1-serverless-client
generate-v1beta1-serverless-client: install-openapi-generator ## Generate serverless client
@echo "==> Generating serverless branch client"
rm -rf pkg/tidbcloud/v1beta1/serverless/branch
cd tools/openapi-generator && npx openapi-generator-cli generate --inline-schema-options RESOLVE_INLINE_ENUMS=true --additional-properties=withGoMod=false,enumClassPrefix=true,disallowAdditionalPropertiesIfNotPresent=false --global-property=apiTests=false,apiDocs=false,modelDocs=false,modelTests=false -i ../../pkg/tidbcloud/v1beta1/serverless/branch.swagger.json -g go -o ../../pkg/tidbcloud/v1beta1/serverless/branch --package-name branch
Expand All @@ -48,16 +51,27 @@ generate-v1beta1-client: install-openapi-generator ## Generate v1beta1 client
@echo "==> Generating serverless export client"
rm -rf pkg/tidbcloud/v1beta1/serverless/export
cd tools/openapi-generator && npx openapi-generator-cli generate --inline-schema-options RESOLVE_INLINE_ENUMS=true --additional-properties=withGoMod=false,enumClassPrefix=true,disallowAdditionalPropertiesIfNotPresent=false --global-property=apiTests=false,apiDocs=false,modelDocs=false,modelTests=false -i ../../pkg/tidbcloud/v1beta1/serverless/export.swagger.json -g go -o ../../pkg/tidbcloud/v1beta1/serverless/export --package-name export
@echo "==> Generating iam client"
rm -rf pkg/tidbcloud/v1beta1/iam
cd tools/openapi-generator && npx openapi-generator-cli generate --inline-schema-options RESOLVE_INLINE_ENUMS=true --additional-properties=withGoMod=false,enumClassPrefix=true,disallowAdditionalPropertiesIfNotPresent=false --global-property=apiTests=false,apiDocs=false,modelDocs=false,modelTests=false -i ../../pkg/tidbcloud/v1beta1/iam.swagger.json -g go -o ../../pkg/tidbcloud/v1beta1/iam --package-name iam
@echo "==> Generating serverless br client"
rm -rf pkg/tidbcloud/v1beta1/serverless/br
cd tools/openapi-generator && npx openapi-generator-cli generate --inline-schema-options RESOLVE_INLINE_ENUMS=true --additional-properties=withGoMod=false,enumClassPrefix=true,disallowAdditionalPropertiesIfNotPresent=false --global-property=apiTests=false,apiDocs=false,modelDocs=false,modelTests=false -i ../../pkg/tidbcloud/v1beta1/serverless/br.swagger.json -g go -o ../../pkg/tidbcloud/v1beta1/serverless/br --package-name br
@echo "==> Generating serverless import client"
rm -rf pkg/tidbcloud/v1beta1/serverless/imp
cd tools/openapi-generator && npx openapi-generator-cli generate --inline-schema-options RESOLVE_INLINE_ENUMS=true --additional-properties=withGoMod=false,enumClassPrefix=true,disallowAdditionalPropertiesIfNotPresent=false --global-property=apiTests=false,apiDocs=false,modelDocs=false,modelTests=false -i ../../pkg/tidbcloud/v1beta1/serverless/import.swagger.json -g go -o ../../pkg/tidbcloud/v1beta1/serverless/imp --package-name imp
cd pkg && go fmt ./tidbcloud/v1beta1/...
cd pkg && go fmt ./tidbcloud/v1beta1/serverless/...

.PHONY: generate-v1beta1-dedicated-client
generate-v1beta1-dedicated-client: install-openapi-generator ## Generate dedicated client
@echo "==> Generating dedicated client"
rm -rf pkg/tidbcloud/v1beta1/dedicated
cd tools/openapi-generator && npx openapi-generator-cli generate --inline-schema-options RESOLVE_INLINE_ENUMS=true --additional-properties=withGoMod=false,enumClassPrefix=true,disallowAdditionalPropertiesIfNotPresent=false --global-property=apiTests=false,apiDocs=false,modelDocs=false,modelTests=false --skip-validate-spec -i ../../pkg/tidbcloud/v1beta1/dedicated.swagger.json -g go -o ../../pkg/tidbcloud/v1beta1/dedicated --package-name dedicated
cd pkg && go fmt ./tidbcloud/v1beta1/dedicated/...

.PHONY: generate-v1beta1-iam-client
generate-v1beta1-iam-client: install-openapi-generator ## Generate iam client
@echo "==> Generating iam client"
rm -rf pkg/tidbcloud/v1beta1/iam
cd tools/openapi-generator && npx openapi-generator-cli generate --inline-schema-options RESOLVE_INLINE_ENUMS=true --additional-properties=withGoMod=false,enumClassPrefix=true,disallowAdditionalPropertiesIfNotPresent=false --global-property=apiTests=false,apiDocs=false,modelDocs=false,modelTests=false -i ../../pkg/tidbcloud/v1beta1/iam.swagger.json -g go -o ../../pkg/tidbcloud/v1beta1/iam --package-name iam
cd pkg && go fmt ./tidbcloud/v1beta1/iam/...

.PHONY: install-openapi-generator
install-openapi-generator:
Expand Down
Loading

0 comments on commit 8e2a11b

Please sign in to comment.