Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dedicated api client #254

Merged
merged 5 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading