From 47dfb46273b2eb2cf9d77f71391d058f9003d58c Mon Sep 17 00:00:00 2001 From: Jason Song Date: Sat, 6 Jun 2026 19:18:08 +0800 Subject: [PATCH 1/2] fix: keep portal consumer contract object based --- CHANGELOG.md | 3 +- apollo-openapi.yaml | 127 +---- generate.sh | 155 ++++- java-client/.openapi-generator/FILES | 9 - java-client/README.md | 11 +- java-client/api/openapi.yaml | 159 +----- java-client/build.gradle | 2 +- java-client/build.sbt | 2 +- .../docs/NamespaceBranchManagementApi.md | 3 - .../docs/OpenConsumerCreateRequestDTO.md | 18 - java-client/docs/OpenConsumerInfoDTO.md | 21 - java-client/docs/OpenConsumerTokenDTO.md | 17 - java-client/docs/PortalManagementApi.md | 22 +- java-client/docs/ReleaseManagementApi.md | 6 - java-client/pom.xml | 2 +- .../org/openapitools/client/ApiClient.java | 2 +- .../openapitools/client/Configuration.java | 2 +- .../java/org/openapitools/client/JSON.java | 3 - .../client/api/AccessKeyManagementApi.java | 120 ---- .../api/NamespaceBranchManagementApi.java | 32 -- .../client/api/PortalManagementApi.java | 77 ++- .../client/api/ReleaseManagementApi.java | 64 --- .../model/OpenConsumerCreateRequestDTO.java | 455 --------------- .../client/model/OpenConsumerInfoDTO.java | 534 ------------------ .../client/model/OpenConsumerTokenDTO.java | 411 -------------- .../api/AccessKeyManagementApiTest.java | 6 +- .../api/NamespaceBranchManagementApiTest.java | 2 +- .../client/api/PortalManagementApiTest.java | 11 +- .../client/api/ReleaseManagementApiTest.java | 5 +- .../client/api/UserManagementApiTest.java | 6 +- .../OpenConsumerCreateRequestDTOTest.java | 111 ---- .../client/model/OpenConsumerInfoDTOTest.java | 135 ----- .../model/OpenConsumerTokenDTOTest.java | 104 ---- python/.openapi-generator/FILES | 12 - python/README.md | 7 +- python/apollo_openapi/__init__.py | 2 +- python/apollo_openapi/api_client.py | 2 +- ...d_envs_env_clusters_cluster_name_export.py | 4 +- python/apollo_openapi/configuration.py | 4 +- .../model/open_consumer_create_request_dto.py | 176 ------ .../open_consumer_create_request_dto.pyi | 173 ------ .../model/open_consumer_info_dto.py | 195 ------- .../model/open_consumer_info_dto.pyi | 192 ------- .../model/open_consumer_token_dto.py | 155 ----- .../model/open_consumer_token_dto.pyi | 152 ----- python/apollo_openapi/models/__init__.py | 3 - .../head.py | 2 +- .../head.pyi | 2 +- .../get.py | 4 +- .../get.pyi | 4 +- .../paths/openapi_v1_consumers/get.py | 11 +- .../paths/openapi_v1_consumers/get.pyi | 11 +- .../paths/openapi_v1_consumers/post.py | 41 +- .../paths/openapi_v1_consumers/post.pyi | 41 +- python/docs/apis/tags/PortalManagementApi.md | 64 +-- .../models/OpenConsumerCreateRequestDTO.md | 22 - python/docs/models/OpenConsumerInfoDTO.md | 25 - python/docs/models/OpenConsumerTokenDTO.md | 21 - python/setup.py | 2 +- .../test_open_consumer_create_request_dto.py | 24 - .../test_open_consumer_info_dto.py | 24 - .../test_open_consumer_token_dto.py | 24 - .../test_head.py | 2 +- rust/.openapi-generator/FILES | 6 - rust/Cargo.toml | 3 +- rust/README.md | 7 +- rust/docs/OpenConsumerCreateRequestDto.md | 17 - rust/docs/OpenConsumerInfoDto.md | 20 - rust/docs/OpenConsumerTokenDto.md | 16 - rust/src/apis/configuration.rs | 2 +- rust/src/models/mod.rs | 6 - .../open_consumer_create_request_dto.rs | 58 -- rust/src/models/open_consumer_info_dto.rs | 70 --- rust/src/models/open_consumer_token_dto.rs | 54 -- spring-boot2/.openapi-generator/FILES | 3 - spring-boot2/pom.xml | 2 +- .../api/AccessKeyManagementApiDelegate.java | 42 +- .../NamespaceBranchManagementApiDelegate.java | 28 +- .../server/api/PortalManagementApi.java | 21 +- .../api/PortalManagementApiController.java | 3 - .../api/PortalManagementApiDelegate.java | 31 +- .../api/ReleaseManagementApiDelegate.java | 39 +- .../server/api/UserManagementApiDelegate.java | 2 +- .../server/config/SpringDocConfiguration.java | 2 +- .../model/OpenConsumerCreateRequestDTO.java | 294 ---------- .../server/model/OpenConsumerInfoDTO.java | 347 ------------ .../server/model/OpenConsumerTokenDTO.java | 255 --------- spring-boot2/src/main/resources/openapi.yaml | 159 +----- tests/test_user_management_contract.py | 84 +-- typescript/.openapi-generator/FILES | 3 - typescript/README.md | 4 +- typescript/package.json | 2 +- typescript/src/apis/PortalManagementApi.ts | 39 +- .../models/OpenConsumerCreateRequestDTO.ts | 131 ----- typescript/src/models/OpenConsumerInfoDTO.ts | 151 ----- typescript/src/models/OpenConsumerTokenDTO.ts | 119 ---- typescript/src/models/index.ts | 3 - 97 files changed, 384 insertions(+), 5677 deletions(-) delete mode 100644 java-client/docs/OpenConsumerCreateRequestDTO.md delete mode 100644 java-client/docs/OpenConsumerInfoDTO.md delete mode 100644 java-client/docs/OpenConsumerTokenDTO.md delete mode 100644 java-client/src/main/java/org/openapitools/client/model/OpenConsumerCreateRequestDTO.java delete mode 100644 java-client/src/main/java/org/openapitools/client/model/OpenConsumerInfoDTO.java delete mode 100644 java-client/src/main/java/org/openapitools/client/model/OpenConsumerTokenDTO.java delete mode 100644 java-client/src/test/java/org/openapitools/client/model/OpenConsumerCreateRequestDTOTest.java delete mode 100644 java-client/src/test/java/org/openapitools/client/model/OpenConsumerInfoDTOTest.java delete mode 100644 java-client/src/test/java/org/openapitools/client/model/OpenConsumerTokenDTOTest.java delete mode 100644 python/apollo_openapi/model/open_consumer_create_request_dto.py delete mode 100644 python/apollo_openapi/model/open_consumer_create_request_dto.pyi delete mode 100644 python/apollo_openapi/model/open_consumer_info_dto.py delete mode 100644 python/apollo_openapi/model/open_consumer_info_dto.pyi delete mode 100644 python/apollo_openapi/model/open_consumer_token_dto.py delete mode 100644 python/apollo_openapi/model/open_consumer_token_dto.pyi delete mode 100644 python/docs/models/OpenConsumerCreateRequestDTO.md delete mode 100644 python/docs/models/OpenConsumerInfoDTO.md delete mode 100644 python/docs/models/OpenConsumerTokenDTO.md delete mode 100644 python/test/test_models/test_open_consumer_create_request_dto.py delete mode 100644 python/test/test_models/test_open_consumer_info_dto.py delete mode 100644 python/test/test_models/test_open_consumer_token_dto.py delete mode 100644 rust/docs/OpenConsumerCreateRequestDto.md delete mode 100644 rust/docs/OpenConsumerInfoDto.md delete mode 100644 rust/docs/OpenConsumerTokenDto.md delete mode 100644 rust/src/models/open_consumer_create_request_dto.rs delete mode 100644 rust/src/models/open_consumer_info_dto.rs delete mode 100644 rust/src/models/open_consumer_token_dto.rs delete mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerCreateRequestDTO.java delete mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerInfoDTO.java delete mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerTokenDTO.java delete mode 100644 typescript/src/models/OpenConsumerCreateRequestDTO.ts delete mode 100644 typescript/src/models/OpenConsumerInfoDTO.ts delete mode 100644 typescript/src/models/OpenConsumerTokenDTO.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 37526af7..18836452 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,12 +13,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Restore `/openapi/v1/consumer-tokens/by-appId` to a token-specific response schema. +- Revert Portal Management consumer endpoint schemas to object-based Portal UI contracts. ### Added - Add Consumer Token support notes to user management contracts, including `ManageUsers`-guarded user lookup and mutation operations. -- Add typed consumer management request, detail, and token schemas with `allowManageUsers` and `rateLimitEnabled` flags. ## [0.3.5] - 2026-05-31 diff --git a/apollo-openapi.yaml b/apollo-openapi.yaml index 7e5226d4..bf208fd3 100644 --- a/apollo-openapi.yaml +++ b/apollo-openapi.yaml @@ -18,7 +18,7 @@ info:
curl -X GET "http://localhost:8070/openapi/v1/apps" \
     -H "Authorization: your_token_here"
- version: 0.3.7 + version: 0.3.8 security: - ApiKeyAuth: [] tags: @@ -5348,7 +5348,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/OpenConsumerCreateRequestDTO' + type: object required: true responses: '200': @@ -5356,7 +5356,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/OpenConsumerInfoDTO' + type: object get: summary: 查询开放平台消费者列表(new added) operationId: getConsumerList @@ -5385,7 +5385,7 @@ paths: schema: type: array items: - $ref: '#/components/schemas/OpenConsumerInfoDTO' + type: object /openapi/v1/consumer-tokens/by-appId: get: summary: 按应用ID查询消费者Token(new added) @@ -5406,7 +5406,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/OpenConsumerTokenDTO' + type: object /openapi/v1/consumers/{token}/assign-role: post: summary: 给消费者授权(new added) @@ -6830,123 +6830,6 @@ components: hasPermission: type: boolean description: '' - OpenConsumerCreateRequestDTO: - type: object - required: - - appId - - name - - orgId - - ownerName - properties: - appId: - type: string - description: 第三方应用ID - allowCreateApplication: - type: boolean - description: 是否允许该Consumer Token创建应用 - default: false - allowManageUsers: - type: boolean - description: 是否允许该Consumer Token管理用户 - default: false - name: - type: string - description: 第三方应用名称 - orgId: - type: string - description: 部门ID - orgName: - type: string - description: 部门名称 - ownerName: - type: string - description: 负责人用户名 - rateLimitEnabled: - type: boolean - description: 是否开启限流 - default: false - rateLimit: - type: integer - description: 限流QPS,rateLimitEnabled 为 true 时必须大于 0;未开启限流时 0 表示不限流 - minimum: 0 - OpenConsumerInfoDTO: - type: object - properties: - appId: - type: string - description: 第三方应用ID - name: - type: string - description: 第三方应用名称 - orgId: - type: string - description: 部门ID - orgName: - type: string - description: 部门名称 - ownerName: - type: string - description: 负责人用户名 - ownerEmail: - type: string - description: 负责人邮箱 - consumerId: - type: integer - format: int64 - description: Consumer ID - token: - type: string - description: Consumer Token,仅在创建或按应用查询详情时返回 - allowCreateApplication: - type: boolean - description: 是否允许该Consumer Token创建应用 - default: false - allowManageUsers: - type: boolean - description: 是否允许该Consumer Token管理用户 - default: false - rateLimit: - type: integer - description: 限流QPS,0表示不限流 - minimum: 0 - default: 0 - rateLimitEnabled: - type: boolean - description: 是否开启限流 - default: false - OpenConsumerTokenDTO: - type: object - properties: - consumerId: - type: integer - format: int64 - description: Consumer ID - token: - type: string - description: Consumer Token - rateLimit: - type: integer - description: 限流QPS,0表示不限流 - minimum: 0 - default: 0 - expires: - type: string - format: date-time - description: 过期时间 - dataChangeCreatedBy: - type: string - description: 创建人 - dataChangeCreatedTime: - type: string - format: date-time - description: 创建时间 - dataChangeLastModifiedBy: - type: string - description: 最后修改人 - dataChangeLastModifiedTime: - type: string - format: date-time - description: 最后修改时间 OpenUserInfoDTO: type: object properties: diff --git a/generate.sh b/generate.sh index a3fa3e04..9af55170 100755 --- a/generate.sh +++ b/generate.sh @@ -42,14 +42,14 @@ echo "🚀 Generating Python SDK..." -o "$PYTHON_DIR" \ -t "$PYTHON_TEMPLATE_DIR" \ --package-name apollo_openapi \ - --additional-properties=projectName=apollo-openapi,packageVersion=0.3.7 + --additional-properties=projectName=apollo-openapi,packageVersion=0.3.8 echo "🚀 Generating TypeScript SDK..." "${OPENAPI_GENERATOR[@]}" generate \ -i "$SPEC_FILE" \ -g typescript-fetch \ -o "$TS_DIR" \ - --additional-properties=npmName=apollo-openapi,npmVersion=0.3.7,typescriptThreePlus=true + --additional-properties=npmName=apollo-openapi,npmVersion=0.3.8,typescriptThreePlus=true echo "🚀 Generating Java Client SDK..." "${OPENAPI_GENERATOR[@]}" generate \ @@ -57,7 +57,152 @@ echo "🚀 Generating Java Client SDK..." -g java \ -o "$JAVA_CLIENT_DIR" \ --additional-properties hideGenerationTimestamp=true \ - --additional-properties=groupId=com.apollo,artifactId=apollo-openapi-client,artifactVersion=0.3.7,packageName=com.apollo.openapi.client + --additional-properties=groupId=com.apollo,artifactId=apollo-openapi-client,artifactVersion=0.3.8,packageName=com.apollo.openapi.client + +echo "🔧 Preserving Java client operator overloads..." +python3 - <<'PY' +from pathlib import Path + +api_file = Path("java-client/src/main/java/org/openapitools/client/api/UserManagementApi.java") +content = api_file.read_text(encoding="utf-8") + + +def add_overload_before(marker, overload): + global content + if overload in content: + return + if marker not in content: + raise SystemExit(f"Could not find Java client overload marker:\n{marker}") + content = content.replace(marker, overload + marker, 1) + + +def add_overload_after(marker, overload): + global content + if overload in content: + return + if marker not in content: + raise SystemExit(f"Could not find Java client overload marker:\n{marker}") + content = content.replace(marker, marker + overload, 1) + + +add_overload_before( + """ @SuppressWarnings("rawtypes") + private okhttp3.Call changeUserEnabledValidateBeforeCall""", + """ /** + * Build call for changeUserEnabled. + * This overload preserves the Java client API for callers that do not need the optional operator query parameter. + */ + public okhttp3.Call changeUserEnabledCall(OpenUserDTO openUserDTO, final ApiCallback _callback) throws ApiException { + return changeUserEnabledCall(openUserDTO, null, _callback); + } + +""", +) +add_overload_after( + """ public void changeUserEnabled(OpenUserDTO openUserDTO, String operator) throws ApiException { + changeUserEnabledWithHttpInfo(openUserDTO, operator); + } + +""", + """ /** + * 修改用户启用状态(new added) + * This overload preserves the Java client API for callers that do not need the optional operator query parameter. + */ + public void changeUserEnabled(OpenUserDTO openUserDTO) throws ApiException { + changeUserEnabled(openUserDTO, null); + } + +""", +) +add_overload_before( + """ /** + * 修改用户启用状态(new added) (asynchronously) + * PUT /openapi/v1/users/enabled""", + """ /** + * 修改用户启用状态(new added) + * This overload preserves the Java client API for callers that do not need the optional operator query parameter. + */ + public ApiResponse changeUserEnabledWithHttpInfo(OpenUserDTO openUserDTO) throws ApiException { + return changeUserEnabledWithHttpInfo(openUserDTO, null); + } + +""", +) +add_overload_before( + """ /** + * Build call for createOrUpdateUser + * @param openUserDTO""", + """ + /** + * 修改用户启用状态(new added) (asynchronously) + * This overload preserves the Java client API for callers that do not need the optional operator query parameter. + */ + public okhttp3.Call changeUserEnabledAsync(OpenUserDTO openUserDTO, final ApiCallback _callback) throws ApiException { + return changeUserEnabledAsync(openUserDTO, null, _callback); + } + +""", +) +add_overload_before( + """ @SuppressWarnings("rawtypes") + private okhttp3.Call createOrUpdateUserValidateBeforeCall""", + """ /** + * Build call for createOrUpdateUser. + * This overload preserves the Java client API for callers that do not need the optional operator query parameter. + */ + public okhttp3.Call createOrUpdateUserCall(OpenUserDTO openUserDTO, Boolean isCreate, final ApiCallback _callback) throws ApiException { + return createOrUpdateUserCall(openUserDTO, isCreate, null, _callback); + } + +""", +) +add_overload_after( + """ public void createOrUpdateUser(OpenUserDTO openUserDTO, Boolean isCreate, String operator) throws ApiException { + createOrUpdateUserWithHttpInfo(openUserDTO, isCreate, operator); + } + +""", + """ /** + * 创建或更新用户(new added) + * This overload preserves the Java client API for callers that do not need the optional operator query parameter. + */ + public void createOrUpdateUser(OpenUserDTO openUserDTO, Boolean isCreate) throws ApiException { + createOrUpdateUser(openUserDTO, isCreate, null); + } + +""", +) +add_overload_before( + """ /** + * 创建或更新用户(new added) (asynchronously) + * POST /openapi/v1/users""", + """ /** + * 创建或更新用户(new added) + * This overload preserves the Java client API for callers that do not need the optional operator query parameter. + */ + public ApiResponse createOrUpdateUserWithHttpInfo(OpenUserDTO openUserDTO, Boolean isCreate) throws ApiException { + return createOrUpdateUserWithHttpInfo(openUserDTO, isCreate, null); + } + +""", +) +add_overload_before( + """ /** + * Build call for getCurrentUser + * @param _callback""", + """ + /** + * 创建或更新用户(new added) (asynchronously) + * This overload preserves the Java client API for callers that do not need the optional operator query parameter. + */ + public okhttp3.Call createOrUpdateUserAsync(OpenUserDTO openUserDTO, Boolean isCreate, final ApiCallback _callback) throws ApiException { + return createOrUpdateUserAsync(openUserDTO, isCreate, null, _callback); + } +""", +) + +api_file.write_text(content, encoding="utf-8") +PY echo "🚀 Generating Spring Boot 2 Server..." "${OPENAPI_GENERATOR[@]}" generate \ @@ -65,7 +210,7 @@ echo "🚀 Generating Spring Boot 2 Server..." -g spring \ -o "$SPRING_BOOT2_DIR" \ --additional-properties hideGenerationTimestamp=true \ - --additional-properties=groupId=com.apollo,artifactId=apollo-openapi-server,artifactVersion=0.3.7,packageName=com.apollo.openapi.server,basePackage=com.apollo.openapi.server,configPackage=com.apollo.openapi.server.config,modelPackage=com.apollo.openapi.server.model,apiPackage=com.apollo.openapi.server.api,library=spring-boot,java8=true,interfaceOnly=false,delegatePattern=true,useTags=true + --additional-properties=groupId=com.apollo,artifactId=apollo-openapi-server,artifactVersion=0.3.8,packageName=com.apollo.openapi.server,basePackage=com.apollo.openapi.server,configPackage=com.apollo.openapi.server.config,modelPackage=com.apollo.openapi.server.model,apiPackage=com.apollo.openapi.server.api,library=spring-boot,java8=true,interfaceOnly=false,delegatePattern=true,useTags=true echo "📦 Adding Maven Wrapper to Spring Boot 2 project..." cd "$SPRING_BOOT2_DIR" @@ -90,7 +235,7 @@ echo "🚀 Generating Rust SDK..." -g rust \ -o "$RUST_DIR" \ --global-property models,supportingFiles \ - --additional-properties=packageName=apollo-openapi,packageVersion=0.3.7 + --additional-properties=packageName=apollo-openapi,packageVersion=0.3.8 echo "✅ SDK generation complete." diff --git a/java-client/.openapi-generator/FILES b/java-client/.openapi-generator/FILES index 20c9e6d5..30a5901d 100644 --- a/java-client/.openapi-generator/FILES +++ b/java-client/.openapi-generator/FILES @@ -25,9 +25,6 @@ docs/OpenAppNamespaceDTO.md docs/OpenAppRoleUserDTO.md docs/OpenClusterDTO.md docs/OpenClusterNamespaceRoleUserDTO.md -docs/OpenConsumerCreateRequestDTO.md -docs/OpenConsumerInfoDTO.md -docs/OpenConsumerTokenDTO.md docs/OpenCreateAppDTO.md docs/OpenCreateNamespaceDTO.md docs/OpenEnvClusterDTO.md @@ -114,9 +111,6 @@ src/main/java/org/openapitools/client/model/OpenAppNamespaceDTO.java src/main/java/org/openapitools/client/model/OpenAppRoleUserDTO.java src/main/java/org/openapitools/client/model/OpenClusterDTO.java src/main/java/org/openapitools/client/model/OpenClusterNamespaceRoleUserDTO.java -src/main/java/org/openapitools/client/model/OpenConsumerCreateRequestDTO.java -src/main/java/org/openapitools/client/model/OpenConsumerInfoDTO.java -src/main/java/org/openapitools/client/model/OpenConsumerTokenDTO.java src/main/java/org/openapitools/client/model/OpenCreateAppDTO.java src/main/java/org/openapitools/client/model/OpenCreateNamespaceDTO.java src/main/java/org/openapitools/client/model/OpenEnvClusterDTO.java @@ -171,9 +165,6 @@ src/test/java/org/openapitools/client/model/OpenAppNamespaceDTOTest.java src/test/java/org/openapitools/client/model/OpenAppRoleUserDTOTest.java src/test/java/org/openapitools/client/model/OpenClusterDTOTest.java src/test/java/org/openapitools/client/model/OpenClusterNamespaceRoleUserDTOTest.java -src/test/java/org/openapitools/client/model/OpenConsumerCreateRequestDTOTest.java -src/test/java/org/openapitools/client/model/OpenConsumerInfoDTOTest.java -src/test/java/org/openapitools/client/model/OpenConsumerTokenDTOTest.java src/test/java/org/openapitools/client/model/OpenCreateAppDTOTest.java src/test/java/org/openapitools/client/model/OpenCreateNamespaceDTOTest.java src/test/java/org/openapitools/client/model/OpenEnvClusterDTOTest.java diff --git a/java-client/README.md b/java-client/README.md index 498cdb95..b761a887 100644 --- a/java-client/README.md +++ b/java-client/README.md @@ -1,7 +1,7 @@ # apollo-openapi-client Apollo OpenAPI -- API version: 0.3.7 +- API version: 0.3.8

Apollo配置中心OpenAPI接口文档

@@ -54,7 +54,7 @@ Add this dependency to your project's POM: com.apollo apollo-openapi-client - 0.3.7 + 0.3.8 compile ``` @@ -70,7 +70,7 @@ Add this dependency to your project's build file: } dependencies { - implementation "com.apollo:apollo-openapi-client:0.3.7" + implementation "com.apollo:apollo-openapi-client:0.3.8" } ``` @@ -84,7 +84,7 @@ mvn clean package Then manually install the following JARs: -* `target/apollo-openapi-client-0.3.7.jar` +* `target/apollo-openapi-client-0.3.8.jar` * `target/lib/*.jar` ## Getting Started @@ -288,9 +288,6 @@ Class | Method | HTTP request | Description - [OpenAppRoleUserDTO](docs/OpenAppRoleUserDTO.md) - [OpenClusterDTO](docs/OpenClusterDTO.md) - [OpenClusterNamespaceRoleUserDTO](docs/OpenClusterNamespaceRoleUserDTO.md) - - [OpenConsumerCreateRequestDTO](docs/OpenConsumerCreateRequestDTO.md) - - [OpenConsumerInfoDTO](docs/OpenConsumerInfoDTO.md) - - [OpenConsumerTokenDTO](docs/OpenConsumerTokenDTO.md) - [OpenCreateAppDTO](docs/OpenCreateAppDTO.md) - [OpenCreateNamespaceDTO](docs/OpenCreateNamespaceDTO.md) - [OpenEnvClusterDTO](docs/OpenEnvClusterDTO.md) diff --git a/java-client/api/openapi.yaml b/java-client/api/openapi.yaml index 68614a85..f05be1eb 100644 --- a/java-client/api/openapi.yaml +++ b/java-client/api/openapi.yaml @@ -17,7 +17,7 @@ info:
curl -X GET "http://localhost:8070/openapi/v1/apps" \
     -H "Authorization: your_token_here"
title: Apollo OpenAPI - version: 0.3.7 + version: 0.3.8 servers: - url: / security: @@ -6177,7 +6177,7 @@ paths: application/json: schema: items: - $ref: '#/components/schemas/OpenConsumerInfoDTO' + type: object type: array description: 成功获取消费者列表 summary: 查询开放平台消费者列表(new added) @@ -6201,14 +6201,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/OpenConsumerCreateRequestDTO' + type: object required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/OpenConsumerInfoDTO' + type: object description: 成功创建消费者 summary: 创建开放平台消费者(new added) tags: @@ -6233,7 +6233,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/OpenConsumerTokenDTO' + type: object description: 成功获取消费者Token summary: 按应用ID查询消费者Token(new added) tags: @@ -8391,155 +8391,6 @@ components: description: "" type: boolean type: object - OpenConsumerCreateRequestDTO: - example: - orgName: orgName - rateLimit: 0 - ownerName: ownerName - appId: appId - name: name - allowCreateApplication: false - allowManageUsers: false - rateLimitEnabled: false - orgId: orgId - properties: - appId: - description: 第三方应用ID - type: string - allowCreateApplication: - default: false - description: 是否允许该Consumer Token创建应用 - type: boolean - allowManageUsers: - default: false - description: 是否允许该Consumer Token管理用户 - type: boolean - name: - description: 第三方应用名称 - type: string - orgId: - description: 部门ID - type: string - orgName: - description: 部门名称 - type: string - ownerName: - description: 负责人用户名 - type: string - rateLimitEnabled: - default: false - description: 是否开启限流 - type: boolean - rateLimit: - description: 限流QPS,rateLimitEnabled 为 true 时必须大于 0;未开启限流时 0 表示不限流 - minimum: 0 - type: integer - required: - - appId - - name - - orgId - - ownerName - type: object - OpenConsumerInfoDTO: - example: - orgName: orgName - rateLimit: 0 - ownerName: ownerName - consumerId: 0 - appId: appId - name: name - allowCreateApplication: false - allowManageUsers: false - rateLimitEnabled: false - orgId: orgId - ownerEmail: ownerEmail - token: token - properties: - appId: - description: 第三方应用ID - type: string - name: - description: 第三方应用名称 - type: string - orgId: - description: 部门ID - type: string - orgName: - description: 部门名称 - type: string - ownerName: - description: 负责人用户名 - type: string - ownerEmail: - description: 负责人邮箱 - type: string - consumerId: - description: Consumer ID - format: int64 - type: integer - token: - description: Consumer Token,仅在创建或按应用查询详情时返回 - type: string - allowCreateApplication: - default: false - description: 是否允许该Consumer Token创建应用 - type: boolean - allowManageUsers: - default: false - description: 是否允许该Consumer Token管理用户 - type: boolean - rateLimit: - default: 0 - description: 限流QPS,0表示不限流 - minimum: 0 - type: integer - rateLimitEnabled: - default: false - description: 是否开启限流 - type: boolean - type: object - OpenConsumerTokenDTO: - example: - expires: 2000-01-23T04:56:07.000+00:00 - rateLimit: 0 - dataChangeCreatedTime: 2000-01-23T04:56:07.000+00:00 - dataChangeLastModifiedBy: dataChangeLastModifiedBy - consumerId: 0 - dataChangeCreatedBy: dataChangeCreatedBy - dataChangeLastModifiedTime: 2000-01-23T04:56:07.000+00:00 - token: token - properties: - consumerId: - description: Consumer ID - format: int64 - type: integer - token: - description: Consumer Token - type: string - rateLimit: - default: 0 - description: 限流QPS,0表示不限流 - minimum: 0 - type: integer - expires: - description: 过期时间 - format: date-time - type: string - dataChangeCreatedBy: - description: 创建人 - type: string - dataChangeCreatedTime: - description: 创建时间 - format: date-time - type: string - dataChangeLastModifiedBy: - description: 最后修改人 - type: string - dataChangeLastModifiedTime: - description: 最后修改时间 - format: date-time - type: string - type: object OpenUserInfoDTO: example: name: name diff --git a/java-client/build.gradle b/java-client/build.gradle index e47f0d7c..e4d88b01 100644 --- a/java-client/build.gradle +++ b/java-client/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'java' apply plugin: 'com.diffplug.spotless' group = 'com.apollo' -version = '0.3.7' +version = '0.3.8' buildscript { repositories { diff --git a/java-client/build.sbt b/java-client/build.sbt index 7c584546..e2c2060c 100644 --- a/java-client/build.sbt +++ b/java-client/build.sbt @@ -2,7 +2,7 @@ lazy val root = (project in file(".")). settings( organization := "com.apollo", name := "apollo-openapi-client", - version := "0.3.7", + version := "0.3.8", scalaVersion := "2.11.4", scalacOptions ++= Seq("-feature"), javacOptions in compile ++= Seq("-Xlint:deprecation"), diff --git a/java-client/docs/NamespaceBranchManagementApi.md b/java-client/docs/NamespaceBranchManagementApi.md index db24275a..0d9249b9 100644 --- a/java-client/docs/NamespaceBranchManagementApi.md +++ b/java-client/docs/NamespaceBranchManagementApi.md @@ -495,9 +495,6 @@ public class Example { 更新分支灰度发布规则 (original openapi) -Compatibility: the Java client also preserves the pre-0.3.1 overload with `operator` -before `openGrayReleaseRuleDTO`. - PUT /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/rules ### Example diff --git a/java-client/docs/OpenConsumerCreateRequestDTO.md b/java-client/docs/OpenConsumerCreateRequestDTO.md deleted file mode 100644 index e870cc60..00000000 --- a/java-client/docs/OpenConsumerCreateRequestDTO.md +++ /dev/null @@ -1,18 +0,0 @@ - - -# OpenConsumerCreateRequestDTO - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**appId** | **String** | 第三方应用ID | | -|**allowCreateApplication** | **Boolean** | 是否允许该Consumer Token创建应用 | [optional] | -|**allowManageUsers** | **Boolean** | 是否允许该Consumer Token管理用户 | [optional] | -|**name** | **String** | 第三方应用名称 | | -|**orgId** | **String** | 部门ID | | -|**orgName** | **String** | 部门名称 | [optional] | -|**ownerName** | **String** | 负责人用户名 | | -|**rateLimitEnabled** | **Boolean** | 是否开启限流 | [optional] | -|**rateLimit** | **Integer** | 限流QPS,rateLimitEnabled 为 true 时必须大于 0;未开启限流时 0 表示不限流 | [optional] | diff --git a/java-client/docs/OpenConsumerInfoDTO.md b/java-client/docs/OpenConsumerInfoDTO.md deleted file mode 100644 index 1ece029a..00000000 --- a/java-client/docs/OpenConsumerInfoDTO.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# OpenConsumerInfoDTO - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**appId** | **String** | 第三方应用ID | [optional] | -|**name** | **String** | 第三方应用名称 | [optional] | -|**orgId** | **String** | 部门ID | [optional] | -|**orgName** | **String** | 部门名称 | [optional] | -|**ownerName** | **String** | 负责人用户名 | [optional] | -|**ownerEmail** | **String** | 负责人邮箱 | [optional] | -|**consumerId** | **Long** | Consumer ID | [optional] | -|**token** | **String** | Consumer Token,仅在创建或按应用查询详情时返回 | [optional] | -|**allowCreateApplication** | **Boolean** | 是否允许该Consumer Token创建应用 | [optional] | -|**allowManageUsers** | **Boolean** | 是否允许该Consumer Token管理用户 | [optional] | -|**rateLimit** | **Integer** | 限流QPS,0表示不限流 | [optional] | -|**rateLimitEnabled** | **Boolean** | 是否开启限流 | [optional] | diff --git a/java-client/docs/OpenConsumerTokenDTO.md b/java-client/docs/OpenConsumerTokenDTO.md deleted file mode 100644 index c2ae0de8..00000000 --- a/java-client/docs/OpenConsumerTokenDTO.md +++ /dev/null @@ -1,17 +0,0 @@ - - -# OpenConsumerTokenDTO - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**consumerId** | **Long** | Consumer ID | [optional] | -|**token** | **String** | Consumer Token | [optional] | -|**rateLimit** | **Integer** | 限流QPS,0表示不限流 | [optional] | -|**expires** | **OffsetDateTime** | 过期时间 | [optional] | -|**dataChangeCreatedBy** | **String** | 创建人 | [optional] | -|**dataChangeCreatedTime** | **OffsetDateTime** | 创建时间 | [optional] | -|**dataChangeLastModifiedBy** | **String** | 最后修改人 | [optional] | -|**dataChangeLastModifiedTime** | **OffsetDateTime** | 最后修改时间 | [optional] | diff --git a/java-client/docs/PortalManagementApi.md b/java-client/docs/PortalManagementApi.md index c71701ba..b107cba8 100644 --- a/java-client/docs/PortalManagementApi.md +++ b/java-client/docs/PortalManagementApi.md @@ -329,7 +329,7 @@ public class Example { # **createConsumer** -> OpenConsumerInfoDTO createConsumer(openConsumerCreateRequestDTO, expires) +> Object createConsumer(body, expires) 创建开放平台消费者(new added) @@ -357,10 +357,10 @@ public class Example { //ApiKeyAuth.setApiKeyPrefix("Token"); PortalManagementApi apiInstance = new PortalManagementApi(defaultClient); - OpenConsumerCreateRequestDTO openConsumerCreateRequestDTO = new OpenConsumerCreateRequestDTO(); // OpenConsumerCreateRequestDTO | + Object body = null; // Object | String expires = "expires_example"; // String | try { - OpenConsumerInfoDTO result = apiInstance.createConsumer(openConsumerCreateRequestDTO, expires); + Object result = apiInstance.createConsumer(body, expires); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PortalManagementApi#createConsumer"); @@ -377,12 +377,12 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **openConsumerCreateRequestDTO** | [**OpenConsumerCreateRequestDTO**](OpenConsumerCreateRequestDTO.md)| | | +| **body** | **Object**| | | | **expires** | **String**| | [optional] | ### Return type -[**OpenConsumerInfoDTO**](OpenConsumerInfoDTO.md) +**Object** ### Authorization @@ -1761,7 +1761,7 @@ This endpoint does not need any parameter. # **getConsumerList** -> List<OpenConsumerInfoDTO> getConsumerList(page, size) +> List<Object> getConsumerList(page, size) 查询开放平台消费者列表(new added) @@ -1792,7 +1792,7 @@ public class Example { Integer page = 0; // Integer | Integer size = 10; // Integer | try { - List result = apiInstance.getConsumerList(page, size); + List result = apiInstance.getConsumerList(page, size); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PortalManagementApi#getConsumerList"); @@ -1814,7 +1814,7 @@ public class Example { ### Return type -[**List<OpenConsumerInfoDTO>**](OpenConsumerInfoDTO.md) +**List<Object>** ### Authorization @@ -1832,7 +1832,7 @@ public class Example { # **getConsumerTokenByAppId** -> OpenConsumerTokenDTO getConsumerTokenByAppId(appId) +> Object getConsumerTokenByAppId(appId) 按应用ID查询消费者Token(new added) @@ -1862,7 +1862,7 @@ public class Example { PortalManagementApi apiInstance = new PortalManagementApi(defaultClient); String appId = "appId_example"; // String | try { - OpenConsumerTokenDTO result = apiInstance.getConsumerTokenByAppId(appId); + Object result = apiInstance.getConsumerTokenByAppId(appId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PortalManagementApi#getConsumerTokenByAppId"); @@ -1883,7 +1883,7 @@ public class Example { ### Return type -[**OpenConsumerTokenDTO**](OpenConsumerTokenDTO.md) +**Object** ### Authorization diff --git a/java-client/docs/ReleaseManagementApi.md b/java-client/docs/ReleaseManagementApi.md index a55bb782..5be055fe 100644 --- a/java-client/docs/ReleaseManagementApi.md +++ b/java-client/docs/ReleaseManagementApi.md @@ -415,9 +415,6 @@ public class Example { 获取发布详情 (new added) -Compatibility: the Java client also preserves the pre-0.3.5 overloads that -accept `Integer releaseId`. - GET /openapi/v1/envs/{env}/releases/{releaseId} ### Example @@ -565,9 +562,6 @@ public class Example { 回滚发布 (original openapi) -Compatibility: the Java client also preserves the pre-0.3.5 overloads without -`toReleaseId`. - 回滚到指定的发布版本 ### Example diff --git a/java-client/pom.xml b/java-client/pom.xml index c269915e..365e4b70 100644 --- a/java-client/pom.xml +++ b/java-client/pom.xml @@ -5,7 +5,7 @@ apollo-openapi-client jar apollo-openapi-client - 0.3.7 + 0.3.8 https://github.com/openapitools/openapi-generator OpenAPI Java diff --git a/java-client/src/main/java/org/openapitools/client/ApiClient.java b/java-client/src/main/java/org/openapitools/client/ApiClient.java index d8864d53..386a9579 100644 --- a/java-client/src/main/java/org/openapitools/client/ApiClient.java +++ b/java-client/src/main/java/org/openapitools/client/ApiClient.java @@ -139,7 +139,7 @@ private void init() { json = new JSON(); // Set default User-Agent. - setUserAgent("OpenAPI-Generator/0.3.7/java"); + setUserAgent("OpenAPI-Generator/0.3.8/java"); authentications = new HashMap(); } diff --git a/java-client/src/main/java/org/openapitools/client/Configuration.java b/java-client/src/main/java/org/openapitools/client/Configuration.java index da2a4760..2339cf6c 100644 --- a/java-client/src/main/java/org/openapitools/client/Configuration.java +++ b/java-client/src/main/java/org/openapitools/client/Configuration.java @@ -14,7 +14,7 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { - public static final String VERSION = "0.3.7"; + public static final String VERSION = "0.3.8"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/java-client/src/main/java/org/openapitools/client/JSON.java b/java-client/src/main/java/org/openapitools/client/JSON.java index abd65fb3..31932a3a 100644 --- a/java-client/src/main/java/org/openapitools/client/JSON.java +++ b/java-client/src/main/java/org/openapitools/client/JSON.java @@ -101,9 +101,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenAppRoleUserDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenClusterDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenClusterNamespaceRoleUserDTO.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenConsumerCreateRequestDTO.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenConsumerInfoDTO.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenConsumerTokenDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenCreateAppDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenCreateNamespaceDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenEnvClusterDTO.CustomTypeAdapterFactory()); diff --git a/java-client/src/main/java/org/openapitools/client/api/AccessKeyManagementApi.java b/java-client/src/main/java/org/openapitools/client/api/AccessKeyManagementApi.java index 600f3feb..f74e2578 100644 --- a/java-client/src/main/java/org/openapitools/client/api/AccessKeyManagementApi.java +++ b/java-client/src/main/java/org/openapitools/client/api/AccessKeyManagementApi.java @@ -424,21 +424,6 @@ public okhttp3.Call disableAccessKeyCall(String appId, String env, Long accessKe return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } - /** - * Build call for disableAccessKey. - * This overload preserves the Java client API from versions before 0.3.3. - * - * @param appId (required) - * @param env (required) - * @param accessKeyId (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public okhttp3.Call disableAccessKeyCall(String appId, String env, Long accessKeyId, final ApiCallback _callback) throws ApiException { - return disableAccessKeyCall(appId, env, accessKeyId, null, _callback); - } - @SuppressWarnings("rawtypes") private okhttp3.Call disableAccessKeyValidateBeforeCall(String appId, String env, Long accessKeyId, String operator, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set @@ -478,19 +463,6 @@ public void disableAccessKey(String appId, String env, Long accessKeyId, String disableAccessKeyWithHttpInfo(appId, env, accessKeyId, operator); } - /** - * 禁用AccessKey - * This overload preserves the Java client API from versions before 0.3.3. - * - * @param appId (required) - * @param env (required) - * @param accessKeyId (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public void disableAccessKey(String appId, String env, Long accessKeyId) throws ApiException { - disableAccessKey(appId, env, accessKeyId, null); - } - /** * 禁用AccessKey * @@ -511,20 +483,6 @@ public ApiResponse disableAccessKeyWithHttpInfo(String appId, String env, return localVarApiClient.execute(localVarCall); } - /** - * 禁用AccessKey - * This overload preserves the Java client API from versions before 0.3.3. - * - * @param appId (required) - * @param env (required) - * @param accessKeyId (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse disableAccessKeyWithHttpInfo(String appId, String env, Long accessKeyId) throws ApiException { - return disableAccessKeyWithHttpInfo(appId, env, accessKeyId, null); - } - /** * 禁用AccessKey (asynchronously) * @@ -547,22 +505,6 @@ public okhttp3.Call disableAccessKeyAsync(String appId, String env, Long accessK localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } - - /** - * 禁用AccessKey (asynchronously) - * This overload preserves the Java client API from versions before 0.3.3. - * - * @param appId (required) - * @param env (required) - * @param accessKeyId (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public okhttp3.Call disableAccessKeyAsync(String appId, String env, Long accessKeyId, final ApiCallback _callback) throws ApiException { - return disableAccessKeyAsync(appId, env, accessKeyId, null, _callback); - } - /** * Build call for enableAccessKey * @param appId (required) @@ -633,22 +575,6 @@ public okhttp3.Call enableAccessKeyCall(String appId, String env, Long accessKey return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } - /** - * Build call for enableAccessKey. - * This overload preserves the Java client API from versions before 0.3.3. - * - * @param appId (required) - * @param env (required) - * @param accessKeyId (required) - * @param mode (optional, default to 0) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public okhttp3.Call enableAccessKeyCall(String appId, String env, Long accessKeyId, Integer mode, final ApiCallback _callback) throws ApiException { - return enableAccessKeyCall(appId, env, accessKeyId, mode, null, _callback); - } - @SuppressWarnings("rawtypes") private okhttp3.Call enableAccessKeyValidateBeforeCall(String appId, String env, Long accessKeyId, Integer mode, String operator, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set @@ -689,20 +615,6 @@ public void enableAccessKey(String appId, String env, Long accessKeyId, Integer enableAccessKeyWithHttpInfo(appId, env, accessKeyId, mode, operator); } - /** - * 启用AccessKey - * This overload preserves the Java client API from versions before 0.3.3. - * - * @param appId (required) - * @param env (required) - * @param accessKeyId (required) - * @param mode (optional, default to 0) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public void enableAccessKey(String appId, String env, Long accessKeyId, Integer mode) throws ApiException { - enableAccessKey(appId, env, accessKeyId, mode, null); - } - /** * 启用AccessKey * @@ -724,21 +636,6 @@ public ApiResponse enableAccessKeyWithHttpInfo(String appId, String env, L return localVarApiClient.execute(localVarCall); } - /** - * 启用AccessKey - * This overload preserves the Java client API from versions before 0.3.3. - * - * @param appId (required) - * @param env (required) - * @param accessKeyId (required) - * @param mode (optional, default to 0) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse enableAccessKeyWithHttpInfo(String appId, String env, Long accessKeyId, Integer mode) throws ApiException { - return enableAccessKeyWithHttpInfo(appId, env, accessKeyId, mode, null); - } - /** * 启用AccessKey (asynchronously) * @@ -762,23 +659,6 @@ public okhttp3.Call enableAccessKeyAsync(String appId, String env, Long accessKe localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } - - /** - * 启用AccessKey (asynchronously) - * This overload preserves the Java client API from versions before 0.3.3. - * - * @param appId (required) - * @param env (required) - * @param accessKeyId (required) - * @param mode (optional, default to 0) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public okhttp3.Call enableAccessKeyAsync(String appId, String env, Long accessKeyId, Integer mode, final ApiCallback _callback) throws ApiException { - return enableAccessKeyAsync(appId, env, accessKeyId, mode, null, _callback); - } - /** * Build call for findAccessKeys * @param appId (required) diff --git a/java-client/src/main/java/org/openapitools/client/api/NamespaceBranchManagementApi.java b/java-client/src/main/java/org/openapitools/client/api/NamespaceBranchManagementApi.java index ed458348..68918559 100644 --- a/java-client/src/main/java/org/openapitools/client/api/NamespaceBranchManagementApi.java +++ b/java-client/src/main/java/org/openapitools/client/api/NamespaceBranchManagementApi.java @@ -1190,14 +1190,6 @@ public okhttp3.Call updateBranchRulesCall(String appId, String env, String clust return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } - /** - * Build call for updateBranchRules. - * This overload preserves the Java client API from versions before 0.3.1. - */ - public okhttp3.Call updateBranchRulesCall(String appId, String env, String clusterName, String namespaceName, String branchName, String operator, OpenGrayReleaseRuleDTO openGrayReleaseRuleDTO, final ApiCallback _callback) throws ApiException { - return updateBranchRulesCall(appId, env, clusterName, namespaceName, branchName, openGrayReleaseRuleDTO, operator, _callback); - } - @SuppressWarnings("rawtypes") private okhttp3.Call updateBranchRulesValidateBeforeCall(String appId, String env, String clusterName, String namespaceName, String branchName, OpenGrayReleaseRuleDTO openGrayReleaseRuleDTO, String operator, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set @@ -1255,14 +1247,6 @@ public void updateBranchRules(String appId, String env, String clusterName, Stri updateBranchRulesWithHttpInfo(appId, env, clusterName, namespaceName, branchName, openGrayReleaseRuleDTO, operator); } - /** - * 更新分支灰度发布规则 (original openapi) - * This overload preserves the Java client API from versions before 0.3.1. - */ - public void updateBranchRules(String appId, String env, String clusterName, String namespaceName, String branchName, String operator, OpenGrayReleaseRuleDTO openGrayReleaseRuleDTO) throws ApiException { - updateBranchRules(appId, env, clusterName, namespaceName, branchName, openGrayReleaseRuleDTO, operator); - } - /** * 更新分支灰度发布规则 (original openapi) * PUT /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/rules @@ -1286,14 +1270,6 @@ public ApiResponse updateBranchRulesWithHttpInfo(String appId, String env, return localVarApiClient.execute(localVarCall); } - /** - * 更新分支灰度发布规则 (original openapi) - * This overload preserves the Java client API from versions before 0.3.1. - */ - public ApiResponse updateBranchRulesWithHttpInfo(String appId, String env, String clusterName, String namespaceName, String branchName, String operator, OpenGrayReleaseRuleDTO openGrayReleaseRuleDTO) throws ApiException { - return updateBranchRulesWithHttpInfo(appId, env, clusterName, namespaceName, branchName, openGrayReleaseRuleDTO, operator); - } - /** * 更新分支灰度发布规则 (original openapi) (asynchronously) * PUT /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/rules @@ -1319,12 +1295,4 @@ public okhttp3.Call updateBranchRulesAsync(String appId, String env, String clus localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } - - /** - * 更新分支灰度发布规则 (original openapi) (asynchronously) - * This overload preserves the Java client API from versions before 0.3.1. - */ - public okhttp3.Call updateBranchRulesAsync(String appId, String env, String clusterName, String namespaceName, String branchName, String operator, OpenGrayReleaseRuleDTO openGrayReleaseRuleDTO, final ApiCallback _callback) throws ApiException { - return updateBranchRulesAsync(appId, env, clusterName, namespaceName, branchName, openGrayReleaseRuleDTO, operator, _callback); - } } diff --git a/java-client/src/main/java/org/openapitools/client/api/PortalManagementApi.java b/java-client/src/main/java/org/openapitools/client/api/PortalManagementApi.java index d5b97170..f6707979 100644 --- a/java-client/src/main/java/org/openapitools/client/api/PortalManagementApi.java +++ b/java-client/src/main/java/org/openapitools/client/api/PortalManagementApi.java @@ -27,9 +27,6 @@ import java.io.File; -import org.openapitools.client.model.OpenConsumerCreateRequestDTO; -import org.openapitools.client.model.OpenConsumerInfoDTO; -import org.openapitools.client.model.OpenConsumerTokenDTO; import java.lang.reflect.Type; import java.util.ArrayList; @@ -618,7 +615,7 @@ public okhttp3.Call checkSystemHealthAsync(String instanceId, final ApiCallback< } /** * Build call for createConsumer - * @param openConsumerCreateRequestDTO (required) + * @param body (required) * @param expires (optional) * @param _callback Callback for upload/download progress * @return Call to execute @@ -629,7 +626,7 @@ public okhttp3.Call checkSystemHealthAsync(String instanceId, final ApiCallback< 200 成功创建消费者 - */ - public okhttp3.Call createConsumerCall(OpenConsumerCreateRequestDTO openConsumerCreateRequestDTO, String expires, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createConsumerCall(Object body, String expires, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -643,7 +640,7 @@ public okhttp3.Call createConsumerCall(OpenConsumerCreateRequestDTO openConsumer basePath = null; } - Object localVarPostBody = openConsumerCreateRequestDTO; + Object localVarPostBody = body; // create path and map variables String localVarPath = "/openapi/v1/consumers"; @@ -679,22 +676,22 @@ public okhttp3.Call createConsumerCall(OpenConsumerCreateRequestDTO openConsumer } @SuppressWarnings("rawtypes") - private okhttp3.Call createConsumerValidateBeforeCall(OpenConsumerCreateRequestDTO openConsumerCreateRequestDTO, String expires, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'openConsumerCreateRequestDTO' is set - if (openConsumerCreateRequestDTO == null) { - throw new ApiException("Missing the required parameter 'openConsumerCreateRequestDTO' when calling createConsumer(Async)"); + private okhttp3.Call createConsumerValidateBeforeCall(Object body, String expires, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling createConsumer(Async)"); } - return createConsumerCall(openConsumerCreateRequestDTO, expires, _callback); + return createConsumerCall(body, expires, _callback); } /** * 创建开放平台消费者(new added) * POST /openapi/v1/consumers - * @param openConsumerCreateRequestDTO (required) + * @param body (required) * @param expires (optional) - * @return OpenConsumerInfoDTO + * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -702,17 +699,17 @@ private okhttp3.Call createConsumerValidateBeforeCall(OpenConsumerCreateRequestD
200 成功创建消费者 -
*/ - public OpenConsumerInfoDTO createConsumer(OpenConsumerCreateRequestDTO openConsumerCreateRequestDTO, String expires) throws ApiException { - ApiResponse localVarResp = createConsumerWithHttpInfo(openConsumerCreateRequestDTO, expires); + public Object createConsumer(Object body, String expires) throws ApiException { + ApiResponse localVarResp = createConsumerWithHttpInfo(body, expires); return localVarResp.getData(); } /** * 创建开放平台消费者(new added) * POST /openapi/v1/consumers - * @param openConsumerCreateRequestDTO (required) + * @param body (required) * @param expires (optional) - * @return ApiResponse<OpenConsumerInfoDTO> + * @return ApiResponse<Object> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -720,16 +717,16 @@ public OpenConsumerInfoDTO createConsumer(OpenConsumerCreateRequestDTO openConsu
200 成功创建消费者 -
*/ - public ApiResponse createConsumerWithHttpInfo(OpenConsumerCreateRequestDTO openConsumerCreateRequestDTO, String expires) throws ApiException { - okhttp3.Call localVarCall = createConsumerValidateBeforeCall(openConsumerCreateRequestDTO, expires, null); - Type localVarReturnType = new TypeToken(){}.getType(); + public ApiResponse createConsumerWithHttpInfo(Object body, String expires) throws ApiException { + okhttp3.Call localVarCall = createConsumerValidateBeforeCall(body, expires, null); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } /** * 创建开放平台消费者(new added) (asynchronously) * POST /openapi/v1/consumers - * @param openConsumerCreateRequestDTO (required) + * @param body (required) * @param expires (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call @@ -740,10 +737,10 @@ public ApiResponse createConsumerWithHttpInfo(OpenConsumerC 200 成功创建消费者 - */ - public okhttp3.Call createConsumerAsync(OpenConsumerCreateRequestDTO openConsumerCreateRequestDTO, String expires, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createConsumerAsync(Object body, String expires, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createConsumerValidateBeforeCall(openConsumerCreateRequestDTO, expires, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + okhttp3.Call localVarCall = createConsumerValidateBeforeCall(body, expires, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -3426,7 +3423,7 @@ private okhttp3.Call getConsumerListValidateBeforeCall(Integer page, Integer siz * GET /openapi/v1/consumers * @param page (optional, default to 0) * @param size (optional, default to 10) - * @return List<OpenConsumerInfoDTO> + * @return List<Object> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3434,8 +3431,8 @@ private okhttp3.Call getConsumerListValidateBeforeCall(Integer page, Integer siz
200 成功获取消费者列表 -
*/ - public List getConsumerList(Integer page, Integer size) throws ApiException { - ApiResponse> localVarResp = getConsumerListWithHttpInfo(page, size); + public List getConsumerList(Integer page, Integer size) throws ApiException { + ApiResponse> localVarResp = getConsumerListWithHttpInfo(page, size); return localVarResp.getData(); } @@ -3444,7 +3441,7 @@ public List getConsumerList(Integer page, Integer size) thr * GET /openapi/v1/consumers * @param page (optional, default to 0) * @param size (optional, default to 10) - * @return ApiResponse<List<OpenConsumerInfoDTO>> + * @return ApiResponse<List<Object>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3452,9 +3449,9 @@ public List getConsumerList(Integer page, Integer size) thr
200 成功获取消费者列表 -
*/ - public ApiResponse> getConsumerListWithHttpInfo(Integer page, Integer size) throws ApiException { + public ApiResponse> getConsumerListWithHttpInfo(Integer page, Integer size) throws ApiException { okhttp3.Call localVarCall = getConsumerListValidateBeforeCall(page, size, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -3472,10 +3469,10 @@ public ApiResponse> getConsumerListWithHttpInfo(Intege 200 成功获取消费者列表 - */ - public okhttp3.Call getConsumerListAsync(Integer page, Integer size, final ApiCallback> _callback) throws ApiException { + public okhttp3.Call getConsumerListAsync(Integer page, Integer size, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = getConsumerListValidateBeforeCall(page, size, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } @@ -3554,7 +3551,7 @@ private okhttp3.Call getConsumerTokenByAppIdValidateBeforeCall(String appId, fin * 按应用ID查询消费者Token(new added) * GET /openapi/v1/consumer-tokens/by-appId * @param appId (required) - * @return OpenConsumerTokenDTO + * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3562,8 +3559,8 @@ private okhttp3.Call getConsumerTokenByAppIdValidateBeforeCall(String appId, fin
200 成功获取消费者Token -
*/ - public OpenConsumerTokenDTO getConsumerTokenByAppId(String appId) throws ApiException { - ApiResponse localVarResp = getConsumerTokenByAppIdWithHttpInfo(appId); + public Object getConsumerTokenByAppId(String appId) throws ApiException { + ApiResponse localVarResp = getConsumerTokenByAppIdWithHttpInfo(appId); return localVarResp.getData(); } @@ -3571,7 +3568,7 @@ public OpenConsumerTokenDTO getConsumerTokenByAppId(String appId) throws ApiExce * 按应用ID查询消费者Token(new added) * GET /openapi/v1/consumer-tokens/by-appId * @param appId (required) - * @return ApiResponse<OpenConsumerTokenDTO> + * @return ApiResponse<Object> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -3579,9 +3576,9 @@ public OpenConsumerTokenDTO getConsumerTokenByAppId(String appId) throws ApiExce
200 成功获取消费者Token -
*/ - public ApiResponse getConsumerTokenByAppIdWithHttpInfo(String appId) throws ApiException { + public ApiResponse getConsumerTokenByAppIdWithHttpInfo(String appId) throws ApiException { okhttp3.Call localVarCall = getConsumerTokenByAppIdValidateBeforeCall(appId, null); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -3598,10 +3595,10 @@ public ApiResponse getConsumerTokenByAppIdWithHttpInfo(Str 200 成功获取消费者Token - */ - public okhttp3.Call getConsumerTokenByAppIdAsync(String appId, final ApiCallback _callback) throws ApiException { + public okhttp3.Call getConsumerTokenByAppIdAsync(String appId, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = getConsumerTokenByAppIdValidateBeforeCall(appId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); + Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/java-client/src/main/java/org/openapitools/client/api/ReleaseManagementApi.java b/java-client/src/main/java/org/openapitools/client/api/ReleaseManagementApi.java index c9e17941..2a1ef8c2 100644 --- a/java-client/src/main/java/org/openapitools/client/api/ReleaseManagementApi.java +++ b/java-client/src/main/java/org/openapitools/client/api/ReleaseManagementApi.java @@ -1004,14 +1004,6 @@ public okhttp3.Call getReleaseByIdCall(String env, Long releaseId, final ApiCall return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } - /** - * Build call for getReleaseById. - * This overload preserves the Java client API from versions before 0.3.2. - */ - public okhttp3.Call getReleaseByIdCall(String env, Integer releaseId, final ApiCallback _callback) throws ApiException { - return getReleaseByIdCall(env, releaseId == null ? null : releaseId.longValue(), _callback); - } - @SuppressWarnings("rawtypes") private okhttp3.Call getReleaseByIdValidateBeforeCall(String env, Long releaseId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'env' is set @@ -1046,14 +1038,6 @@ public OpenReleaseDTO getReleaseById(String env, Long releaseId) throws ApiExcep return localVarResp.getData(); } - /** - * 获取发布详情 (new added) - * This overload preserves the Java client API from versions before 0.3.2. - */ - public OpenReleaseDTO getReleaseById(String env, Integer releaseId) throws ApiException { - return getReleaseById(env, releaseId == null ? null : releaseId.longValue()); - } - /** * 获取发布详情 (new added) * GET /openapi/v1/envs/{env}/releases/{releaseId} @@ -1073,14 +1057,6 @@ public ApiResponse getReleaseByIdWithHttpInfo(String env, Long r return localVarApiClient.execute(localVarCall, localVarReturnType); } - /** - * 获取发布详情 (new added) - * This overload preserves the Java client API from versions before 0.3.2. - */ - public ApiResponse getReleaseByIdWithHttpInfo(String env, Integer releaseId) throws ApiException { - return getReleaseByIdWithHttpInfo(env, releaseId == null ? null : releaseId.longValue()); - } - /** * 获取发布详情 (new added) (asynchronously) * GET /openapi/v1/envs/{env}/releases/{releaseId} @@ -1102,14 +1078,6 @@ public okhttp3.Call getReleaseByIdAsync(String env, Long releaseId, final ApiCal localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - - /** - * 获取发布详情 (new added) (asynchronously) - * This overload preserves the Java client API from versions before 0.3.2. - */ - public okhttp3.Call getReleaseByIdAsync(String env, Integer releaseId, final ApiCallback _callback) throws ApiException { - return getReleaseByIdAsync(env, releaseId == null ? null : releaseId.longValue(), _callback); - } /** * Build call for loadLatestActiveRelease * @param appId 应用ID (required) @@ -1335,14 +1303,6 @@ public okhttp3.Call rollbackCall(String env, Long releaseId, String operator, Lo return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); } - /** - * Build call for rollback. - * This overload preserves the Java client API from versions before 0.3.1. - */ - public okhttp3.Call rollbackCall(String env, Long releaseId, String operator, final ApiCallback _callback) throws ApiException { - return rollbackCall(env, releaseId, operator, null, _callback); - } - @SuppressWarnings("rawtypes") private okhttp3.Call rollbackValidateBeforeCall(String env, Long releaseId, String operator, Long toReleaseId, final ApiCallback _callback) throws ApiException { // verify the required parameter 'env' is set @@ -1377,14 +1337,6 @@ public void rollback(String env, Long releaseId, String operator, Long toRelease rollbackWithHttpInfo(env, releaseId, operator, toReleaseId); } - /** - * 回滚发布 (original openapi) - * This overload preserves the Java client API from versions before 0.3.1. - */ - public void rollback(String env, Long releaseId, String operator) throws ApiException { - rollback(env, releaseId, operator, null); - } - /** * 回滚发布 (original openapi) * 回滚到指定的发布版本 @@ -1405,14 +1357,6 @@ public ApiResponse rollbackWithHttpInfo(String env, Long releaseId, String return localVarApiClient.execute(localVarCall); } - /** - * 回滚发布 (original openapi) - * This overload preserves the Java client API from versions before 0.3.1. - */ - public ApiResponse rollbackWithHttpInfo(String env, Long releaseId, String operator) throws ApiException { - return rollbackWithHttpInfo(env, releaseId, operator, null); - } - /** * 回滚发布 (original openapi) (asynchronously) * 回滚到指定的发布版本 @@ -1435,12 +1379,4 @@ public okhttp3.Call rollbackAsync(String env, Long releaseId, String operator, L localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } - - /** - * 回滚发布 (original openapi) (asynchronously) - * This overload preserves the Java client API from versions before 0.3.1. - */ - public okhttp3.Call rollbackAsync(String env, Long releaseId, String operator, final ApiCallback _callback) throws ApiException { - return rollbackAsync(env, releaseId, operator, null, _callback); - } } diff --git a/java-client/src/main/java/org/openapitools/client/model/OpenConsumerCreateRequestDTO.java b/java-client/src/main/java/org/openapitools/client/model/OpenConsumerCreateRequestDTO.java deleted file mode 100644 index 2eb1dfae..00000000 --- a/java-client/src/main/java/org/openapitools/client/model/OpenConsumerCreateRequestDTO.java +++ /dev/null @@ -1,455 +0,0 @@ -/* - * Apollo OpenAPI - *

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
- * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * OpenConsumerCreateRequestDTO - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class OpenConsumerCreateRequestDTO { - public static final String SERIALIZED_NAME_APP_ID = "appId"; - @SerializedName(SERIALIZED_NAME_APP_ID) - private String appId; - - public static final String SERIALIZED_NAME_ALLOW_CREATE_APPLICATION = "allowCreateApplication"; - @SerializedName(SERIALIZED_NAME_ALLOW_CREATE_APPLICATION) - private Boolean allowCreateApplication = false; - - public static final String SERIALIZED_NAME_ALLOW_MANAGE_USERS = "allowManageUsers"; - @SerializedName(SERIALIZED_NAME_ALLOW_MANAGE_USERS) - private Boolean allowManageUsers = false; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ORG_ID = "orgId"; - @SerializedName(SERIALIZED_NAME_ORG_ID) - private String orgId; - - public static final String SERIALIZED_NAME_ORG_NAME = "orgName"; - @SerializedName(SERIALIZED_NAME_ORG_NAME) - private String orgName; - - public static final String SERIALIZED_NAME_OWNER_NAME = "ownerName"; - @SerializedName(SERIALIZED_NAME_OWNER_NAME) - private String ownerName; - - public static final String SERIALIZED_NAME_RATE_LIMIT_ENABLED = "rateLimitEnabled"; - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_ENABLED) - private Boolean rateLimitEnabled = false; - - public static final String SERIALIZED_NAME_RATE_LIMIT = "rateLimit"; - @SerializedName(SERIALIZED_NAME_RATE_LIMIT) - private Integer rateLimit; - - public OpenConsumerCreateRequestDTO() { - } - - public OpenConsumerCreateRequestDTO appId(String appId) { - - this.appId = appId; - return this; - } - - /** - * 第三方应用ID - * @return appId - **/ - @javax.annotation.Nonnull - public String getAppId() { - return appId; - } - - - public void setAppId(String appId) { - this.appId = appId; - } - - - public OpenConsumerCreateRequestDTO allowCreateApplication(Boolean allowCreateApplication) { - - this.allowCreateApplication = allowCreateApplication; - return this; - } - - /** - * 是否允许该Consumer Token创建应用 - * @return allowCreateApplication - **/ - @javax.annotation.Nullable - public Boolean getAllowCreateApplication() { - return allowCreateApplication; - } - - - public void setAllowCreateApplication(Boolean allowCreateApplication) { - this.allowCreateApplication = allowCreateApplication; - } - - - public OpenConsumerCreateRequestDTO allowManageUsers(Boolean allowManageUsers) { - - this.allowManageUsers = allowManageUsers; - return this; - } - - /** - * 是否允许该Consumer Token管理用户 - * @return allowManageUsers - **/ - @javax.annotation.Nullable - public Boolean getAllowManageUsers() { - return allowManageUsers; - } - - - public void setAllowManageUsers(Boolean allowManageUsers) { - this.allowManageUsers = allowManageUsers; - } - - - public OpenConsumerCreateRequestDTO name(String name) { - - this.name = name; - return this; - } - - /** - * 第三方应用名称 - * @return name - **/ - @javax.annotation.Nonnull - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public OpenConsumerCreateRequestDTO orgId(String orgId) { - - this.orgId = orgId; - return this; - } - - /** - * 部门ID - * @return orgId - **/ - @javax.annotation.Nonnull - public String getOrgId() { - return orgId; - } - - - public void setOrgId(String orgId) { - this.orgId = orgId; - } - - - public OpenConsumerCreateRequestDTO orgName(String orgName) { - - this.orgName = orgName; - return this; - } - - /** - * 部门名称 - * @return orgName - **/ - @javax.annotation.Nullable - public String getOrgName() { - return orgName; - } - - - public void setOrgName(String orgName) { - this.orgName = orgName; - } - - - public OpenConsumerCreateRequestDTO ownerName(String ownerName) { - - this.ownerName = ownerName; - return this; - } - - /** - * 负责人用户名 - * @return ownerName - **/ - @javax.annotation.Nonnull - public String getOwnerName() { - return ownerName; - } - - - public void setOwnerName(String ownerName) { - this.ownerName = ownerName; - } - - - public OpenConsumerCreateRequestDTO rateLimitEnabled(Boolean rateLimitEnabled) { - - this.rateLimitEnabled = rateLimitEnabled; - return this; - } - - /** - * 是否开启限流 - * @return rateLimitEnabled - **/ - @javax.annotation.Nullable - public Boolean getRateLimitEnabled() { - return rateLimitEnabled; - } - - - public void setRateLimitEnabled(Boolean rateLimitEnabled) { - this.rateLimitEnabled = rateLimitEnabled; - } - - - public OpenConsumerCreateRequestDTO rateLimit(Integer rateLimit) { - - this.rateLimit = rateLimit; - return this; - } - - /** - * 限流QPS,rateLimitEnabled 为 true 时必须大于 0;未开启限流时 0 表示不限流 - * minimum: 0 - * @return rateLimit - **/ - @javax.annotation.Nullable - public Integer getRateLimit() { - return rateLimit; - } - - - public void setRateLimit(Integer rateLimit) { - this.rateLimit = rateLimit; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OpenConsumerCreateRequestDTO openConsumerCreateRequestDTO = (OpenConsumerCreateRequestDTO) o; - return Objects.equals(this.appId, openConsumerCreateRequestDTO.appId) && - Objects.equals(this.allowCreateApplication, openConsumerCreateRequestDTO.allowCreateApplication) && - Objects.equals(this.allowManageUsers, openConsumerCreateRequestDTO.allowManageUsers) && - Objects.equals(this.name, openConsumerCreateRequestDTO.name) && - Objects.equals(this.orgId, openConsumerCreateRequestDTO.orgId) && - Objects.equals(this.orgName, openConsumerCreateRequestDTO.orgName) && - Objects.equals(this.ownerName, openConsumerCreateRequestDTO.ownerName) && - Objects.equals(this.rateLimitEnabled, openConsumerCreateRequestDTO.rateLimitEnabled) && - Objects.equals(this.rateLimit, openConsumerCreateRequestDTO.rateLimit); - } - - @Override - public int hashCode() { - return Objects.hash(appId, allowCreateApplication, allowManageUsers, name, orgId, orgName, ownerName, rateLimitEnabled, rateLimit); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OpenConsumerCreateRequestDTO {\n"); - sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); - sb.append(" allowCreateApplication: ").append(toIndentedString(allowCreateApplication)).append("\n"); - sb.append(" allowManageUsers: ").append(toIndentedString(allowManageUsers)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); - sb.append(" orgName: ").append(toIndentedString(orgName)).append("\n"); - sb.append(" ownerName: ").append(toIndentedString(ownerName)).append("\n"); - sb.append(" rateLimitEnabled: ").append(toIndentedString(rateLimitEnabled)).append("\n"); - sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("appId"); - openapiFields.add("allowCreateApplication"); - openapiFields.add("allowManageUsers"); - openapiFields.add("name"); - openapiFields.add("orgId"); - openapiFields.add("orgName"); - openapiFields.add("ownerName"); - openapiFields.add("rateLimitEnabled"); - openapiFields.add("rateLimit"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - openapiRequiredFields.add("appId"); - openapiRequiredFields.add("name"); - openapiRequiredFields.add("orgId"); - openapiRequiredFields.add("ownerName"); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to OpenConsumerCreateRequestDTO - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!OpenConsumerCreateRequestDTO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in OpenConsumerCreateRequestDTO is not found in the empty JSON string", OpenConsumerCreateRequestDTO.openapiRequiredFields.toString())); - } - return; - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!OpenConsumerCreateRequestDTO.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenConsumerCreateRequestDTO` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : OpenConsumerCreateRequestDTO.openapiRequiredFields) { - if (jsonObj.get(requiredField) == null) { - throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); - } - } - if (!jsonObj.get("appId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `appId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appId").toString())); - } - if (!jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if (!jsonObj.get("orgId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orgId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orgId").toString())); - } - if ((jsonObj.get("orgName") != null && !jsonObj.get("orgName").isJsonNull()) && !jsonObj.get("orgName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orgName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orgName").toString())); - } - if (!jsonObj.get("ownerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OpenConsumerCreateRequestDTO.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OpenConsumerCreateRequestDTO' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(OpenConsumerCreateRequestDTO.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, OpenConsumerCreateRequestDTO value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OpenConsumerCreateRequestDTO read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of OpenConsumerCreateRequestDTO given an JSON string - * - * @param jsonString JSON string - * @return An instance of OpenConsumerCreateRequestDTO - * @throws IOException if the JSON string is invalid with respect to OpenConsumerCreateRequestDTO - */ - public static OpenConsumerCreateRequestDTO fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OpenConsumerCreateRequestDTO.class); - } - - /** - * Convert an instance of OpenConsumerCreateRequestDTO to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/java-client/src/main/java/org/openapitools/client/model/OpenConsumerInfoDTO.java b/java-client/src/main/java/org/openapitools/client/model/OpenConsumerInfoDTO.java deleted file mode 100644 index 64ec748e..00000000 --- a/java-client/src/main/java/org/openapitools/client/model/OpenConsumerInfoDTO.java +++ /dev/null @@ -1,534 +0,0 @@ -/* - * Apollo OpenAPI - *

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
- * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * OpenConsumerInfoDTO - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class OpenConsumerInfoDTO { - public static final String SERIALIZED_NAME_APP_ID = "appId"; - @SerializedName(SERIALIZED_NAME_APP_ID) - private String appId; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_ORG_ID = "orgId"; - @SerializedName(SERIALIZED_NAME_ORG_ID) - private String orgId; - - public static final String SERIALIZED_NAME_ORG_NAME = "orgName"; - @SerializedName(SERIALIZED_NAME_ORG_NAME) - private String orgName; - - public static final String SERIALIZED_NAME_OWNER_NAME = "ownerName"; - @SerializedName(SERIALIZED_NAME_OWNER_NAME) - private String ownerName; - - public static final String SERIALIZED_NAME_OWNER_EMAIL = "ownerEmail"; - @SerializedName(SERIALIZED_NAME_OWNER_EMAIL) - private String ownerEmail; - - public static final String SERIALIZED_NAME_CONSUMER_ID = "consumerId"; - @SerializedName(SERIALIZED_NAME_CONSUMER_ID) - private Long consumerId; - - public static final String SERIALIZED_NAME_TOKEN = "token"; - @SerializedName(SERIALIZED_NAME_TOKEN) - private String token; - - public static final String SERIALIZED_NAME_ALLOW_CREATE_APPLICATION = "allowCreateApplication"; - @SerializedName(SERIALIZED_NAME_ALLOW_CREATE_APPLICATION) - private Boolean allowCreateApplication = false; - - public static final String SERIALIZED_NAME_ALLOW_MANAGE_USERS = "allowManageUsers"; - @SerializedName(SERIALIZED_NAME_ALLOW_MANAGE_USERS) - private Boolean allowManageUsers = false; - - public static final String SERIALIZED_NAME_RATE_LIMIT = "rateLimit"; - @SerializedName(SERIALIZED_NAME_RATE_LIMIT) - private Integer rateLimit = 0; - - public static final String SERIALIZED_NAME_RATE_LIMIT_ENABLED = "rateLimitEnabled"; - @SerializedName(SERIALIZED_NAME_RATE_LIMIT_ENABLED) - private Boolean rateLimitEnabled = false; - - public OpenConsumerInfoDTO() { - } - - public OpenConsumerInfoDTO appId(String appId) { - - this.appId = appId; - return this; - } - - /** - * 第三方应用ID - * @return appId - **/ - @javax.annotation.Nullable - public String getAppId() { - return appId; - } - - - public void setAppId(String appId) { - this.appId = appId; - } - - - public OpenConsumerInfoDTO name(String name) { - - this.name = name; - return this; - } - - /** - * 第三方应用名称 - * @return name - **/ - @javax.annotation.Nullable - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public OpenConsumerInfoDTO orgId(String orgId) { - - this.orgId = orgId; - return this; - } - - /** - * 部门ID - * @return orgId - **/ - @javax.annotation.Nullable - public String getOrgId() { - return orgId; - } - - - public void setOrgId(String orgId) { - this.orgId = orgId; - } - - - public OpenConsumerInfoDTO orgName(String orgName) { - - this.orgName = orgName; - return this; - } - - /** - * 部门名称 - * @return orgName - **/ - @javax.annotation.Nullable - public String getOrgName() { - return orgName; - } - - - public void setOrgName(String orgName) { - this.orgName = orgName; - } - - - public OpenConsumerInfoDTO ownerName(String ownerName) { - - this.ownerName = ownerName; - return this; - } - - /** - * 负责人用户名 - * @return ownerName - **/ - @javax.annotation.Nullable - public String getOwnerName() { - return ownerName; - } - - - public void setOwnerName(String ownerName) { - this.ownerName = ownerName; - } - - - public OpenConsumerInfoDTO ownerEmail(String ownerEmail) { - - this.ownerEmail = ownerEmail; - return this; - } - - /** - * 负责人邮箱 - * @return ownerEmail - **/ - @javax.annotation.Nullable - public String getOwnerEmail() { - return ownerEmail; - } - - - public void setOwnerEmail(String ownerEmail) { - this.ownerEmail = ownerEmail; - } - - - public OpenConsumerInfoDTO consumerId(Long consumerId) { - - this.consumerId = consumerId; - return this; - } - - /** - * Consumer ID - * @return consumerId - **/ - @javax.annotation.Nullable - public Long getConsumerId() { - return consumerId; - } - - - public void setConsumerId(Long consumerId) { - this.consumerId = consumerId; - } - - - public OpenConsumerInfoDTO token(String token) { - - this.token = token; - return this; - } - - /** - * Consumer Token,仅在创建或按应用查询详情时返回 - * @return token - **/ - @javax.annotation.Nullable - public String getToken() { - return token; - } - - - public void setToken(String token) { - this.token = token; - } - - - public OpenConsumerInfoDTO allowCreateApplication(Boolean allowCreateApplication) { - - this.allowCreateApplication = allowCreateApplication; - return this; - } - - /** - * 是否允许该Consumer Token创建应用 - * @return allowCreateApplication - **/ - @javax.annotation.Nullable - public Boolean getAllowCreateApplication() { - return allowCreateApplication; - } - - - public void setAllowCreateApplication(Boolean allowCreateApplication) { - this.allowCreateApplication = allowCreateApplication; - } - - - public OpenConsumerInfoDTO allowManageUsers(Boolean allowManageUsers) { - - this.allowManageUsers = allowManageUsers; - return this; - } - - /** - * 是否允许该Consumer Token管理用户 - * @return allowManageUsers - **/ - @javax.annotation.Nullable - public Boolean getAllowManageUsers() { - return allowManageUsers; - } - - - public void setAllowManageUsers(Boolean allowManageUsers) { - this.allowManageUsers = allowManageUsers; - } - - - public OpenConsumerInfoDTO rateLimit(Integer rateLimit) { - - this.rateLimit = rateLimit; - return this; - } - - /** - * 限流QPS,0表示不限流 - * minimum: 0 - * @return rateLimit - **/ - @javax.annotation.Nullable - public Integer getRateLimit() { - return rateLimit; - } - - - public void setRateLimit(Integer rateLimit) { - this.rateLimit = rateLimit; - } - - - public OpenConsumerInfoDTO rateLimitEnabled(Boolean rateLimitEnabled) { - - this.rateLimitEnabled = rateLimitEnabled; - return this; - } - - /** - * 是否开启限流 - * @return rateLimitEnabled - **/ - @javax.annotation.Nullable - public Boolean getRateLimitEnabled() { - return rateLimitEnabled; - } - - - public void setRateLimitEnabled(Boolean rateLimitEnabled) { - this.rateLimitEnabled = rateLimitEnabled; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OpenConsumerInfoDTO openConsumerInfoDTO = (OpenConsumerInfoDTO) o; - return Objects.equals(this.appId, openConsumerInfoDTO.appId) && - Objects.equals(this.name, openConsumerInfoDTO.name) && - Objects.equals(this.orgId, openConsumerInfoDTO.orgId) && - Objects.equals(this.orgName, openConsumerInfoDTO.orgName) && - Objects.equals(this.ownerName, openConsumerInfoDTO.ownerName) && - Objects.equals(this.ownerEmail, openConsumerInfoDTO.ownerEmail) && - Objects.equals(this.consumerId, openConsumerInfoDTO.consumerId) && - Objects.equals(this.token, openConsumerInfoDTO.token) && - Objects.equals(this.allowCreateApplication, openConsumerInfoDTO.allowCreateApplication) && - Objects.equals(this.allowManageUsers, openConsumerInfoDTO.allowManageUsers) && - Objects.equals(this.rateLimit, openConsumerInfoDTO.rateLimit) && - Objects.equals(this.rateLimitEnabled, openConsumerInfoDTO.rateLimitEnabled); - } - - @Override - public int hashCode() { - return Objects.hash(appId, name, orgId, orgName, ownerName, ownerEmail, consumerId, token, allowCreateApplication, allowManageUsers, rateLimit, rateLimitEnabled); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OpenConsumerInfoDTO {\n"); - sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); - sb.append(" orgName: ").append(toIndentedString(orgName)).append("\n"); - sb.append(" ownerName: ").append(toIndentedString(ownerName)).append("\n"); - sb.append(" ownerEmail: ").append(toIndentedString(ownerEmail)).append("\n"); - sb.append(" consumerId: ").append(toIndentedString(consumerId)).append("\n"); - sb.append(" token: ").append(token == null ? "null" : "***redacted***").append("\n"); - sb.append(" allowCreateApplication: ").append(toIndentedString(allowCreateApplication)).append("\n"); - sb.append(" allowManageUsers: ").append(toIndentedString(allowManageUsers)).append("\n"); - sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); - sb.append(" rateLimitEnabled: ").append(toIndentedString(rateLimitEnabled)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("appId"); - openapiFields.add("name"); - openapiFields.add("orgId"); - openapiFields.add("orgName"); - openapiFields.add("ownerName"); - openapiFields.add("ownerEmail"); - openapiFields.add("consumerId"); - openapiFields.add("token"); - openapiFields.add("allowCreateApplication"); - openapiFields.add("allowManageUsers"); - openapiFields.add("rateLimit"); - openapiFields.add("rateLimitEnabled"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to OpenConsumerInfoDTO - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!OpenConsumerInfoDTO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in OpenConsumerInfoDTO is not found in the empty JSON string", OpenConsumerInfoDTO.openapiRequiredFields.toString())); - } - return; - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!OpenConsumerInfoDTO.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenConsumerInfoDTO` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("appId") != null && !jsonObj.get("appId").isJsonNull()) && !jsonObj.get("appId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `appId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appId").toString())); - } - if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !jsonObj.get("name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); - } - if ((jsonObj.get("orgId") != null && !jsonObj.get("orgId").isJsonNull()) && !jsonObj.get("orgId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orgId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orgId").toString())); - } - if ((jsonObj.get("orgName") != null && !jsonObj.get("orgName").isJsonNull()) && !jsonObj.get("orgName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orgName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orgName").toString())); - } - if ((jsonObj.get("ownerName") != null && !jsonObj.get("ownerName").isJsonNull()) && !jsonObj.get("ownerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); - } - if ((jsonObj.get("ownerEmail") != null && !jsonObj.get("ownerEmail").isJsonNull()) && !jsonObj.get("ownerEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerEmail").toString())); - } - if ((jsonObj.get("token") != null && !jsonObj.get("token").isJsonNull()) && !jsonObj.get("token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OpenConsumerInfoDTO.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OpenConsumerInfoDTO' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(OpenConsumerInfoDTO.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, OpenConsumerInfoDTO value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OpenConsumerInfoDTO read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of OpenConsumerInfoDTO given an JSON string - * - * @param jsonString JSON string - * @return An instance of OpenConsumerInfoDTO - * @throws IOException if the JSON string is invalid with respect to OpenConsumerInfoDTO - */ - public static OpenConsumerInfoDTO fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OpenConsumerInfoDTO.class); - } - - /** - * Convert an instance of OpenConsumerInfoDTO to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/java-client/src/main/java/org/openapitools/client/model/OpenConsumerTokenDTO.java b/java-client/src/main/java/org/openapitools/client/model/OpenConsumerTokenDTO.java deleted file mode 100644 index 75e56d78..00000000 --- a/java-client/src/main/java/org/openapitools/client/model/OpenConsumerTokenDTO.java +++ /dev/null @@ -1,411 +0,0 @@ -/* - * Apollo OpenAPI - *

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
- * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonDeserializationContext; -import com.google.gson.JsonDeserializer; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapterFactory; -import com.google.gson.reflect.TypeToken; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; - -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.openapitools.client.JSON; - -/** - * OpenConsumerTokenDTO - */ -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class OpenConsumerTokenDTO { - public static final String SERIALIZED_NAME_CONSUMER_ID = "consumerId"; - @SerializedName(SERIALIZED_NAME_CONSUMER_ID) - private Long consumerId; - - public static final String SERIALIZED_NAME_TOKEN = "token"; - @SerializedName(SERIALIZED_NAME_TOKEN) - private String token; - - public static final String SERIALIZED_NAME_RATE_LIMIT = "rateLimit"; - @SerializedName(SERIALIZED_NAME_RATE_LIMIT) - private Integer rateLimit = 0; - - public static final String SERIALIZED_NAME_EXPIRES = "expires"; - @SerializedName(SERIALIZED_NAME_EXPIRES) - private OffsetDateTime expires; - - public static final String SERIALIZED_NAME_DATA_CHANGE_CREATED_BY = "dataChangeCreatedBy"; - @SerializedName(SERIALIZED_NAME_DATA_CHANGE_CREATED_BY) - private String dataChangeCreatedBy; - - public static final String SERIALIZED_NAME_DATA_CHANGE_CREATED_TIME = "dataChangeCreatedTime"; - @SerializedName(SERIALIZED_NAME_DATA_CHANGE_CREATED_TIME) - private OffsetDateTime dataChangeCreatedTime; - - public static final String SERIALIZED_NAME_DATA_CHANGE_LAST_MODIFIED_BY = "dataChangeLastModifiedBy"; - @SerializedName(SERIALIZED_NAME_DATA_CHANGE_LAST_MODIFIED_BY) - private String dataChangeLastModifiedBy; - - public static final String SERIALIZED_NAME_DATA_CHANGE_LAST_MODIFIED_TIME = "dataChangeLastModifiedTime"; - @SerializedName(SERIALIZED_NAME_DATA_CHANGE_LAST_MODIFIED_TIME) - private OffsetDateTime dataChangeLastModifiedTime; - - public OpenConsumerTokenDTO() { - } - - public OpenConsumerTokenDTO consumerId(Long consumerId) { - - this.consumerId = consumerId; - return this; - } - - /** - * Consumer ID - * @return consumerId - **/ - @javax.annotation.Nullable - public Long getConsumerId() { - return consumerId; - } - - - public void setConsumerId(Long consumerId) { - this.consumerId = consumerId; - } - - - public OpenConsumerTokenDTO token(String token) { - - this.token = token; - return this; - } - - /** - * Consumer Token - * @return token - **/ - @javax.annotation.Nullable - public String getToken() { - return token; - } - - - public void setToken(String token) { - this.token = token; - } - - - public OpenConsumerTokenDTO rateLimit(Integer rateLimit) { - - this.rateLimit = rateLimit; - return this; - } - - /** - * 限流QPS,0表示不限流 - * minimum: 0 - * @return rateLimit - **/ - @javax.annotation.Nullable - public Integer getRateLimit() { - return rateLimit; - } - - - public void setRateLimit(Integer rateLimit) { - this.rateLimit = rateLimit; - } - - - public OpenConsumerTokenDTO expires(OffsetDateTime expires) { - - this.expires = expires; - return this; - } - - /** - * 过期时间 - * @return expires - **/ - @javax.annotation.Nullable - public OffsetDateTime getExpires() { - return expires; - } - - - public void setExpires(OffsetDateTime expires) { - this.expires = expires; - } - - - public OpenConsumerTokenDTO dataChangeCreatedBy(String dataChangeCreatedBy) { - - this.dataChangeCreatedBy = dataChangeCreatedBy; - return this; - } - - /** - * 创建人 - * @return dataChangeCreatedBy - **/ - @javax.annotation.Nullable - public String getDataChangeCreatedBy() { - return dataChangeCreatedBy; - } - - - public void setDataChangeCreatedBy(String dataChangeCreatedBy) { - this.dataChangeCreatedBy = dataChangeCreatedBy; - } - - - public OpenConsumerTokenDTO dataChangeCreatedTime(OffsetDateTime dataChangeCreatedTime) { - - this.dataChangeCreatedTime = dataChangeCreatedTime; - return this; - } - - /** - * 创建时间 - * @return dataChangeCreatedTime - **/ - @javax.annotation.Nullable - public OffsetDateTime getDataChangeCreatedTime() { - return dataChangeCreatedTime; - } - - - public void setDataChangeCreatedTime(OffsetDateTime dataChangeCreatedTime) { - this.dataChangeCreatedTime = dataChangeCreatedTime; - } - - - public OpenConsumerTokenDTO dataChangeLastModifiedBy(String dataChangeLastModifiedBy) { - - this.dataChangeLastModifiedBy = dataChangeLastModifiedBy; - return this; - } - - /** - * 最后修改人 - * @return dataChangeLastModifiedBy - **/ - @javax.annotation.Nullable - public String getDataChangeLastModifiedBy() { - return dataChangeLastModifiedBy; - } - - - public void setDataChangeLastModifiedBy(String dataChangeLastModifiedBy) { - this.dataChangeLastModifiedBy = dataChangeLastModifiedBy; - } - - - public OpenConsumerTokenDTO dataChangeLastModifiedTime(OffsetDateTime dataChangeLastModifiedTime) { - - this.dataChangeLastModifiedTime = dataChangeLastModifiedTime; - return this; - } - - /** - * 最后修改时间 - * @return dataChangeLastModifiedTime - **/ - @javax.annotation.Nullable - public OffsetDateTime getDataChangeLastModifiedTime() { - return dataChangeLastModifiedTime; - } - - - public void setDataChangeLastModifiedTime(OffsetDateTime dataChangeLastModifiedTime) { - this.dataChangeLastModifiedTime = dataChangeLastModifiedTime; - } - - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OpenConsumerTokenDTO openConsumerTokenDTO = (OpenConsumerTokenDTO) o; - return Objects.equals(this.consumerId, openConsumerTokenDTO.consumerId) && - Objects.equals(this.token, openConsumerTokenDTO.token) && - Objects.equals(this.rateLimit, openConsumerTokenDTO.rateLimit) && - Objects.equals(this.expires, openConsumerTokenDTO.expires) && - Objects.equals(this.dataChangeCreatedBy, openConsumerTokenDTO.dataChangeCreatedBy) && - Objects.equals(this.dataChangeCreatedTime, openConsumerTokenDTO.dataChangeCreatedTime) && - Objects.equals(this.dataChangeLastModifiedBy, openConsumerTokenDTO.dataChangeLastModifiedBy) && - Objects.equals(this.dataChangeLastModifiedTime, openConsumerTokenDTO.dataChangeLastModifiedTime); - } - - @Override - public int hashCode() { - return Objects.hash(consumerId, token, rateLimit, expires, dataChangeCreatedBy, dataChangeCreatedTime, dataChangeLastModifiedBy, dataChangeLastModifiedTime); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OpenConsumerTokenDTO {\n"); - sb.append(" consumerId: ").append(toIndentedString(consumerId)).append("\n"); - sb.append(" token: ").append(token == null ? "null" : "***redacted***").append("\n"); - sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); - sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); - sb.append(" dataChangeCreatedBy: ").append(toIndentedString(dataChangeCreatedBy)).append("\n"); - sb.append(" dataChangeCreatedTime: ").append(toIndentedString(dataChangeCreatedTime)).append("\n"); - sb.append(" dataChangeLastModifiedBy: ").append(toIndentedString(dataChangeLastModifiedBy)).append("\n"); - sb.append(" dataChangeLastModifiedTime: ").append(toIndentedString(dataChangeLastModifiedTime)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public static HashSet openapiFields; - public static HashSet openapiRequiredFields; - - static { - // a set of all properties/fields (JSON key names) - openapiFields = new HashSet(); - openapiFields.add("consumerId"); - openapiFields.add("token"); - openapiFields.add("rateLimit"); - openapiFields.add("expires"); - openapiFields.add("dataChangeCreatedBy"); - openapiFields.add("dataChangeCreatedTime"); - openapiFields.add("dataChangeLastModifiedBy"); - openapiFields.add("dataChangeLastModifiedTime"); - - // a set of required properties/fields (JSON key names) - openapiRequiredFields = new HashSet(); - } - - /** - * Validates the JSON Object and throws an exception if issues found - * - * @param jsonObj JSON Object - * @throws IOException if the JSON Object is invalid with respect to OpenConsumerTokenDTO - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (!OpenConsumerTokenDTO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in OpenConsumerTokenDTO is not found in the empty JSON string", OpenConsumerTokenDTO.openapiRequiredFields.toString())); - } - return; - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!OpenConsumerTokenDTO.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenConsumerTokenDTO` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - if ((jsonObj.get("token") != null && !jsonObj.get("token").isJsonNull()) && !jsonObj.get("token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); - } - if ((jsonObj.get("dataChangeCreatedBy") != null && !jsonObj.get("dataChangeCreatedBy").isJsonNull()) && !jsonObj.get("dataChangeCreatedBy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dataChangeCreatedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dataChangeCreatedBy").toString())); - } - if ((jsonObj.get("dataChangeLastModifiedBy") != null && !jsonObj.get("dataChangeLastModifiedBy").isJsonNull()) && !jsonObj.get("dataChangeLastModifiedBy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dataChangeLastModifiedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dataChangeLastModifiedBy").toString())); - } - } - - public static class CustomTypeAdapterFactory implements TypeAdapterFactory { - @SuppressWarnings("unchecked") - @Override - public TypeAdapter create(Gson gson, TypeToken type) { - if (!OpenConsumerTokenDTO.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OpenConsumerTokenDTO' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(OpenConsumerTokenDTO.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, OpenConsumerTokenDTO value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public OpenConsumerTokenDTO read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of OpenConsumerTokenDTO given an JSON string - * - * @param jsonString JSON string - * @return An instance of OpenConsumerTokenDTO - * @throws IOException if the JSON string is invalid with respect to OpenConsumerTokenDTO - */ - public static OpenConsumerTokenDTO fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OpenConsumerTokenDTO.class); - } - - /** - * Convert an instance of OpenConsumerTokenDTO to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} diff --git a/java-client/src/test/java/org/openapitools/client/api/AccessKeyManagementApiTest.java b/java-client/src/test/java/org/openapitools/client/api/AccessKeyManagementApiTest.java index b8f0c588..3720a79f 100644 --- a/java-client/src/test/java/org/openapitools/client/api/AccessKeyManagementApiTest.java +++ b/java-client/src/test/java/org/openapitools/client/api/AccessKeyManagementApiTest.java @@ -75,7 +75,8 @@ public void disableAccessKeyTest() throws ApiException { String appId = null; String env = null; Long accessKeyId = null; - api.disableAccessKey(appId, env, accessKeyId); + String operator = null; + api.disableAccessKey(appId, env, accessKeyId, operator); // TODO: test validations } @@ -92,7 +93,8 @@ public void enableAccessKeyTest() throws ApiException { String env = null; Long accessKeyId = null; Integer mode = null; - api.enableAccessKey(appId, env, accessKeyId, mode); + String operator = null; + api.enableAccessKey(appId, env, accessKeyId, mode, operator); // TODO: test validations } diff --git a/java-client/src/test/java/org/openapitools/client/api/NamespaceBranchManagementApiTest.java b/java-client/src/test/java/org/openapitools/client/api/NamespaceBranchManagementApiTest.java index 64c2f53f..b596bd20 100644 --- a/java-client/src/test/java/org/openapitools/client/api/NamespaceBranchManagementApiTest.java +++ b/java-client/src/test/java/org/openapitools/client/api/NamespaceBranchManagementApiTest.java @@ -164,7 +164,7 @@ public void updateBranchRulesTest() throws ApiException { String branchName = null; OpenGrayReleaseRuleDTO openGrayReleaseRuleDTO = null; String operator = null; - api.updateBranchRules(appId, env, clusterName, namespaceName, branchName, operator, openGrayReleaseRuleDTO); + api.updateBranchRules(appId, env, clusterName, namespaceName, branchName, openGrayReleaseRuleDTO, operator); // TODO: test validations } diff --git a/java-client/src/test/java/org/openapitools/client/api/PortalManagementApiTest.java b/java-client/src/test/java/org/openapitools/client/api/PortalManagementApiTest.java index 7edd9f81..1be6fc61 100644 --- a/java-client/src/test/java/org/openapitools/client/api/PortalManagementApiTest.java +++ b/java-client/src/test/java/org/openapitools/client/api/PortalManagementApiTest.java @@ -14,9 +14,6 @@ import org.openapitools.client.ApiException; import java.io.File; -import org.openapitools.client.model.OpenConsumerCreateRequestDTO; -import org.openapitools.client.model.OpenConsumerInfoDTO; -import org.openapitools.client.model.OpenConsumerTokenDTO; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -103,9 +100,9 @@ public void checkSystemHealthTest() throws ApiException { */ @Test public void createConsumerTest() throws ApiException { - OpenConsumerCreateRequestDTO openConsumerCreateRequestDTO = null; + Object body = null; String expires = null; - OpenConsumerInfoDTO response = api.createConsumer(openConsumerCreateRequestDTO, expires); + Object response = api.createConsumer(body, expires); // TODO: test validations } @@ -415,7 +412,7 @@ public void getAuditPropertiesTest() throws ApiException { public void getConsumerListTest() throws ApiException { Integer page = null; Integer size = null; - List response = api.getConsumerList(page, size); + List response = api.getConsumerList(page, size); // TODO: test validations } @@ -429,7 +426,7 @@ public void getConsumerListTest() throws ApiException { @Test public void getConsumerTokenByAppIdTest() throws ApiException { String appId = null; - OpenConsumerTokenDTO response = api.getConsumerTokenByAppId(appId); + Object response = api.getConsumerTokenByAppId(appId); // TODO: test validations } diff --git a/java-client/src/test/java/org/openapitools/client/api/ReleaseManagementApiTest.java b/java-client/src/test/java/org/openapitools/client/api/ReleaseManagementApiTest.java index c0d14a4f..5bd59a15 100644 --- a/java-client/src/test/java/org/openapitools/client/api/ReleaseManagementApiTest.java +++ b/java-client/src/test/java/org/openapitools/client/api/ReleaseManagementApiTest.java @@ -138,7 +138,7 @@ public void findActiveReleasesTest() throws ApiException { @Test public void getReleaseByIdTest() throws ApiException { String env = null; - Integer releaseId = null; + Long releaseId = null; OpenReleaseDTO response = api.getReleaseById(env, releaseId); // TODO: test validations } @@ -172,7 +172,8 @@ public void rollbackTest() throws ApiException { String env = null; Long releaseId = null; String operator = null; - api.rollback(env, releaseId, operator); + Long toReleaseId = null; + api.rollback(env, releaseId, operator, toReleaseId); // TODO: test validations } diff --git a/java-client/src/test/java/org/openapitools/client/api/UserManagementApiTest.java b/java-client/src/test/java/org/openapitools/client/api/UserManagementApiTest.java index 32d92a03..8b2c15b1 100644 --- a/java-client/src/test/java/org/openapitools/client/api/UserManagementApiTest.java +++ b/java-client/src/test/java/org/openapitools/client/api/UserManagementApiTest.java @@ -42,7 +42,8 @@ public class UserManagementApiTest { @Test public void changeUserEnabledTest() throws ApiException { OpenUserDTO openUserDTO = null; - api.changeUserEnabled(openUserDTO); + String operator = null; + api.changeUserEnabled(openUserDTO, operator); // TODO: test validations } @@ -57,7 +58,8 @@ public void changeUserEnabledTest() throws ApiException { public void createOrUpdateUserTest() throws ApiException { OpenUserDTO openUserDTO = null; Boolean isCreate = null; - api.createOrUpdateUser(openUserDTO, isCreate); + String operator = null; + api.createOrUpdateUser(openUserDTO, isCreate, operator); // TODO: test validations } diff --git a/java-client/src/test/java/org/openapitools/client/model/OpenConsumerCreateRequestDTOTest.java b/java-client/src/test/java/org/openapitools/client/model/OpenConsumerCreateRequestDTOTest.java deleted file mode 100644 index d0d8c2b9..00000000 --- a/java-client/src/test/java/org/openapitools/client/model/OpenConsumerCreateRequestDTOTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Apollo OpenAPI - *

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
- * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for OpenConsumerCreateRequestDTO - */ -public class OpenConsumerCreateRequestDTOTest { - private final OpenConsumerCreateRequestDTO model = new OpenConsumerCreateRequestDTO(); - - /** - * Model tests for OpenConsumerCreateRequestDTO - */ - @Test - public void testOpenConsumerCreateRequestDTO() { - // TODO: test OpenConsumerCreateRequestDTO - } - - /** - * Test the property 'appId' - */ - @Test - public void appIdTest() { - // TODO: test appId - } - - /** - * Test the property 'allowCreateApplication' - */ - @Test - public void allowCreateApplicationTest() { - // TODO: test allowCreateApplication - } - - /** - * Test the property 'allowManageUsers' - */ - @Test - public void allowManageUsersTest() { - // TODO: test allowManageUsers - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'orgId' - */ - @Test - public void orgIdTest() { - // TODO: test orgId - } - - /** - * Test the property 'orgName' - */ - @Test - public void orgNameTest() { - // TODO: test orgName - } - - /** - * Test the property 'ownerName' - */ - @Test - public void ownerNameTest() { - // TODO: test ownerName - } - - /** - * Test the property 'rateLimitEnabled' - */ - @Test - public void rateLimitEnabledTest() { - // TODO: test rateLimitEnabled - } - - /** - * Test the property 'rateLimit' - */ - @Test - public void rateLimitTest() { - // TODO: test rateLimit - } - -} diff --git a/java-client/src/test/java/org/openapitools/client/model/OpenConsumerInfoDTOTest.java b/java-client/src/test/java/org/openapitools/client/model/OpenConsumerInfoDTOTest.java deleted file mode 100644 index 4bf9d7ea..00000000 --- a/java-client/src/test/java/org/openapitools/client/model/OpenConsumerInfoDTOTest.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Apollo OpenAPI - *

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
- * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for OpenConsumerInfoDTO - */ -public class OpenConsumerInfoDTOTest { - private final OpenConsumerInfoDTO model = new OpenConsumerInfoDTO(); - - /** - * Model tests for OpenConsumerInfoDTO - */ - @Test - public void testOpenConsumerInfoDTO() { - // TODO: test OpenConsumerInfoDTO - } - - /** - * Test the property 'appId' - */ - @Test - public void appIdTest() { - // TODO: test appId - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'orgId' - */ - @Test - public void orgIdTest() { - // TODO: test orgId - } - - /** - * Test the property 'orgName' - */ - @Test - public void orgNameTest() { - // TODO: test orgName - } - - /** - * Test the property 'ownerName' - */ - @Test - public void ownerNameTest() { - // TODO: test ownerName - } - - /** - * Test the property 'ownerEmail' - */ - @Test - public void ownerEmailTest() { - // TODO: test ownerEmail - } - - /** - * Test the property 'consumerId' - */ - @Test - public void consumerIdTest() { - // TODO: test consumerId - } - - /** - * Test the property 'token' - */ - @Test - public void tokenTest() { - // TODO: test token - } - - /** - * Test the property 'allowCreateApplication' - */ - @Test - public void allowCreateApplicationTest() { - // TODO: test allowCreateApplication - } - - /** - * Test the property 'allowManageUsers' - */ - @Test - public void allowManageUsersTest() { - // TODO: test allowManageUsers - } - - /** - * Test the property 'rateLimit' - */ - @Test - public void rateLimitTest() { - // TODO: test rateLimit - } - - /** - * Test the property 'rateLimitEnabled' - */ - @Test - public void rateLimitEnabledTest() { - // TODO: test rateLimitEnabled - } - -} diff --git a/java-client/src/test/java/org/openapitools/client/model/OpenConsumerTokenDTOTest.java b/java-client/src/test/java/org/openapitools/client/model/OpenConsumerTokenDTOTest.java deleted file mode 100644 index 251e0c25..00000000 --- a/java-client/src/test/java/org/openapitools/client/model/OpenConsumerTokenDTOTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Apollo OpenAPI - *

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
- * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for OpenConsumerTokenDTO - */ -public class OpenConsumerTokenDTOTest { - private final OpenConsumerTokenDTO model = new OpenConsumerTokenDTO(); - - /** - * Model tests for OpenConsumerTokenDTO - */ - @Test - public void testOpenConsumerTokenDTO() { - // TODO: test OpenConsumerTokenDTO - } - - /** - * Test the property 'consumerId' - */ - @Test - public void consumerIdTest() { - // TODO: test consumerId - } - - /** - * Test the property 'token' - */ - @Test - public void tokenTest() { - // TODO: test token - } - - /** - * Test the property 'rateLimit' - */ - @Test - public void rateLimitTest() { - // TODO: test rateLimit - } - - /** - * Test the property 'expires' - */ - @Test - public void expiresTest() { - // TODO: test expires - } - - /** - * Test the property 'dataChangeCreatedBy' - */ - @Test - public void dataChangeCreatedByTest() { - // TODO: test dataChangeCreatedBy - } - - /** - * Test the property 'dataChangeCreatedTime' - */ - @Test - public void dataChangeCreatedTimeTest() { - // TODO: test dataChangeCreatedTime - } - - /** - * Test the property 'dataChangeLastModifiedBy' - */ - @Test - public void dataChangeLastModifiedByTest() { - // TODO: test dataChangeLastModifiedBy - } - - /** - * Test the property 'dataChangeLastModifiedTime' - */ - @Test - public void dataChangeLastModifiedTimeTest() { - // TODO: test dataChangeLastModifiedTime - } - -} diff --git a/python/.openapi-generator/FILES b/python/.openapi-generator/FILES index 3528d76d..792eb3a1 100644 --- a/python/.openapi-generator/FILES +++ b/python/.openapi-generator/FILES @@ -44,12 +44,6 @@ apollo_openapi/model/open_cluster_dto.py apollo_openapi/model/open_cluster_dto.pyi apollo_openapi/model/open_cluster_namespace_role_user_dto.py apollo_openapi/model/open_cluster_namespace_role_user_dto.pyi -apollo_openapi/model/open_consumer_create_request_dto.py -apollo_openapi/model/open_consumer_create_request_dto.pyi -apollo_openapi/model/open_consumer_info_dto.py -apollo_openapi/model/open_consumer_info_dto.pyi -apollo_openapi/model/open_consumer_token_dto.py -apollo_openapi/model/open_consumer_token_dto.pyi apollo_openapi/model/open_create_app_dto.py apollo_openapi/model/open_create_app_dto.pyi apollo_openapi/model/open_create_namespace_dto.py @@ -140,9 +134,6 @@ docs/models/OpenAppNamespaceDTO.md docs/models/OpenAppRoleUserDTO.md docs/models/OpenClusterDTO.md docs/models/OpenClusterNamespaceRoleUserDTO.md -docs/models/OpenConsumerCreateRequestDTO.md -docs/models/OpenConsumerInfoDTO.md -docs/models/OpenConsumerTokenDTO.md docs/models/OpenCreateAppDTO.md docs/models/OpenCreateNamespaceDTO.md docs/models/OpenEnvClusterDTO.md @@ -191,9 +182,6 @@ test/test_models/test_open_app_namespace_dto.py test/test_models/test_open_app_role_user_dto.py test/test_models/test_open_cluster_dto.py test/test_models/test_open_cluster_namespace_role_user_dto.py -test/test_models/test_open_consumer_create_request_dto.py -test/test_models/test_open_consumer_info_dto.py -test/test_models/test_open_consumer_token_dto.py test/test_models/test_open_create_app_dto.py test/test_models/test_open_create_namespace_dto.py test/test_models/test_open_env_cluster_dto.py diff --git a/python/README.md b/python/README.md index 2a87b6b6..c476934f 100644 --- a/python/README.md +++ b/python/README.md @@ -18,8 +18,8 @@ This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 0.3.7 -- Package version: 0.3.7 +- API version: 0.3.8 +- Package version: 0.3.8 - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. @@ -347,9 +347,6 @@ Class | Method | HTTP request | Description - [OpenAppRoleUserDTO](docs/models/OpenAppRoleUserDTO.md) - [OpenClusterDTO](docs/models/OpenClusterDTO.md) - [OpenClusterNamespaceRoleUserDTO](docs/models/OpenClusterNamespaceRoleUserDTO.md) - - [OpenConsumerCreateRequestDTO](docs/models/OpenConsumerCreateRequestDTO.md) - - [OpenConsumerInfoDTO](docs/models/OpenConsumerInfoDTO.md) - - [OpenConsumerTokenDTO](docs/models/OpenConsumerTokenDTO.md) - [OpenCreateAppDTO](docs/models/OpenCreateAppDTO.md) - [OpenCreateNamespaceDTO](docs/models/OpenCreateNamespaceDTO.md) - [OpenEnvClusterDTO](docs/models/OpenEnvClusterDTO.md) diff --git a/python/apollo_openapi/__init__.py b/python/apollo_openapi/__init__.py index 0265f113..ff55244e 100644 --- a/python/apollo_openapi/__init__.py +++ b/python/apollo_openapi/__init__.py @@ -10,7 +10,7 @@ Generated by: https://openapi-generator.tech """ -__version__ = "0.3.7" +__version__ = "0.3.8" # import ApiClient from apollo_openapi.api_client import ApiClient diff --git a/python/apollo_openapi/api_client.py b/python/apollo_openapi/api_client.py index cb1dd10a..238e8d97 100644 --- a/python/apollo_openapi/api_client.py +++ b/python/apollo_openapi/api_client.py @@ -1002,7 +1002,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/0.3.7/python' + self.user_agent = 'OpenAPI-Generator/0.3.8/python' def __enter__(self): return self diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export.py index 78f851ff..b2e02078 100644 --- a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export.py +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export.py @@ -1,9 +1,9 @@ from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export.get import ApiForget -from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export.head import ApiForHead +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export.head import ApiForhead class OpenapiV1AppsAppIdEnvsEnvClustersClusterNameExport( ApiForget, - ApiForHead, + ApiForhead, ): pass diff --git a/python/apollo_openapi/configuration.py b/python/apollo_openapi/configuration.py index 688de43d..acce7b40 100644 --- a/python/apollo_openapi/configuration.py +++ b/python/apollo_openapi/configuration.py @@ -402,8 +402,8 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 0.3.7\n"\ - "SDK Package Version: 0.3.7".\ + "Version of the API: 0.3.8\n"\ + "SDK Package Version: 0.3.8".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/python/apollo_openapi/model/open_consumer_create_request_dto.py b/python/apollo_openapi/model/open_consumer_create_request_dto.py deleted file mode 100644 index 0dbce85d..00000000 --- a/python/apollo_openapi/model/open_consumer_create_request_dto.py +++ /dev/null @@ -1,176 +0,0 @@ -# coding: utf-8 - -""" - Apollo OpenAPI - -

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
# noqa: E501 - - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from apollo_openapi import schemas # noqa: F401 - - -class OpenConsumerCreateRequestDTO( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "ownerName", - "appId", - "name", - "orgId", - } - - class properties: - appId = schemas.StrSchema - name = schemas.StrSchema - orgId = schemas.StrSchema - ownerName = schemas.StrSchema - allowCreateApplication = schemas.BoolSchema - allowManageUsers = schemas.BoolSchema - orgName = schemas.StrSchema - rateLimitEnabled = schemas.BoolSchema - - - class rateLimit( - schemas.IntSchema - ): - - - class MetaOapg: - inclusive_minimum = 0 - __annotations__ = { - "appId": appId, - "name": name, - "orgId": orgId, - "ownerName": ownerName, - "allowCreateApplication": allowCreateApplication, - "allowManageUsers": allowManageUsers, - "orgName": orgName, - "rateLimitEnabled": rateLimitEnabled, - "rateLimit": rateLimit, - } - - ownerName: MetaOapg.properties.ownerName - appId: MetaOapg.properties.appId - name: MetaOapg.properties.name - orgId: MetaOapg.properties.orgId - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["orgId"]) -> MetaOapg.properties.orgId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ownerName"]) -> MetaOapg.properties.ownerName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["allowCreateApplication"]) -> MetaOapg.properties.allowCreateApplication: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["allowManageUsers"]) -> MetaOapg.properties.allowManageUsers: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["orgName"]) -> MetaOapg.properties.orgName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["rateLimitEnabled"]) -> MetaOapg.properties.rateLimitEnabled: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["rateLimit"]) -> MetaOapg.properties.rateLimit: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["appId", "name", "orgId", "ownerName", "allowCreateApplication", "allowManageUsers", "orgName", "rateLimitEnabled", "rateLimit", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["orgId"]) -> MetaOapg.properties.orgId: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ownerName"]) -> MetaOapg.properties.ownerName: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["allowCreateApplication"]) -> typing.Union[MetaOapg.properties.allowCreateApplication, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["allowManageUsers"]) -> typing.Union[MetaOapg.properties.allowManageUsers, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["orgName"]) -> typing.Union[MetaOapg.properties.orgName, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["rateLimitEnabled"]) -> typing.Union[MetaOapg.properties.rateLimitEnabled, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["rateLimit"]) -> typing.Union[MetaOapg.properties.rateLimit, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["appId", "name", "orgId", "ownerName", "allowCreateApplication", "allowManageUsers", "orgName", "rateLimitEnabled", "rateLimit", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - ownerName: typing.Union[MetaOapg.properties.ownerName, str, ], - appId: typing.Union[MetaOapg.properties.appId, str, ], - name: typing.Union[MetaOapg.properties.name, str, ], - orgId: typing.Union[MetaOapg.properties.orgId, str, ], - allowCreateApplication: typing.Union[MetaOapg.properties.allowCreateApplication, bool, schemas.Unset] = schemas.unset, - allowManageUsers: typing.Union[MetaOapg.properties.allowManageUsers, bool, schemas.Unset] = schemas.unset, - orgName: typing.Union[MetaOapg.properties.orgName, str, schemas.Unset] = schemas.unset, - rateLimitEnabled: typing.Union[MetaOapg.properties.rateLimitEnabled, bool, schemas.Unset] = schemas.unset, - rateLimit: typing.Union[MetaOapg.properties.rateLimit, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'OpenConsumerCreateRequestDTO': - return super().__new__( - cls, - *_args, - ownerName=ownerName, - appId=appId, - name=name, - orgId=orgId, - allowCreateApplication=allowCreateApplication, - allowManageUsers=allowManageUsers, - orgName=orgName, - rateLimitEnabled=rateLimitEnabled, - rateLimit=rateLimit, - _configuration=_configuration, - **kwargs, - ) diff --git a/python/apollo_openapi/model/open_consumer_create_request_dto.pyi b/python/apollo_openapi/model/open_consumer_create_request_dto.pyi deleted file mode 100644 index 1c90508d..00000000 --- a/python/apollo_openapi/model/open_consumer_create_request_dto.pyi +++ /dev/null @@ -1,173 +0,0 @@ -# coding: utf-8 - -""" - Apollo OpenAPI - -

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
# noqa: E501 - - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from apollo_openapi import schemas # noqa: F401 - - -class OpenConsumerCreateRequestDTO( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - required = { - "ownerName", - "appId", - "name", - "orgId", - } - - class properties: - appId = schemas.StrSchema - name = schemas.StrSchema - orgId = schemas.StrSchema - ownerName = schemas.StrSchema - allowCreateApplication = schemas.BoolSchema - allowManageUsers = schemas.BoolSchema - orgName = schemas.StrSchema - rateLimitEnabled = schemas.BoolSchema - - - class rateLimit( - schemas.IntSchema - ): - pass - __annotations__ = { - "appId": appId, - "name": name, - "orgId": orgId, - "ownerName": ownerName, - "allowCreateApplication": allowCreateApplication, - "allowManageUsers": allowManageUsers, - "orgName": orgName, - "rateLimitEnabled": rateLimitEnabled, - "rateLimit": rateLimit, - } - - ownerName: MetaOapg.properties.ownerName - appId: MetaOapg.properties.appId - name: MetaOapg.properties.name - orgId: MetaOapg.properties.orgId - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["orgId"]) -> MetaOapg.properties.orgId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ownerName"]) -> MetaOapg.properties.ownerName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["allowCreateApplication"]) -> MetaOapg.properties.allowCreateApplication: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["allowManageUsers"]) -> MetaOapg.properties.allowManageUsers: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["orgName"]) -> MetaOapg.properties.orgName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["rateLimitEnabled"]) -> MetaOapg.properties.rateLimitEnabled: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["rateLimit"]) -> MetaOapg.properties.rateLimit: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["appId", "name", "orgId", "ownerName", "allowCreateApplication", "allowManageUsers", "orgName", "rateLimitEnabled", "rateLimit", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["orgId"]) -> MetaOapg.properties.orgId: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ownerName"]) -> MetaOapg.properties.ownerName: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["allowCreateApplication"]) -> typing.Union[MetaOapg.properties.allowCreateApplication, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["allowManageUsers"]) -> typing.Union[MetaOapg.properties.allowManageUsers, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["orgName"]) -> typing.Union[MetaOapg.properties.orgName, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["rateLimitEnabled"]) -> typing.Union[MetaOapg.properties.rateLimitEnabled, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["rateLimit"]) -> typing.Union[MetaOapg.properties.rateLimit, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["appId", "name", "orgId", "ownerName", "allowCreateApplication", "allowManageUsers", "orgName", "rateLimitEnabled", "rateLimit", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - ownerName: typing.Union[MetaOapg.properties.ownerName, str, ], - appId: typing.Union[MetaOapg.properties.appId, str, ], - name: typing.Union[MetaOapg.properties.name, str, ], - orgId: typing.Union[MetaOapg.properties.orgId, str, ], - allowCreateApplication: typing.Union[MetaOapg.properties.allowCreateApplication, bool, schemas.Unset] = schemas.unset, - allowManageUsers: typing.Union[MetaOapg.properties.allowManageUsers, bool, schemas.Unset] = schemas.unset, - orgName: typing.Union[MetaOapg.properties.orgName, str, schemas.Unset] = schemas.unset, - rateLimitEnabled: typing.Union[MetaOapg.properties.rateLimitEnabled, bool, schemas.Unset] = schemas.unset, - rateLimit: typing.Union[MetaOapg.properties.rateLimit, decimal.Decimal, int, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'OpenConsumerCreateRequestDTO': - return super().__new__( - cls, - *_args, - ownerName=ownerName, - appId=appId, - name=name, - orgId=orgId, - allowCreateApplication=allowCreateApplication, - allowManageUsers=allowManageUsers, - orgName=orgName, - rateLimitEnabled=rateLimitEnabled, - rateLimit=rateLimit, - _configuration=_configuration, - **kwargs, - ) diff --git a/python/apollo_openapi/model/open_consumer_info_dto.py b/python/apollo_openapi/model/open_consumer_info_dto.py deleted file mode 100644 index cbbd983f..00000000 --- a/python/apollo_openapi/model/open_consumer_info_dto.py +++ /dev/null @@ -1,195 +0,0 @@ -# coding: utf-8 - -""" - Apollo OpenAPI - -

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
# noqa: E501 - - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from apollo_openapi import schemas # noqa: F401 - - -class OpenConsumerInfoDTO( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - appId = schemas.StrSchema - name = schemas.StrSchema - orgId = schemas.StrSchema - orgName = schemas.StrSchema - ownerName = schemas.StrSchema - ownerEmail = schemas.StrSchema - consumerId = schemas.Int64Schema - token = schemas.StrSchema - allowCreateApplication = schemas.BoolSchema - allowManageUsers = schemas.BoolSchema - - - class rateLimit( - schemas.IntSchema - ): - - - class MetaOapg: - inclusive_minimum = 0 - rateLimitEnabled = schemas.BoolSchema - __annotations__ = { - "appId": appId, - "name": name, - "orgId": orgId, - "orgName": orgName, - "ownerName": ownerName, - "ownerEmail": ownerEmail, - "consumerId": consumerId, - "token": token, - "allowCreateApplication": allowCreateApplication, - "allowManageUsers": allowManageUsers, - "rateLimit": rateLimit, - "rateLimitEnabled": rateLimitEnabled, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["orgId"]) -> MetaOapg.properties.orgId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["orgName"]) -> MetaOapg.properties.orgName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ownerName"]) -> MetaOapg.properties.ownerName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ownerEmail"]) -> MetaOapg.properties.ownerEmail: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["consumerId"]) -> MetaOapg.properties.consumerId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["token"]) -> MetaOapg.properties.token: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["allowCreateApplication"]) -> MetaOapg.properties.allowCreateApplication: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["allowManageUsers"]) -> MetaOapg.properties.allowManageUsers: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["rateLimit"]) -> MetaOapg.properties.rateLimit: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["rateLimitEnabled"]) -> MetaOapg.properties.rateLimitEnabled: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["appId", "name", "orgId", "orgName", "ownerName", "ownerEmail", "consumerId", "token", "allowCreateApplication", "allowManageUsers", "rateLimit", "rateLimitEnabled", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["appId"]) -> typing.Union[MetaOapg.properties.appId, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["orgId"]) -> typing.Union[MetaOapg.properties.orgId, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["orgName"]) -> typing.Union[MetaOapg.properties.orgName, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ownerName"]) -> typing.Union[MetaOapg.properties.ownerName, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ownerEmail"]) -> typing.Union[MetaOapg.properties.ownerEmail, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["consumerId"]) -> typing.Union[MetaOapg.properties.consumerId, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["token"]) -> typing.Union[MetaOapg.properties.token, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["allowCreateApplication"]) -> typing.Union[MetaOapg.properties.allowCreateApplication, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["allowManageUsers"]) -> typing.Union[MetaOapg.properties.allowManageUsers, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["rateLimit"]) -> typing.Union[MetaOapg.properties.rateLimit, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["rateLimitEnabled"]) -> typing.Union[MetaOapg.properties.rateLimitEnabled, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["appId", "name", "orgId", "orgName", "ownerName", "ownerEmail", "consumerId", "token", "allowCreateApplication", "allowManageUsers", "rateLimit", "rateLimitEnabled", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - appId: typing.Union[MetaOapg.properties.appId, str, schemas.Unset] = schemas.unset, - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - orgId: typing.Union[MetaOapg.properties.orgId, str, schemas.Unset] = schemas.unset, - orgName: typing.Union[MetaOapg.properties.orgName, str, schemas.Unset] = schemas.unset, - ownerName: typing.Union[MetaOapg.properties.ownerName, str, schemas.Unset] = schemas.unset, - ownerEmail: typing.Union[MetaOapg.properties.ownerEmail, str, schemas.Unset] = schemas.unset, - consumerId: typing.Union[MetaOapg.properties.consumerId, decimal.Decimal, int, schemas.Unset] = schemas.unset, - token: typing.Union[MetaOapg.properties.token, str, schemas.Unset] = schemas.unset, - allowCreateApplication: typing.Union[MetaOapg.properties.allowCreateApplication, bool, schemas.Unset] = schemas.unset, - allowManageUsers: typing.Union[MetaOapg.properties.allowManageUsers, bool, schemas.Unset] = schemas.unset, - rateLimit: typing.Union[MetaOapg.properties.rateLimit, decimal.Decimal, int, schemas.Unset] = schemas.unset, - rateLimitEnabled: typing.Union[MetaOapg.properties.rateLimitEnabled, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'OpenConsumerInfoDTO': - return super().__new__( - cls, - *_args, - appId=appId, - name=name, - orgId=orgId, - orgName=orgName, - ownerName=ownerName, - ownerEmail=ownerEmail, - consumerId=consumerId, - token=token, - allowCreateApplication=allowCreateApplication, - allowManageUsers=allowManageUsers, - rateLimit=rateLimit, - rateLimitEnabled=rateLimitEnabled, - _configuration=_configuration, - **kwargs, - ) diff --git a/python/apollo_openapi/model/open_consumer_info_dto.pyi b/python/apollo_openapi/model/open_consumer_info_dto.pyi deleted file mode 100644 index 74edb892..00000000 --- a/python/apollo_openapi/model/open_consumer_info_dto.pyi +++ /dev/null @@ -1,192 +0,0 @@ -# coding: utf-8 - -""" - Apollo OpenAPI - -

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
# noqa: E501 - - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from apollo_openapi import schemas # noqa: F401 - - -class OpenConsumerInfoDTO( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - appId = schemas.StrSchema - name = schemas.StrSchema - orgId = schemas.StrSchema - orgName = schemas.StrSchema - ownerName = schemas.StrSchema - ownerEmail = schemas.StrSchema - consumerId = schemas.Int64Schema - token = schemas.StrSchema - allowCreateApplication = schemas.BoolSchema - allowManageUsers = schemas.BoolSchema - - - class rateLimit( - schemas.IntSchema - ): - pass - rateLimitEnabled = schemas.BoolSchema - __annotations__ = { - "appId": appId, - "name": name, - "orgId": orgId, - "orgName": orgName, - "ownerName": ownerName, - "ownerEmail": ownerEmail, - "consumerId": consumerId, - "token": token, - "allowCreateApplication": allowCreateApplication, - "allowManageUsers": allowManageUsers, - "rateLimit": rateLimit, - "rateLimitEnabled": rateLimitEnabled, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["orgId"]) -> MetaOapg.properties.orgId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["orgName"]) -> MetaOapg.properties.orgName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ownerName"]) -> MetaOapg.properties.ownerName: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["ownerEmail"]) -> MetaOapg.properties.ownerEmail: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["consumerId"]) -> MetaOapg.properties.consumerId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["token"]) -> MetaOapg.properties.token: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["allowCreateApplication"]) -> MetaOapg.properties.allowCreateApplication: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["allowManageUsers"]) -> MetaOapg.properties.allowManageUsers: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["rateLimit"]) -> MetaOapg.properties.rateLimit: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["rateLimitEnabled"]) -> MetaOapg.properties.rateLimitEnabled: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["appId", "name", "orgId", "orgName", "ownerName", "ownerEmail", "consumerId", "token", "allowCreateApplication", "allowManageUsers", "rateLimit", "rateLimitEnabled", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["appId"]) -> typing.Union[MetaOapg.properties.appId, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union[MetaOapg.properties.name, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["orgId"]) -> typing.Union[MetaOapg.properties.orgId, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["orgName"]) -> typing.Union[MetaOapg.properties.orgName, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ownerName"]) -> typing.Union[MetaOapg.properties.ownerName, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["ownerEmail"]) -> typing.Union[MetaOapg.properties.ownerEmail, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["consumerId"]) -> typing.Union[MetaOapg.properties.consumerId, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["token"]) -> typing.Union[MetaOapg.properties.token, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["allowCreateApplication"]) -> typing.Union[MetaOapg.properties.allowCreateApplication, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["allowManageUsers"]) -> typing.Union[MetaOapg.properties.allowManageUsers, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["rateLimit"]) -> typing.Union[MetaOapg.properties.rateLimit, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["rateLimitEnabled"]) -> typing.Union[MetaOapg.properties.rateLimitEnabled, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["appId", "name", "orgId", "orgName", "ownerName", "ownerEmail", "consumerId", "token", "allowCreateApplication", "allowManageUsers", "rateLimit", "rateLimitEnabled", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - appId: typing.Union[MetaOapg.properties.appId, str, schemas.Unset] = schemas.unset, - name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, - orgId: typing.Union[MetaOapg.properties.orgId, str, schemas.Unset] = schemas.unset, - orgName: typing.Union[MetaOapg.properties.orgName, str, schemas.Unset] = schemas.unset, - ownerName: typing.Union[MetaOapg.properties.ownerName, str, schemas.Unset] = schemas.unset, - ownerEmail: typing.Union[MetaOapg.properties.ownerEmail, str, schemas.Unset] = schemas.unset, - consumerId: typing.Union[MetaOapg.properties.consumerId, decimal.Decimal, int, schemas.Unset] = schemas.unset, - token: typing.Union[MetaOapg.properties.token, str, schemas.Unset] = schemas.unset, - allowCreateApplication: typing.Union[MetaOapg.properties.allowCreateApplication, bool, schemas.Unset] = schemas.unset, - allowManageUsers: typing.Union[MetaOapg.properties.allowManageUsers, bool, schemas.Unset] = schemas.unset, - rateLimit: typing.Union[MetaOapg.properties.rateLimit, decimal.Decimal, int, schemas.Unset] = schemas.unset, - rateLimitEnabled: typing.Union[MetaOapg.properties.rateLimitEnabled, bool, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'OpenConsumerInfoDTO': - return super().__new__( - cls, - *_args, - appId=appId, - name=name, - orgId=orgId, - orgName=orgName, - ownerName=ownerName, - ownerEmail=ownerEmail, - consumerId=consumerId, - token=token, - allowCreateApplication=allowCreateApplication, - allowManageUsers=allowManageUsers, - rateLimit=rateLimit, - rateLimitEnabled=rateLimitEnabled, - _configuration=_configuration, - **kwargs, - ) diff --git a/python/apollo_openapi/model/open_consumer_token_dto.py b/python/apollo_openapi/model/open_consumer_token_dto.py deleted file mode 100644 index 1ee64872..00000000 --- a/python/apollo_openapi/model/open_consumer_token_dto.py +++ /dev/null @@ -1,155 +0,0 @@ -# coding: utf-8 - -""" - Apollo OpenAPI - -

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
# noqa: E501 - - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from apollo_openapi import schemas # noqa: F401 - - -class OpenConsumerTokenDTO( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - consumerId = schemas.Int64Schema - token = schemas.StrSchema - - - class rateLimit( - schemas.IntSchema - ): - - - class MetaOapg: - inclusive_minimum = 0 - expires = schemas.DateTimeSchema - dataChangeCreatedBy = schemas.StrSchema - dataChangeCreatedTime = schemas.DateTimeSchema - dataChangeLastModifiedBy = schemas.StrSchema - dataChangeLastModifiedTime = schemas.DateTimeSchema - __annotations__ = { - "consumerId": consumerId, - "token": token, - "rateLimit": rateLimit, - "expires": expires, - "dataChangeCreatedBy": dataChangeCreatedBy, - "dataChangeCreatedTime": dataChangeCreatedTime, - "dataChangeLastModifiedBy": dataChangeLastModifiedBy, - "dataChangeLastModifiedTime": dataChangeLastModifiedTime, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["consumerId"]) -> MetaOapg.properties.consumerId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["token"]) -> MetaOapg.properties.token: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["rateLimit"]) -> MetaOapg.properties.rateLimit: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["expires"]) -> MetaOapg.properties.expires: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dataChangeCreatedBy"]) -> MetaOapg.properties.dataChangeCreatedBy: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dataChangeCreatedTime"]) -> MetaOapg.properties.dataChangeCreatedTime: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dataChangeLastModifiedBy"]) -> MetaOapg.properties.dataChangeLastModifiedBy: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dataChangeLastModifiedTime"]) -> MetaOapg.properties.dataChangeLastModifiedTime: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["consumerId", "token", "rateLimit", "expires", "dataChangeCreatedBy", "dataChangeCreatedTime", "dataChangeLastModifiedBy", "dataChangeLastModifiedTime", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["consumerId"]) -> typing.Union[MetaOapg.properties.consumerId, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["token"]) -> typing.Union[MetaOapg.properties.token, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["rateLimit"]) -> typing.Union[MetaOapg.properties.rateLimit, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["expires"]) -> typing.Union[MetaOapg.properties.expires, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dataChangeCreatedBy"]) -> typing.Union[MetaOapg.properties.dataChangeCreatedBy, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dataChangeCreatedTime"]) -> typing.Union[MetaOapg.properties.dataChangeCreatedTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dataChangeLastModifiedBy"]) -> typing.Union[MetaOapg.properties.dataChangeLastModifiedBy, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dataChangeLastModifiedTime"]) -> typing.Union[MetaOapg.properties.dataChangeLastModifiedTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["consumerId", "token", "rateLimit", "expires", "dataChangeCreatedBy", "dataChangeCreatedTime", "dataChangeLastModifiedBy", "dataChangeLastModifiedTime", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - consumerId: typing.Union[MetaOapg.properties.consumerId, decimal.Decimal, int, schemas.Unset] = schemas.unset, - token: typing.Union[MetaOapg.properties.token, str, schemas.Unset] = schemas.unset, - rateLimit: typing.Union[MetaOapg.properties.rateLimit, decimal.Decimal, int, schemas.Unset] = schemas.unset, - expires: typing.Union[MetaOapg.properties.expires, str, datetime, schemas.Unset] = schemas.unset, - dataChangeCreatedBy: typing.Union[MetaOapg.properties.dataChangeCreatedBy, str, schemas.Unset] = schemas.unset, - dataChangeCreatedTime: typing.Union[MetaOapg.properties.dataChangeCreatedTime, str, datetime, schemas.Unset] = schemas.unset, - dataChangeLastModifiedBy: typing.Union[MetaOapg.properties.dataChangeLastModifiedBy, str, schemas.Unset] = schemas.unset, - dataChangeLastModifiedTime: typing.Union[MetaOapg.properties.dataChangeLastModifiedTime, str, datetime, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'OpenConsumerTokenDTO': - return super().__new__( - cls, - *_args, - consumerId=consumerId, - token=token, - rateLimit=rateLimit, - expires=expires, - dataChangeCreatedBy=dataChangeCreatedBy, - dataChangeCreatedTime=dataChangeCreatedTime, - dataChangeLastModifiedBy=dataChangeLastModifiedBy, - dataChangeLastModifiedTime=dataChangeLastModifiedTime, - _configuration=_configuration, - **kwargs, - ) diff --git a/python/apollo_openapi/model/open_consumer_token_dto.pyi b/python/apollo_openapi/model/open_consumer_token_dto.pyi deleted file mode 100644 index 237d4b93..00000000 --- a/python/apollo_openapi/model/open_consumer_token_dto.pyi +++ /dev/null @@ -1,152 +0,0 @@ -# coding: utf-8 - -""" - Apollo OpenAPI - -

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
# noqa: E501 - - Generated by: https://openapi-generator.tech -""" - -from datetime import date, datetime # noqa: F401 -import decimal # noqa: F401 -import functools # noqa: F401 -import io # noqa: F401 -import re # noqa: F401 -import typing # noqa: F401 -import typing_extensions # noqa: F401 -import uuid # noqa: F401 - -import frozendict # noqa: F401 - -from apollo_openapi import schemas # noqa: F401 - - -class OpenConsumerTokenDTO( - schemas.DictSchema -): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - - class MetaOapg: - - class properties: - consumerId = schemas.Int64Schema - token = schemas.StrSchema - - - class rateLimit( - schemas.IntSchema - ): - pass - expires = schemas.DateTimeSchema - dataChangeCreatedBy = schemas.StrSchema - dataChangeCreatedTime = schemas.DateTimeSchema - dataChangeLastModifiedBy = schemas.StrSchema - dataChangeLastModifiedTime = schemas.DateTimeSchema - __annotations__ = { - "consumerId": consumerId, - "token": token, - "rateLimit": rateLimit, - "expires": expires, - "dataChangeCreatedBy": dataChangeCreatedBy, - "dataChangeCreatedTime": dataChangeCreatedTime, - "dataChangeLastModifiedBy": dataChangeLastModifiedBy, - "dataChangeLastModifiedTime": dataChangeLastModifiedTime, - } - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["consumerId"]) -> MetaOapg.properties.consumerId: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["token"]) -> MetaOapg.properties.token: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["rateLimit"]) -> MetaOapg.properties.rateLimit: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["expires"]) -> MetaOapg.properties.expires: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dataChangeCreatedBy"]) -> MetaOapg.properties.dataChangeCreatedBy: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dataChangeCreatedTime"]) -> MetaOapg.properties.dataChangeCreatedTime: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dataChangeLastModifiedBy"]) -> MetaOapg.properties.dataChangeLastModifiedBy: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["dataChangeLastModifiedTime"]) -> MetaOapg.properties.dataChangeLastModifiedTime: ... - - @typing.overload - def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - - def __getitem__(self, name: typing.Union[typing_extensions.Literal["consumerId", "token", "rateLimit", "expires", "dataChangeCreatedBy", "dataChangeCreatedTime", "dataChangeLastModifiedBy", "dataChangeLastModifiedTime", ], str]): - # dict_instance[name] accessor - return super().__getitem__(name) - - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["consumerId"]) -> typing.Union[MetaOapg.properties.consumerId, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["token"]) -> typing.Union[MetaOapg.properties.token, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["rateLimit"]) -> typing.Union[MetaOapg.properties.rateLimit, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["expires"]) -> typing.Union[MetaOapg.properties.expires, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dataChangeCreatedBy"]) -> typing.Union[MetaOapg.properties.dataChangeCreatedBy, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dataChangeCreatedTime"]) -> typing.Union[MetaOapg.properties.dataChangeCreatedTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dataChangeLastModifiedBy"]) -> typing.Union[MetaOapg.properties.dataChangeLastModifiedBy, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["dataChangeLastModifiedTime"]) -> typing.Union[MetaOapg.properties.dataChangeLastModifiedTime, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["consumerId", "token", "rateLimit", "expires", "dataChangeCreatedBy", "dataChangeCreatedTime", "dataChangeLastModifiedBy", "dataChangeLastModifiedTime", ], str]): - return super().get_item_oapg(name) - - - def __new__( - cls, - *_args: typing.Union[dict, frozendict.frozendict, ], - consumerId: typing.Union[MetaOapg.properties.consumerId, decimal.Decimal, int, schemas.Unset] = schemas.unset, - token: typing.Union[MetaOapg.properties.token, str, schemas.Unset] = schemas.unset, - rateLimit: typing.Union[MetaOapg.properties.rateLimit, decimal.Decimal, int, schemas.Unset] = schemas.unset, - expires: typing.Union[MetaOapg.properties.expires, str, datetime, schemas.Unset] = schemas.unset, - dataChangeCreatedBy: typing.Union[MetaOapg.properties.dataChangeCreatedBy, str, schemas.Unset] = schemas.unset, - dataChangeCreatedTime: typing.Union[MetaOapg.properties.dataChangeCreatedTime, str, datetime, schemas.Unset] = schemas.unset, - dataChangeLastModifiedBy: typing.Union[MetaOapg.properties.dataChangeLastModifiedBy, str, schemas.Unset] = schemas.unset, - dataChangeLastModifiedTime: typing.Union[MetaOapg.properties.dataChangeLastModifiedTime, str, datetime, schemas.Unset] = schemas.unset, - _configuration: typing.Optional[schemas.Configuration] = None, - **kwargs: typing.Union[schemas.AnyTypeSchema, dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes], - ) -> 'OpenConsumerTokenDTO': - return super().__new__( - cls, - *_args, - consumerId=consumerId, - token=token, - rateLimit=rateLimit, - expires=expires, - dataChangeCreatedBy=dataChangeCreatedBy, - dataChangeCreatedTime=dataChangeCreatedTime, - dataChangeLastModifiedBy=dataChangeLastModifiedBy, - dataChangeLastModifiedTime=dataChangeLastModifiedTime, - _configuration=_configuration, - **kwargs, - ) diff --git a/python/apollo_openapi/models/__init__.py b/python/apollo_openapi/models/__init__.py index 9dd606af..37a0a05e 100644 --- a/python/apollo_openapi/models/__init__.py +++ b/python/apollo_openapi/models/__init__.py @@ -21,9 +21,6 @@ from apollo_openapi.model.open_app_role_user_dto import OpenAppRoleUserDTO from apollo_openapi.model.open_cluster_dto import OpenClusterDTO from apollo_openapi.model.open_cluster_namespace_role_user_dto import OpenClusterNamespaceRoleUserDTO -from apollo_openapi.model.open_consumer_create_request_dto import OpenConsumerCreateRequestDTO -from apollo_openapi.model.open_consumer_info_dto import OpenConsumerInfoDTO -from apollo_openapi.model.open_consumer_token_dto import OpenConsumerTokenDTO from apollo_openapi.model.open_create_app_dto import OpenCreateAppDTO from apollo_openapi.model.open_create_namespace_dto import OpenCreateNamespaceDTO from apollo_openapi.model.open_env_cluster_dto import OpenEnvClusterDTO diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export/head.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export/head.py index 3d268f36..05024460 100644 --- a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export/head.py +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export/head.py @@ -230,7 +230,7 @@ def check_export_app_config( ) -class ApiForHead(BaseApi): +class ApiForhead(BaseApi): # this class is used by api classes that refer to endpoints by path and http method names @typing.overload diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export/head.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export/head.pyi index 6fe8b1c2..7b23e38d 100644 --- a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export/head.pyi +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export/head.pyi @@ -222,7 +222,7 @@ class CheckExportAppConfig(BaseApi): ) -class ApiForHead(BaseApi): +class ApiForhead(BaseApi): # this class is used by api classes that refer to endpoints by path and http method names @typing.overload diff --git a/python/apollo_openapi/paths/openapi_v1_consumer_tokens_by_app_id/get.py b/python/apollo_openapi/paths/openapi_v1_consumer_tokens_by_app_id/get.py index 56d5633f..e686fef7 100644 --- a/python/apollo_openapi/paths/openapi_v1_consumer_tokens_by_app_id/get.py +++ b/python/apollo_openapi/paths/openapi_v1_consumer_tokens_by_app_id/get.py @@ -25,8 +25,6 @@ from apollo_openapi import schemas # noqa: F401 -from apollo_openapi.model.open_consumer_token_dto import OpenConsumerTokenDTO - from . import path # Query params @@ -59,7 +57,7 @@ class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams) _auth = [ 'ApiKeyAuth', ] -SchemaFor200ResponseBodyApplicationJson = OpenConsumerTokenDTO +SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass diff --git a/python/apollo_openapi/paths/openapi_v1_consumer_tokens_by_app_id/get.pyi b/python/apollo_openapi/paths/openapi_v1_consumer_tokens_by_app_id/get.pyi index 2195ff1c..0d65bd82 100644 --- a/python/apollo_openapi/paths/openapi_v1_consumer_tokens_by_app_id/get.pyi +++ b/python/apollo_openapi/paths/openapi_v1_consumer_tokens_by_app_id/get.pyi @@ -25,8 +25,6 @@ import frozendict # noqa: F401 from apollo_openapi import schemas # noqa: F401 -from apollo_openapi.model.open_consumer_token_dto import OpenConsumerTokenDTO - # Query params AppIdSchema = schemas.StrSchema RequestRequiredQueryParams = typing_extensions.TypedDict( @@ -54,7 +52,7 @@ request_query_app_id = api_client.QueryParameter( required=True, explode=True, ) -SchemaFor200ResponseBodyApplicationJson = OpenConsumerTokenDTO +SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass diff --git a/python/apollo_openapi/paths/openapi_v1_consumers/get.py b/python/apollo_openapi/paths/openapi_v1_consumers/get.py index 92b4c625..a1925445 100644 --- a/python/apollo_openapi/paths/openapi_v1_consumers/get.py +++ b/python/apollo_openapi/paths/openapi_v1_consumers/get.py @@ -25,8 +25,6 @@ from apollo_openapi import schemas # noqa: F401 -from apollo_openapi.model.open_consumer_info_dto import OpenConsumerInfoDTO - from . import path # Query params @@ -74,14 +72,11 @@ class SchemaFor200ResponseBodyApplicationJson( class MetaOapg: - - @staticmethod - def items() -> typing.Type['OpenConsumerInfoDTO']: - return OpenConsumerInfoDTO + items = schemas.DictSchema def __new__( cls, - _arg: typing.Union[typing.Tuple['OpenConsumerInfoDTO'], typing.List['OpenConsumerInfoDTO']], + _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, ]]], _configuration: typing.Optional[schemas.Configuration] = None, ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( @@ -90,7 +85,7 @@ def __new__( _configuration=_configuration, ) - def __getitem__(self, i: int) -> 'OpenConsumerInfoDTO': + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) diff --git a/python/apollo_openapi/paths/openapi_v1_consumers/get.pyi b/python/apollo_openapi/paths/openapi_v1_consumers/get.pyi index 769cfda4..8cb91c70 100644 --- a/python/apollo_openapi/paths/openapi_v1_consumers/get.pyi +++ b/python/apollo_openapi/paths/openapi_v1_consumers/get.pyi @@ -25,8 +25,6 @@ import frozendict # noqa: F401 from apollo_openapi import schemas # noqa: F401 -from apollo_openapi.model.open_consumer_info_dto import OpenConsumerInfoDTO - # Query params PageSchema = schemas.IntSchema SizeSchema = schemas.IntSchema @@ -69,14 +67,11 @@ class SchemaFor200ResponseBodyApplicationJson( class MetaOapg: - - @staticmethod - def items() -> typing.Type['OpenConsumerInfoDTO']: - return OpenConsumerInfoDTO + items = schemas.DictSchema def __new__( cls, - _arg: typing.Union[typing.Tuple['OpenConsumerInfoDTO'], typing.List['OpenConsumerInfoDTO']], + _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict.frozendict, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict.frozendict, ]]], _configuration: typing.Optional[schemas.Configuration] = None, ) -> 'SchemaFor200ResponseBodyApplicationJson': return super().__new__( @@ -85,7 +80,7 @@ class SchemaFor200ResponseBodyApplicationJson( _configuration=_configuration, ) - def __getitem__(self, i: int) -> 'OpenConsumerInfoDTO': + def __getitem__(self, i: int) -> MetaOapg.items: return super().__getitem__(i) diff --git a/python/apollo_openapi/paths/openapi_v1_consumers/post.py b/python/apollo_openapi/paths/openapi_v1_consumers/post.py index 449a8974..c8e63f3e 100644 --- a/python/apollo_openapi/paths/openapi_v1_consumers/post.py +++ b/python/apollo_openapi/paths/openapi_v1_consumers/post.py @@ -25,9 +25,6 @@ from apollo_openapi import schemas # noqa: F401 -from apollo_openapi.model.open_consumer_create_request_dto import OpenConsumerCreateRequestDTO -from apollo_openapi.model.open_consumer_info_dto import OpenConsumerInfoDTO - from . import path # Query params @@ -57,10 +54,10 @@ class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams) explode=True, ) # body param -SchemaForRequestBodyApplicationJson = OpenConsumerCreateRequestDTO +SchemaForRequestBodyApplicationJson = schemas.DictSchema -request_body_open_consumer_create_request_dto = api_client.RequestBody( +request_body_body = api_client.RequestBody( content={ 'application/json': api_client.MediaType( schema=SchemaForRequestBodyApplicationJson), @@ -70,7 +67,7 @@ class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams) _auth = [ 'ApiKeyAuth', ] -SchemaFor200ResponseBodyApplicationJson = OpenConsumerInfoDTO +SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass @@ -101,7 +98,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_consumer_oapg( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -115,7 +112,7 @@ def _create_consumer_oapg( @typing.overload def _create_consumer_oapg( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -130,7 +127,7 @@ def _create_consumer_oapg( @typing.overload def _create_consumer_oapg( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), @@ -142,7 +139,7 @@ def _create_consumer_oapg( @typing.overload def _create_consumer_oapg( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -156,7 +153,7 @@ def _create_consumer_oapg( def _create_consumer_oapg( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = 'application/json', query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -197,7 +194,7 @@ class instances 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body_open_consumer_create_request_dto.serialize(body, content_type) + serialized_data = request_body_body.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -239,7 +236,7 @@ class CreateConsumer(BaseApi): @typing.overload def create_consumer( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -253,7 +250,7 @@ def create_consumer( @typing.overload def create_consumer( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -268,7 +265,7 @@ def create_consumer( @typing.overload def create_consumer( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), @@ -280,7 +277,7 @@ def create_consumer( @typing.overload def create_consumer( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -294,7 +291,7 @@ def create_consumer( def create_consumer( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = 'application/json', query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -319,7 +316,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -333,7 +330,7 @@ def post( @typing.overload def post( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -348,7 +345,7 @@ def post( @typing.overload def post( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), @@ -360,7 +357,7 @@ def post( @typing.overload def post( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -374,7 +371,7 @@ def post( def post( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = 'application/json', query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, diff --git a/python/apollo_openapi/paths/openapi_v1_consumers/post.pyi b/python/apollo_openapi/paths/openapi_v1_consumers/post.pyi index 2de54dd0..f654cf1c 100644 --- a/python/apollo_openapi/paths/openapi_v1_consumers/post.pyi +++ b/python/apollo_openapi/paths/openapi_v1_consumers/post.pyi @@ -25,9 +25,6 @@ import frozendict # noqa: F401 from apollo_openapi import schemas # noqa: F401 -from apollo_openapi.model.open_consumer_create_request_dto import OpenConsumerCreateRequestDTO -from apollo_openapi.model.open_consumer_info_dto import OpenConsumerInfoDTO - # Query params ExpiresSchema = schemas.StrSchema RequestRequiredQueryParams = typing_extensions.TypedDict( @@ -55,17 +52,17 @@ request_query_expires = api_client.QueryParameter( explode=True, ) # body param -SchemaForRequestBodyApplicationJson = OpenConsumerCreateRequestDTO +SchemaForRequestBodyApplicationJson = schemas.DictSchema -request_body_open_consumer_create_request_dto = api_client.RequestBody( +request_body_body = api_client.RequestBody( content={ 'application/json': api_client.MediaType( schema=SchemaForRequestBodyApplicationJson), }, required=True, ) -SchemaFor200ResponseBodyApplicationJson = OpenConsumerInfoDTO +SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass @@ -93,7 +90,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_consumer_oapg( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -107,7 +104,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_consumer_oapg( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -122,7 +119,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_consumer_oapg( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), @@ -134,7 +131,7 @@ class BaseApi(api_client.Api): @typing.overload def _create_consumer_oapg( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -148,7 +145,7 @@ class BaseApi(api_client.Api): def _create_consumer_oapg( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = 'application/json', query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -189,7 +186,7 @@ class BaseApi(api_client.Api): 'The required body parameter has an invalid value of: unset. Set a valid value instead') _fields = None _body = None - serialized_data = request_body_open_consumer_create_request_dto.serialize(body, content_type) + serialized_data = request_body_body.serialize(body, content_type) _headers.add('Content-Type', content_type) if 'fields' in serialized_data: _fields = serialized_data['fields'] @@ -231,7 +228,7 @@ class CreateConsumer(BaseApi): @typing.overload def create_consumer( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -245,7 +242,7 @@ class CreateConsumer(BaseApi): @typing.overload def create_consumer( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -260,7 +257,7 @@ class CreateConsumer(BaseApi): @typing.overload def create_consumer( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), @@ -272,7 +269,7 @@ class CreateConsumer(BaseApi): @typing.overload def create_consumer( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -286,7 +283,7 @@ class CreateConsumer(BaseApi): def create_consumer( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = 'application/json', query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -311,7 +308,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: typing_extensions.Literal["application/json"] = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -325,7 +322,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -340,7 +337,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), @@ -352,7 +349,7 @@ class ApiForpost(BaseApi): @typing.overload def post( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = ..., query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, @@ -366,7 +363,7 @@ class ApiForpost(BaseApi): def post( self, - body: typing.Union[SchemaForRequestBodyApplicationJson,], + body: typing.Union[SchemaForRequestBodyApplicationJson,dict, frozendict.frozendict, ], content_type: str = 'application/json', query_params: RequestQueryParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, diff --git a/python/docs/apis/tags/PortalManagementApi.md b/python/docs/apis/tags/PortalManagementApi.md index 4dc35c4f..22013e18 100644 --- a/python/docs/apis/tags/PortalManagementApi.md +++ b/python/docs/apis/tags/PortalManagementApi.md @@ -521,7 +521,7 @@ dict, frozendict.frozendict, | frozendict.frozendict, | | # **create_consumer** -> OpenConsumerInfoDTO create_consumer(open_consumer_create_request_dto) +> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} create_consumer(body) 创建开放平台消费者(new added) @@ -533,8 +533,6 @@ POST /openapi/v1/consumers ```python import apollo_openapi from apollo_openapi.apis.tags import portal_management_api -from apollo_openapi.model.open_consumer_create_request_dto import OpenConsumerCreateRequestDTO -from apollo_openapi.model.open_consumer_info_dto import OpenConsumerInfoDTO from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. @@ -560,17 +558,7 @@ with apollo_openapi.ApiClient(configuration) as api_client: # example passing only required values which don't have defaults set query_params = { } - body = OpenConsumerCreateRequestDTO( - app_id="app_id_example", - allow_create_application=False, - allow_manage_users=False, - name="name_example", - org_id="org_id_example", - org_name="org_name_example", - owner_name="owner_name_example", - rate_limit_enabled=False, - rate_limit=0, - ) + body = dict() try: # 创建开放平台消费者(new added) api_response = api_instance.create_consumer( @@ -585,17 +573,7 @@ with apollo_openapi.ApiClient(configuration) as api_client: query_params = { 'expires': "expires_example", } - body = OpenConsumerCreateRequestDTO( - app_id="app_id_example", - allow_create_application=False, - allow_manage_users=False, - name="name_example", - org_id="org_id_example", - org_name="org_name_example", - owner_name="owner_name_example", - rate_limit_enabled=False, - rate_limit=0, - ) + body = dict() try: # 创建开放平台消费者(new added) api_response = api_instance.create_consumer( @@ -621,10 +599,11 @@ skip_deserialization | bool | default is False | when True, headers and body wil ### body # SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OpenConsumerCreateRequestDTO**](../../models/OpenConsumerCreateRequestDTO.md) | | +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | ### query_params #### RequestQueryParams @@ -658,10 +637,11 @@ body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | headers | Unset | headers were not defined | # SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OpenConsumerInfoDTO**](../../models/OpenConsumerInfoDTO.md) | | +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | ### Authorization @@ -2975,7 +2955,7 @@ dict, frozendict.frozendict, | frozendict.frozendict, | | # **get_consumer_list** -> [OpenConsumerInfoDTO] get_consumer_list() +> [{str: (bool, date, datetime, dict, float, int, list, str, none_type)}] get_consumer_list() 查询开放平台消费者列表(new added) @@ -2987,7 +2967,6 @@ GET /openapi/v1/consumers ```python import apollo_openapi from apollo_openapi.apis.tags import portal_management_api -from apollo_openapi.model.open_consumer_info_dto import OpenConsumerInfoDTO from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. @@ -3081,7 +3060,14 @@ list, tuple, | tuple, | | ### Tuple Items Class Name | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -[**OpenConsumerInfoDTO**]({{complexTypePrefix}}OpenConsumerInfoDTO.md) | [**OpenConsumerInfoDTO**]({{complexTypePrefix}}OpenConsumerInfoDTO.md) | [**OpenConsumerInfoDTO**]({{complexTypePrefix}}OpenConsumerInfoDTO.md) | | +[items](#items) | dict, frozendict.frozendict, | frozendict.frozendict, | | + +# items + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | ### Authorization @@ -3091,7 +3077,7 @@ Class Name | Input Type | Accessed Type | Description | Notes # **get_consumer_token_by_app_id** -> OpenConsumerTokenDTO get_consumer_token_by_app_id(app_id) +> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} get_consumer_token_by_app_id(app_id) 按应用ID查询消费者Token(new added) @@ -3103,7 +3089,6 @@ GET /openapi/v1/consumer-tokens/by-appId ```python import apollo_openapi from apollo_openapi.apis.tags import portal_management_api -from apollo_openapi.model.open_consumer_token_dto import OpenConsumerTokenDTO from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. @@ -3179,10 +3164,11 @@ body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | headers | Unset | headers were not defined | # SchemaFor200ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**OpenConsumerTokenDTO**](../../models/OpenConsumerTokenDTO.md) | | +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | ### Authorization diff --git a/python/docs/models/OpenConsumerCreateRequestDTO.md b/python/docs/models/OpenConsumerCreateRequestDTO.md deleted file mode 100644 index 95bd05e3..00000000 --- a/python/docs/models/OpenConsumerCreateRequestDTO.md +++ /dev/null @@ -1,22 +0,0 @@ -# apollo_openapi.model.open_consumer_create_request_dto.OpenConsumerCreateRequestDTO - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**ownerName** | str, | str, | 负责人用户名 | [required] -**appId** | str, | str, | 第三方应用ID | [required] -**name** | str, | str, | 第三方应用名称 | [required] -**orgId** | str, | str, | 部门ID | [required] -**allowCreateApplication** | bool, | BoolClass, | 是否允许该Consumer Token创建应用 | [optional] if omitted the server will use the default value of False -**allowManageUsers** | bool, | BoolClass, | 是否允许该Consumer Token管理用户 | [optional] if omitted the server will use the default value of False -**orgName** | str, | str, | 部门名称 | [optional] -**rateLimitEnabled** | bool, | BoolClass, | 是否开启限流 | [optional] if omitted the server will use the default value of False -**rateLimit** | decimal.Decimal, int, | decimal.Decimal, | 限流QPS,rateLimitEnabled 为 true 时必须大于 0;未开启限流时 0 表示不限流 | [optional] -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/python/docs/models/OpenConsumerInfoDTO.md b/python/docs/models/OpenConsumerInfoDTO.md deleted file mode 100644 index 8595323d..00000000 --- a/python/docs/models/OpenConsumerInfoDTO.md +++ /dev/null @@ -1,25 +0,0 @@ -# apollo_openapi.model.open_consumer_info_dto.OpenConsumerInfoDTO - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**appId** | str, | str, | 第三方应用ID | [optional] -**name** | str, | str, | 第三方应用名称 | [optional] -**orgId** | str, | str, | 部门ID | [optional] -**orgName** | str, | str, | 部门名称 | [optional] -**ownerName** | str, | str, | 负责人用户名 | [optional] -**ownerEmail** | str, | str, | 负责人邮箱 | [optional] -**consumerId** | decimal.Decimal, int, | decimal.Decimal, | Consumer ID | [optional] value must be a 64 bit integer -**token** | str, | str, | Consumer Token,仅在创建或按应用查询详情时返回 | [optional] -**allowCreateApplication** | bool, | BoolClass, | 是否允许该Consumer Token创建应用 | [optional] if omitted the server will use the default value of False -**allowManageUsers** | bool, | BoolClass, | 是否允许该Consumer Token管理用户 | [optional] if omitted the server will use the default value of False -**rateLimit** | decimal.Decimal, int, | decimal.Decimal, | 限流QPS,0表示不限流 | [optional] if omitted the server will use the default value of 0 -**rateLimitEnabled** | bool, | BoolClass, | 是否开启限流 | [optional] if omitted the server will use the default value of False -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/python/docs/models/OpenConsumerTokenDTO.md b/python/docs/models/OpenConsumerTokenDTO.md deleted file mode 100644 index b017141a..00000000 --- a/python/docs/models/OpenConsumerTokenDTO.md +++ /dev/null @@ -1,21 +0,0 @@ -# apollo_openapi.model.open_consumer_token_dto.OpenConsumerTokenDTO - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - -### Dictionary Keys -Key | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -**consumerId** | decimal.Decimal, int, | decimal.Decimal, | Consumer ID | [optional] value must be a 64 bit integer -**token** | str, | str, | Consumer Token | [optional] -**rateLimit** | decimal.Decimal, int, | decimal.Decimal, | 限流QPS,0表示不限流 | [optional] if omitted the server will use the default value of 0 -**expires** | str, datetime, | str, | 过期时间 | [optional] value must conform to RFC-3339 date-time -**dataChangeCreatedBy** | str, | str, | 创建人 | [optional] -**dataChangeCreatedTime** | str, datetime, | str, | 创建时间 | [optional] value must conform to RFC-3339 date-time -**dataChangeLastModifiedBy** | str, | str, | 最后修改人 | [optional] -**dataChangeLastModifiedTime** | str, datetime, | str, | 最后修改时间 | [optional] value must conform to RFC-3339 date-time -**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] - -[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/python/setup.py b/python/setup.py index 9a9210d0..6df3590c 100644 --- a/python/setup.py +++ b/python/setup.py @@ -11,7 +11,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "apollo-openapi" -VERSION = "0.3.7" +VERSION = "0.3.8" # To install the library, run the following # # python setup.py install diff --git a/python/test/test_models/test_open_consumer_create_request_dto.py b/python/test/test_models/test_open_consumer_create_request_dto.py deleted file mode 100644 index d88ed1d3..00000000 --- a/python/test/test_models/test_open_consumer_create_request_dto.py +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - Apollo OpenAPI - -

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
# noqa: E501 - - Generated by: https://openapi-generator.tech -""" - -import unittest - -import apollo_openapi -from apollo_openapi.model.open_consumer_create_request_dto import OpenConsumerCreateRequestDTO -from apollo_openapi import configuration - - -class TestOpenConsumerCreateRequestDTO(unittest.TestCase): - """OpenConsumerCreateRequestDTO unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/python/test/test_models/test_open_consumer_info_dto.py b/python/test/test_models/test_open_consumer_info_dto.py deleted file mode 100644 index 559a81ed..00000000 --- a/python/test/test_models/test_open_consumer_info_dto.py +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - Apollo OpenAPI - -

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
# noqa: E501 - - Generated by: https://openapi-generator.tech -""" - -import unittest - -import apollo_openapi -from apollo_openapi.model.open_consumer_info_dto import OpenConsumerInfoDTO -from apollo_openapi import configuration - - -class TestOpenConsumerInfoDTO(unittest.TestCase): - """OpenConsumerInfoDTO unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/python/test/test_models/test_open_consumer_token_dto.py b/python/test/test_models/test_open_consumer_token_dto.py deleted file mode 100644 index 6f8bfaf8..00000000 --- a/python/test/test_models/test_open_consumer_token_dto.py +++ /dev/null @@ -1,24 +0,0 @@ -# coding: utf-8 - -""" - Apollo OpenAPI - -

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
# noqa: E501 - - Generated by: https://openapi-generator.tech -""" - -import unittest - -import apollo_openapi -from apollo_openapi.model.open_consumer_token_dto import OpenConsumerTokenDTO -from apollo_openapi import configuration - - -class TestOpenConsumerTokenDTO(unittest.TestCase): - """OpenConsumerTokenDTO unit test stubs""" - _configuration = configuration.Configuration() - - -if __name__ == '__main__': - unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export/test_head.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export/test_head.py index 054667e6..24b535e1 100644 --- a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export/test_head.py +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_export/test_head.py @@ -27,7 +27,7 @@ class TestOpenapiV1AppsAppIdEnvsEnvClustersClusterNameExport(ApiTestMixin, unitt def setUp(self): used_api_client = api_client.ApiClient(configuration=self._configuration) - self.api = head.ApiForHead(api_client=used_api_client) # noqa: E501 + self.api = head.ApiForhead(api_client=used_api_client) # noqa: E501 def tearDown(self): pass diff --git a/rust/.openapi-generator/FILES b/rust/.openapi-generator/FILES index f0e104d2..3b1adb58 100644 --- a/rust/.openapi-generator/FILES +++ b/rust/.openapi-generator/FILES @@ -12,9 +12,6 @@ docs/OpenAppNamespaceDto.md docs/OpenAppRoleUserDto.md docs/OpenClusterDto.md docs/OpenClusterNamespaceRoleUserDto.md -docs/OpenConsumerCreateRequestDto.md -docs/OpenConsumerInfoDto.md -docs/OpenConsumerTokenDto.md docs/OpenCreateAppDto.md docs/OpenCreateNamespaceDto.md docs/OpenEnvClusterDto.md @@ -59,9 +56,6 @@ src/models/open_app_namespace_dto.rs src/models/open_app_role_user_dto.rs src/models/open_cluster_dto.rs src/models/open_cluster_namespace_role_user_dto.rs -src/models/open_consumer_create_request_dto.rs -src/models/open_consumer_info_dto.rs -src/models/open_consumer_token_dto.rs src/models/open_create_app_dto.rs src/models/open_create_namespace_dto.rs src/models/open_env_cluster_dto.rs diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 5c17de24..a3210b9d 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-openapi" -version = "0.3.7" +version = "0.3.8" authors = ["OpenAPI Generator team and contributors"] description = "

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
" # Override this license by providing a License Object in the OpenAPI. @@ -10,7 +10,6 @@ edition = "2018" [dependencies] serde = "^1.0" serde_derive = "^1.0" -serde_with = "^2.0" serde_json = "^1.0" url = "^2.2" uuid = { version = "^1.0", features = ["serde"] } diff --git a/rust/README.md b/rust/README.md index a11bcfd5..375ba979 100644 --- a/rust/README.md +++ b/rust/README.md @@ -22,8 +22,8 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. -- API version: 0.3.7 -- Package version: 0.3.7 +- API version: 0.3.8 +- Package version: 0.3.8 - Build package: `org.openapitools.codegen.languages.RustClientCodegen` ## Installation @@ -53,9 +53,6 @@ Class | Method | HTTP request | Description - [OpenAppRoleUserDto](docs/OpenAppRoleUserDto.md) - [OpenClusterDto](docs/OpenClusterDto.md) - [OpenClusterNamespaceRoleUserDto](docs/OpenClusterNamespaceRoleUserDto.md) - - [OpenConsumerCreateRequestDto](docs/OpenConsumerCreateRequestDto.md) - - [OpenConsumerInfoDto](docs/OpenConsumerInfoDto.md) - - [OpenConsumerTokenDto](docs/OpenConsumerTokenDto.md) - [OpenCreateAppDto](docs/OpenCreateAppDto.md) - [OpenCreateNamespaceDto](docs/OpenCreateNamespaceDto.md) - [OpenEnvClusterDto](docs/OpenEnvClusterDto.md) diff --git a/rust/docs/OpenConsumerCreateRequestDto.md b/rust/docs/OpenConsumerCreateRequestDto.md deleted file mode 100644 index d0666131..00000000 --- a/rust/docs/OpenConsumerCreateRequestDto.md +++ /dev/null @@ -1,17 +0,0 @@ -# OpenConsumerCreateRequestDto - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**app_id** | **String** | 第三方应用ID | [required] -**allow_create_application** | Option<**bool**> | 是否允许该Consumer Token创建应用 | [optional][default to false] -**allow_manage_users** | Option<**bool**> | 是否允许该Consumer Token管理用户 | [optional][default to false] -**name** | **String** | 第三方应用名称 | [required] -**org_id** | **String** | 部门ID | [required] -**org_name** | Option<**String**> | 部门名称 | [optional] -**owner_name** | **String** | 负责人用户名 | [required] -**rate_limit_enabled** | Option<**bool**> | 是否开启限流 | [optional][default to false] -**rate_limit** | Option<**i32**> | 限流QPS,rateLimitEnabled 为 true 时必须大于 0;未开启限流时 0 表示不限流 | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/rust/docs/OpenConsumerInfoDto.md b/rust/docs/OpenConsumerInfoDto.md deleted file mode 100644 index b995a1e8..00000000 --- a/rust/docs/OpenConsumerInfoDto.md +++ /dev/null @@ -1,20 +0,0 @@ -# OpenConsumerInfoDto - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**app_id** | Option<**String**> | 第三方应用ID | [optional] -**name** | Option<**String**> | 第三方应用名称 | [optional] -**org_id** | Option<**String**> | 部门ID | [optional] -**org_name** | Option<**String**> | 部门名称 | [optional] -**owner_name** | Option<**String**> | 负责人用户名 | [optional] -**owner_email** | Option<**String**> | 负责人邮箱 | [optional] -**consumer_id** | Option<**i64**> | Consumer ID | [optional] -**token** | Option<**String**> | Consumer Token,仅在创建或按应用查询详情时返回 | [optional] -**allow_create_application** | Option<**bool**> | 是否允许该Consumer Token创建应用 | [optional][default to false] -**allow_manage_users** | Option<**bool**> | 是否允许该Consumer Token管理用户 | [optional][default to false] -**rate_limit** | Option<**i32**> | 限流QPS,0表示不限流 | [optional][default to 0] -**rate_limit_enabled** | Option<**bool**> | 是否开启限流 | [optional][default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/rust/docs/OpenConsumerTokenDto.md b/rust/docs/OpenConsumerTokenDto.md deleted file mode 100644 index c05dec73..00000000 --- a/rust/docs/OpenConsumerTokenDto.md +++ /dev/null @@ -1,16 +0,0 @@ -# OpenConsumerTokenDto - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**consumer_id** | Option<**i64**> | Consumer ID | [optional] -**token** | Option<**String**> | Consumer Token | [optional] -**rate_limit** | Option<**i32**> | 限流QPS,0表示不限流 | [optional][default to 0] -**expires** | Option<**String**> | 过期时间 | [optional] -**data_change_created_by** | Option<**String**> | 创建人 | [optional] -**data_change_created_time** | Option<**String**> | 创建时间 | [optional] -**data_change_last_modified_by** | Option<**String**> | 最后修改人 | [optional] -**data_change_last_modified_time** | Option<**String**> | 最后修改时间 | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/rust/src/apis/configuration.rs b/rust/src/apis/configuration.rs index 5bdc013e..5a03bca2 100644 --- a/rust/src/apis/configuration.rs +++ b/rust/src/apis/configuration.rs @@ -40,7 +40,7 @@ impl Default for Configuration { fn default() -> Self { Configuration { base_path: "http://localhost".to_owned(), - user_agent: Some("OpenAPI-Generator/0.3.7/rust".to_owned()), + user_agent: Some("OpenAPI-Generator/0.3.8/rust".to_owned()), client: reqwest::Client::new(), basic_auth: None, oauth_access_token: None, diff --git a/rust/src/models/mod.rs b/rust/src/models/mod.rs index 9c5e7ac4..2e9e710a 100644 --- a/rust/src/models/mod.rs +++ b/rust/src/models/mod.rs @@ -16,12 +16,6 @@ pub mod open_cluster_dto; pub use self::open_cluster_dto::OpenClusterDto; pub mod open_cluster_namespace_role_user_dto; pub use self::open_cluster_namespace_role_user_dto::OpenClusterNamespaceRoleUserDto; -pub mod open_consumer_create_request_dto; -pub use self::open_consumer_create_request_dto::OpenConsumerCreateRequestDto; -pub mod open_consumer_info_dto; -pub use self::open_consumer_info_dto::OpenConsumerInfoDto; -pub mod open_consumer_token_dto; -pub use self::open_consumer_token_dto::OpenConsumerTokenDto; pub mod open_create_app_dto; pub use self::open_create_app_dto::OpenCreateAppDto; pub mod open_create_namespace_dto; diff --git a/rust/src/models/open_consumer_create_request_dto.rs b/rust/src/models/open_consumer_create_request_dto.rs deleted file mode 100644 index 0683421b..00000000 --- a/rust/src/models/open_consumer_create_request_dto.rs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Apollo OpenAPI - * - *

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
- * - * - * Generated by: https://openapi-generator.tech - */ - - - - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct OpenConsumerCreateRequestDto { - /// 第三方应用ID - #[serde(rename = "appId")] - pub app_id: String, - /// 是否允许该Consumer Token创建应用 - #[serde(rename = "allowCreateApplication", skip_serializing_if = "Option::is_none")] - pub allow_create_application: Option, - /// 是否允许该Consumer Token管理用户 - #[serde(rename = "allowManageUsers", skip_serializing_if = "Option::is_none")] - pub allow_manage_users: Option, - /// 第三方应用名称 - #[serde(rename = "name")] - pub name: String, - /// 部门ID - #[serde(rename = "orgId")] - pub org_id: String, - /// 部门名称 - #[serde(rename = "orgName", skip_serializing_if = "Option::is_none")] - pub org_name: Option, - /// 负责人用户名 - #[serde(rename = "ownerName")] - pub owner_name: String, - /// 是否开启限流 - #[serde(rename = "rateLimitEnabled", skip_serializing_if = "Option::is_none")] - pub rate_limit_enabled: Option, - /// 限流QPS,rateLimitEnabled 为 true 时必须大于 0;未开启限流时 0 表示不限流 - #[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")] - pub rate_limit: Option, -} - -impl OpenConsumerCreateRequestDto { - pub fn new(app_id: String, name: String, org_id: String, owner_name: String) -> OpenConsumerCreateRequestDto { - OpenConsumerCreateRequestDto { - app_id, - allow_create_application: None, - allow_manage_users: None, - name, - org_id, - org_name: None, - owner_name, - rate_limit_enabled: None, - rate_limit: None, - } - } -} diff --git a/rust/src/models/open_consumer_info_dto.rs b/rust/src/models/open_consumer_info_dto.rs deleted file mode 100644 index 63d48d5a..00000000 --- a/rust/src/models/open_consumer_info_dto.rs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Apollo OpenAPI - * - *

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
- * - * - * Generated by: https://openapi-generator.tech - */ - - - - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct OpenConsumerInfoDto { - /// 第三方应用ID - #[serde(rename = "appId", skip_serializing_if = "Option::is_none")] - pub app_id: Option, - /// 第三方应用名称 - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// 部门ID - #[serde(rename = "orgId", skip_serializing_if = "Option::is_none")] - pub org_id: Option, - /// 部门名称 - #[serde(rename = "orgName", skip_serializing_if = "Option::is_none")] - pub org_name: Option, - /// 负责人用户名 - #[serde(rename = "ownerName", skip_serializing_if = "Option::is_none")] - pub owner_name: Option, - /// 负责人邮箱 - #[serde(rename = "ownerEmail", skip_serializing_if = "Option::is_none")] - pub owner_email: Option, - /// Consumer ID - #[serde(rename = "consumerId", skip_serializing_if = "Option::is_none")] - pub consumer_id: Option, - /// Consumer Token,仅在创建或按应用查询详情时返回 - #[serde(rename = "token", skip_serializing_if = "Option::is_none")] - pub token: Option, - /// 是否允许该Consumer Token创建应用 - #[serde(rename = "allowCreateApplication", skip_serializing_if = "Option::is_none")] - pub allow_create_application: Option, - /// 是否允许该Consumer Token管理用户 - #[serde(rename = "allowManageUsers", skip_serializing_if = "Option::is_none")] - pub allow_manage_users: Option, - /// 限流QPS,0表示不限流 - #[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")] - pub rate_limit: Option, - /// 是否开启限流 - #[serde(rename = "rateLimitEnabled", skip_serializing_if = "Option::is_none")] - pub rate_limit_enabled: Option, -} - -impl OpenConsumerInfoDto { - pub fn new() -> OpenConsumerInfoDto { - OpenConsumerInfoDto { - app_id: None, - name: None, - org_id: None, - org_name: None, - owner_name: None, - owner_email: None, - consumer_id: None, - token: None, - allow_create_application: None, - allow_manage_users: None, - rate_limit: None, - rate_limit_enabled: None, - } - } -} diff --git a/rust/src/models/open_consumer_token_dto.rs b/rust/src/models/open_consumer_token_dto.rs deleted file mode 100644 index 2c73f202..00000000 --- a/rust/src/models/open_consumer_token_dto.rs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Apollo OpenAPI - * - *

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
- * - * - * Generated by: https://openapi-generator.tech - */ - - - - -#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct OpenConsumerTokenDto { - /// Consumer ID - #[serde(rename = "consumerId", skip_serializing_if = "Option::is_none")] - pub consumer_id: Option, - /// Consumer Token - #[serde(rename = "token", skip_serializing_if = "Option::is_none")] - pub token: Option, - /// 限流QPS,0表示不限流 - #[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")] - pub rate_limit: Option, - /// 过期时间 - #[serde(rename = "expires", skip_serializing_if = "Option::is_none")] - pub expires: Option, - /// 创建人 - #[serde(rename = "dataChangeCreatedBy", skip_serializing_if = "Option::is_none")] - pub data_change_created_by: Option, - /// 创建时间 - #[serde(rename = "dataChangeCreatedTime", skip_serializing_if = "Option::is_none")] - pub data_change_created_time: Option, - /// 最后修改人 - #[serde(rename = "dataChangeLastModifiedBy", skip_serializing_if = "Option::is_none")] - pub data_change_last_modified_by: Option, - /// 最后修改时间 - #[serde(rename = "dataChangeLastModifiedTime", skip_serializing_if = "Option::is_none")] - pub data_change_last_modified_time: Option, -} - -impl OpenConsumerTokenDto { - pub fn new() -> OpenConsumerTokenDto { - OpenConsumerTokenDto { - consumer_id: None, - token: None, - rate_limit: None, - expires: None, - data_change_created_by: None, - data_change_created_time: None, - data_change_last_modified_by: None, - data_change_last_modified_time: None, - } - } -} diff --git a/spring-boot2/.openapi-generator/FILES b/spring-boot2/.openapi-generator/FILES index a345c6bf..a80c0915 100644 --- a/spring-boot2/.openapi-generator/FILES +++ b/spring-boot2/.openapi-generator/FILES @@ -60,9 +60,6 @@ src/main/java/com/apollo/openapi/server/model/OpenAppNamespaceDTO.java src/main/java/com/apollo/openapi/server/model/OpenAppRoleUserDTO.java src/main/java/com/apollo/openapi/server/model/OpenClusterDTO.java src/main/java/com/apollo/openapi/server/model/OpenClusterNamespaceRoleUserDTO.java -src/main/java/com/apollo/openapi/server/model/OpenConsumerCreateRequestDTO.java -src/main/java/com/apollo/openapi/server/model/OpenConsumerInfoDTO.java -src/main/java/com/apollo/openapi/server/model/OpenConsumerTokenDTO.java src/main/java/com/apollo/openapi/server/model/OpenCreateAppDTO.java src/main/java/com/apollo/openapi/server/model/OpenCreateNamespaceDTO.java src/main/java/com/apollo/openapi/server/model/OpenEnvClusterDTO.java diff --git a/spring-boot2/pom.xml b/spring-boot2/pom.xml index 3479dbbc..729c5c35 100644 --- a/spring-boot2/pom.xml +++ b/spring-boot2/pom.xml @@ -4,7 +4,7 @@ apollo-openapi-server jar apollo-openapi-server - 0.3.7 + 0.3.8 1.8 ${java.version} diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApiDelegate.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApiDelegate.java index 32bd4be8..8e64b5ea 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApiDelegate.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApiDelegate.java @@ -79,56 +79,16 @@ default ResponseEntity deleteAccessKey(String appId, * @return (status code 200) * @see AccessKeyManagementApi#disableAccessKey */ - default ResponseEntity disableAccessKey(String appId, - String env, - Long accessKeyId) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation : 禁用AccessKey - * This overload accepts the 0.3.3 operator parameter and delegates to the legacy overload by default. - * - * - * @param appId (required) - * @param env (required) - * @param accessKeyId (required) - * @param operator 操作人用户名 (optional) - * @return (status code 200) - * @see AccessKeyManagementApi#disableAccessKey - */ default ResponseEntity disableAccessKey(String appId, String env, Long accessKeyId, String operator) { - return disableAccessKey(appId, env, accessKeyId); - - } - - /** - * PUT /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/activation : 启用AccessKey - * - * - * @param appId (required) - * @param env (required) - * @param accessKeyId (required) - * @param mode (optional, default to 0) - * @param operator 操作人用户名 (optional) - * @return (status code 200) - * @see AccessKeyManagementApi#enableAccessKey - */ - default ResponseEntity enableAccessKey(String appId, - String env, - Long accessKeyId, - Integer mode) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * PUT /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/activation : 启用AccessKey - * This overload accepts the 0.3.3 operator parameter and delegates to the legacy overload by default. * * * @param appId (required) @@ -144,7 +104,7 @@ default ResponseEntity enableAccessKey(String appId, Long accessKeyId, Integer mode, String operator) { - return enableAccessKey(appId, env, accessKeyId, mode); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/NamespaceBranchManagementApiDelegate.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/NamespaceBranchManagementApiDelegate.java index 9c59df38..0ed927e1 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/NamespaceBranchManagementApiDelegate.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/NamespaceBranchManagementApiDelegate.java @@ -227,31 +227,6 @@ default ResponseEntity mergeBranch(String env, * @return 灰度规则更新成功 (status code 200) * @see NamespaceBranchManagementApi#updateBranchRules */ - default ResponseEntity updateBranchRules(String appId, - String env, - String clusterName, - String namespaceName, - String branchName, - String operator, - OpenGrayReleaseRuleDTO openGrayReleaseRuleDTO) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/rules : 更新分支灰度发布规则 (original openapi) - * This overload preserves delegate implementations from versions before 0.3.1. - * - * @param appId 应用ID (required) - * @param env 环境标识 (required) - * @param clusterName 集群名称 (required) - * @param namespaceName 命名空间名称 (required) - * @param branchName 分支名称 (required) - * @param openGrayReleaseRuleDTO (required) - * @param operator 操作人用户名 (optional) - * @return 灰度规则更新成功 (status code 200) - * @see NamespaceBranchManagementApi#updateBranchRules - */ default ResponseEntity updateBranchRules(String appId, String env, String clusterName, @@ -259,8 +234,7 @@ default ResponseEntity updateBranchRules(String appId, String branchName, OpenGrayReleaseRuleDTO openGrayReleaseRuleDTO, String operator) { - return updateBranchRules(appId, env, clusterName, namespaceName, branchName, operator, - openGrayReleaseRuleDTO); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/PortalManagementApi.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/PortalManagementApi.java index 8181c3ef..60f732a3 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/PortalManagementApi.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/PortalManagementApi.java @@ -5,9 +5,6 @@ */ package com.apollo.openapi.server.api; -import com.apollo.openapi.server.model.OpenConsumerCreateRequestDTO; -import com.apollo.openapi.server.model.OpenConsumerInfoDTO; -import com.apollo.openapi.server.model.OpenConsumerTokenDTO; import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -184,7 +181,7 @@ default ResponseEntity checkSystemHealth( * POST /openapi/v1/consumers : 创建开放平台消费者(new added) * POST /openapi/v1/consumers * - * @param openConsumerCreateRequestDTO (required) + * @param body (required) * @param expires (optional) * @return 成功创建消费者 (status code 200) */ @@ -195,7 +192,7 @@ default ResponseEntity checkSystemHealth( tags = { "Portal Management" }, responses = { @ApiResponse(responseCode = "200", description = "成功创建消费者", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = OpenConsumerInfoDTO.class)) + @Content(mediaType = "application/json", schema = @Schema(implementation = Object.class)) }) }, security = { @@ -208,11 +205,11 @@ default ResponseEntity checkSystemHealth( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity createConsumer( - @Parameter(name = "OpenConsumerCreateRequestDTO", description = "", required = true) @Valid @RequestBody OpenConsumerCreateRequestDTO openConsumerCreateRequestDTO, + default ResponseEntity createConsumer( + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody Object body, @Parameter(name = "expires", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "expires", required = false) String expires ) { - return getDelegate().createConsumer(openConsumerCreateRequestDTO, expires); + return getDelegate().createConsumer(body, expires); } @@ -908,7 +905,7 @@ default ResponseEntity getAuditProperties( tags = { "Portal Management" }, responses = { @ApiResponse(responseCode = "200", description = "成功获取消费者列表", content = { - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = OpenConsumerInfoDTO.class))) + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Object.class))) }) }, security = { @@ -920,7 +917,7 @@ default ResponseEntity getAuditProperties( value = "/openapi/v1/consumers", produces = { "application/json" } ) - default ResponseEntity> getConsumerList( + default ResponseEntity> getConsumerList( @Parameter(name = "page", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "page", required = false, defaultValue = "0") Integer page, @Parameter(name = "size", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "size", required = false, defaultValue = "10") Integer size ) { @@ -942,7 +939,7 @@ default ResponseEntity> getConsumerList( tags = { "Portal Management" }, responses = { @ApiResponse(responseCode = "200", description = "成功获取消费者Token", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = OpenConsumerTokenDTO.class)) + @Content(mediaType = "application/json", schema = @Schema(implementation = Object.class)) }) }, security = { @@ -954,7 +951,7 @@ default ResponseEntity> getConsumerList( value = "/openapi/v1/consumer-tokens/by-appId", produces = { "application/json" } ) - default ResponseEntity getConsumerTokenByAppId( + default ResponseEntity getConsumerTokenByAppId( @NotNull @Parameter(name = "appId", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "appId", required = true) String appId ) { return getDelegate().getConsumerTokenByAppId(appId); diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/PortalManagementApiController.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/PortalManagementApiController.java index cb9329a4..5f05e1e3 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/PortalManagementApiController.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/PortalManagementApiController.java @@ -1,8 +1,5 @@ package com.apollo.openapi.server.api; -import com.apollo.openapi.server.model.OpenConsumerCreateRequestDTO; -import com.apollo.openapi.server.model.OpenConsumerInfoDTO; -import com.apollo.openapi.server.model.OpenConsumerTokenDTO; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/PortalManagementApiDelegate.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/PortalManagementApiDelegate.java index e27d6997..d4905115 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/PortalManagementApiDelegate.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/PortalManagementApiDelegate.java @@ -1,8 +1,5 @@ package com.apollo.openapi.server.api; -import com.apollo.openapi.server.model.OpenConsumerCreateRequestDTO; -import com.apollo.openapi.server.model.OpenConsumerInfoDTO; -import com.apollo.openapi.server.model.OpenConsumerTokenDTO; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -100,22 +97,13 @@ default ResponseEntity checkSystemHealth(String instanceId) { * POST /openapi/v1/consumers : 创建开放平台消费者(new added) * POST /openapi/v1/consumers * - * @param openConsumerCreateRequestDTO (required) + * @param body (required) * @param expires (optional) * @return 成功创建消费者 (status code 200) * @see PortalManagementApi#createConsumer */ - default ResponseEntity createConsumer(OpenConsumerCreateRequestDTO openConsumerCreateRequestDTO, + default ResponseEntity createConsumer(Object body, String expires) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"orgName\" : \"orgName\", \"rateLimit\" : 0, \"ownerName\" : \"ownerName\", \"consumerId\" : 0, \"appId\" : \"appId\", \"name\" : \"name\", \"allowCreateApplication\" : false, \"allowManageUsers\" : false, \"rateLimitEnabled\" : false, \"orgId\" : \"orgId\", \"ownerEmail\" : \"ownerEmail\", \"token\" : \"token\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -517,12 +505,12 @@ default ResponseEntity getAuditProperties() { * @return 成功获取消费者列表 (status code 200) * @see PortalManagementApi#getConsumerList */ - default ResponseEntity> getConsumerList(Integer page, + default ResponseEntity> getConsumerList(Integer page, Integer size) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"orgName\" : \"orgName\", \"rateLimit\" : 0, \"ownerName\" : \"ownerName\", \"consumerId\" : 0, \"appId\" : \"appId\", \"name\" : \"name\", \"allowCreateApplication\" : false, \"allowManageUsers\" : false, \"rateLimitEnabled\" : false, \"orgId\" : \"orgId\", \"ownerEmail\" : \"ownerEmail\", \"token\" : \"token\" }, { \"orgName\" : \"orgName\", \"rateLimit\" : 0, \"ownerName\" : \"ownerName\", \"consumerId\" : 0, \"appId\" : \"appId\", \"name\" : \"name\", \"allowCreateApplication\" : false, \"allowManageUsers\" : false, \"rateLimitEnabled\" : false, \"orgId\" : \"orgId\", \"ownerEmail\" : \"ownerEmail\", \"token\" : \"token\" } ]"; + String exampleString = "[ \"{}\", \"{}\" ]"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -540,16 +528,7 @@ default ResponseEntity> getConsumerList(Integer page, * @return 成功获取消费者Token (status code 200) * @see PortalManagementApi#getConsumerTokenByAppId */ - default ResponseEntity getConsumerTokenByAppId(String appId) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"expires\" : \"2000-01-23T04:56:07.000+00:00\", \"rateLimit\" : 0, \"dataChangeCreatedTime\" : \"2000-01-23T04:56:07.000+00:00\", \"dataChangeLastModifiedBy\" : \"dataChangeLastModifiedBy\", \"consumerId\" : 0, \"dataChangeCreatedBy\" : \"dataChangeCreatedBy\", \"dataChangeLastModifiedTime\" : \"2000-01-23T04:56:07.000+00:00\", \"token\" : \"token\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); + default ResponseEntity getConsumerTokenByAppId(String appId) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/ReleaseManagementApiDelegate.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/ReleaseManagementApiDelegate.java index 3c2fcdb3..88e23565 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/ReleaseManagementApiDelegate.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/ReleaseManagementApiDelegate.java @@ -198,25 +198,6 @@ default ResponseEntity> findActiveReleases(String appId, */ default ResponseEntity getReleaseById(String env, Long releaseId) { - if (releaseId != null - && (releaseId > Integer.MAX_VALUE || releaseId < Integer.MIN_VALUE)) { - return ResponseEntity.badRequest().build(); - } - return getReleaseById(env, releaseId == null ? null : releaseId.intValue()); - - } - - /** - * GET /openapi/v1/envs/{env}/releases/{releaseId} : 获取发布详情 (new added) - * This overload preserves delegate implementations from versions before 0.3.2. - * - * @param env 环境标识 (required) - * @param releaseId 发布ID (required) - * @return 成功获取发布详情 (status code 200) - * @see ReleaseManagementApi#getReleaseById - */ - default ResponseEntity getReleaseById(String env, - Integer releaseId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -270,29 +251,11 @@ default ResponseEntity loadLatestActiveRelease(String appId, * @return 发布回滚成功 (status code 200) * @see ReleaseManagementApi#rollback */ - default ResponseEntity rollback(String env, - Long releaseId, - String operator) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - /** - * PUT /openapi/v1/envs/{env}/releases/{releaseId}/rollback : 回滚发布 (original openapi) - * This overload preserves delegate implementations from versions before 0.3.1. - * - * @param env 环境标识 (required) - * @param releaseId 发布ID (required) - * @param operator 操作人用户名 (optional) - * @param toReleaseId 要回滚到的目标发布ID;不传时回滚到上一版本 (optional) - * @return 发布回滚成功 (status code 200) - * @see ReleaseManagementApi#rollback - */ default ResponseEntity rollback(String env, Long releaseId, String operator, Long toReleaseId) { - return rollback(env, releaseId, operator); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/UserManagementApiDelegate.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/UserManagementApiDelegate.java index c80b8111..19d77fcf 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/UserManagementApiDelegate.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/UserManagementApiDelegate.java @@ -15,7 +15,7 @@ import javax.annotation.Generated; /** - * A delegate to be called by the {@link UserManagementApiController}. + * A delegate to be called by the {@link UserManagementApiController}}. * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. */ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/config/SpringDocConfiguration.java b/spring-boot2/src/main/java/com/apollo/openapi/server/config/SpringDocConfiguration.java index 4b6efbc3..baf6ceb0 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/config/SpringDocConfiguration.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/config/SpringDocConfiguration.java @@ -20,7 +20,7 @@ OpenAPI apiInfo() { new Info() .title("Apollo OpenAPI") .description("

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
") - .version("0.3.7") + .version("0.3.8") ) .components( new Components() diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerCreateRequestDTO.java b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerCreateRequestDTO.java deleted file mode 100644 index bae6a4c4..00000000 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerCreateRequestDTO.java +++ /dev/null @@ -1,294 +0,0 @@ -package com.apollo.openapi.server.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OpenConsumerCreateRequestDTO - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OpenConsumerCreateRequestDTO { - - private String appId; - - private Boolean allowCreateApplication = false; - - private Boolean allowManageUsers = false; - - private String name; - - private String orgId; - - private String orgName; - - private String ownerName; - - private Boolean rateLimitEnabled = false; - - private Integer rateLimit; - - /** - * Default constructor - * @deprecated Use {@link OpenConsumerCreateRequestDTO#OpenConsumerCreateRequestDTO(String, String, String, String)} - */ - @Deprecated - public OpenConsumerCreateRequestDTO() { - super(); - } - - /** - * Constructor with only required parameters - */ - public OpenConsumerCreateRequestDTO(String appId, String name, String orgId, String ownerName) { - this.appId = appId; - this.name = name; - this.orgId = orgId; - this.ownerName = ownerName; - } - - public OpenConsumerCreateRequestDTO appId(String appId) { - this.appId = appId; - return this; - } - - /** - * 第三方应用ID - * @return appId - */ - @NotNull - @Schema(name = "appId", description = "第三方应用ID", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("appId") - public String getAppId() { - return appId; - } - - public void setAppId(String appId) { - this.appId = appId; - } - - public OpenConsumerCreateRequestDTO allowCreateApplication(Boolean allowCreateApplication) { - this.allowCreateApplication = allowCreateApplication; - return this; - } - - /** - * 是否允许该Consumer Token创建应用 - * @return allowCreateApplication - */ - - @Schema(name = "allowCreateApplication", description = "是否允许该Consumer Token创建应用", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("allowCreateApplication") - public Boolean getAllowCreateApplication() { - return allowCreateApplication; - } - - public void setAllowCreateApplication(Boolean allowCreateApplication) { - this.allowCreateApplication = allowCreateApplication; - } - - public OpenConsumerCreateRequestDTO allowManageUsers(Boolean allowManageUsers) { - this.allowManageUsers = allowManageUsers; - return this; - } - - /** - * 是否允许该Consumer Token管理用户 - * @return allowManageUsers - */ - - @Schema(name = "allowManageUsers", description = "是否允许该Consumer Token管理用户", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("allowManageUsers") - public Boolean getAllowManageUsers() { - return allowManageUsers; - } - - public void setAllowManageUsers(Boolean allowManageUsers) { - this.allowManageUsers = allowManageUsers; - } - - public OpenConsumerCreateRequestDTO name(String name) { - this.name = name; - return this; - } - - /** - * 第三方应用名称 - * @return name - */ - @NotNull - @Schema(name = "name", description = "第三方应用名称", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public OpenConsumerCreateRequestDTO orgId(String orgId) { - this.orgId = orgId; - return this; - } - - /** - * 部门ID - * @return orgId - */ - @NotNull - @Schema(name = "orgId", description = "部门ID", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("orgId") - public String getOrgId() { - return orgId; - } - - public void setOrgId(String orgId) { - this.orgId = orgId; - } - - public OpenConsumerCreateRequestDTO orgName(String orgName) { - this.orgName = orgName; - return this; - } - - /** - * 部门名称 - * @return orgName - */ - - @Schema(name = "orgName", description = "部门名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("orgName") - public String getOrgName() { - return orgName; - } - - public void setOrgName(String orgName) { - this.orgName = orgName; - } - - public OpenConsumerCreateRequestDTO ownerName(String ownerName) { - this.ownerName = ownerName; - return this; - } - - /** - * 负责人用户名 - * @return ownerName - */ - @NotNull - @Schema(name = "ownerName", description = "负责人用户名", requiredMode = Schema.RequiredMode.REQUIRED) - @JsonProperty("ownerName") - public String getOwnerName() { - return ownerName; - } - - public void setOwnerName(String ownerName) { - this.ownerName = ownerName; - } - - public OpenConsumerCreateRequestDTO rateLimitEnabled(Boolean rateLimitEnabled) { - this.rateLimitEnabled = rateLimitEnabled; - return this; - } - - /** - * 是否开启限流 - * @return rateLimitEnabled - */ - - @Schema(name = "rateLimitEnabled", description = "是否开启限流", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("rateLimitEnabled") - public Boolean getRateLimitEnabled() { - return rateLimitEnabled; - } - - public void setRateLimitEnabled(Boolean rateLimitEnabled) { - this.rateLimitEnabled = rateLimitEnabled; - } - - public OpenConsumerCreateRequestDTO rateLimit(Integer rateLimit) { - this.rateLimit = rateLimit; - return this; - } - - /** - * 限流QPS,rateLimitEnabled 为 true 时必须大于 0;未开启限流时 0 表示不限流 - * minimum: 0 - * @return rateLimit - */ - @Min(0) - @Schema(name = "rateLimit", description = "限流QPS,rateLimitEnabled 为 true 时必须大于 0;未开启限流时 0 表示不限流", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("rateLimit") - public Integer getRateLimit() { - return rateLimit; - } - - public void setRateLimit(Integer rateLimit) { - this.rateLimit = rateLimit; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OpenConsumerCreateRequestDTO openConsumerCreateRequestDTO = (OpenConsumerCreateRequestDTO) o; - return Objects.equals(this.appId, openConsumerCreateRequestDTO.appId) && - Objects.equals(this.allowCreateApplication, openConsumerCreateRequestDTO.allowCreateApplication) && - Objects.equals(this.allowManageUsers, openConsumerCreateRequestDTO.allowManageUsers) && - Objects.equals(this.name, openConsumerCreateRequestDTO.name) && - Objects.equals(this.orgId, openConsumerCreateRequestDTO.orgId) && - Objects.equals(this.orgName, openConsumerCreateRequestDTO.orgName) && - Objects.equals(this.ownerName, openConsumerCreateRequestDTO.ownerName) && - Objects.equals(this.rateLimitEnabled, openConsumerCreateRequestDTO.rateLimitEnabled) && - Objects.equals(this.rateLimit, openConsumerCreateRequestDTO.rateLimit); - } - - @Override - public int hashCode() { - return Objects.hash(appId, allowCreateApplication, allowManageUsers, name, orgId, orgName, ownerName, rateLimitEnabled, rateLimit); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OpenConsumerCreateRequestDTO {\n"); - sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); - sb.append(" allowCreateApplication: ").append(toIndentedString(allowCreateApplication)).append("\n"); - sb.append(" allowManageUsers: ").append(toIndentedString(allowManageUsers)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); - sb.append(" orgName: ").append(toIndentedString(orgName)).append("\n"); - sb.append(" ownerName: ").append(toIndentedString(ownerName)).append("\n"); - sb.append(" rateLimitEnabled: ").append(toIndentedString(rateLimitEnabled)).append("\n"); - sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerInfoDTO.java b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerInfoDTO.java deleted file mode 100644 index a64ee711..00000000 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerInfoDTO.java +++ /dev/null @@ -1,347 +0,0 @@ -package com.apollo.openapi.server.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OpenConsumerInfoDTO - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OpenConsumerInfoDTO { - - private String appId; - - private String name; - - private String orgId; - - private String orgName; - - private String ownerName; - - private String ownerEmail; - - private Long consumerId; - - private String token; - - private Boolean allowCreateApplication = false; - - private Boolean allowManageUsers = false; - - private Integer rateLimit = 0; - - private Boolean rateLimitEnabled = false; - - public OpenConsumerInfoDTO appId(String appId) { - this.appId = appId; - return this; - } - - /** - * 第三方应用ID - * @return appId - */ - - @Schema(name = "appId", description = "第三方应用ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("appId") - public String getAppId() { - return appId; - } - - public void setAppId(String appId) { - this.appId = appId; - } - - public OpenConsumerInfoDTO name(String name) { - this.name = name; - return this; - } - - /** - * 第三方应用名称 - * @return name - */ - - @Schema(name = "name", description = "第三方应用名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public OpenConsumerInfoDTO orgId(String orgId) { - this.orgId = orgId; - return this; - } - - /** - * 部门ID - * @return orgId - */ - - @Schema(name = "orgId", description = "部门ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("orgId") - public String getOrgId() { - return orgId; - } - - public void setOrgId(String orgId) { - this.orgId = orgId; - } - - public OpenConsumerInfoDTO orgName(String orgName) { - this.orgName = orgName; - return this; - } - - /** - * 部门名称 - * @return orgName - */ - - @Schema(name = "orgName", description = "部门名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("orgName") - public String getOrgName() { - return orgName; - } - - public void setOrgName(String orgName) { - this.orgName = orgName; - } - - public OpenConsumerInfoDTO ownerName(String ownerName) { - this.ownerName = ownerName; - return this; - } - - /** - * 负责人用户名 - * @return ownerName - */ - - @Schema(name = "ownerName", description = "负责人用户名", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("ownerName") - public String getOwnerName() { - return ownerName; - } - - public void setOwnerName(String ownerName) { - this.ownerName = ownerName; - } - - public OpenConsumerInfoDTO ownerEmail(String ownerEmail) { - this.ownerEmail = ownerEmail; - return this; - } - - /** - * 负责人邮箱 - * @return ownerEmail - */ - - @Schema(name = "ownerEmail", description = "负责人邮箱", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("ownerEmail") - public String getOwnerEmail() { - return ownerEmail; - } - - public void setOwnerEmail(String ownerEmail) { - this.ownerEmail = ownerEmail; - } - - public OpenConsumerInfoDTO consumerId(Long consumerId) { - this.consumerId = consumerId; - return this; - } - - /** - * Consumer ID - * @return consumerId - */ - - @Schema(name = "consumerId", description = "Consumer ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("consumerId") - public Long getConsumerId() { - return consumerId; - } - - public void setConsumerId(Long consumerId) { - this.consumerId = consumerId; - } - - public OpenConsumerInfoDTO token(String token) { - this.token = token; - return this; - } - - /** - * Consumer Token,仅在创建或按应用查询详情时返回 - * @return token - */ - - @Schema(name = "token", description = "Consumer Token,仅在创建或按应用查询详情时返回", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("token") - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - public OpenConsumerInfoDTO allowCreateApplication(Boolean allowCreateApplication) { - this.allowCreateApplication = allowCreateApplication; - return this; - } - - /** - * 是否允许该Consumer Token创建应用 - * @return allowCreateApplication - */ - - @Schema(name = "allowCreateApplication", description = "是否允许该Consumer Token创建应用", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("allowCreateApplication") - public Boolean getAllowCreateApplication() { - return allowCreateApplication; - } - - public void setAllowCreateApplication(Boolean allowCreateApplication) { - this.allowCreateApplication = allowCreateApplication; - } - - public OpenConsumerInfoDTO allowManageUsers(Boolean allowManageUsers) { - this.allowManageUsers = allowManageUsers; - return this; - } - - /** - * 是否允许该Consumer Token管理用户 - * @return allowManageUsers - */ - - @Schema(name = "allowManageUsers", description = "是否允许该Consumer Token管理用户", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("allowManageUsers") - public Boolean getAllowManageUsers() { - return allowManageUsers; - } - - public void setAllowManageUsers(Boolean allowManageUsers) { - this.allowManageUsers = allowManageUsers; - } - - public OpenConsumerInfoDTO rateLimit(Integer rateLimit) { - this.rateLimit = rateLimit; - return this; - } - - /** - * 限流QPS,0表示不限流 - * minimum: 0 - * @return rateLimit - */ - @Min(0) - @Schema(name = "rateLimit", description = "限流QPS,0表示不限流", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("rateLimit") - public Integer getRateLimit() { - return rateLimit; - } - - public void setRateLimit(Integer rateLimit) { - this.rateLimit = rateLimit; - } - - public OpenConsumerInfoDTO rateLimitEnabled(Boolean rateLimitEnabled) { - this.rateLimitEnabled = rateLimitEnabled; - return this; - } - - /** - * 是否开启限流 - * @return rateLimitEnabled - */ - - @Schema(name = "rateLimitEnabled", description = "是否开启限流", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("rateLimitEnabled") - public Boolean getRateLimitEnabled() { - return rateLimitEnabled; - } - - public void setRateLimitEnabled(Boolean rateLimitEnabled) { - this.rateLimitEnabled = rateLimitEnabled; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OpenConsumerInfoDTO openConsumerInfoDTO = (OpenConsumerInfoDTO) o; - return Objects.equals(this.appId, openConsumerInfoDTO.appId) && - Objects.equals(this.name, openConsumerInfoDTO.name) && - Objects.equals(this.orgId, openConsumerInfoDTO.orgId) && - Objects.equals(this.orgName, openConsumerInfoDTO.orgName) && - Objects.equals(this.ownerName, openConsumerInfoDTO.ownerName) && - Objects.equals(this.ownerEmail, openConsumerInfoDTO.ownerEmail) && - Objects.equals(this.consumerId, openConsumerInfoDTO.consumerId) && - Objects.equals(this.token, openConsumerInfoDTO.token) && - Objects.equals(this.allowCreateApplication, openConsumerInfoDTO.allowCreateApplication) && - Objects.equals(this.allowManageUsers, openConsumerInfoDTO.allowManageUsers) && - Objects.equals(this.rateLimit, openConsumerInfoDTO.rateLimit) && - Objects.equals(this.rateLimitEnabled, openConsumerInfoDTO.rateLimitEnabled); - } - - @Override - public int hashCode() { - return Objects.hash(appId, name, orgId, orgName, ownerName, ownerEmail, consumerId, token, allowCreateApplication, allowManageUsers, rateLimit, rateLimitEnabled); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OpenConsumerInfoDTO {\n"); - sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); - sb.append(" orgName: ").append(toIndentedString(orgName)).append("\n"); - sb.append(" ownerName: ").append(toIndentedString(ownerName)).append("\n"); - sb.append(" ownerEmail: ").append(toIndentedString(ownerEmail)).append("\n"); - sb.append(" consumerId: ").append(toIndentedString(consumerId)).append("\n"); - sb.append(" token: ").append(token == null ? "null" : "***redacted***").append("\n"); - sb.append(" allowCreateApplication: ").append(toIndentedString(allowCreateApplication)).append("\n"); - sb.append(" allowManageUsers: ").append(toIndentedString(allowManageUsers)).append("\n"); - sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); - sb.append(" rateLimitEnabled: ").append(toIndentedString(rateLimitEnabled)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerTokenDTO.java b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerTokenDTO.java deleted file mode 100644 index c5e99846..00000000 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerTokenDTO.java +++ /dev/null @@ -1,255 +0,0 @@ -package com.apollo.openapi.server.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OpenConsumerTokenDTO - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OpenConsumerTokenDTO { - - private Long consumerId; - - private String token; - - private Integer rateLimit = 0; - - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime expires; - - private String dataChangeCreatedBy; - - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dataChangeCreatedTime; - - private String dataChangeLastModifiedBy; - - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dataChangeLastModifiedTime; - - public OpenConsumerTokenDTO consumerId(Long consumerId) { - this.consumerId = consumerId; - return this; - } - - /** - * Consumer ID - * @return consumerId - */ - - @Schema(name = "consumerId", description = "Consumer ID", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("consumerId") - public Long getConsumerId() { - return consumerId; - } - - public void setConsumerId(Long consumerId) { - this.consumerId = consumerId; - } - - public OpenConsumerTokenDTO token(String token) { - this.token = token; - return this; - } - - /** - * Consumer Token - * @return token - */ - - @Schema(name = "token", description = "Consumer Token", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("token") - public String getToken() { - return token; - } - - public void setToken(String token) { - this.token = token; - } - - public OpenConsumerTokenDTO rateLimit(Integer rateLimit) { - this.rateLimit = rateLimit; - return this; - } - - /** - * 限流QPS,0表示不限流 - * minimum: 0 - * @return rateLimit - */ - @Min(0) - @Schema(name = "rateLimit", description = "限流QPS,0表示不限流", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("rateLimit") - public Integer getRateLimit() { - return rateLimit; - } - - public void setRateLimit(Integer rateLimit) { - this.rateLimit = rateLimit; - } - - public OpenConsumerTokenDTO expires(OffsetDateTime expires) { - this.expires = expires; - return this; - } - - /** - * 过期时间 - * @return expires - */ - @Valid - @Schema(name = "expires", description = "过期时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("expires") - public OffsetDateTime getExpires() { - return expires; - } - - public void setExpires(OffsetDateTime expires) { - this.expires = expires; - } - - public OpenConsumerTokenDTO dataChangeCreatedBy(String dataChangeCreatedBy) { - this.dataChangeCreatedBy = dataChangeCreatedBy; - return this; - } - - /** - * 创建人 - * @return dataChangeCreatedBy - */ - - @Schema(name = "dataChangeCreatedBy", description = "创建人", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("dataChangeCreatedBy") - public String getDataChangeCreatedBy() { - return dataChangeCreatedBy; - } - - public void setDataChangeCreatedBy(String dataChangeCreatedBy) { - this.dataChangeCreatedBy = dataChangeCreatedBy; - } - - public OpenConsumerTokenDTO dataChangeCreatedTime(OffsetDateTime dataChangeCreatedTime) { - this.dataChangeCreatedTime = dataChangeCreatedTime; - return this; - } - - /** - * 创建时间 - * @return dataChangeCreatedTime - */ - @Valid - @Schema(name = "dataChangeCreatedTime", description = "创建时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("dataChangeCreatedTime") - public OffsetDateTime getDataChangeCreatedTime() { - return dataChangeCreatedTime; - } - - public void setDataChangeCreatedTime(OffsetDateTime dataChangeCreatedTime) { - this.dataChangeCreatedTime = dataChangeCreatedTime; - } - - public OpenConsumerTokenDTO dataChangeLastModifiedBy(String dataChangeLastModifiedBy) { - this.dataChangeLastModifiedBy = dataChangeLastModifiedBy; - return this; - } - - /** - * 最后修改人 - * @return dataChangeLastModifiedBy - */ - - @Schema(name = "dataChangeLastModifiedBy", description = "最后修改人", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("dataChangeLastModifiedBy") - public String getDataChangeLastModifiedBy() { - return dataChangeLastModifiedBy; - } - - public void setDataChangeLastModifiedBy(String dataChangeLastModifiedBy) { - this.dataChangeLastModifiedBy = dataChangeLastModifiedBy; - } - - public OpenConsumerTokenDTO dataChangeLastModifiedTime(OffsetDateTime dataChangeLastModifiedTime) { - this.dataChangeLastModifiedTime = dataChangeLastModifiedTime; - return this; - } - - /** - * 最后修改时间 - * @return dataChangeLastModifiedTime - */ - @Valid - @Schema(name = "dataChangeLastModifiedTime", description = "最后修改时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("dataChangeLastModifiedTime") - public OffsetDateTime getDataChangeLastModifiedTime() { - return dataChangeLastModifiedTime; - } - - public void setDataChangeLastModifiedTime(OffsetDateTime dataChangeLastModifiedTime) { - this.dataChangeLastModifiedTime = dataChangeLastModifiedTime; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OpenConsumerTokenDTO openConsumerTokenDTO = (OpenConsumerTokenDTO) o; - return Objects.equals(this.consumerId, openConsumerTokenDTO.consumerId) && - Objects.equals(this.token, openConsumerTokenDTO.token) && - Objects.equals(this.rateLimit, openConsumerTokenDTO.rateLimit) && - Objects.equals(this.expires, openConsumerTokenDTO.expires) && - Objects.equals(this.dataChangeCreatedBy, openConsumerTokenDTO.dataChangeCreatedBy) && - Objects.equals(this.dataChangeCreatedTime, openConsumerTokenDTO.dataChangeCreatedTime) && - Objects.equals(this.dataChangeLastModifiedBy, openConsumerTokenDTO.dataChangeLastModifiedBy) && - Objects.equals(this.dataChangeLastModifiedTime, openConsumerTokenDTO.dataChangeLastModifiedTime); - } - - @Override - public int hashCode() { - return Objects.hash(consumerId, token, rateLimit, expires, dataChangeCreatedBy, dataChangeCreatedTime, dataChangeLastModifiedBy, dataChangeLastModifiedTime); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OpenConsumerTokenDTO {\n"); - sb.append(" consumerId: ").append(toIndentedString(consumerId)).append("\n"); - sb.append(" token: ").append(token == null ? "null" : "***redacted***").append("\n"); - sb.append(" rateLimit: ").append(toIndentedString(rateLimit)).append("\n"); - sb.append(" expires: ").append(toIndentedString(expires)).append("\n"); - sb.append(" dataChangeCreatedBy: ").append(toIndentedString(dataChangeCreatedBy)).append("\n"); - sb.append(" dataChangeCreatedTime: ").append(toIndentedString(dataChangeCreatedTime)).append("\n"); - sb.append(" dataChangeLastModifiedBy: ").append(toIndentedString(dataChangeLastModifiedBy)).append("\n"); - sb.append(" dataChangeLastModifiedTime: ").append(toIndentedString(dataChangeLastModifiedTime)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/spring-boot2/src/main/resources/openapi.yaml b/spring-boot2/src/main/resources/openapi.yaml index 97a74823..9e818da5 100644 --- a/spring-boot2/src/main/resources/openapi.yaml +++ b/spring-boot2/src/main/resources/openapi.yaml @@ -17,7 +17,7 @@ info:
curl -X GET "http://localhost:8070/openapi/v1/apps" \
     -H "Authorization: your_token_here"
title: Apollo OpenAPI - version: 0.3.7 + version: 0.3.8 servers: - url: / security: @@ -6397,7 +6397,7 @@ paths: application/json: schema: items: - $ref: '#/components/schemas/OpenConsumerInfoDTO' + type: object type: array description: 成功获取消费者列表 summary: 查询开放平台消费者列表(new added) @@ -6423,14 +6423,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/OpenConsumerCreateRequestDTO' + type: object required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/OpenConsumerInfoDTO' + type: object description: 成功创建消费者 summary: 创建开放平台消费者(new added) tags: @@ -6457,7 +6457,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/OpenConsumerTokenDTO' + type: object description: 成功获取消费者Token summary: 按应用ID查询消费者Token(new added) tags: @@ -8667,155 +8667,6 @@ components: description: "" type: boolean type: object - OpenConsumerCreateRequestDTO: - example: - orgName: orgName - rateLimit: 0 - ownerName: ownerName - appId: appId - name: name - allowCreateApplication: false - allowManageUsers: false - rateLimitEnabled: false - orgId: orgId - properties: - appId: - description: 第三方应用ID - type: string - allowCreateApplication: - default: false - description: 是否允许该Consumer Token创建应用 - type: boolean - allowManageUsers: - default: false - description: 是否允许该Consumer Token管理用户 - type: boolean - name: - description: 第三方应用名称 - type: string - orgId: - description: 部门ID - type: string - orgName: - description: 部门名称 - type: string - ownerName: - description: 负责人用户名 - type: string - rateLimitEnabled: - default: false - description: 是否开启限流 - type: boolean - rateLimit: - description: 限流QPS,rateLimitEnabled 为 true 时必须大于 0;未开启限流时 0 表示不限流 - minimum: 0 - type: integer - required: - - appId - - name - - orgId - - ownerName - type: object - OpenConsumerInfoDTO: - example: - orgName: orgName - rateLimit: 0 - ownerName: ownerName - consumerId: 0 - appId: appId - name: name - allowCreateApplication: false - allowManageUsers: false - rateLimitEnabled: false - orgId: orgId - ownerEmail: ownerEmail - token: token - properties: - appId: - description: 第三方应用ID - type: string - name: - description: 第三方应用名称 - type: string - orgId: - description: 部门ID - type: string - orgName: - description: 部门名称 - type: string - ownerName: - description: 负责人用户名 - type: string - ownerEmail: - description: 负责人邮箱 - type: string - consumerId: - description: Consumer ID - format: int64 - type: integer - token: - description: Consumer Token,仅在创建或按应用查询详情时返回 - type: string - allowCreateApplication: - default: false - description: 是否允许该Consumer Token创建应用 - type: boolean - allowManageUsers: - default: false - description: 是否允许该Consumer Token管理用户 - type: boolean - rateLimit: - default: 0 - description: 限流QPS,0表示不限流 - minimum: 0 - type: integer - rateLimitEnabled: - default: false - description: 是否开启限流 - type: boolean - type: object - OpenConsumerTokenDTO: - example: - expires: 2000-01-23T04:56:07.000+00:00 - rateLimit: 0 - dataChangeCreatedTime: 2000-01-23T04:56:07.000+00:00 - dataChangeLastModifiedBy: dataChangeLastModifiedBy - consumerId: 0 - dataChangeCreatedBy: dataChangeCreatedBy - dataChangeLastModifiedTime: 2000-01-23T04:56:07.000+00:00 - token: token - properties: - consumerId: - description: Consumer ID - format: int64 - type: integer - token: - description: Consumer Token - type: string - rateLimit: - default: 0 - description: 限流QPS,0表示不限流 - minimum: 0 - type: integer - expires: - description: 过期时间 - format: date-time - type: string - dataChangeCreatedBy: - description: 创建人 - type: string - dataChangeCreatedTime: - description: 创建时间 - format: date-time - type: string - dataChangeLastModifiedBy: - description: 最后修改人 - type: string - dataChangeLastModifiedTime: - description: 最后修改时间 - format: date-time - type: string - type: object OpenUserInfoDTO: example: name: name diff --git a/tests/test_user_management_contract.py b/tests/test_user_management_contract.py index 9acf110a..e6011887 100644 --- a/tests/test_user_management_contract.py +++ b/tests/test_user_management_contract.py @@ -1,4 +1,3 @@ -import re import unittest from pathlib import Path @@ -62,7 +61,7 @@ def test_user_management_operations_support_consumer_manage_users_contract(self) self.assertEqual("query", operator_param["in"]) self.assertFalse(operator_param.get("required", False)) - def test_consumer_management_uses_typed_schemas_with_manage_users_flag(self): + def test_portal_consumer_management_keeps_internal_object_contract(self): for spec_file in SPEC_FILES: spec = self._load_spec(spec_file) schemas = spec["components"]["schemas"] @@ -70,49 +69,30 @@ def test_consumer_management_uses_typed_schemas_with_manage_users_flag(self): with self.subTest(spec=spec_file): create_consumer = spec["paths"]["/openapi/v1/consumers"]["post"] self.assertEqual( - "#/components/schemas/OpenConsumerCreateRequestDTO", - create_consumer["requestBody"]["content"]["application/json"]["schema"]["$ref"], + {"type": "object"}, + create_consumer["requestBody"]["content"]["application/json"]["schema"], ) self.assertEqual( - "#/components/schemas/OpenConsumerInfoDTO", - create_consumer["responses"]["200"]["content"]["application/json"]["schema"]["$ref"], + {"type": "object"}, + create_consumer["responses"]["200"]["content"]["application/json"]["schema"], ) list_consumers = spec["paths"]["/openapi/v1/consumers"]["get"] self.assertEqual( - "#/components/schemas/OpenConsumerInfoDTO", - list_consumers["responses"]["200"]["content"]["application/json"]["schema"]["items"]["$ref"], + {"type": "object"}, + list_consumers["responses"]["200"]["content"]["application/json"]["schema"]["items"], ) consumer_token = spec["paths"]["/openapi/v1/consumer-tokens/by-appId"]["get"] self.assertEqual( - "#/components/schemas/OpenConsumerTokenDTO", - consumer_token["responses"]["200"]["content"]["application/json"]["schema"]["$ref"], + {"type": "object"}, + consumer_token["responses"]["200"]["content"]["application/json"]["schema"], ) + self.assertNotIn("OpenConsumerCreateRequestDTO", schemas) + self.assertNotIn("OpenConsumerInfoDTO", schemas) self.assertNotIn("OpenConsumerSummaryDTO", schemas) - for schema_name in ("OpenConsumerCreateRequestDTO", "OpenConsumerInfoDTO"): - properties = schemas[schema_name]["properties"] - self.assertEqual("boolean", properties["allowCreateApplication"]["type"]) - self.assertEqual("boolean", properties["allowManageUsers"]["type"]) - self.assertEqual(0, properties["rateLimit"]["minimum"]) - create_schema = schemas["OpenConsumerCreateRequestDTO"] - self.assertEqual(["appId", "name", "orgId", "ownerName"], create_schema["required"]) - self.assertNotIn("default", create_schema["properties"]["rateLimit"]) - self.assertIn("必须大于 0", create_schema["properties"]["rateLimit"]["description"]) - self.assertEqual("boolean", - schemas["OpenConsumerInfoDTO"]["properties"]["rateLimitEnabled"]["type"]) - self.assertIn("token", schemas["OpenConsumerInfoDTO"]["properties"]) - token_properties = schemas["OpenConsumerTokenDTO"]["properties"] - self.assertNotIn("id", token_properties) - self.assertNotIn("deleted", token_properties) - self.assertNotIn("deletedAt", token_properties) - self.assertEqual("integer", token_properties["consumerId"]["type"]) - self.assertEqual("int64", token_properties["consumerId"]["format"]) - self.assertEqual("string", token_properties["token"]["type"]) - self.assertNotIn("nullable", token_properties["token"]) - self.assertEqual("string", token_properties["expires"]["type"]) - self.assertEqual("date-time", token_properties["expires"]["format"]) + self.assertNotIn("OpenConsumerTokenDTO", schemas) def test_spring_server_api_uses_user_management_name(self): api_dir = self.repo_root / "spring-boot2/src/main/java/com/apollo/openapi/server/api" @@ -130,39 +110,19 @@ def test_java_client_preserves_optional_operator_overloads(self): "createOrUpdateUser(OpenUserDTO openUserDTO, Boolean isCreate) throws ApiException", content) - def test_consumer_java_models_handle_null_json_and_redact_tokens(self): + def test_portal_consumer_models_are_not_generated(self): model_dir = self.repo_root / "java-client/src/main/java/org/openapitools/client/model" + spring_model_dir = self.repo_root / ( + "spring-boot2/src/main/java/com/apollo/openapi/server/model") for model_name in ( - "OpenConsumerCreateRequestDTO", "OpenConsumerInfoDTO", "OpenConsumerTokenDTO"): - content = (model_dir / f"{model_name}.java").read_text(encoding="utf-8") - + "OpenConsumerCreateRequestDTO", + "OpenConsumerInfoDTO", + "OpenConsumerSummaryDTO", + "OpenConsumerTokenDTO", + ): with self.subTest(model=model_name): - self.assertRegex(content, re.compile( - r"if \(jsonObj == null\) \{.*?return;.*?\}\s+" - r"Set> entries = jsonObj\.entrySet\(\);", - re.DOTALL)) - - self.assertFalse((model_dir / "OpenConsumerSummaryDTO.java").exists()) - - client_info = (model_dir / "OpenConsumerInfoDTO.java").read_text(encoding="utf-8") - self.assertIn('token == null ? "null" : "***redacted***"', client_info) - self.assertNotIn('token: ").append(toIndentedString(token))', client_info) - - spring_info = (self.repo_root / - "spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerInfoDTO.java" - ).read_text(encoding="utf-8") - self.assertIn('token == null ? "null" : "***redacted***"', spring_info) - self.assertNotIn('token: ").append(toIndentedString(token))', spring_info) - - client_token = (model_dir / "OpenConsumerTokenDTO.java").read_text(encoding="utf-8") - self.assertIn('token == null ? "null" : "***redacted***"', client_token) - self.assertNotIn('token: ").append(toIndentedString(token))', client_token) - - spring_token = (self.repo_root / - "spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenConsumerTokenDTO.java" - ).read_text(encoding="utf-8") - self.assertIn('token == null ? "null" : "***redacted***"', spring_token) - self.assertNotIn('token: ").append(toIndentedString(token))', spring_token) + self.assertFalse((model_dir / f"{model_name}.java").exists()) + self.assertFalse((spring_model_dir / f"{model_name}.java").exists()) def _find_parameter(self, operation, name): for parameter in operation.get("parameters", ()): diff --git a/typescript/.openapi-generator/FILES b/typescript/.openapi-generator/FILES index b9ea9930..227ec6c5 100644 --- a/typescript/.openapi-generator/FILES +++ b/typescript/.openapi-generator/FILES @@ -29,9 +29,6 @@ src/models/OpenAppNamespaceDTO.ts src/models/OpenAppRoleUserDTO.ts src/models/OpenClusterDTO.ts src/models/OpenClusterNamespaceRoleUserDTO.ts -src/models/OpenConsumerCreateRequestDTO.ts -src/models/OpenConsumerInfoDTO.ts -src/models/OpenConsumerTokenDTO.ts src/models/OpenCreateAppDTO.ts src/models/OpenCreateNamespaceDTO.ts src/models/OpenEnvClusterDTO.ts diff --git a/typescript/README.md b/typescript/README.md index e7218f63..826a3720 100644 --- a/typescript/README.md +++ b/typescript/README.md @@ -1,4 +1,4 @@ -## apollo-openapi@0.3.7 +## apollo-openapi@0.3.8 This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments: @@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co _published:_ ``` -npm install apollo-openapi@0.3.7 --save +npm install apollo-openapi@0.3.8 --save ``` _unPublished (not recommended):_ diff --git a/typescript/package.json b/typescript/package.json index e605432c..598e05be 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -1,6 +1,6 @@ { "name": "apollo-openapi", - "version": "0.3.7", + "version": "0.3.8", "description": "OpenAPI client for apollo-openapi", "author": "OpenAPI-Generator", "repository": { diff --git a/typescript/src/apis/PortalManagementApi.ts b/typescript/src/apis/PortalManagementApi.ts index f1a8032b..3cfbf916 100644 --- a/typescript/src/apis/PortalManagementApi.ts +++ b/typescript/src/apis/PortalManagementApi.ts @@ -13,19 +13,6 @@ import * as runtime from '../runtime'; -import type { - OpenConsumerCreateRequestDTO, - OpenConsumerInfoDTO, - OpenConsumerTokenDTO, -} from '../models'; -import { - OpenConsumerCreateRequestDTOFromJSON, - OpenConsumerCreateRequestDTOToJSON, - OpenConsumerInfoDTOFromJSON, - OpenConsumerInfoDTOToJSON, - OpenConsumerTokenDTOFromJSON, - OpenConsumerTokenDTOToJSON, -} from '../models'; export interface AddFavoriteRequest { body: object; @@ -49,7 +36,7 @@ export interface CheckSystemHealthRequest { } export interface CreateConsumerRequest { - openConsumerCreateRequestDTO: OpenConsumerCreateRequestDTO; + body: object; expires?: string; } @@ -396,9 +383,9 @@ export class PortalManagementApi extends runtime.BaseAPI { * POST /openapi/v1/consumers * 创建开放平台消费者(new added) */ - async createConsumerRaw(requestParameters: CreateConsumerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - if (requestParameters.openConsumerCreateRequestDTO === null || requestParameters.openConsumerCreateRequestDTO === undefined) { - throw new runtime.RequiredError('openConsumerCreateRequestDTO','Required parameter requestParameters.openConsumerCreateRequestDTO was null or undefined when calling createConsumer.'); + async createConsumerRaw(requestParameters: CreateConsumerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.body === null || requestParameters.body === undefined) { + throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createConsumer.'); } const queryParameters: any = {}; @@ -420,17 +407,17 @@ export class PortalManagementApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: OpenConsumerCreateRequestDTOToJSON(requestParameters.openConsumerCreateRequestDTO), + body: requestParameters.body as any, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => OpenConsumerInfoDTOFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response); } /** * POST /openapi/v1/consumers * 创建开放平台消费者(new added) */ - async createConsumer(requestParameters: CreateConsumerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + async createConsumer(requestParameters: CreateConsumerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.createConsumerRaw(requestParameters, initOverrides); return await response.value(); } @@ -1281,7 +1268,7 @@ export class PortalManagementApi extends runtime.BaseAPI { * GET /openapi/v1/consumers * 查询开放平台消费者列表(new added) */ - async getConsumerListRaw(requestParameters: GetConsumerListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + async getConsumerListRaw(requestParameters: GetConsumerListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { const queryParameters: any = {}; if (requestParameters.page !== undefined) { @@ -1305,14 +1292,14 @@ export class PortalManagementApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(OpenConsumerInfoDTOFromJSON)); + return new runtime.JSONApiResponse(response); } /** * GET /openapi/v1/consumers * 查询开放平台消费者列表(new added) */ - async getConsumerList(requestParameters: GetConsumerListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async getConsumerList(requestParameters: GetConsumerListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const response = await this.getConsumerListRaw(requestParameters, initOverrides); return await response.value(); } @@ -1321,7 +1308,7 @@ export class PortalManagementApi extends runtime.BaseAPI { * GET /openapi/v1/consumer-tokens/by-appId * 按应用ID查询消费者Token(new added) */ - async getConsumerTokenByAppIdRaw(requestParameters: GetConsumerTokenByAppIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async getConsumerTokenByAppIdRaw(requestParameters: GetConsumerTokenByAppIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.appId === null || requestParameters.appId === undefined) { throw new runtime.RequiredError('appId','Required parameter requestParameters.appId was null or undefined when calling getConsumerTokenByAppId.'); } @@ -1345,14 +1332,14 @@ export class PortalManagementApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => OpenConsumerTokenDTOFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response); } /** * GET /openapi/v1/consumer-tokens/by-appId * 按应用ID查询消费者Token(new added) */ - async getConsumerTokenByAppId(requestParameters: GetConsumerTokenByAppIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + async getConsumerTokenByAppId(requestParameters: GetConsumerTokenByAppIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getConsumerTokenByAppIdRaw(requestParameters, initOverrides); return await response.value(); } diff --git a/typescript/src/models/OpenConsumerCreateRequestDTO.ts b/typescript/src/models/OpenConsumerCreateRequestDTO.ts deleted file mode 100644 index 9db05b03..00000000 --- a/typescript/src/models/OpenConsumerCreateRequestDTO.ts +++ /dev/null @@ -1,131 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Apollo OpenAPI - *

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
- * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -/** - * - * @export - * @interface OpenConsumerCreateRequestDTO - */ -export interface OpenConsumerCreateRequestDTO { - /** - * 第三方应用ID - * @type {string} - * @memberof OpenConsumerCreateRequestDTO - */ - appId: string; - /** - * 是否允许该Consumer Token创建应用 - * @type {boolean} - * @memberof OpenConsumerCreateRequestDTO - */ - allowCreateApplication?: boolean; - /** - * 是否允许该Consumer Token管理用户 - * @type {boolean} - * @memberof OpenConsumerCreateRequestDTO - */ - allowManageUsers?: boolean; - /** - * 第三方应用名称 - * @type {string} - * @memberof OpenConsumerCreateRequestDTO - */ - name: string; - /** - * 部门ID - * @type {string} - * @memberof OpenConsumerCreateRequestDTO - */ - orgId: string; - /** - * 部门名称 - * @type {string} - * @memberof OpenConsumerCreateRequestDTO - */ - orgName?: string; - /** - * 负责人用户名 - * @type {string} - * @memberof OpenConsumerCreateRequestDTO - */ - ownerName: string; - /** - * 是否开启限流 - * @type {boolean} - * @memberof OpenConsumerCreateRequestDTO - */ - rateLimitEnabled?: boolean; - /** - * 限流QPS,rateLimitEnabled 为 true 时必须大于 0;未开启限流时 0 表示不限流 - * @type {number} - * @memberof OpenConsumerCreateRequestDTO - */ - rateLimit?: number; -} - -/** - * Check if a given object implements the OpenConsumerCreateRequestDTO interface. - */ -export function instanceOfOpenConsumerCreateRequestDTO(value: object): boolean { - let isInstance = true; - isInstance = isInstance && "appId" in value; - isInstance = isInstance && "name" in value; - isInstance = isInstance && "orgId" in value; - isInstance = isInstance && "ownerName" in value; - - return isInstance; -} - -export function OpenConsumerCreateRequestDTOFromJSON(json: any): OpenConsumerCreateRequestDTO { - return OpenConsumerCreateRequestDTOFromJSONTyped(json, false); -} - -export function OpenConsumerCreateRequestDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenConsumerCreateRequestDTO { - if ((json === undefined) || (json === null)) { - return json; - } - return { - - 'appId': json['appId'], - 'allowCreateApplication': !exists(json, 'allowCreateApplication') ? undefined : json['allowCreateApplication'], - 'allowManageUsers': !exists(json, 'allowManageUsers') ? undefined : json['allowManageUsers'], - 'name': json['name'], - 'orgId': json['orgId'], - 'orgName': !exists(json, 'orgName') ? undefined : json['orgName'], - 'ownerName': json['ownerName'], - 'rateLimitEnabled': !exists(json, 'rateLimitEnabled') ? undefined : json['rateLimitEnabled'], - 'rateLimit': !exists(json, 'rateLimit') ? undefined : json['rateLimit'], - }; -} - -export function OpenConsumerCreateRequestDTOToJSON(value?: OpenConsumerCreateRequestDTO | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; - } - return { - - 'appId': value.appId, - 'allowCreateApplication': value.allowCreateApplication, - 'allowManageUsers': value.allowManageUsers, - 'name': value.name, - 'orgId': value.orgId, - 'orgName': value.orgName, - 'ownerName': value.ownerName, - 'rateLimitEnabled': value.rateLimitEnabled, - 'rateLimit': value.rateLimit, - }; -} diff --git a/typescript/src/models/OpenConsumerInfoDTO.ts b/typescript/src/models/OpenConsumerInfoDTO.ts deleted file mode 100644 index 605815c7..00000000 --- a/typescript/src/models/OpenConsumerInfoDTO.ts +++ /dev/null @@ -1,151 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Apollo OpenAPI - *

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
- * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -/** - * - * @export - * @interface OpenConsumerInfoDTO - */ -export interface OpenConsumerInfoDTO { - /** - * 第三方应用ID - * @type {string} - * @memberof OpenConsumerInfoDTO - */ - appId?: string; - /** - * 第三方应用名称 - * @type {string} - * @memberof OpenConsumerInfoDTO - */ - name?: string; - /** - * 部门ID - * @type {string} - * @memberof OpenConsumerInfoDTO - */ - orgId?: string; - /** - * 部门名称 - * @type {string} - * @memberof OpenConsumerInfoDTO - */ - orgName?: string; - /** - * 负责人用户名 - * @type {string} - * @memberof OpenConsumerInfoDTO - */ - ownerName?: string; - /** - * 负责人邮箱 - * @type {string} - * @memberof OpenConsumerInfoDTO - */ - ownerEmail?: string; - /** - * Consumer ID - * @type {number} - * @memberof OpenConsumerInfoDTO - */ - consumerId?: number; - /** - * Consumer Token,仅在创建或按应用查询详情时返回 - * @type {string} - * @memberof OpenConsumerInfoDTO - */ - token?: string; - /** - * 是否允许该Consumer Token创建应用 - * @type {boolean} - * @memberof OpenConsumerInfoDTO - */ - allowCreateApplication?: boolean; - /** - * 是否允许该Consumer Token管理用户 - * @type {boolean} - * @memberof OpenConsumerInfoDTO - */ - allowManageUsers?: boolean; - /** - * 限流QPS,0表示不限流 - * @type {number} - * @memberof OpenConsumerInfoDTO - */ - rateLimit?: number; - /** - * 是否开启限流 - * @type {boolean} - * @memberof OpenConsumerInfoDTO - */ - rateLimitEnabled?: boolean; -} - -/** - * Check if a given object implements the OpenConsumerInfoDTO interface. - */ -export function instanceOfOpenConsumerInfoDTO(value: object): boolean { - let isInstance = true; - - return isInstance; -} - -export function OpenConsumerInfoDTOFromJSON(json: any): OpenConsumerInfoDTO { - return OpenConsumerInfoDTOFromJSONTyped(json, false); -} - -export function OpenConsumerInfoDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenConsumerInfoDTO { - if ((json === undefined) || (json === null)) { - return json; - } - return { - - 'appId': !exists(json, 'appId') ? undefined : json['appId'], - 'name': !exists(json, 'name') ? undefined : json['name'], - 'orgId': !exists(json, 'orgId') ? undefined : json['orgId'], - 'orgName': !exists(json, 'orgName') ? undefined : json['orgName'], - 'ownerName': !exists(json, 'ownerName') ? undefined : json['ownerName'], - 'ownerEmail': !exists(json, 'ownerEmail') ? undefined : json['ownerEmail'], - 'consumerId': !exists(json, 'consumerId') ? undefined : json['consumerId'], - 'token': !exists(json, 'token') ? undefined : json['token'], - 'allowCreateApplication': !exists(json, 'allowCreateApplication') ? undefined : json['allowCreateApplication'], - 'allowManageUsers': !exists(json, 'allowManageUsers') ? undefined : json['allowManageUsers'], - 'rateLimit': !exists(json, 'rateLimit') ? undefined : json['rateLimit'], - 'rateLimitEnabled': !exists(json, 'rateLimitEnabled') ? undefined : json['rateLimitEnabled'], - }; -} - -export function OpenConsumerInfoDTOToJSON(value?: OpenConsumerInfoDTO | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; - } - return { - - 'appId': value.appId, - 'name': value.name, - 'orgId': value.orgId, - 'orgName': value.orgName, - 'ownerName': value.ownerName, - 'ownerEmail': value.ownerEmail, - 'consumerId': value.consumerId, - 'token': value.token, - 'allowCreateApplication': value.allowCreateApplication, - 'allowManageUsers': value.allowManageUsers, - 'rateLimit': value.rateLimit, - 'rateLimitEnabled': value.rateLimitEnabled, - }; -} diff --git a/typescript/src/models/OpenConsumerTokenDTO.ts b/typescript/src/models/OpenConsumerTokenDTO.ts deleted file mode 100644 index 44a63e39..00000000 --- a/typescript/src/models/OpenConsumerTokenDTO.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Apollo OpenAPI - *

Apollo配置中心OpenAPI接口文档

认证方式

所有 API 接口都需要通过 Authorization header 进行身份验证。

获取 Token 的方式:

  1. Portal 管理界面获取:登录 Portal → 管理员工具 → 开放平台授权管理 → 创建第三方应用,获取 Token。
  2. Token 格式Authorization: token_value
  3. Token 权限:按应用/环境/命名空间授予,建议不同用途分别创建。

使用示例

curl -X GET \"http://localhost:8070/openapi/v1/apps\" \\ -H \"Authorization: your_token_here\"
- * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { exists, mapValues } from '../runtime'; -/** - * - * @export - * @interface OpenConsumerTokenDTO - */ -export interface OpenConsumerTokenDTO { - /** - * Consumer ID - * @type {number} - * @memberof OpenConsumerTokenDTO - */ - consumerId?: number; - /** - * Consumer Token - * @type {string} - * @memberof OpenConsumerTokenDTO - */ - token?: string; - /** - * 限流QPS,0表示不限流 - * @type {number} - * @memberof OpenConsumerTokenDTO - */ - rateLimit?: number; - /** - * 过期时间 - * @type {Date} - * @memberof OpenConsumerTokenDTO - */ - expires?: Date; - /** - * 创建人 - * @type {string} - * @memberof OpenConsumerTokenDTO - */ - dataChangeCreatedBy?: string; - /** - * 创建时间 - * @type {Date} - * @memberof OpenConsumerTokenDTO - */ - dataChangeCreatedTime?: Date; - /** - * 最后修改人 - * @type {string} - * @memberof OpenConsumerTokenDTO - */ - dataChangeLastModifiedBy?: string; - /** - * 最后修改时间 - * @type {Date} - * @memberof OpenConsumerTokenDTO - */ - dataChangeLastModifiedTime?: Date; -} - -/** - * Check if a given object implements the OpenConsumerTokenDTO interface. - */ -export function instanceOfOpenConsumerTokenDTO(value: object): boolean { - let isInstance = true; - - return isInstance; -} - -export function OpenConsumerTokenDTOFromJSON(json: any): OpenConsumerTokenDTO { - return OpenConsumerTokenDTOFromJSONTyped(json, false); -} - -export function OpenConsumerTokenDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenConsumerTokenDTO { - if ((json === undefined) || (json === null)) { - return json; - } - return { - - 'consumerId': !exists(json, 'consumerId') ? undefined : json['consumerId'], - 'token': !exists(json, 'token') ? undefined : json['token'], - 'rateLimit': !exists(json, 'rateLimit') ? undefined : json['rateLimit'], - 'expires': !exists(json, 'expires') ? undefined : (new Date(json['expires'])), - 'dataChangeCreatedBy': !exists(json, 'dataChangeCreatedBy') ? undefined : json['dataChangeCreatedBy'], - 'dataChangeCreatedTime': !exists(json, 'dataChangeCreatedTime') ? undefined : (new Date(json['dataChangeCreatedTime'])), - 'dataChangeLastModifiedBy': !exists(json, 'dataChangeLastModifiedBy') ? undefined : json['dataChangeLastModifiedBy'], - 'dataChangeLastModifiedTime': !exists(json, 'dataChangeLastModifiedTime') ? undefined : (new Date(json['dataChangeLastModifiedTime'])), - }; -} - -export function OpenConsumerTokenDTOToJSON(value?: OpenConsumerTokenDTO | null): any { - if (value === undefined) { - return undefined; - } - if (value === null) { - return null; - } - return { - - 'consumerId': value.consumerId, - 'token': value.token, - 'rateLimit': value.rateLimit, - 'expires': value.expires === undefined ? undefined : (value.expires.toISOString()), - 'dataChangeCreatedBy': value.dataChangeCreatedBy, - 'dataChangeCreatedTime': value.dataChangeCreatedTime === undefined ? undefined : (value.dataChangeCreatedTime.toISOString()), - 'dataChangeLastModifiedBy': value.dataChangeLastModifiedBy, - 'dataChangeLastModifiedTime': value.dataChangeLastModifiedTime === undefined ? undefined : (value.dataChangeLastModifiedTime.toISOString()), - }; -} diff --git a/typescript/src/models/index.ts b/typescript/src/models/index.ts index aea9fe95..7eafcc5c 100644 --- a/typescript/src/models/index.ts +++ b/typescript/src/models/index.ts @@ -9,9 +9,6 @@ export * from './OpenAppNamespaceDTO'; export * from './OpenAppRoleUserDTO'; export * from './OpenClusterDTO'; export * from './OpenClusterNamespaceRoleUserDTO'; -export * from './OpenConsumerCreateRequestDTO'; -export * from './OpenConsumerInfoDTO'; -export * from './OpenConsumerTokenDTO'; export * from './OpenCreateAppDTO'; export * from './OpenCreateNamespaceDTO'; export * from './OpenEnvClusterDTO'; From 6765fbb00a5ec1b58e71b1ba77a3d2d38425909a Mon Sep 17 00:00:00 2001 From: Jason Song Date: Sat, 6 Jun 2026 19:20:40 +0800 Subject: [PATCH 2/2] chore: allow generated ApiForhead identifier --- _typos.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 _typos.toml diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000..7da27f10 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,2 @@ +[default.extend-identifiers] +ApiForhead = "ApiForhead"