From 87971f10176ef123d0d8e9ef34836c5bff96bc40 Mon Sep 17 00:00:00 2001 From: tacklequestions Date: Sun, 14 Dec 2025 16:38:59 +0800 Subject: [PATCH] feat: release and accessKey and permission endpoints --- apollo-openapi.yaml | 1739 ++++++-- java-client/.openapi-generator/FILES | 39 +- java-client/README.md | 56 +- java-client/api/openapi.yaml | 1942 ++++++++- java-client/docs/AccessKeyManagementApi.md | 376 ++ java-client/docs/AppManagementApi.md | 21 +- java-client/docs/ClusterManagementApi.md | 7 +- java-client/docs/InstanceManagementApi.md | 2 +- java-client/docs/NamespaceManagementApi.md | 9 +- java-client/docs/OpenAccessKeyDTO.md | 20 + java-client/docs/OpenAppRoleUserDTO.md | 11 + .../docs/OpenClusterNamespaceRoleUserDTO.md | 14 + .../docs/OpenEnvNamespaceRoleUserDTO.md | 14 + java-client/docs/OpenNamespaceRoleUserDTO.md | 13 + ...ntity.md => OpenPermissionConditionDTO.md} | 5 +- java-client/docs/OpenReleaseBO.md | 11 - java-client/docs/OpenReleaseChangeDTO.md | 13 + java-client/docs/OpenReleaseDiffDTO.md | 10 + java-client/docs/OpenUserInfoDTO.md | 13 + java-client/docs/PermissionManagementApi.md | 1933 +++++++++ java-client/docs/ReleaseManagementApi.md | 173 +- .../java/org/openapitools/client/JSON.java | 11 +- .../client/api/AccessKeyManagementApi.java | 780 ++++ .../client/api/AppManagementApi.java | 54 +- .../client/api/ClusterManagementApi.java | 18 +- .../client/api/InstanceManagementApi.java | 13 +- .../client/api/NamespaceManagementApi.java | 19 +- .../client/api/PermissionManagementApi.java | 3841 +++++++++++++++++ .../client/api/ReleaseManagementApi.java | 427 +- .../client/model/OpenAccessKeyDTO.java | 508 +++ .../client/model/OpenAppRoleUserDTO.java | 260 ++ .../OpenClusterNamespaceRoleUserDTO.java | 372 ++ .../model/OpenEnvNamespaceRoleUserDTO.java | 372 ++ .../model/OpenNamespaceRoleUserDTO.java | 341 ++ ...y.java => OpenPermissionConditionDTO.java} | 110 +- .../client/model/OpenReleaseChangeDTO.java | 300 ++ ...ReleaseBO.java => OpenReleaseDiffDTO.java} | 135 +- .../client/model/OpenUserInfoDTO.java | 297 ++ .../api/AccessKeyManagementApiTest.java | 115 + .../client/api/AppManagementApiTest.java | 6 +- .../client/api/ClusterManagementApiTest.java | 2 +- .../api/NamespaceManagementApiTest.java | 2 +- .../api/PermissionManagementApiTest.java | 464 ++ .../client/api/ReleaseManagementApiTest.java | 48 +- .../client/model/OpenAccessKeyDTOTest.java | 128 + ...OTest.java => OpenAppRoleUserDTOTest.java} | 27 +- .../OpenClusterNamespaceRoleUserDTOTest.java | 83 + .../OpenEnvNamespaceRoleUserDTOTest.java | 83 + .../model/OpenNamespaceRoleUserDTOTest.java | 75 + ...va => OpenPermissionConditionDTOTest.java} | 26 +- .../model/OpenReleaseChangeDTOTest.java | 72 + .../client/model/OpenReleaseDiffDTOTest.java | 51 + .../client/model/OpenUserInfoDTOTest.java | 72 + python/.openapi-generator/FILES | 48 +- python/README.md | 85 +- python/apollo_openapi/apis/path_to_api.py | 75 +- ...napi_v1_apps_app_id_envs_env_accesskeys.py | 9 + ...pp_id_envs_env_accesskeys_access_key_id.py | 7 + ...env_accesskeys_access_key_id_activation.py | 7 + ...v_accesskeys_access_key_id_deactivation.py | 7 + ...cluster_name_namespaces_permission_init.py | 7 + ..._namespaces_permissions_permission_type.py | 7 + ...ters_cluster_name_namespaces_role_users.py | 7 + ...v_clusters_cluster_name_roles_role_type.py | 9 + ...espace_name_permissions_permission_type.py | 7 + ...nv_namespaces_namespace_name_role_users.py | 7 + ...mespaces_namespace_name_roles_role_type.py | 9 + ...mespaces_namespace_name_permission_init.py | 7 + ...espace_name_permissions_permission_type.py | 7 + ...id_namespaces_namespace_name_role_users.py | 7 + ...mespaces_namespace_name_roles_role_type.py | 9 + ...apps_app_id_permissions_permission_type.py | 7 + .../openapi_v1_apps_app_id_role_users.py | 7 + .../openapi_v1_apps_app_id_roles_master.py | 9 + .../openapi_v1_apps_app_id_roles_role_type.py | 9 + ..._namespaces_namespace_name_releases_all.py | 7 - ...openapi_v1_envs_env_releases_comparison.py | 7 + .../apis/paths/openapi_v1_permissions_root.py | 7 + ...penapi_v1_system_role_manage_app_master.py | 7 + ...napi_v1_system_roles_create_application.py | 11 + ...tem_roles_create_application_role_users.py | 7 + python/apollo_openapi/apis/tag_to_api.py | 6 + python/apollo_openapi/apis/tags/__init__.py | 2 + .../apis/tags/access_key_management_api.py | 31 + .../apis/tags/permission_management_api.py | 73 + .../apis/tags/release_management_api.py | 4 +- .../model/open_access_key_dto.py | 178 + .../model/open_access_key_dto.pyi | 178 + ...lease_bo.pyi => open_app_role_user_dto.py} | 48 +- ...lease_bo.py => open_app_role_user_dto.pyi} | 48 +- .../open_cluster_namespace_role_user_dto.py | 170 + .../open_cluster_namespace_role_user_dto.pyi | 170 + .../model/open_env_namespace_role_user_dto.py | 170 + .../open_env_namespace_role_user_dto.pyi | 170 + .../model/open_namespace_role_user_dto.py | 160 + .../model/open_namespace_role_user_dto.pyi | 160 + ...ty.py => open_permission_condition_dto.py} | 30 +- ....pyi => open_permission_condition_dto.pyi} | 30 +- .../model/open_release_change_dto.py | 108 + .../model/open_release_change_dto.pyi | 108 + .../model/open_release_diff_dto.py | 105 + .../model/open_release_diff_dto.pyi | 105 + .../model/open_user_info_dto.py | 108 + .../model/open_user_info_dto.pyi | 108 + python/apollo_openapi/models/__init__.py | 11 +- python/apollo_openapi/paths/__init__.py | 25 +- .../paths/openapi_v1_apps_app_id/delete.py | 9 +- .../paths/openapi_v1_apps_app_id/delete.pyi | 9 +- .../paths/openapi_v1_apps_app_id/put.py | 9 +- .../paths/openapi_v1_apps_app_id/put.pyi | 9 +- .../__init__.py | 7 + .../get.py | 329 ++ .../get.pyi | 321 ++ .../post.py | 358 ++ .../post.pyi | 350 ++ .../__init__.py | 7 + .../delete.py | 334 ++ .../delete.pyi | 326 ++ .../__init__.py | 7 + .../put.py | 334 ++ .../put.pyi | 326 ++ .../__init__.py | 7 + .../put.py | 280 ++ .../put.pyi | 272 ++ .../post.py | 33 +- .../post.pyi | 33 +- .../__init__.py | 7 + .../post.py | 334 ++ .../post.pyi | 326 ++ .../__init__.py | 7 + .../get.py | 377 ++ .../get.pyi | 369 ++ .../__init__.py | 7 + .../get.py | 313 ++ .../get.pyi | 305 ++ .../__init__.py | 7 + .../delete.py | 353 ++ .../delete.pyi | 345 ++ .../post.py | 353 ++ .../post.pyi | 345 ++ .../__init__.py | 7 + .../get.py | 93 +- .../get.pyi | 93 +- .../__init__.py | 7 + .../get.py | 313 ++ .../get.pyi | 305 ++ .../__init__.py | 7 + .../delete.py | 353 ++ .../delete.pyi | 345 ++ .../post.py | 353 ++ .../post.pyi | 345 ++ .../__init__.py | 7 + .../post.py | 325 ++ .../post.pyi | 317 ++ .../__init__.py | 7 + .../get.py | 368 ++ .../get.pyi | 360 ++ .../__init__.py | 7 + .../get.py | 304 ++ .../get.pyi | 296 ++ .../__init__.py | 7 + .../delete.py | 344 ++ .../delete.pyi | 336 ++ .../post.py | 344 ++ .../post.pyi | 336 ++ .../__init__.py | 7 + .../get.py | 359 ++ .../get.pyi | 351 ++ .../__init__.py | 7 + .../openapi_v1_apps_app_id_role_users/get.py | 295 ++ .../openapi_v1_apps_app_id_role_users/get.pyi | 287 ++ .../__init__.py | 7 + .../delete.py | 326 ++ .../delete.pyi | 318 ++ .../post.py | 326 ++ .../post.pyi | 318 ++ .../__init__.py | 7 + .../delete.py | 335 ++ .../delete.pyi | 327 ++ .../post.py | 433 ++ .../post.pyi | 425 ++ .../paths/openapi_v1_apps_envs_env/post.py | 9 +- .../paths/openapi_v1_apps_envs_env/post.pyi | 9 +- .../delete.py | 9 +- .../delete.pyi | 9 +- .../post.py | 57 + .../post.pyi | 57 + .../post.py | 57 + .../post.pyi | 57 + .../post.py | 57 + .../post.pyi | 57 + .../__init__.py | 7 - .../get.py | 3 +- .../get.pyi | 3 +- .../__init__.py | 7 + .../get.py | 360 ++ .../get.pyi | 352 ++ .../put.py | 33 +- .../put.pyi | 33 +- .../openapi_v1_permissions_root/__init__.py | 7 + .../paths/openapi_v1_permissions_root/get.py | 296 ++ .../paths/openapi_v1_permissions_root/get.pyi | 288 ++ .../__init__.py | 7 + .../get.py | 267 ++ .../get.pyi | 259 ++ .../__init__.py | 7 + .../delete.py | 272 ++ .../delete.pyi | 264 ++ .../get.py | 322 ++ .../get.pyi | 314 ++ .../post.py | 379 ++ .../post.pyi | 371 ++ .../__init__.py | 7 + .../get.py | 261 ++ .../get.pyi | 253 ++ .../docs/apis/tags/AccessKeyManagementApi.md | 664 +++ python/docs/apis/tags/AppManagementApi.md | 39 +- python/docs/apis/tags/ClusterManagementApi.md | 13 +- .../docs/apis/tags/InstanceManagementApi.md | 23 +- .../docs/apis/tags/NamespaceManagementApi.md | 14 +- .../docs/apis/tags/PermissionManagementApi.md | 3412 +++++++++++++++ python/docs/apis/tags/ReleaseManagementApi.md | 436 +- python/docs/models/OpenAccessKeyDTO.md | 24 + ...OpenReleaseBO.md => OpenAppRoleUserDTO.md} | 10 +- .../models/OpenClusterNamespaceRoleUserDTO.md | 42 + .../models/OpenEnvNamespaceRoleUserDTO.md | 42 + .../docs/models/OpenNamespaceRoleUserDTO.md | 41 + ...ntity.md => OpenPermissionConditionDTO.md} | 5 +- python/docs/models/OpenReleaseChangeDTO.md | 17 + python/docs/models/OpenReleaseDiffDTO.md | 28 + python/docs/models/OpenUserInfoDTO.md | 17 + ...ease_bo.py => test_open_access_key_dto.py} | 6 +- .../test_open_app_role_user_dto.py | 25 + ...st_open_cluster_namespace_role_user_dto.py | 25 + .../test_open_env_namespace_role_user_dto.py | 25 + .../test_open_namespace_role_user_dto.py | 25 + .../test_open_permission_condition_dto.py | 25 + .../test_open_release_change_dto.py | 25 + .../test_models/test_open_release_diff_dto.py | 25 + ...v_entity.py => test_open_user_info_dto.py} | 6 +- .../test_delete.py | 3 +- .../test_openapi_v1_apps_app_id/test_put.py | 3 +- .../__init__.py | 0 .../test_get.py | 41 + .../test_post.py | 41 + .../__init__.py | 1 + .../test_delete.py | 40 + .../__init__.py | 1 + .../test_put.py | 40 + .../__init__.py | 1 + .../test_put.py | 40 + .../test_post.py | 3 +- .../__init__.py | 1 + .../test_post.py | 40 + .../__init__.py | 1 + .../test_get.py | 8 +- .../__init__.py | 1 + .../test_get.py | 41 + .../__init__.py | 1 + .../test_delete.py | 40 + .../test_post.py | 40 + .../__init__.py | 1 + .../test_get.py | 41 + .../__init__.py | 1 + .../test_get.py | 41 + .../__init__.py | 1 + .../test_delete.py | 40 + .../test_post.py | 40 + .../__init__.py | 1 + .../test_post.py | 40 + .../__init__.py | 1 + .../test_get.py | 41 + .../__init__.py | 1 + .../test_get.py | 41 + .../__init__.py | 1 + .../test_delete.py | 40 + .../test_post.py | 40 + .../__init__.py | 1 + .../test_get.py | 41 + .../__init__.py | 1 + .../test_get.py | 41 + .../__init__.py | 1 + .../test_delete.py | 40 + .../test_post.py | 40 + .../__init__.py | 1 + .../test_delete.py | 40 + .../test_post.py | 40 + .../test_post.py | 3 +- .../test_delete.py | 3 +- .../__init__.py | 1 + .../test_get.py | 41 + .../test_put.py | 3 +- .../__init__.py | 1 + .../test_get.py | 41 + .../__init__.py | 1 + .../test_get.py | 41 + .../__init__.py | 1 + .../test_delete.py | 40 + .../test_get.py | 41 + .../test_post.py | 40 + .../__init__.py | 1 + .../test_get.py | 41 + rust/.openapi-generator/FILES | 22 +- rust/README.md | 11 +- rust/docs/OpenAccessKeyDto.md | 19 + ...OpenReleaseBo.md => OpenAppRoleUserDto.md} | 6 +- rust/docs/OpenClusterNamespaceRoleUserDto.md | 13 + rust/docs/OpenEnvNamespaceRoleUserDto.md | 13 + rust/docs/OpenNamespaceRoleUserDto.md | 12 + ...ntity.md => OpenPermissionConditionDto.md} | 5 +- rust/docs/OpenReleaseChangeDto.md | 12 + rust/docs/OpenReleaseDiffDto.md | 9 + rust/docs/OpenUserInfoDto.md | 12 + rust/src/models/mod.rs | 22 +- rust/src/models/open_access_key_dto.rs | 67 + rust/src/models/open_app_role_user_dto.rs | 31 + .../open_cluster_namespace_role_user_dto.rs | 43 + .../open_env_namespace_role_user_dto.rs | 43 + .../models/open_namespace_role_user_dto.rs | 39 + ...ty.rs => open_permission_condition_dto.rs} | 20 +- rust/src/models/open_release_change_dto.rs | 39 + ...release_bo.rs => open_release_diff_dto.rs} | 18 +- rust/src/models/open_user_info_dto.rs | 39 + spring-boot2/.openapi-generator/FILES | 17 +- .../server/api/AccessKeyManagementApi.java | 217 + .../api/AccessKeyManagementApiController.java | 44 + .../api/AccessKeyManagementApiDelegate.java | 131 + .../openapi/server/api/AppManagementApi.java | 18 +- .../server/api/AppManagementApiDelegate.java | 6 +- .../server/api/ClusterManagementApi.java | 6 +- .../api/ClusterManagementApiDelegate.java | 2 +- .../server/api/InstanceManagementApi.java | 4 +- .../api/InstanceManagementApiDelegate.java | 2 +- .../server/api/NamespaceManagementApi.java | 9 +- .../api/NamespaceManagementApiDelegate.java | 2 +- .../server/api/PermissionManagementApi.java | 989 +++++ .../PermissionManagementApiController.java | 50 + .../api/PermissionManagementApiDelegate.java | 586 +++ .../server/api/ReleaseManagementApi.java | 109 +- .../api/ReleaseManagementApiController.java | 2 +- .../api/ReleaseManagementApiDelegate.java | 74 +- .../server/model/OpenAccessKeyDTO.java | 322 ++ .../server/model/OpenAppRoleUserDTO.java | 118 + .../OpenClusterNamespaceRoleUserDTO.java | 199 + .../model/OpenEnvNamespaceRoleUserDTO.java | 199 + .../model/OpenNamespaceRoleUserDTO.java | 175 + ...y.java => OpenPermissionConditionDTO.java} | 60 +- .../openapi/server/model/OpenReleaseBO.java | 119 - .../server/model/OpenReleaseChangeDTO.java | 154 + .../server/model/OpenReleaseDiffDTO.java | 94 + .../openapi/server/model/OpenUserInfoDTO.java | 154 + spring-boot2/src/main/resources/openapi.yaml | 2000 ++++++++- typescript/.openapi-generator/FILES | 13 +- typescript/src/apis/AccessKeyManagementApi.ts | 282 ++ typescript/src/apis/AppManagementApi.ts | 27 +- typescript/src/apis/ClusterManagementApi.ts | 9 +- typescript/src/apis/InstanceManagementApi.ts | 6 +- typescript/src/apis/NamespaceManagementApi.ts | 9 +- .../src/apis/PermissionManagementApi.ts | 1438 ++++++ typescript/src/apis/ReleaseManagementApi.ts | 161 +- typescript/src/apis/index.ts | 2 + typescript/src/models/OpenAccessKeyDTO.ts | 144 + ...OpenReleaseBO.ts => OpenAppRoleUserDTO.ts} | 52 +- .../models/OpenClusterNamespaceRoleUserDTO.ts | 103 + .../src/models/OpenEnvNamespaceRoleUserDTO.ts | 103 + .../src/models/OpenNamespaceRoleUserDTO.ts | 95 + ...ntity.ts => OpenPermissionConditionDTO.ts} | 36 +- typescript/src/models/OpenReleaseChangeDTO.ts | 88 + typescript/src/models/OpenReleaseDiffDTO.ts | 71 + typescript/src/models/OpenUserInfoDTO.ts | 88 + typescript/src/models/index.ts | 11 +- 371 files changed, 52423 insertions(+), 2492 deletions(-) create mode 100644 java-client/docs/AccessKeyManagementApi.md create mode 100644 java-client/docs/OpenAccessKeyDTO.md create mode 100644 java-client/docs/OpenAppRoleUserDTO.md create mode 100644 java-client/docs/OpenClusterNamespaceRoleUserDTO.md create mode 100644 java-client/docs/OpenEnvNamespaceRoleUserDTO.md create mode 100644 java-client/docs/OpenNamespaceRoleUserDTO.md rename java-client/docs/{KVEntity.md => OpenPermissionConditionDTO.md} (54%) delete mode 100644 java-client/docs/OpenReleaseBO.md create mode 100644 java-client/docs/OpenReleaseChangeDTO.md create mode 100644 java-client/docs/OpenReleaseDiffDTO.md create mode 100644 java-client/docs/OpenUserInfoDTO.md create mode 100644 java-client/docs/PermissionManagementApi.md create mode 100644 java-client/src/main/java/org/openapitools/client/api/AccessKeyManagementApi.java create mode 100644 java-client/src/main/java/org/openapitools/client/api/PermissionManagementApi.java create mode 100644 java-client/src/main/java/org/openapitools/client/model/OpenAccessKeyDTO.java create mode 100644 java-client/src/main/java/org/openapitools/client/model/OpenAppRoleUserDTO.java create mode 100644 java-client/src/main/java/org/openapitools/client/model/OpenClusterNamespaceRoleUserDTO.java create mode 100644 java-client/src/main/java/org/openapitools/client/model/OpenEnvNamespaceRoleUserDTO.java create mode 100644 java-client/src/main/java/org/openapitools/client/model/OpenNamespaceRoleUserDTO.java rename java-client/src/main/java/org/openapitools/client/model/{KVEntity.java => OpenPermissionConditionDTO.java} (62%) create mode 100644 java-client/src/main/java/org/openapitools/client/model/OpenReleaseChangeDTO.java rename java-client/src/main/java/org/openapitools/client/model/{OpenReleaseBO.java => OpenReleaseDiffDTO.java} (59%) create mode 100644 java-client/src/main/java/org/openapitools/client/model/OpenUserInfoDTO.java create mode 100644 java-client/src/test/java/org/openapitools/client/api/AccessKeyManagementApiTest.java create mode 100644 java-client/src/test/java/org/openapitools/client/api/PermissionManagementApiTest.java create mode 100644 java-client/src/test/java/org/openapitools/client/model/OpenAccessKeyDTOTest.java rename java-client/src/test/java/org/openapitools/client/model/{OpenReleaseBOTest.java => OpenAppRoleUserDTOTest.java} (73%) create mode 100644 java-client/src/test/java/org/openapitools/client/model/OpenClusterNamespaceRoleUserDTOTest.java create mode 100644 java-client/src/test/java/org/openapitools/client/model/OpenEnvNamespaceRoleUserDTOTest.java create mode 100644 java-client/src/test/java/org/openapitools/client/model/OpenNamespaceRoleUserDTOTest.java rename java-client/src/test/java/org/openapitools/client/model/{KVEntityTest.java => OpenPermissionConditionDTOTest.java} (75%) create mode 100644 java-client/src/test/java/org/openapitools/client/model/OpenReleaseChangeDTOTest.java create mode 100644 java-client/src/test/java/org/openapitools/client/model/OpenReleaseDiffDTOTest.java create mode 100644 java-client/src/test/java/org/openapitools/client/model/OpenUserInfoDTOTest.java create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_permissions_permission_type.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_role_users.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_roles_master.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_roles_role_type.py delete mode 100644 python/apollo_openapi/apis/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_envs_env_releases_comparison.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_permissions_root.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_system_role_manage_app_master.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_system_roles_create_application.py create mode 100644 python/apollo_openapi/apis/paths/openapi_v1_system_roles_create_application_role_users.py create mode 100644 python/apollo_openapi/apis/tags/access_key_management_api.py create mode 100644 python/apollo_openapi/apis/tags/permission_management_api.py create mode 100644 python/apollo_openapi/model/open_access_key_dto.py create mode 100644 python/apollo_openapi/model/open_access_key_dto.pyi rename python/apollo_openapi/model/{open_release_bo.pyi => open_app_role_user_dto.py} (67%) rename python/apollo_openapi/model/{open_release_bo.py => open_app_role_user_dto.pyi} (67%) create mode 100644 python/apollo_openapi/model/open_cluster_namespace_role_user_dto.py create mode 100644 python/apollo_openapi/model/open_cluster_namespace_role_user_dto.pyi create mode 100644 python/apollo_openapi/model/open_env_namespace_role_user_dto.py create mode 100644 python/apollo_openapi/model/open_env_namespace_role_user_dto.pyi create mode 100644 python/apollo_openapi/model/open_namespace_role_user_dto.py create mode 100644 python/apollo_openapi/model/open_namespace_role_user_dto.pyi rename python/apollo_openapi/model/{kv_entity.py => open_permission_condition_dto.py} (71%) rename python/apollo_openapi/model/{kv_entity.pyi => open_permission_condition_dto.pyi} (71%) create mode 100644 python/apollo_openapi/model/open_release_change_dto.py create mode 100644 python/apollo_openapi/model/open_release_change_dto.pyi create mode 100644 python/apollo_openapi/model/open_release_diff_dto.py create mode 100644 python/apollo_openapi/model/open_release_diff_dto.pyi create mode 100644 python/apollo_openapi/model/open_user_info_dto.py create mode 100644 python/apollo_openapi/model/open_user_info_dto.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/get.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/get.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/post.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/post.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/delete.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/delete.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/put.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/put.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/put.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/put.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/post.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/post.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/get.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/get.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/get.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/get.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/delete.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/delete.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/post.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/post.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/__init__.py rename python/apollo_openapi/paths/{openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all => openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type}/get.py (86%) rename python/apollo_openapi/paths/{openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all => openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type}/get.pyi (86%) create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/get.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/get.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/delete.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/delete.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/post.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/post.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/post.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/post.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/get.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/get.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users/get.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users/get.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/delete.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/delete.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/post.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/post.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_permissions_permission_type/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_permissions_permission_type/get.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_permissions_permission_type/get.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_role_users/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_role_users/get.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_role_users/get.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/delete.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/delete.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/post.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/post.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/delete.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/delete.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/post.py create mode 100644 python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/post.pyi delete mode 100644 python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_envs_env_releases_comparison/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_envs_env_releases_comparison/get.py create mode 100644 python/apollo_openapi/paths/openapi_v1_envs_env_releases_comparison/get.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_permissions_root/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_permissions_root/get.py create mode 100644 python/apollo_openapi/paths/openapi_v1_permissions_root/get.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_system_role_manage_app_master/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_system_role_manage_app_master/get.py create mode 100644 python/apollo_openapi/paths/openapi_v1_system_role_manage_app_master/get.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_system_roles_create_application/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_system_roles_create_application/delete.py create mode 100644 python/apollo_openapi/paths/openapi_v1_system_roles_create_application/delete.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_system_roles_create_application/get.py create mode 100644 python/apollo_openapi/paths/openapi_v1_system_roles_create_application/get.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_system_roles_create_application/post.py create mode 100644 python/apollo_openapi/paths/openapi_v1_system_roles_create_application/post.pyi create mode 100644 python/apollo_openapi/paths/openapi_v1_system_roles_create_application_role_users/__init__.py create mode 100644 python/apollo_openapi/paths/openapi_v1_system_roles_create_application_role_users/get.py create mode 100644 python/apollo_openapi/paths/openapi_v1_system_roles_create_application_role_users/get.pyi create mode 100644 python/docs/apis/tags/AccessKeyManagementApi.md create mode 100644 python/docs/apis/tags/PermissionManagementApi.md create mode 100644 python/docs/models/OpenAccessKeyDTO.md rename python/docs/models/{OpenReleaseBO.md => OpenAppRoleUserDTO.md} (77%) create mode 100644 python/docs/models/OpenClusterNamespaceRoleUserDTO.md create mode 100644 python/docs/models/OpenEnvNamespaceRoleUserDTO.md create mode 100644 python/docs/models/OpenNamespaceRoleUserDTO.md rename python/docs/models/{KVEntity.md => OpenPermissionConditionDTO.md} (86%) create mode 100644 python/docs/models/OpenReleaseChangeDTO.md create mode 100644 python/docs/models/OpenReleaseDiffDTO.md create mode 100644 python/docs/models/OpenUserInfoDTO.md rename python/test/test_models/{test_open_release_bo.py => test_open_access_key_dto.py} (86%) create mode 100644 python/test/test_models/test_open_app_role_user_dto.py create mode 100644 python/test/test_models/test_open_cluster_namespace_role_user_dto.py create mode 100644 python/test/test_models/test_open_env_namespace_role_user_dto.py create mode 100644 python/test/test_models/test_open_namespace_role_user_dto.py create mode 100644 python/test/test_models/test_open_permission_condition_dto.py create mode 100644 python/test/test_models/test_open_release_change_dto.py create mode 100644 python/test/test_models/test_open_release_diff_dto.py rename python/test/test_models/{test_kv_entity.py => test_open_user_info_dto.py} (87%) rename python/test/test_paths/{test_openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all => test_openapi_v1_apps_app_id_envs_env_accesskeys}/__init__.py (100%) create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys/test_get.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys/test_post.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/test_delete.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/test_put.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/test_put.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/test_post.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/__init__.py rename python/test/test_paths/{test_openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all => test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type}/test_get.py (60%) create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/test_get.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/test_delete.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/test_post.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/test_get.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/test_get.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/test_delete.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/test_post.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/test_post.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/test_get.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_role_users/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_role_users/test_get.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/test_delete.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/test_post.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_permissions_permission_type/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_permissions_permission_type/test_get.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_role_users/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_role_users/test_get.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_roles_master/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_roles_master/test_delete.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_roles_master/test_post.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_roles_role_type/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_roles_role_type/test_delete.py create mode 100644 python/test/test_paths/test_openapi_v1_apps_app_id_roles_role_type/test_post.py create mode 100644 python/test/test_paths/test_openapi_v1_envs_env_releases_comparison/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_envs_env_releases_comparison/test_get.py create mode 100644 python/test/test_paths/test_openapi_v1_permissions_root/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_permissions_root/test_get.py create mode 100644 python/test/test_paths/test_openapi_v1_system_role_manage_app_master/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_system_role_manage_app_master/test_get.py create mode 100644 python/test/test_paths/test_openapi_v1_system_roles_create_application/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_system_roles_create_application/test_delete.py create mode 100644 python/test/test_paths/test_openapi_v1_system_roles_create_application/test_get.py create mode 100644 python/test/test_paths/test_openapi_v1_system_roles_create_application/test_post.py create mode 100644 python/test/test_paths/test_openapi_v1_system_roles_create_application_role_users/__init__.py create mode 100644 python/test/test_paths/test_openapi_v1_system_roles_create_application_role_users/test_get.py create mode 100644 rust/docs/OpenAccessKeyDto.md rename rust/docs/{OpenReleaseBo.md => OpenAppRoleUserDto.md} (58%) create mode 100644 rust/docs/OpenClusterNamespaceRoleUserDto.md create mode 100644 rust/docs/OpenEnvNamespaceRoleUserDto.md create mode 100644 rust/docs/OpenNamespaceRoleUserDto.md rename rust/docs/{KvEntity.md => OpenPermissionConditionDto.md} (71%) create mode 100644 rust/docs/OpenReleaseChangeDto.md create mode 100644 rust/docs/OpenReleaseDiffDto.md create mode 100644 rust/docs/OpenUserInfoDto.md create mode 100644 rust/src/models/open_access_key_dto.rs create mode 100644 rust/src/models/open_app_role_user_dto.rs create mode 100644 rust/src/models/open_cluster_namespace_role_user_dto.rs create mode 100644 rust/src/models/open_env_namespace_role_user_dto.rs create mode 100644 rust/src/models/open_namespace_role_user_dto.rs rename rust/src/models/{kv_entity.rs => open_permission_condition_dto.rs} (72%) create mode 100644 rust/src/models/open_release_change_dto.rs rename rust/src/models/{open_release_bo.rs => open_release_diff_dto.rs} (68%) create mode 100644 rust/src/models/open_user_info_dto.rs create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApi.java create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApiController.java create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApiDelegate.java create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/api/PermissionManagementApi.java create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/api/PermissionManagementApiController.java create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/api/PermissionManagementApiDelegate.java create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenAccessKeyDTO.java create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenAppRoleUserDTO.java create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenClusterNamespaceRoleUserDTO.java create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenEnvNamespaceRoleUserDTO.java create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenNamespaceRoleUserDTO.java rename spring-boot2/src/main/java/com/apollo/openapi/server/model/{KVEntity.java => OpenPermissionConditionDTO.java} (52%) delete mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenReleaseBO.java create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenReleaseChangeDTO.java create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenReleaseDiffDTO.java create mode 100644 spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenUserInfoDTO.java create mode 100644 typescript/src/apis/AccessKeyManagementApi.ts create mode 100644 typescript/src/apis/PermissionManagementApi.ts create mode 100644 typescript/src/models/OpenAccessKeyDTO.ts rename typescript/src/models/{OpenReleaseBO.ts => OpenAppRoleUserDTO.ts} (51%) create mode 100644 typescript/src/models/OpenClusterNamespaceRoleUserDTO.ts create mode 100644 typescript/src/models/OpenEnvNamespaceRoleUserDTO.ts create mode 100644 typescript/src/models/OpenNamespaceRoleUserDTO.ts rename typescript/src/models/{KVEntity.ts => OpenPermissionConditionDTO.ts} (61%) create mode 100644 typescript/src/models/OpenReleaseChangeDTO.ts create mode 100644 typescript/src/models/OpenReleaseDiffDTO.ts create mode 100644 typescript/src/models/OpenUserInfoDTO.ts diff --git a/apollo-openapi.yaml b/apollo-openapi.yaml index 0528788..674a661 100644 --- a/apollo-openapi.yaml +++ b/apollo-openapi.yaml @@ -44,6 +44,8 @@ tags: description: 组织管理相关接口,包括组织信息查询等功能 - name: Environment Management description: 环境管理相关接口,包括环境查询等功能 + - name: Permission Management + description: 权限管理相关接口,包括权限查询等功能 paths: /openapi/v1/apps: post: @@ -288,11 +290,6 @@ paths: responses: '200': description: '应用更新成功' - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' - headers: {} '400': description: '请求参数错误' content: @@ -328,10 +325,6 @@ paths: responses: '200': description: '应用删除成功' - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' '403': description: '权限不足,需要超级管理员权限' content: @@ -476,10 +469,6 @@ paths: responses: '200': description: '应用在指定环境创建成功' - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' '400': description: '请求参数错误' content: @@ -1563,10 +1552,6 @@ paths: responses: '200': description: '集群删除成功' - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' '400': description: '删除失败,集群可能包含配置' content: @@ -1672,6 +1657,12 @@ paths: required: true schema: type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string requestBody: content: application/json: @@ -1903,6 +1894,12 @@ paths: required: true schema: type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string requestBody: content: application/json: @@ -1969,6 +1966,12 @@ paths: required: true schema: type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string requestBody: content: application/json: @@ -2027,11 +2030,6 @@ paths: responses: '200': description: '发布回滚成功' - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' - headers: {} /openapi/v1/envs/{env}/releases/{releaseId}: get: summary: 获取发布详情 (new added) @@ -2074,14 +2072,14 @@ paths: '': '' comment: '' headers: {} - /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all: + /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active: get: - summary: 获取所有发布(分页) (new added) - operationId: findAllReleases + summary: 获取活跃发布(分页) (new added) + operationId: findActiveReleases deprecated: false description: >- GET - /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all + /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active tags: - Release Management parameters: @@ -2125,106 +2123,62 @@ paths: type: integer responses: '200': - description: '成功获取发布列表' + description: '成功获取活跃发布列表' content: application/json: schema: type: array items: - $ref: '#/components/schemas/OpenReleaseBO' + $ref: '#/components/schemas/OpenReleaseDTO' example: - - baseInfo: - dataChangeCreatedBy: '' - dataChangeLastModifiedBy: '' - dataChangeCreatedByDisplayName: '' - dataChangeLastModifiedByDisplayName: '' - dataChangeCreatedTime: '' - dataChangeLastModifiedTime: '' - id: 0 - releaseKey: '' - name: '' - appId: '' - clusterName: '' - namespaceName: '' - configurations: '' - comment: '' - isAbandoned: false - items: - - key: '' - value: '' + - dataChangeCreatedBy: '' + dataChangeLastModifiedBy: '' + dataChangeCreatedTime: '' + dataChangeLastModifiedTime: '' + id: 0 + appId: '' + clusterName: '' + namespaceName: '' + name: '' + configurations: + '': '' + comment: '' headers: {} - /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active: + /openapi/v1/envs/{env}/releases/comparison: get: - summary: 获取活跃发布(分页) (new added) - operationId: findActiveReleases - deprecated: false - description: >- - GET - /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active tags: - Release Management + summary: Compare two releases + description: Get the configuration differences between two releases. + operationId: compareRelease parameters: - - name: appId - in: path - description: '应用ID' - required: true - schema: - type: string - name: env in: path - description: '环境标识' - required: true - schema: - type: string - - name: clusterName - in: path - description: '集群名称' - required: true - schema: - type: string - - name: namespaceName - in: path - description: '命名空间名称' + description: Environment required: true schema: type: string - - name: page + - name: baseReleaseId in: query - description: '页码,从0开始' + description: The base release ID required: true - example: 0 schema: type: integer - - name: size + format: int64 + - name: toCompareReleaseId in: query - description: '每页数量' + description: The release ID to compare against required: true - example: 5 schema: type: integer + format: int64 responses: '200': - description: '成功获取活跃发布列表' + description: Successful comparison content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/OpenReleaseDTO' - example: - - dataChangeCreatedBy: '' - dataChangeLastModifiedBy: '' - dataChangeCreatedTime: '' - dataChangeLastModifiedTime: '' - id: 0 - appId: '' - clusterName: '' - namespaceName: '' - name: '' - configurations: - '': '' - comment: '' - headers: {} + $ref: '#/components/schemas/OpenReleaseDiffDTO' /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/instances: get: summary: 获取命名空间下的实例数量 (original openapi) @@ -2460,7 +2414,7 @@ paths: - name: releaseIds in: query description: '排除的发布ID列表,用逗号分隔' - required: false + required: true schema: type: string responses: @@ -3225,11 +3179,6 @@ paths: responses: '200': description: '缺失的命名空间创建成功' - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' - headers: {} /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}: delete: summary: 删除指定的Namespace (new added) @@ -3719,129 +3668,1287 @@ paths: - 'UAT' - 'PRO' headers: {} -components: - securitySchemes: - ApiKeyAuth: - type: apiKey - in: header - name: Authorization - description: | - Apollo OpenAPI访问令牌 - **获取方式:** - 1. 登录Apollo Portal管理界面 - 2. 进入"管理员工具" -> "开放平台授权管理" - 3. 创建第三方应用,获取Token - **使用格式:** - ``` - Authorization: your_token_here - ``` - **权限说明:** - - Token具有对应应用的读写权限 - - 不同Token可能有不同的环境和命名空间权限 - - 建议为不同用途创建不同的Token - schemas: - OpenAppDTO: - type: object - properties: - dataChangeCreatedBy: - type: string - description: 数据创建者用户名,记录是谁创建了这个应用 - dataChangeLastModifiedBy: - type: string - description: 数据最后修改者用户名,记录最后一次修改应用信息的用户 - dataChangeCreatedTime: - type: string - description: 数据创建时间,ISO 8601格式的时间戳 - example: "2025-09-29T12:34:56Z" - dataChangeLastModifiedTime: - type: string - description: 数据最后修改时间,ISO 8601格式的时间戳 - example: "2025-09-29T12:34:56Z" - name: - type: string - description: 应用名称,用于显示的友好名称 - appId: - type: string - description: 应用唯一标识符,全局唯一的应用ID - orgId: - type: string - description: 组织ID,应用所属组织的唯一标识 - orgName: - type: string - description: 组织名称,应用所属组织的显示名称 - ownerName: - type: string - description: 应用负责人姓名,应用的主要负责人 - ownerEmail: - type: string - description: 应用负责人邮箱地址,用于接收应用相关通知 - ownerDisplayName: - type: string - description: Apollo应用信息数据传输对象,包含应用的基本信息和元数据 - OpenCreateAppDTO: - type: object - properties: - assignAppRoleToSelf: - type: boolean - description: 是否将应用角色分配给当前用户。当设置为true时,当前token用户将获得该应用的完全操作权限 - admins: - type: array - items: + /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init: + post: + summary: 初始化应用权限 (new added) + operationId: initAppPermission + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: type: string - uniqueItems: true - description: 应用管理员用户名列表。应用负责人默认具有项目管理员权限。管理员可以创建命名空间、集群并分配用户权限 - app: - $ref: '#/components/schemas/OpenAppDTO' - description: 创建Apollo应用的请求数据传输对象,包含创建应用所需的所有信息 - OpenItemDTO: - type: object - description: Apollo配置项核心数据对象,仅包含键值及基础审计信息 - properties: - key: - type: string - description: 配置项的键名,在同一命名空间内唯一标识一个配置项 - value: - type: string - description: 配置项的值,可以是字符串、数字、JSON等格式 - type: - type: integer - description: 配置项类型 - comment: - type: string - description: 配置项的注释说明,用于描述配置项的用途和含义 - extendInfo: - $ref: '#/components/schemas/OpenItemExtendDTO' - dataChangeCreatedBy: - type: string - description: 配置项创建者用户名,记录是谁创建了这个配置项 - dataChangeLastModifiedBy: - type: string - description: 配置项最后修改者用户名,记录最后一次修改配置的用户 - dataChangeCreatedTime: - type: string - description: 配置项创建时间,ISO 8601格式的时间戳 - example: "2025-09-29T12:34:56Z" - dataChangeLastModifiedTime: - type: string - description: 配置项最后修改时间,ISO 8601格式的时间戳 - example: "2025-09-29T12:34:56Z" - OpenItemExtendDTO: - type: object - description: Apollo配置项扩展信息,包含状态、类型、归属及变更对比信息 - properties: - namespaceId: - type: integer - format: int64 - description: 所属命名空间的ID - isModified: - type: boolean - description: 是否有未发布的修改 - isDeleted: - type: boolean - description: 是否被标记为删除(未发布) - isNewlyAdded: - type: boolean - description: 是否为新添加的配置项(未发布) + - name: namespaceName + in: path + description: '' + required: true + schema: + type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + responses: + '200': + description: '初始化成功' + /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permission-init: + post: + summary: 初始化集群Namespace权限 (new added) + operationId: initClusterNamespacePermission + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + - name: clusterName + in: path + description: '' + required: true + schema: + type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + responses: + '200': + description: '' + /openapi/v1/apps/{appId}/permissions/{permissionType}: + get: + summary: 校验应用权限 (new added) + operationId: hasAppPermission + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: permissionType + in: path + description: '' + required: true + schema: + type: string + - name: userId + in: query + description: '' + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + example: + hasPermission: false + /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permissions/{permissionType}: + get: + summary: 校验Namespace权限 (new added) + operationId: hasNamespacePermission + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: namespaceName + in: path + description: '' + required: true + schema: + type: string + - name: permissionType + in: path + description: '' + required: true + schema: + type: string + - name: userId + in: query + description: '' + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + example: + hasPermission: false + /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/permissions/{permissionType}: + get: + summary: 校验环境Namespace权限 (new added) + operationId: hasEnvNamespacePermission + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + - name: namespaceName + in: path + description: '' + required: true + schema: + type: string + - name: permissionType + in: path + description: '' + required: true + schema: + type: string + - name: userId + in: query + description: '' + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + example: + hasPermission: false + /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permissions/{permissionType}: + get: + summary: 校验集群Namespace权限 (new added) + operationId: hasClusterNamespacePermission + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + - name: clusterName + in: path + description: '' + required: true + schema: + type: string + - name: permissionType + in: path + description: '' + required: true + schema: + type: string + - name: userId + in: query + description: '' + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + example: + hasPermission: false + /openapi/v1/permissions/root: + get: + summary: 校验Root权限 (new added) + operationId: hasRootPermission + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: userId + in: query + description: '' + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + example: + hasPermission: false + /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/role-users: + get: + summary: 获取环境Namespace用户 (new added) + operationId: getNamespaceEnvRoleUsers + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + - name: namespaceName + in: path + description: '' + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/OpenEnvNamespaceRoleUserDTO' + description: + example: + appId: '' + namespaceName: '' + modifyRoleUsers: + - userId: '' + name: '' + email: '' + enabled: 0 + releaseRoleUsers: + - userId: '' + name: '' + email: '' + enabled: 0 + env: '' + /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType}: + post: + summary: 分配环境Namespace角色 (new added) + operationId: assignNamespaceEnvRoleToUser + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + - name: namespaceName + in: path + description: '' + required: true + schema: + type: string + - name: roleType + in: path + description: '' + required: true + schema: + type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + - name: userId + in: query + description: 'the user which role assigned to' + required: true + schema: + type: string + responses: + '200': + description: '' + delete: + summary: 移除环境Namespace角色 (new added) + operationId: removeNamespaceEnvRoleFromUser + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + - name: namespaceName + in: path + description: '' + required: true + schema: + type: string + - name: roleType + in: path + description: '' + required: true + schema: + type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + - name: userId + in: query + description: 'the user which role removed from' + required: true + schema: + type: string + responses: + '200': + description: '' + /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/role-users: + get: + summary: 获取集群Namespace用户 (new added) + operationId: getClusterNamespaceRoles + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + - name: clusterName + in: path + description: '' + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/OpenClusterNamespaceRoleUserDTO' + description: + example: + appId: '' + env: '' + cluster: '' + modifyRoleUsers: + - userId: '' + name: '' + email: '' + enabled: 0 + releaseRoleUsers: + - userId: '' + name: '' + email: '' + enabled: 0 + /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType}: + post: + summary: 分配集群Namespace角色 (new added) + operationId: assignClusterNamespaceRoleToUser + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + - name: clusterName + in: path + description: '' + required: true + schema: + type: string + - name: roleType + in: path + description: '' + required: true + schema: + type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + - name: userId + in: query + description: 'the user which role assigned to' + required: true + schema: + type: string + responses: + '200': + description: '' + delete: + summary: 移除集群Namespace角色 (new added) + operationId: removeClusterNamespaceRoleFromUser + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + - name: clusterName + in: path + description: '' + required: true + schema: + type: string + - name: roleType + in: path + description: '' + required: true + schema: + type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + - name: userId + in: query + description: 'the user which role removed from' + required: true + schema: + type: string + responses: + '200': + description: '' + /openapi/v1/apps/{appId}/namespaces/{namespaceName}/role-users: + get: + summary: 获取Namespace用户 (new added) + operationId: getNamespaceRoles + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: namespaceName + in: path + description: '' + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/OpenNamespaceRoleUserDTO' + description: + example: + appId: '' + namespaceName: '' + modifyRoleUsers: + - userId: '' + name: '' + email: '' + enabled: 0 + releaseRoleUsers: + - userId: '' + name: '' + email: '' + enabled: 0 + /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType}: + post: + summary: 分配Namespace角色 (new added) + operationId: assignNamespaceRoleToUser + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: namespaceName + in: path + description: '' + required: true + schema: + type: string + - name: roleType + in: path + description: '' + required: true + schema: + type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + - name: userId + in: query + description: 'the user which role assigned to' + required: true + schema: + type: string + responses: + '200': + description: '' + delete: + summary: 移除Namespace角色 (new added) + operationId: removeNamespaceRoleFromUser + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: namespaceName + in: path + description: '' + required: true + schema: + type: string + - name: roleType + in: path + description: '' + required: true + schema: + type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + - name: userId + in: query + description: 'the user which role removed from' + required: true + schema: + type: string + responses: + '200': + description: '' + /openapi/v1/apps/{appId}/role-users: + get: + summary: 获取应用角色用户 (new added) + operationId: getAppRoles + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAppRoleUserDTO' + description: + example: + appId: '' + masterUsers: + - userId: '' + name: '' + email: '' + enabled: 0 + /openapi/v1/apps/{appId}/roles/{roleType}: + post: + summary: 分配应用角色 (new added) + operationId: assignAppRoleToUser + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: roleType + in: path + description: '' + required: true + schema: + type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + - name: userId + in: query + description: 'the user which role removed from' + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + description: '' + responses: + '200': + description: '' + delete: + summary: 移除应用角色 (new added) + operationId: removeAppRoleFromUser + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: roleType + in: path + description: '' + required: true + schema: + type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + - name: userId + in: query + description: 'the user which role removed from' + required: true + schema: + type: string + responses: + '200': + description: '' + /openapi/v1/system/roles/create-application: + post: + summary: 分配建应用角色 (new added) + operationId: addCreateApplicationRoleToUsers + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + requestBody: + content: + application/json: + schema: + title: userIds + type: array + items: + type: string + description: '' + responses: + '200': + description: '' + delete: + summary: 移除建应用角色 (new added) + operationId: deleteCreateApplicationRoleFromUser + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + - name: userId + in: query + description: '' + required: true + schema: + type: string + responses: + '200': + description: '' + get: + summary: 校验建应用权限 (new added) + operationId: hasCreateApplicationPermission + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: userId + in: query + description: '' + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + additionalProperties: + type: boolean + example: + members: + '': {} + /openapi/v1/system/roles/create-application/role-users: + get: + summary: 获取建应用用户 (new added) + operationId: getCreateApplicationRoleUsers + deprecated: false + description: '' + tags: + - Permission Management + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + type: string + example: + - '' + /openapi/v1/apps/{appId}/roles/master: + post: + summary: 分配AppMaster (new added) + operationId: addManageAppMasterRoleToUser + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + - name: userId + in: query + description: 'the user which role assign to' + required: true + schema: + type: string + responses: + '200': + description: '' + delete: + summary: 移除AppMaster (new added) + operationId: removeManageAppMasterRoleFromUser + deprecated: false + description: '' + tags: + - Permission Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: operator + in: query + description: '操作人用户名' + required: false + schema: + type: string + - name: userId + in: query + description: 'the user which role removed from' + required: true + schema: + type: string + responses: + '200': + description: '' + /openapi/v1/system/role/manage-app-master: + get: + summary: 校验AppMaster开关 (new added) + operationId: isManageAppMasterPermissionEnabled + deprecated: false + description: '' + tags: + - Permission Management + parameters: [] + responses: + '200': + description: '' + content: + application/json: + schema: + type: object + additionalProperties: + type: boolean + example: + members: + '': {} + /openapi/v1/apps/{appId}/envs/{env}/accesskeys: + post: + summary: 创建AccessKey + operationId: createAccessKey + deprecated: false + description: '' + tags: + - AccessKey Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + - name: operator + in: query + description: '' + required: false + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAccessKeyDTO' + description: com.ctrip.framework.apollo.common.dto.AccessKeyDTO + example: + dataChangeCreatedBy: '' + dataChangeLastModifiedBy: '' + dataChangeCreatedByDisplayName: '' + dataChangeLastModifiedByDisplayName: '' + dataChangeCreatedTime: '' + dataChangeLastModifiedTime: '' + id: 0 + secret: '' + appId: '' + mode: 0 + enabled: false + headers: {} + get: + summary: 查找AccessKey + operationId: findAccessKeys + deprecated: false + description: '' + tags: + - AccessKey Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + responses: + '200': + description: '' + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/OpenAccessKeyDTO' + description: com.ctrip.framework.apollo.common.dto.AccessKeyDTO + example: + - dataChangeCreatedBy: '' + dataChangeLastModifiedBy: '' + dataChangeCreatedByDisplayName: '' + dataChangeLastModifiedByDisplayName: '' + dataChangeCreatedTime: '' + dataChangeLastModifiedTime: '' + id: 0 + secret: '' + appId: '' + mode: 0 + enabled: false + headers: {} + /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}: + delete: + summary: 删除AccessKey + operationId: deleteAccessKey + deprecated: false + description: '' + tags: + - AccessKey Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + - name: accessKeyId + in: path + description: '' + required: true + schema: + type: integer + format: int64 + - name: operator + in: query + description: '' + required: false + schema: + type: string + responses: + '200': + description: '' + /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/activation: + put: + summary: 启用AccessKey + operationId: enableAccessKey + deprecated: false + description: '' + tags: + - AccessKey Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + - name: accessKeyId + in: path + description: '' + required: true + schema: + type: integer + format: int64 + - name: mode + in: query + description: '' + required: false + example: 0 + schema: + type: integer + default: 0 + responses: + '200': + description: '' + /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation: + put: + summary: 禁用AccessKey + operationId: disableAccessKey + deprecated: false + description: '' + tags: + - AccessKey Management + parameters: + - name: appId + in: path + description: '' + required: true + schema: + type: string + - name: env + in: path + description: '' + required: true + schema: + type: string + - name: accessKeyId + in: path + description: '' + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: '' +components: + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: Authorization + description: | + Apollo OpenAPI访问令牌 + **获取方式:** + 1. 登录Apollo Portal管理界面 + 2. 进入"管理员工具" -> "开放平台授权管理" + 3. 创建第三方应用,获取Token + **使用格式:** + ``` + Authorization: your_token_here + ``` + **权限说明:** + - Token具有对应应用的读写权限 + - 不同Token可能有不同的环境和命名空间权限 + - 建议为不同用途创建不同的Token + schemas: + OpenAppDTO: + type: object + properties: + dataChangeCreatedBy: + type: string + description: 数据创建者用户名,记录是谁创建了这个应用 + dataChangeLastModifiedBy: + type: string + description: 数据最后修改者用户名,记录最后一次修改应用信息的用户 + dataChangeCreatedTime: + type: string + description: 数据创建时间,ISO 8601格式的时间戳 + example: "2025-09-29T12:34:56Z" + dataChangeLastModifiedTime: + type: string + description: 数据最后修改时间,ISO 8601格式的时间戳 + example: "2025-09-29T12:34:56Z" + name: + type: string + description: 应用名称,用于显示的友好名称 + appId: + type: string + description: 应用唯一标识符,全局唯一的应用ID + orgId: + type: string + description: 组织ID,应用所属组织的唯一标识 + orgName: + type: string + description: 组织名称,应用所属组织的显示名称 + ownerName: + type: string + description: 应用负责人姓名,应用的主要负责人 + ownerEmail: + type: string + description: 应用负责人邮箱地址,用于接收应用相关通知 + ownerDisplayName: + type: string + description: Apollo应用信息数据传输对象,包含应用的基本信息和元数据 + OpenCreateAppDTO: + type: object + properties: + assignAppRoleToSelf: + type: boolean + description: 是否将应用角色分配给当前用户。当设置为true时,当前token用户将获得该应用的完全操作权限 + admins: + type: array + items: + type: string + uniqueItems: true + description: 应用管理员用户名列表。应用负责人默认具有项目管理员权限。管理员可以创建命名空间、集群并分配用户权限 + app: + $ref: '#/components/schemas/OpenAppDTO' + description: 创建Apollo应用的请求数据传输对象,包含创建应用所需的所有信息 + OpenItemDTO: + type: object + description: Apollo配置项核心数据对象,仅包含键值及基础审计信息 + properties: + key: + type: string + description: 配置项的键名,在同一命名空间内唯一标识一个配置项 + value: + type: string + description: 配置项的值,可以是字符串、数字、JSON等格式 + type: + type: integer + description: 配置项类型 + comment: + type: string + description: 配置项的注释说明,用于描述配置项的用途和含义 + extendInfo: + $ref: '#/components/schemas/OpenItemExtendDTO' + dataChangeCreatedBy: + type: string + description: 配置项创建者用户名,记录是谁创建了这个配置项 + dataChangeLastModifiedBy: + type: string + description: 配置项最后修改者用户名,记录最后一次修改配置的用户 + dataChangeCreatedTime: + type: string + description: 配置项创建时间,ISO 8601格式的时间戳 + example: "2025-09-29T12:34:56Z" + dataChangeLastModifiedTime: + type: string + description: 配置项最后修改时间,ISO 8601格式的时间戳 + example: "2025-09-29T12:34:56Z" + OpenItemExtendDTO: + type: object + description: Apollo配置项扩展信息,包含状态、类型、归属及变更对比信息 + properties: + namespaceId: + type: integer + format: int64 + description: 所属命名空间的ID + isModified: + type: boolean + description: 是否有未发布的修改 + isDeleted: + type: boolean + description: 是否被标记为删除(未发布) + isNewlyAdded: + type: boolean + description: 是否为新添加的配置项(未发布) newValue: type: string description: 新的值 @@ -4379,24 +5486,6 @@ components: # operation: # type: string # enum: [update, delete, create] - KVEntity: - type: object - properties: - key: - type: string - description: 键 - value: - type: string - description: 值 - OpenReleaseBO: - type: object - properties: - baseInfo: - $ref: '#/components/schemas/OpenReleaseDTO' - items: - type: array - items: - $ref: '#/components/schemas/KVEntity' OpenInstanceConfigDTO: type: object properties: @@ -4468,9 +5557,169 @@ components: message: "Resource not found" timestamp: "2025-09-29T12:34:56Z" exception: "NotFoundException" - SuccessEmptyResponse: # 对应 ResponseEntity 是一个通用的空返回数据模型,不带任何信息,用于成功时的返回 + OpenPermissionConditionDTO: + type: object + properties: + hasPermission: + type: boolean + description: '' + OpenUserInfoDTO: + type: object + properties: + userId: + type: string + description: '' + name: + type: string + description: '' + email: + type: string + description: '' + enabled: + type: integer + description: '' + OpenEnvNamespaceRoleUserDTO: + type: object + properties: + appId: + type: string + description: '' + namespaceName: + type: string + description: '' + modifyRoleUsers: + type: array + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + description: + description: '' + releaseRoleUsers: + type: array + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + description: + description: '' + env: + type: string + description: '' + OpenClusterNamespaceRoleUserDTO: + type: object + properties: + appId: + type: string + description: '' + env: + type: string + description: '' + cluster: + type: string + description: '' + modifyRoleUsers: + type: array + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + description: + description: '' + releaseRoleUsers: + type: array + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + description: + description: '' + OpenNamespaceRoleUserDTO: + type: object + properties: + appId: + type: string + description: '' + namespaceName: + type: string + description: '' + modifyRoleUsers: + type: array + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + description: + description: '' + releaseRoleUsers: + type: array + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + description: + description: '' + OpenAppRoleUserDTO: + type: object + properties: + appId: + type: string + description: '' + masterUsers: + type: array + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + description: + description: '' + OpenReleaseDiffDTO: + type: object + properties: + changes: + type: array + description: A list of changes, ensuring order if necessary. + items: + $ref: '#/components/schemas/OpenReleaseChangeDTO' + description: Map containing a single key-value pair of the changed item. + OpenReleaseChangeDTO: + type: object + properties: + changeType: + type: string + description: '修改类型' + key: + type: string + description: 'key' + newValue: + type: string + description: 'new value' + oldValue: + type: string + description: 'old value' + OpenAccessKeyDTO: type: object - properties: {} + properties: + dataChangeCreatedBy: + type: string + description: '' + dataChangeLastModifiedBy: + type: string + description: '' + dataChangeCreatedByDisplayName: + type: string + description: '' + dataChangeLastModifiedByDisplayName: + type: string + description: '' + dataChangeCreatedTime: + type: string + description: '' + dataChangeLastModifiedTime: + type: string + description: '' + id: + type: integer + description: '' + format: int64 + secret: + type: string + description: '' + appId: + type: string + description: '' + mode: + type: integer + description: '' + enabled: + type: boolean + description: '' StringToStringBoolMap: # Map> type: object additionalProperties: diff --git a/java-client/.openapi-generator/FILES b/java-client/.openapi-generator/FILES index 71607d2..5aba53b 100644 --- a/java-client/.openapi-generator/FILES +++ b/java-client/.openapi-generator/FILES @@ -6,6 +6,7 @@ README.md api/openapi.yaml build.gradle build.sbt +docs/AccessKeyManagementApi.md docs/AppManagementApi.md docs/AppNamespaceManagementApi.md docs/ClusterManagementApi.md @@ -13,20 +14,23 @@ docs/EnvironmentManagementApi.md docs/ExceptionResponse.md docs/InstanceManagementApi.md docs/ItemManagementApi.md -docs/KVEntity.md docs/NamespaceBranchManagementApi.md docs/NamespaceGrayDelReleaseDTO.md docs/NamespaceLockManagementApi.md docs/NamespaceManagementApi.md docs/NamespaceReleaseDTO.md +docs/OpenAccessKeyDTO.md docs/OpenAppDTO.md docs/OpenAppNamespaceDTO.md +docs/OpenAppRoleUserDTO.md docs/OpenClusterDTO.md +docs/OpenClusterNamespaceRoleUserDTO.md docs/OpenCreateAppDTO.md docs/OpenCreateItemDTO.md docs/OpenCreateNamespaceDTO.md docs/OpenEnvClusterDTO.md docs/OpenEnvClusterInfo.md +docs/OpenEnvNamespaceRoleUserDTO.md docs/OpenGrayReleaseRuleDTO.md docs/OpenGrayReleaseRuleItemDTO.md docs/OpenInstanceConfigDTO.md @@ -42,13 +46,18 @@ docs/OpenNamespaceDTO.md docs/OpenNamespaceExtendDTO.md docs/OpenNamespaceIdentifier.md docs/OpenNamespaceLockDTO.md +docs/OpenNamespaceRoleUserDTO.md docs/OpenNamespaceSyncDTO.md docs/OpenNamespaceTextModel.md docs/OpenNamespaceUsageDTO.md docs/OpenOrganizationDto.md -docs/OpenReleaseBO.md +docs/OpenPermissionConditionDTO.md +docs/OpenReleaseChangeDTO.md docs/OpenReleaseDTO.md +docs/OpenReleaseDiffDTO.md +docs/OpenUserInfoDTO.md docs/OrganizationManagementApi.md +docs/PermissionManagementApi.md docs/ReleaseManagementApi.md git_push.sh gradle.properties @@ -72,6 +81,7 @@ src/main/java/org/openapitools/client/ProgressResponseBody.java src/main/java/org/openapitools/client/ServerConfiguration.java src/main/java/org/openapitools/client/ServerVariable.java src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AccessKeyManagementApi.java src/main/java/org/openapitools/client/api/AppManagementApi.java src/main/java/org/openapitools/client/api/AppNamespaceManagementApi.java src/main/java/org/openapitools/client/api/ClusterManagementApi.java @@ -82,6 +92,7 @@ src/main/java/org/openapitools/client/api/NamespaceBranchManagementApi.java src/main/java/org/openapitools/client/api/NamespaceLockManagementApi.java src/main/java/org/openapitools/client/api/NamespaceManagementApi.java src/main/java/org/openapitools/client/api/OrganizationManagementApi.java +src/main/java/org/openapitools/client/api/PermissionManagementApi.java src/main/java/org/openapitools/client/api/ReleaseManagementApi.java src/main/java/org/openapitools/client/auth/ApiKeyAuth.java src/main/java/org/openapitools/client/auth/Authentication.java @@ -89,17 +100,20 @@ src/main/java/org/openapitools/client/auth/HttpBasicAuth.java src/main/java/org/openapitools/client/auth/HttpBearerAuth.java src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java src/main/java/org/openapitools/client/model/ExceptionResponse.java -src/main/java/org/openapitools/client/model/KVEntity.java src/main/java/org/openapitools/client/model/NamespaceGrayDelReleaseDTO.java src/main/java/org/openapitools/client/model/NamespaceReleaseDTO.java +src/main/java/org/openapitools/client/model/OpenAccessKeyDTO.java src/main/java/org/openapitools/client/model/OpenAppDTO.java 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/OpenCreateAppDTO.java src/main/java/org/openapitools/client/model/OpenCreateItemDTO.java src/main/java/org/openapitools/client/model/OpenCreateNamespaceDTO.java src/main/java/org/openapitools/client/model/OpenEnvClusterDTO.java src/main/java/org/openapitools/client/model/OpenEnvClusterInfo.java +src/main/java/org/openapitools/client/model/OpenEnvNamespaceRoleUserDTO.java src/main/java/org/openapitools/client/model/OpenGrayReleaseRuleDTO.java src/main/java/org/openapitools/client/model/OpenGrayReleaseRuleItemDTO.java src/main/java/org/openapitools/client/model/OpenInstanceConfigDTO.java @@ -115,12 +129,17 @@ src/main/java/org/openapitools/client/model/OpenNamespaceDTO.java src/main/java/org/openapitools/client/model/OpenNamespaceExtendDTO.java src/main/java/org/openapitools/client/model/OpenNamespaceIdentifier.java src/main/java/org/openapitools/client/model/OpenNamespaceLockDTO.java +src/main/java/org/openapitools/client/model/OpenNamespaceRoleUserDTO.java src/main/java/org/openapitools/client/model/OpenNamespaceSyncDTO.java src/main/java/org/openapitools/client/model/OpenNamespaceTextModel.java src/main/java/org/openapitools/client/model/OpenNamespaceUsageDTO.java src/main/java/org/openapitools/client/model/OpenOrganizationDto.java -src/main/java/org/openapitools/client/model/OpenReleaseBO.java +src/main/java/org/openapitools/client/model/OpenPermissionConditionDTO.java +src/main/java/org/openapitools/client/model/OpenReleaseChangeDTO.java src/main/java/org/openapitools/client/model/OpenReleaseDTO.java +src/main/java/org/openapitools/client/model/OpenReleaseDiffDTO.java +src/main/java/org/openapitools/client/model/OpenUserInfoDTO.java +src/test/java/org/openapitools/client/api/AccessKeyManagementApiTest.java src/test/java/org/openapitools/client/api/AppManagementApiTest.java src/test/java/org/openapitools/client/api/AppNamespaceManagementApiTest.java src/test/java/org/openapitools/client/api/ClusterManagementApiTest.java @@ -131,19 +150,23 @@ src/test/java/org/openapitools/client/api/NamespaceBranchManagementApiTest.java src/test/java/org/openapitools/client/api/NamespaceLockManagementApiTest.java src/test/java/org/openapitools/client/api/NamespaceManagementApiTest.java src/test/java/org/openapitools/client/api/OrganizationManagementApiTest.java +src/test/java/org/openapitools/client/api/PermissionManagementApiTest.java src/test/java/org/openapitools/client/api/ReleaseManagementApiTest.java src/test/java/org/openapitools/client/model/ExceptionResponseTest.java -src/test/java/org/openapitools/client/model/KVEntityTest.java src/test/java/org/openapitools/client/model/NamespaceGrayDelReleaseDTOTest.java src/test/java/org/openapitools/client/model/NamespaceReleaseDTOTest.java +src/test/java/org/openapitools/client/model/OpenAccessKeyDTOTest.java src/test/java/org/openapitools/client/model/OpenAppDTOTest.java 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/OpenCreateAppDTOTest.java src/test/java/org/openapitools/client/model/OpenCreateItemDTOTest.java src/test/java/org/openapitools/client/model/OpenCreateNamespaceDTOTest.java src/test/java/org/openapitools/client/model/OpenEnvClusterDTOTest.java src/test/java/org/openapitools/client/model/OpenEnvClusterInfoTest.java +src/test/java/org/openapitools/client/model/OpenEnvNamespaceRoleUserDTOTest.java src/test/java/org/openapitools/client/model/OpenGrayReleaseRuleDTOTest.java src/test/java/org/openapitools/client/model/OpenGrayReleaseRuleItemDTOTest.java src/test/java/org/openapitools/client/model/OpenInstanceConfigDTOTest.java @@ -159,9 +182,13 @@ src/test/java/org/openapitools/client/model/OpenNamespaceDTOTest.java src/test/java/org/openapitools/client/model/OpenNamespaceExtendDTOTest.java src/test/java/org/openapitools/client/model/OpenNamespaceIdentifierTest.java src/test/java/org/openapitools/client/model/OpenNamespaceLockDTOTest.java +src/test/java/org/openapitools/client/model/OpenNamespaceRoleUserDTOTest.java src/test/java/org/openapitools/client/model/OpenNamespaceSyncDTOTest.java src/test/java/org/openapitools/client/model/OpenNamespaceTextModelTest.java src/test/java/org/openapitools/client/model/OpenNamespaceUsageDTOTest.java src/test/java/org/openapitools/client/model/OpenOrganizationDtoTest.java -src/test/java/org/openapitools/client/model/OpenReleaseBOTest.java +src/test/java/org/openapitools/client/model/OpenPermissionConditionDTOTest.java +src/test/java/org/openapitools/client/model/OpenReleaseChangeDTOTest.java src/test/java/org/openapitools/client/model/OpenReleaseDTOTest.java +src/test/java/org/openapitools/client/model/OpenReleaseDiffDTOTest.java +src/test/java/org/openapitools/client/model/OpenUserInfoDTOTest.java diff --git a/java-client/README.md b/java-client/README.md index 9074026..3fe2e26 100644 --- a/java-client/README.md +++ b/java-client/README.md @@ -99,7 +99,7 @@ import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; import org.openapitools.client.auth.*; import org.openapitools.client.models.*; -import org.openapitools.client.api.AppManagementApi; +import org.openapitools.client.api.AccessKeyManagementApi; public class Example { public static void main(String[] args) { @@ -112,13 +112,15 @@ public class Example { // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //ApiKeyAuth.setApiKeyPrefix("Token"); - AppManagementApi apiInstance = new AppManagementApi(defaultClient); - OpenCreateAppDTO openCreateAppDTO = new OpenCreateAppDTO(); // OpenCreateAppDTO | + AccessKeyManagementApi apiInstance = new AccessKeyManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + String operator = "operator_example"; // String | try { - OpenAppDTO result = apiInstance.createApp(openCreateAppDTO); + OpenAccessKeyDTO result = apiInstance.createAccessKey(appId, env, operator); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AppManagementApi#createApp"); + System.err.println("Exception when calling AccessKeyManagementApi#createAccessKey"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -135,6 +137,11 @@ All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AccessKeyManagementApi* | [**createAccessKey**](docs/AccessKeyManagementApi.md#createAccessKey) | **POST** /openapi/v1/apps/{appId}/envs/{env}/accesskeys | 创建AccessKey +*AccessKeyManagementApi* | [**deleteAccessKey**](docs/AccessKeyManagementApi.md#deleteAccessKey) | **DELETE** /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId} | 删除AccessKey +*AccessKeyManagementApi* | [**disableAccessKey**](docs/AccessKeyManagementApi.md#disableAccessKey) | **PUT** /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation | 禁用AccessKey +*AccessKeyManagementApi* | [**enableAccessKey**](docs/AccessKeyManagementApi.md#enableAccessKey) | **PUT** /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/activation | 启用AccessKey +*AccessKeyManagementApi* | [**findAccessKeys**](docs/AccessKeyManagementApi.md#findAccessKeys) | **GET** /openapi/v1/apps/{appId}/envs/{env}/accesskeys | 查找AccessKey *AppManagementApi* | [**createApp**](docs/AppManagementApi.md#createApp) | **POST** /openapi/v1/apps | 创建应用 (original openapi) *AppManagementApi* | [**createAppInEnv**](docs/AppManagementApi.md#createAppInEnv) | **POST** /openapi/v1/apps/envs/{env} | 在指定环境创建应用(new added) *AppManagementApi* | [**deleteApp**](docs/AppManagementApi.md#deleteApp) | **DELETE** /openapi/v1/apps/{appId} | 删除应用(new added) @@ -193,11 +200,37 @@ Class | Method | HTTP request | Description *NamespaceManagementApi* | [**findPublicNamespaceForAssociatedNamespace**](docs/NamespaceManagementApi.md#findPublicNamespaceForAssociatedNamespace) | **GET** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/associated-public-namespace | 查询关联Namespace对应的公共Namespace详情 (new added) *NamespaceManagementApi* | [**getNamespacesReleaseStatus**](docs/NamespaceManagementApi.md#getNamespacesReleaseStatus) | **GET** /openapi/v1/apps/{appId}/namespaces/releases/status | 获取应用下所有Namespace的发布状态 (new added) *OrganizationManagementApi* | [**getOrganization**](docs/OrganizationManagementApi.md#getOrganization) | **GET** /openapi/v1/organizations | 获取所有组织信息 (original openapi) +*PermissionManagementApi* | [**addCreateApplicationRoleToUsers**](docs/PermissionManagementApi.md#addCreateApplicationRoleToUsers) | **POST** /openapi/v1/system/roles/create-application | 分配建应用角色 (new added) +*PermissionManagementApi* | [**addManageAppMasterRoleToUser**](docs/PermissionManagementApi.md#addManageAppMasterRoleToUser) | **POST** /openapi/v1/apps/{appId}/roles/master | 分配AppMaster (new added) +*PermissionManagementApi* | [**assignAppRoleToUser**](docs/PermissionManagementApi.md#assignAppRoleToUser) | **POST** /openapi/v1/apps/{appId}/roles/{roleType} | 分配应用角色 (new added) +*PermissionManagementApi* | [**assignClusterNamespaceRoleToUser**](docs/PermissionManagementApi.md#assignClusterNamespaceRoleToUser) | **POST** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType} | 分配集群Namespace角色 (new added) +*PermissionManagementApi* | [**assignNamespaceEnvRoleToUser**](docs/PermissionManagementApi.md#assignNamespaceEnvRoleToUser) | **POST** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType} | 分配环境Namespace角色 (new added) +*PermissionManagementApi* | [**assignNamespaceRoleToUser**](docs/PermissionManagementApi.md#assignNamespaceRoleToUser) | **POST** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType} | 分配Namespace角色 (new added) +*PermissionManagementApi* | [**deleteCreateApplicationRoleFromUser**](docs/PermissionManagementApi.md#deleteCreateApplicationRoleFromUser) | **DELETE** /openapi/v1/system/roles/create-application | 移除建应用角色 (new added) +*PermissionManagementApi* | [**getAppRoles**](docs/PermissionManagementApi.md#getAppRoles) | **GET** /openapi/v1/apps/{appId}/role-users | 获取应用角色用户 (new added) +*PermissionManagementApi* | [**getClusterNamespaceRoles**](docs/PermissionManagementApi.md#getClusterNamespaceRoles) | **GET** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/role-users | 获取集群Namespace用户 (new added) +*PermissionManagementApi* | [**getCreateApplicationRoleUsers**](docs/PermissionManagementApi.md#getCreateApplicationRoleUsers) | **GET** /openapi/v1/system/roles/create-application/role-users | 获取建应用用户 (new added) +*PermissionManagementApi* | [**getNamespaceEnvRoleUsers**](docs/PermissionManagementApi.md#getNamespaceEnvRoleUsers) | **GET** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/role-users | 获取环境Namespace用户 (new added) +*PermissionManagementApi* | [**getNamespaceRoles**](docs/PermissionManagementApi.md#getNamespaceRoles) | **GET** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/role-users | 获取Namespace用户 (new added) +*PermissionManagementApi* | [**hasAppPermission**](docs/PermissionManagementApi.md#hasAppPermission) | **GET** /openapi/v1/apps/{appId}/permissions/{permissionType} | 校验应用权限 (new added) +*PermissionManagementApi* | [**hasClusterNamespacePermission**](docs/PermissionManagementApi.md#hasClusterNamespacePermission) | **GET** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permissions/{permissionType} | 校验集群Namespace权限 (new added) +*PermissionManagementApi* | [**hasCreateApplicationPermission**](docs/PermissionManagementApi.md#hasCreateApplicationPermission) | **GET** /openapi/v1/system/roles/create-application | 校验建应用权限 (new added) +*PermissionManagementApi* | [**hasEnvNamespacePermission**](docs/PermissionManagementApi.md#hasEnvNamespacePermission) | **GET** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/permissions/{permissionType} | 校验环境Namespace权限 (new added) +*PermissionManagementApi* | [**hasNamespacePermission**](docs/PermissionManagementApi.md#hasNamespacePermission) | **GET** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permissions/{permissionType} | 校验Namespace权限 (new added) +*PermissionManagementApi* | [**hasRootPermission**](docs/PermissionManagementApi.md#hasRootPermission) | **GET** /openapi/v1/permissions/root | 校验Root权限 (new added) +*PermissionManagementApi* | [**initAppPermission**](docs/PermissionManagementApi.md#initAppPermission) | **POST** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init | 初始化应用权限 (new added) +*PermissionManagementApi* | [**initClusterNamespacePermission**](docs/PermissionManagementApi.md#initClusterNamespacePermission) | **POST** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permission-init | 初始化集群Namespace权限 (new added) +*PermissionManagementApi* | [**isManageAppMasterPermissionEnabled**](docs/PermissionManagementApi.md#isManageAppMasterPermissionEnabled) | **GET** /openapi/v1/system/role/manage-app-master | 校验AppMaster开关 (new added) +*PermissionManagementApi* | [**removeAppRoleFromUser**](docs/PermissionManagementApi.md#removeAppRoleFromUser) | **DELETE** /openapi/v1/apps/{appId}/roles/{roleType} | 移除应用角色 (new added) +*PermissionManagementApi* | [**removeClusterNamespaceRoleFromUser**](docs/PermissionManagementApi.md#removeClusterNamespaceRoleFromUser) | **DELETE** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType} | 移除集群Namespace角色 (new added) +*PermissionManagementApi* | [**removeManageAppMasterRoleFromUser**](docs/PermissionManagementApi.md#removeManageAppMasterRoleFromUser) | **DELETE** /openapi/v1/apps/{appId}/roles/master | 移除AppMaster (new added) +*PermissionManagementApi* | [**removeNamespaceEnvRoleFromUser**](docs/PermissionManagementApi.md#removeNamespaceEnvRoleFromUser) | **DELETE** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType} | 移除环境Namespace角色 (new added) +*PermissionManagementApi* | [**removeNamespaceRoleFromUser**](docs/PermissionManagementApi.md#removeNamespaceRoleFromUser) | **DELETE** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType} | 移除Namespace角色 (new added) +*ReleaseManagementApi* | [**compareRelease**](docs/ReleaseManagementApi.md#compareRelease) | **GET** /openapi/v1/envs/{env}/releases/comparison | Compare two releases *ReleaseManagementApi* | [**createGrayDelRelease**](docs/ReleaseManagementApi.md#createGrayDelRelease) | **POST** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/gray-del-releases | 创建灰度删除发布 (original openapi) *ReleaseManagementApi* | [**createGrayRelease**](docs/ReleaseManagementApi.md#createGrayRelease) | **POST** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/releases | 创建灰度发布 (original openapi) *ReleaseManagementApi* | [**createRelease**](docs/ReleaseManagementApi.md#createRelease) | **POST** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases | 创建发布 (original openapi) *ReleaseManagementApi* | [**findActiveReleases**](docs/ReleaseManagementApi.md#findActiveReleases) | **GET** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active | 获取活跃发布(分页) (new added) -*ReleaseManagementApi* | [**findAllReleases**](docs/ReleaseManagementApi.md#findAllReleases) | **GET** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all | 获取所有发布(分页) (new added) *ReleaseManagementApi* | [**getReleaseById**](docs/ReleaseManagementApi.md#getReleaseById) | **GET** /openapi/v1/envs/{env}/releases/{releaseId} | 获取发布详情 (new added) *ReleaseManagementApi* | [**loadLatestActiveRelease**](docs/ReleaseManagementApi.md#loadLatestActiveRelease) | **GET** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/latest | 获取最新活跃发布 (original openapi) *ReleaseManagementApi* | [**rollback**](docs/ReleaseManagementApi.md#rollback) | **PUT** /openapi/v1/envs/{env}/releases/{releaseId}/rollback | 回滚发布 (original openapi) @@ -206,17 +239,20 @@ Class | Method | HTTP request | Description ## Documentation for Models - [ExceptionResponse](docs/ExceptionResponse.md) - - [KVEntity](docs/KVEntity.md) - [NamespaceGrayDelReleaseDTO](docs/NamespaceGrayDelReleaseDTO.md) - [NamespaceReleaseDTO](docs/NamespaceReleaseDTO.md) + - [OpenAccessKeyDTO](docs/OpenAccessKeyDTO.md) - [OpenAppDTO](docs/OpenAppDTO.md) - [OpenAppNamespaceDTO](docs/OpenAppNamespaceDTO.md) + - [OpenAppRoleUserDTO](docs/OpenAppRoleUserDTO.md) - [OpenClusterDTO](docs/OpenClusterDTO.md) + - [OpenClusterNamespaceRoleUserDTO](docs/OpenClusterNamespaceRoleUserDTO.md) - [OpenCreateAppDTO](docs/OpenCreateAppDTO.md) - [OpenCreateItemDTO](docs/OpenCreateItemDTO.md) - [OpenCreateNamespaceDTO](docs/OpenCreateNamespaceDTO.md) - [OpenEnvClusterDTO](docs/OpenEnvClusterDTO.md) - [OpenEnvClusterInfo](docs/OpenEnvClusterInfo.md) + - [OpenEnvNamespaceRoleUserDTO](docs/OpenEnvNamespaceRoleUserDTO.md) - [OpenGrayReleaseRuleDTO](docs/OpenGrayReleaseRuleDTO.md) - [OpenGrayReleaseRuleItemDTO](docs/OpenGrayReleaseRuleItemDTO.md) - [OpenInstanceConfigDTO](docs/OpenInstanceConfigDTO.md) @@ -232,12 +268,16 @@ Class | Method | HTTP request | Description - [OpenNamespaceExtendDTO](docs/OpenNamespaceExtendDTO.md) - [OpenNamespaceIdentifier](docs/OpenNamespaceIdentifier.md) - [OpenNamespaceLockDTO](docs/OpenNamespaceLockDTO.md) + - [OpenNamespaceRoleUserDTO](docs/OpenNamespaceRoleUserDTO.md) - [OpenNamespaceSyncDTO](docs/OpenNamespaceSyncDTO.md) - [OpenNamespaceTextModel](docs/OpenNamespaceTextModel.md) - [OpenNamespaceUsageDTO](docs/OpenNamespaceUsageDTO.md) - [OpenOrganizationDto](docs/OpenOrganizationDto.md) - - [OpenReleaseBO](docs/OpenReleaseBO.md) + - [OpenPermissionConditionDTO](docs/OpenPermissionConditionDTO.md) + - [OpenReleaseChangeDTO](docs/OpenReleaseChangeDTO.md) - [OpenReleaseDTO](docs/OpenReleaseDTO.md) + - [OpenReleaseDiffDTO](docs/OpenReleaseDiffDTO.md) + - [OpenUserInfoDTO](docs/OpenUserInfoDTO.md) diff --git a/java-client/api/openapi.yaml b/java-client/api/openapi.yaml index adb0a38..c3e849c 100644 --- a/java-client/api/openapi.yaml +++ b/java-client/api/openapi.yaml @@ -45,6 +45,8 @@ tags: name: Organization Management - description: 环境管理相关接口,包括环境查询等功能 name: Environment Management +- description: 权限管理相关接口,包括权限查询等功能 + name: Permission Management paths: /openapi/v1/apps: get: @@ -249,10 +251,6 @@ paths: style: form responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' description: 应用删除成功 "403": content: @@ -340,10 +338,6 @@ paths: required: true responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' description: 应用更新成功 "400": content: @@ -499,10 +493,6 @@ paths: required: true responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' description: 应用在指定环境创建成功 "400": content: @@ -1698,10 +1688,6 @@ paths: style: form responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' description: 集群删除成功 "400": content: @@ -1874,6 +1860,14 @@ paths: schema: type: string style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form requestBody: content: application/json: @@ -2137,6 +2131,14 @@ paths: schema: type: string style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form requestBody: content: application/json: @@ -2215,6 +2217,14 @@ paths: schema: type: string style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form requestBody: content: application/json: @@ -2280,10 +2290,6 @@ paths: style: form responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' description: 发布回滚成功 summary: 回滚发布 (original openapi) tags: @@ -2336,11 +2342,11 @@ paths: tags: - Release Management x-accepts: application/json - /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all: + /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active: get: deprecated: false - description: "GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all" - operationId: findAllReleases + description: "GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active" + operationId: findActiveReleases parameters: - description: 应用ID explode: false @@ -2397,49 +2403,34 @@ paths: content: application/json: example: - - baseInfo: - dataChangeCreatedBy: "" - dataChangeLastModifiedBy: "" - dataChangeCreatedByDisplayName: "" - dataChangeLastModifiedByDisplayName: "" - dataChangeCreatedTime: "" - dataChangeLastModifiedTime: "" - id: 0 - releaseKey: "" - name: "" - appId: "" - clusterName: "" - namespaceName: "" - configurations: "" - comment: "" - isAbandoned: false - items: - - key: "" - value: "" + - dataChangeCreatedBy: "" + dataChangeLastModifiedBy: "" + dataChangeCreatedTime: "" + dataChangeLastModifiedTime: "" + id: 0 + appId: "" + clusterName: "" + namespaceName: "" + name: "" + configurations: + ? "" + : "" + comment: "" schema: items: - $ref: '#/components/schemas/OpenReleaseBO' + $ref: '#/components/schemas/OpenReleaseDTO' type: array - description: 成功获取发布列表 - summary: 获取所有发布(分页) (new added) + description: 成功获取活跃发布列表 + summary: 获取活跃发布(分页) (new added) tags: - Release Management x-accepts: application/json - /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active: + /openapi/v1/envs/{env}/releases/comparison: get: - deprecated: false - description: "GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active" - operationId: findActiveReleases + description: Get the configuration differences between two releases. + operationId: compareRelease parameters: - - description: 应用ID - explode: false - in: path - name: appId - required: true - schema: - type: string - style: simple - - description: 环境标识 + - description: Environment explode: false in: path name: env @@ -2447,64 +2438,32 @@ paths: schema: type: string style: simple - - description: 集群名称 - explode: false - in: path - name: clusterName - required: true - schema: - type: string - style: simple - - description: 命名空间名称 - explode: false - in: path - name: namespaceName - required: true - schema: - type: string - style: simple - - description: 页码,从0开始 - example: 0 + - description: The base release ID explode: true in: query - name: page + name: baseReleaseId required: true schema: + format: int64 type: integer style: form - - description: 每页数量 - example: 5 + - description: The release ID to compare against explode: true in: query - name: size + name: toCompareReleaseId required: true schema: + format: int64 type: integer style: form responses: "200": content: application/json: - example: - - dataChangeCreatedBy: "" - dataChangeLastModifiedBy: "" - dataChangeCreatedTime: "" - dataChangeLastModifiedTime: "" - id: 0 - appId: "" - clusterName: "" - namespaceName: "" - name: "" - configurations: - ? "" - : "" - comment: "" schema: - items: - $ref: '#/components/schemas/OpenReleaseDTO' - type: array - description: 成功获取活跃发布列表 - summary: 获取活跃发布(分页) (new added) + $ref: '#/components/schemas/OpenReleaseDiffDTO' + description: Successful comparison + summary: Compare two releases tags: - Release Management x-accepts: application/json @@ -2781,7 +2740,7 @@ paths: explode: true in: query name: releaseIds - required: false + required: true schema: type: string style: form @@ -3638,10 +3597,6 @@ paths: style: form responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' description: 缺失的命名空间创建成功 summary: 创建缺失的Namespace (new added) tags: @@ -4217,56 +4172,1445 @@ paths: tags: - Environment Management x-accepts: application/json -components: - schemas: - OpenAppDTO: - description: Apollo应用信息数据传输对象,包含应用的基本信息和元数据 - example: - dataChangeCreatedTime: 2025-09-29T12:34:56Z - orgName: orgName - dataChangeLastModifiedBy: dataChangeLastModifiedBy - ownerName: ownerName - ownerDisplayName: ownerDisplayName - appId: appId - dataChangeCreatedBy: dataChangeCreatedBy - name: name - dataChangeLastModifiedTime: 2025-09-29T12:34:56Z - orgId: orgId - ownerEmail: ownerEmail - properties: - dataChangeCreatedBy: - description: 数据创建者用户名,记录是谁创建了这个应用 - type: string - dataChangeLastModifiedBy: - description: 数据最后修改者用户名,记录最后一次修改应用信息的用户 - type: string - dataChangeCreatedTime: - description: 数据创建时间,ISO 8601格式的时间戳 - example: 2025-09-29T12:34:56Z + /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init: + post: + deprecated: false + description: "" + operationId: initAppPermission + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: type: string - dataChangeLastModifiedTime: - description: 数据最后修改时间,ISO 8601格式的时间戳 - example: 2025-09-29T12:34:56Z + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: type: string - name: - description: 应用名称,用于显示的友好名称 + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: type: string - appId: - description: 应用唯一标识符,全局唯一的应用ID + style: form + responses: + "200": + description: 初始化成功 + summary: 初始化应用权限 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permission-init: + post: + deprecated: false + description: "" + operationId: initClusterNamespacePermission + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: type: string - orgId: - description: 组织ID,应用所属组织的唯一标识 + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: type: string - orgName: - description: 组织名称,应用所属组织的显示名称 + style: simple + - description: "" + explode: false + in: path + name: clusterName + required: true + schema: type: string - ownerName: - description: 应用负责人姓名,应用的主要负责人 + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: type: string - ownerEmail: - description: 应用负责人邮箱地址,用于接收应用相关通知 + style: form + responses: + "200": + description: "" + summary: 初始化集群Namespace权限 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/permissions/{permissionType}: + get: + deprecated: false + description: "" + operationId: hasAppPermission + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: type: string - ownerDisplayName: + style: simple + - description: "" + explode: false + in: path + name: permissionType + required: true + schema: + type: string + style: simple + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + hasPermission: false + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + description: "" + summary: 校验应用权限 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permissions/{permissionType}: + get: + deprecated: false + description: "" + operationId: hasNamespacePermission + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: permissionType + required: true + schema: + type: string + style: simple + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + hasPermission: false + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + description: "" + summary: 校验Namespace权限 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/permissions/{permissionType}: + get: + deprecated: false + description: "" + operationId: hasEnvNamespacePermission + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: permissionType + required: true + schema: + type: string + style: simple + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + hasPermission: false + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + description: "" + summary: 校验环境Namespace权限 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permissions/{permissionType}: + get: + deprecated: false + description: "" + operationId: hasClusterNamespacePermission + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: clusterName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: permissionType + required: true + schema: + type: string + style: simple + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + hasPermission: false + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + description: "" + summary: 校验集群Namespace权限 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/permissions/root: + get: + deprecated: false + description: "" + operationId: hasRootPermission + parameters: + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + hasPermission: false + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + description: "" + summary: 校验Root权限 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/role-users: + get: + deprecated: false + description: "" + operationId: getNamespaceEnvRoleUsers + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + appId: "" + namespaceName: "" + modifyRoleUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + releaseRoleUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + env: "" + schema: + $ref: '#/components/schemas/OpenEnvNamespaceRoleUserDTO' + description: "" + summary: 获取环境Namespace用户 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType}: + delete: + deprecated: false + description: "" + operationId: removeNamespaceEnvRoleFromUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role removed from + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 移除环境Namespace角色 (new added) + tags: + - Permission Management + x-accepts: application/json + post: + deprecated: false + description: "" + operationId: assignNamespaceEnvRoleToUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role assigned to + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 分配环境Namespace角色 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/role-users: + get: + deprecated: false + description: "" + operationId: getClusterNamespaceRoles + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: clusterName + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + appId: "" + env: "" + cluster: "" + modifyRoleUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + releaseRoleUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + schema: + $ref: '#/components/schemas/OpenClusterNamespaceRoleUserDTO' + description: "" + summary: 获取集群Namespace用户 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType}: + delete: + deprecated: false + description: "" + operationId: removeClusterNamespaceRoleFromUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: clusterName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role removed from + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 移除集群Namespace角色 (new added) + tags: + - Permission Management + x-accepts: application/json + post: + deprecated: false + description: "" + operationId: assignClusterNamespaceRoleToUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: clusterName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role assigned to + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 分配集群Namespace角色 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/namespaces/{namespaceName}/role-users: + get: + deprecated: false + description: "" + operationId: getNamespaceRoles + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + appId: "" + namespaceName: "" + modifyRoleUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + releaseRoleUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + schema: + $ref: '#/components/schemas/OpenNamespaceRoleUserDTO' + description: "" + summary: 获取Namespace用户 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType}: + delete: + deprecated: false + description: "" + operationId: removeNamespaceRoleFromUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role removed from + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 移除Namespace角色 (new added) + tags: + - Permission Management + x-accepts: application/json + post: + deprecated: false + description: "" + operationId: assignNamespaceRoleToUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role assigned to + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 分配Namespace角色 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/role-users: + get: + deprecated: false + description: "" + operationId: getAppRoles + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + appId: "" + masterUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + schema: + $ref: '#/components/schemas/OpenAppRoleUserDTO' + description: "" + summary: 获取应用角色用户 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/roles/{roleType}: + delete: + deprecated: false + description: "" + operationId: removeAppRoleFromUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role removed from + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 移除应用角色 (new added) + tags: + - Permission Management + x-accepts: application/json + post: + deprecated: false + description: "" + operationId: assignAppRoleToUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role removed from + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + description: "" + type: string + responses: + "200": + description: "" + summary: 分配应用角色 (new added) + tags: + - Permission Management + x-content-type: application/json + x-accepts: application/json + /openapi/v1/system/roles/create-application: + delete: + deprecated: false + description: "" + operationId: deleteCreateApplicationRoleFromUser + parameters: + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 移除建应用角色 (new added) + tags: + - Permission Management + x-accepts: application/json + get: + deprecated: false + description: "" + operationId: hasCreateApplicationPermission + parameters: + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + members: + ? "" + : {} + schema: + additionalProperties: + type: boolean + type: object + description: "" + summary: 校验建应用权限 (new added) + tags: + - Permission Management + x-accepts: application/json + post: + deprecated: false + description: "" + operationId: addCreateApplicationRoleToUsers + parameters: + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + description: "" + items: + type: string + title: userIds + type: array + responses: + "200": + description: "" + summary: 分配建应用角色 (new added) + tags: + - Permission Management + x-content-type: application/json + x-accepts: application/json + /openapi/v1/system/roles/create-application/role-users: + get: + deprecated: false + description: "" + operationId: getCreateApplicationRoleUsers + parameters: [] + responses: + "200": + content: + application/json: + example: + - "" + schema: + items: + type: string + type: array + description: "" + summary: 获取建应用用户 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/roles/master: + delete: + deprecated: false + description: "" + operationId: removeManageAppMasterRoleFromUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role removed from + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 移除AppMaster (new added) + tags: + - Permission Management + x-accepts: application/json + post: + deprecated: false + description: "" + operationId: addManageAppMasterRoleToUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role assign to + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 分配AppMaster (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/system/role/manage-app-master: + get: + deprecated: false + description: "" + operationId: isManageAppMasterPermissionEnabled + parameters: [] + responses: + "200": + content: + application/json: + example: + members: + ? "" + : {} + schema: + additionalProperties: + type: boolean + type: object + description: "" + summary: 校验AppMaster开关 (new added) + tags: + - Permission Management + x-accepts: application/json + /openapi/v1/apps/{appId}/envs/{env}/accesskeys: + get: + deprecated: false + description: "" + operationId: findAccessKeys + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + - dataChangeCreatedBy: "" + dataChangeLastModifiedBy: "" + dataChangeCreatedByDisplayName: "" + dataChangeLastModifiedByDisplayName: "" + dataChangeCreatedTime: "" + dataChangeLastModifiedTime: "" + id: 0 + secret: "" + appId: "" + mode: 0 + enabled: false + schema: + items: + $ref: '#/components/schemas/OpenAccessKeyDTO' + type: array + description: "" + summary: 查找AccessKey + tags: + - AccessKey Management + x-accepts: application/json + post: + deprecated: false + description: "" + operationId: createAccessKey + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + dataChangeCreatedBy: "" + dataChangeLastModifiedBy: "" + dataChangeCreatedByDisplayName: "" + dataChangeLastModifiedByDisplayName: "" + dataChangeCreatedTime: "" + dataChangeLastModifiedTime: "" + id: 0 + secret: "" + appId: "" + mode: 0 + enabled: false + schema: + $ref: '#/components/schemas/OpenAccessKeyDTO' + description: "" + summary: 创建AccessKey + tags: + - AccessKey Management + x-accepts: application/json + /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}: + delete: + deprecated: false + description: "" + operationId: deleteAccessKey + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: accessKeyId + required: true + schema: + format: int64 + type: integer + style: simple + - description: "" + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 删除AccessKey + tags: + - AccessKey Management + x-accepts: application/json + /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/activation: + put: + deprecated: false + description: "" + operationId: enableAccessKey + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: accessKeyId + required: true + schema: + format: int64 + type: integer + style: simple + - description: "" + example: 0 + explode: true + in: query + name: mode + required: false + schema: + default: 0 + type: integer + style: form + responses: + "200": + description: "" + summary: 启用AccessKey + tags: + - AccessKey Management + x-accepts: application/json + /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation: + put: + deprecated: false + description: "" + operationId: disableAccessKey + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: accessKeyId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + description: "" + summary: 禁用AccessKey + tags: + - AccessKey Management + x-accepts: application/json +components: + schemas: + OpenAppDTO: + description: Apollo应用信息数据传输对象,包含应用的基本信息和元数据 + example: + dataChangeCreatedTime: 2025-09-29T12:34:56Z + orgName: orgName + dataChangeLastModifiedBy: dataChangeLastModifiedBy + ownerName: ownerName + ownerDisplayName: ownerDisplayName + appId: appId + dataChangeCreatedBy: dataChangeCreatedBy + name: name + dataChangeLastModifiedTime: 2025-09-29T12:34:56Z + orgId: orgId + ownerEmail: ownerEmail + properties: + dataChangeCreatedBy: + description: 数据创建者用户名,记录是谁创建了这个应用 + type: string + dataChangeLastModifiedBy: + description: 数据最后修改者用户名,记录最后一次修改应用信息的用户 + type: string + dataChangeCreatedTime: + description: 数据创建时间,ISO 8601格式的时间戳 + example: 2025-09-29T12:34:56Z + type: string + dataChangeLastModifiedTime: + description: 数据最后修改时间,ISO 8601格式的时间戳 + example: 2025-09-29T12:34:56Z + type: string + name: + description: 应用名称,用于显示的友好名称 + type: string + appId: + description: 应用唯一标识符,全局唯一的应用ID + type: string + orgId: + description: 组织ID,应用所属组织的唯一标识 + type: string + orgName: + description: 组织名称,应用所属组织的显示名称 + type: string + ownerName: + description: 应用负责人姓名,应用的主要负责人 + type: string + ownerEmail: + description: 应用负责人邮箱地址,用于接收应用相关通知 + type: string + ownerDisplayName: type: string type: object OpenCreateAppDTO: @@ -5357,46 +6701,6 @@ components: $ref: '#/components/schemas/OpenItemDTO' type: array type: object - KVEntity: - example: - value: value - key: key - properties: - key: - description: 键 - type: string - value: - description: 值 - type: string - type: object - OpenReleaseBO: - example: - baseInfo: - dataChangeCreatedTime: 2025-09-29T12:34:56Z - dataChangeLastModifiedBy: dataChangeLastModifiedBy - configurations: - key: configurations - appId: appId - clusterName: clusterName - dataChangeCreatedBy: dataChangeCreatedBy - name: name - comment: comment - id: 0 - dataChangeLastModifiedTime: 2025-09-29T12:34:56Z - namespaceName: namespaceName - items: - - value: value - key: key - - value: value - key: key - properties: - baseInfo: - $ref: '#/components/schemas/OpenReleaseDTO' - items: - items: - $ref: '#/components/schemas/KVEntity' - type: array - type: object OpenInstanceConfigDTO: example: releaseDeliveryTime: 2025-09-29T12:34:56Z @@ -5525,8 +6829,270 @@ components: description: 错误类名 type: string type: object - SuccessEmptyResponse: - properties: {} + OpenPermissionConditionDTO: + example: + hasPermission: true + properties: + hasPermission: + description: "" + type: boolean + type: object + OpenUserInfoDTO: + example: + name: name + userId: userId + email: email + enabled: 0 + properties: + userId: + description: "" + type: string + name: + description: "" + type: string + email: + description: "" + type: string + enabled: + description: "" + type: integer + type: object + OpenEnvNamespaceRoleUserDTO: + example: + releaseRoleUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + appId: appId + modifyRoleUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + env: env + namespaceName: namespaceName + properties: + appId: + description: "" + type: string + namespaceName: + description: "" + type: string + modifyRoleUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + releaseRoleUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + env: + description: "" + type: string + type: object + OpenClusterNamespaceRoleUserDTO: + example: + cluster: cluster + releaseRoleUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + appId: appId + modifyRoleUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + env: env + properties: + appId: + description: "" + type: string + env: + description: "" + type: string + cluster: + description: "" + type: string + modifyRoleUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + releaseRoleUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + type: object + OpenNamespaceRoleUserDTO: + example: + releaseRoleUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + appId: appId + modifyRoleUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + namespaceName: namespaceName + properties: + appId: + description: "" + type: string + namespaceName: + description: "" + type: string + modifyRoleUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + releaseRoleUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + type: object + OpenAppRoleUserDTO: + example: + appId: appId + masterUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + properties: + appId: + description: "" + type: string + masterUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + type: object + OpenReleaseDiffDTO: + example: + changes: + - newValue: newValue + changeType: changeType + oldValue: oldValue + key: key + - newValue: newValue + changeType: changeType + oldValue: oldValue + key: key + properties: + changes: + description: "A list of changes, ensuring order if necessary." + items: + $ref: '#/components/schemas/OpenReleaseChangeDTO' + type: array + type: object + OpenReleaseChangeDTO: + example: + newValue: newValue + changeType: changeType + oldValue: oldValue + key: key + properties: + changeType: + description: 修改类型 + type: string + key: + description: key + type: string + newValue: + description: new value + type: string + oldValue: + description: old value + type: string + type: object + OpenAccessKeyDTO: + example: + mode: 6 + dataChangeLastModifiedByDisplayName: dataChangeLastModifiedByDisplayName + dataChangeCreatedByDisplayName: dataChangeCreatedByDisplayName + dataChangeCreatedTime: dataChangeCreatedTime + dataChangeLastModifiedBy: dataChangeLastModifiedBy + appId: appId + dataChangeCreatedBy: dataChangeCreatedBy + id: 0 + secret: secret + dataChangeLastModifiedTime: dataChangeLastModifiedTime + enabled: true + properties: + dataChangeCreatedBy: + description: "" + type: string + dataChangeLastModifiedBy: + description: "" + type: string + dataChangeCreatedByDisplayName: + description: "" + type: string + dataChangeLastModifiedByDisplayName: + description: "" + type: string + dataChangeCreatedTime: + description: "" + type: string + dataChangeLastModifiedTime: + description: "" + type: string + id: + description: "" + format: int64 + type: integer + secret: + description: "" + type: string + appId: + description: "" + type: string + mode: + description: "" + type: integer + enabled: + description: "" + type: boolean type: object StringToStringBoolMap: additionalProperties: diff --git a/java-client/docs/AccessKeyManagementApi.md b/java-client/docs/AccessKeyManagementApi.md new file mode 100644 index 0000000..be0199e --- /dev/null +++ b/java-client/docs/AccessKeyManagementApi.md @@ -0,0 +1,376 @@ +# AccessKeyManagementApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createAccessKey**](AccessKeyManagementApi.md#createAccessKey) | **POST** /openapi/v1/apps/{appId}/envs/{env}/accesskeys | 创建AccessKey | +| [**deleteAccessKey**](AccessKeyManagementApi.md#deleteAccessKey) | **DELETE** /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId} | 删除AccessKey | +| [**disableAccessKey**](AccessKeyManagementApi.md#disableAccessKey) | **PUT** /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation | 禁用AccessKey | +| [**enableAccessKey**](AccessKeyManagementApi.md#enableAccessKey) | **PUT** /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/activation | 启用AccessKey | +| [**findAccessKeys**](AccessKeyManagementApi.md#findAccessKeys) | **GET** /openapi/v1/apps/{appId}/envs/{env}/accesskeys | 查找AccessKey | + + + +# **createAccessKey** +> OpenAccessKeyDTO createAccessKey(appId, env, operator) + +创建AccessKey + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AccessKeyManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + AccessKeyManagementApi apiInstance = new AccessKeyManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + String operator = "operator_example"; // String | + try { + OpenAccessKeyDTO result = apiInstance.createAccessKey(appId, env, operator); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccessKeyManagementApi#createAccessKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | +| **operator** | **String**| | [optional] | + +### Return type + +[**OpenAccessKeyDTO**](OpenAccessKeyDTO.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **deleteAccessKey** +> deleteAccessKey(appId, env, accessKeyId, operator) + +删除AccessKey + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AccessKeyManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + AccessKeyManagementApi apiInstance = new AccessKeyManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + Long accessKeyId = 56L; // Long | + String operator = "operator_example"; // String | + try { + apiInstance.deleteAccessKey(appId, env, accessKeyId, operator); + } catch (ApiException e) { + System.err.println("Exception when calling AccessKeyManagementApi#deleteAccessKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | +| **accessKeyId** | **Long**| | | +| **operator** | **String**| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **disableAccessKey** +> disableAccessKey(appId, env, accessKeyId) + +禁用AccessKey + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AccessKeyManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + AccessKeyManagementApi apiInstance = new AccessKeyManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + Long accessKeyId = 56L; // Long | + try { + apiInstance.disableAccessKey(appId, env, accessKeyId); + } catch (ApiException e) { + System.err.println("Exception when calling AccessKeyManagementApi#disableAccessKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | +| **accessKeyId** | **Long**| | | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **enableAccessKey** +> enableAccessKey(appId, env, accessKeyId, mode) + +启用AccessKey + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AccessKeyManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + AccessKeyManagementApi apiInstance = new AccessKeyManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + Long accessKeyId = 56L; // Long | + Integer mode = 0; // Integer | + try { + apiInstance.enableAccessKey(appId, env, accessKeyId, mode); + } catch (ApiException e) { + System.err.println("Exception when calling AccessKeyManagementApi#enableAccessKey"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | +| **accessKeyId** | **Long**| | | +| **mode** | **Integer**| | [optional] [default to 0] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **findAccessKeys** +> List<OpenAccessKeyDTO> findAccessKeys(appId, env) + +查找AccessKey + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AccessKeyManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + AccessKeyManagementApi apiInstance = new AccessKeyManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + try { + List result = apiInstance.findAccessKeys(appId, env); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AccessKeyManagementApi#findAccessKeys"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | + +### Return type + +[**List<OpenAccessKeyDTO>**](OpenAccessKeyDTO.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | diff --git a/java-client/docs/AppManagementApi.md b/java-client/docs/AppManagementApi.md index 5ec22e3..55c0724 100644 --- a/java-client/docs/AppManagementApi.md +++ b/java-client/docs/AppManagementApi.md @@ -90,7 +90,7 @@ public class Example { # **createAppInEnv** -> Object createAppInEnv(env, openAppDTO, operator) +> createAppInEnv(env, openAppDTO, operator) 在指定环境创建应用(new added) @@ -122,8 +122,7 @@ public class Example { OpenAppDTO openAppDTO = new OpenAppDTO(); // OpenAppDTO | String operator = "operator_example"; // String | 操作人用户名 try { - Object result = apiInstance.createAppInEnv(env, openAppDTO, operator); - System.out.println(result); + apiInstance.createAppInEnv(env, openAppDTO, operator); } catch (ApiException e) { System.err.println("Exception when calling AppManagementApi#createAppInEnv"); System.err.println("Status code: " + e.getCode()); @@ -145,7 +144,7 @@ public class Example { ### Return type -**Object** +null (empty response body) ### Authorization @@ -165,7 +164,7 @@ public class Example { # **deleteApp** -> Object deleteApp(appId, operator) +> deleteApp(appId, operator) 删除应用(new added) @@ -196,8 +195,7 @@ public class Example { String appId = "appId_example"; // String | 应用ID String operator = "operator_example"; // String | 操作人用户名 try { - Object result = apiInstance.deleteApp(appId, operator); - System.out.println(result); + apiInstance.deleteApp(appId, operator); } catch (ApiException e) { System.err.println("Exception when calling AppManagementApi#deleteApp"); System.err.println("Status code: " + e.getCode()); @@ -218,7 +216,7 @@ public class Example { ### Return type -**Object** +null (empty response body) ### Authorization @@ -725,7 +723,7 @@ public class Example { # **updateApp** -> Object updateApp(appId, openAppDTO, operator) +> updateApp(appId, openAppDTO, operator) 更新应用(new added) @@ -757,8 +755,7 @@ public class Example { OpenAppDTO openAppDTO = new OpenAppDTO(); // OpenAppDTO | String operator = "operator_example"; // String | 操作人用户名 try { - Object result = apiInstance.updateApp(appId, openAppDTO, operator); - System.out.println(result); + apiInstance.updateApp(appId, openAppDTO, operator); } catch (ApiException e) { System.err.println("Exception when calling AppManagementApi#updateApp"); System.err.println("Status code: " + e.getCode()); @@ -780,7 +777,7 @@ public class Example { ### Return type -**Object** +null (empty response body) ### Authorization diff --git a/java-client/docs/ClusterManagementApi.md b/java-client/docs/ClusterManagementApi.md index ad4af3d..7417207 100644 --- a/java-client/docs/ClusterManagementApi.md +++ b/java-client/docs/ClusterManagementApi.md @@ -86,7 +86,7 @@ public class Example { # **deleteCluster** -> Object deleteCluster(env, appId, clusterName, operator) +> deleteCluster(env, appId, clusterName, operator) 删除集群 (new added) @@ -119,8 +119,7 @@ public class Example { String clusterName = "clusterName_example"; // String | String operator = "operator_example"; // String | 操作人用户名,openapi外部调用时需传入 try { - Object result = apiInstance.deleteCluster(env, appId, clusterName, operator); - System.out.println(result); + apiInstance.deleteCluster(env, appId, clusterName, operator); } catch (ApiException e) { System.err.println("Exception when calling ClusterManagementApi#deleteCluster"); System.err.println("Status code: " + e.getCode()); @@ -143,7 +142,7 @@ public class Example { ### Return type -**Object** +null (empty response body) ### Authorization diff --git a/java-client/docs/InstanceManagementApi.md b/java-client/docs/InstanceManagementApi.md index 82cfcd4..98d6cb3 100644 --- a/java-client/docs/InstanceManagementApi.md +++ b/java-client/docs/InstanceManagementApi.md @@ -219,7 +219,7 @@ public class Example { | **appId** | **String**| 应用ID | | | **clusterName** | **String**| 集群名称 | | | **namespaceName** | **String**| 命名空间名称 | | -| **releaseIds** | **String**| 排除的发布ID列表,用逗号分隔 | [optional] | +| **releaseIds** | **String**| 排除的发布ID列表,用逗号分隔 | | ### Return type diff --git a/java-client/docs/NamespaceManagementApi.md b/java-client/docs/NamespaceManagementApi.md index 889de88..fdf9f40 100644 --- a/java-client/docs/NamespaceManagementApi.md +++ b/java-client/docs/NamespaceManagementApi.md @@ -17,7 +17,7 @@ All URIs are relative to *http://localhost* # **createMissingNamespaces** -> Object createMissingNamespaces(appId, env, clusterName, operator) +> createMissingNamespaces(appId, env, clusterName, operator) 创建缺失的Namespace (new added) @@ -50,8 +50,7 @@ public class Example { String clusterName = "clusterName_example"; // String | 集群名称 String operator = "operator_example"; // String | 操作人用户名 try { - Object result = apiInstance.createMissingNamespaces(appId, env, clusterName, operator); - System.out.println(result); + apiInstance.createMissingNamespaces(appId, env, clusterName, operator); } catch (ApiException e) { System.err.println("Exception when calling NamespaceManagementApi#createMissingNamespaces"); System.err.println("Status code: " + e.getCode()); @@ -74,7 +73,7 @@ public class Example { ### Return type -**Object** +null (empty response body) ### Authorization @@ -83,7 +82,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json + - **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | diff --git a/java-client/docs/OpenAccessKeyDTO.md b/java-client/docs/OpenAccessKeyDTO.md new file mode 100644 index 0000000..902ae7f --- /dev/null +++ b/java-client/docs/OpenAccessKeyDTO.md @@ -0,0 +1,20 @@ + + +# OpenAccessKeyDTO + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**dataChangeCreatedBy** | **String** | | [optional] | +|**dataChangeLastModifiedBy** | **String** | | [optional] | +|**dataChangeCreatedByDisplayName** | **String** | | [optional] | +|**dataChangeLastModifiedByDisplayName** | **String** | | [optional] | +|**dataChangeCreatedTime** | **String** | | [optional] | +|**dataChangeLastModifiedTime** | **String** | | [optional] | +|**id** | **Long** | | [optional] | +|**secret** | **String** | | [optional] | +|**appId** | **String** | | [optional] | +|**mode** | **Integer** | | [optional] | +|**enabled** | **Boolean** | | [optional] | diff --git a/java-client/docs/OpenAppRoleUserDTO.md b/java-client/docs/OpenAppRoleUserDTO.md new file mode 100644 index 0000000..942ab22 --- /dev/null +++ b/java-client/docs/OpenAppRoleUserDTO.md @@ -0,0 +1,11 @@ + + +# OpenAppRoleUserDTO + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**appId** | **String** | | [optional] | +|**masterUsers** | [**List<OpenUserInfoDTO>**](OpenUserInfoDTO.md) | | [optional] | diff --git a/java-client/docs/OpenClusterNamespaceRoleUserDTO.md b/java-client/docs/OpenClusterNamespaceRoleUserDTO.md new file mode 100644 index 0000000..406a8d6 --- /dev/null +++ b/java-client/docs/OpenClusterNamespaceRoleUserDTO.md @@ -0,0 +1,14 @@ + + +# OpenClusterNamespaceRoleUserDTO + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**appId** | **String** | | [optional] | +|**env** | **String** | | [optional] | +|**cluster** | **String** | | [optional] | +|**modifyRoleUsers** | [**List<OpenUserInfoDTO>**](OpenUserInfoDTO.md) | | [optional] | +|**releaseRoleUsers** | [**List<OpenUserInfoDTO>**](OpenUserInfoDTO.md) | | [optional] | diff --git a/java-client/docs/OpenEnvNamespaceRoleUserDTO.md b/java-client/docs/OpenEnvNamespaceRoleUserDTO.md new file mode 100644 index 0000000..ac2941e --- /dev/null +++ b/java-client/docs/OpenEnvNamespaceRoleUserDTO.md @@ -0,0 +1,14 @@ + + +# OpenEnvNamespaceRoleUserDTO + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**appId** | **String** | | [optional] | +|**namespaceName** | **String** | | [optional] | +|**modifyRoleUsers** | [**List<OpenUserInfoDTO>**](OpenUserInfoDTO.md) | | [optional] | +|**releaseRoleUsers** | [**List<OpenUserInfoDTO>**](OpenUserInfoDTO.md) | | [optional] | +|**env** | **String** | | [optional] | diff --git a/java-client/docs/OpenNamespaceRoleUserDTO.md b/java-client/docs/OpenNamespaceRoleUserDTO.md new file mode 100644 index 0000000..5bba268 --- /dev/null +++ b/java-client/docs/OpenNamespaceRoleUserDTO.md @@ -0,0 +1,13 @@ + + +# OpenNamespaceRoleUserDTO + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**appId** | **String** | | [optional] | +|**namespaceName** | **String** | | [optional] | +|**modifyRoleUsers** | [**List<OpenUserInfoDTO>**](OpenUserInfoDTO.md) | | [optional] | +|**releaseRoleUsers** | [**List<OpenUserInfoDTO>**](OpenUserInfoDTO.md) | | [optional] | diff --git a/java-client/docs/KVEntity.md b/java-client/docs/OpenPermissionConditionDTO.md similarity index 54% rename from java-client/docs/KVEntity.md rename to java-client/docs/OpenPermissionConditionDTO.md index a99d053..5424be7 100644 --- a/java-client/docs/KVEntity.md +++ b/java-client/docs/OpenPermissionConditionDTO.md @@ -1,11 +1,10 @@ -# KVEntity +# OpenPermissionConditionDTO ## Properties | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**key** | **String** | 键 | [optional] | -|**value** | **String** | 值 | [optional] | +|**hasPermission** | **Boolean** | | [optional] | diff --git a/java-client/docs/OpenReleaseBO.md b/java-client/docs/OpenReleaseBO.md deleted file mode 100644 index 80beb2c..0000000 --- a/java-client/docs/OpenReleaseBO.md +++ /dev/null @@ -1,11 +0,0 @@ - - -# OpenReleaseBO - - -## Properties - -| Name | Type | Description | Notes | -|------------ | ------------- | ------------- | -------------| -|**baseInfo** | [**OpenReleaseDTO**](OpenReleaseDTO.md) | | [optional] | -|**items** | [**List<KVEntity>**](KVEntity.md) | | [optional] | diff --git a/java-client/docs/OpenReleaseChangeDTO.md b/java-client/docs/OpenReleaseChangeDTO.md new file mode 100644 index 0000000..c2350c7 --- /dev/null +++ b/java-client/docs/OpenReleaseChangeDTO.md @@ -0,0 +1,13 @@ + + +# OpenReleaseChangeDTO + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**changeType** | **String** | 修改类型 | [optional] | +|**key** | **String** | key | [optional] | +|**newValue** | **String** | new value | [optional] | +|**oldValue** | **String** | old value | [optional] | diff --git a/java-client/docs/OpenReleaseDiffDTO.md b/java-client/docs/OpenReleaseDiffDTO.md new file mode 100644 index 0000000..9322849 --- /dev/null +++ b/java-client/docs/OpenReleaseDiffDTO.md @@ -0,0 +1,10 @@ + + +# OpenReleaseDiffDTO + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**changes** | [**List<OpenReleaseChangeDTO>**](OpenReleaseChangeDTO.md) | A list of changes, ensuring order if necessary. | [optional] | diff --git a/java-client/docs/OpenUserInfoDTO.md b/java-client/docs/OpenUserInfoDTO.md new file mode 100644 index 0000000..cc291a2 --- /dev/null +++ b/java-client/docs/OpenUserInfoDTO.md @@ -0,0 +1,13 @@ + + +# OpenUserInfoDTO + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**userId** | **String** | | [optional] | +|**name** | **String** | | [optional] | +|**email** | **String** | | [optional] | +|**enabled** | **Integer** | | [optional] | diff --git a/java-client/docs/PermissionManagementApi.md b/java-client/docs/PermissionManagementApi.md new file mode 100644 index 0000000..12d3408 --- /dev/null +++ b/java-client/docs/PermissionManagementApi.md @@ -0,0 +1,1933 @@ +# PermissionManagementApi + +All URIs are relative to *http://localhost* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addCreateApplicationRoleToUsers**](PermissionManagementApi.md#addCreateApplicationRoleToUsers) | **POST** /openapi/v1/system/roles/create-application | 分配建应用角色 (new added) | +| [**addManageAppMasterRoleToUser**](PermissionManagementApi.md#addManageAppMasterRoleToUser) | **POST** /openapi/v1/apps/{appId}/roles/master | 分配AppMaster (new added) | +| [**assignAppRoleToUser**](PermissionManagementApi.md#assignAppRoleToUser) | **POST** /openapi/v1/apps/{appId}/roles/{roleType} | 分配应用角色 (new added) | +| [**assignClusterNamespaceRoleToUser**](PermissionManagementApi.md#assignClusterNamespaceRoleToUser) | **POST** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType} | 分配集群Namespace角色 (new added) | +| [**assignNamespaceEnvRoleToUser**](PermissionManagementApi.md#assignNamespaceEnvRoleToUser) | **POST** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType} | 分配环境Namespace角色 (new added) | +| [**assignNamespaceRoleToUser**](PermissionManagementApi.md#assignNamespaceRoleToUser) | **POST** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType} | 分配Namespace角色 (new added) | +| [**deleteCreateApplicationRoleFromUser**](PermissionManagementApi.md#deleteCreateApplicationRoleFromUser) | **DELETE** /openapi/v1/system/roles/create-application | 移除建应用角色 (new added) | +| [**getAppRoles**](PermissionManagementApi.md#getAppRoles) | **GET** /openapi/v1/apps/{appId}/role-users | 获取应用角色用户 (new added) | +| [**getClusterNamespaceRoles**](PermissionManagementApi.md#getClusterNamespaceRoles) | **GET** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/role-users | 获取集群Namespace用户 (new added) | +| [**getCreateApplicationRoleUsers**](PermissionManagementApi.md#getCreateApplicationRoleUsers) | **GET** /openapi/v1/system/roles/create-application/role-users | 获取建应用用户 (new added) | +| [**getNamespaceEnvRoleUsers**](PermissionManagementApi.md#getNamespaceEnvRoleUsers) | **GET** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/role-users | 获取环境Namespace用户 (new added) | +| [**getNamespaceRoles**](PermissionManagementApi.md#getNamespaceRoles) | **GET** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/role-users | 获取Namespace用户 (new added) | +| [**hasAppPermission**](PermissionManagementApi.md#hasAppPermission) | **GET** /openapi/v1/apps/{appId}/permissions/{permissionType} | 校验应用权限 (new added) | +| [**hasClusterNamespacePermission**](PermissionManagementApi.md#hasClusterNamespacePermission) | **GET** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permissions/{permissionType} | 校验集群Namespace权限 (new added) | +| [**hasCreateApplicationPermission**](PermissionManagementApi.md#hasCreateApplicationPermission) | **GET** /openapi/v1/system/roles/create-application | 校验建应用权限 (new added) | +| [**hasEnvNamespacePermission**](PermissionManagementApi.md#hasEnvNamespacePermission) | **GET** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/permissions/{permissionType} | 校验环境Namespace权限 (new added) | +| [**hasNamespacePermission**](PermissionManagementApi.md#hasNamespacePermission) | **GET** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permissions/{permissionType} | 校验Namespace权限 (new added) | +| [**hasRootPermission**](PermissionManagementApi.md#hasRootPermission) | **GET** /openapi/v1/permissions/root | 校验Root权限 (new added) | +| [**initAppPermission**](PermissionManagementApi.md#initAppPermission) | **POST** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init | 初始化应用权限 (new added) | +| [**initClusterNamespacePermission**](PermissionManagementApi.md#initClusterNamespacePermission) | **POST** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permission-init | 初始化集群Namespace权限 (new added) | +| [**isManageAppMasterPermissionEnabled**](PermissionManagementApi.md#isManageAppMasterPermissionEnabled) | **GET** /openapi/v1/system/role/manage-app-master | 校验AppMaster开关 (new added) | +| [**removeAppRoleFromUser**](PermissionManagementApi.md#removeAppRoleFromUser) | **DELETE** /openapi/v1/apps/{appId}/roles/{roleType} | 移除应用角色 (new added) | +| [**removeClusterNamespaceRoleFromUser**](PermissionManagementApi.md#removeClusterNamespaceRoleFromUser) | **DELETE** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType} | 移除集群Namespace角色 (new added) | +| [**removeManageAppMasterRoleFromUser**](PermissionManagementApi.md#removeManageAppMasterRoleFromUser) | **DELETE** /openapi/v1/apps/{appId}/roles/master | 移除AppMaster (new added) | +| [**removeNamespaceEnvRoleFromUser**](PermissionManagementApi.md#removeNamespaceEnvRoleFromUser) | **DELETE** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType} | 移除环境Namespace角色 (new added) | +| [**removeNamespaceRoleFromUser**](PermissionManagementApi.md#removeNamespaceRoleFromUser) | **DELETE** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType} | 移除Namespace角色 (new added) | + + + +# **addCreateApplicationRoleToUsers** +> addCreateApplicationRoleToUsers(operator, requestBody) + +分配建应用角色 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String operator = "operator_example"; // String | 操作人用户名 + List requestBody = Arrays.asList(); // List | + try { + apiInstance.addCreateApplicationRoleToUsers(operator, requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#addCreateApplicationRoleToUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **operator** | **String**| 操作人用户名 | [optional] | +| **requestBody** | [**List<String>**](String.md)| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **addManageAppMasterRoleToUser** +> addManageAppMasterRoleToUser(appId, userId, operator) + +分配AppMaster (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String userId = "userId_example"; // String | the user which role assign to + String operator = "operator_example"; // String | 操作人用户名 + try { + apiInstance.addManageAppMasterRoleToUser(appId, userId, operator); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#addManageAppMasterRoleToUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **userId** | **String**| the user which role assign to | | +| **operator** | **String**| 操作人用户名 | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **assignAppRoleToUser** +> assignAppRoleToUser(appId, roleType, userId, operator, body) + +分配应用角色 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String roleType = "roleType_example"; // String | + String userId = "userId_example"; // String | the user which role removed from + String operator = "operator_example"; // String | 操作人用户名 + String body = "body_example"; // String | + try { + apiInstance.assignAppRoleToUser(appId, roleType, userId, operator, body); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#assignAppRoleToUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **roleType** | **String**| | | +| **userId** | **String**| the user which role removed from | | +| **operator** | **String**| 操作人用户名 | [optional] | +| **body** | **String**| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **assignClusterNamespaceRoleToUser** +> assignClusterNamespaceRoleToUser(appId, env, clusterName, roleType, userId, operator) + +分配集群Namespace角色 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + String clusterName = "clusterName_example"; // String | + String roleType = "roleType_example"; // String | + String userId = "userId_example"; // String | the user which role assigned to + String operator = "operator_example"; // String | 操作人用户名 + try { + apiInstance.assignClusterNamespaceRoleToUser(appId, env, clusterName, roleType, userId, operator); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#assignClusterNamespaceRoleToUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | +| **clusterName** | **String**| | | +| **roleType** | **String**| | | +| **userId** | **String**| the user which role assigned to | | +| **operator** | **String**| 操作人用户名 | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **assignNamespaceEnvRoleToUser** +> assignNamespaceEnvRoleToUser(appId, env, namespaceName, roleType, userId, operator) + +分配环境Namespace角色 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + String namespaceName = "namespaceName_example"; // String | + String roleType = "roleType_example"; // String | + String userId = "userId_example"; // String | the user which role assigned to + String operator = "operator_example"; // String | 操作人用户名 + try { + apiInstance.assignNamespaceEnvRoleToUser(appId, env, namespaceName, roleType, userId, operator); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#assignNamespaceEnvRoleToUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | +| **namespaceName** | **String**| | | +| **roleType** | **String**| | | +| **userId** | **String**| the user which role assigned to | | +| **operator** | **String**| 操作人用户名 | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **assignNamespaceRoleToUser** +> assignNamespaceRoleToUser(appId, namespaceName, roleType, userId, operator) + +分配Namespace角色 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String namespaceName = "namespaceName_example"; // String | + String roleType = "roleType_example"; // String | + String userId = "userId_example"; // String | the user which role assigned to + String operator = "operator_example"; // String | 操作人用户名 + try { + apiInstance.assignNamespaceRoleToUser(appId, namespaceName, roleType, userId, operator); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#assignNamespaceRoleToUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **namespaceName** | **String**| | | +| **roleType** | **String**| | | +| **userId** | **String**| the user which role assigned to | | +| **operator** | **String**| 操作人用户名 | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **deleteCreateApplicationRoleFromUser** +> deleteCreateApplicationRoleFromUser(userId, operator) + +移除建应用角色 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String userId = "userId_example"; // String | + String operator = "operator_example"; // String | 操作人用户名 + try { + apiInstance.deleteCreateApplicationRoleFromUser(userId, operator); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#deleteCreateApplicationRoleFromUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| | | +| **operator** | **String**| 操作人用户名 | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **getAppRoles** +> OpenAppRoleUserDTO getAppRoles(appId) + +获取应用角色用户 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + try { + OpenAppRoleUserDTO result = apiInstance.getAppRoles(appId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#getAppRoles"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | + +### Return type + +[**OpenAppRoleUserDTO**](OpenAppRoleUserDTO.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **getClusterNamespaceRoles** +> OpenClusterNamespaceRoleUserDTO getClusterNamespaceRoles(appId, env, clusterName) + +获取集群Namespace用户 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + String clusterName = "clusterName_example"; // String | + try { + OpenClusterNamespaceRoleUserDTO result = apiInstance.getClusterNamespaceRoles(appId, env, clusterName); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#getClusterNamespaceRoles"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | +| **clusterName** | **String**| | | + +### Return type + +[**OpenClusterNamespaceRoleUserDTO**](OpenClusterNamespaceRoleUserDTO.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **getCreateApplicationRoleUsers** +> List<String> getCreateApplicationRoleUsers() + +获取建应用用户 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + try { + List result = apiInstance.getCreateApplicationRoleUsers(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#getCreateApplicationRoleUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**List<String>** + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **getNamespaceEnvRoleUsers** +> OpenEnvNamespaceRoleUserDTO getNamespaceEnvRoleUsers(appId, env, namespaceName) + +获取环境Namespace用户 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + String namespaceName = "namespaceName_example"; // String | + try { + OpenEnvNamespaceRoleUserDTO result = apiInstance.getNamespaceEnvRoleUsers(appId, env, namespaceName); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#getNamespaceEnvRoleUsers"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | +| **namespaceName** | **String**| | | + +### Return type + +[**OpenEnvNamespaceRoleUserDTO**](OpenEnvNamespaceRoleUserDTO.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **getNamespaceRoles** +> OpenNamespaceRoleUserDTO getNamespaceRoles(appId, namespaceName) + +获取Namespace用户 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String namespaceName = "namespaceName_example"; // String | + try { + OpenNamespaceRoleUserDTO result = apiInstance.getNamespaceRoles(appId, namespaceName); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#getNamespaceRoles"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **namespaceName** | **String**| | | + +### Return type + +[**OpenNamespaceRoleUserDTO**](OpenNamespaceRoleUserDTO.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **hasAppPermission** +> OpenPermissionConditionDTO hasAppPermission(appId, permissionType, userId) + +校验应用权限 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String permissionType = "permissionType_example"; // String | + String userId = "userId_example"; // String | + try { + OpenPermissionConditionDTO result = apiInstance.hasAppPermission(appId, permissionType, userId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#hasAppPermission"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **permissionType** | **String**| | | +| **userId** | **String**| | | + +### Return type + +[**OpenPermissionConditionDTO**](OpenPermissionConditionDTO.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **hasClusterNamespacePermission** +> OpenPermissionConditionDTO hasClusterNamespacePermission(appId, env, clusterName, permissionType, userId) + +校验集群Namespace权限 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + String clusterName = "clusterName_example"; // String | + String permissionType = "permissionType_example"; // String | + String userId = "userId_example"; // String | + try { + OpenPermissionConditionDTO result = apiInstance.hasClusterNamespacePermission(appId, env, clusterName, permissionType, userId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#hasClusterNamespacePermission"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | +| **clusterName** | **String**| | | +| **permissionType** | **String**| | | +| **userId** | **String**| | | + +### Return type + +[**OpenPermissionConditionDTO**](OpenPermissionConditionDTO.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **hasCreateApplicationPermission** +> Map<String, Boolean> hasCreateApplicationPermission(userId) + +校验建应用权限 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String userId = "userId_example"; // String | + try { + Map result = apiInstance.hasCreateApplicationPermission(userId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#hasCreateApplicationPermission"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| | | + +### Return type + +**Map<String, Boolean>** + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **hasEnvNamespacePermission** +> OpenPermissionConditionDTO hasEnvNamespacePermission(appId, env, namespaceName, permissionType, userId) + +校验环境Namespace权限 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + String namespaceName = "namespaceName_example"; // String | + String permissionType = "permissionType_example"; // String | + String userId = "userId_example"; // String | + try { + OpenPermissionConditionDTO result = apiInstance.hasEnvNamespacePermission(appId, env, namespaceName, permissionType, userId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#hasEnvNamespacePermission"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | +| **namespaceName** | **String**| | | +| **permissionType** | **String**| | | +| **userId** | **String**| | | + +### Return type + +[**OpenPermissionConditionDTO**](OpenPermissionConditionDTO.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **hasNamespacePermission** +> OpenPermissionConditionDTO hasNamespacePermission(appId, namespaceName, permissionType, userId) + +校验Namespace权限 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String namespaceName = "namespaceName_example"; // String | + String permissionType = "permissionType_example"; // String | + String userId = "userId_example"; // String | + try { + OpenPermissionConditionDTO result = apiInstance.hasNamespacePermission(appId, namespaceName, permissionType, userId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#hasNamespacePermission"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **namespaceName** | **String**| | | +| **permissionType** | **String**| | | +| **userId** | **String**| | | + +### Return type + +[**OpenPermissionConditionDTO**](OpenPermissionConditionDTO.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **hasRootPermission** +> OpenPermissionConditionDTO hasRootPermission(userId) + +校验Root权限 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String userId = "userId_example"; // String | + try { + OpenPermissionConditionDTO result = apiInstance.hasRootPermission(userId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#hasRootPermission"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **userId** | **String**| | | + +### Return type + +[**OpenPermissionConditionDTO**](OpenPermissionConditionDTO.md) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **initAppPermission** +> initAppPermission(appId, namespaceName, operator) + +初始化应用权限 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String namespaceName = "namespaceName_example"; // String | + String operator = "operator_example"; // String | 操作人用户名 + try { + apiInstance.initAppPermission(appId, namespaceName, operator); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#initAppPermission"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **namespaceName** | **String**| | | +| **operator** | **String**| 操作人用户名 | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | 初始化成功 | - | + + +# **initClusterNamespacePermission** +> initClusterNamespacePermission(appId, env, clusterName, operator) + +初始化集群Namespace权限 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + String clusterName = "clusterName_example"; // String | + String operator = "operator_example"; // String | 操作人用户名 + try { + apiInstance.initClusterNamespacePermission(appId, env, clusterName, operator); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#initClusterNamespacePermission"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | +| **clusterName** | **String**| | | +| **operator** | **String**| 操作人用户名 | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **isManageAppMasterPermissionEnabled** +> Map<String, Boolean> isManageAppMasterPermissionEnabled() + +校验AppMaster开关 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + try { + Map result = apiInstance.isManageAppMasterPermissionEnabled(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#isManageAppMasterPermissionEnabled"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map<String, Boolean>** + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **removeAppRoleFromUser** +> removeAppRoleFromUser(appId, roleType, userId, operator) + +移除应用角色 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String roleType = "roleType_example"; // String | + String userId = "userId_example"; // String | the user which role removed from + String operator = "operator_example"; // String | 操作人用户名 + try { + apiInstance.removeAppRoleFromUser(appId, roleType, userId, operator); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#removeAppRoleFromUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **roleType** | **String**| | | +| **userId** | **String**| the user which role removed from | | +| **operator** | **String**| 操作人用户名 | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **removeClusterNamespaceRoleFromUser** +> removeClusterNamespaceRoleFromUser(appId, env, clusterName, roleType, userId, operator) + +移除集群Namespace角色 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + String clusterName = "clusterName_example"; // String | + String roleType = "roleType_example"; // String | + String userId = "userId_example"; // String | the user which role removed from + String operator = "operator_example"; // String | 操作人用户名 + try { + apiInstance.removeClusterNamespaceRoleFromUser(appId, env, clusterName, roleType, userId, operator); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#removeClusterNamespaceRoleFromUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | +| **clusterName** | **String**| | | +| **roleType** | **String**| | | +| **userId** | **String**| the user which role removed from | | +| **operator** | **String**| 操作人用户名 | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **removeManageAppMasterRoleFromUser** +> removeManageAppMasterRoleFromUser(appId, userId, operator) + +移除AppMaster (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String userId = "userId_example"; // String | the user which role removed from + String operator = "operator_example"; // String | 操作人用户名 + try { + apiInstance.removeManageAppMasterRoleFromUser(appId, userId, operator); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#removeManageAppMasterRoleFromUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **userId** | **String**| the user which role removed from | | +| **operator** | **String**| 操作人用户名 | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **removeNamespaceEnvRoleFromUser** +> removeNamespaceEnvRoleFromUser(appId, env, namespaceName, roleType, userId, operator) + +移除环境Namespace角色 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String env = "env_example"; // String | + String namespaceName = "namespaceName_example"; // String | + String roleType = "roleType_example"; // String | + String userId = "userId_example"; // String | the user which role removed from + String operator = "operator_example"; // String | 操作人用户名 + try { + apiInstance.removeNamespaceEnvRoleFromUser(appId, env, namespaceName, roleType, userId, operator); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#removeNamespaceEnvRoleFromUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **env** | **String**| | | +| **namespaceName** | **String**| | | +| **roleType** | **String**| | | +| **userId** | **String**| the user which role removed from | | +| **operator** | **String**| 操作人用户名 | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | + + +# **removeNamespaceRoleFromUser** +> removeNamespaceRoleFromUser(appId, namespaceName, roleType, userId, operator) + +移除Namespace角色 (new added) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PermissionManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://localhost"); + + // Configure API key authorization: ApiKeyAuth + ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth"); + ApiKeyAuth.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //ApiKeyAuth.setApiKeyPrefix("Token"); + + PermissionManagementApi apiInstance = new PermissionManagementApi(defaultClient); + String appId = "appId_example"; // String | + String namespaceName = "namespaceName_example"; // String | + String roleType = "roleType_example"; // String | + String userId = "userId_example"; // String | the user which role removed from + String operator = "operator_example"; // String | 操作人用户名 + try { + apiInstance.removeNamespaceRoleFromUser(appId, namespaceName, roleType, userId, operator); + } catch (ApiException e) { + System.err.println("Exception when calling PermissionManagementApi#removeNamespaceRoleFromUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **appId** | **String**| | | +| **namespaceName** | **String**| | | +| **roleType** | **String**| | | +| **userId** | **String**| the user which role removed from | | +| **operator** | **String**| 操作人用户名 | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[ApiKeyAuth](../README.md#ApiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | | - | diff --git a/java-client/docs/ReleaseManagementApi.md b/java-client/docs/ReleaseManagementApi.md index 506bfc8..0d645d4 100644 --- a/java-client/docs/ReleaseManagementApi.md +++ b/java-client/docs/ReleaseManagementApi.md @@ -4,23 +4,23 @@ All URIs are relative to *http://localhost* | Method | HTTP request | Description | |------------- | ------------- | -------------| +| [**compareRelease**](ReleaseManagementApi.md#compareRelease) | **GET** /openapi/v1/envs/{env}/releases/comparison | Compare two releases | | [**createGrayDelRelease**](ReleaseManagementApi.md#createGrayDelRelease) | **POST** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/gray-del-releases | 创建灰度删除发布 (original openapi) | | [**createGrayRelease**](ReleaseManagementApi.md#createGrayRelease) | **POST** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/releases | 创建灰度发布 (original openapi) | | [**createRelease**](ReleaseManagementApi.md#createRelease) | **POST** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases | 创建发布 (original openapi) | | [**findActiveReleases**](ReleaseManagementApi.md#findActiveReleases) | **GET** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active | 获取活跃发布(分页) (new added) | -| [**findAllReleases**](ReleaseManagementApi.md#findAllReleases) | **GET** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all | 获取所有发布(分页) (new added) | | [**getReleaseById**](ReleaseManagementApi.md#getReleaseById) | **GET** /openapi/v1/envs/{env}/releases/{releaseId} | 获取发布详情 (new added) | | [**loadLatestActiveRelease**](ReleaseManagementApi.md#loadLatestActiveRelease) | **GET** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/latest | 获取最新活跃发布 (original openapi) | | [**rollback**](ReleaseManagementApi.md#rollback) | **PUT** /openapi/v1/envs/{env}/releases/{releaseId}/rollback | 回滚发布 (original openapi) | - -# **createGrayDelRelease** -> OpenReleaseDTO createGrayDelRelease(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO) - -创建灰度删除发布 (original openapi) + +# **compareRelease** +> OpenReleaseDiffDTO compareRelease(env, baseReleaseId, toCompareReleaseId) +Compare two releases +Get the configuration differences between two releases. ### Example ```java @@ -44,17 +44,14 @@ public class Example { //ApiKeyAuth.setApiKeyPrefix("Token"); ReleaseManagementApi apiInstance = new ReleaseManagementApi(defaultClient); - String appId = "appId_example"; // String | - String env = "env_example"; // String | - String clusterName = "clusterName_example"; // String | - String namespaceName = "namespaceName_example"; // String | - String branchName = "branchName_example"; // String | - NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO = new NamespaceGrayDelReleaseDTO(); // NamespaceGrayDelReleaseDTO | + String env = "env_example"; // String | Environment + Long baseReleaseId = 56L; // Long | The base release ID + Long toCompareReleaseId = 56L; // Long | The release ID to compare against try { - OpenReleaseDTO result = apiInstance.createGrayDelRelease(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO); + OpenReleaseDiffDTO result = apiInstance.compareRelease(env, baseReleaseId, toCompareReleaseId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling ReleaseManagementApi#createGrayDelRelease"); + System.err.println("Exception when calling ReleaseManagementApi#compareRelease"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -68,16 +65,13 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| | | -| **env** | **String**| | | -| **clusterName** | **String**| | | -| **namespaceName** | **String**| | | -| **branchName** | **String**| | | -| **namespaceGrayDelReleaseDTO** | [**NamespaceGrayDelReleaseDTO**](NamespaceGrayDelReleaseDTO.md)| | | +| **env** | **String**| Environment | | +| **baseReleaseId** | **Long**| The base release ID | | +| **toCompareReleaseId** | **Long**| The release ID to compare against | | ### Return type -[**OpenReleaseDTO**](OpenReleaseDTO.md) +[**OpenReleaseDiffDTO**](OpenReleaseDiffDTO.md) ### Authorization @@ -85,21 +79,21 @@ public class Example { ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | | - | +| **200** | Successful comparison | - | - -# **createGrayRelease** -> OpenReleaseDTO createGrayRelease(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO) + +# **createGrayDelRelease** +> OpenReleaseDTO createGrayDelRelease(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO, operator) + +创建灰度删除发布 (original openapi) -创建灰度发布 (original openapi) -创建灰度发布 ### Example ```java @@ -123,17 +117,18 @@ public class Example { //ApiKeyAuth.setApiKeyPrefix("Token"); ReleaseManagementApi apiInstance = new ReleaseManagementApi(defaultClient); - String appId = "appId_example"; // String | app标识 - String env = "env_example"; // String | 环境标识 - String clusterName = "clusterName_example"; // String | 集群名称 - String namespaceName = "namespaceName_example"; // String | 命名空间名称 - String branchName = "branchName_example"; // String | 分支名称 - NamespaceReleaseDTO namespaceReleaseDTO = new NamespaceReleaseDTO(); // NamespaceReleaseDTO | + String appId = "appId_example"; // String | + String env = "env_example"; // String | + String clusterName = "clusterName_example"; // String | + String namespaceName = "namespaceName_example"; // String | + String branchName = "branchName_example"; // String | + NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO = new NamespaceGrayDelReleaseDTO(); // NamespaceGrayDelReleaseDTO | + String operator = "operator_example"; // String | 操作人用户名 try { - OpenReleaseDTO result = apiInstance.createGrayRelease(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO); + OpenReleaseDTO result = apiInstance.createGrayDelRelease(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO, operator); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling ReleaseManagementApi#createGrayRelease"); + System.err.println("Exception when calling ReleaseManagementApi#createGrayDelRelease"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -147,12 +142,13 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| app标识 | | -| **env** | **String**| 环境标识 | | -| **clusterName** | **String**| 集群名称 | | -| **namespaceName** | **String**| 命名空间名称 | | -| **branchName** | **String**| 分支名称 | | -| **namespaceReleaseDTO** | [**NamespaceReleaseDTO**](NamespaceReleaseDTO.md)| | | +| **appId** | **String**| | | +| **env** | **String**| | | +| **clusterName** | **String**| | | +| **namespaceName** | **String**| | | +| **branchName** | **String**| | | +| **namespaceGrayDelReleaseDTO** | [**NamespaceGrayDelReleaseDTO**](NamespaceGrayDelReleaseDTO.md)| | | +| **operator** | **String**| 操作人用户名 | [optional] | ### Return type @@ -170,15 +166,15 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | 灰度发布创建成功 | - | +| **200** | | - | - -# **createRelease** -> OpenReleaseDTO createRelease(appId, env, clusterName, namespaceName, namespaceReleaseDTO) + +# **createGrayRelease** +> OpenReleaseDTO createGrayRelease(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO, operator) -创建发布 (original openapi) +创建灰度发布 (original openapi) -创建发布 +创建灰度发布 ### Example ```java @@ -204,14 +200,16 @@ public class Example { ReleaseManagementApi apiInstance = new ReleaseManagementApi(defaultClient); String appId = "appId_example"; // String | app标识 String env = "env_example"; // String | 环境标识 - String clusterName = "clusterName_example"; // String | + String clusterName = "clusterName_example"; // String | 集群名称 String namespaceName = "namespaceName_example"; // String | 命名空间名称 + String branchName = "branchName_example"; // String | 分支名称 NamespaceReleaseDTO namespaceReleaseDTO = new NamespaceReleaseDTO(); // NamespaceReleaseDTO | + String operator = "operator_example"; // String | 操作人用户名 try { - OpenReleaseDTO result = apiInstance.createRelease(appId, env, clusterName, namespaceName, namespaceReleaseDTO); + OpenReleaseDTO result = apiInstance.createGrayRelease(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO, operator); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling ReleaseManagementApi#createRelease"); + System.err.println("Exception when calling ReleaseManagementApi#createGrayRelease"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -227,9 +225,11 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **appId** | **String**| app标识 | | | **env** | **String**| 环境标识 | | -| **clusterName** | **String**| | | +| **clusterName** | **String**| 集群名称 | | | **namespaceName** | **String**| 命名空间名称 | | +| **branchName** | **String**| 分支名称 | | | **namespaceReleaseDTO** | [**NamespaceReleaseDTO**](NamespaceReleaseDTO.md)| | | +| **operator** | **String**| 操作人用户名 | [optional] | ### Return type @@ -247,17 +247,15 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | 发布创建成功 | - | -| **400** | 发布参数错误 | - | -| **403** | 权限不足 | - | +| **200** | 灰度发布创建成功 | - | - -# **findActiveReleases** -> List<OpenReleaseDTO> findActiveReleases(appId, env, clusterName, namespaceName, page, size) + +# **createRelease** +> OpenReleaseDTO createRelease(appId, env, clusterName, namespaceName, namespaceReleaseDTO, operator) -获取活跃发布(分页) (new added) +创建发布 (original openapi) -GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active +创建发布 ### Example ```java @@ -281,17 +279,17 @@ public class Example { //ApiKeyAuth.setApiKeyPrefix("Token"); ReleaseManagementApi apiInstance = new ReleaseManagementApi(defaultClient); - String appId = "appId_example"; // String | 应用ID + String appId = "appId_example"; // String | app标识 String env = "env_example"; // String | 环境标识 - String clusterName = "clusterName_example"; // String | 集群名称 + String clusterName = "clusterName_example"; // String | String namespaceName = "namespaceName_example"; // String | 命名空间名称 - Integer page = 0; // Integer | 页码,从0开始 - Integer size = 5; // Integer | 每页数量 + NamespaceReleaseDTO namespaceReleaseDTO = new NamespaceReleaseDTO(); // NamespaceReleaseDTO | + String operator = "operator_example"; // String | 操作人用户名 try { - List result = apiInstance.findActiveReleases(appId, env, clusterName, namespaceName, page, size); + OpenReleaseDTO result = apiInstance.createRelease(appId, env, clusterName, namespaceName, namespaceReleaseDTO, operator); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling ReleaseManagementApi#findActiveReleases"); + System.err.println("Exception when calling ReleaseManagementApi#createRelease"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -305,16 +303,16 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **appId** | **String**| 应用ID | | +| **appId** | **String**| app标识 | | | **env** | **String**| 环境标识 | | -| **clusterName** | **String**| 集群名称 | | +| **clusterName** | **String**| | | | **namespaceName** | **String**| 命名空间名称 | | -| **page** | **Integer**| 页码,从0开始 | | -| **size** | **Integer**| 每页数量 | | +| **namespaceReleaseDTO** | [**NamespaceReleaseDTO**](NamespaceReleaseDTO.md)| | | +| **operator** | **String**| 操作人用户名 | [optional] | ### Return type -[**List<OpenReleaseDTO>**](OpenReleaseDTO.md) +[**OpenReleaseDTO**](OpenReleaseDTO.md) ### Authorization @@ -322,21 +320,23 @@ public class Example { ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | 成功获取活跃发布列表 | - | +| **200** | 发布创建成功 | - | +| **400** | 发布参数错误 | - | +| **403** | 权限不足 | - | - -# **findAllReleases** -> List<OpenReleaseBO> findAllReleases(appId, env, clusterName, namespaceName, page, size) + +# **findActiveReleases** +> List<OpenReleaseDTO> findActiveReleases(appId, env, clusterName, namespaceName, page, size) -获取所有发布(分页) (new added) +获取活跃发布(分页) (new added) -GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all +GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active ### Example ```java @@ -367,10 +367,10 @@ public class Example { Integer page = 0; // Integer | 页码,从0开始 Integer size = 5; // Integer | 每页数量 try { - List result = apiInstance.findAllReleases(appId, env, clusterName, namespaceName, page, size); + List result = apiInstance.findActiveReleases(appId, env, clusterName, namespaceName, page, size); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling ReleaseManagementApi#findAllReleases"); + System.err.println("Exception when calling ReleaseManagementApi#findActiveReleases"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -393,7 +393,7 @@ public class Example { ### Return type -[**List<OpenReleaseBO>**](OpenReleaseBO.md) +[**List<OpenReleaseDTO>**](OpenReleaseDTO.md) ### Authorization @@ -407,7 +407,7 @@ public class Example { ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | 成功获取发布列表 | - | +| **200** | 成功获取活跃发布列表 | - | # **getReleaseById** @@ -558,7 +558,7 @@ public class Example { # **rollback** -> Object rollback(env, releaseId, operator) +> rollback(env, releaseId, operator) 回滚发布 (original openapi) @@ -590,8 +590,7 @@ public class Example { Long releaseId = 56L; // Long | 发布ID String operator = "operator_example"; // String | 操作人用户名 try { - Object result = apiInstance.rollback(env, releaseId, operator); - System.out.println(result); + apiInstance.rollback(env, releaseId, operator); } catch (ApiException e) { System.err.println("Exception when calling ReleaseManagementApi#rollback"); System.err.println("Status code: " + e.getCode()); @@ -613,7 +612,7 @@ public class Example { ### Return type -**Object** +null (empty response body) ### Authorization @@ -622,7 +621,7 @@ public class Example { ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json + - **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | 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 0f8e325..642b886 100644 --- a/java-client/src/main/java/org/openapitools/client/JSON.java +++ b/java-client/src/main/java/org/openapitools/client/JSON.java @@ -94,17 +94,20 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.ExceptionResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.KVEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NamespaceGrayDelReleaseDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.NamespaceReleaseDTO.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenAccessKeyDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenAppDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenAppNamespaceDTO.CustomTypeAdapterFactory()); + 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.OpenCreateAppDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenCreateItemDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenCreateNamespaceDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenEnvClusterDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenEnvClusterInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenEnvNamespaceRoleUserDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenGrayReleaseRuleDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenGrayReleaseRuleItemDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenInstanceConfigDTO.CustomTypeAdapterFactory()); @@ -120,12 +123,16 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenNamespaceExtendDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenNamespaceIdentifier.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenNamespaceLockDTO.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenNamespaceRoleUserDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenNamespaceSyncDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenNamespaceTextModel.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenNamespaceUsageDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenOrganizationDto.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenReleaseBO.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenPermissionConditionDTO.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenReleaseChangeDTO.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenReleaseDTO.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenReleaseDiffDTO.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new org.openapitools.client.model.OpenUserInfoDTO.CustomTypeAdapterFactory()); gson = gsonBuilder.create(); } 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 new file mode 100644 index 0000000..45bde91 --- /dev/null +++ b/java-client/src/main/java/org/openapitools/client/api/AccessKeyManagementApi.java @@ -0,0 +1,780 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.OpenAccessKeyDTO; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class AccessKeyManagementApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AccessKeyManagementApi() { + this(Configuration.getDefaultApiClient()); + } + + public AccessKeyManagementApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for createAccessKey + * @param appId (required) + * @param env (required) + * @param operator (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call createAccessKeyCall(String appId, String env, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createAccessKeyValidateBeforeCall(String appId, String env, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling createAccessKey(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling createAccessKey(Async)"); + } + + return createAccessKeyCall(appId, env, operator, _callback); + + } + + /** + * 创建AccessKey + * + * @param appId (required) + * @param env (required) + * @param operator (optional) + * @return OpenAccessKeyDTO + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public OpenAccessKeyDTO createAccessKey(String appId, String env, String operator) throws ApiException { + ApiResponse localVarResp = createAccessKeyWithHttpInfo(appId, env, operator); + return localVarResp.getData(); + } + + /** + * 创建AccessKey + * + * @param appId (required) + * @param env (required) + * @param operator (optional) + * @return ApiResponse<OpenAccessKeyDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse createAccessKeyWithHttpInfo(String appId, String env, String operator) throws ApiException { + okhttp3.Call localVarCall = createAccessKeyValidateBeforeCall(appId, env, operator, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 创建AccessKey (asynchronously) + * + * @param appId (required) + * @param env (required) + * @param operator (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call createAccessKeyAsync(String appId, String env, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = createAccessKeyValidateBeforeCall(appId, env, operator, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteAccessKey + * @param appId (required) + * @param env (required) + * @param accessKeyId (required) + * @param operator (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call deleteAccessKeyCall(String appId, String env, Long accessKeyId, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())) + .replace("{" + "accessKeyId" + "}", localVarApiClient.escapeString(accessKeyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteAccessKeyValidateBeforeCall(String appId, String env, Long accessKeyId, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling deleteAccessKey(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling deleteAccessKey(Async)"); + } + + // verify the required parameter 'accessKeyId' is set + if (accessKeyId == null) { + throw new ApiException("Missing the required parameter 'accessKeyId' when calling deleteAccessKey(Async)"); + } + + return deleteAccessKeyCall(appId, env, accessKeyId, operator, _callback); + + } + + /** + * 删除AccessKey + * + * @param appId (required) + * @param env (required) + * @param accessKeyId (required) + * @param operator (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void deleteAccessKey(String appId, String env, Long accessKeyId, String operator) throws ApiException { + deleteAccessKeyWithHttpInfo(appId, env, accessKeyId, operator); + } + + /** + * 删除AccessKey + * + * @param appId (required) + * @param env (required) + * @param accessKeyId (required) + * @param operator (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse deleteAccessKeyWithHttpInfo(String appId, String env, Long accessKeyId, String operator) throws ApiException { + okhttp3.Call localVarCall = deleteAccessKeyValidateBeforeCall(appId, env, accessKeyId, operator, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 删除AccessKey (asynchronously) + * + * @param appId (required) + * @param env (required) + * @param accessKeyId (required) + * @param operator (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call deleteAccessKeyAsync(String appId, String env, Long accessKeyId, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteAccessKeyValidateBeforeCall(appId, env, accessKeyId, operator, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for disableAccessKey + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call disableAccessKeyCall(String appId, String env, Long accessKeyId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())) + .replace("{" + "accessKeyId" + "}", localVarApiClient.escapeString(accessKeyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call disableAccessKeyValidateBeforeCall(String appId, String env, Long accessKeyId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling disableAccessKey(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling disableAccessKey(Async)"); + } + + // verify the required parameter 'accessKeyId' is set + if (accessKeyId == null) { + throw new ApiException("Missing the required parameter 'accessKeyId' when calling disableAccessKey(Async)"); + } + + return disableAccessKeyCall(appId, env, accessKeyId, _callback); + + } + + /** + * 禁用AccessKey + * + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void disableAccessKey(String appId, String env, Long accessKeyId) throws ApiException { + disableAccessKeyWithHttpInfo(appId, env, accessKeyId); + } + + /** + * 禁用AccessKey + * + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse disableAccessKeyWithHttpInfo(String appId, String env, Long accessKeyId) throws ApiException { + okhttp3.Call localVarCall = disableAccessKeyValidateBeforeCall(appId, env, accessKeyId, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 禁用AccessKey (asynchronously) + * + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call disableAccessKeyAsync(String appId, String env, Long accessKeyId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = disableAccessKeyValidateBeforeCall(appId, env, accessKeyId, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for enableAccessKey + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call enableAccessKeyCall(String appId, String env, Long accessKeyId, Integer mode, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/activation" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())) + .replace("{" + "accessKeyId" + "}", localVarApiClient.escapeString(accessKeyId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (mode != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("mode", mode)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call enableAccessKeyValidateBeforeCall(String appId, String env, Long accessKeyId, Integer mode, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling enableAccessKey(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling enableAccessKey(Async)"); + } + + // verify the required parameter 'accessKeyId' is set + if (accessKeyId == null) { + throw new ApiException("Missing the required parameter 'accessKeyId' when calling enableAccessKey(Async)"); + } + + return enableAccessKeyCall(appId, env, accessKeyId, mode, _callback); + + } + + /** + * 启用AccessKey + * + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void enableAccessKey(String appId, String env, Long accessKeyId, Integer mode) throws ApiException { + enableAccessKeyWithHttpInfo(appId, env, accessKeyId, mode); + } + + /** + * 启用AccessKey + * + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse enableAccessKeyWithHttpInfo(String appId, String env, Long accessKeyId, Integer mode) throws ApiException { + okhttp3.Call localVarCall = enableAccessKeyValidateBeforeCall(appId, env, accessKeyId, mode, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 启用AccessKey (asynchronously) + * + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call enableAccessKeyAsync(String appId, String env, Long accessKeyId, Integer mode, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = enableAccessKeyValidateBeforeCall(appId, env, accessKeyId, mode, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for findAccessKeys + * @param appId (required) + * @param env (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call findAccessKeysCall(String appId, String env, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call findAccessKeysValidateBeforeCall(String appId, String env, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling findAccessKeys(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling findAccessKeys(Async)"); + } + + return findAccessKeysCall(appId, env, _callback); + + } + + /** + * 查找AccessKey + * + * @param appId (required) + * @param env (required) + * @return List<OpenAccessKeyDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public List findAccessKeys(String appId, String env) throws ApiException { + ApiResponse> localVarResp = findAccessKeysWithHttpInfo(appId, env); + return localVarResp.getData(); + } + + /** + * 查找AccessKey + * + * @param appId (required) + * @param env (required) + * @return ApiResponse<List<OpenAccessKeyDTO>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse> findAccessKeysWithHttpInfo(String appId, String env) throws ApiException { + okhttp3.Call localVarCall = findAccessKeysValidateBeforeCall(appId, env, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 查找AccessKey (asynchronously) + * + * @param appId (required) + * @param env (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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call findAccessKeysAsync(String appId, String env, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = findAccessKeysValidateBeforeCall(appId, env, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/java-client/src/main/java/org/openapitools/client/api/AppManagementApi.java b/java-client/src/main/java/org/openapitools/client/api/AppManagementApi.java index fd79da8..db62893 100644 --- a/java-client/src/main/java/org/openapitools/client/api/AppManagementApi.java +++ b/java-client/src/main/java/org/openapitools/client/api/AppManagementApi.java @@ -297,7 +297,6 @@ private okhttp3.Call createAppInEnvValidateBeforeCall(String env, OpenAppDTO ope * @param env 环境标识,例如 DEV、FAT、UAT、PROD (required) * @param openAppDTO (required) * @param operator 操作人用户名 (optional) - * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -307,9 +306,8 @@ private okhttp3.Call createAppInEnvValidateBeforeCall(String env, OpenAppDTO ope
403 权限不足 -
*/ - public Object createAppInEnv(String env, OpenAppDTO openAppDTO, String operator) throws ApiException { - ApiResponse localVarResp = createAppInEnvWithHttpInfo(env, openAppDTO, operator); - return localVarResp.getData(); + public void createAppInEnv(String env, OpenAppDTO openAppDTO, String operator) throws ApiException { + createAppInEnvWithHttpInfo(env, openAppDTO, operator); } /** @@ -318,7 +316,7 @@ public Object createAppInEnv(String env, OpenAppDTO openAppDTO, String operator) * @param env 环境标识,例如 DEV、FAT、UAT、PROD (required) * @param openAppDTO (required) * @param operator 操作人用户名 (optional) - * @return ApiResponse<Object> + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -328,10 +326,9 @@ public Object createAppInEnv(String env, OpenAppDTO openAppDTO, String operator)
403 权限不足 -
*/ - public ApiResponse createAppInEnvWithHttpInfo(String env, OpenAppDTO openAppDTO, String operator) throws ApiException { + public ApiResponse createAppInEnvWithHttpInfo(String env, OpenAppDTO openAppDTO, String operator) throws ApiException { okhttp3.Call localVarCall = createAppInEnvValidateBeforeCall(env, openAppDTO, operator, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + return localVarApiClient.execute(localVarCall); } /** @@ -351,11 +348,10 @@ public ApiResponse createAppInEnvWithHttpInfo(String env, OpenAppDTO ope 403 权限不足 - */ - public okhttp3.Call createAppInEnvAsync(String env, OpenAppDTO openAppDTO, String operator, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createAppInEnvAsync(String env, OpenAppDTO openAppDTO, String operator, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createAppInEnvValidateBeforeCall(env, openAppDTO, operator, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** @@ -438,7 +434,6 @@ private okhttp3.Call deleteAppValidateBeforeCall(String appId, String operator, * DELETE /openapi/v1/apps/{appId} * @param appId 应用ID (required) * @param operator 操作人用户名 (optional) - * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -448,9 +443,8 @@ private okhttp3.Call deleteAppValidateBeforeCall(String appId, String operator,
404 应用不存在 -
*/ - public Object deleteApp(String appId, String operator) throws ApiException { - ApiResponse localVarResp = deleteAppWithHttpInfo(appId, operator); - return localVarResp.getData(); + public void deleteApp(String appId, String operator) throws ApiException { + deleteAppWithHttpInfo(appId, operator); } /** @@ -458,7 +452,7 @@ public Object deleteApp(String appId, String operator) throws ApiException { * DELETE /openapi/v1/apps/{appId} * @param appId 应用ID (required) * @param operator 操作人用户名 (optional) - * @return ApiResponse<Object> + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -468,10 +462,9 @@ public Object deleteApp(String appId, String operator) throws ApiException {
404 应用不存在 -
*/ - public ApiResponse deleteAppWithHttpInfo(String appId, String operator) throws ApiException { + public ApiResponse deleteAppWithHttpInfo(String appId, String operator) throws ApiException { okhttp3.Call localVarCall = deleteAppValidateBeforeCall(appId, operator, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + return localVarApiClient.execute(localVarCall); } /** @@ -490,11 +483,10 @@ public ApiResponse deleteAppWithHttpInfo(String appId, String operator) 404 应用不存在 - */ - public okhttp3.Call deleteAppAsync(String appId, String operator, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteAppAsync(String appId, String operator, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteAppValidateBeforeCall(appId, operator, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** @@ -1474,7 +1466,6 @@ private okhttp3.Call updateAppValidateBeforeCall(String appId, OpenAppDTO openAp * @param appId 应用ID (required) * @param openAppDTO (required) * @param operator 操作人用户名 (optional) - * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1484,9 +1475,8 @@ private okhttp3.Call updateAppValidateBeforeCall(String appId, OpenAppDTO openAp
403 权限不足 -
*/ - public Object updateApp(String appId, OpenAppDTO openAppDTO, String operator) throws ApiException { - ApiResponse localVarResp = updateAppWithHttpInfo(appId, openAppDTO, operator); - return localVarResp.getData(); + public void updateApp(String appId, OpenAppDTO openAppDTO, String operator) throws ApiException { + updateAppWithHttpInfo(appId, openAppDTO, operator); } /** @@ -1495,7 +1485,7 @@ public Object updateApp(String appId, OpenAppDTO openAppDTO, String operator) th * @param appId 应用ID (required) * @param openAppDTO (required) * @param operator 操作人用户名 (optional) - * @return ApiResponse<Object> + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1505,10 +1495,9 @@ public Object updateApp(String appId, OpenAppDTO openAppDTO, String operator) th
403 权限不足 -
*/ - public ApiResponse updateAppWithHttpInfo(String appId, OpenAppDTO openAppDTO, String operator) throws ApiException { + public ApiResponse updateAppWithHttpInfo(String appId, OpenAppDTO openAppDTO, String operator) throws ApiException { okhttp3.Call localVarCall = updateAppValidateBeforeCall(appId, openAppDTO, operator, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + return localVarApiClient.execute(localVarCall); } /** @@ -1528,11 +1517,10 @@ public ApiResponse updateAppWithHttpInfo(String appId, OpenAppDTO openAp 403 权限不足 - */ - public okhttp3.Call updateAppAsync(String appId, OpenAppDTO openAppDTO, String operator, final ApiCallback _callback) throws ApiException { + public okhttp3.Call updateAppAsync(String appId, OpenAppDTO openAppDTO, String operator, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = updateAppValidateBeforeCall(appId, openAppDTO, operator, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } } diff --git a/java-client/src/main/java/org/openapitools/client/api/ClusterManagementApi.java b/java-client/src/main/java/org/openapitools/client/api/ClusterManagementApi.java index 3276dd1..bb5e01f 100644 --- a/java-client/src/main/java/org/openapitools/client/api/ClusterManagementApi.java +++ b/java-client/src/main/java/org/openapitools/client/api/ClusterManagementApi.java @@ -322,7 +322,6 @@ private okhttp3.Call deleteClusterValidateBeforeCall(String env, String appId, S * @param appId (required) * @param clusterName (required) * @param operator 操作人用户名,openapi外部调用时需传入 (optional) - * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -333,9 +332,8 @@ private okhttp3.Call deleteClusterValidateBeforeCall(String env, String appId, S
404 集群不存在 -
*/ - public Object deleteCluster(String env, String appId, String clusterName, String operator) throws ApiException { - ApiResponse localVarResp = deleteClusterWithHttpInfo(env, appId, clusterName, operator); - return localVarResp.getData(); + public void deleteCluster(String env, String appId, String clusterName, String operator) throws ApiException { + deleteClusterWithHttpInfo(env, appId, clusterName, operator); } /** @@ -345,7 +343,7 @@ public Object deleteCluster(String env, String appId, String clusterName, String * @param appId (required) * @param clusterName (required) * @param operator 操作人用户名,openapi外部调用时需传入 (optional) - * @return ApiResponse<Object> + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -356,10 +354,9 @@ public Object deleteCluster(String env, String appId, String clusterName, String
404 集群不存在 -
*/ - public ApiResponse deleteClusterWithHttpInfo(String env, String appId, String clusterName, String operator) throws ApiException { + public ApiResponse deleteClusterWithHttpInfo(String env, String appId, String clusterName, String operator) throws ApiException { okhttp3.Call localVarCall = deleteClusterValidateBeforeCall(env, appId, clusterName, operator, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + return localVarApiClient.execute(localVarCall); } /** @@ -381,11 +378,10 @@ public ApiResponse deleteClusterWithHttpInfo(String env, String appId, S 404 集群不存在 - */ - public okhttp3.Call deleteClusterAsync(String env, String appId, String clusterName, String operator, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deleteClusterAsync(String env, String appId, String clusterName, String operator, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = deleteClusterValidateBeforeCall(env, appId, clusterName, operator, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** diff --git a/java-client/src/main/java/org/openapitools/client/api/InstanceManagementApi.java b/java-client/src/main/java/org/openapitools/client/api/InstanceManagementApi.java index cc9855b..ad42a55 100644 --- a/java-client/src/main/java/org/openapitools/client/api/InstanceManagementApi.java +++ b/java-client/src/main/java/org/openapitools/client/api/InstanceManagementApi.java @@ -438,7 +438,7 @@ public okhttp3.Call getByReleaseAsync(String env, Long releaseId, Integer page, * @param appId 应用ID (required) * @param clusterName 集群名称 (required) * @param namespaceName 命名空间名称 (required) - * @param releaseIds 排除的发布ID列表,用逗号分隔 (optional) + * @param releaseIds 排除的发布ID列表,用逗号分隔 (required) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -531,6 +531,11 @@ private okhttp3.Call getByReleasesAndNamespaceNotInValidateBeforeCall(String env throw new ApiException("Missing the required parameter 'namespaceName' when calling getByReleasesAndNamespaceNotIn(Async)"); } + // verify the required parameter 'releaseIds' is set + if (releaseIds == null) { + throw new ApiException("Missing the required parameter 'releaseIds' when calling getByReleasesAndNamespaceNotIn(Async)"); + } + return getByReleasesAndNamespaceNotInCall(env, appId, clusterName, namespaceName, releaseIds, _callback); } @@ -542,7 +547,7 @@ private okhttp3.Call getByReleasesAndNamespaceNotInValidateBeforeCall(String env * @param appId 应用ID (required) * @param clusterName 集群名称 (required) * @param namespaceName 命名空间名称 (required) - * @param releaseIds 排除的发布ID列表,用逗号分隔 (optional) + * @param releaseIds 排除的发布ID列表,用逗号分隔 (required) * @return List<OpenInstanceDTO> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -563,7 +568,7 @@ public List getByReleasesAndNamespaceNotIn(String env, String a * @param appId 应用ID (required) * @param clusterName 集群名称 (required) * @param namespaceName 命名空间名称 (required) - * @param releaseIds 排除的发布ID列表,用逗号分隔 (optional) + * @param releaseIds 排除的发布ID列表,用逗号分隔 (required) * @return ApiResponse<List<OpenInstanceDTO>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -585,7 +590,7 @@ public ApiResponse> getByReleasesAndNamespaceNotInWithHttp * @param appId 应用ID (required) * @param clusterName 集群名称 (required) * @param namespaceName 命名空间名称 (required) - * @param releaseIds 排除的发布ID列表,用逗号分隔 (optional) + * @param releaseIds 排除的发布ID列表,用逗号分隔 (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 diff --git a/java-client/src/main/java/org/openapitools/client/api/NamespaceManagementApi.java b/java-client/src/main/java/org/openapitools/client/api/NamespaceManagementApi.java index c5b1db4..6cf8f20 100644 --- a/java-client/src/main/java/org/openapitools/client/api/NamespaceManagementApi.java +++ b/java-client/src/main/java/org/openapitools/client/api/NamespaceManagementApi.java @@ -123,7 +123,6 @@ public okhttp3.Call createMissingNamespacesCall(String appId, String env, String } final String[] localVarAccepts = { - "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -169,7 +168,6 @@ private okhttp3.Call createMissingNamespacesValidateBeforeCall(String appId, Str * @param env 环境标识 (required) * @param clusterName 集群名称 (required) * @param operator 操作人用户名 (optional) - * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -177,9 +175,8 @@ private okhttp3.Call createMissingNamespacesValidateBeforeCall(String appId, Str
200 缺失的命名空间创建成功 -
*/ - public Object createMissingNamespaces(String appId, String env, String clusterName, String operator) throws ApiException { - ApiResponse localVarResp = createMissingNamespacesWithHttpInfo(appId, env, clusterName, operator); - return localVarResp.getData(); + public void createMissingNamespaces(String appId, String env, String clusterName, String operator) throws ApiException { + createMissingNamespacesWithHttpInfo(appId, env, clusterName, operator); } /** @@ -189,7 +186,7 @@ public Object createMissingNamespaces(String appId, String env, String clusterNa * @param env 环境标识 (required) * @param clusterName 集群名称 (required) * @param operator 操作人用户名 (optional) - * @return ApiResponse<Object> + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -197,10 +194,9 @@ public Object createMissingNamespaces(String appId, String env, String clusterNa
200 缺失的命名空间创建成功 -
*/ - public ApiResponse createMissingNamespacesWithHttpInfo(String appId, String env, String clusterName, String operator) throws ApiException { + public ApiResponse createMissingNamespacesWithHttpInfo(String appId, String env, String clusterName, String operator) throws ApiException { okhttp3.Call localVarCall = createMissingNamespacesValidateBeforeCall(appId, env, clusterName, operator, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + return localVarApiClient.execute(localVarCall); } /** @@ -219,11 +215,10 @@ public ApiResponse createMissingNamespacesWithHttpInfo(String appId, Str 200 缺失的命名空间创建成功 - */ - public okhttp3.Call createMissingNamespacesAsync(String appId, String env, String clusterName, String operator, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createMissingNamespacesAsync(String appId, String env, String clusterName, String operator, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = createMissingNamespacesValidateBeforeCall(appId, env, clusterName, operator, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } /** diff --git a/java-client/src/main/java/org/openapitools/client/api/PermissionManagementApi.java b/java-client/src/main/java/org/openapitools/client/api/PermissionManagementApi.java new file mode 100644 index 0000000..0812aaf --- /dev/null +++ b/java-client/src/main/java/org/openapitools/client/api/PermissionManagementApi.java @@ -0,0 +1,3841 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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.api; + +import org.openapitools.client.ApiCallback; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.ProgressRequestBody; +import org.openapitools.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import org.openapitools.client.model.OpenAppRoleUserDTO; +import org.openapitools.client.model.OpenClusterNamespaceRoleUserDTO; +import org.openapitools.client.model.OpenEnvNamespaceRoleUserDTO; +import org.openapitools.client.model.OpenNamespaceRoleUserDTO; +import org.openapitools.client.model.OpenPermissionConditionDTO; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +public class PermissionManagementApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PermissionManagementApi() { + this(Configuration.getDefaultApiClient()); + } + + public PermissionManagementApi(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public ApiClient getApiClient() { + return localVarApiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.localVarApiClient = apiClient; + } + + public int getHostIndex() { + return localHostIndex; + } + + public void setHostIndex(int hostIndex) { + this.localHostIndex = hostIndex; + } + + public String getCustomBaseUrl() { + return localCustomBaseUrl; + } + + public void setCustomBaseUrl(String customBaseUrl) { + this.localCustomBaseUrl = customBaseUrl; + } + + /** + * Build call for addCreateApplicationRoleToUsers + * @param operator 操作人用户名 (optional) + * @param requestBody (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call addCreateApplicationRoleToUsersCall(String operator, List requestBody, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = requestBody; + + // create path and map variables + String localVarPath = "/openapi/v1/system/roles/create-application"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addCreateApplicationRoleToUsersValidateBeforeCall(String operator, List requestBody, final ApiCallback _callback) throws ApiException { + return addCreateApplicationRoleToUsersCall(operator, requestBody, _callback); + + } + + /** + * 分配建应用角色 (new added) + * + * @param operator 操作人用户名 (optional) + * @param requestBody (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void addCreateApplicationRoleToUsers(String operator, List requestBody) throws ApiException { + addCreateApplicationRoleToUsersWithHttpInfo(operator, requestBody); + } + + /** + * 分配建应用角色 (new added) + * + * @param operator 操作人用户名 (optional) + * @param requestBody (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse addCreateApplicationRoleToUsersWithHttpInfo(String operator, List requestBody) throws ApiException { + okhttp3.Call localVarCall = addCreateApplicationRoleToUsersValidateBeforeCall(operator, requestBody, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 分配建应用角色 (new added) (asynchronously) + * + * @param operator 操作人用户名 (optional) + * @param requestBody (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call addCreateApplicationRoleToUsersAsync(String operator, List requestBody, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = addCreateApplicationRoleToUsersValidateBeforeCall(operator, requestBody, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for addManageAppMasterRoleToUser + * @param appId (required) + * @param userId the user which role assign to (required) + * @param operator 操作人用户名 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call addManageAppMasterRoleToUserCall(String appId, String userId, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/roles/master" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addManageAppMasterRoleToUserValidateBeforeCall(String appId, String userId, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling addManageAppMasterRoleToUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling addManageAppMasterRoleToUser(Async)"); + } + + return addManageAppMasterRoleToUserCall(appId, userId, operator, _callback); + + } + + /** + * 分配AppMaster (new added) + * + * @param appId (required) + * @param userId the user which role assign to (required) + * @param operator 操作人用户名 (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void addManageAppMasterRoleToUser(String appId, String userId, String operator) throws ApiException { + addManageAppMasterRoleToUserWithHttpInfo(appId, userId, operator); + } + + /** + * 分配AppMaster (new added) + * + * @param appId (required) + * @param userId the user which role assign to (required) + * @param operator 操作人用户名 (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse addManageAppMasterRoleToUserWithHttpInfo(String appId, String userId, String operator) throws ApiException { + okhttp3.Call localVarCall = addManageAppMasterRoleToUserValidateBeforeCall(appId, userId, operator, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 分配AppMaster (new added) (asynchronously) + * + * @param appId (required) + * @param userId the user which role assign to (required) + * @param operator 操作人用户名 (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call addManageAppMasterRoleToUserAsync(String appId, String userId, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = addManageAppMasterRoleToUserValidateBeforeCall(appId, userId, operator, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for assignAppRoleToUser + * @param appId (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @param body (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call assignAppRoleToUserCall(String appId, String roleType, String userId, String operator, String body, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/roles/{roleType}" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "roleType" + "}", localVarApiClient.escapeString(roleType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call assignAppRoleToUserValidateBeforeCall(String appId, String roleType, String userId, String operator, String body, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling assignAppRoleToUser(Async)"); + } + + // verify the required parameter 'roleType' is set + if (roleType == null) { + throw new ApiException("Missing the required parameter 'roleType' when calling assignAppRoleToUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling assignAppRoleToUser(Async)"); + } + + return assignAppRoleToUserCall(appId, roleType, userId, operator, body, _callback); + + } + + /** + * 分配应用角色 (new added) + * + * @param appId (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @param body (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void assignAppRoleToUser(String appId, String roleType, String userId, String operator, String body) throws ApiException { + assignAppRoleToUserWithHttpInfo(appId, roleType, userId, operator, body); + } + + /** + * 分配应用角色 (new added) + * + * @param appId (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @param body (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse assignAppRoleToUserWithHttpInfo(String appId, String roleType, String userId, String operator, String body) throws ApiException { + okhttp3.Call localVarCall = assignAppRoleToUserValidateBeforeCall(appId, roleType, userId, operator, body, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 分配应用角色 (new added) (asynchronously) + * + * @param appId (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @param body (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call assignAppRoleToUserAsync(String appId, String roleType, String userId, String operator, String body, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = assignAppRoleToUserValidateBeforeCall(appId, roleType, userId, operator, body, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for assignClusterNamespaceRoleToUser + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call assignClusterNamespaceRoleToUserCall(String appId, String env, String clusterName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType}" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())) + .replace("{" + "clusterName" + "}", localVarApiClient.escapeString(clusterName.toString())) + .replace("{" + "roleType" + "}", localVarApiClient.escapeString(roleType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call assignClusterNamespaceRoleToUserValidateBeforeCall(String appId, String env, String clusterName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling assignClusterNamespaceRoleToUser(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling assignClusterNamespaceRoleToUser(Async)"); + } + + // verify the required parameter 'clusterName' is set + if (clusterName == null) { + throw new ApiException("Missing the required parameter 'clusterName' when calling assignClusterNamespaceRoleToUser(Async)"); + } + + // verify the required parameter 'roleType' is set + if (roleType == null) { + throw new ApiException("Missing the required parameter 'roleType' when calling assignClusterNamespaceRoleToUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling assignClusterNamespaceRoleToUser(Async)"); + } + + return assignClusterNamespaceRoleToUserCall(appId, env, clusterName, roleType, userId, operator, _callback); + + } + + /** + * 分配集群Namespace角色 (new added) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void assignClusterNamespaceRoleToUser(String appId, String env, String clusterName, String roleType, String userId, String operator) throws ApiException { + assignClusterNamespaceRoleToUserWithHttpInfo(appId, env, clusterName, roleType, userId, operator); + } + + /** + * 分配集群Namespace角色 (new added) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse assignClusterNamespaceRoleToUserWithHttpInfo(String appId, String env, String clusterName, String roleType, String userId, String operator) throws ApiException { + okhttp3.Call localVarCall = assignClusterNamespaceRoleToUserValidateBeforeCall(appId, env, clusterName, roleType, userId, operator, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 分配集群Namespace角色 (new added) (asynchronously) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call assignClusterNamespaceRoleToUserAsync(String appId, String env, String clusterName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = assignClusterNamespaceRoleToUserValidateBeforeCall(appId, env, clusterName, roleType, userId, operator, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for assignNamespaceEnvRoleToUser + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call assignNamespaceEnvRoleToUserCall(String appId, String env, String namespaceName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType}" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())) + .replace("{" + "namespaceName" + "}", localVarApiClient.escapeString(namespaceName.toString())) + .replace("{" + "roleType" + "}", localVarApiClient.escapeString(roleType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call assignNamespaceEnvRoleToUserValidateBeforeCall(String appId, String env, String namespaceName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling assignNamespaceEnvRoleToUser(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling assignNamespaceEnvRoleToUser(Async)"); + } + + // verify the required parameter 'namespaceName' is set + if (namespaceName == null) { + throw new ApiException("Missing the required parameter 'namespaceName' when calling assignNamespaceEnvRoleToUser(Async)"); + } + + // verify the required parameter 'roleType' is set + if (roleType == null) { + throw new ApiException("Missing the required parameter 'roleType' when calling assignNamespaceEnvRoleToUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling assignNamespaceEnvRoleToUser(Async)"); + } + + return assignNamespaceEnvRoleToUserCall(appId, env, namespaceName, roleType, userId, operator, _callback); + + } + + /** + * 分配环境Namespace角色 (new added) + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void assignNamespaceEnvRoleToUser(String appId, String env, String namespaceName, String roleType, String userId, String operator) throws ApiException { + assignNamespaceEnvRoleToUserWithHttpInfo(appId, env, namespaceName, roleType, userId, operator); + } + + /** + * 分配环境Namespace角色 (new added) + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse assignNamespaceEnvRoleToUserWithHttpInfo(String appId, String env, String namespaceName, String roleType, String userId, String operator) throws ApiException { + okhttp3.Call localVarCall = assignNamespaceEnvRoleToUserValidateBeforeCall(appId, env, namespaceName, roleType, userId, operator, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 分配环境Namespace角色 (new added) (asynchronously) + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call assignNamespaceEnvRoleToUserAsync(String appId, String env, String namespaceName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = assignNamespaceEnvRoleToUserValidateBeforeCall(appId, env, namespaceName, roleType, userId, operator, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for assignNamespaceRoleToUser + * @param appId (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call assignNamespaceRoleToUserCall(String appId, String namespaceName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType}" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "namespaceName" + "}", localVarApiClient.escapeString(namespaceName.toString())) + .replace("{" + "roleType" + "}", localVarApiClient.escapeString(roleType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call assignNamespaceRoleToUserValidateBeforeCall(String appId, String namespaceName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling assignNamespaceRoleToUser(Async)"); + } + + // verify the required parameter 'namespaceName' is set + if (namespaceName == null) { + throw new ApiException("Missing the required parameter 'namespaceName' when calling assignNamespaceRoleToUser(Async)"); + } + + // verify the required parameter 'roleType' is set + if (roleType == null) { + throw new ApiException("Missing the required parameter 'roleType' when calling assignNamespaceRoleToUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling assignNamespaceRoleToUser(Async)"); + } + + return assignNamespaceRoleToUserCall(appId, namespaceName, roleType, userId, operator, _callback); + + } + + /** + * 分配Namespace角色 (new added) + * + * @param appId (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void assignNamespaceRoleToUser(String appId, String namespaceName, String roleType, String userId, String operator) throws ApiException { + assignNamespaceRoleToUserWithHttpInfo(appId, namespaceName, roleType, userId, operator); + } + + /** + * 分配Namespace角色 (new added) + * + * @param appId (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse assignNamespaceRoleToUserWithHttpInfo(String appId, String namespaceName, String roleType, String userId, String operator) throws ApiException { + okhttp3.Call localVarCall = assignNamespaceRoleToUserValidateBeforeCall(appId, namespaceName, roleType, userId, operator, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 分配Namespace角色 (new added) (asynchronously) + * + * @param appId (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call assignNamespaceRoleToUserAsync(String appId, String namespaceName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = assignNamespaceRoleToUserValidateBeforeCall(appId, namespaceName, roleType, userId, operator, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for deleteCreateApplicationRoleFromUser + * @param userId (required) + * @param operator 操作人用户名 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call deleteCreateApplicationRoleFromUserCall(String userId, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/system/roles/create-application"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteCreateApplicationRoleFromUserValidateBeforeCall(String userId, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling deleteCreateApplicationRoleFromUser(Async)"); + } + + return deleteCreateApplicationRoleFromUserCall(userId, operator, _callback); + + } + + /** + * 移除建应用角色 (new added) + * + * @param userId (required) + * @param operator 操作人用户名 (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void deleteCreateApplicationRoleFromUser(String userId, String operator) throws ApiException { + deleteCreateApplicationRoleFromUserWithHttpInfo(userId, operator); + } + + /** + * 移除建应用角色 (new added) + * + * @param userId (required) + * @param operator 操作人用户名 (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse deleteCreateApplicationRoleFromUserWithHttpInfo(String userId, String operator) throws ApiException { + okhttp3.Call localVarCall = deleteCreateApplicationRoleFromUserValidateBeforeCall(userId, operator, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 移除建应用角色 (new added) (asynchronously) + * + * @param userId (required) + * @param operator 操作人用户名 (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call deleteCreateApplicationRoleFromUserAsync(String userId, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCreateApplicationRoleFromUserValidateBeforeCall(userId, operator, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getAppRoles + * @param appId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call getAppRolesCall(String appId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/role-users" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAppRolesValidateBeforeCall(String appId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling getAppRoles(Async)"); + } + + return getAppRolesCall(appId, _callback); + + } + + /** + * 获取应用角色用户 (new added) + * + * @param appId (required) + * @return OpenAppRoleUserDTO + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public OpenAppRoleUserDTO getAppRoles(String appId) throws ApiException { + ApiResponse localVarResp = getAppRolesWithHttpInfo(appId); + return localVarResp.getData(); + } + + /** + * 获取应用角色用户 (new added) + * + * @param appId (required) + * @return ApiResponse<OpenAppRoleUserDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse getAppRolesWithHttpInfo(String appId) throws ApiException { + okhttp3.Call localVarCall = getAppRolesValidateBeforeCall(appId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 获取应用角色用户 (new added) (asynchronously) + * + * @param appId (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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call getAppRolesAsync(String appId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getAppRolesValidateBeforeCall(appId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getClusterNamespaceRoles + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call getClusterNamespaceRolesCall(String appId, String env, String clusterName, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/role-users" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())) + .replace("{" + "clusterName" + "}", localVarApiClient.escapeString(clusterName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getClusterNamespaceRolesValidateBeforeCall(String appId, String env, String clusterName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling getClusterNamespaceRoles(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling getClusterNamespaceRoles(Async)"); + } + + // verify the required parameter 'clusterName' is set + if (clusterName == null) { + throw new ApiException("Missing the required parameter 'clusterName' when calling getClusterNamespaceRoles(Async)"); + } + + return getClusterNamespaceRolesCall(appId, env, clusterName, _callback); + + } + + /** + * 获取集群Namespace用户 (new added) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @return OpenClusterNamespaceRoleUserDTO + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public OpenClusterNamespaceRoleUserDTO getClusterNamespaceRoles(String appId, String env, String clusterName) throws ApiException { + ApiResponse localVarResp = getClusterNamespaceRolesWithHttpInfo(appId, env, clusterName); + return localVarResp.getData(); + } + + /** + * 获取集群Namespace用户 (new added) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @return ApiResponse<OpenClusterNamespaceRoleUserDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse getClusterNamespaceRolesWithHttpInfo(String appId, String env, String clusterName) throws ApiException { + okhttp3.Call localVarCall = getClusterNamespaceRolesValidateBeforeCall(appId, env, clusterName, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 获取集群Namespace用户 (new added) (asynchronously) + * + * @param appId (required) + * @param env (required) + * @param clusterName (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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call getClusterNamespaceRolesAsync(String appId, String env, String clusterName, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getClusterNamespaceRolesValidateBeforeCall(appId, env, clusterName, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getCreateApplicationRoleUsers + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call getCreateApplicationRoleUsersCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/system/roles/create-application/role-users"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCreateApplicationRoleUsersValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getCreateApplicationRoleUsersCall(_callback); + + } + + /** + * 获取建应用用户 (new added) + * + * @return List<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public List getCreateApplicationRoleUsers() throws ApiException { + ApiResponse> localVarResp = getCreateApplicationRoleUsersWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * 获取建应用用户 (new added) + * + * @return ApiResponse<List<String>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse> getCreateApplicationRoleUsersWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getCreateApplicationRoleUsersValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 获取建应用用户 (new added) (asynchronously) + * + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call getCreateApplicationRoleUsersAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = getCreateApplicationRoleUsersValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getNamespaceEnvRoleUsers + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call getNamespaceEnvRoleUsersCall(String appId, String env, String namespaceName, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/role-users" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())) + .replace("{" + "namespaceName" + "}", localVarApiClient.escapeString(namespaceName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getNamespaceEnvRoleUsersValidateBeforeCall(String appId, String env, String namespaceName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling getNamespaceEnvRoleUsers(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling getNamespaceEnvRoleUsers(Async)"); + } + + // verify the required parameter 'namespaceName' is set + if (namespaceName == null) { + throw new ApiException("Missing the required parameter 'namespaceName' when calling getNamespaceEnvRoleUsers(Async)"); + } + + return getNamespaceEnvRoleUsersCall(appId, env, namespaceName, _callback); + + } + + /** + * 获取环境Namespace用户 (new added) + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @return OpenEnvNamespaceRoleUserDTO + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public OpenEnvNamespaceRoleUserDTO getNamespaceEnvRoleUsers(String appId, String env, String namespaceName) throws ApiException { + ApiResponse localVarResp = getNamespaceEnvRoleUsersWithHttpInfo(appId, env, namespaceName); + return localVarResp.getData(); + } + + /** + * 获取环境Namespace用户 (new added) + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @return ApiResponse<OpenEnvNamespaceRoleUserDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse getNamespaceEnvRoleUsersWithHttpInfo(String appId, String env, String namespaceName) throws ApiException { + okhttp3.Call localVarCall = getNamespaceEnvRoleUsersValidateBeforeCall(appId, env, namespaceName, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 获取环境Namespace用户 (new added) (asynchronously) + * + * @param appId (required) + * @param env (required) + * @param namespaceName (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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call getNamespaceEnvRoleUsersAsync(String appId, String env, String namespaceName, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getNamespaceEnvRoleUsersValidateBeforeCall(appId, env, namespaceName, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getNamespaceRoles + * @param appId (required) + * @param namespaceName (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call getNamespaceRolesCall(String appId, String namespaceName, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/role-users" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "namespaceName" + "}", localVarApiClient.escapeString(namespaceName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getNamespaceRolesValidateBeforeCall(String appId, String namespaceName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling getNamespaceRoles(Async)"); + } + + // verify the required parameter 'namespaceName' is set + if (namespaceName == null) { + throw new ApiException("Missing the required parameter 'namespaceName' when calling getNamespaceRoles(Async)"); + } + + return getNamespaceRolesCall(appId, namespaceName, _callback); + + } + + /** + * 获取Namespace用户 (new added) + * + * @param appId (required) + * @param namespaceName (required) + * @return OpenNamespaceRoleUserDTO + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public OpenNamespaceRoleUserDTO getNamespaceRoles(String appId, String namespaceName) throws ApiException { + ApiResponse localVarResp = getNamespaceRolesWithHttpInfo(appId, namespaceName); + return localVarResp.getData(); + } + + /** + * 获取Namespace用户 (new added) + * + * @param appId (required) + * @param namespaceName (required) + * @return ApiResponse<OpenNamespaceRoleUserDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse getNamespaceRolesWithHttpInfo(String appId, String namespaceName) throws ApiException { + okhttp3.Call localVarCall = getNamespaceRolesValidateBeforeCall(appId, namespaceName, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 获取Namespace用户 (new added) (asynchronously) + * + * @param appId (required) + * @param namespaceName (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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call getNamespaceRolesAsync(String appId, String namespaceName, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = getNamespaceRolesValidateBeforeCall(appId, namespaceName, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasAppPermission + * @param appId (required) + * @param permissionType (required) + * @param userId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call hasAppPermissionCall(String appId, String permissionType, String userId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/permissions/{permissionType}" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "permissionType" + "}", localVarApiClient.escapeString(permissionType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hasAppPermissionValidateBeforeCall(String appId, String permissionType, String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling hasAppPermission(Async)"); + } + + // verify the required parameter 'permissionType' is set + if (permissionType == null) { + throw new ApiException("Missing the required parameter 'permissionType' when calling hasAppPermission(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling hasAppPermission(Async)"); + } + + return hasAppPermissionCall(appId, permissionType, userId, _callback); + + } + + /** + * 校验应用权限 (new added) + * + * @param appId (required) + * @param permissionType (required) + * @param userId (required) + * @return OpenPermissionConditionDTO + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public OpenPermissionConditionDTO hasAppPermission(String appId, String permissionType, String userId) throws ApiException { + ApiResponse localVarResp = hasAppPermissionWithHttpInfo(appId, permissionType, userId); + return localVarResp.getData(); + } + + /** + * 校验应用权限 (new added) + * + * @param appId (required) + * @param permissionType (required) + * @param userId (required) + * @return ApiResponse<OpenPermissionConditionDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse hasAppPermissionWithHttpInfo(String appId, String permissionType, String userId) throws ApiException { + okhttp3.Call localVarCall = hasAppPermissionValidateBeforeCall(appId, permissionType, userId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 校验应用权限 (new added) (asynchronously) + * + * @param appId (required) + * @param permissionType (required) + * @param userId (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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call hasAppPermissionAsync(String appId, String permissionType, String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasAppPermissionValidateBeforeCall(appId, permissionType, userId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasClusterNamespacePermission + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param permissionType (required) + * @param userId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call hasClusterNamespacePermissionCall(String appId, String env, String clusterName, String permissionType, String userId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permissions/{permissionType}" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())) + .replace("{" + "clusterName" + "}", localVarApiClient.escapeString(clusterName.toString())) + .replace("{" + "permissionType" + "}", localVarApiClient.escapeString(permissionType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hasClusterNamespacePermissionValidateBeforeCall(String appId, String env, String clusterName, String permissionType, String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling hasClusterNamespacePermission(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling hasClusterNamespacePermission(Async)"); + } + + // verify the required parameter 'clusterName' is set + if (clusterName == null) { + throw new ApiException("Missing the required parameter 'clusterName' when calling hasClusterNamespacePermission(Async)"); + } + + // verify the required parameter 'permissionType' is set + if (permissionType == null) { + throw new ApiException("Missing the required parameter 'permissionType' when calling hasClusterNamespacePermission(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling hasClusterNamespacePermission(Async)"); + } + + return hasClusterNamespacePermissionCall(appId, env, clusterName, permissionType, userId, _callback); + + } + + /** + * 校验集群Namespace权限 (new added) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param permissionType (required) + * @param userId (required) + * @return OpenPermissionConditionDTO + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public OpenPermissionConditionDTO hasClusterNamespacePermission(String appId, String env, String clusterName, String permissionType, String userId) throws ApiException { + ApiResponse localVarResp = hasClusterNamespacePermissionWithHttpInfo(appId, env, clusterName, permissionType, userId); + return localVarResp.getData(); + } + + /** + * 校验集群Namespace权限 (new added) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param permissionType (required) + * @param userId (required) + * @return ApiResponse<OpenPermissionConditionDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse hasClusterNamespacePermissionWithHttpInfo(String appId, String env, String clusterName, String permissionType, String userId) throws ApiException { + okhttp3.Call localVarCall = hasClusterNamespacePermissionValidateBeforeCall(appId, env, clusterName, permissionType, userId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 校验集群Namespace权限 (new added) (asynchronously) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param permissionType (required) + * @param userId (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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call hasClusterNamespacePermissionAsync(String appId, String env, String clusterName, String permissionType, String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasClusterNamespacePermissionValidateBeforeCall(appId, env, clusterName, permissionType, userId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasCreateApplicationPermission + * @param userId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call hasCreateApplicationPermissionCall(String userId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/system/roles/create-application"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hasCreateApplicationPermissionValidateBeforeCall(String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling hasCreateApplicationPermission(Async)"); + } + + return hasCreateApplicationPermissionCall(userId, _callback); + + } + + /** + * 校验建应用权限 (new added) + * + * @param userId (required) + * @return Map<String, Boolean> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public Map hasCreateApplicationPermission(String userId) throws ApiException { + ApiResponse> localVarResp = hasCreateApplicationPermissionWithHttpInfo(userId); + return localVarResp.getData(); + } + + /** + * 校验建应用权限 (new added) + * + * @param userId (required) + * @return ApiResponse<Map<String, Boolean>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse> hasCreateApplicationPermissionWithHttpInfo(String userId) throws ApiException { + okhttp3.Call localVarCall = hasCreateApplicationPermissionValidateBeforeCall(userId, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 校验建应用权限 (new added) (asynchronously) + * + * @param userId (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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call hasCreateApplicationPermissionAsync(String userId, final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = hasCreateApplicationPermissionValidateBeforeCall(userId, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasEnvNamespacePermission + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param permissionType (required) + * @param userId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call hasEnvNamespacePermissionCall(String appId, String env, String namespaceName, String permissionType, String userId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/permissions/{permissionType}" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())) + .replace("{" + "namespaceName" + "}", localVarApiClient.escapeString(namespaceName.toString())) + .replace("{" + "permissionType" + "}", localVarApiClient.escapeString(permissionType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hasEnvNamespacePermissionValidateBeforeCall(String appId, String env, String namespaceName, String permissionType, String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling hasEnvNamespacePermission(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling hasEnvNamespacePermission(Async)"); + } + + // verify the required parameter 'namespaceName' is set + if (namespaceName == null) { + throw new ApiException("Missing the required parameter 'namespaceName' when calling hasEnvNamespacePermission(Async)"); + } + + // verify the required parameter 'permissionType' is set + if (permissionType == null) { + throw new ApiException("Missing the required parameter 'permissionType' when calling hasEnvNamespacePermission(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling hasEnvNamespacePermission(Async)"); + } + + return hasEnvNamespacePermissionCall(appId, env, namespaceName, permissionType, userId, _callback); + + } + + /** + * 校验环境Namespace权限 (new added) + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param permissionType (required) + * @param userId (required) + * @return OpenPermissionConditionDTO + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public OpenPermissionConditionDTO hasEnvNamespacePermission(String appId, String env, String namespaceName, String permissionType, String userId) throws ApiException { + ApiResponse localVarResp = hasEnvNamespacePermissionWithHttpInfo(appId, env, namespaceName, permissionType, userId); + return localVarResp.getData(); + } + + /** + * 校验环境Namespace权限 (new added) + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param permissionType (required) + * @param userId (required) + * @return ApiResponse<OpenPermissionConditionDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse hasEnvNamespacePermissionWithHttpInfo(String appId, String env, String namespaceName, String permissionType, String userId) throws ApiException { + okhttp3.Call localVarCall = hasEnvNamespacePermissionValidateBeforeCall(appId, env, namespaceName, permissionType, userId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 校验环境Namespace权限 (new added) (asynchronously) + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param permissionType (required) + * @param userId (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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call hasEnvNamespacePermissionAsync(String appId, String env, String namespaceName, String permissionType, String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasEnvNamespacePermissionValidateBeforeCall(appId, env, namespaceName, permissionType, userId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasNamespacePermission + * @param appId (required) + * @param namespaceName (required) + * @param permissionType (required) + * @param userId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call hasNamespacePermissionCall(String appId, String namespaceName, String permissionType, String userId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/permissions/{permissionType}" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "namespaceName" + "}", localVarApiClient.escapeString(namespaceName.toString())) + .replace("{" + "permissionType" + "}", localVarApiClient.escapeString(permissionType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hasNamespacePermissionValidateBeforeCall(String appId, String namespaceName, String permissionType, String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling hasNamespacePermission(Async)"); + } + + // verify the required parameter 'namespaceName' is set + if (namespaceName == null) { + throw new ApiException("Missing the required parameter 'namespaceName' when calling hasNamespacePermission(Async)"); + } + + // verify the required parameter 'permissionType' is set + if (permissionType == null) { + throw new ApiException("Missing the required parameter 'permissionType' when calling hasNamespacePermission(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling hasNamespacePermission(Async)"); + } + + return hasNamespacePermissionCall(appId, namespaceName, permissionType, userId, _callback); + + } + + /** + * 校验Namespace权限 (new added) + * + * @param appId (required) + * @param namespaceName (required) + * @param permissionType (required) + * @param userId (required) + * @return OpenPermissionConditionDTO + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public OpenPermissionConditionDTO hasNamespacePermission(String appId, String namespaceName, String permissionType, String userId) throws ApiException { + ApiResponse localVarResp = hasNamespacePermissionWithHttpInfo(appId, namespaceName, permissionType, userId); + return localVarResp.getData(); + } + + /** + * 校验Namespace权限 (new added) + * + * @param appId (required) + * @param namespaceName (required) + * @param permissionType (required) + * @param userId (required) + * @return ApiResponse<OpenPermissionConditionDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse hasNamespacePermissionWithHttpInfo(String appId, String namespaceName, String permissionType, String userId) throws ApiException { + okhttp3.Call localVarCall = hasNamespacePermissionValidateBeforeCall(appId, namespaceName, permissionType, userId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 校验Namespace权限 (new added) (asynchronously) + * + * @param appId (required) + * @param namespaceName (required) + * @param permissionType (required) + * @param userId (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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call hasNamespacePermissionAsync(String appId, String namespaceName, String permissionType, String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasNamespacePermissionValidateBeforeCall(appId, namespaceName, permissionType, userId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for hasRootPermission + * @param userId (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call hasRootPermissionCall(String userId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/permissions/root"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call hasRootPermissionValidateBeforeCall(String userId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling hasRootPermission(Async)"); + } + + return hasRootPermissionCall(userId, _callback); + + } + + /** + * 校验Root权限 (new added) + * + * @param userId (required) + * @return OpenPermissionConditionDTO + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public OpenPermissionConditionDTO hasRootPermission(String userId) throws ApiException { + ApiResponse localVarResp = hasRootPermissionWithHttpInfo(userId); + return localVarResp.getData(); + } + + /** + * 校验Root权限 (new added) + * + * @param userId (required) + * @return ApiResponse<OpenPermissionConditionDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse hasRootPermissionWithHttpInfo(String userId) throws ApiException { + okhttp3.Call localVarCall = hasRootPermissionValidateBeforeCall(userId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 校验Root权限 (new added) (asynchronously) + * + * @param userId (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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call hasRootPermissionAsync(String userId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = hasRootPermissionValidateBeforeCall(userId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for initAppPermission + * @param appId (required) + * @param namespaceName (required) + * @param operator 操作人用户名 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 初始化成功 -
+ */ + public okhttp3.Call initAppPermissionCall(String appId, String namespaceName, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "namespaceName" + "}", localVarApiClient.escapeString(namespaceName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call initAppPermissionValidateBeforeCall(String appId, String namespaceName, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling initAppPermission(Async)"); + } + + // verify the required parameter 'namespaceName' is set + if (namespaceName == null) { + throw new ApiException("Missing the required parameter 'namespaceName' when calling initAppPermission(Async)"); + } + + return initAppPermissionCall(appId, namespaceName, operator, _callback); + + } + + /** + * 初始化应用权限 (new added) + * + * @param appId (required) + * @param namespaceName (required) + * @param operator 操作人用户名 (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 初始化成功 -
+ */ + public void initAppPermission(String appId, String namespaceName, String operator) throws ApiException { + initAppPermissionWithHttpInfo(appId, namespaceName, operator); + } + + /** + * 初始化应用权限 (new added) + * + * @param appId (required) + * @param namespaceName (required) + * @param operator 操作人用户名 (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 初始化成功 -
+ */ + public ApiResponse initAppPermissionWithHttpInfo(String appId, String namespaceName, String operator) throws ApiException { + okhttp3.Call localVarCall = initAppPermissionValidateBeforeCall(appId, namespaceName, operator, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 初始化应用权限 (new added) (asynchronously) + * + * @param appId (required) + * @param namespaceName (required) + * @param operator 操作人用户名 (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 初始化成功 -
+ */ + public okhttp3.Call initAppPermissionAsync(String appId, String namespaceName, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = initAppPermissionValidateBeforeCall(appId, namespaceName, operator, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for initClusterNamespacePermission + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param operator 操作人用户名 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call initClusterNamespacePermissionCall(String appId, String env, String clusterName, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permission-init" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())) + .replace("{" + "clusterName" + "}", localVarApiClient.escapeString(clusterName.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call initClusterNamespacePermissionValidateBeforeCall(String appId, String env, String clusterName, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling initClusterNamespacePermission(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling initClusterNamespacePermission(Async)"); + } + + // verify the required parameter 'clusterName' is set + if (clusterName == null) { + throw new ApiException("Missing the required parameter 'clusterName' when calling initClusterNamespacePermission(Async)"); + } + + return initClusterNamespacePermissionCall(appId, env, clusterName, operator, _callback); + + } + + /** + * 初始化集群Namespace权限 (new added) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param operator 操作人用户名 (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void initClusterNamespacePermission(String appId, String env, String clusterName, String operator) throws ApiException { + initClusterNamespacePermissionWithHttpInfo(appId, env, clusterName, operator); + } + + /** + * 初始化集群Namespace权限 (new added) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param operator 操作人用户名 (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse initClusterNamespacePermissionWithHttpInfo(String appId, String env, String clusterName, String operator) throws ApiException { + okhttp3.Call localVarCall = initClusterNamespacePermissionValidateBeforeCall(appId, env, clusterName, operator, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 初始化集群Namespace权限 (new added) (asynchronously) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param operator 操作人用户名 (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call initClusterNamespacePermissionAsync(String appId, String env, String clusterName, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = initClusterNamespacePermissionValidateBeforeCall(appId, env, clusterName, operator, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for isManageAppMasterPermissionEnabled + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call isManageAppMasterPermissionEnabledCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/system/role/manage-app-master"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call isManageAppMasterPermissionEnabledValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return isManageAppMasterPermissionEnabledCall(_callback); + + } + + /** + * 校验AppMaster开关 (new added) + * + * @return Map<String, Boolean> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public Map isManageAppMasterPermissionEnabled() throws ApiException { + ApiResponse> localVarResp = isManageAppMasterPermissionEnabledWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * 校验AppMaster开关 (new added) + * + * @return ApiResponse<Map<String, Boolean>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse> isManageAppMasterPermissionEnabledWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = isManageAppMasterPermissionEnabledValidateBeforeCall(null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * 校验AppMaster开关 (new added) (asynchronously) + * + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call isManageAppMasterPermissionEnabledAsync(final ApiCallback> _callback) throws ApiException { + + okhttp3.Call localVarCall = isManageAppMasterPermissionEnabledValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for removeAppRoleFromUser + * @param appId (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call removeAppRoleFromUserCall(String appId, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/roles/{roleType}" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "roleType" + "}", localVarApiClient.escapeString(roleType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeAppRoleFromUserValidateBeforeCall(String appId, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling removeAppRoleFromUser(Async)"); + } + + // verify the required parameter 'roleType' is set + if (roleType == null) { + throw new ApiException("Missing the required parameter 'roleType' when calling removeAppRoleFromUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling removeAppRoleFromUser(Async)"); + } + + return removeAppRoleFromUserCall(appId, roleType, userId, operator, _callback); + + } + + /** + * 移除应用角色 (new added) + * + * @param appId (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void removeAppRoleFromUser(String appId, String roleType, String userId, String operator) throws ApiException { + removeAppRoleFromUserWithHttpInfo(appId, roleType, userId, operator); + } + + /** + * 移除应用角色 (new added) + * + * @param appId (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse removeAppRoleFromUserWithHttpInfo(String appId, String roleType, String userId, String operator) throws ApiException { + okhttp3.Call localVarCall = removeAppRoleFromUserValidateBeforeCall(appId, roleType, userId, operator, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 移除应用角色 (new added) (asynchronously) + * + * @param appId (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call removeAppRoleFromUserAsync(String appId, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = removeAppRoleFromUserValidateBeforeCall(appId, roleType, userId, operator, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for removeClusterNamespaceRoleFromUser + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call removeClusterNamespaceRoleFromUserCall(String appId, String env, String clusterName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType}" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())) + .replace("{" + "clusterName" + "}", localVarApiClient.escapeString(clusterName.toString())) + .replace("{" + "roleType" + "}", localVarApiClient.escapeString(roleType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeClusterNamespaceRoleFromUserValidateBeforeCall(String appId, String env, String clusterName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling removeClusterNamespaceRoleFromUser(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling removeClusterNamespaceRoleFromUser(Async)"); + } + + // verify the required parameter 'clusterName' is set + if (clusterName == null) { + throw new ApiException("Missing the required parameter 'clusterName' when calling removeClusterNamespaceRoleFromUser(Async)"); + } + + // verify the required parameter 'roleType' is set + if (roleType == null) { + throw new ApiException("Missing the required parameter 'roleType' when calling removeClusterNamespaceRoleFromUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling removeClusterNamespaceRoleFromUser(Async)"); + } + + return removeClusterNamespaceRoleFromUserCall(appId, env, clusterName, roleType, userId, operator, _callback); + + } + + /** + * 移除集群Namespace角色 (new added) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void removeClusterNamespaceRoleFromUser(String appId, String env, String clusterName, String roleType, String userId, String operator) throws ApiException { + removeClusterNamespaceRoleFromUserWithHttpInfo(appId, env, clusterName, roleType, userId, operator); + } + + /** + * 移除集群Namespace角色 (new added) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse removeClusterNamespaceRoleFromUserWithHttpInfo(String appId, String env, String clusterName, String roleType, String userId, String operator) throws ApiException { + okhttp3.Call localVarCall = removeClusterNamespaceRoleFromUserValidateBeforeCall(appId, env, clusterName, roleType, userId, operator, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 移除集群Namespace角色 (new added) (asynchronously) + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call removeClusterNamespaceRoleFromUserAsync(String appId, String env, String clusterName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = removeClusterNamespaceRoleFromUserValidateBeforeCall(appId, env, clusterName, roleType, userId, operator, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for removeManageAppMasterRoleFromUser + * @param appId (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call removeManageAppMasterRoleFromUserCall(String appId, String userId, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/roles/master" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeManageAppMasterRoleFromUserValidateBeforeCall(String appId, String userId, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling removeManageAppMasterRoleFromUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling removeManageAppMasterRoleFromUser(Async)"); + } + + return removeManageAppMasterRoleFromUserCall(appId, userId, operator, _callback); + + } + + /** + * 移除AppMaster (new added) + * + * @param appId (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void removeManageAppMasterRoleFromUser(String appId, String userId, String operator) throws ApiException { + removeManageAppMasterRoleFromUserWithHttpInfo(appId, userId, operator); + } + + /** + * 移除AppMaster (new added) + * + * @param appId (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse removeManageAppMasterRoleFromUserWithHttpInfo(String appId, String userId, String operator) throws ApiException { + okhttp3.Call localVarCall = removeManageAppMasterRoleFromUserValidateBeforeCall(appId, userId, operator, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 移除AppMaster (new added) (asynchronously) + * + * @param appId (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call removeManageAppMasterRoleFromUserAsync(String appId, String userId, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = removeManageAppMasterRoleFromUserValidateBeforeCall(appId, userId, operator, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for removeNamespaceEnvRoleFromUser + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call removeNamespaceEnvRoleFromUserCall(String appId, String env, String namespaceName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType}" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())) + .replace("{" + "namespaceName" + "}", localVarApiClient.escapeString(namespaceName.toString())) + .replace("{" + "roleType" + "}", localVarApiClient.escapeString(roleType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeNamespaceEnvRoleFromUserValidateBeforeCall(String appId, String env, String namespaceName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling removeNamespaceEnvRoleFromUser(Async)"); + } + + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling removeNamespaceEnvRoleFromUser(Async)"); + } + + // verify the required parameter 'namespaceName' is set + if (namespaceName == null) { + throw new ApiException("Missing the required parameter 'namespaceName' when calling removeNamespaceEnvRoleFromUser(Async)"); + } + + // verify the required parameter 'roleType' is set + if (roleType == null) { + throw new ApiException("Missing the required parameter 'roleType' when calling removeNamespaceEnvRoleFromUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling removeNamespaceEnvRoleFromUser(Async)"); + } + + return removeNamespaceEnvRoleFromUserCall(appId, env, namespaceName, roleType, userId, operator, _callback); + + } + + /** + * 移除环境Namespace角色 (new added) + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void removeNamespaceEnvRoleFromUser(String appId, String env, String namespaceName, String roleType, String userId, String operator) throws ApiException { + removeNamespaceEnvRoleFromUserWithHttpInfo(appId, env, namespaceName, roleType, userId, operator); + } + + /** + * 移除环境Namespace角色 (new added) + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse removeNamespaceEnvRoleFromUserWithHttpInfo(String appId, String env, String namespaceName, String roleType, String userId, String operator) throws ApiException { + okhttp3.Call localVarCall = removeNamespaceEnvRoleFromUserValidateBeforeCall(appId, env, namespaceName, roleType, userId, operator, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 移除环境Namespace角色 (new added) (asynchronously) + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call removeNamespaceEnvRoleFromUserAsync(String appId, String env, String namespaceName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = removeNamespaceEnvRoleFromUserValidateBeforeCall(appId, env, namespaceName, roleType, userId, operator, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for removeNamespaceRoleFromUser + * @param appId (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call removeNamespaceRoleFromUserCall(String appId, String namespaceName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType}" + .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) + .replace("{" + "namespaceName" + "}", localVarApiClient.escapeString(namespaceName.toString())) + .replace("{" + "roleType" + "}", localVarApiClient.escapeString(roleType.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + + if (userId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("userId", userId)); + } + + final String[] localVarAccepts = { + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removeNamespaceRoleFromUserValidateBeforeCall(String appId, String namespaceName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException("Missing the required parameter 'appId' when calling removeNamespaceRoleFromUser(Async)"); + } + + // verify the required parameter 'namespaceName' is set + if (namespaceName == null) { + throw new ApiException("Missing the required parameter 'namespaceName' when calling removeNamespaceRoleFromUser(Async)"); + } + + // verify the required parameter 'roleType' is set + if (roleType == null) { + throw new ApiException("Missing the required parameter 'roleType' when calling removeNamespaceRoleFromUser(Async)"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException("Missing the required parameter 'userId' when calling removeNamespaceRoleFromUser(Async)"); + } + + return removeNamespaceRoleFromUserCall(appId, namespaceName, roleType, userId, operator, _callback); + + } + + /** + * 移除Namespace角色 (new added) + * + * @param appId (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public void removeNamespaceRoleFromUser(String appId, String namespaceName, String roleType, String userId, String operator) throws ApiException { + removeNamespaceRoleFromUserWithHttpInfo(appId, namespaceName, roleType, userId, operator); + } + + /** + * 移除Namespace角色 (new added) + * + * @param appId (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public ApiResponse removeNamespaceRoleFromUserWithHttpInfo(String appId, String namespaceName, String roleType, String userId, String operator) throws ApiException { + okhttp3.Call localVarCall = removeNamespaceRoleFromUserValidateBeforeCall(appId, namespaceName, roleType, userId, operator, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * 移除Namespace角色 (new added) (asynchronously) + * + * @param appId (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @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 + * @http.response.details + + + +
Status Code Description Response Headers
200 -
+ */ + public okhttp3.Call removeNamespaceRoleFromUserAsync(String appId, String namespaceName, String roleType, String userId, String operator, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = removeNamespaceRoleFromUserValidateBeforeCall(appId, namespaceName, roleType, userId, operator, _callback); + localVarApiClient.executeAsync(localVarCall, _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 4550557..0b8bd2d 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 @@ -30,8 +30,8 @@ import org.openapitools.client.model.ExceptionResponse; import org.openapitools.client.model.NamespaceGrayDelReleaseDTO; import org.openapitools.client.model.NamespaceReleaseDTO; -import org.openapitools.client.model.OpenReleaseBO; import org.openapitools.client.model.OpenReleaseDTO; +import org.openapitools.client.model.OpenReleaseDiffDTO; import java.lang.reflect.Type; import java.util.ArrayList; @@ -77,6 +77,155 @@ public void setCustomBaseUrl(String customBaseUrl) { this.localCustomBaseUrl = customBaseUrl; } + /** + * Build call for compareRelease + * @param env Environment (required) + * @param baseReleaseId The base release ID (required) + * @param toCompareReleaseId The release ID to compare against (required) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + +
Status Code Description Response Headers
200 Successful comparison -
+ */ + public okhttp3.Call compareReleaseCall(String env, Long baseReleaseId, Long toCompareReleaseId, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/openapi/v1/envs/{env}/releases/comparison" + .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + if (baseReleaseId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("baseReleaseId", baseReleaseId)); + } + + if (toCompareReleaseId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("toCompareReleaseId", toCompareReleaseId)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call compareReleaseValidateBeforeCall(String env, Long baseReleaseId, Long toCompareReleaseId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'env' is set + if (env == null) { + throw new ApiException("Missing the required parameter 'env' when calling compareRelease(Async)"); + } + + // verify the required parameter 'baseReleaseId' is set + if (baseReleaseId == null) { + throw new ApiException("Missing the required parameter 'baseReleaseId' when calling compareRelease(Async)"); + } + + // verify the required parameter 'toCompareReleaseId' is set + if (toCompareReleaseId == null) { + throw new ApiException("Missing the required parameter 'toCompareReleaseId' when calling compareRelease(Async)"); + } + + return compareReleaseCall(env, baseReleaseId, toCompareReleaseId, _callback); + + } + + /** + * Compare two releases + * Get the configuration differences between two releases. + * @param env Environment (required) + * @param baseReleaseId The base release ID (required) + * @param toCompareReleaseId The release ID to compare against (required) + * @return OpenReleaseDiffDTO + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Successful comparison -
+ */ + public OpenReleaseDiffDTO compareRelease(String env, Long baseReleaseId, Long toCompareReleaseId) throws ApiException { + ApiResponse localVarResp = compareReleaseWithHttpInfo(env, baseReleaseId, toCompareReleaseId); + return localVarResp.getData(); + } + + /** + * Compare two releases + * Get the configuration differences between two releases. + * @param env Environment (required) + * @param baseReleaseId The base release ID (required) + * @param toCompareReleaseId The release ID to compare against (required) + * @return ApiResponse<OpenReleaseDiffDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + +
Status Code Description Response Headers
200 Successful comparison -
+ */ + public ApiResponse compareReleaseWithHttpInfo(String env, Long baseReleaseId, Long toCompareReleaseId) throws ApiException { + okhttp3.Call localVarCall = compareReleaseValidateBeforeCall(env, baseReleaseId, toCompareReleaseId, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Compare two releases (asynchronously) + * Get the configuration differences between two releases. + * @param env Environment (required) + * @param baseReleaseId The base release ID (required) + * @param toCompareReleaseId The release ID to compare against (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 + * @http.response.details + + + +
Status Code Description Response Headers
200 Successful comparison -
+ */ + public okhttp3.Call compareReleaseAsync(String env, Long baseReleaseId, Long toCompareReleaseId, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = compareReleaseValidateBeforeCall(env, baseReleaseId, toCompareReleaseId, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } /** * Build call for createGrayDelRelease * @param appId (required) @@ -85,6 +234,7 @@ public void setCustomBaseUrl(String customBaseUrl) { * @param namespaceName (required) * @param branchName (required) * @param namespaceGrayDelReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -94,7 +244,7 @@ public void setCustomBaseUrl(String customBaseUrl) { 200 - */ - public okhttp3.Call createGrayDelReleaseCall(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createGrayDelReleaseCall(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO, String operator, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -124,6 +274,10 @@ public okhttp3.Call createGrayDelReleaseCall(String appId, String env, String cl Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + final String[] localVarAccepts = { "application/json" }; @@ -145,7 +299,7 @@ public okhttp3.Call createGrayDelReleaseCall(String appId, String env, String cl } @SuppressWarnings("rawtypes") - private okhttp3.Call createGrayDelReleaseValidateBeforeCall(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createGrayDelReleaseValidateBeforeCall(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO, String operator, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { throw new ApiException("Missing the required parameter 'appId' when calling createGrayDelRelease(Async)"); @@ -176,7 +330,7 @@ private okhttp3.Call createGrayDelReleaseValidateBeforeCall(String appId, String throw new ApiException("Missing the required parameter 'namespaceGrayDelReleaseDTO' when calling createGrayDelRelease(Async)"); } - return createGrayDelReleaseCall(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO, _callback); + return createGrayDelReleaseCall(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO, operator, _callback); } @@ -189,6 +343,7 @@ private okhttp3.Call createGrayDelReleaseValidateBeforeCall(String appId, String * @param namespaceName (required) * @param branchName (required) * @param namespaceGrayDelReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @return OpenReleaseDTO * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -197,8 +352,8 @@ private okhttp3.Call createGrayDelReleaseValidateBeforeCall(String appId, String 200 - */ - public OpenReleaseDTO createGrayDelRelease(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO) throws ApiException { - ApiResponse localVarResp = createGrayDelReleaseWithHttpInfo(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO); + public OpenReleaseDTO createGrayDelRelease(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO, String operator) throws ApiException { + ApiResponse localVarResp = createGrayDelReleaseWithHttpInfo(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO, operator); return localVarResp.getData(); } @@ -211,6 +366,7 @@ public OpenReleaseDTO createGrayDelRelease(String appId, String env, String clus * @param namespaceName (required) * @param branchName (required) * @param namespaceGrayDelReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @return ApiResponse<OpenReleaseDTO> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -219,8 +375,8 @@ public OpenReleaseDTO createGrayDelRelease(String appId, String env, String clus 200 - */ - public ApiResponse createGrayDelReleaseWithHttpInfo(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO) throws ApiException { - okhttp3.Call localVarCall = createGrayDelReleaseValidateBeforeCall(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO, null); + public ApiResponse createGrayDelReleaseWithHttpInfo(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO, String operator) throws ApiException { + okhttp3.Call localVarCall = createGrayDelReleaseValidateBeforeCall(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO, operator, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -234,6 +390,7 @@ public ApiResponse createGrayDelReleaseWithHttpInfo(String appId * @param namespaceName (required) * @param branchName (required) * @param namespaceGrayDelReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @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 @@ -243,9 +400,9 @@ public ApiResponse createGrayDelReleaseWithHttpInfo(String appId 200 - */ - public okhttp3.Call createGrayDelReleaseAsync(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createGrayDelReleaseAsync(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO, String operator, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createGrayDelReleaseValidateBeforeCall(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO, _callback); + okhttp3.Call localVarCall = createGrayDelReleaseValidateBeforeCall(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO, operator, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -258,6 +415,7 @@ public okhttp3.Call createGrayDelReleaseAsync(String appId, String env, String c * @param namespaceName 命名空间名称 (required) * @param branchName 分支名称 (required) * @param namespaceReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -267,7 +425,7 @@ public okhttp3.Call createGrayDelReleaseAsync(String appId, String env, String c 200 灰度发布创建成功 - */ - public okhttp3.Call createGrayReleaseCall(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceReleaseDTO namespaceReleaseDTO, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createGrayReleaseCall(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceReleaseDTO namespaceReleaseDTO, String operator, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -297,6 +455,10 @@ public okhttp3.Call createGrayReleaseCall(String appId, String env, String clust Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + final String[] localVarAccepts = { "application/json" }; @@ -318,7 +480,7 @@ public okhttp3.Call createGrayReleaseCall(String appId, String env, String clust } @SuppressWarnings("rawtypes") - private okhttp3.Call createGrayReleaseValidateBeforeCall(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceReleaseDTO namespaceReleaseDTO, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createGrayReleaseValidateBeforeCall(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceReleaseDTO namespaceReleaseDTO, String operator, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { throw new ApiException("Missing the required parameter 'appId' when calling createGrayRelease(Async)"); @@ -349,7 +511,7 @@ private okhttp3.Call createGrayReleaseValidateBeforeCall(String appId, String en throw new ApiException("Missing the required parameter 'namespaceReleaseDTO' when calling createGrayRelease(Async)"); } - return createGrayReleaseCall(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO, _callback); + return createGrayReleaseCall(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO, operator, _callback); } @@ -362,6 +524,7 @@ private okhttp3.Call createGrayReleaseValidateBeforeCall(String appId, String en * @param namespaceName 命名空间名称 (required) * @param branchName 分支名称 (required) * @param namespaceReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @return OpenReleaseDTO * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -370,8 +533,8 @@ private okhttp3.Call createGrayReleaseValidateBeforeCall(String appId, String en 200 灰度发布创建成功 - */ - public OpenReleaseDTO createGrayRelease(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceReleaseDTO namespaceReleaseDTO) throws ApiException { - ApiResponse localVarResp = createGrayReleaseWithHttpInfo(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO); + public OpenReleaseDTO createGrayRelease(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceReleaseDTO namespaceReleaseDTO, String operator) throws ApiException { + ApiResponse localVarResp = createGrayReleaseWithHttpInfo(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO, operator); return localVarResp.getData(); } @@ -384,6 +547,7 @@ public OpenReleaseDTO createGrayRelease(String appId, String env, String cluster * @param namespaceName 命名空间名称 (required) * @param branchName 分支名称 (required) * @param namespaceReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @return ApiResponse<OpenReleaseDTO> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -392,8 +556,8 @@ public OpenReleaseDTO createGrayRelease(String appId, String env, String cluster 200 灰度发布创建成功 - */ - public ApiResponse createGrayReleaseWithHttpInfo(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceReleaseDTO namespaceReleaseDTO) throws ApiException { - okhttp3.Call localVarCall = createGrayReleaseValidateBeforeCall(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO, null); + public ApiResponse createGrayReleaseWithHttpInfo(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceReleaseDTO namespaceReleaseDTO, String operator) throws ApiException { + okhttp3.Call localVarCall = createGrayReleaseValidateBeforeCall(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO, operator, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -407,6 +571,7 @@ public ApiResponse createGrayReleaseWithHttpInfo(String appId, S * @param namespaceName 命名空间名称 (required) * @param branchName 分支名称 (required) * @param namespaceReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @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 @@ -416,9 +581,9 @@ public ApiResponse createGrayReleaseWithHttpInfo(String appId, S 200 灰度发布创建成功 - */ - public okhttp3.Call createGrayReleaseAsync(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceReleaseDTO namespaceReleaseDTO, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createGrayReleaseAsync(String appId, String env, String clusterName, String namespaceName, String branchName, NamespaceReleaseDTO namespaceReleaseDTO, String operator, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createGrayReleaseValidateBeforeCall(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO, _callback); + okhttp3.Call localVarCall = createGrayReleaseValidateBeforeCall(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO, operator, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -430,6 +595,7 @@ public okhttp3.Call createGrayReleaseAsync(String appId, String env, String clus * @param clusterName (required) * @param namespaceName 命名空间名称 (required) * @param namespaceReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -441,7 +607,7 @@ public okhttp3.Call createGrayReleaseAsync(String appId, String env, String clus 403 权限不足 - */ - public okhttp3.Call createReleaseCall(String appId, String env, String clusterName, String namespaceName, NamespaceReleaseDTO namespaceReleaseDTO, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createReleaseCall(String appId, String env, String clusterName, String namespaceName, NamespaceReleaseDTO namespaceReleaseDTO, String operator, final ApiCallback _callback) throws ApiException { String basePath = null; // Operation Servers String[] localBasePaths = new String[] { }; @@ -470,6 +636,10 @@ public okhttp3.Call createReleaseCall(String appId, String env, String clusterNa Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (operator != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("operator", operator)); + } + final String[] localVarAccepts = { "application/json" }; @@ -491,7 +661,7 @@ public okhttp3.Call createReleaseCall(String appId, String env, String clusterNa } @SuppressWarnings("rawtypes") - private okhttp3.Call createReleaseValidateBeforeCall(String appId, String env, String clusterName, String namespaceName, NamespaceReleaseDTO namespaceReleaseDTO, final ApiCallback _callback) throws ApiException { + private okhttp3.Call createReleaseValidateBeforeCall(String appId, String env, String clusterName, String namespaceName, NamespaceReleaseDTO namespaceReleaseDTO, String operator, final ApiCallback _callback) throws ApiException { // verify the required parameter 'appId' is set if (appId == null) { throw new ApiException("Missing the required parameter 'appId' when calling createRelease(Async)"); @@ -517,7 +687,7 @@ private okhttp3.Call createReleaseValidateBeforeCall(String appId, String env, S throw new ApiException("Missing the required parameter 'namespaceReleaseDTO' when calling createRelease(Async)"); } - return createReleaseCall(appId, env, clusterName, namespaceName, namespaceReleaseDTO, _callback); + return createReleaseCall(appId, env, clusterName, namespaceName, namespaceReleaseDTO, operator, _callback); } @@ -529,6 +699,7 @@ private okhttp3.Call createReleaseValidateBeforeCall(String appId, String env, S * @param clusterName (required) * @param namespaceName 命名空间名称 (required) * @param namespaceReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @return OpenReleaseDTO * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -539,8 +710,8 @@ private okhttp3.Call createReleaseValidateBeforeCall(String appId, String env, S 403 权限不足 - */ - public OpenReleaseDTO createRelease(String appId, String env, String clusterName, String namespaceName, NamespaceReleaseDTO namespaceReleaseDTO) throws ApiException { - ApiResponse localVarResp = createReleaseWithHttpInfo(appId, env, clusterName, namespaceName, namespaceReleaseDTO); + public OpenReleaseDTO createRelease(String appId, String env, String clusterName, String namespaceName, NamespaceReleaseDTO namespaceReleaseDTO, String operator) throws ApiException { + ApiResponse localVarResp = createReleaseWithHttpInfo(appId, env, clusterName, namespaceName, namespaceReleaseDTO, operator); return localVarResp.getData(); } @@ -552,6 +723,7 @@ public OpenReleaseDTO createRelease(String appId, String env, String clusterName * @param clusterName (required) * @param namespaceName 命名空间名称 (required) * @param namespaceReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @return ApiResponse<OpenReleaseDTO> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -562,8 +734,8 @@ public OpenReleaseDTO createRelease(String appId, String env, String clusterName 403 权限不足 - */ - public ApiResponse createReleaseWithHttpInfo(String appId, String env, String clusterName, String namespaceName, NamespaceReleaseDTO namespaceReleaseDTO) throws ApiException { - okhttp3.Call localVarCall = createReleaseValidateBeforeCall(appId, env, clusterName, namespaceName, namespaceReleaseDTO, null); + public ApiResponse createReleaseWithHttpInfo(String appId, String env, String clusterName, String namespaceName, NamespaceReleaseDTO namespaceReleaseDTO, String operator) throws ApiException { + okhttp3.Call localVarCall = createReleaseValidateBeforeCall(appId, env, clusterName, namespaceName, namespaceReleaseDTO, operator, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -576,6 +748,7 @@ public ApiResponse createReleaseWithHttpInfo(String appId, Strin * @param clusterName (required) * @param namespaceName 命名空间名称 (required) * @param namespaceReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @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 @@ -587,9 +760,9 @@ public ApiResponse createReleaseWithHttpInfo(String appId, Strin 403 权限不足 - */ - public okhttp3.Call createReleaseAsync(String appId, String env, String clusterName, String namespaceName, NamespaceReleaseDTO namespaceReleaseDTO, final ApiCallback _callback) throws ApiException { + public okhttp3.Call createReleaseAsync(String appId, String env, String clusterName, String namespaceName, NamespaceReleaseDTO namespaceReleaseDTO, String operator, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = createReleaseValidateBeforeCall(appId, env, clusterName, namespaceName, namespaceReleaseDTO, _callback); + okhttp3.Call localVarCall = createReleaseValidateBeforeCall(appId, env, clusterName, namespaceName, namespaceReleaseDTO, operator, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; @@ -773,185 +946,6 @@ public okhttp3.Call findActiveReleasesAsync(String appId, String env, String clu localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for findAllReleases - * @param appId 应用ID (required) - * @param env 环境标识 (required) - * @param clusterName 集群名称 (required) - * @param namespaceName 命名空间名称 (required) - * @param page 页码,从0开始 (required) - * @param size 每页数量 (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 成功获取发布列表 -
- */ - public okhttp3.Call findAllReleasesCall(String appId, String env, String clusterName, String namespaceName, Integer page, Integer size, final ApiCallback _callback) throws ApiException { - String basePath = null; - // Operation Servers - String[] localBasePaths = new String[] { }; - - // Determine Base Path to Use - if (localCustomBaseUrl != null){ - basePath = localCustomBaseUrl; - } else if ( localBasePaths.length > 0 ) { - basePath = localBasePaths[localHostIndex]; - } else { - basePath = null; - } - - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all" - .replace("{" + "appId" + "}", localVarApiClient.escapeString(appId.toString())) - .replace("{" + "env" + "}", localVarApiClient.escapeString(env.toString())) - .replace("{" + "clusterName" + "}", localVarApiClient.escapeString(clusterName.toString())) - .replace("{" + "namespaceName" + "}", localVarApiClient.escapeString(namespaceName.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - if (page != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("page", page)); - } - - if (size != null) { - localVarQueryParams.addAll(localVarApiClient.parameterToPair("size", size)); - } - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarContentType != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { "ApiKeyAuth" }; - return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call findAllReleasesValidateBeforeCall(String appId, String env, String clusterName, String namespaceName, Integer page, Integer size, final ApiCallback _callback) throws ApiException { - // verify the required parameter 'appId' is set - if (appId == null) { - throw new ApiException("Missing the required parameter 'appId' when calling findAllReleases(Async)"); - } - - // verify the required parameter 'env' is set - if (env == null) { - throw new ApiException("Missing the required parameter 'env' when calling findAllReleases(Async)"); - } - - // verify the required parameter 'clusterName' is set - if (clusterName == null) { - throw new ApiException("Missing the required parameter 'clusterName' when calling findAllReleases(Async)"); - } - - // verify the required parameter 'namespaceName' is set - if (namespaceName == null) { - throw new ApiException("Missing the required parameter 'namespaceName' when calling findAllReleases(Async)"); - } - - // verify the required parameter 'page' is set - if (page == null) { - throw new ApiException("Missing the required parameter 'page' when calling findAllReleases(Async)"); - } - - // verify the required parameter 'size' is set - if (size == null) { - throw new ApiException("Missing the required parameter 'size' when calling findAllReleases(Async)"); - } - - return findAllReleasesCall(appId, env, clusterName, namespaceName, page, size, _callback); - - } - - /** - * 获取所有发布(分页) (new added) - * GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all - * @param appId 应用ID (required) - * @param env 环境标识 (required) - * @param clusterName 集群名称 (required) - * @param namespaceName 命名空间名称 (required) - * @param page 页码,从0开始 (required) - * @param size 每页数量 (required) - * @return List<OpenReleaseBO> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 成功获取发布列表 -
- */ - public List findAllReleases(String appId, String env, String clusterName, String namespaceName, Integer page, Integer size) throws ApiException { - ApiResponse> localVarResp = findAllReleasesWithHttpInfo(appId, env, clusterName, namespaceName, page, size); - return localVarResp.getData(); - } - - /** - * 获取所有发布(分页) (new added) - * GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all - * @param appId 应用ID (required) - * @param env 环境标识 (required) - * @param clusterName 集群名称 (required) - * @param namespaceName 命名空间名称 (required) - * @param page 页码,从0开始 (required) - * @param size 每页数量 (required) - * @return ApiResponse<List<OpenReleaseBO>> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 成功获取发布列表 -
- */ - public ApiResponse> findAllReleasesWithHttpInfo(String appId, String env, String clusterName, String namespaceName, Integer page, Integer size) throws ApiException { - okhttp3.Call localVarCall = findAllReleasesValidateBeforeCall(appId, env, clusterName, namespaceName, page, size, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * 获取所有发布(分页) (new added) (asynchronously) - * GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all - * @param appId 应用ID (required) - * @param env 环境标识 (required) - * @param clusterName 集群名称 (required) - * @param namespaceName 命名空间名称 (required) - * @param page 页码,从0开始 (required) - * @param size 每页数量 (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 - * @http.response.details - - - -
Status Code Description Response Headers
200 成功获取发布列表 -
- */ - public okhttp3.Call findAllReleasesAsync(String appId, String env, String clusterName, String namespaceName, Integer page, Integer size, final ApiCallback> _callback) throws ApiException { - - okhttp3.Call localVarCall = findAllReleasesValidateBeforeCall(appId, env, clusterName, namespaceName, page, size, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } /** * Build call for getReleaseById * @param env 环境标识 (required) @@ -1288,7 +1282,6 @@ public okhttp3.Call rollbackCall(String env, Long releaseId, String operator, fi } final String[] localVarAccepts = { - "application/json" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { @@ -1328,7 +1321,6 @@ private okhttp3.Call rollbackValidateBeforeCall(String env, Long releaseId, Stri * @param env 环境标识 (required) * @param releaseId 发布ID (required) * @param operator 操作人用户名 (optional) - * @return Object * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1336,9 +1328,8 @@ private okhttp3.Call rollbackValidateBeforeCall(String env, Long releaseId, Stri
200 发布回滚成功 -
*/ - public Object rollback(String env, Long releaseId, String operator) throws ApiException { - ApiResponse localVarResp = rollbackWithHttpInfo(env, releaseId, operator); - return localVarResp.getData(); + public void rollback(String env, Long releaseId, String operator) throws ApiException { + rollbackWithHttpInfo(env, releaseId, operator); } /** @@ -1347,7 +1338,7 @@ public Object rollback(String env, Long releaseId, String operator) throws ApiEx * @param env 环境标识 (required) * @param releaseId 发布ID (required) * @param operator 操作人用户名 (optional) - * @return ApiResponse<Object> + * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -1355,10 +1346,9 @@ public Object rollback(String env, Long releaseId, String operator) throws ApiEx
200 发布回滚成功 -
*/ - public ApiResponse rollbackWithHttpInfo(String env, Long releaseId, String operator) throws ApiException { + public ApiResponse rollbackWithHttpInfo(String env, Long releaseId, String operator) throws ApiException { okhttp3.Call localVarCall = rollbackValidateBeforeCall(env, releaseId, operator, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + return localVarApiClient.execute(localVarCall); } /** @@ -1376,11 +1366,10 @@ public ApiResponse rollbackWithHttpInfo(String env, Long releaseId, Stri 200 发布回滚成功 - */ - public okhttp3.Call rollbackAsync(String env, Long releaseId, String operator, final ApiCallback _callback) throws ApiException { + public okhttp3.Call rollbackAsync(String env, Long releaseId, String operator, final ApiCallback _callback) throws ApiException { okhttp3.Call localVarCall = rollbackValidateBeforeCall(env, releaseId, operator, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } } diff --git a/java-client/src/main/java/org/openapitools/client/model/OpenAccessKeyDTO.java b/java-client/src/main/java/org/openapitools/client/model/OpenAccessKeyDTO.java new file mode 100644 index 0000000..ecb1d68 --- /dev/null +++ b/java-client/src/main/java/org/openapitools/client/model/OpenAccessKeyDTO.java @@ -0,0 +1,508 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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; + +/** + * OpenAccessKeyDTO + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OpenAccessKeyDTO { + 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_LAST_MODIFIED_BY = "dataChangeLastModifiedBy"; + @SerializedName(SERIALIZED_NAME_DATA_CHANGE_LAST_MODIFIED_BY) + private String dataChangeLastModifiedBy; + + public static final String SERIALIZED_NAME_DATA_CHANGE_CREATED_BY_DISPLAY_NAME = "dataChangeCreatedByDisplayName"; + @SerializedName(SERIALIZED_NAME_DATA_CHANGE_CREATED_BY_DISPLAY_NAME) + private String dataChangeCreatedByDisplayName; + + public static final String SERIALIZED_NAME_DATA_CHANGE_LAST_MODIFIED_BY_DISPLAY_NAME = "dataChangeLastModifiedByDisplayName"; + @SerializedName(SERIALIZED_NAME_DATA_CHANGE_LAST_MODIFIED_BY_DISPLAY_NAME) + private String dataChangeLastModifiedByDisplayName; + + public static final String SERIALIZED_NAME_DATA_CHANGE_CREATED_TIME = "dataChangeCreatedTime"; + @SerializedName(SERIALIZED_NAME_DATA_CHANGE_CREATED_TIME) + private String dataChangeCreatedTime; + + public static final String SERIALIZED_NAME_DATA_CHANGE_LAST_MODIFIED_TIME = "dataChangeLastModifiedTime"; + @SerializedName(SERIALIZED_NAME_DATA_CHANGE_LAST_MODIFIED_TIME) + private String dataChangeLastModifiedTime; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_SECRET = "secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + private String secret; + + public static final String SERIALIZED_NAME_APP_ID = "appId"; + @SerializedName(SERIALIZED_NAME_APP_ID) + private String appId; + + public static final String SERIALIZED_NAME_MODE = "mode"; + @SerializedName(SERIALIZED_NAME_MODE) + private Integer mode; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + public OpenAccessKeyDTO() { + } + + public OpenAccessKeyDTO 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 OpenAccessKeyDTO 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 OpenAccessKeyDTO dataChangeCreatedByDisplayName(String dataChangeCreatedByDisplayName) { + + this.dataChangeCreatedByDisplayName = dataChangeCreatedByDisplayName; + return this; + } + + /** + * + * @return dataChangeCreatedByDisplayName + **/ + @javax.annotation.Nullable + public String getDataChangeCreatedByDisplayName() { + return dataChangeCreatedByDisplayName; + } + + + public void setDataChangeCreatedByDisplayName(String dataChangeCreatedByDisplayName) { + this.dataChangeCreatedByDisplayName = dataChangeCreatedByDisplayName; + } + + + public OpenAccessKeyDTO dataChangeLastModifiedByDisplayName(String dataChangeLastModifiedByDisplayName) { + + this.dataChangeLastModifiedByDisplayName = dataChangeLastModifiedByDisplayName; + return this; + } + + /** + * + * @return dataChangeLastModifiedByDisplayName + **/ + @javax.annotation.Nullable + public String getDataChangeLastModifiedByDisplayName() { + return dataChangeLastModifiedByDisplayName; + } + + + public void setDataChangeLastModifiedByDisplayName(String dataChangeLastModifiedByDisplayName) { + this.dataChangeLastModifiedByDisplayName = dataChangeLastModifiedByDisplayName; + } + + + public OpenAccessKeyDTO dataChangeCreatedTime(String dataChangeCreatedTime) { + + this.dataChangeCreatedTime = dataChangeCreatedTime; + return this; + } + + /** + * + * @return dataChangeCreatedTime + **/ + @javax.annotation.Nullable + public String getDataChangeCreatedTime() { + return dataChangeCreatedTime; + } + + + public void setDataChangeCreatedTime(String dataChangeCreatedTime) { + this.dataChangeCreatedTime = dataChangeCreatedTime; + } + + + public OpenAccessKeyDTO dataChangeLastModifiedTime(String dataChangeLastModifiedTime) { + + this.dataChangeLastModifiedTime = dataChangeLastModifiedTime; + return this; + } + + /** + * + * @return dataChangeLastModifiedTime + **/ + @javax.annotation.Nullable + public String getDataChangeLastModifiedTime() { + return dataChangeLastModifiedTime; + } + + + public void setDataChangeLastModifiedTime(String dataChangeLastModifiedTime) { + this.dataChangeLastModifiedTime = dataChangeLastModifiedTime; + } + + + public OpenAccessKeyDTO id(Long id) { + + this.id = id; + return this; + } + + /** + * + * @return id + **/ + @javax.annotation.Nullable + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public OpenAccessKeyDTO secret(String secret) { + + this.secret = secret; + return this; + } + + /** + * + * @return secret + **/ + @javax.annotation.Nullable + public String getSecret() { + return secret; + } + + + public void setSecret(String secret) { + this.secret = secret; + } + + + public OpenAccessKeyDTO appId(String appId) { + + this.appId = appId; + return this; + } + + /** + * + * @return appId + **/ + @javax.annotation.Nullable + public String getAppId() { + return appId; + } + + + public void setAppId(String appId) { + this.appId = appId; + } + + + public OpenAccessKeyDTO mode(Integer mode) { + + this.mode = mode; + return this; + } + + /** + * + * @return mode + **/ + @javax.annotation.Nullable + public Integer getMode() { + return mode; + } + + + public void setMode(Integer mode) { + this.mode = mode; + } + + + public OpenAccessKeyDTO enabled(Boolean enabled) { + + this.enabled = enabled; + return this; + } + + /** + * + * @return enabled + **/ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenAccessKeyDTO openAccessKeyDTO = (OpenAccessKeyDTO) o; + return Objects.equals(this.dataChangeCreatedBy, openAccessKeyDTO.dataChangeCreatedBy) && + Objects.equals(this.dataChangeLastModifiedBy, openAccessKeyDTO.dataChangeLastModifiedBy) && + Objects.equals(this.dataChangeCreatedByDisplayName, openAccessKeyDTO.dataChangeCreatedByDisplayName) && + Objects.equals(this.dataChangeLastModifiedByDisplayName, openAccessKeyDTO.dataChangeLastModifiedByDisplayName) && + Objects.equals(this.dataChangeCreatedTime, openAccessKeyDTO.dataChangeCreatedTime) && + Objects.equals(this.dataChangeLastModifiedTime, openAccessKeyDTO.dataChangeLastModifiedTime) && + Objects.equals(this.id, openAccessKeyDTO.id) && + Objects.equals(this.secret, openAccessKeyDTO.secret) && + Objects.equals(this.appId, openAccessKeyDTO.appId) && + Objects.equals(this.mode, openAccessKeyDTO.mode) && + Objects.equals(this.enabled, openAccessKeyDTO.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(dataChangeCreatedBy, dataChangeLastModifiedBy, dataChangeCreatedByDisplayName, dataChangeLastModifiedByDisplayName, dataChangeCreatedTime, dataChangeLastModifiedTime, id, secret, appId, mode, enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenAccessKeyDTO {\n"); + sb.append(" dataChangeCreatedBy: ").append(toIndentedString(dataChangeCreatedBy)).append("\n"); + sb.append(" dataChangeLastModifiedBy: ").append(toIndentedString(dataChangeLastModifiedBy)).append("\n"); + sb.append(" dataChangeCreatedByDisplayName: ").append(toIndentedString(dataChangeCreatedByDisplayName)).append("\n"); + sb.append(" dataChangeLastModifiedByDisplayName: ").append(toIndentedString(dataChangeLastModifiedByDisplayName)).append("\n"); + sb.append(" dataChangeCreatedTime: ").append(toIndentedString(dataChangeCreatedTime)).append("\n"); + sb.append(" dataChangeLastModifiedTime: ").append(toIndentedString(dataChangeLastModifiedTime)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).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("dataChangeCreatedBy"); + openapiFields.add("dataChangeLastModifiedBy"); + openapiFields.add("dataChangeCreatedByDisplayName"); + openapiFields.add("dataChangeLastModifiedByDisplayName"); + openapiFields.add("dataChangeCreatedTime"); + openapiFields.add("dataChangeLastModifiedTime"); + openapiFields.add("id"); + openapiFields.add("secret"); + openapiFields.add("appId"); + openapiFields.add("mode"); + openapiFields.add("enabled"); + + // 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 OpenAccessKeyDTO + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OpenAccessKeyDTO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OpenAccessKeyDTO is not found in the empty JSON string", OpenAccessKeyDTO.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OpenAccessKeyDTO.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenAccessKeyDTO` properties. JSON: %s", entry.getKey(), jsonObj.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())); + } + if ((jsonObj.get("dataChangeCreatedByDisplayName") != null && !jsonObj.get("dataChangeCreatedByDisplayName").isJsonNull()) && !jsonObj.get("dataChangeCreatedByDisplayName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dataChangeCreatedByDisplayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dataChangeCreatedByDisplayName").toString())); + } + if ((jsonObj.get("dataChangeLastModifiedByDisplayName") != null && !jsonObj.get("dataChangeLastModifiedByDisplayName").isJsonNull()) && !jsonObj.get("dataChangeLastModifiedByDisplayName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dataChangeLastModifiedByDisplayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dataChangeLastModifiedByDisplayName").toString())); + } + if ((jsonObj.get("dataChangeCreatedTime") != null && !jsonObj.get("dataChangeCreatedTime").isJsonNull()) && !jsonObj.get("dataChangeCreatedTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dataChangeCreatedTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dataChangeCreatedTime").toString())); + } + if ((jsonObj.get("dataChangeLastModifiedTime") != null && !jsonObj.get("dataChangeLastModifiedTime").isJsonNull()) && !jsonObj.get("dataChangeLastModifiedTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `dataChangeLastModifiedTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dataChangeLastModifiedTime").toString())); + } + if ((jsonObj.get("secret") != null && !jsonObj.get("secret").isJsonNull()) && !jsonObj.get("secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secret").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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OpenAccessKeyDTO.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OpenAccessKeyDTO' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OpenAccessKeyDTO.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OpenAccessKeyDTO value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OpenAccessKeyDTO read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OpenAccessKeyDTO given an JSON string + * + * @param jsonString JSON string + * @return An instance of OpenAccessKeyDTO + * @throws IOException if the JSON string is invalid with respect to OpenAccessKeyDTO + */ + public static OpenAccessKeyDTO fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OpenAccessKeyDTO.class); + } + + /** + * Convert an instance of OpenAccessKeyDTO 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/OpenAppRoleUserDTO.java b/java-client/src/main/java/org/openapitools/client/model/OpenAppRoleUserDTO.java new file mode 100644 index 0000000..62b6023 --- /dev/null +++ b/java-client/src/main/java/org/openapitools/client/model/OpenAppRoleUserDTO.java @@ -0,0 +1,260 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OpenUserInfoDTO; + +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; + +/** + * OpenAppRoleUserDTO + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OpenAppRoleUserDTO { + public static final String SERIALIZED_NAME_APP_ID = "appId"; + @SerializedName(SERIALIZED_NAME_APP_ID) + private String appId; + + public static final String SERIALIZED_NAME_MASTER_USERS = "masterUsers"; + @SerializedName(SERIALIZED_NAME_MASTER_USERS) + private List masterUsers; + + public OpenAppRoleUserDTO() { + } + + public OpenAppRoleUserDTO appId(String appId) { + + this.appId = appId; + return this; + } + + /** + * + * @return appId + **/ + @javax.annotation.Nullable + public String getAppId() { + return appId; + } + + + public void setAppId(String appId) { + this.appId = appId; + } + + + public OpenAppRoleUserDTO masterUsers(List masterUsers) { + + this.masterUsers = masterUsers; + return this; + } + + public OpenAppRoleUserDTO addMasterUsersItem(OpenUserInfoDTO masterUsersItem) { + if (this.masterUsers == null) { + this.masterUsers = new ArrayList<>(); + } + this.masterUsers.add(masterUsersItem); + return this; + } + + /** + * + * @return masterUsers + **/ + @javax.annotation.Nullable + public List getMasterUsers() { + return masterUsers; + } + + + public void setMasterUsers(List masterUsers) { + this.masterUsers = masterUsers; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenAppRoleUserDTO openAppRoleUserDTO = (OpenAppRoleUserDTO) o; + return Objects.equals(this.appId, openAppRoleUserDTO.appId) && + Objects.equals(this.masterUsers, openAppRoleUserDTO.masterUsers); + } + + @Override + public int hashCode() { + return Objects.hash(appId, masterUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenAppRoleUserDTO {\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" masterUsers: ").append(toIndentedString(masterUsers)).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("masterUsers"); + + // 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 OpenAppRoleUserDTO + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OpenAppRoleUserDTO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OpenAppRoleUserDTO is not found in the empty JSON string", OpenAppRoleUserDTO.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OpenAppRoleUserDTO.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenAppRoleUserDTO` 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("masterUsers") != null && !jsonObj.get("masterUsers").isJsonNull()) { + JsonArray jsonArraymasterUsers = jsonObj.getAsJsonArray("masterUsers"); + if (jsonArraymasterUsers != null) { + // ensure the json data is an array + if (!jsonObj.get("masterUsers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `masterUsers` to be an array in the JSON string but got `%s`", jsonObj.get("masterUsers").toString())); + } + + // validate the optional field `masterUsers` (array) + for (int i = 0; i < jsonArraymasterUsers.size(); i++) { + OpenUserInfoDTO.validateJsonObject(jsonArraymasterUsers.get(i).getAsJsonObject()); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OpenAppRoleUserDTO.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OpenAppRoleUserDTO' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OpenAppRoleUserDTO.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OpenAppRoleUserDTO value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OpenAppRoleUserDTO read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OpenAppRoleUserDTO given an JSON string + * + * @param jsonString JSON string + * @return An instance of OpenAppRoleUserDTO + * @throws IOException if the JSON string is invalid with respect to OpenAppRoleUserDTO + */ + public static OpenAppRoleUserDTO fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OpenAppRoleUserDTO.class); + } + + /** + * Convert an instance of OpenAppRoleUserDTO 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/OpenClusterNamespaceRoleUserDTO.java b/java-client/src/main/java/org/openapitools/client/model/OpenClusterNamespaceRoleUserDTO.java new file mode 100644 index 0000000..24b098c --- /dev/null +++ b/java-client/src/main/java/org/openapitools/client/model/OpenClusterNamespaceRoleUserDTO.java @@ -0,0 +1,372 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OpenUserInfoDTO; + +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; + +/** + * OpenClusterNamespaceRoleUserDTO + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OpenClusterNamespaceRoleUserDTO { + public static final String SERIALIZED_NAME_APP_ID = "appId"; + @SerializedName(SERIALIZED_NAME_APP_ID) + private String appId; + + public static final String SERIALIZED_NAME_ENV = "env"; + @SerializedName(SERIALIZED_NAME_ENV) + private String env; + + public static final String SERIALIZED_NAME_CLUSTER = "cluster"; + @SerializedName(SERIALIZED_NAME_CLUSTER) + private String cluster; + + public static final String SERIALIZED_NAME_MODIFY_ROLE_USERS = "modifyRoleUsers"; + @SerializedName(SERIALIZED_NAME_MODIFY_ROLE_USERS) + private List modifyRoleUsers; + + public static final String SERIALIZED_NAME_RELEASE_ROLE_USERS = "releaseRoleUsers"; + @SerializedName(SERIALIZED_NAME_RELEASE_ROLE_USERS) + private List releaseRoleUsers; + + public OpenClusterNamespaceRoleUserDTO() { + } + + public OpenClusterNamespaceRoleUserDTO appId(String appId) { + + this.appId = appId; + return this; + } + + /** + * + * @return appId + **/ + @javax.annotation.Nullable + public String getAppId() { + return appId; + } + + + public void setAppId(String appId) { + this.appId = appId; + } + + + public OpenClusterNamespaceRoleUserDTO env(String env) { + + this.env = env; + return this; + } + + /** + * + * @return env + **/ + @javax.annotation.Nullable + public String getEnv() { + return env; + } + + + public void setEnv(String env) { + this.env = env; + } + + + public OpenClusterNamespaceRoleUserDTO cluster(String cluster) { + + this.cluster = cluster; + return this; + } + + /** + * + * @return cluster + **/ + @javax.annotation.Nullable + public String getCluster() { + return cluster; + } + + + public void setCluster(String cluster) { + this.cluster = cluster; + } + + + public OpenClusterNamespaceRoleUserDTO modifyRoleUsers(List modifyRoleUsers) { + + this.modifyRoleUsers = modifyRoleUsers; + return this; + } + + public OpenClusterNamespaceRoleUserDTO addModifyRoleUsersItem(OpenUserInfoDTO modifyRoleUsersItem) { + if (this.modifyRoleUsers == null) { + this.modifyRoleUsers = new ArrayList<>(); + } + this.modifyRoleUsers.add(modifyRoleUsersItem); + return this; + } + + /** + * + * @return modifyRoleUsers + **/ + @javax.annotation.Nullable + public List getModifyRoleUsers() { + return modifyRoleUsers; + } + + + public void setModifyRoleUsers(List modifyRoleUsers) { + this.modifyRoleUsers = modifyRoleUsers; + } + + + public OpenClusterNamespaceRoleUserDTO releaseRoleUsers(List releaseRoleUsers) { + + this.releaseRoleUsers = releaseRoleUsers; + return this; + } + + public OpenClusterNamespaceRoleUserDTO addReleaseRoleUsersItem(OpenUserInfoDTO releaseRoleUsersItem) { + if (this.releaseRoleUsers == null) { + this.releaseRoleUsers = new ArrayList<>(); + } + this.releaseRoleUsers.add(releaseRoleUsersItem); + return this; + } + + /** + * + * @return releaseRoleUsers + **/ + @javax.annotation.Nullable + public List getReleaseRoleUsers() { + return releaseRoleUsers; + } + + + public void setReleaseRoleUsers(List releaseRoleUsers) { + this.releaseRoleUsers = releaseRoleUsers; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenClusterNamespaceRoleUserDTO openClusterNamespaceRoleUserDTO = (OpenClusterNamespaceRoleUserDTO) o; + return Objects.equals(this.appId, openClusterNamespaceRoleUserDTO.appId) && + Objects.equals(this.env, openClusterNamespaceRoleUserDTO.env) && + Objects.equals(this.cluster, openClusterNamespaceRoleUserDTO.cluster) && + Objects.equals(this.modifyRoleUsers, openClusterNamespaceRoleUserDTO.modifyRoleUsers) && + Objects.equals(this.releaseRoleUsers, openClusterNamespaceRoleUserDTO.releaseRoleUsers); + } + + @Override + public int hashCode() { + return Objects.hash(appId, env, cluster, modifyRoleUsers, releaseRoleUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenClusterNamespaceRoleUserDTO {\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" cluster: ").append(toIndentedString(cluster)).append("\n"); + sb.append(" modifyRoleUsers: ").append(toIndentedString(modifyRoleUsers)).append("\n"); + sb.append(" releaseRoleUsers: ").append(toIndentedString(releaseRoleUsers)).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("env"); + openapiFields.add("cluster"); + openapiFields.add("modifyRoleUsers"); + openapiFields.add("releaseRoleUsers"); + + // 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 OpenClusterNamespaceRoleUserDTO + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OpenClusterNamespaceRoleUserDTO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OpenClusterNamespaceRoleUserDTO is not found in the empty JSON string", OpenClusterNamespaceRoleUserDTO.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OpenClusterNamespaceRoleUserDTO.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenClusterNamespaceRoleUserDTO` 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("env") != null && !jsonObj.get("env").isJsonNull()) && !jsonObj.get("env").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `env` to be a primitive type in the JSON string but got `%s`", jsonObj.get("env").toString())); + } + if ((jsonObj.get("cluster") != null && !jsonObj.get("cluster").isJsonNull()) && !jsonObj.get("cluster").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cluster` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cluster").toString())); + } + if (jsonObj.get("modifyRoleUsers") != null && !jsonObj.get("modifyRoleUsers").isJsonNull()) { + JsonArray jsonArraymodifyRoleUsers = jsonObj.getAsJsonArray("modifyRoleUsers"); + if (jsonArraymodifyRoleUsers != null) { + // ensure the json data is an array + if (!jsonObj.get("modifyRoleUsers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `modifyRoleUsers` to be an array in the JSON string but got `%s`", jsonObj.get("modifyRoleUsers").toString())); + } + + // validate the optional field `modifyRoleUsers` (array) + for (int i = 0; i < jsonArraymodifyRoleUsers.size(); i++) { + OpenUserInfoDTO.validateJsonObject(jsonArraymodifyRoleUsers.get(i).getAsJsonObject()); + }; + } + } + if (jsonObj.get("releaseRoleUsers") != null && !jsonObj.get("releaseRoleUsers").isJsonNull()) { + JsonArray jsonArrayreleaseRoleUsers = jsonObj.getAsJsonArray("releaseRoleUsers"); + if (jsonArrayreleaseRoleUsers != null) { + // ensure the json data is an array + if (!jsonObj.get("releaseRoleUsers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `releaseRoleUsers` to be an array in the JSON string but got `%s`", jsonObj.get("releaseRoleUsers").toString())); + } + + // validate the optional field `releaseRoleUsers` (array) + for (int i = 0; i < jsonArrayreleaseRoleUsers.size(); i++) { + OpenUserInfoDTO.validateJsonObject(jsonArrayreleaseRoleUsers.get(i).getAsJsonObject()); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OpenClusterNamespaceRoleUserDTO.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OpenClusterNamespaceRoleUserDTO' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OpenClusterNamespaceRoleUserDTO.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OpenClusterNamespaceRoleUserDTO value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OpenClusterNamespaceRoleUserDTO read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OpenClusterNamespaceRoleUserDTO given an JSON string + * + * @param jsonString JSON string + * @return An instance of OpenClusterNamespaceRoleUserDTO + * @throws IOException if the JSON string is invalid with respect to OpenClusterNamespaceRoleUserDTO + */ + public static OpenClusterNamespaceRoleUserDTO fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OpenClusterNamespaceRoleUserDTO.class); + } + + /** + * Convert an instance of OpenClusterNamespaceRoleUserDTO 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/OpenEnvNamespaceRoleUserDTO.java b/java-client/src/main/java/org/openapitools/client/model/OpenEnvNamespaceRoleUserDTO.java new file mode 100644 index 0000000..0f8cc2f --- /dev/null +++ b/java-client/src/main/java/org/openapitools/client/model/OpenEnvNamespaceRoleUserDTO.java @@ -0,0 +1,372 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OpenUserInfoDTO; + +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; + +/** + * OpenEnvNamespaceRoleUserDTO + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OpenEnvNamespaceRoleUserDTO { + public static final String SERIALIZED_NAME_APP_ID = "appId"; + @SerializedName(SERIALIZED_NAME_APP_ID) + private String appId; + + public static final String SERIALIZED_NAME_NAMESPACE_NAME = "namespaceName"; + @SerializedName(SERIALIZED_NAME_NAMESPACE_NAME) + private String namespaceName; + + public static final String SERIALIZED_NAME_MODIFY_ROLE_USERS = "modifyRoleUsers"; + @SerializedName(SERIALIZED_NAME_MODIFY_ROLE_USERS) + private List modifyRoleUsers; + + public static final String SERIALIZED_NAME_RELEASE_ROLE_USERS = "releaseRoleUsers"; + @SerializedName(SERIALIZED_NAME_RELEASE_ROLE_USERS) + private List releaseRoleUsers; + + public static final String SERIALIZED_NAME_ENV = "env"; + @SerializedName(SERIALIZED_NAME_ENV) + private String env; + + public OpenEnvNamespaceRoleUserDTO() { + } + + public OpenEnvNamespaceRoleUserDTO appId(String appId) { + + this.appId = appId; + return this; + } + + /** + * + * @return appId + **/ + @javax.annotation.Nullable + public String getAppId() { + return appId; + } + + + public void setAppId(String appId) { + this.appId = appId; + } + + + public OpenEnvNamespaceRoleUserDTO namespaceName(String namespaceName) { + + this.namespaceName = namespaceName; + return this; + } + + /** + * + * @return namespaceName + **/ + @javax.annotation.Nullable + public String getNamespaceName() { + return namespaceName; + } + + + public void setNamespaceName(String namespaceName) { + this.namespaceName = namespaceName; + } + + + public OpenEnvNamespaceRoleUserDTO modifyRoleUsers(List modifyRoleUsers) { + + this.modifyRoleUsers = modifyRoleUsers; + return this; + } + + public OpenEnvNamespaceRoleUserDTO addModifyRoleUsersItem(OpenUserInfoDTO modifyRoleUsersItem) { + if (this.modifyRoleUsers == null) { + this.modifyRoleUsers = new ArrayList<>(); + } + this.modifyRoleUsers.add(modifyRoleUsersItem); + return this; + } + + /** + * + * @return modifyRoleUsers + **/ + @javax.annotation.Nullable + public List getModifyRoleUsers() { + return modifyRoleUsers; + } + + + public void setModifyRoleUsers(List modifyRoleUsers) { + this.modifyRoleUsers = modifyRoleUsers; + } + + + public OpenEnvNamespaceRoleUserDTO releaseRoleUsers(List releaseRoleUsers) { + + this.releaseRoleUsers = releaseRoleUsers; + return this; + } + + public OpenEnvNamespaceRoleUserDTO addReleaseRoleUsersItem(OpenUserInfoDTO releaseRoleUsersItem) { + if (this.releaseRoleUsers == null) { + this.releaseRoleUsers = new ArrayList<>(); + } + this.releaseRoleUsers.add(releaseRoleUsersItem); + return this; + } + + /** + * + * @return releaseRoleUsers + **/ + @javax.annotation.Nullable + public List getReleaseRoleUsers() { + return releaseRoleUsers; + } + + + public void setReleaseRoleUsers(List releaseRoleUsers) { + this.releaseRoleUsers = releaseRoleUsers; + } + + + public OpenEnvNamespaceRoleUserDTO env(String env) { + + this.env = env; + return this; + } + + /** + * + * @return env + **/ + @javax.annotation.Nullable + public String getEnv() { + return env; + } + + + public void setEnv(String env) { + this.env = env; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenEnvNamespaceRoleUserDTO openEnvNamespaceRoleUserDTO = (OpenEnvNamespaceRoleUserDTO) o; + return Objects.equals(this.appId, openEnvNamespaceRoleUserDTO.appId) && + Objects.equals(this.namespaceName, openEnvNamespaceRoleUserDTO.namespaceName) && + Objects.equals(this.modifyRoleUsers, openEnvNamespaceRoleUserDTO.modifyRoleUsers) && + Objects.equals(this.releaseRoleUsers, openEnvNamespaceRoleUserDTO.releaseRoleUsers) && + Objects.equals(this.env, openEnvNamespaceRoleUserDTO.env); + } + + @Override + public int hashCode() { + return Objects.hash(appId, namespaceName, modifyRoleUsers, releaseRoleUsers, env); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenEnvNamespaceRoleUserDTO {\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" namespaceName: ").append(toIndentedString(namespaceName)).append("\n"); + sb.append(" modifyRoleUsers: ").append(toIndentedString(modifyRoleUsers)).append("\n"); + sb.append(" releaseRoleUsers: ").append(toIndentedString(releaseRoleUsers)).append("\n"); + sb.append(" env: ").append(toIndentedString(env)).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("namespaceName"); + openapiFields.add("modifyRoleUsers"); + openapiFields.add("releaseRoleUsers"); + openapiFields.add("env"); + + // 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 OpenEnvNamespaceRoleUserDTO + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OpenEnvNamespaceRoleUserDTO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OpenEnvNamespaceRoleUserDTO is not found in the empty JSON string", OpenEnvNamespaceRoleUserDTO.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OpenEnvNamespaceRoleUserDTO.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenEnvNamespaceRoleUserDTO` 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("namespaceName") != null && !jsonObj.get("namespaceName").isJsonNull()) && !jsonObj.get("namespaceName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `namespaceName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespaceName").toString())); + } + if (jsonObj.get("modifyRoleUsers") != null && !jsonObj.get("modifyRoleUsers").isJsonNull()) { + JsonArray jsonArraymodifyRoleUsers = jsonObj.getAsJsonArray("modifyRoleUsers"); + if (jsonArraymodifyRoleUsers != null) { + // ensure the json data is an array + if (!jsonObj.get("modifyRoleUsers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `modifyRoleUsers` to be an array in the JSON string but got `%s`", jsonObj.get("modifyRoleUsers").toString())); + } + + // validate the optional field `modifyRoleUsers` (array) + for (int i = 0; i < jsonArraymodifyRoleUsers.size(); i++) { + OpenUserInfoDTO.validateJsonObject(jsonArraymodifyRoleUsers.get(i).getAsJsonObject()); + }; + } + } + if (jsonObj.get("releaseRoleUsers") != null && !jsonObj.get("releaseRoleUsers").isJsonNull()) { + JsonArray jsonArrayreleaseRoleUsers = jsonObj.getAsJsonArray("releaseRoleUsers"); + if (jsonArrayreleaseRoleUsers != null) { + // ensure the json data is an array + if (!jsonObj.get("releaseRoleUsers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `releaseRoleUsers` to be an array in the JSON string but got `%s`", jsonObj.get("releaseRoleUsers").toString())); + } + + // validate the optional field `releaseRoleUsers` (array) + for (int i = 0; i < jsonArrayreleaseRoleUsers.size(); i++) { + OpenUserInfoDTO.validateJsonObject(jsonArrayreleaseRoleUsers.get(i).getAsJsonObject()); + }; + } + } + if ((jsonObj.get("env") != null && !jsonObj.get("env").isJsonNull()) && !jsonObj.get("env").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `env` to be a primitive type in the JSON string but got `%s`", jsonObj.get("env").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OpenEnvNamespaceRoleUserDTO.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OpenEnvNamespaceRoleUserDTO' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OpenEnvNamespaceRoleUserDTO.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OpenEnvNamespaceRoleUserDTO value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OpenEnvNamespaceRoleUserDTO read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OpenEnvNamespaceRoleUserDTO given an JSON string + * + * @param jsonString JSON string + * @return An instance of OpenEnvNamespaceRoleUserDTO + * @throws IOException if the JSON string is invalid with respect to OpenEnvNamespaceRoleUserDTO + */ + public static OpenEnvNamespaceRoleUserDTO fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OpenEnvNamespaceRoleUserDTO.class); + } + + /** + * Convert an instance of OpenEnvNamespaceRoleUserDTO 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/OpenNamespaceRoleUserDTO.java b/java-client/src/main/java/org/openapitools/client/model/OpenNamespaceRoleUserDTO.java new file mode 100644 index 0000000..fbc521b --- /dev/null +++ b/java-client/src/main/java/org/openapitools/client/model/OpenNamespaceRoleUserDTO.java @@ -0,0 +1,341 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OpenUserInfoDTO; + +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; + +/** + * OpenNamespaceRoleUserDTO + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OpenNamespaceRoleUserDTO { + public static final String SERIALIZED_NAME_APP_ID = "appId"; + @SerializedName(SERIALIZED_NAME_APP_ID) + private String appId; + + public static final String SERIALIZED_NAME_NAMESPACE_NAME = "namespaceName"; + @SerializedName(SERIALIZED_NAME_NAMESPACE_NAME) + private String namespaceName; + + public static final String SERIALIZED_NAME_MODIFY_ROLE_USERS = "modifyRoleUsers"; + @SerializedName(SERIALIZED_NAME_MODIFY_ROLE_USERS) + private List modifyRoleUsers; + + public static final String SERIALIZED_NAME_RELEASE_ROLE_USERS = "releaseRoleUsers"; + @SerializedName(SERIALIZED_NAME_RELEASE_ROLE_USERS) + private List releaseRoleUsers; + + public OpenNamespaceRoleUserDTO() { + } + + public OpenNamespaceRoleUserDTO appId(String appId) { + + this.appId = appId; + return this; + } + + /** + * + * @return appId + **/ + @javax.annotation.Nullable + public String getAppId() { + return appId; + } + + + public void setAppId(String appId) { + this.appId = appId; + } + + + public OpenNamespaceRoleUserDTO namespaceName(String namespaceName) { + + this.namespaceName = namespaceName; + return this; + } + + /** + * + * @return namespaceName + **/ + @javax.annotation.Nullable + public String getNamespaceName() { + return namespaceName; + } + + + public void setNamespaceName(String namespaceName) { + this.namespaceName = namespaceName; + } + + + public OpenNamespaceRoleUserDTO modifyRoleUsers(List modifyRoleUsers) { + + this.modifyRoleUsers = modifyRoleUsers; + return this; + } + + public OpenNamespaceRoleUserDTO addModifyRoleUsersItem(OpenUserInfoDTO modifyRoleUsersItem) { + if (this.modifyRoleUsers == null) { + this.modifyRoleUsers = new ArrayList<>(); + } + this.modifyRoleUsers.add(modifyRoleUsersItem); + return this; + } + + /** + * + * @return modifyRoleUsers + **/ + @javax.annotation.Nullable + public List getModifyRoleUsers() { + return modifyRoleUsers; + } + + + public void setModifyRoleUsers(List modifyRoleUsers) { + this.modifyRoleUsers = modifyRoleUsers; + } + + + public OpenNamespaceRoleUserDTO releaseRoleUsers(List releaseRoleUsers) { + + this.releaseRoleUsers = releaseRoleUsers; + return this; + } + + public OpenNamespaceRoleUserDTO addReleaseRoleUsersItem(OpenUserInfoDTO releaseRoleUsersItem) { + if (this.releaseRoleUsers == null) { + this.releaseRoleUsers = new ArrayList<>(); + } + this.releaseRoleUsers.add(releaseRoleUsersItem); + return this; + } + + /** + * + * @return releaseRoleUsers + **/ + @javax.annotation.Nullable + public List getReleaseRoleUsers() { + return releaseRoleUsers; + } + + + public void setReleaseRoleUsers(List releaseRoleUsers) { + this.releaseRoleUsers = releaseRoleUsers; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenNamespaceRoleUserDTO openNamespaceRoleUserDTO = (OpenNamespaceRoleUserDTO) o; + return Objects.equals(this.appId, openNamespaceRoleUserDTO.appId) && + Objects.equals(this.namespaceName, openNamespaceRoleUserDTO.namespaceName) && + Objects.equals(this.modifyRoleUsers, openNamespaceRoleUserDTO.modifyRoleUsers) && + Objects.equals(this.releaseRoleUsers, openNamespaceRoleUserDTO.releaseRoleUsers); + } + + @Override + public int hashCode() { + return Objects.hash(appId, namespaceName, modifyRoleUsers, releaseRoleUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenNamespaceRoleUserDTO {\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" namespaceName: ").append(toIndentedString(namespaceName)).append("\n"); + sb.append(" modifyRoleUsers: ").append(toIndentedString(modifyRoleUsers)).append("\n"); + sb.append(" releaseRoleUsers: ").append(toIndentedString(releaseRoleUsers)).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("namespaceName"); + openapiFields.add("modifyRoleUsers"); + openapiFields.add("releaseRoleUsers"); + + // 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 OpenNamespaceRoleUserDTO + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OpenNamespaceRoleUserDTO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OpenNamespaceRoleUserDTO is not found in the empty JSON string", OpenNamespaceRoleUserDTO.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OpenNamespaceRoleUserDTO.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenNamespaceRoleUserDTO` 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("namespaceName") != null && !jsonObj.get("namespaceName").isJsonNull()) && !jsonObj.get("namespaceName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `namespaceName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("namespaceName").toString())); + } + if (jsonObj.get("modifyRoleUsers") != null && !jsonObj.get("modifyRoleUsers").isJsonNull()) { + JsonArray jsonArraymodifyRoleUsers = jsonObj.getAsJsonArray("modifyRoleUsers"); + if (jsonArraymodifyRoleUsers != null) { + // ensure the json data is an array + if (!jsonObj.get("modifyRoleUsers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `modifyRoleUsers` to be an array in the JSON string but got `%s`", jsonObj.get("modifyRoleUsers").toString())); + } + + // validate the optional field `modifyRoleUsers` (array) + for (int i = 0; i < jsonArraymodifyRoleUsers.size(); i++) { + OpenUserInfoDTO.validateJsonObject(jsonArraymodifyRoleUsers.get(i).getAsJsonObject()); + }; + } + } + if (jsonObj.get("releaseRoleUsers") != null && !jsonObj.get("releaseRoleUsers").isJsonNull()) { + JsonArray jsonArrayreleaseRoleUsers = jsonObj.getAsJsonArray("releaseRoleUsers"); + if (jsonArrayreleaseRoleUsers != null) { + // ensure the json data is an array + if (!jsonObj.get("releaseRoleUsers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `releaseRoleUsers` to be an array in the JSON string but got `%s`", jsonObj.get("releaseRoleUsers").toString())); + } + + // validate the optional field `releaseRoleUsers` (array) + for (int i = 0; i < jsonArrayreleaseRoleUsers.size(); i++) { + OpenUserInfoDTO.validateJsonObject(jsonArrayreleaseRoleUsers.get(i).getAsJsonObject()); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OpenNamespaceRoleUserDTO.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OpenNamespaceRoleUserDTO' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OpenNamespaceRoleUserDTO.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OpenNamespaceRoleUserDTO value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OpenNamespaceRoleUserDTO read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OpenNamespaceRoleUserDTO given an JSON string + * + * @param jsonString JSON string + * @return An instance of OpenNamespaceRoleUserDTO + * @throws IOException if the JSON string is invalid with respect to OpenNamespaceRoleUserDTO + */ + public static OpenNamespaceRoleUserDTO fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OpenNamespaceRoleUserDTO.class); + } + + /** + * Convert an instance of OpenNamespaceRoleUserDTO 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/KVEntity.java b/java-client/src/main/java/org/openapitools/client/model/OpenPermissionConditionDTO.java similarity index 62% rename from java-client/src/main/java/org/openapitools/client/model/KVEntity.java rename to java-client/src/main/java/org/openapitools/client/model/OpenPermissionConditionDTO.java index 61513de..89c138b 100644 --- a/java-client/src/main/java/org/openapitools/client/model/KVEntity.java +++ b/java-client/src/main/java/org/openapitools/client/model/OpenPermissionConditionDTO.java @@ -48,60 +48,35 @@ import org.openapitools.client.JSON; /** - * KVEntity + * OpenPermissionConditionDTO */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class KVEntity { - public static final String SERIALIZED_NAME_KEY = "key"; - @SerializedName(SERIALIZED_NAME_KEY) - private String key; +public class OpenPermissionConditionDTO { + public static final String SERIALIZED_NAME_HAS_PERMISSION = "hasPermission"; + @SerializedName(SERIALIZED_NAME_HAS_PERMISSION) + private Boolean hasPermission; - public static final String SERIALIZED_NAME_VALUE = "value"; - @SerializedName(SERIALIZED_NAME_VALUE) - private String value; - - public KVEntity() { - } - - public KVEntity key(String key) { - - this.key = key; - return this; - } - - /** - * 键 - * @return key - **/ - @javax.annotation.Nullable - public String getKey() { - return key; - } - - - public void setKey(String key) { - this.key = key; + public OpenPermissionConditionDTO() { } + public OpenPermissionConditionDTO hasPermission(Boolean hasPermission) { - public KVEntity value(String value) { - - this.value = value; + this.hasPermission = hasPermission; return this; } /** - * 值 - * @return value + * + * @return hasPermission **/ @javax.annotation.Nullable - public String getValue() { - return value; + public Boolean getHasPermission() { + return hasPermission; } - public void setValue(String value) { - this.value = value; + public void setHasPermission(Boolean hasPermission) { + this.hasPermission = hasPermission; } @@ -114,22 +89,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - KVEntity kvEntity = (KVEntity) o; - return Objects.equals(this.key, kvEntity.key) && - Objects.equals(this.value, kvEntity.value); + OpenPermissionConditionDTO openPermissionConditionDTO = (OpenPermissionConditionDTO) o; + return Objects.equals(this.hasPermission, openPermissionConditionDTO.hasPermission); } @Override public int hashCode() { - return Objects.hash(key, value); + return Objects.hash(hasPermission); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class KVEntity {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("class OpenPermissionConditionDTO {\n"); + sb.append(" hasPermission: ").append(toIndentedString(hasPermission)).append("\n"); sb.append("}"); return sb.toString(); } @@ -152,8 +125,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("key"); - openapiFields.add("value"); + openapiFields.add("hasPermission"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -163,50 +135,44 @@ private String toIndentedString(Object o) { * 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 KVEntity + * @throws IOException if the JSON Object is invalid with respect to OpenPermissionConditionDTO */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (!KVEntity.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in KVEntity is not found in the empty JSON string", KVEntity.openapiRequiredFields.toString())); + if (!OpenPermissionConditionDTO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OpenPermissionConditionDTO is not found in the empty JSON string", OpenPermissionConditionDTO.openapiRequiredFields.toString())); } } Set> entries = jsonObj.entrySet(); // check to see if the JSON string contains additional fields for (Entry entry : entries) { - if (!KVEntity.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `KVEntity` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + if (!OpenPermissionConditionDTO.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenPermissionConditionDTO` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); - } - if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !jsonObj.get("value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); - } } public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!KVEntity.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'KVEntity' and its subtypes + if (!OpenPermissionConditionDTO.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OpenPermissionConditionDTO' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(KVEntity.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OpenPermissionConditionDTO.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, KVEntity value) throws IOException { + public void write(JsonWriter out, OpenPermissionConditionDTO value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public KVEntity read(JsonReader in) throws IOException { + public OpenPermissionConditionDTO read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); return thisAdapter.fromJsonTree(jsonObj); @@ -217,18 +183,18 @@ public KVEntity read(JsonReader in) throws IOException { } /** - * Create an instance of KVEntity given an JSON string + * Create an instance of OpenPermissionConditionDTO given an JSON string * * @param jsonString JSON string - * @return An instance of KVEntity - * @throws IOException if the JSON string is invalid with respect to KVEntity + * @return An instance of OpenPermissionConditionDTO + * @throws IOException if the JSON string is invalid with respect to OpenPermissionConditionDTO */ - public static KVEntity fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, KVEntity.class); + public static OpenPermissionConditionDTO fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OpenPermissionConditionDTO.class); } /** - * Convert an instance of KVEntity to an JSON string + * Convert an instance of OpenPermissionConditionDTO to an JSON string * * @return JSON string */ diff --git a/java-client/src/main/java/org/openapitools/client/model/OpenReleaseChangeDTO.java b/java-client/src/main/java/org/openapitools/client/model/OpenReleaseChangeDTO.java new file mode 100644 index 0000000..afcd185 --- /dev/null +++ b/java-client/src/main/java/org/openapitools/client/model/OpenReleaseChangeDTO.java @@ -0,0 +1,300 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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; + +/** + * OpenReleaseChangeDTO + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OpenReleaseChangeDTO { + public static final String SERIALIZED_NAME_CHANGE_TYPE = "changeType"; + @SerializedName(SERIALIZED_NAME_CHANGE_TYPE) + private String changeType; + + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + private String key; + + public static final String SERIALIZED_NAME_NEW_VALUE = "newValue"; + @SerializedName(SERIALIZED_NAME_NEW_VALUE) + private String newValue; + + public static final String SERIALIZED_NAME_OLD_VALUE = "oldValue"; + @SerializedName(SERIALIZED_NAME_OLD_VALUE) + private String oldValue; + + public OpenReleaseChangeDTO() { + } + + public OpenReleaseChangeDTO changeType(String changeType) { + + this.changeType = changeType; + return this; + } + + /** + * 修改类型 + * @return changeType + **/ + @javax.annotation.Nullable + public String getChangeType() { + return changeType; + } + + + public void setChangeType(String changeType) { + this.changeType = changeType; + } + + + public OpenReleaseChangeDTO key(String key) { + + this.key = key; + return this; + } + + /** + * key + * @return key + **/ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + + public void setKey(String key) { + this.key = key; + } + + + public OpenReleaseChangeDTO newValue(String newValue) { + + this.newValue = newValue; + return this; + } + + /** + * new value + * @return newValue + **/ + @javax.annotation.Nullable + public String getNewValue() { + return newValue; + } + + + public void setNewValue(String newValue) { + this.newValue = newValue; + } + + + public OpenReleaseChangeDTO oldValue(String oldValue) { + + this.oldValue = oldValue; + return this; + } + + /** + * old value + * @return oldValue + **/ + @javax.annotation.Nullable + public String getOldValue() { + return oldValue; + } + + + public void setOldValue(String oldValue) { + this.oldValue = oldValue; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenReleaseChangeDTO openReleaseChangeDTO = (OpenReleaseChangeDTO) o; + return Objects.equals(this.changeType, openReleaseChangeDTO.changeType) && + Objects.equals(this.key, openReleaseChangeDTO.key) && + Objects.equals(this.newValue, openReleaseChangeDTO.newValue) && + Objects.equals(this.oldValue, openReleaseChangeDTO.oldValue); + } + + @Override + public int hashCode() { + return Objects.hash(changeType, key, newValue, oldValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenReleaseChangeDTO {\n"); + sb.append(" changeType: ").append(toIndentedString(changeType)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" newValue: ").append(toIndentedString(newValue)).append("\n"); + sb.append(" oldValue: ").append(toIndentedString(oldValue)).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("changeType"); + openapiFields.add("key"); + openapiFields.add("newValue"); + openapiFields.add("oldValue"); + + // 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 OpenReleaseChangeDTO + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OpenReleaseChangeDTO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OpenReleaseChangeDTO is not found in the empty JSON string", OpenReleaseChangeDTO.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OpenReleaseChangeDTO.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenReleaseChangeDTO` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("changeType") != null && !jsonObj.get("changeType").isJsonNull()) && !jsonObj.get("changeType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `changeType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("changeType").toString())); + } + if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + if ((jsonObj.get("newValue") != null && !jsonObj.get("newValue").isJsonNull()) && !jsonObj.get("newValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `newValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("newValue").toString())); + } + if ((jsonObj.get("oldValue") != null && !jsonObj.get("oldValue").isJsonNull()) && !jsonObj.get("oldValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `oldValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("oldValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OpenReleaseChangeDTO.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OpenReleaseChangeDTO' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OpenReleaseChangeDTO.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OpenReleaseChangeDTO value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OpenReleaseChangeDTO read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OpenReleaseChangeDTO given an JSON string + * + * @param jsonString JSON string + * @return An instance of OpenReleaseChangeDTO + * @throws IOException if the JSON string is invalid with respect to OpenReleaseChangeDTO + */ + public static OpenReleaseChangeDTO fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OpenReleaseChangeDTO.class); + } + + /** + * Convert an instance of OpenReleaseChangeDTO 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/OpenReleaseBO.java b/java-client/src/main/java/org/openapitools/client/model/OpenReleaseDiffDTO.java similarity index 59% rename from java-client/src/main/java/org/openapitools/client/model/OpenReleaseBO.java rename to java-client/src/main/java/org/openapitools/client/model/OpenReleaseDiffDTO.java index 5660463..a209b0f 100644 --- a/java-client/src/main/java/org/openapitools/client/model/OpenReleaseBO.java +++ b/java-client/src/main/java/org/openapitools/client/model/OpenReleaseDiffDTO.java @@ -23,8 +23,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.openapitools.client.model.KVEntity; -import org.openapitools.client.model.OpenReleaseDTO; +import org.openapitools.client.model.OpenReleaseChangeDTO; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -52,68 +51,43 @@ import org.openapitools.client.JSON; /** - * OpenReleaseBO + * OpenReleaseDiffDTO */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class OpenReleaseBO { - public static final String SERIALIZED_NAME_BASE_INFO = "baseInfo"; - @SerializedName(SERIALIZED_NAME_BASE_INFO) - private OpenReleaseDTO baseInfo; +public class OpenReleaseDiffDTO { + public static final String SERIALIZED_NAME_CHANGES = "changes"; + @SerializedName(SERIALIZED_NAME_CHANGES) + private List changes; - public static final String SERIALIZED_NAME_ITEMS = "items"; - @SerializedName(SERIALIZED_NAME_ITEMS) - private List items; - - public OpenReleaseBO() { + public OpenReleaseDiffDTO() { } - public OpenReleaseBO baseInfo(OpenReleaseDTO baseInfo) { + public OpenReleaseDiffDTO changes(List changes) { - this.baseInfo = baseInfo; + this.changes = changes; return this; } - /** - * Get baseInfo - * @return baseInfo - **/ - @javax.annotation.Nullable - public OpenReleaseDTO getBaseInfo() { - return baseInfo; - } - - - public void setBaseInfo(OpenReleaseDTO baseInfo) { - this.baseInfo = baseInfo; - } - - - public OpenReleaseBO items(List items) { - - this.items = items; - return this; - } - - public OpenReleaseBO addItemsItem(KVEntity itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); + public OpenReleaseDiffDTO addChangesItem(OpenReleaseChangeDTO changesItem) { + if (this.changes == null) { + this.changes = new ArrayList<>(); } - this.items.add(itemsItem); + this.changes.add(changesItem); return this; } /** - * Get items - * @return items + * A list of changes, ensuring order if necessary. + * @return changes **/ @javax.annotation.Nullable - public List getItems() { - return items; + public List getChanges() { + return changes; } - public void setItems(List items) { - this.items = items; + public void setChanges(List changes) { + this.changes = changes; } @@ -126,22 +100,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - OpenReleaseBO openReleaseBO = (OpenReleaseBO) o; - return Objects.equals(this.baseInfo, openReleaseBO.baseInfo) && - Objects.equals(this.items, openReleaseBO.items); + OpenReleaseDiffDTO openReleaseDiffDTO = (OpenReleaseDiffDTO) o; + return Objects.equals(this.changes, openReleaseDiffDTO.changes); } @Override public int hashCode() { - return Objects.hash(baseInfo, items); + return Objects.hash(changes); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class OpenReleaseBO {\n"); - sb.append(" baseInfo: ").append(toIndentedString(baseInfo)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append("class OpenReleaseDiffDTO {\n"); + sb.append(" changes: ").append(toIndentedString(changes)).append("\n"); sb.append("}"); return sb.toString(); } @@ -164,8 +136,7 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("baseInfo"); - openapiFields.add("items"); + openapiFields.add("changes"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); @@ -175,37 +146,33 @@ private String toIndentedString(Object o) { * 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 OpenReleaseBO + * @throws IOException if the JSON Object is invalid with respect to OpenReleaseDiffDTO */ public static void validateJsonObject(JsonObject jsonObj) throws IOException { if (jsonObj == null) { - if (!OpenReleaseBO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null - throw new IllegalArgumentException(String.format("The required field(s) %s in OpenReleaseBO is not found in the empty JSON string", OpenReleaseBO.openapiRequiredFields.toString())); + if (!OpenReleaseDiffDTO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OpenReleaseDiffDTO is not found in the empty JSON string", OpenReleaseDiffDTO.openapiRequiredFields.toString())); } } Set> entries = jsonObj.entrySet(); // check to see if the JSON string contains additional fields for (Entry entry : entries) { - if (!OpenReleaseBO.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenReleaseBO` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + if (!OpenReleaseDiffDTO.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenReleaseDiffDTO` properties. JSON: %s", entry.getKey(), jsonObj.toString())); } } - // validate the optional field `baseInfo` - if (jsonObj.get("baseInfo") != null && !jsonObj.get("baseInfo").isJsonNull()) { - OpenReleaseDTO.validateJsonObject(jsonObj.getAsJsonObject("baseInfo")); - } - if (jsonObj.get("items") != null && !jsonObj.get("items").isJsonNull()) { - JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); - if (jsonArrayitems != null) { + if (jsonObj.get("changes") != null && !jsonObj.get("changes").isJsonNull()) { + JsonArray jsonArraychanges = jsonObj.getAsJsonArray("changes"); + if (jsonArraychanges != null) { // ensure the json data is an array - if (!jsonObj.get("items").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `items` to be an array in the JSON string but got `%s`", jsonObj.get("items").toString())); + if (!jsonObj.get("changes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `changes` to be an array in the JSON string but got `%s`", jsonObj.get("changes").toString())); } - // validate the optional field `items` (array) - for (int i = 0; i < jsonArrayitems.size(); i++) { - KVEntity.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); + // validate the optional field `changes` (array) + for (int i = 0; i < jsonArraychanges.size(); i++) { + OpenReleaseChangeDTO.validateJsonObject(jsonArraychanges.get(i).getAsJsonObject()); }; } } @@ -215,22 +182,22 @@ public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!OpenReleaseBO.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'OpenReleaseBO' and its subtypes + if (!OpenReleaseDiffDTO.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OpenReleaseDiffDTO' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(OpenReleaseBO.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OpenReleaseDiffDTO.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, OpenReleaseBO value) throws IOException { + public void write(JsonWriter out, OpenReleaseDiffDTO value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public OpenReleaseBO read(JsonReader in) throws IOException { + public OpenReleaseDiffDTO read(JsonReader in) throws IOException { JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); validateJsonObject(jsonObj); return thisAdapter.fromJsonTree(jsonObj); @@ -241,18 +208,18 @@ public OpenReleaseBO read(JsonReader in) throws IOException { } /** - * Create an instance of OpenReleaseBO given an JSON string + * Create an instance of OpenReleaseDiffDTO given an JSON string * * @param jsonString JSON string - * @return An instance of OpenReleaseBO - * @throws IOException if the JSON string is invalid with respect to OpenReleaseBO + * @return An instance of OpenReleaseDiffDTO + * @throws IOException if the JSON string is invalid with respect to OpenReleaseDiffDTO */ - public static OpenReleaseBO fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, OpenReleaseBO.class); + public static OpenReleaseDiffDTO fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OpenReleaseDiffDTO.class); } /** - * Convert an instance of OpenReleaseBO to an JSON string + * Convert an instance of OpenReleaseDiffDTO to an JSON string * * @return JSON string */ diff --git a/java-client/src/main/java/org/openapitools/client/model/OpenUserInfoDTO.java b/java-client/src/main/java/org/openapitools/client/model/OpenUserInfoDTO.java new file mode 100644 index 0000000..4ac2809 --- /dev/null +++ b/java-client/src/main/java/org/openapitools/client/model/OpenUserInfoDTO.java @@ -0,0 +1,297 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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; + +/** + * OpenUserInfoDTO + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class OpenUserInfoDTO { + public static final String SERIALIZED_NAME_USER_ID = "userId"; + @SerializedName(SERIALIZED_NAME_USER_ID) + private String userId; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Integer enabled; + + public OpenUserInfoDTO() { + } + + public OpenUserInfoDTO userId(String userId) { + + this.userId = userId; + return this; + } + + /** + * + * @return userId + **/ + @javax.annotation.Nullable + public String getUserId() { + return userId; + } + + + public void setUserId(String userId) { + this.userId = userId; + } + + + public OpenUserInfoDTO 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 OpenUserInfoDTO email(String email) { + + this.email = email; + return this; + } + + /** + * + * @return email + **/ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public OpenUserInfoDTO enabled(Integer enabled) { + + this.enabled = enabled; + return this; + } + + /** + * + * @return enabled + **/ + @javax.annotation.Nullable + public Integer getEnabled() { + return enabled; + } + + + public void setEnabled(Integer enabled) { + this.enabled = enabled; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenUserInfoDTO openUserInfoDTO = (OpenUserInfoDTO) o; + return Objects.equals(this.userId, openUserInfoDTO.userId) && + Objects.equals(this.name, openUserInfoDTO.name) && + Objects.equals(this.email, openUserInfoDTO.email) && + Objects.equals(this.enabled, openUserInfoDTO.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(userId, name, email, enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenUserInfoDTO {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).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("userId"); + openapiFields.add("name"); + openapiFields.add("email"); + openapiFields.add("enabled"); + + // 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 OpenUserInfoDTO + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (!OpenUserInfoDTO.openapiRequiredFields.isEmpty()) { // has required fields but JSON object is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OpenUserInfoDTO is not found in the empty JSON string", OpenUserInfoDTO.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OpenUserInfoDTO.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenUserInfoDTO` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + if ((jsonObj.get("userId") != null && !jsonObj.get("userId").isJsonNull()) && !jsonObj.get("userId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userId").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("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!OpenUserInfoDTO.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OpenUserInfoDTO' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OpenUserInfoDTO.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, OpenUserInfoDTO value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public OpenUserInfoDTO read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OpenUserInfoDTO given an JSON string + * + * @param jsonString JSON string + * @return An instance of OpenUserInfoDTO + * @throws IOException if the JSON string is invalid with respect to OpenUserInfoDTO + */ + public static OpenUserInfoDTO fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OpenUserInfoDTO.class); + } + + /** + * Convert an instance of OpenUserInfoDTO 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 new file mode 100644 index 0000000..79e9233 --- /dev/null +++ b/java-client/src/test/java/org/openapitools/client/api/AccessKeyManagementApiTest.java @@ -0,0 +1,115 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.OpenAccessKeyDTO; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AccessKeyManagementApi + */ +@Disabled +public class AccessKeyManagementApiTest { + + private final AccessKeyManagementApi api = new AccessKeyManagementApi(); + + /** + * 创建AccessKey + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void createAccessKeyTest() throws ApiException { + String appId = null; + String env = null; + String operator = null; + OpenAccessKeyDTO response = api.createAccessKey(appId, env, operator); + // TODO: test validations + } + + /** + * 删除AccessKey + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteAccessKeyTest() throws ApiException { + String appId = null; + String env = null; + Long accessKeyId = null; + String operator = null; + api.deleteAccessKey(appId, env, accessKeyId, operator); + // TODO: test validations + } + + /** + * 禁用AccessKey + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void disableAccessKeyTest() throws ApiException { + String appId = null; + String env = null; + Long accessKeyId = null; + api.disableAccessKey(appId, env, accessKeyId); + // TODO: test validations + } + + /** + * 启用AccessKey + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void enableAccessKeyTest() throws ApiException { + String appId = null; + String env = null; + Long accessKeyId = null; + Integer mode = null; + api.enableAccessKey(appId, env, accessKeyId, mode); + // TODO: test validations + } + + /** + * 查找AccessKey + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void findAccessKeysTest() throws ApiException { + String appId = null; + String env = null; + List response = api.findAccessKeys(appId, env); + // TODO: test validations + } + +} diff --git a/java-client/src/test/java/org/openapitools/client/api/AppManagementApiTest.java b/java-client/src/test/java/org/openapitools/client/api/AppManagementApiTest.java index e7c3466..c51ec1f 100644 --- a/java-client/src/test/java/org/openapitools/client/api/AppManagementApiTest.java +++ b/java-client/src/test/java/org/openapitools/client/api/AppManagementApiTest.java @@ -62,7 +62,7 @@ public void createAppInEnvTest() throws ApiException { String env = null; OpenAppDTO openAppDTO = null; String operator = null; - Object response = api.createAppInEnv(env, openAppDTO, operator); + api.createAppInEnv(env, openAppDTO, operator); // TODO: test validations } @@ -77,7 +77,7 @@ public void createAppInEnvTest() throws ApiException { public void deleteAppTest() throws ApiException { String appId = null; String operator = null; - Object response = api.deleteApp(appId, operator); + api.deleteApp(appId, operator); // TODO: test validations } @@ -191,7 +191,7 @@ public void updateAppTest() throws ApiException { String appId = null; OpenAppDTO openAppDTO = null; String operator = null; - Object response = api.updateApp(appId, openAppDTO, operator); + api.updateApp(appId, openAppDTO, operator); // TODO: test validations } diff --git a/java-client/src/test/java/org/openapitools/client/api/ClusterManagementApiTest.java b/java-client/src/test/java/org/openapitools/client/api/ClusterManagementApiTest.java index 1ccc323..940b293 100644 --- a/java-client/src/test/java/org/openapitools/client/api/ClusterManagementApiTest.java +++ b/java-client/src/test/java/org/openapitools/client/api/ClusterManagementApiTest.java @@ -61,7 +61,7 @@ public void deleteClusterTest() throws ApiException { String appId = null; String clusterName = null; String operator = null; - Object response = api.deleteCluster(env, appId, clusterName, operator); + api.deleteCluster(env, appId, clusterName, operator); // TODO: test validations } diff --git a/java-client/src/test/java/org/openapitools/client/api/NamespaceManagementApiTest.java b/java-client/src/test/java/org/openapitools/client/api/NamespaceManagementApiTest.java index 127aabc..612073c 100644 --- a/java-client/src/test/java/org/openapitools/client/api/NamespaceManagementApiTest.java +++ b/java-client/src/test/java/org/openapitools/client/api/NamespaceManagementApiTest.java @@ -46,7 +46,7 @@ public void createMissingNamespacesTest() throws ApiException { String env = null; String clusterName = null; String operator = null; - Object response = api.createMissingNamespaces(appId, env, clusterName, operator); + api.createMissingNamespaces(appId, env, clusterName, operator); // TODO: test validations } diff --git a/java-client/src/test/java/org/openapitools/client/api/PermissionManagementApiTest.java b/java-client/src/test/java/org/openapitools/client/api/PermissionManagementApiTest.java new file mode 100644 index 0000000..70d800d --- /dev/null +++ b/java-client/src/test/java/org/openapitools/client/api/PermissionManagementApiTest.java @@ -0,0 +1,464 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.OpenAppRoleUserDTO; +import org.openapitools.client.model.OpenClusterNamespaceRoleUserDTO; +import org.openapitools.client.model.OpenEnvNamespaceRoleUserDTO; +import org.openapitools.client.model.OpenNamespaceRoleUserDTO; +import org.openapitools.client.model.OpenPermissionConditionDTO; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for PermissionManagementApi + */ +@Disabled +public class PermissionManagementApiTest { + + private final PermissionManagementApi api = new PermissionManagementApi(); + + /** + * 分配建应用角色 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void addCreateApplicationRoleToUsersTest() throws ApiException { + String operator = null; + List requestBody = null; + api.addCreateApplicationRoleToUsers(operator, requestBody); + // TODO: test validations + } + + /** + * 分配AppMaster (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void addManageAppMasterRoleToUserTest() throws ApiException { + String appId = null; + String userId = null; + String operator = null; + api.addManageAppMasterRoleToUser(appId, userId, operator); + // TODO: test validations + } + + /** + * 分配应用角色 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void assignAppRoleToUserTest() throws ApiException { + String appId = null; + String roleType = null; + String userId = null; + String operator = null; + String body = null; + api.assignAppRoleToUser(appId, roleType, userId, operator, body); + // TODO: test validations + } + + /** + * 分配集群Namespace角色 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void assignClusterNamespaceRoleToUserTest() throws ApiException { + String appId = null; + String env = null; + String clusterName = null; + String roleType = null; + String userId = null; + String operator = null; + api.assignClusterNamespaceRoleToUser(appId, env, clusterName, roleType, userId, operator); + // TODO: test validations + } + + /** + * 分配环境Namespace角色 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void assignNamespaceEnvRoleToUserTest() throws ApiException { + String appId = null; + String env = null; + String namespaceName = null; + String roleType = null; + String userId = null; + String operator = null; + api.assignNamespaceEnvRoleToUser(appId, env, namespaceName, roleType, userId, operator); + // TODO: test validations + } + + /** + * 分配Namespace角色 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void assignNamespaceRoleToUserTest() throws ApiException { + String appId = null; + String namespaceName = null; + String roleType = null; + String userId = null; + String operator = null; + api.assignNamespaceRoleToUser(appId, namespaceName, roleType, userId, operator); + // TODO: test validations + } + + /** + * 移除建应用角色 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteCreateApplicationRoleFromUserTest() throws ApiException { + String userId = null; + String operator = null; + api.deleteCreateApplicationRoleFromUser(userId, operator); + // TODO: test validations + } + + /** + * 获取应用角色用户 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void getAppRolesTest() throws ApiException { + String appId = null; + OpenAppRoleUserDTO response = api.getAppRoles(appId); + // TODO: test validations + } + + /** + * 获取集群Namespace用户 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void getClusterNamespaceRolesTest() throws ApiException { + String appId = null; + String env = null; + String clusterName = null; + OpenClusterNamespaceRoleUserDTO response = api.getClusterNamespaceRoles(appId, env, clusterName); + // TODO: test validations + } + + /** + * 获取建应用用户 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void getCreateApplicationRoleUsersTest() throws ApiException { + List response = api.getCreateApplicationRoleUsers(); + // TODO: test validations + } + + /** + * 获取环境Namespace用户 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void getNamespaceEnvRoleUsersTest() throws ApiException { + String appId = null; + String env = null; + String namespaceName = null; + OpenEnvNamespaceRoleUserDTO response = api.getNamespaceEnvRoleUsers(appId, env, namespaceName); + // TODO: test validations + } + + /** + * 获取Namespace用户 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void getNamespaceRolesTest() throws ApiException { + String appId = null; + String namespaceName = null; + OpenNamespaceRoleUserDTO response = api.getNamespaceRoles(appId, namespaceName); + // TODO: test validations + } + + /** + * 校验应用权限 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasAppPermissionTest() throws ApiException { + String appId = null; + String permissionType = null; + String userId = null; + OpenPermissionConditionDTO response = api.hasAppPermission(appId, permissionType, userId); + // TODO: test validations + } + + /** + * 校验集群Namespace权限 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasClusterNamespacePermissionTest() throws ApiException { + String appId = null; + String env = null; + String clusterName = null; + String permissionType = null; + String userId = null; + OpenPermissionConditionDTO response = api.hasClusterNamespacePermission(appId, env, clusterName, permissionType, userId); + // TODO: test validations + } + + /** + * 校验建应用权限 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasCreateApplicationPermissionTest() throws ApiException { + String userId = null; + Map response = api.hasCreateApplicationPermission(userId); + // TODO: test validations + } + + /** + * 校验环境Namespace权限 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasEnvNamespacePermissionTest() throws ApiException { + String appId = null; + String env = null; + String namespaceName = null; + String permissionType = null; + String userId = null; + OpenPermissionConditionDTO response = api.hasEnvNamespacePermission(appId, env, namespaceName, permissionType, userId); + // TODO: test validations + } + + /** + * 校验Namespace权限 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasNamespacePermissionTest() throws ApiException { + String appId = null; + String namespaceName = null; + String permissionType = null; + String userId = null; + OpenPermissionConditionDTO response = api.hasNamespacePermission(appId, namespaceName, permissionType, userId); + // TODO: test validations + } + + /** + * 校验Root权限 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void hasRootPermissionTest() throws ApiException { + String userId = null; + OpenPermissionConditionDTO response = api.hasRootPermission(userId); + // TODO: test validations + } + + /** + * 初始化应用权限 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void initAppPermissionTest() throws ApiException { + String appId = null; + String namespaceName = null; + String operator = null; + api.initAppPermission(appId, namespaceName, operator); + // TODO: test validations + } + + /** + * 初始化集群Namespace权限 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void initClusterNamespacePermissionTest() throws ApiException { + String appId = null; + String env = null; + String clusterName = null; + String operator = null; + api.initClusterNamespacePermission(appId, env, clusterName, operator); + // TODO: test validations + } + + /** + * 校验AppMaster开关 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void isManageAppMasterPermissionEnabledTest() throws ApiException { + Map response = api.isManageAppMasterPermissionEnabled(); + // TODO: test validations + } + + /** + * 移除应用角色 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void removeAppRoleFromUserTest() throws ApiException { + String appId = null; + String roleType = null; + String userId = null; + String operator = null; + api.removeAppRoleFromUser(appId, roleType, userId, operator); + // TODO: test validations + } + + /** + * 移除集群Namespace角色 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void removeClusterNamespaceRoleFromUserTest() throws ApiException { + String appId = null; + String env = null; + String clusterName = null; + String roleType = null; + String userId = null; + String operator = null; + api.removeClusterNamespaceRoleFromUser(appId, env, clusterName, roleType, userId, operator); + // TODO: test validations + } + + /** + * 移除AppMaster (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void removeManageAppMasterRoleFromUserTest() throws ApiException { + String appId = null; + String userId = null; + String operator = null; + api.removeManageAppMasterRoleFromUser(appId, userId, operator); + // TODO: test validations + } + + /** + * 移除环境Namespace角色 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void removeNamespaceEnvRoleFromUserTest() throws ApiException { + String appId = null; + String env = null; + String namespaceName = null; + String roleType = null; + String userId = null; + String operator = null; + api.removeNamespaceEnvRoleFromUser(appId, env, namespaceName, roleType, userId, operator); + // TODO: test validations + } + + /** + * 移除Namespace角色 (new added) + * + * + * + * @throws ApiException if the Api call fails + */ + @Test + public void removeNamespaceRoleFromUserTest() throws ApiException { + String appId = null; + String namespaceName = null; + String roleType = null; + String userId = null; + String operator = null; + api.removeNamespaceRoleFromUser(appId, namespaceName, roleType, userId, operator); + // 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 1c6278a..a55ccbe 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 @@ -17,8 +17,8 @@ import org.openapitools.client.model.ExceptionResponse; import org.openapitools.client.model.NamespaceGrayDelReleaseDTO; import org.openapitools.client.model.NamespaceReleaseDTO; -import org.openapitools.client.model.OpenReleaseBO; import org.openapitools.client.model.OpenReleaseDTO; +import org.openapitools.client.model.OpenReleaseDiffDTO; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -35,6 +35,22 @@ public class ReleaseManagementApiTest { private final ReleaseManagementApi api = new ReleaseManagementApi(); + /** + * Compare two releases + * + * Get the configuration differences between two releases. + * + * @throws ApiException if the Api call fails + */ + @Test + public void compareReleaseTest() throws ApiException { + String env = null; + Long baseReleaseId = null; + Long toCompareReleaseId = null; + OpenReleaseDiffDTO response = api.compareRelease(env, baseReleaseId, toCompareReleaseId); + // TODO: test validations + } + /** * 创建灰度删除发布 (original openapi) * @@ -50,7 +66,8 @@ public void createGrayDelReleaseTest() throws ApiException { String namespaceName = null; String branchName = null; NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO = null; - OpenReleaseDTO response = api.createGrayDelRelease(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO); + String operator = null; + OpenReleaseDTO response = api.createGrayDelRelease(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO, operator); // TODO: test validations } @@ -69,7 +86,8 @@ public void createGrayReleaseTest() throws ApiException { String namespaceName = null; String branchName = null; NamespaceReleaseDTO namespaceReleaseDTO = null; - OpenReleaseDTO response = api.createGrayRelease(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO); + String operator = null; + OpenReleaseDTO response = api.createGrayRelease(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO, operator); // TODO: test validations } @@ -87,7 +105,8 @@ public void createReleaseTest() throws ApiException { String clusterName = null; String namespaceName = null; NamespaceReleaseDTO namespaceReleaseDTO = null; - OpenReleaseDTO response = api.createRelease(appId, env, clusterName, namespaceName, namespaceReleaseDTO); + String operator = null; + OpenReleaseDTO response = api.createRelease(appId, env, clusterName, namespaceName, namespaceReleaseDTO, operator); // TODO: test validations } @@ -110,25 +129,6 @@ public void findActiveReleasesTest() throws ApiException { // TODO: test validations } - /** - * 获取所有发布(分页) (new added) - * - * GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all - * - * @throws ApiException if the Api call fails - */ - @Test - public void findAllReleasesTest() throws ApiException { - String appId = null; - String env = null; - String clusterName = null; - String namespaceName = null; - Integer page = null; - Integer size = null; - List response = api.findAllReleases(appId, env, clusterName, namespaceName, page, size); - // TODO: test validations - } - /** * 获取发布详情 (new added) * @@ -173,7 +173,7 @@ public void rollbackTest() throws ApiException { String env = null; Long releaseId = null; String operator = null; - Object response = api.rollback(env, releaseId, operator); + api.rollback(env, releaseId, operator); // TODO: test validations } diff --git a/java-client/src/test/java/org/openapitools/client/model/OpenAccessKeyDTOTest.java b/java-client/src/test/java/org/openapitools/client/model/OpenAccessKeyDTOTest.java new file mode 100644 index 0000000..4da57cd --- /dev/null +++ b/java-client/src/test/java/org/openapitools/client/model/OpenAccessKeyDTOTest.java @@ -0,0 +1,128 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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 OpenAccessKeyDTO + */ +public class OpenAccessKeyDTOTest { + private final OpenAccessKeyDTO model = new OpenAccessKeyDTO(); + + /** + * Model tests for OpenAccessKeyDTO + */ + @Test + public void testOpenAccessKeyDTO() { + // TODO: test OpenAccessKeyDTO + } + + /** + * Test the property 'dataChangeCreatedBy' + */ + @Test + public void dataChangeCreatedByTest() { + // TODO: test dataChangeCreatedBy + } + + /** + * Test the property 'dataChangeLastModifiedBy' + */ + @Test + public void dataChangeLastModifiedByTest() { + // TODO: test dataChangeLastModifiedBy + } + + /** + * Test the property 'dataChangeCreatedByDisplayName' + */ + @Test + public void dataChangeCreatedByDisplayNameTest() { + // TODO: test dataChangeCreatedByDisplayName + } + + /** + * Test the property 'dataChangeLastModifiedByDisplayName' + */ + @Test + public void dataChangeLastModifiedByDisplayNameTest() { + // TODO: test dataChangeLastModifiedByDisplayName + } + + /** + * Test the property 'dataChangeCreatedTime' + */ + @Test + public void dataChangeCreatedTimeTest() { + // TODO: test dataChangeCreatedTime + } + + /** + * Test the property 'dataChangeLastModifiedTime' + */ + @Test + public void dataChangeLastModifiedTimeTest() { + // TODO: test dataChangeLastModifiedTime + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'secret' + */ + @Test + public void secretTest() { + // TODO: test secret + } + + /** + * Test the property 'appId' + */ + @Test + public void appIdTest() { + // TODO: test appId + } + + /** + * Test the property 'mode' + */ + @Test + public void modeTest() { + // TODO: test mode + } + + /** + * Test the property 'enabled' + */ + @Test + public void enabledTest() { + // TODO: test enabled + } + +} diff --git a/java-client/src/test/java/org/openapitools/client/model/OpenReleaseBOTest.java b/java-client/src/test/java/org/openapitools/client/model/OpenAppRoleUserDTOTest.java similarity index 73% rename from java-client/src/test/java/org/openapitools/client/model/OpenReleaseBOTest.java rename to java-client/src/test/java/org/openapitools/client/model/OpenAppRoleUserDTOTest.java index 5d14421..c799848 100644 --- a/java-client/src/test/java/org/openapitools/client/model/OpenReleaseBOTest.java +++ b/java-client/src/test/java/org/openapitools/client/model/OpenAppRoleUserDTOTest.java @@ -21,40 +21,39 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.openapitools.client.model.KVEntity; -import org.openapitools.client.model.OpenReleaseDTO; +import org.openapitools.client.model.OpenUserInfoDTO; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** - * Model tests for OpenReleaseBO + * Model tests for OpenAppRoleUserDTO */ -public class OpenReleaseBOTest { - private final OpenReleaseBO model = new OpenReleaseBO(); +public class OpenAppRoleUserDTOTest { + private final OpenAppRoleUserDTO model = new OpenAppRoleUserDTO(); /** - * Model tests for OpenReleaseBO + * Model tests for OpenAppRoleUserDTO */ @Test - public void testOpenReleaseBO() { - // TODO: test OpenReleaseBO + public void testOpenAppRoleUserDTO() { + // TODO: test OpenAppRoleUserDTO } /** - * Test the property 'baseInfo' + * Test the property 'appId' */ @Test - public void baseInfoTest() { - // TODO: test baseInfo + public void appIdTest() { + // TODO: test appId } /** - * Test the property 'items' + * Test the property 'masterUsers' */ @Test - public void itemsTest() { - // TODO: test items + public void masterUsersTest() { + // TODO: test masterUsers } } diff --git a/java-client/src/test/java/org/openapitools/client/model/OpenClusterNamespaceRoleUserDTOTest.java b/java-client/src/test/java/org/openapitools/client/model/OpenClusterNamespaceRoleUserDTOTest.java new file mode 100644 index 0000000..8e923ca --- /dev/null +++ b/java-client/src/test/java/org/openapitools/client/model/OpenClusterNamespaceRoleUserDTOTest.java @@ -0,0 +1,83 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OpenUserInfoDTO; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OpenClusterNamespaceRoleUserDTO + */ +public class OpenClusterNamespaceRoleUserDTOTest { + private final OpenClusterNamespaceRoleUserDTO model = new OpenClusterNamespaceRoleUserDTO(); + + /** + * Model tests for OpenClusterNamespaceRoleUserDTO + */ + @Test + public void testOpenClusterNamespaceRoleUserDTO() { + // TODO: test OpenClusterNamespaceRoleUserDTO + } + + /** + * Test the property 'appId' + */ + @Test + public void appIdTest() { + // TODO: test appId + } + + /** + * Test the property 'env' + */ + @Test + public void envTest() { + // TODO: test env + } + + /** + * Test the property 'cluster' + */ + @Test + public void clusterTest() { + // TODO: test cluster + } + + /** + * Test the property 'modifyRoleUsers' + */ + @Test + public void modifyRoleUsersTest() { + // TODO: test modifyRoleUsers + } + + /** + * Test the property 'releaseRoleUsers' + */ + @Test + public void releaseRoleUsersTest() { + // TODO: test releaseRoleUsers + } + +} diff --git a/java-client/src/test/java/org/openapitools/client/model/OpenEnvNamespaceRoleUserDTOTest.java b/java-client/src/test/java/org/openapitools/client/model/OpenEnvNamespaceRoleUserDTOTest.java new file mode 100644 index 0000000..c291864 --- /dev/null +++ b/java-client/src/test/java/org/openapitools/client/model/OpenEnvNamespaceRoleUserDTOTest.java @@ -0,0 +1,83 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OpenUserInfoDTO; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OpenEnvNamespaceRoleUserDTO + */ +public class OpenEnvNamespaceRoleUserDTOTest { + private final OpenEnvNamespaceRoleUserDTO model = new OpenEnvNamespaceRoleUserDTO(); + + /** + * Model tests for OpenEnvNamespaceRoleUserDTO + */ + @Test + public void testOpenEnvNamespaceRoleUserDTO() { + // TODO: test OpenEnvNamespaceRoleUserDTO + } + + /** + * Test the property 'appId' + */ + @Test + public void appIdTest() { + // TODO: test appId + } + + /** + * Test the property 'namespaceName' + */ + @Test + public void namespaceNameTest() { + // TODO: test namespaceName + } + + /** + * Test the property 'modifyRoleUsers' + */ + @Test + public void modifyRoleUsersTest() { + // TODO: test modifyRoleUsers + } + + /** + * Test the property 'releaseRoleUsers' + */ + @Test + public void releaseRoleUsersTest() { + // TODO: test releaseRoleUsers + } + + /** + * Test the property 'env' + */ + @Test + public void envTest() { + // TODO: test env + } + +} diff --git a/java-client/src/test/java/org/openapitools/client/model/OpenNamespaceRoleUserDTOTest.java b/java-client/src/test/java/org/openapitools/client/model/OpenNamespaceRoleUserDTOTest.java new file mode 100644 index 0000000..a3934dc --- /dev/null +++ b/java-client/src/test/java/org/openapitools/client/model/OpenNamespaceRoleUserDTOTest.java @@ -0,0 +1,75 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OpenUserInfoDTO; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OpenNamespaceRoleUserDTO + */ +public class OpenNamespaceRoleUserDTOTest { + private final OpenNamespaceRoleUserDTO model = new OpenNamespaceRoleUserDTO(); + + /** + * Model tests for OpenNamespaceRoleUserDTO + */ + @Test + public void testOpenNamespaceRoleUserDTO() { + // TODO: test OpenNamespaceRoleUserDTO + } + + /** + * Test the property 'appId' + */ + @Test + public void appIdTest() { + // TODO: test appId + } + + /** + * Test the property 'namespaceName' + */ + @Test + public void namespaceNameTest() { + // TODO: test namespaceName + } + + /** + * Test the property 'modifyRoleUsers' + */ + @Test + public void modifyRoleUsersTest() { + // TODO: test modifyRoleUsers + } + + /** + * Test the property 'releaseRoleUsers' + */ + @Test + public void releaseRoleUsersTest() { + // TODO: test releaseRoleUsers + } + +} diff --git a/java-client/src/test/java/org/openapitools/client/model/KVEntityTest.java b/java-client/src/test/java/org/openapitools/client/model/OpenPermissionConditionDTOTest.java similarity index 75% rename from java-client/src/test/java/org/openapitools/client/model/KVEntityTest.java rename to java-client/src/test/java/org/openapitools/client/model/OpenPermissionConditionDTOTest.java index 21bad78..ed41388 100644 --- a/java-client/src/test/java/org/openapitools/client/model/KVEntityTest.java +++ b/java-client/src/test/java/org/openapitools/client/model/OpenPermissionConditionDTOTest.java @@ -24,33 +24,25 @@ /** - * Model tests for KVEntity + * Model tests for OpenPermissionConditionDTO */ -public class KVEntityTest { - private final KVEntity model = new KVEntity(); +public class OpenPermissionConditionDTOTest { + private final OpenPermissionConditionDTO model = new OpenPermissionConditionDTO(); /** - * Model tests for KVEntity + * Model tests for OpenPermissionConditionDTO */ @Test - public void testKVEntity() { - // TODO: test KVEntity + public void testOpenPermissionConditionDTO() { + // TODO: test OpenPermissionConditionDTO } /** - * Test the property 'key' + * Test the property 'hasPermission' */ @Test - public void keyTest() { - // TODO: test key - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value + public void hasPermissionTest() { + // TODO: test hasPermission } } diff --git a/java-client/src/test/java/org/openapitools/client/model/OpenReleaseChangeDTOTest.java b/java-client/src/test/java/org/openapitools/client/model/OpenReleaseChangeDTOTest.java new file mode 100644 index 0000000..b669f05 --- /dev/null +++ b/java-client/src/test/java/org/openapitools/client/model/OpenReleaseChangeDTOTest.java @@ -0,0 +1,72 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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 OpenReleaseChangeDTO + */ +public class OpenReleaseChangeDTOTest { + private final OpenReleaseChangeDTO model = new OpenReleaseChangeDTO(); + + /** + * Model tests for OpenReleaseChangeDTO + */ + @Test + public void testOpenReleaseChangeDTO() { + // TODO: test OpenReleaseChangeDTO + } + + /** + * Test the property 'changeType' + */ + @Test + public void changeTypeTest() { + // TODO: test changeType + } + + /** + * Test the property 'key' + */ + @Test + public void keyTest() { + // TODO: test key + } + + /** + * Test the property 'newValue' + */ + @Test + public void newValueTest() { + // TODO: test newValue + } + + /** + * Test the property 'oldValue' + */ + @Test + public void oldValueTest() { + // TODO: test oldValue + } + +} diff --git a/java-client/src/test/java/org/openapitools/client/model/OpenReleaseDiffDTOTest.java b/java-client/src/test/java/org/openapitools/client/model/OpenReleaseDiffDTOTest.java new file mode 100644 index 0000000..14412ea --- /dev/null +++ b/java-client/src/test/java/org/openapitools/client/model/OpenReleaseDiffDTOTest.java @@ -0,0 +1,51 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.OpenReleaseChangeDTO; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OpenReleaseDiffDTO + */ +public class OpenReleaseDiffDTOTest { + private final OpenReleaseDiffDTO model = new OpenReleaseDiffDTO(); + + /** + * Model tests for OpenReleaseDiffDTO + */ + @Test + public void testOpenReleaseDiffDTO() { + // TODO: test OpenReleaseDiffDTO + } + + /** + * Test the property 'changes' + */ + @Test + public void changesTest() { + // TODO: test changes + } + +} diff --git a/java-client/src/test/java/org/openapitools/client/model/OpenUserInfoDTOTest.java b/java-client/src/test/java/org/openapitools/client/model/OpenUserInfoDTOTest.java new file mode 100644 index 0000000..1c8fea9 --- /dev/null +++ b/java-client/src/test/java/org/openapitools/client/model/OpenUserInfoDTOTest.java @@ -0,0 +1,72 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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 OpenUserInfoDTO + */ +public class OpenUserInfoDTOTest { + private final OpenUserInfoDTO model = new OpenUserInfoDTO(); + + /** + * Model tests for OpenUserInfoDTO + */ + @Test + public void testOpenUserInfoDTO() { + // TODO: test OpenUserInfoDTO + } + + /** + * Test the property 'userId' + */ + @Test + public void userIdTest() { + // TODO: test userId + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'enabled' + */ + @Test + public void enabledTest() { + // TODO: test enabled + } + +} diff --git a/python/.openapi-generator/FILES b/python/.openapi-generator/FILES index db328f9..c9f60a9 100644 --- a/python/.openapi-generator/FILES +++ b/python/.openapi-generator/FILES @@ -6,6 +6,7 @@ README.md apollo_openapi/__init__.py apollo_openapi/api_client.py apollo_openapi/apis/__init__.py +apollo_openapi/apis/tags/access_key_management_api.py apollo_openapi/apis/tags/app_management_api.py apollo_openapi/apis/tags/app_namespace_management_api.py apollo_openapi/apis/tags/cluster_management_api.py @@ -16,26 +17,31 @@ apollo_openapi/apis/tags/namespace_branch_management_api.py apollo_openapi/apis/tags/namespace_lock_management_api.py apollo_openapi/apis/tags/namespace_management_api.py apollo_openapi/apis/tags/organization_management_api.py +apollo_openapi/apis/tags/permission_management_api.py apollo_openapi/apis/tags/release_management_api.py apollo_openapi/configuration.py apollo_openapi/exceptions.py apollo_openapi/model/__init__.py apollo_openapi/model/exception_response.py apollo_openapi/model/exception_response.pyi -apollo_openapi/model/kv_entity.py -apollo_openapi/model/kv_entity.pyi apollo_openapi/model/map_string.py apollo_openapi/model/map_string.pyi apollo_openapi/model/namespace_gray_del_release_dto.py apollo_openapi/model/namespace_gray_del_release_dto.pyi apollo_openapi/model/namespace_release_dto.py apollo_openapi/model/namespace_release_dto.pyi +apollo_openapi/model/open_access_key_dto.py +apollo_openapi/model/open_access_key_dto.pyi apollo_openapi/model/open_app_dto.py apollo_openapi/model/open_app_dto.pyi apollo_openapi/model/open_app_namespace_dto.py apollo_openapi/model/open_app_namespace_dto.pyi +apollo_openapi/model/open_app_role_user_dto.py +apollo_openapi/model/open_app_role_user_dto.pyi 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_create_app_dto.py apollo_openapi/model/open_create_app_dto.pyi apollo_openapi/model/open_create_item_dto.py @@ -46,6 +52,8 @@ apollo_openapi/model/open_env_cluster_dto.py apollo_openapi/model/open_env_cluster_dto.pyi apollo_openapi/model/open_env_cluster_info.py apollo_openapi/model/open_env_cluster_info.pyi +apollo_openapi/model/open_env_namespace_role_user_dto.py +apollo_openapi/model/open_env_namespace_role_user_dto.pyi apollo_openapi/model/open_gray_release_rule_dto.py apollo_openapi/model/open_gray_release_rule_dto.pyi apollo_openapi/model/open_gray_release_rule_item_dto.py @@ -76,6 +84,8 @@ apollo_openapi/model/open_namespace_identifier.py apollo_openapi/model/open_namespace_identifier.pyi apollo_openapi/model/open_namespace_lock_dto.py apollo_openapi/model/open_namespace_lock_dto.pyi +apollo_openapi/model/open_namespace_role_user_dto.py +apollo_openapi/model/open_namespace_role_user_dto.pyi apollo_openapi/model/open_namespace_sync_dto.py apollo_openapi/model/open_namespace_sync_dto.pyi apollo_openapi/model/open_namespace_text_model.py @@ -84,15 +94,22 @@ apollo_openapi/model/open_namespace_usage_dto.py apollo_openapi/model/open_namespace_usage_dto.pyi apollo_openapi/model/open_organization_dto.py apollo_openapi/model/open_organization_dto.pyi -apollo_openapi/model/open_release_bo.py -apollo_openapi/model/open_release_bo.pyi +apollo_openapi/model/open_permission_condition_dto.py +apollo_openapi/model/open_permission_condition_dto.pyi +apollo_openapi/model/open_release_change_dto.py +apollo_openapi/model/open_release_change_dto.pyi +apollo_openapi/model/open_release_diff_dto.py +apollo_openapi/model/open_release_diff_dto.pyi apollo_openapi/model/open_release_dto.py apollo_openapi/model/open_release_dto.pyi +apollo_openapi/model/open_user_info_dto.py +apollo_openapi/model/open_user_info_dto.pyi apollo_openapi/model/string_to_string_bool_map.py apollo_openapi/model/string_to_string_bool_map.pyi apollo_openapi/models/__init__.py apollo_openapi/rest.py apollo_openapi/schemas.py +docs/apis/tags/AccessKeyManagementApi.md docs/apis/tags/AppManagementApi.md docs/apis/tags/AppNamespaceManagementApi.md docs/apis/tags/ClusterManagementApi.md @@ -103,20 +120,24 @@ docs/apis/tags/NamespaceBranchManagementApi.md docs/apis/tags/NamespaceLockManagementApi.md docs/apis/tags/NamespaceManagementApi.md docs/apis/tags/OrganizationManagementApi.md +docs/apis/tags/PermissionManagementApi.md docs/apis/tags/ReleaseManagementApi.md docs/models/ExceptionResponse.md -docs/models/KVEntity.md docs/models/MapString.md docs/models/NamespaceGrayDelReleaseDTO.md docs/models/NamespaceReleaseDTO.md +docs/models/OpenAccessKeyDTO.md docs/models/OpenAppDTO.md docs/models/OpenAppNamespaceDTO.md +docs/models/OpenAppRoleUserDTO.md docs/models/OpenClusterDTO.md +docs/models/OpenClusterNamespaceRoleUserDTO.md docs/models/OpenCreateAppDTO.md docs/models/OpenCreateItemDTO.md docs/models/OpenCreateNamespaceDTO.md docs/models/OpenEnvClusterDTO.md docs/models/OpenEnvClusterInfo.md +docs/models/OpenEnvNamespaceRoleUserDTO.md docs/models/OpenGrayReleaseRuleDTO.md docs/models/OpenGrayReleaseRuleItemDTO.md docs/models/OpenInstanceConfigDTO.md @@ -132,12 +153,16 @@ docs/models/OpenNamespaceDTO.md docs/models/OpenNamespaceExtendDTO.md docs/models/OpenNamespaceIdentifier.md docs/models/OpenNamespaceLockDTO.md +docs/models/OpenNamespaceRoleUserDTO.md docs/models/OpenNamespaceSyncDTO.md docs/models/OpenNamespaceTextModel.md docs/models/OpenNamespaceUsageDTO.md docs/models/OpenOrganizationDto.md -docs/models/OpenReleaseBO.md +docs/models/OpenPermissionConditionDTO.md +docs/models/OpenReleaseChangeDTO.md docs/models/OpenReleaseDTO.md +docs/models/OpenReleaseDiffDTO.md +docs/models/OpenUserInfoDTO.md docs/models/StringToStringBoolMap.md git_push.sh requirements.txt @@ -147,18 +172,21 @@ test-requirements.txt test/__init__.py test/test_models/__init__.py test/test_models/test_exception_response.py -test/test_models/test_kv_entity.py test/test_models/test_map_string.py test/test_models/test_namespace_gray_del_release_dto.py test/test_models/test_namespace_release_dto.py +test/test_models/test_open_access_key_dto.py test/test_models/test_open_app_dto.py 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_create_app_dto.py test/test_models/test_open_create_item_dto.py test/test_models/test_open_create_namespace_dto.py test/test_models/test_open_env_cluster_dto.py test/test_models/test_open_env_cluster_info.py +test/test_models/test_open_env_namespace_role_user_dto.py test/test_models/test_open_gray_release_rule_dto.py test/test_models/test_open_gray_release_rule_item_dto.py test/test_models/test_open_instance_config_dto.py @@ -174,11 +202,15 @@ test/test_models/test_open_namespace_dto.py test/test_models/test_open_namespace_extend_dto.py test/test_models/test_open_namespace_identifier.py test/test_models/test_open_namespace_lock_dto.py +test/test_models/test_open_namespace_role_user_dto.py test/test_models/test_open_namespace_sync_dto.py test/test_models/test_open_namespace_text_model.py test/test_models/test_open_namespace_usage_dto.py test/test_models/test_open_organization_dto.py -test/test_models/test_open_release_bo.py +test/test_models/test_open_permission_condition_dto.py +test/test_models/test_open_release_change_dto.py +test/test_models/test_open_release_diff_dto.py test/test_models/test_open_release_dto.py +test/test_models/test_open_user_info_dto.py test/test_models/test_string_to_string_bool_map.py tox.ini diff --git a/python/README.md b/python/README.md index 4abc575..b9fedd0 100644 --- a/python/README.md +++ b/python/README.md @@ -155,13 +155,8 @@ Please follow the [installation procedure](#installation--usage) and then run th import time import apollo_openapi from pprint import pprint -from apollo_openapi.apis.tags import app_management_api -from apollo_openapi.model.exception_response import ExceptionResponse -from apollo_openapi.model.open_app_dto import OpenAppDTO -from apollo_openapi.model.open_create_app_dto import OpenCreateAppDTO -from apollo_openapi.model.open_env_cluster_dto import OpenEnvClusterDTO -from apollo_openapi.model.open_env_cluster_info import OpenEnvClusterInfo -from apollo_openapi.model.open_miss_env_dto import OpenMissEnvDTO +from apollo_openapi.apis.tags import access_key_management_api +from apollo_openapi.model.open_access_key_dto import OpenAccessKeyDTO # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = apollo_openapi.Configuration( @@ -182,33 +177,17 @@ configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' # Enter a context with an instance of the API client with apollo_openapi.ApiClient(configuration) as api_client: # Create an instance of the API class - api_instance = app_management_api.AppManagementApi(api_client) - open_create_app_dto = OpenCreateAppDTO( - assign_app_role_to_self=True, - admins=[ - "admins_example" - ], - app=OpenAppDTO( - data_change_created_by="data_change_created_by_example", - data_change_last_modified_by="data_change_last_modified_by_example", - data_change_created_time="2025-09-29T12:34:56Z", - data_change_last_modified_time="2025-09-29T12:34:56Z", - name="name_example", - app_id="app_id_example", - org_id="org_id_example", - org_name="org_name_example", - owner_name="owner_name_example", - owner_email="owner_email_example", - owner_display_name="owner_display_name_example", - ), - ) # OpenCreateAppDTO | + api_instance = access_key_management_api.AccessKeyManagementApi(api_client) + app_id = "appId_example" # str | +env = "env_example" # str | +operator = "operator_example" # str | (optional) try: - # 创建应用 (original openapi) - api_response = api_instance.create_app(open_create_app_dto) + # 创建AccessKey + api_response = api_instance.create_access_key(app_idenvoperator=operator) pprint(api_response) except apollo_openapi.ApiException as e: - print("Exception when calling AppManagementApi->create_app: %s\n" % e) + print("Exception when calling AccessKeyManagementApi->create_access_key: %s\n" % e) ``` ## Documentation for API Endpoints @@ -217,6 +196,11 @@ All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AccessKeyManagementApi* | [**create_access_key**](docs/apis/tags/AccessKeyManagementApi.md#create_access_key) | **post** /openapi/v1/apps/{appId}/envs/{env}/accesskeys | 创建AccessKey +*AccessKeyManagementApi* | [**delete_access_key**](docs/apis/tags/AccessKeyManagementApi.md#delete_access_key) | **delete** /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId} | 删除AccessKey +*AccessKeyManagementApi* | [**disable_access_key**](docs/apis/tags/AccessKeyManagementApi.md#disable_access_key) | **put** /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation | 禁用AccessKey +*AccessKeyManagementApi* | [**enable_access_key**](docs/apis/tags/AccessKeyManagementApi.md#enable_access_key) | **put** /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/activation | 启用AccessKey +*AccessKeyManagementApi* | [**find_access_keys**](docs/apis/tags/AccessKeyManagementApi.md#find_access_keys) | **get** /openapi/v1/apps/{appId}/envs/{env}/accesskeys | 查找AccessKey *AppManagementApi* | [**create_app**](docs/apis/tags/AppManagementApi.md#create_app) | **post** /openapi/v1/apps | 创建应用 (original openapi) *AppManagementApi* | [**create_app_in_env**](docs/apis/tags/AppManagementApi.md#create_app_in_env) | **post** /openapi/v1/apps/envs/{env} | 在指定环境创建应用(new added) *AppManagementApi* | [**delete_app**](docs/apis/tags/AppManagementApi.md#delete_app) | **delete** /openapi/v1/apps/{appId} | 删除应用(new added) @@ -275,11 +259,37 @@ Class | Method | HTTP request | Description *NamespaceManagementApi* | [**find_public_namespace_for_associated_namespace**](docs/apis/tags/NamespaceManagementApi.md#find_public_namespace_for_associated_namespace) | **get** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/associated-public-namespace | 查询关联Namespace对应的公共Namespace详情 (new added) *NamespaceManagementApi* | [**get_namespaces_release_status**](docs/apis/tags/NamespaceManagementApi.md#get_namespaces_release_status) | **get** /openapi/v1/apps/{appId}/namespaces/releases/status | 获取应用下所有Namespace的发布状态 (new added) *OrganizationManagementApi* | [**get_organization**](docs/apis/tags/OrganizationManagementApi.md#get_organization) | **get** /openapi/v1/organizations | 获取所有组织信息 (original openapi) +*PermissionManagementApi* | [**add_create_application_role_to_users**](docs/apis/tags/PermissionManagementApi.md#add_create_application_role_to_users) | **post** /openapi/v1/system/roles/create-application | 分配建应用角色 (new added) +*PermissionManagementApi* | [**add_manage_app_master_role_to_user**](docs/apis/tags/PermissionManagementApi.md#add_manage_app_master_role_to_user) | **post** /openapi/v1/apps/{appId}/roles/master | 分配AppMaster (new added) +*PermissionManagementApi* | [**assign_app_role_to_user**](docs/apis/tags/PermissionManagementApi.md#assign_app_role_to_user) | **post** /openapi/v1/apps/{appId}/roles/{roleType} | 分配应用角色 (new added) +*PermissionManagementApi* | [**assign_cluster_namespace_role_to_user**](docs/apis/tags/PermissionManagementApi.md#assign_cluster_namespace_role_to_user) | **post** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType} | 分配集群Namespace角色 (new added) +*PermissionManagementApi* | [**assign_namespace_env_role_to_user**](docs/apis/tags/PermissionManagementApi.md#assign_namespace_env_role_to_user) | **post** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType} | 分配环境Namespace角色 (new added) +*PermissionManagementApi* | [**assign_namespace_role_to_user**](docs/apis/tags/PermissionManagementApi.md#assign_namespace_role_to_user) | **post** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType} | 分配Namespace角色 (new added) +*PermissionManagementApi* | [**delete_create_application_role_from_user**](docs/apis/tags/PermissionManagementApi.md#delete_create_application_role_from_user) | **delete** /openapi/v1/system/roles/create-application | 移除建应用角色 (new added) +*PermissionManagementApi* | [**get_app_roles**](docs/apis/tags/PermissionManagementApi.md#get_app_roles) | **get** /openapi/v1/apps/{appId}/role-users | 获取应用角色用户 (new added) +*PermissionManagementApi* | [**get_cluster_namespace_roles**](docs/apis/tags/PermissionManagementApi.md#get_cluster_namespace_roles) | **get** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/role-users | 获取集群Namespace用户 (new added) +*PermissionManagementApi* | [**get_create_application_role_users**](docs/apis/tags/PermissionManagementApi.md#get_create_application_role_users) | **get** /openapi/v1/system/roles/create-application/role-users | 获取建应用用户 (new added) +*PermissionManagementApi* | [**get_namespace_env_role_users**](docs/apis/tags/PermissionManagementApi.md#get_namespace_env_role_users) | **get** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/role-users | 获取环境Namespace用户 (new added) +*PermissionManagementApi* | [**get_namespace_roles**](docs/apis/tags/PermissionManagementApi.md#get_namespace_roles) | **get** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/role-users | 获取Namespace用户 (new added) +*PermissionManagementApi* | [**has_app_permission**](docs/apis/tags/PermissionManagementApi.md#has_app_permission) | **get** /openapi/v1/apps/{appId}/permissions/{permissionType} | 校验应用权限 (new added) +*PermissionManagementApi* | [**has_cluster_namespace_permission**](docs/apis/tags/PermissionManagementApi.md#has_cluster_namespace_permission) | **get** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permissions/{permissionType} | 校验集群Namespace权限 (new added) +*PermissionManagementApi* | [**has_create_application_permission**](docs/apis/tags/PermissionManagementApi.md#has_create_application_permission) | **get** /openapi/v1/system/roles/create-application | 校验建应用权限 (new added) +*PermissionManagementApi* | [**has_env_namespace_permission**](docs/apis/tags/PermissionManagementApi.md#has_env_namespace_permission) | **get** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/permissions/{permissionType} | 校验环境Namespace权限 (new added) +*PermissionManagementApi* | [**has_namespace_permission**](docs/apis/tags/PermissionManagementApi.md#has_namespace_permission) | **get** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permissions/{permissionType} | 校验Namespace权限 (new added) +*PermissionManagementApi* | [**has_root_permission**](docs/apis/tags/PermissionManagementApi.md#has_root_permission) | **get** /openapi/v1/permissions/root | 校验Root权限 (new added) +*PermissionManagementApi* | [**init_app_permission**](docs/apis/tags/PermissionManagementApi.md#init_app_permission) | **post** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init | 初始化应用权限 (new added) +*PermissionManagementApi* | [**init_cluster_namespace_permission**](docs/apis/tags/PermissionManagementApi.md#init_cluster_namespace_permission) | **post** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permission-init | 初始化集群Namespace权限 (new added) +*PermissionManagementApi* | [**is_manage_app_master_permission_enabled**](docs/apis/tags/PermissionManagementApi.md#is_manage_app_master_permission_enabled) | **get** /openapi/v1/system/role/manage-app-master | 校验AppMaster开关 (new added) +*PermissionManagementApi* | [**remove_app_role_from_user**](docs/apis/tags/PermissionManagementApi.md#remove_app_role_from_user) | **delete** /openapi/v1/apps/{appId}/roles/{roleType} | 移除应用角色 (new added) +*PermissionManagementApi* | [**remove_cluster_namespace_role_from_user**](docs/apis/tags/PermissionManagementApi.md#remove_cluster_namespace_role_from_user) | **delete** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType} | 移除集群Namespace角色 (new added) +*PermissionManagementApi* | [**remove_manage_app_master_role_from_user**](docs/apis/tags/PermissionManagementApi.md#remove_manage_app_master_role_from_user) | **delete** /openapi/v1/apps/{appId}/roles/master | 移除AppMaster (new added) +*PermissionManagementApi* | [**remove_namespace_env_role_from_user**](docs/apis/tags/PermissionManagementApi.md#remove_namespace_env_role_from_user) | **delete** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType} | 移除环境Namespace角色 (new added) +*PermissionManagementApi* | [**remove_namespace_role_from_user**](docs/apis/tags/PermissionManagementApi.md#remove_namespace_role_from_user) | **delete** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType} | 移除Namespace角色 (new added) +*ReleaseManagementApi* | [**compare_release**](docs/apis/tags/ReleaseManagementApi.md#compare_release) | **get** /openapi/v1/envs/{env}/releases/comparison | Compare two releases *ReleaseManagementApi* | [**create_gray_del_release**](docs/apis/tags/ReleaseManagementApi.md#create_gray_del_release) | **post** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/gray-del-releases | 创建灰度删除发布 (original openapi) *ReleaseManagementApi* | [**create_gray_release**](docs/apis/tags/ReleaseManagementApi.md#create_gray_release) | **post** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/releases | 创建灰度发布 (original openapi) *ReleaseManagementApi* | [**create_release**](docs/apis/tags/ReleaseManagementApi.md#create_release) | **post** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases | 创建发布 (original openapi) *ReleaseManagementApi* | [**find_active_releases**](docs/apis/tags/ReleaseManagementApi.md#find_active_releases) | **get** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active | 获取活跃发布(分页) (new added) -*ReleaseManagementApi* | [**find_all_releases**](docs/apis/tags/ReleaseManagementApi.md#find_all_releases) | **get** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all | 获取所有发布(分页) (new added) *ReleaseManagementApi* | [**get_release_by_id**](docs/apis/tags/ReleaseManagementApi.md#get_release_by_id) | **get** /openapi/v1/envs/{env}/releases/{releaseId} | 获取发布详情 (new added) *ReleaseManagementApi* | [**load_latest_active_release**](docs/apis/tags/ReleaseManagementApi.md#load_latest_active_release) | **get** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/latest | 获取最新活跃发布 (original openapi) *ReleaseManagementApi* | [**rollback**](docs/apis/tags/ReleaseManagementApi.md#rollback) | **put** /openapi/v1/envs/{env}/releases/{releaseId}/rollback | 回滚发布 (original openapi) @@ -287,18 +297,21 @@ Class | Method | HTTP request | Description ## Documentation For Models - [ExceptionResponse](docs/models/ExceptionResponse.md) - - [KVEntity](docs/models/KVEntity.md) - [MapString](docs/models/MapString.md) - [NamespaceGrayDelReleaseDTO](docs/models/NamespaceGrayDelReleaseDTO.md) - [NamespaceReleaseDTO](docs/models/NamespaceReleaseDTO.md) + - [OpenAccessKeyDTO](docs/models/OpenAccessKeyDTO.md) - [OpenAppDTO](docs/models/OpenAppDTO.md) - [OpenAppNamespaceDTO](docs/models/OpenAppNamespaceDTO.md) + - [OpenAppRoleUserDTO](docs/models/OpenAppRoleUserDTO.md) - [OpenClusterDTO](docs/models/OpenClusterDTO.md) + - [OpenClusterNamespaceRoleUserDTO](docs/models/OpenClusterNamespaceRoleUserDTO.md) - [OpenCreateAppDTO](docs/models/OpenCreateAppDTO.md) - [OpenCreateItemDTO](docs/models/OpenCreateItemDTO.md) - [OpenCreateNamespaceDTO](docs/models/OpenCreateNamespaceDTO.md) - [OpenEnvClusterDTO](docs/models/OpenEnvClusterDTO.md) - [OpenEnvClusterInfo](docs/models/OpenEnvClusterInfo.md) + - [OpenEnvNamespaceRoleUserDTO](docs/models/OpenEnvNamespaceRoleUserDTO.md) - [OpenGrayReleaseRuleDTO](docs/models/OpenGrayReleaseRuleDTO.md) - [OpenGrayReleaseRuleItemDTO](docs/models/OpenGrayReleaseRuleItemDTO.md) - [OpenInstanceConfigDTO](docs/models/OpenInstanceConfigDTO.md) @@ -314,12 +327,16 @@ Class | Method | HTTP request | Description - [OpenNamespaceExtendDTO](docs/models/OpenNamespaceExtendDTO.md) - [OpenNamespaceIdentifier](docs/models/OpenNamespaceIdentifier.md) - [OpenNamespaceLockDTO](docs/models/OpenNamespaceLockDTO.md) + - [OpenNamespaceRoleUserDTO](docs/models/OpenNamespaceRoleUserDTO.md) - [OpenNamespaceSyncDTO](docs/models/OpenNamespaceSyncDTO.md) - [OpenNamespaceTextModel](docs/models/OpenNamespaceTextModel.md) - [OpenNamespaceUsageDTO](docs/models/OpenNamespaceUsageDTO.md) - [OpenOrganizationDto](docs/models/OpenOrganizationDto.md) - - [OpenReleaseBO](docs/models/OpenReleaseBO.md) + - [OpenPermissionConditionDTO](docs/models/OpenPermissionConditionDTO.md) + - [OpenReleaseChangeDTO](docs/models/OpenReleaseChangeDTO.md) - [OpenReleaseDTO](docs/models/OpenReleaseDTO.md) + - [OpenReleaseDiffDTO](docs/models/OpenReleaseDiffDTO.md) + - [OpenUserInfoDTO](docs/models/OpenUserInfoDTO.md) - [StringToStringBoolMap](docs/models/StringToStringBoolMap.md) ## Documentation For Authorization @@ -347,6 +364,8 @@ Authentication schemes defined for the API: + + ## Notes for Large OpenAPI documents If the OpenAPI document is large, imports in apollo_openapi.apis and apollo_openapi.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: diff --git a/python/apollo_openapi/apis/path_to_api.py b/python/apollo_openapi/apis/path_to_api.py index 4969214..c4d49df 100644 --- a/python/apollo_openapi/apis/path_to_api.py +++ b/python/apollo_openapi/apis/path_to_api.py @@ -26,8 +26,8 @@ from apollo_openapi.apis.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_gray_del_releases import OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameBranchesBranchNameGrayDelReleases from apollo_openapi.apis.paths.openapi_v1_envs_env_releases_release_id_rollback import OpenapiV1EnvsEnvReleasesReleaseIdRollback from apollo_openapi.apis.paths.openapi_v1_envs_env_releases_release_id import OpenapiV1EnvsEnvReleasesReleaseId -from apollo_openapi.apis.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all import OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameReleasesAll from apollo_openapi.apis.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_active import OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameReleasesActive +from apollo_openapi.apis.paths.openapi_v1_envs_env_releases_comparison import OpenapiV1EnvsEnvReleasesComparison from apollo_openapi.apis.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_instances import OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameInstances from apollo_openapi.apis.paths.openapi_v1_envs_env_instances_by_release import OpenapiV1EnvsEnvInstancesByRelease from apollo_openapi.apis.paths.openapi_v1_envs_env_instances_by_namespace import OpenapiV1EnvsEnvInstancesByNamespace @@ -51,6 +51,29 @@ from apollo_openapi.apis.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name import OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameBranchesBranchName from apollo_openapi.apis.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_rules import OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameBranchesBranchNameRules from apollo_openapi.apis.paths.openapi_v1_envs import OpenapiV1Envs +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_namespaces_namespace_name_permission_init import OpenapiV1AppsAppIdNamespacesNamespaceNamePermissionInit +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init import OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesPermissionInit +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_permissions_permission_type import OpenapiV1AppsAppIdPermissionsPermissionType +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type import OpenapiV1AppsAppIdNamespacesNamespaceNamePermissionsPermissionType +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type import OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNamePermissionsPermissionType +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type import OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesPermissionsPermissionType +from apollo_openapi.apis.paths.openapi_v1_permissions_root import OpenapiV1PermissionsRoot +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users import OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRoleUsers +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type import OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRolesRoleType +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users import OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesRoleUsers +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type import OpenapiV1AppsAppIdEnvsEnvClustersClusterNameRolesRoleType +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_namespaces_namespace_name_role_users import OpenapiV1AppsAppIdNamespacesNamespaceNameRoleUsers +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type import OpenapiV1AppsAppIdNamespacesNamespaceNameRolesRoleType +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_role_users import OpenapiV1AppsAppIdRoleUsers +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_roles_role_type import OpenapiV1AppsAppIdRolesRoleType +from apollo_openapi.apis.paths.openapi_v1_system_roles_create_application import OpenapiV1SystemRolesCreateApplication +from apollo_openapi.apis.paths.openapi_v1_system_roles_create_application_role_users import OpenapiV1SystemRolesCreateApplicationRoleUsers +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_roles_master import OpenapiV1AppsAppIdRolesMaster +from apollo_openapi.apis.paths.openapi_v1_system_role_manage_app_master import OpenapiV1SystemRoleManageAppMaster +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_envs_env_accesskeys import OpenapiV1AppsAppIdEnvsEnvAccesskeys +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id import OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyId +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation import OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyIdActivation +from apollo_openapi.apis.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation import OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyIdDeactivation PathToApi = typing_extensions.TypedDict( 'PathToApi', @@ -80,8 +103,8 @@ PathValues.OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_BRANCHES_BRANCH_NAME_GRAYDELRELEASES: OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameBranchesBranchNameGrayDelReleases, PathValues.OPENAPI_V1_ENVS_ENV_RELEASES_RELEASE_ID_ROLLBACK: OpenapiV1EnvsEnvReleasesReleaseIdRollback, PathValues.OPENAPI_V1_ENVS_ENV_RELEASES_RELEASE_ID: OpenapiV1EnvsEnvReleasesReleaseId, - PathValues.OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_RELEASES_ALL: OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameReleasesAll, PathValues.OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_RELEASES_ACTIVE: OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameReleasesActive, + PathValues.OPENAPI_V1_ENVS_ENV_RELEASES_COMPARISON: OpenapiV1EnvsEnvReleasesComparison, PathValues.OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_INSTANCES: OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameInstances, PathValues.OPENAPI_V1_ENVS_ENV_INSTANCES_BYRELEASE: OpenapiV1EnvsEnvInstancesByRelease, PathValues.OPENAPI_V1_ENVS_ENV_INSTANCES_BYNAMESPACE: OpenapiV1EnvsEnvInstancesByNamespace, @@ -105,6 +128,29 @@ PathValues.OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_BRANCHES_BRANCH_NAME: OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameBranchesBranchName, PathValues.OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_BRANCHES_BRANCH_NAME_RULES: OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameBranchesBranchNameRules, PathValues.OPENAPI_V1_ENVS: OpenapiV1Envs, + PathValues.OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_PERMISSIONINIT: OpenapiV1AppsAppIdNamespacesNamespaceNamePermissionInit, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_NAMESPACES_PERMISSIONINIT: OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesPermissionInit, + PathValues.OPENAPI_V1_APPS_APP_ID_PERMISSIONS_PERMISSION_TYPE: OpenapiV1AppsAppIdPermissionsPermissionType, + PathValues.OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_PERMISSIONS_PERMISSION_TYPE: OpenapiV1AppsAppIdNamespacesNamespaceNamePermissionsPermissionType, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_NAMESPACES_NAMESPACE_NAME_PERMISSIONS_PERMISSION_TYPE: OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNamePermissionsPermissionType, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_NAMESPACES_PERMISSIONS_PERMISSION_TYPE: OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesPermissionsPermissionType, + PathValues.OPENAPI_V1_PERMISSIONS_ROOT: OpenapiV1PermissionsRoot, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_NAMESPACES_NAMESPACE_NAME_ROLEUSERS: OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRoleUsers, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_NAMESPACES_NAMESPACE_NAME_ROLES_ROLE_TYPE: OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRolesRoleType, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_NAMESPACES_ROLEUSERS: OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesRoleUsers, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_ROLES_ROLE_TYPE: OpenapiV1AppsAppIdEnvsEnvClustersClusterNameRolesRoleType, + PathValues.OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_ROLEUSERS: OpenapiV1AppsAppIdNamespacesNamespaceNameRoleUsers, + PathValues.OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_ROLES_ROLE_TYPE: OpenapiV1AppsAppIdNamespacesNamespaceNameRolesRoleType, + PathValues.OPENAPI_V1_APPS_APP_ID_ROLEUSERS: OpenapiV1AppsAppIdRoleUsers, + PathValues.OPENAPI_V1_APPS_APP_ID_ROLES_ROLE_TYPE: OpenapiV1AppsAppIdRolesRoleType, + PathValues.OPENAPI_V1_SYSTEM_ROLES_CREATEAPPLICATION: OpenapiV1SystemRolesCreateApplication, + PathValues.OPENAPI_V1_SYSTEM_ROLES_CREATEAPPLICATION_ROLEUSERS: OpenapiV1SystemRolesCreateApplicationRoleUsers, + PathValues.OPENAPI_V1_APPS_APP_ID_ROLES_MASTER: OpenapiV1AppsAppIdRolesMaster, + PathValues.OPENAPI_V1_SYSTEM_ROLE_MANAGEAPPMASTER: OpenapiV1SystemRoleManageAppMaster, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS: OpenapiV1AppsAppIdEnvsEnvAccesskeys, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS_ACCESS_KEY_ID: OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyId, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS_ACCESS_KEY_ID_ACTIVATION: OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyIdActivation, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS_ACCESS_KEY_ID_DEACTIVATION: OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyIdDeactivation, } ) @@ -135,8 +181,8 @@ PathValues.OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_BRANCHES_BRANCH_NAME_GRAYDELRELEASES: OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameBranchesBranchNameGrayDelReleases, PathValues.OPENAPI_V1_ENVS_ENV_RELEASES_RELEASE_ID_ROLLBACK: OpenapiV1EnvsEnvReleasesReleaseIdRollback, PathValues.OPENAPI_V1_ENVS_ENV_RELEASES_RELEASE_ID: OpenapiV1EnvsEnvReleasesReleaseId, - PathValues.OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_RELEASES_ALL: OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameReleasesAll, PathValues.OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_RELEASES_ACTIVE: OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameReleasesActive, + PathValues.OPENAPI_V1_ENVS_ENV_RELEASES_COMPARISON: OpenapiV1EnvsEnvReleasesComparison, PathValues.OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_INSTANCES: OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameInstances, PathValues.OPENAPI_V1_ENVS_ENV_INSTANCES_BYRELEASE: OpenapiV1EnvsEnvInstancesByRelease, PathValues.OPENAPI_V1_ENVS_ENV_INSTANCES_BYNAMESPACE: OpenapiV1EnvsEnvInstancesByNamespace, @@ -160,5 +206,28 @@ PathValues.OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_BRANCHES_BRANCH_NAME: OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameBranchesBranchName, PathValues.OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_BRANCHES_BRANCH_NAME_RULES: OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameBranchesBranchNameRules, PathValues.OPENAPI_V1_ENVS: OpenapiV1Envs, + PathValues.OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_PERMISSIONINIT: OpenapiV1AppsAppIdNamespacesNamespaceNamePermissionInit, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_NAMESPACES_PERMISSIONINIT: OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesPermissionInit, + PathValues.OPENAPI_V1_APPS_APP_ID_PERMISSIONS_PERMISSION_TYPE: OpenapiV1AppsAppIdPermissionsPermissionType, + PathValues.OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_PERMISSIONS_PERMISSION_TYPE: OpenapiV1AppsAppIdNamespacesNamespaceNamePermissionsPermissionType, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_NAMESPACES_NAMESPACE_NAME_PERMISSIONS_PERMISSION_TYPE: OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNamePermissionsPermissionType, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_NAMESPACES_PERMISSIONS_PERMISSION_TYPE: OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesPermissionsPermissionType, + PathValues.OPENAPI_V1_PERMISSIONS_ROOT: OpenapiV1PermissionsRoot, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_NAMESPACES_NAMESPACE_NAME_ROLEUSERS: OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRoleUsers, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_NAMESPACES_NAMESPACE_NAME_ROLES_ROLE_TYPE: OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRolesRoleType, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_NAMESPACES_ROLEUSERS: OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesRoleUsers, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_ROLES_ROLE_TYPE: OpenapiV1AppsAppIdEnvsEnvClustersClusterNameRolesRoleType, + PathValues.OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_ROLEUSERS: OpenapiV1AppsAppIdNamespacesNamespaceNameRoleUsers, + PathValues.OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_ROLES_ROLE_TYPE: OpenapiV1AppsAppIdNamespacesNamespaceNameRolesRoleType, + PathValues.OPENAPI_V1_APPS_APP_ID_ROLEUSERS: OpenapiV1AppsAppIdRoleUsers, + PathValues.OPENAPI_V1_APPS_APP_ID_ROLES_ROLE_TYPE: OpenapiV1AppsAppIdRolesRoleType, + PathValues.OPENAPI_V1_SYSTEM_ROLES_CREATEAPPLICATION: OpenapiV1SystemRolesCreateApplication, + PathValues.OPENAPI_V1_SYSTEM_ROLES_CREATEAPPLICATION_ROLEUSERS: OpenapiV1SystemRolesCreateApplicationRoleUsers, + PathValues.OPENAPI_V1_APPS_APP_ID_ROLES_MASTER: OpenapiV1AppsAppIdRolesMaster, + PathValues.OPENAPI_V1_SYSTEM_ROLE_MANAGEAPPMASTER: OpenapiV1SystemRoleManageAppMaster, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS: OpenapiV1AppsAppIdEnvsEnvAccesskeys, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS_ACCESS_KEY_ID: OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyId, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS_ACCESS_KEY_ID_ACTIVATION: OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyIdActivation, + PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS_ACCESS_KEY_ID_DEACTIVATION: OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyIdDeactivation, } ) diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys.py new file mode 100644 index 0000000..e8bf4cc --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys.py @@ -0,0 +1,9 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys.get import ApiForget +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys.post import ApiForpost + + +class OpenapiV1AppsAppIdEnvsEnvAccesskeys( + ApiForget, + ApiForpost, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id.py new file mode 100644 index 0000000..0c84f84 --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id.delete import ApiFordelete + + +class OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyId( + ApiFordelete, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation.py new file mode 100644 index 0000000..4fd84ab --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation.put import ApiForput + + +class OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyIdActivation( + ApiForput, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation.py new file mode 100644 index 0000000..ffceb68 --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation.put import ApiForput + + +class OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyIdDeactivation( + ApiForput, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init.py new file mode 100644 index 0000000..8f167e8 --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init.post import ApiForpost + + +class OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesPermissionInit( + ApiForpost, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type.py new file mode 100644 index 0000000..35489f7 --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type.get import ApiForget + + +class OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesPermissionsPermissionType( + ApiForget, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users.py new file mode 100644 index 0000000..1944926 --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users.get import ApiForget + + +class OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesRoleUsers( + ApiForget, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type.py new file mode 100644 index 0000000..b1e9ba9 --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type.py @@ -0,0 +1,9 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type.post import ApiForpost +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type.delete import ApiFordelete + + +class OpenapiV1AppsAppIdEnvsEnvClustersClusterNameRolesRoleType( + ApiForpost, + ApiFordelete, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type.py new file mode 100644 index 0000000..118eb2b --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type.get import ApiForget + + +class OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNamePermissionsPermissionType( + ApiForget, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users.py new file mode 100644 index 0000000..f0c667f --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users.get import ApiForget + + +class OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRoleUsers( + ApiForget, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type.py new file mode 100644 index 0000000..495e3aa --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type.py @@ -0,0 +1,9 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type.post import ApiForpost +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type.delete import ApiFordelete + + +class OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRolesRoleType( + ApiForpost, + ApiFordelete, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init.py new file mode 100644 index 0000000..adca021 --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_permission_init.post import ApiForpost + + +class OpenapiV1AppsAppIdNamespacesNamespaceNamePermissionInit( + ApiForpost, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type.py new file mode 100644 index 0000000..3ae13e3 --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type.get import ApiForget + + +class OpenapiV1AppsAppIdNamespacesNamespaceNamePermissionsPermissionType( + ApiForget, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users.py new file mode 100644 index 0000000..7458cbc --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_role_users.get import ApiForget + + +class OpenapiV1AppsAppIdNamespacesNamespaceNameRoleUsers( + ApiForget, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type.py new file mode 100644 index 0000000..c307cea --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type.py @@ -0,0 +1,9 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type.post import ApiForpost +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type.delete import ApiFordelete + + +class OpenapiV1AppsAppIdNamespacesNamespaceNameRolesRoleType( + ApiForpost, + ApiFordelete, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_permissions_permission_type.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_permissions_permission_type.py new file mode 100644 index 0000000..def9aa7 --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_permissions_permission_type.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_permissions_permission_type.get import ApiForget + + +class OpenapiV1AppsAppIdPermissionsPermissionType( + ApiForget, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_role_users.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_role_users.py new file mode 100644 index 0000000..59bbea3 --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_role_users.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_role_users.get import ApiForget + + +class OpenapiV1AppsAppIdRoleUsers( + ApiForget, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_roles_master.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_roles_master.py new file mode 100644 index 0000000..e3301fb --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_roles_master.py @@ -0,0 +1,9 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_roles_master.post import ApiForpost +from apollo_openapi.paths.openapi_v1_apps_app_id_roles_master.delete import ApiFordelete + + +class OpenapiV1AppsAppIdRolesMaster( + ApiForpost, + ApiFordelete, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_roles_role_type.py b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_roles_role_type.py new file mode 100644 index 0000000..3a78e01 --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_apps_app_id_roles_role_type.py @@ -0,0 +1,9 @@ +from apollo_openapi.paths.openapi_v1_apps_app_id_roles_role_type.post import ApiForpost +from apollo_openapi.paths.openapi_v1_apps_app_id_roles_role_type.delete import ApiFordelete + + +class OpenapiV1AppsAppIdRolesRoleType( + ApiForpost, + ApiFordelete, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all.py b/python/apollo_openapi/apis/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all.py deleted file mode 100644 index da3e56e..0000000 --- a/python/apollo_openapi/apis/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all.py +++ /dev/null @@ -1,7 +0,0 @@ -from apollo_openapi.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all.get import ApiForget - - -class OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameReleasesAll( - ApiForget, -): - pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_envs_env_releases_comparison.py b/python/apollo_openapi/apis/paths/openapi_v1_envs_env_releases_comparison.py new file mode 100644 index 0000000..5639a2e --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_envs_env_releases_comparison.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_envs_env_releases_comparison.get import ApiForget + + +class OpenapiV1EnvsEnvReleasesComparison( + ApiForget, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_permissions_root.py b/python/apollo_openapi/apis/paths/openapi_v1_permissions_root.py new file mode 100644 index 0000000..2d4e48c --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_permissions_root.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_permissions_root.get import ApiForget + + +class OpenapiV1PermissionsRoot( + ApiForget, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_system_role_manage_app_master.py b/python/apollo_openapi/apis/paths/openapi_v1_system_role_manage_app_master.py new file mode 100644 index 0000000..9f5083b --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_system_role_manage_app_master.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_system_role_manage_app_master.get import ApiForget + + +class OpenapiV1SystemRoleManageAppMaster( + ApiForget, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_system_roles_create_application.py b/python/apollo_openapi/apis/paths/openapi_v1_system_roles_create_application.py new file mode 100644 index 0000000..2a432e0 --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_system_roles_create_application.py @@ -0,0 +1,11 @@ +from apollo_openapi.paths.openapi_v1_system_roles_create_application.get import ApiForget +from apollo_openapi.paths.openapi_v1_system_roles_create_application.post import ApiForpost +from apollo_openapi.paths.openapi_v1_system_roles_create_application.delete import ApiFordelete + + +class OpenapiV1SystemRolesCreateApplication( + ApiForget, + ApiForpost, + ApiFordelete, +): + pass diff --git a/python/apollo_openapi/apis/paths/openapi_v1_system_roles_create_application_role_users.py b/python/apollo_openapi/apis/paths/openapi_v1_system_roles_create_application_role_users.py new file mode 100644 index 0000000..1d96162 --- /dev/null +++ b/python/apollo_openapi/apis/paths/openapi_v1_system_roles_create_application_role_users.py @@ -0,0 +1,7 @@ +from apollo_openapi.paths.openapi_v1_system_roles_create_application_role_users.get import ApiForget + + +class OpenapiV1SystemRolesCreateApplicationRoleUsers( + ApiForget, +): + pass diff --git a/python/apollo_openapi/apis/tag_to_api.py b/python/apollo_openapi/apis/tag_to_api.py index b8607f6..249a36a 100644 --- a/python/apollo_openapi/apis/tag_to_api.py +++ b/python/apollo_openapi/apis/tag_to_api.py @@ -12,6 +12,8 @@ from apollo_openapi.apis.tags.instance_management_api import InstanceManagementApi from apollo_openapi.apis.tags.organization_management_api import OrganizationManagementApi from apollo_openapi.apis.tags.environment_management_api import EnvironmentManagementApi +from apollo_openapi.apis.tags.permission_management_api import PermissionManagementApi +from apollo_openapi.apis.tags.access_key_management_api import AccessKeyManagementApi TagToApi = typing_extensions.TypedDict( 'TagToApi', @@ -27,6 +29,8 @@ TagValues.INSTANCE_MANAGEMENT: InstanceManagementApi, TagValues.ORGANIZATION_MANAGEMENT: OrganizationManagementApi, TagValues.ENVIRONMENT_MANAGEMENT: EnvironmentManagementApi, + TagValues.PERMISSION_MANAGEMENT: PermissionManagementApi, + TagValues.ACCESS_KEY_MANAGEMENT: AccessKeyManagementApi, } ) @@ -43,5 +47,7 @@ TagValues.INSTANCE_MANAGEMENT: InstanceManagementApi, TagValues.ORGANIZATION_MANAGEMENT: OrganizationManagementApi, TagValues.ENVIRONMENT_MANAGEMENT: EnvironmentManagementApi, + TagValues.PERMISSION_MANAGEMENT: PermissionManagementApi, + TagValues.ACCESS_KEY_MANAGEMENT: AccessKeyManagementApi, } ) diff --git a/python/apollo_openapi/apis/tags/__init__.py b/python/apollo_openapi/apis/tags/__init__.py index 631942e..3134bf5 100644 --- a/python/apollo_openapi/apis/tags/__init__.py +++ b/python/apollo_openapi/apis/tags/__init__.py @@ -17,3 +17,5 @@ class TagValues(str, enum.Enum): INSTANCE_MANAGEMENT = "Instance Management" ORGANIZATION_MANAGEMENT = "Organization Management" ENVIRONMENT_MANAGEMENT = "Environment Management" + PERMISSION_MANAGEMENT = "Permission Management" + ACCESS_KEY_MANAGEMENT = "AccessKey Management" diff --git a/python/apollo_openapi/apis/tags/access_key_management_api.py b/python/apollo_openapi/apis/tags/access_key_management_api.py new file mode 100644 index 0000000..6b14fd4 --- /dev/null +++ b/python/apollo_openapi/apis/tags/access_key_management_api.py @@ -0,0 +1,31 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys.post import CreateAccessKey +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id.delete import DeleteAccessKey +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation.put import DisableAccessKey +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation.put import EnableAccessKey +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys.get import FindAccessKeys + + +class AccessKeyManagementApi( + CreateAccessKey, + DeleteAccessKey, + DisableAccessKey, + EnableAccessKey, + FindAccessKeys, +): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/python/apollo_openapi/apis/tags/permission_management_api.py b/python/apollo_openapi/apis/tags/permission_management_api.py new file mode 100644 index 0000000..64f8de9 --- /dev/null +++ b/python/apollo_openapi/apis/tags/permission_management_api.py @@ -0,0 +1,73 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +from apollo_openapi.paths.openapi_v1_system_roles_create_application.post import AddCreateApplicationRoleToUsers +from apollo_openapi.paths.openapi_v1_apps_app_id_roles_master.post import AddManageAppMasterRoleToUser +from apollo_openapi.paths.openapi_v1_apps_app_id_roles_role_type.post import AssignAppRoleToUser +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type.post import AssignClusterNamespaceRoleToUser +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type.post import AssignNamespaceEnvRoleToUser +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type.post import AssignNamespaceRoleToUser +from apollo_openapi.paths.openapi_v1_system_roles_create_application.delete import DeleteCreateApplicationRoleFromUser +from apollo_openapi.paths.openapi_v1_apps_app_id_role_users.get import GetAppRoles +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users.get import GetClusterNamespaceRoles +from apollo_openapi.paths.openapi_v1_system_roles_create_application_role_users.get import GetCreateApplicationRoleUsers +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users.get import GetNamespaceEnvRoleUsers +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_role_users.get import GetNamespaceRoles +from apollo_openapi.paths.openapi_v1_apps_app_id_permissions_permission_type.get import HasAppPermission +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type.get import HasClusterNamespacePermission +from apollo_openapi.paths.openapi_v1_system_roles_create_application.get import HasCreateApplicationPermission +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type.get import HasEnvNamespacePermission +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type.get import HasNamespacePermission +from apollo_openapi.paths.openapi_v1_permissions_root.get import HasRootPermission +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_permission_init.post import InitAppPermission +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init.post import InitClusterNamespacePermission +from apollo_openapi.paths.openapi_v1_system_role_manage_app_master.get import IsManageAppMasterPermissionEnabled +from apollo_openapi.paths.openapi_v1_apps_app_id_roles_role_type.delete import RemoveAppRoleFromUser +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type.delete import RemoveClusterNamespaceRoleFromUser +from apollo_openapi.paths.openapi_v1_apps_app_id_roles_master.delete import RemoveManageAppMasterRoleFromUser +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type.delete import RemoveNamespaceEnvRoleFromUser +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type.delete import RemoveNamespaceRoleFromUser + + +class PermissionManagementApi( + AddCreateApplicationRoleToUsers, + AddManageAppMasterRoleToUser, + AssignAppRoleToUser, + AssignClusterNamespaceRoleToUser, + AssignNamespaceEnvRoleToUser, + AssignNamespaceRoleToUser, + DeleteCreateApplicationRoleFromUser, + GetAppRoles, + GetClusterNamespaceRoles, + GetCreateApplicationRoleUsers, + GetNamespaceEnvRoleUsers, + GetNamespaceRoles, + HasAppPermission, + HasClusterNamespacePermission, + HasCreateApplicationPermission, + HasEnvNamespacePermission, + HasNamespacePermission, + HasRootPermission, + InitAppPermission, + InitClusterNamespacePermission, + IsManageAppMasterPermissionEnabled, + RemoveAppRoleFromUser, + RemoveClusterNamespaceRoleFromUser, + RemoveManageAppMasterRoleFromUser, + RemoveNamespaceEnvRoleFromUser, + RemoveNamespaceRoleFromUser, +): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + pass diff --git a/python/apollo_openapi/apis/tags/release_management_api.py b/python/apollo_openapi/apis/tags/release_management_api.py index b1b9e80..ed75117 100644 --- a/python/apollo_openapi/apis/tags/release_management_api.py +++ b/python/apollo_openapi/apis/tags/release_management_api.py @@ -9,22 +9,22 @@ Generated by: https://openapi-generator.tech """ +from apollo_openapi.paths.openapi_v1_envs_env_releases_comparison.get import CompareRelease from apollo_openapi.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_gray_del_releases.post import CreateGrayDelRelease from apollo_openapi.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_releases.post import CreateGrayRelease from apollo_openapi.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases.post import CreateRelease from apollo_openapi.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_active.get import FindActiveReleases -from apollo_openapi.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all.get import FindAllReleases from apollo_openapi.paths.openapi_v1_envs_env_releases_release_id.get import GetReleaseById from apollo_openapi.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_latest.get import LoadLatestActiveRelease from apollo_openapi.paths.openapi_v1_envs_env_releases_release_id_rollback.put import Rollback class ReleaseManagementApi( + CompareRelease, CreateGrayDelRelease, CreateGrayRelease, CreateRelease, FindActiveReleases, - FindAllReleases, GetReleaseById, LoadLatestActiveRelease, Rollback, diff --git a/python/apollo_openapi/model/open_access_key_dto.py b/python/apollo_openapi/model/open_access_key_dto.py new file mode 100644 index 0000000..559f01a --- /dev/null +++ b/python/apollo_openapi/model/open_access_key_dto.py @@ -0,0 +1,178 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenAccessKeyDTO( + 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: + dataChangeCreatedBy = schemas.StrSchema + dataChangeLastModifiedBy = schemas.StrSchema + dataChangeCreatedByDisplayName = schemas.StrSchema + dataChangeLastModifiedByDisplayName = schemas.StrSchema + dataChangeCreatedTime = schemas.StrSchema + dataChangeLastModifiedTime = schemas.StrSchema + id = schemas.Int64Schema + secret = schemas.StrSchema + appId = schemas.StrSchema + mode = schemas.IntSchema + enabled = schemas.BoolSchema + __annotations__ = { + "dataChangeCreatedBy": dataChangeCreatedBy, + "dataChangeLastModifiedBy": dataChangeLastModifiedBy, + "dataChangeCreatedByDisplayName": dataChangeCreatedByDisplayName, + "dataChangeLastModifiedByDisplayName": dataChangeLastModifiedByDisplayName, + "dataChangeCreatedTime": dataChangeCreatedTime, + "dataChangeLastModifiedTime": dataChangeLastModifiedTime, + "id": id, + "secret": secret, + "appId": appId, + "mode": mode, + "enabled": enabled, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dataChangeCreatedBy"]) -> MetaOapg.properties.dataChangeCreatedBy: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dataChangeLastModifiedBy"]) -> MetaOapg.properties.dataChangeLastModifiedBy: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dataChangeCreatedByDisplayName"]) -> MetaOapg.properties.dataChangeCreatedByDisplayName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dataChangeLastModifiedByDisplayName"]) -> MetaOapg.properties.dataChangeLastModifiedByDisplayName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dataChangeCreatedTime"]) -> MetaOapg.properties.dataChangeCreatedTime: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dataChangeLastModifiedTime"]) -> MetaOapg.properties.dataChangeLastModifiedTime: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["secret"]) -> MetaOapg.properties.secret: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["mode"]) -> MetaOapg.properties.mode: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enabled"]) -> MetaOapg.properties.enabled: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["dataChangeCreatedBy", "dataChangeLastModifiedBy", "dataChangeCreatedByDisplayName", "dataChangeLastModifiedByDisplayName", "dataChangeCreatedTime", "dataChangeLastModifiedTime", "id", "secret", "appId", "mode", "enabled", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @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["dataChangeLastModifiedBy"]) -> typing.Union[MetaOapg.properties.dataChangeLastModifiedBy, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["dataChangeCreatedByDisplayName"]) -> typing.Union[MetaOapg.properties.dataChangeCreatedByDisplayName, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["dataChangeLastModifiedByDisplayName"]) -> typing.Union[MetaOapg.properties.dataChangeLastModifiedByDisplayName, 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["dataChangeLastModifiedTime"]) -> typing.Union[MetaOapg.properties.dataChangeLastModifiedTime, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["secret"]) -> typing.Union[MetaOapg.properties.secret, schemas.Unset]: ... + + @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["mode"]) -> typing.Union[MetaOapg.properties.mode, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["enabled"]) -> typing.Union[MetaOapg.properties.enabled, 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["dataChangeCreatedBy", "dataChangeLastModifiedBy", "dataChangeCreatedByDisplayName", "dataChangeLastModifiedByDisplayName", "dataChangeCreatedTime", "dataChangeLastModifiedTime", "id", "secret", "appId", "mode", "enabled", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + dataChangeCreatedBy: typing.Union[MetaOapg.properties.dataChangeCreatedBy, str, schemas.Unset] = schemas.unset, + dataChangeLastModifiedBy: typing.Union[MetaOapg.properties.dataChangeLastModifiedBy, str, schemas.Unset] = schemas.unset, + dataChangeCreatedByDisplayName: typing.Union[MetaOapg.properties.dataChangeCreatedByDisplayName, str, schemas.Unset] = schemas.unset, + dataChangeLastModifiedByDisplayName: typing.Union[MetaOapg.properties.dataChangeLastModifiedByDisplayName, str, schemas.Unset] = schemas.unset, + dataChangeCreatedTime: typing.Union[MetaOapg.properties.dataChangeCreatedTime, str, schemas.Unset] = schemas.unset, + dataChangeLastModifiedTime: typing.Union[MetaOapg.properties.dataChangeLastModifiedTime, str, schemas.Unset] = schemas.unset, + id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, + secret: typing.Union[MetaOapg.properties.secret, str, schemas.Unset] = schemas.unset, + appId: typing.Union[MetaOapg.properties.appId, str, schemas.Unset] = schemas.unset, + mode: typing.Union[MetaOapg.properties.mode, decimal.Decimal, int, schemas.Unset] = schemas.unset, + enabled: typing.Union[MetaOapg.properties.enabled, 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], + ) -> 'OpenAccessKeyDTO': + return super().__new__( + cls, + *_args, + dataChangeCreatedBy=dataChangeCreatedBy, + dataChangeLastModifiedBy=dataChangeLastModifiedBy, + dataChangeCreatedByDisplayName=dataChangeCreatedByDisplayName, + dataChangeLastModifiedByDisplayName=dataChangeLastModifiedByDisplayName, + dataChangeCreatedTime=dataChangeCreatedTime, + dataChangeLastModifiedTime=dataChangeLastModifiedTime, + id=id, + secret=secret, + appId=appId, + mode=mode, + enabled=enabled, + _configuration=_configuration, + **kwargs, + ) diff --git a/python/apollo_openapi/model/open_access_key_dto.pyi b/python/apollo_openapi/model/open_access_key_dto.pyi new file mode 100644 index 0000000..559f01a --- /dev/null +++ b/python/apollo_openapi/model/open_access_key_dto.pyi @@ -0,0 +1,178 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenAccessKeyDTO( + 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: + dataChangeCreatedBy = schemas.StrSchema + dataChangeLastModifiedBy = schemas.StrSchema + dataChangeCreatedByDisplayName = schemas.StrSchema + dataChangeLastModifiedByDisplayName = schemas.StrSchema + dataChangeCreatedTime = schemas.StrSchema + dataChangeLastModifiedTime = schemas.StrSchema + id = schemas.Int64Schema + secret = schemas.StrSchema + appId = schemas.StrSchema + mode = schemas.IntSchema + enabled = schemas.BoolSchema + __annotations__ = { + "dataChangeCreatedBy": dataChangeCreatedBy, + "dataChangeLastModifiedBy": dataChangeLastModifiedBy, + "dataChangeCreatedByDisplayName": dataChangeCreatedByDisplayName, + "dataChangeLastModifiedByDisplayName": dataChangeLastModifiedByDisplayName, + "dataChangeCreatedTime": dataChangeCreatedTime, + "dataChangeLastModifiedTime": dataChangeLastModifiedTime, + "id": id, + "secret": secret, + "appId": appId, + "mode": mode, + "enabled": enabled, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dataChangeCreatedBy"]) -> MetaOapg.properties.dataChangeCreatedBy: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dataChangeLastModifiedBy"]) -> MetaOapg.properties.dataChangeLastModifiedBy: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dataChangeCreatedByDisplayName"]) -> MetaOapg.properties.dataChangeCreatedByDisplayName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dataChangeLastModifiedByDisplayName"]) -> MetaOapg.properties.dataChangeLastModifiedByDisplayName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dataChangeCreatedTime"]) -> MetaOapg.properties.dataChangeCreatedTime: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["dataChangeLastModifiedTime"]) -> MetaOapg.properties.dataChangeLastModifiedTime: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.properties.id: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["secret"]) -> MetaOapg.properties.secret: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["mode"]) -> MetaOapg.properties.mode: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enabled"]) -> MetaOapg.properties.enabled: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["dataChangeCreatedBy", "dataChangeLastModifiedBy", "dataChangeCreatedByDisplayName", "dataChangeLastModifiedByDisplayName", "dataChangeCreatedTime", "dataChangeLastModifiedTime", "id", "secret", "appId", "mode", "enabled", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @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["dataChangeLastModifiedBy"]) -> typing.Union[MetaOapg.properties.dataChangeLastModifiedBy, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["dataChangeCreatedByDisplayName"]) -> typing.Union[MetaOapg.properties.dataChangeCreatedByDisplayName, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["dataChangeLastModifiedByDisplayName"]) -> typing.Union[MetaOapg.properties.dataChangeLastModifiedByDisplayName, 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["dataChangeLastModifiedTime"]) -> typing.Union[MetaOapg.properties.dataChangeLastModifiedTime, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> typing.Union[MetaOapg.properties.id, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["secret"]) -> typing.Union[MetaOapg.properties.secret, schemas.Unset]: ... + + @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["mode"]) -> typing.Union[MetaOapg.properties.mode, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["enabled"]) -> typing.Union[MetaOapg.properties.enabled, 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["dataChangeCreatedBy", "dataChangeLastModifiedBy", "dataChangeCreatedByDisplayName", "dataChangeLastModifiedByDisplayName", "dataChangeCreatedTime", "dataChangeLastModifiedTime", "id", "secret", "appId", "mode", "enabled", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + dataChangeCreatedBy: typing.Union[MetaOapg.properties.dataChangeCreatedBy, str, schemas.Unset] = schemas.unset, + dataChangeLastModifiedBy: typing.Union[MetaOapg.properties.dataChangeLastModifiedBy, str, schemas.Unset] = schemas.unset, + dataChangeCreatedByDisplayName: typing.Union[MetaOapg.properties.dataChangeCreatedByDisplayName, str, schemas.Unset] = schemas.unset, + dataChangeLastModifiedByDisplayName: typing.Union[MetaOapg.properties.dataChangeLastModifiedByDisplayName, str, schemas.Unset] = schemas.unset, + dataChangeCreatedTime: typing.Union[MetaOapg.properties.dataChangeCreatedTime, str, schemas.Unset] = schemas.unset, + dataChangeLastModifiedTime: typing.Union[MetaOapg.properties.dataChangeLastModifiedTime, str, schemas.Unset] = schemas.unset, + id: typing.Union[MetaOapg.properties.id, decimal.Decimal, int, schemas.Unset] = schemas.unset, + secret: typing.Union[MetaOapg.properties.secret, str, schemas.Unset] = schemas.unset, + appId: typing.Union[MetaOapg.properties.appId, str, schemas.Unset] = schemas.unset, + mode: typing.Union[MetaOapg.properties.mode, decimal.Decimal, int, schemas.Unset] = schemas.unset, + enabled: typing.Union[MetaOapg.properties.enabled, 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], + ) -> 'OpenAccessKeyDTO': + return super().__new__( + cls, + *_args, + dataChangeCreatedBy=dataChangeCreatedBy, + dataChangeLastModifiedBy=dataChangeLastModifiedBy, + dataChangeCreatedByDisplayName=dataChangeCreatedByDisplayName, + dataChangeLastModifiedByDisplayName=dataChangeLastModifiedByDisplayName, + dataChangeCreatedTime=dataChangeCreatedTime, + dataChangeLastModifiedTime=dataChangeLastModifiedTime, + id=id, + secret=secret, + appId=appId, + mode=mode, + enabled=enabled, + _configuration=_configuration, + **kwargs, + ) diff --git a/python/apollo_openapi/model/open_release_bo.pyi b/python/apollo_openapi/model/open_app_role_user_dto.py similarity index 67% rename from python/apollo_openapi/model/open_release_bo.pyi rename to python/apollo_openapi/model/open_app_role_user_dto.py index 061c214..713f880 100644 --- a/python/apollo_openapi/model/open_release_bo.pyi +++ b/python/apollo_openapi/model/open_app_role_user_dto.py @@ -23,7 +23,7 @@ from apollo_openapi import schemas # noqa: F401 -class OpenReleaseBO( +class OpenAppRoleUserDTO( schemas.DictSchema ): """NOTE: This class is auto generated by OpenAPI Generator. @@ -36,13 +36,10 @@ class OpenReleaseBO( class MetaOapg: class properties: + appId = schemas.StrSchema - @staticmethod - def baseInfo() -> typing.Type['OpenReleaseDTO']: - return OpenReleaseDTO - - class items( + class masterUsers( schemas.ListSchema ): @@ -50,70 +47,69 @@ class items( class MetaOapg: @staticmethod - def items() -> typing.Type['KVEntity']: - return KVEntity + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO def __new__( cls, - _arg: typing.Union[typing.Tuple['KVEntity'], typing.List['KVEntity']], + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': + ) -> 'masterUsers': return super().__new__( cls, _arg, _configuration=_configuration, ) - def __getitem__(self, i: int) -> 'KVEntity': + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': return super().__getitem__(i) __annotations__ = { - "baseInfo": baseInfo, - "items": items, + "appId": appId, + "masterUsers": masterUsers, } @typing.overload - def __getitem__(self, name: typing_extensions.Literal["baseInfo"]) -> 'OpenReleaseDTO': ... + def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... @typing.overload - def __getitem__(self, name: typing_extensions.Literal["items"]) -> MetaOapg.properties.items: ... + def __getitem__(self, name: typing_extensions.Literal["masterUsers"]) -> MetaOapg.properties.masterUsers: ... @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__(self, name: typing.Union[typing_extensions.Literal["baseInfo", "items", ], str]): + def __getitem__(self, name: typing.Union[typing_extensions.Literal["appId", "masterUsers", ], str]): # dict_instance[name] accessor return super().__getitem__(name) @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["baseInfo"]) -> typing.Union['OpenReleaseDTO', schemas.Unset]: ... + 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["items"]) -> typing.Union[MetaOapg.properties.items, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["masterUsers"]) -> typing.Union[MetaOapg.properties.masterUsers, 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["baseInfo", "items", ], str]): + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["appId", "masterUsers", ], str]): return super().get_item_oapg(name) def __new__( cls, *_args: typing.Union[dict, frozendict.frozendict, ], - baseInfo: typing.Union['OpenReleaseDTO', schemas.Unset] = schemas.unset, - items: typing.Union[MetaOapg.properties.items, list, tuple, schemas.Unset] = schemas.unset, + appId: typing.Union[MetaOapg.properties.appId, str, schemas.Unset] = schemas.unset, + masterUsers: typing.Union[MetaOapg.properties.masterUsers, list, tuple, 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], - ) -> 'OpenReleaseBO': + ) -> 'OpenAppRoleUserDTO': return super().__new__( cls, *_args, - baseInfo=baseInfo, - items=items, + appId=appId, + masterUsers=masterUsers, _configuration=_configuration, **kwargs, ) -from apollo_openapi.model.kv_entity import KVEntity -from apollo_openapi.model.open_release_dto import OpenReleaseDTO +from apollo_openapi.model.open_user_info_dto import OpenUserInfoDTO diff --git a/python/apollo_openapi/model/open_release_bo.py b/python/apollo_openapi/model/open_app_role_user_dto.pyi similarity index 67% rename from python/apollo_openapi/model/open_release_bo.py rename to python/apollo_openapi/model/open_app_role_user_dto.pyi index 061c214..713f880 100644 --- a/python/apollo_openapi/model/open_release_bo.py +++ b/python/apollo_openapi/model/open_app_role_user_dto.pyi @@ -23,7 +23,7 @@ from apollo_openapi import schemas # noqa: F401 -class OpenReleaseBO( +class OpenAppRoleUserDTO( schemas.DictSchema ): """NOTE: This class is auto generated by OpenAPI Generator. @@ -36,13 +36,10 @@ class OpenReleaseBO( class MetaOapg: class properties: + appId = schemas.StrSchema - @staticmethod - def baseInfo() -> typing.Type['OpenReleaseDTO']: - return OpenReleaseDTO - - class items( + class masterUsers( schemas.ListSchema ): @@ -50,70 +47,69 @@ class items( class MetaOapg: @staticmethod - def items() -> typing.Type['KVEntity']: - return KVEntity + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO def __new__( cls, - _arg: typing.Union[typing.Tuple['KVEntity'], typing.List['KVEntity']], + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'items': + ) -> 'masterUsers': return super().__new__( cls, _arg, _configuration=_configuration, ) - def __getitem__(self, i: int) -> 'KVEntity': + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': return super().__getitem__(i) __annotations__ = { - "baseInfo": baseInfo, - "items": items, + "appId": appId, + "masterUsers": masterUsers, } @typing.overload - def __getitem__(self, name: typing_extensions.Literal["baseInfo"]) -> 'OpenReleaseDTO': ... + def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... @typing.overload - def __getitem__(self, name: typing_extensions.Literal["items"]) -> MetaOapg.properties.items: ... + def __getitem__(self, name: typing_extensions.Literal["masterUsers"]) -> MetaOapg.properties.masterUsers: ... @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__(self, name: typing.Union[typing_extensions.Literal["baseInfo", "items", ], str]): + def __getitem__(self, name: typing.Union[typing_extensions.Literal["appId", "masterUsers", ], str]): # dict_instance[name] accessor return super().__getitem__(name) @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["baseInfo"]) -> typing.Union['OpenReleaseDTO', schemas.Unset]: ... + 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["items"]) -> typing.Union[MetaOapg.properties.items, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["masterUsers"]) -> typing.Union[MetaOapg.properties.masterUsers, 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["baseInfo", "items", ], str]): + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["appId", "masterUsers", ], str]): return super().get_item_oapg(name) def __new__( cls, *_args: typing.Union[dict, frozendict.frozendict, ], - baseInfo: typing.Union['OpenReleaseDTO', schemas.Unset] = schemas.unset, - items: typing.Union[MetaOapg.properties.items, list, tuple, schemas.Unset] = schemas.unset, + appId: typing.Union[MetaOapg.properties.appId, str, schemas.Unset] = schemas.unset, + masterUsers: typing.Union[MetaOapg.properties.masterUsers, list, tuple, 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], - ) -> 'OpenReleaseBO': + ) -> 'OpenAppRoleUserDTO': return super().__new__( cls, *_args, - baseInfo=baseInfo, - items=items, + appId=appId, + masterUsers=masterUsers, _configuration=_configuration, **kwargs, ) -from apollo_openapi.model.kv_entity import KVEntity -from apollo_openapi.model.open_release_dto import OpenReleaseDTO +from apollo_openapi.model.open_user_info_dto import OpenUserInfoDTO diff --git a/python/apollo_openapi/model/open_cluster_namespace_role_user_dto.py b/python/apollo_openapi/model/open_cluster_namespace_role_user_dto.py new file mode 100644 index 0000000..06c2a50 --- /dev/null +++ b/python/apollo_openapi/model/open_cluster_namespace_role_user_dto.py @@ -0,0 +1,170 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenClusterNamespaceRoleUserDTO( + 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 + env = schemas.StrSchema + cluster = schemas.StrSchema + + + class modifyRoleUsers( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'modifyRoleUsers': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': + return super().__getitem__(i) + + + class releaseRoleUsers( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'releaseRoleUsers': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': + return super().__getitem__(i) + __annotations__ = { + "appId": appId, + "env": env, + "cluster": cluster, + "modifyRoleUsers": modifyRoleUsers, + "releaseRoleUsers": releaseRoleUsers, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["env"]) -> MetaOapg.properties.env: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["cluster"]) -> MetaOapg.properties.cluster: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["modifyRoleUsers"]) -> MetaOapg.properties.modifyRoleUsers: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["releaseRoleUsers"]) -> MetaOapg.properties.releaseRoleUsers: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["appId", "env", "cluster", "modifyRoleUsers", "releaseRoleUsers", ], 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["env"]) -> typing.Union[MetaOapg.properties.env, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["cluster"]) -> typing.Union[MetaOapg.properties.cluster, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["modifyRoleUsers"]) -> typing.Union[MetaOapg.properties.modifyRoleUsers, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["releaseRoleUsers"]) -> typing.Union[MetaOapg.properties.releaseRoleUsers, 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", "env", "cluster", "modifyRoleUsers", "releaseRoleUsers", ], 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, + env: typing.Union[MetaOapg.properties.env, str, schemas.Unset] = schemas.unset, + cluster: typing.Union[MetaOapg.properties.cluster, str, schemas.Unset] = schemas.unset, + modifyRoleUsers: typing.Union[MetaOapg.properties.modifyRoleUsers, list, tuple, schemas.Unset] = schemas.unset, + releaseRoleUsers: typing.Union[MetaOapg.properties.releaseRoleUsers, list, tuple, 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], + ) -> 'OpenClusterNamespaceRoleUserDTO': + return super().__new__( + cls, + *_args, + appId=appId, + env=env, + cluster=cluster, + modifyRoleUsers=modifyRoleUsers, + releaseRoleUsers=releaseRoleUsers, + _configuration=_configuration, + **kwargs, + ) + +from apollo_openapi.model.open_user_info_dto import OpenUserInfoDTO diff --git a/python/apollo_openapi/model/open_cluster_namespace_role_user_dto.pyi b/python/apollo_openapi/model/open_cluster_namespace_role_user_dto.pyi new file mode 100644 index 0000000..06c2a50 --- /dev/null +++ b/python/apollo_openapi/model/open_cluster_namespace_role_user_dto.pyi @@ -0,0 +1,170 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenClusterNamespaceRoleUserDTO( + 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 + env = schemas.StrSchema + cluster = schemas.StrSchema + + + class modifyRoleUsers( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'modifyRoleUsers': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': + return super().__getitem__(i) + + + class releaseRoleUsers( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'releaseRoleUsers': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': + return super().__getitem__(i) + __annotations__ = { + "appId": appId, + "env": env, + "cluster": cluster, + "modifyRoleUsers": modifyRoleUsers, + "releaseRoleUsers": releaseRoleUsers, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["env"]) -> MetaOapg.properties.env: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["cluster"]) -> MetaOapg.properties.cluster: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["modifyRoleUsers"]) -> MetaOapg.properties.modifyRoleUsers: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["releaseRoleUsers"]) -> MetaOapg.properties.releaseRoleUsers: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["appId", "env", "cluster", "modifyRoleUsers", "releaseRoleUsers", ], 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["env"]) -> typing.Union[MetaOapg.properties.env, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["cluster"]) -> typing.Union[MetaOapg.properties.cluster, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["modifyRoleUsers"]) -> typing.Union[MetaOapg.properties.modifyRoleUsers, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["releaseRoleUsers"]) -> typing.Union[MetaOapg.properties.releaseRoleUsers, 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", "env", "cluster", "modifyRoleUsers", "releaseRoleUsers", ], 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, + env: typing.Union[MetaOapg.properties.env, str, schemas.Unset] = schemas.unset, + cluster: typing.Union[MetaOapg.properties.cluster, str, schemas.Unset] = schemas.unset, + modifyRoleUsers: typing.Union[MetaOapg.properties.modifyRoleUsers, list, tuple, schemas.Unset] = schemas.unset, + releaseRoleUsers: typing.Union[MetaOapg.properties.releaseRoleUsers, list, tuple, 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], + ) -> 'OpenClusterNamespaceRoleUserDTO': + return super().__new__( + cls, + *_args, + appId=appId, + env=env, + cluster=cluster, + modifyRoleUsers=modifyRoleUsers, + releaseRoleUsers=releaseRoleUsers, + _configuration=_configuration, + **kwargs, + ) + +from apollo_openapi.model.open_user_info_dto import OpenUserInfoDTO diff --git a/python/apollo_openapi/model/open_env_namespace_role_user_dto.py b/python/apollo_openapi/model/open_env_namespace_role_user_dto.py new file mode 100644 index 0000000..a09977b --- /dev/null +++ b/python/apollo_openapi/model/open_env_namespace_role_user_dto.py @@ -0,0 +1,170 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenEnvNamespaceRoleUserDTO( + 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 + namespaceName = schemas.StrSchema + + + class modifyRoleUsers( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'modifyRoleUsers': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': + return super().__getitem__(i) + + + class releaseRoleUsers( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'releaseRoleUsers': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': + return super().__getitem__(i) + env = schemas.StrSchema + __annotations__ = { + "appId": appId, + "namespaceName": namespaceName, + "modifyRoleUsers": modifyRoleUsers, + "releaseRoleUsers": releaseRoleUsers, + "env": env, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["namespaceName"]) -> MetaOapg.properties.namespaceName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["modifyRoleUsers"]) -> MetaOapg.properties.modifyRoleUsers: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["releaseRoleUsers"]) -> MetaOapg.properties.releaseRoleUsers: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["env"]) -> MetaOapg.properties.env: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["appId", "namespaceName", "modifyRoleUsers", "releaseRoleUsers", "env", ], 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["namespaceName"]) -> typing.Union[MetaOapg.properties.namespaceName, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["modifyRoleUsers"]) -> typing.Union[MetaOapg.properties.modifyRoleUsers, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["releaseRoleUsers"]) -> typing.Union[MetaOapg.properties.releaseRoleUsers, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["env"]) -> typing.Union[MetaOapg.properties.env, 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", "namespaceName", "modifyRoleUsers", "releaseRoleUsers", "env", ], 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, + namespaceName: typing.Union[MetaOapg.properties.namespaceName, str, schemas.Unset] = schemas.unset, + modifyRoleUsers: typing.Union[MetaOapg.properties.modifyRoleUsers, list, tuple, schemas.Unset] = schemas.unset, + releaseRoleUsers: typing.Union[MetaOapg.properties.releaseRoleUsers, list, tuple, schemas.Unset] = schemas.unset, + env: typing.Union[MetaOapg.properties.env, str, 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], + ) -> 'OpenEnvNamespaceRoleUserDTO': + return super().__new__( + cls, + *_args, + appId=appId, + namespaceName=namespaceName, + modifyRoleUsers=modifyRoleUsers, + releaseRoleUsers=releaseRoleUsers, + env=env, + _configuration=_configuration, + **kwargs, + ) + +from apollo_openapi.model.open_user_info_dto import OpenUserInfoDTO diff --git a/python/apollo_openapi/model/open_env_namespace_role_user_dto.pyi b/python/apollo_openapi/model/open_env_namespace_role_user_dto.pyi new file mode 100644 index 0000000..a09977b --- /dev/null +++ b/python/apollo_openapi/model/open_env_namespace_role_user_dto.pyi @@ -0,0 +1,170 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenEnvNamespaceRoleUserDTO( + 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 + namespaceName = schemas.StrSchema + + + class modifyRoleUsers( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'modifyRoleUsers': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': + return super().__getitem__(i) + + + class releaseRoleUsers( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'releaseRoleUsers': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': + return super().__getitem__(i) + env = schemas.StrSchema + __annotations__ = { + "appId": appId, + "namespaceName": namespaceName, + "modifyRoleUsers": modifyRoleUsers, + "releaseRoleUsers": releaseRoleUsers, + "env": env, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["namespaceName"]) -> MetaOapg.properties.namespaceName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["modifyRoleUsers"]) -> MetaOapg.properties.modifyRoleUsers: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["releaseRoleUsers"]) -> MetaOapg.properties.releaseRoleUsers: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["env"]) -> MetaOapg.properties.env: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["appId", "namespaceName", "modifyRoleUsers", "releaseRoleUsers", "env", ], 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["namespaceName"]) -> typing.Union[MetaOapg.properties.namespaceName, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["modifyRoleUsers"]) -> typing.Union[MetaOapg.properties.modifyRoleUsers, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["releaseRoleUsers"]) -> typing.Union[MetaOapg.properties.releaseRoleUsers, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["env"]) -> typing.Union[MetaOapg.properties.env, 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", "namespaceName", "modifyRoleUsers", "releaseRoleUsers", "env", ], 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, + namespaceName: typing.Union[MetaOapg.properties.namespaceName, str, schemas.Unset] = schemas.unset, + modifyRoleUsers: typing.Union[MetaOapg.properties.modifyRoleUsers, list, tuple, schemas.Unset] = schemas.unset, + releaseRoleUsers: typing.Union[MetaOapg.properties.releaseRoleUsers, list, tuple, schemas.Unset] = schemas.unset, + env: typing.Union[MetaOapg.properties.env, str, 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], + ) -> 'OpenEnvNamespaceRoleUserDTO': + return super().__new__( + cls, + *_args, + appId=appId, + namespaceName=namespaceName, + modifyRoleUsers=modifyRoleUsers, + releaseRoleUsers=releaseRoleUsers, + env=env, + _configuration=_configuration, + **kwargs, + ) + +from apollo_openapi.model.open_user_info_dto import OpenUserInfoDTO diff --git a/python/apollo_openapi/model/open_namespace_role_user_dto.py b/python/apollo_openapi/model/open_namespace_role_user_dto.py new file mode 100644 index 0000000..803e723 --- /dev/null +++ b/python/apollo_openapi/model/open_namespace_role_user_dto.py @@ -0,0 +1,160 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenNamespaceRoleUserDTO( + 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 + namespaceName = schemas.StrSchema + + + class modifyRoleUsers( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'modifyRoleUsers': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': + return super().__getitem__(i) + + + class releaseRoleUsers( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'releaseRoleUsers': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': + return super().__getitem__(i) + __annotations__ = { + "appId": appId, + "namespaceName": namespaceName, + "modifyRoleUsers": modifyRoleUsers, + "releaseRoleUsers": releaseRoleUsers, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["namespaceName"]) -> MetaOapg.properties.namespaceName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["modifyRoleUsers"]) -> MetaOapg.properties.modifyRoleUsers: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["releaseRoleUsers"]) -> MetaOapg.properties.releaseRoleUsers: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["appId", "namespaceName", "modifyRoleUsers", "releaseRoleUsers", ], 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["namespaceName"]) -> typing.Union[MetaOapg.properties.namespaceName, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["modifyRoleUsers"]) -> typing.Union[MetaOapg.properties.modifyRoleUsers, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["releaseRoleUsers"]) -> typing.Union[MetaOapg.properties.releaseRoleUsers, 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", "namespaceName", "modifyRoleUsers", "releaseRoleUsers", ], 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, + namespaceName: typing.Union[MetaOapg.properties.namespaceName, str, schemas.Unset] = schemas.unset, + modifyRoleUsers: typing.Union[MetaOapg.properties.modifyRoleUsers, list, tuple, schemas.Unset] = schemas.unset, + releaseRoleUsers: typing.Union[MetaOapg.properties.releaseRoleUsers, list, tuple, 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], + ) -> 'OpenNamespaceRoleUserDTO': + return super().__new__( + cls, + *_args, + appId=appId, + namespaceName=namespaceName, + modifyRoleUsers=modifyRoleUsers, + releaseRoleUsers=releaseRoleUsers, + _configuration=_configuration, + **kwargs, + ) + +from apollo_openapi.model.open_user_info_dto import OpenUserInfoDTO diff --git a/python/apollo_openapi/model/open_namespace_role_user_dto.pyi b/python/apollo_openapi/model/open_namespace_role_user_dto.pyi new file mode 100644 index 0000000..803e723 --- /dev/null +++ b/python/apollo_openapi/model/open_namespace_role_user_dto.pyi @@ -0,0 +1,160 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenNamespaceRoleUserDTO( + 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 + namespaceName = schemas.StrSchema + + + class modifyRoleUsers( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'modifyRoleUsers': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': + return super().__getitem__(i) + + + class releaseRoleUsers( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenUserInfoDTO']: + return OpenUserInfoDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenUserInfoDTO'], typing.List['OpenUserInfoDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'releaseRoleUsers': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenUserInfoDTO': + return super().__getitem__(i) + __annotations__ = { + "appId": appId, + "namespaceName": namespaceName, + "modifyRoleUsers": modifyRoleUsers, + "releaseRoleUsers": releaseRoleUsers, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["appId"]) -> MetaOapg.properties.appId: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["namespaceName"]) -> MetaOapg.properties.namespaceName: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["modifyRoleUsers"]) -> MetaOapg.properties.modifyRoleUsers: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["releaseRoleUsers"]) -> MetaOapg.properties.releaseRoleUsers: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["appId", "namespaceName", "modifyRoleUsers", "releaseRoleUsers", ], 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["namespaceName"]) -> typing.Union[MetaOapg.properties.namespaceName, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["modifyRoleUsers"]) -> typing.Union[MetaOapg.properties.modifyRoleUsers, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["releaseRoleUsers"]) -> typing.Union[MetaOapg.properties.releaseRoleUsers, 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", "namespaceName", "modifyRoleUsers", "releaseRoleUsers", ], 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, + namespaceName: typing.Union[MetaOapg.properties.namespaceName, str, schemas.Unset] = schemas.unset, + modifyRoleUsers: typing.Union[MetaOapg.properties.modifyRoleUsers, list, tuple, schemas.Unset] = schemas.unset, + releaseRoleUsers: typing.Union[MetaOapg.properties.releaseRoleUsers, list, tuple, 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], + ) -> 'OpenNamespaceRoleUserDTO': + return super().__new__( + cls, + *_args, + appId=appId, + namespaceName=namespaceName, + modifyRoleUsers=modifyRoleUsers, + releaseRoleUsers=releaseRoleUsers, + _configuration=_configuration, + **kwargs, + ) + +from apollo_openapi.model.open_user_info_dto import OpenUserInfoDTO diff --git a/python/apollo_openapi/model/kv_entity.py b/python/apollo_openapi/model/open_permission_condition_dto.py similarity index 71% rename from python/apollo_openapi/model/kv_entity.py rename to python/apollo_openapi/model/open_permission_condition_dto.py index b511e03..b97de4c 100644 --- a/python/apollo_openapi/model/kv_entity.py +++ b/python/apollo_openapi/model/open_permission_condition_dto.py @@ -23,7 +23,7 @@ from apollo_openapi import schemas # noqa: F401 -class KVEntity( +class OpenPermissionConditionDTO( schemas.DictSchema ): """NOTE: This class is auto generated by OpenAPI Generator. @@ -36,53 +36,43 @@ class KVEntity( class MetaOapg: class properties: - key = schemas.StrSchema - value = schemas.StrSchema + hasPermission = schemas.BoolSchema __annotations__ = { - "key": key, - "value": value, + "hasPermission": hasPermission, } @typing.overload - def __getitem__(self, name: typing_extensions.Literal["key"]) -> MetaOapg.properties.key: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["value"]) -> MetaOapg.properties.value: ... + def __getitem__(self, name: typing_extensions.Literal["hasPermission"]) -> MetaOapg.properties.hasPermission: ... @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__(self, name: typing.Union[typing_extensions.Literal["key", "value", ], str]): + def __getitem__(self, name: typing.Union[typing_extensions.Literal["hasPermission", ], str]): # dict_instance[name] accessor return super().__getitem__(name) @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["key"]) -> typing.Union[MetaOapg.properties.key, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["value"]) -> typing.Union[MetaOapg.properties.value, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["hasPermission"]) -> typing.Union[MetaOapg.properties.hasPermission, 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["key", "value", ], str]): + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["hasPermission", ], str]): return super().get_item_oapg(name) def __new__( cls, *_args: typing.Union[dict, frozendict.frozendict, ], - key: typing.Union[MetaOapg.properties.key, str, schemas.Unset] = schemas.unset, - value: typing.Union[MetaOapg.properties.value, str, schemas.Unset] = schemas.unset, + hasPermission: typing.Union[MetaOapg.properties.hasPermission, 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], - ) -> 'KVEntity': + ) -> 'OpenPermissionConditionDTO': return super().__new__( cls, *_args, - key=key, - value=value, + hasPermission=hasPermission, _configuration=_configuration, **kwargs, ) diff --git a/python/apollo_openapi/model/kv_entity.pyi b/python/apollo_openapi/model/open_permission_condition_dto.pyi similarity index 71% rename from python/apollo_openapi/model/kv_entity.pyi rename to python/apollo_openapi/model/open_permission_condition_dto.pyi index b511e03..b97de4c 100644 --- a/python/apollo_openapi/model/kv_entity.pyi +++ b/python/apollo_openapi/model/open_permission_condition_dto.pyi @@ -23,7 +23,7 @@ import frozendict # noqa: F401 from apollo_openapi import schemas # noqa: F401 -class KVEntity( +class OpenPermissionConditionDTO( schemas.DictSchema ): """NOTE: This class is auto generated by OpenAPI Generator. @@ -36,53 +36,43 @@ class KVEntity( class MetaOapg: class properties: - key = schemas.StrSchema - value = schemas.StrSchema + hasPermission = schemas.BoolSchema __annotations__ = { - "key": key, - "value": value, + "hasPermission": hasPermission, } @typing.overload - def __getitem__(self, name: typing_extensions.Literal["key"]) -> MetaOapg.properties.key: ... - - @typing.overload - def __getitem__(self, name: typing_extensions.Literal["value"]) -> MetaOapg.properties.value: ... + def __getitem__(self, name: typing_extensions.Literal["hasPermission"]) -> MetaOapg.properties.hasPermission: ... @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__(self, name: typing.Union[typing_extensions.Literal["key", "value", ], str]): + def __getitem__(self, name: typing.Union[typing_extensions.Literal["hasPermission", ], str]): # dict_instance[name] accessor return super().__getitem__(name) @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["key"]) -> typing.Union[MetaOapg.properties.key, schemas.Unset]: ... - - @typing.overload - def get_item_oapg(self, name: typing_extensions.Literal["value"]) -> typing.Union[MetaOapg.properties.value, schemas.Unset]: ... + def get_item_oapg(self, name: typing_extensions.Literal["hasPermission"]) -> typing.Union[MetaOapg.properties.hasPermission, 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["key", "value", ], str]): + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["hasPermission", ], str]): return super().get_item_oapg(name) def __new__( cls, *_args: typing.Union[dict, frozendict.frozendict, ], - key: typing.Union[MetaOapg.properties.key, str, schemas.Unset] = schemas.unset, - value: typing.Union[MetaOapg.properties.value, str, schemas.Unset] = schemas.unset, + hasPermission: typing.Union[MetaOapg.properties.hasPermission, 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], - ) -> 'KVEntity': + ) -> 'OpenPermissionConditionDTO': return super().__new__( cls, *_args, - key=key, - value=value, + hasPermission=hasPermission, _configuration=_configuration, **kwargs, ) diff --git a/python/apollo_openapi/model/open_release_change_dto.py b/python/apollo_openapi/model/open_release_change_dto.py new file mode 100644 index 0000000..6ebc869 --- /dev/null +++ b/python/apollo_openapi/model/open_release_change_dto.py @@ -0,0 +1,108 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenReleaseChangeDTO( + 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: + changeType = schemas.StrSchema + key = schemas.StrSchema + newValue = schemas.StrSchema + oldValue = schemas.StrSchema + __annotations__ = { + "changeType": changeType, + "key": key, + "newValue": newValue, + "oldValue": oldValue, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["changeType"]) -> MetaOapg.properties.changeType: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["key"]) -> MetaOapg.properties.key: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["newValue"]) -> MetaOapg.properties.newValue: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["oldValue"]) -> MetaOapg.properties.oldValue: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["changeType", "key", "newValue", "oldValue", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["changeType"]) -> typing.Union[MetaOapg.properties.changeType, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["key"]) -> typing.Union[MetaOapg.properties.key, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["newValue"]) -> typing.Union[MetaOapg.properties.newValue, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["oldValue"]) -> typing.Union[MetaOapg.properties.oldValue, 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["changeType", "key", "newValue", "oldValue", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + changeType: typing.Union[MetaOapg.properties.changeType, str, schemas.Unset] = schemas.unset, + key: typing.Union[MetaOapg.properties.key, str, schemas.Unset] = schemas.unset, + newValue: typing.Union[MetaOapg.properties.newValue, str, schemas.Unset] = schemas.unset, + oldValue: typing.Union[MetaOapg.properties.oldValue, str, 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], + ) -> 'OpenReleaseChangeDTO': + return super().__new__( + cls, + *_args, + changeType=changeType, + key=key, + newValue=newValue, + oldValue=oldValue, + _configuration=_configuration, + **kwargs, + ) diff --git a/python/apollo_openapi/model/open_release_change_dto.pyi b/python/apollo_openapi/model/open_release_change_dto.pyi new file mode 100644 index 0000000..6ebc869 --- /dev/null +++ b/python/apollo_openapi/model/open_release_change_dto.pyi @@ -0,0 +1,108 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenReleaseChangeDTO( + 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: + changeType = schemas.StrSchema + key = schemas.StrSchema + newValue = schemas.StrSchema + oldValue = schemas.StrSchema + __annotations__ = { + "changeType": changeType, + "key": key, + "newValue": newValue, + "oldValue": oldValue, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["changeType"]) -> MetaOapg.properties.changeType: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["key"]) -> MetaOapg.properties.key: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["newValue"]) -> MetaOapg.properties.newValue: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["oldValue"]) -> MetaOapg.properties.oldValue: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["changeType", "key", "newValue", "oldValue", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["changeType"]) -> typing.Union[MetaOapg.properties.changeType, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["key"]) -> typing.Union[MetaOapg.properties.key, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["newValue"]) -> typing.Union[MetaOapg.properties.newValue, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["oldValue"]) -> typing.Union[MetaOapg.properties.oldValue, 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["changeType", "key", "newValue", "oldValue", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + changeType: typing.Union[MetaOapg.properties.changeType, str, schemas.Unset] = schemas.unset, + key: typing.Union[MetaOapg.properties.key, str, schemas.Unset] = schemas.unset, + newValue: typing.Union[MetaOapg.properties.newValue, str, schemas.Unset] = schemas.unset, + oldValue: typing.Union[MetaOapg.properties.oldValue, str, 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], + ) -> 'OpenReleaseChangeDTO': + return super().__new__( + cls, + *_args, + changeType=changeType, + key=key, + newValue=newValue, + oldValue=oldValue, + _configuration=_configuration, + **kwargs, + ) diff --git a/python/apollo_openapi/model/open_release_diff_dto.py b/python/apollo_openapi/model/open_release_diff_dto.py new file mode 100644 index 0000000..9b06f4b --- /dev/null +++ b/python/apollo_openapi/model/open_release_diff_dto.py @@ -0,0 +1,105 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenReleaseDiffDTO( + 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: + + + class changes( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenReleaseChangeDTO']: + return OpenReleaseChangeDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenReleaseChangeDTO'], typing.List['OpenReleaseChangeDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'changes': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenReleaseChangeDTO': + return super().__getitem__(i) + __annotations__ = { + "changes": changes, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["changes"]) -> MetaOapg.properties.changes: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["changes", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["changes"]) -> typing.Union[MetaOapg.properties.changes, 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["changes", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + changes: typing.Union[MetaOapg.properties.changes, list, tuple, 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], + ) -> 'OpenReleaseDiffDTO': + return super().__new__( + cls, + *_args, + changes=changes, + _configuration=_configuration, + **kwargs, + ) + +from apollo_openapi.model.open_release_change_dto import OpenReleaseChangeDTO diff --git a/python/apollo_openapi/model/open_release_diff_dto.pyi b/python/apollo_openapi/model/open_release_diff_dto.pyi new file mode 100644 index 0000000..9b06f4b --- /dev/null +++ b/python/apollo_openapi/model/open_release_diff_dto.pyi @@ -0,0 +1,105 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenReleaseDiffDTO( + 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: + + + class changes( + schemas.ListSchema + ): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenReleaseChangeDTO']: + return OpenReleaseChangeDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenReleaseChangeDTO'], typing.List['OpenReleaseChangeDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'changes': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenReleaseChangeDTO': + return super().__getitem__(i) + __annotations__ = { + "changes": changes, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["changes"]) -> MetaOapg.properties.changes: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["changes", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["changes"]) -> typing.Union[MetaOapg.properties.changes, 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["changes", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + changes: typing.Union[MetaOapg.properties.changes, list, tuple, 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], + ) -> 'OpenReleaseDiffDTO': + return super().__new__( + cls, + *_args, + changes=changes, + _configuration=_configuration, + **kwargs, + ) + +from apollo_openapi.model.open_release_change_dto import OpenReleaseChangeDTO diff --git a/python/apollo_openapi/model/open_user_info_dto.py b/python/apollo_openapi/model/open_user_info_dto.py new file mode 100644 index 0000000..4099bdc --- /dev/null +++ b/python/apollo_openapi/model/open_user_info_dto.py @@ -0,0 +1,108 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenUserInfoDTO( + 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: + userId = schemas.StrSchema + name = schemas.StrSchema + email = schemas.StrSchema + enabled = schemas.IntSchema + __annotations__ = { + "userId": userId, + "name": name, + "email": email, + "enabled": enabled, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["userId"]) -> MetaOapg.properties.userId: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["email"]) -> MetaOapg.properties.email: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enabled"]) -> MetaOapg.properties.enabled: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["userId", "name", "email", "enabled", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["userId"]) -> typing.Union[MetaOapg.properties.userId, 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["email"]) -> typing.Union[MetaOapg.properties.email, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["enabled"]) -> typing.Union[MetaOapg.properties.enabled, 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["userId", "name", "email", "enabled", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + userId: typing.Union[MetaOapg.properties.userId, str, schemas.Unset] = schemas.unset, + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, + email: typing.Union[MetaOapg.properties.email, str, schemas.Unset] = schemas.unset, + enabled: typing.Union[MetaOapg.properties.enabled, 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], + ) -> 'OpenUserInfoDTO': + return super().__new__( + cls, + *_args, + userId=userId, + name=name, + email=email, + enabled=enabled, + _configuration=_configuration, + **kwargs, + ) diff --git a/python/apollo_openapi/model/open_user_info_dto.pyi b/python/apollo_openapi/model/open_user_info_dto.pyi new file mode 100644 index 0000000..4099bdc --- /dev/null +++ b/python/apollo_openapi/model/open_user_info_dto.pyi @@ -0,0 +1,108 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + 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 OpenUserInfoDTO( + 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: + userId = schemas.StrSchema + name = schemas.StrSchema + email = schemas.StrSchema + enabled = schemas.IntSchema + __annotations__ = { + "userId": userId, + "name": name, + "email": email, + "enabled": enabled, + } + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["userId"]) -> MetaOapg.properties.userId: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.properties.name: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["email"]) -> MetaOapg.properties.email: ... + + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["enabled"]) -> MetaOapg.properties.enabled: ... + + @typing.overload + def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... + + def __getitem__(self, name: typing.Union[typing_extensions.Literal["userId", "name", "email", "enabled", ], str]): + # dict_instance[name] accessor + return super().__getitem__(name) + + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["userId"]) -> typing.Union[MetaOapg.properties.userId, 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["email"]) -> typing.Union[MetaOapg.properties.email, schemas.Unset]: ... + + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["enabled"]) -> typing.Union[MetaOapg.properties.enabled, 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["userId", "name", "email", "enabled", ], str]): + return super().get_item_oapg(name) + + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + userId: typing.Union[MetaOapg.properties.userId, str, schemas.Unset] = schemas.unset, + name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, + email: typing.Union[MetaOapg.properties.email, str, schemas.Unset] = schemas.unset, + enabled: typing.Union[MetaOapg.properties.enabled, 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], + ) -> 'OpenUserInfoDTO': + return super().__new__( + cls, + *_args, + userId=userId, + name=name, + email=email, + enabled=enabled, + _configuration=_configuration, + **kwargs, + ) diff --git a/python/apollo_openapi/models/__init__.py b/python/apollo_openapi/models/__init__.py index 32fa98f..3aa0cfa 100644 --- a/python/apollo_openapi/models/__init__.py +++ b/python/apollo_openapi/models/__init__.py @@ -12,18 +12,21 @@ # sys.setrecursionlimit(n) from apollo_openapi.model.exception_response import ExceptionResponse -from apollo_openapi.model.kv_entity import KVEntity from apollo_openapi.model.map_string import MapString from apollo_openapi.model.namespace_gray_del_release_dto import NamespaceGrayDelReleaseDTO from apollo_openapi.model.namespace_release_dto import NamespaceReleaseDTO +from apollo_openapi.model.open_access_key_dto import OpenAccessKeyDTO from apollo_openapi.model.open_app_dto import OpenAppDTO from apollo_openapi.model.open_app_namespace_dto import OpenAppNamespaceDTO +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_create_app_dto import OpenCreateAppDTO from apollo_openapi.model.open_create_item_dto import OpenCreateItemDTO from apollo_openapi.model.open_create_namespace_dto import OpenCreateNamespaceDTO from apollo_openapi.model.open_env_cluster_dto import OpenEnvClusterDTO from apollo_openapi.model.open_env_cluster_info import OpenEnvClusterInfo +from apollo_openapi.model.open_env_namespace_role_user_dto import OpenEnvNamespaceRoleUserDTO from apollo_openapi.model.open_gray_release_rule_dto import OpenGrayReleaseRuleDTO from apollo_openapi.model.open_gray_release_rule_item_dto import OpenGrayReleaseRuleItemDTO from apollo_openapi.model.open_instance_config_dto import OpenInstanceConfigDTO @@ -39,10 +42,14 @@ from apollo_openapi.model.open_namespace_extend_dto import OpenNamespaceExtendDTO from apollo_openapi.model.open_namespace_identifier import OpenNamespaceIdentifier from apollo_openapi.model.open_namespace_lock_dto import OpenNamespaceLockDTO +from apollo_openapi.model.open_namespace_role_user_dto import OpenNamespaceRoleUserDTO from apollo_openapi.model.open_namespace_sync_dto import OpenNamespaceSyncDTO from apollo_openapi.model.open_namespace_text_model import OpenNamespaceTextModel from apollo_openapi.model.open_namespace_usage_dto import OpenNamespaceUsageDTO from apollo_openapi.model.open_organization_dto import OpenOrganizationDto -from apollo_openapi.model.open_release_bo import OpenReleaseBO +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO +from apollo_openapi.model.open_release_change_dto import OpenReleaseChangeDTO from apollo_openapi.model.open_release_dto import OpenReleaseDTO +from apollo_openapi.model.open_release_diff_dto import OpenReleaseDiffDTO +from apollo_openapi.model.open_user_info_dto import OpenUserInfoDTO from apollo_openapi.model.string_to_string_bool_map import StringToStringBoolMap diff --git a/python/apollo_openapi/paths/__init__.py b/python/apollo_openapi/paths/__init__.py index f3fd747..18d82b9 100644 --- a/python/apollo_openapi/paths/__init__.py +++ b/python/apollo_openapi/paths/__init__.py @@ -31,8 +31,8 @@ class PathValues(str, enum.Enum): OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_BRANCHES_BRANCH_NAME_GRAYDELRELEASES = "/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/gray-del-releases" OPENAPI_V1_ENVS_ENV_RELEASES_RELEASE_ID_ROLLBACK = "/openapi/v1/envs/{env}/releases/{releaseId}/rollback" OPENAPI_V1_ENVS_ENV_RELEASES_RELEASE_ID = "/openapi/v1/envs/{env}/releases/{releaseId}" - OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_RELEASES_ALL = "/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all" OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_RELEASES_ACTIVE = "/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active" + OPENAPI_V1_ENVS_ENV_RELEASES_COMPARISON = "/openapi/v1/envs/{env}/releases/comparison" OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_INSTANCES = "/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/instances" OPENAPI_V1_ENVS_ENV_INSTANCES_BYRELEASE = "/openapi/v1/envs/{env}/instances/by-release" OPENAPI_V1_ENVS_ENV_INSTANCES_BYNAMESPACE = "/openapi/v1/envs/{env}/instances/by-namespace" @@ -56,3 +56,26 @@ class PathValues(str, enum.Enum): OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_BRANCHES_BRANCH_NAME = "/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}" OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_BRANCHES_BRANCH_NAME_RULES = "/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/rules" OPENAPI_V1_ENVS = "/openapi/v1/envs" + OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_PERMISSIONINIT = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init" + OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_NAMESPACES_PERMISSIONINIT = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permission-init" + OPENAPI_V1_APPS_APP_ID_PERMISSIONS_PERMISSION_TYPE = "/openapi/v1/apps/{appId}/permissions/{permissionType}" + OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_PERMISSIONS_PERMISSION_TYPE = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/permissions/{permissionType}" + OPENAPI_V1_APPS_APP_ID_ENVS_ENV_NAMESPACES_NAMESPACE_NAME_PERMISSIONS_PERMISSION_TYPE = "/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/permissions/{permissionType}" + OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_NAMESPACES_PERMISSIONS_PERMISSION_TYPE = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permissions/{permissionType}" + OPENAPI_V1_PERMISSIONS_ROOT = "/openapi/v1/permissions/root" + OPENAPI_V1_APPS_APP_ID_ENVS_ENV_NAMESPACES_NAMESPACE_NAME_ROLEUSERS = "/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/role-users" + OPENAPI_V1_APPS_APP_ID_ENVS_ENV_NAMESPACES_NAMESPACE_NAME_ROLES_ROLE_TYPE = "/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType}" + OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_NAMESPACES_ROLEUSERS = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/role-users" + OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_ROLES_ROLE_TYPE = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType}" + OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_ROLEUSERS = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/role-users" + OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_ROLES_ROLE_TYPE = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType}" + OPENAPI_V1_APPS_APP_ID_ROLEUSERS = "/openapi/v1/apps/{appId}/role-users" + OPENAPI_V1_APPS_APP_ID_ROLES_ROLE_TYPE = "/openapi/v1/apps/{appId}/roles/{roleType}" + OPENAPI_V1_SYSTEM_ROLES_CREATEAPPLICATION = "/openapi/v1/system/roles/create-application" + OPENAPI_V1_SYSTEM_ROLES_CREATEAPPLICATION_ROLEUSERS = "/openapi/v1/system/roles/create-application/role-users" + OPENAPI_V1_APPS_APP_ID_ROLES_MASTER = "/openapi/v1/apps/{appId}/roles/master" + OPENAPI_V1_SYSTEM_ROLE_MANAGEAPPMASTER = "/openapi/v1/system/role/manage-app-master" + OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys" + OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS_ACCESS_KEY_ID = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}" + OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS_ACCESS_KEY_ID_ACTIVATION = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/activation" + OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS_ACCESS_KEY_ID_DEACTIVATION = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation" diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id/delete.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id/delete.py index 752701a..2bf53b8 100644 --- a/python/apollo_openapi/paths/openapi_v1_apps_app_id/delete.py +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id/delete.py @@ -84,24 +84,17 @@ class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): _auth = [ 'ApiKeyAuth', ] -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] + body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, ) SchemaFor403ResponseBodyApplicationJson = ExceptionResponse diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id/delete.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id/delete.pyi index 907e88f..e9cd5de 100644 --- a/python/apollo_openapi/paths/openapi_v1_apps_app_id/delete.pyi +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id/delete.pyi @@ -79,24 +79,17 @@ request_path_app_id = api_client.PathParameter( schema=AppIdSchema, required=True, ) -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] + body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, ) SchemaFor403ResponseBodyApplicationJson = ExceptionResponse diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id/put.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id/put.py index 6790e3c..f9b0bb1 100644 --- a/python/apollo_openapi/paths/openapi_v1_apps_app_id/put.py +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id/put.py @@ -96,24 +96,17 @@ class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): _auth = [ 'ApiKeyAuth', ] -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] + body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, ) SchemaFor400ResponseBodyApplicationJson = ExceptionResponse diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id/put.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id/put.pyi index e11a5bb..b2f0141 100644 --- a/python/apollo_openapi/paths/openapi_v1_apps_app_id/put.pyi +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id/put.pyi @@ -91,24 +91,17 @@ request_body_open_app_dto = api_client.RequestBody( }, required=True, ) -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] + body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, ) SchemaFor400ResponseBodyApplicationJson = ExceptionResponse diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/__init__.py new file mode 100644 index 0000000..98906c3 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/get.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/get.py new file mode 100644 index 0000000..3542372 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/get.py @@ -0,0 +1,329 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_access_key_dto import OpenAccessKeyDTO + +from . import path + +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.ListSchema +): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenAccessKeyDTO']: + return OpenAccessKeyDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenAccessKeyDTO'], typing.List['OpenAccessKeyDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenAccessKeyDTO': + return super().__getitem__(i) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _find_access_keys_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _find_access_keys_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _find_access_keys_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _find_access_keys_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 查找AccessKey + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class FindAccessKeys(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def find_access_keys( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def find_access_keys( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def find_access_keys( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def find_access_keys( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._find_access_keys_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._find_access_keys_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/get.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/get.pyi new file mode 100644 index 0000000..4ee29dc --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/get.pyi @@ -0,0 +1,321 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_access_key_dto import OpenAccessKeyDTO + +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.ListSchema +): + + + class MetaOapg: + + @staticmethod + def items() -> typing.Type['OpenAccessKeyDTO']: + return OpenAccessKeyDTO + + def __new__( + cls, + _arg: typing.Union[typing.Tuple['OpenAccessKeyDTO'], typing.List['OpenAccessKeyDTO']], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> 'OpenAccessKeyDTO': + return super().__getitem__(i) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _find_access_keys_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _find_access_keys_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _find_access_keys_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _find_access_keys_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 查找AccessKey + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class FindAccessKeys(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def find_access_keys( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def find_access_keys( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def find_access_keys( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def find_access_keys( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._find_access_keys_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._find_access_keys_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/post.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/post.py new file mode 100644 index 0000000..8f7fb03 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/post.py @@ -0,0 +1,358 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_access_key_dto import OpenAccessKeyDTO + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] +SchemaFor200ResponseBodyApplicationJson = OpenAccessKeyDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _create_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _create_access_key_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _create_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _create_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 创建AccessKey + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class CreateAccessKey(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def create_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def create_access_key( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def create_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def create_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._create_access_key_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._create_access_key_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/post.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/post.pyi new file mode 100644 index 0000000..0a5f5bc --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys/post.pyi @@ -0,0 +1,350 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_access_key_dto import OpenAccessKeyDTO + +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +SchemaFor200ResponseBodyApplicationJson = OpenAccessKeyDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _create_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _create_access_key_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _create_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _create_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 创建AccessKey + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class CreateAccessKey(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def create_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def create_access_key( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def create_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def create_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._create_access_key_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._create_access_key_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/__init__.py new file mode 100644 index 0000000..e23cd82 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS_ACCESS_KEY_ID diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/delete.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/delete.py new file mode 100644 index 0000000..87fccd6 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/delete.py @@ -0,0 +1,334 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +AccessKeyIdSchema = schemas.Int64Schema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'accessKeyId': typing.Union[AccessKeyIdSchema, decimal.Decimal, int, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_access_key_id = api_client.PathParameter( + name="accessKeyId", + style=api_client.ParameterStyle.SIMPLE, + schema=AccessKeyIdSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _delete_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _delete_access_key_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _delete_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _delete_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 删除AccessKey + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_access_key_id, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class DeleteAccessKey(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def delete_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete_access_key( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_access_key_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_access_key_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/delete.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/delete.pyi new file mode 100644 index 0000000..9af2c7a --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/delete.pyi @@ -0,0 +1,326 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +AccessKeyIdSchema = schemas.Int64Schema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'accessKeyId': typing.Union[AccessKeyIdSchema, decimal.Decimal, int, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_access_key_id = api_client.PathParameter( + name="accessKeyId", + style=api_client.ParameterStyle.SIMPLE, + schema=AccessKeyIdSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _delete_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _delete_access_key_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _delete_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _delete_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 删除AccessKey + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_access_key_id, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class DeleteAccessKey(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def delete_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete_access_key( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_access_key_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_access_key_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/__init__.py new file mode 100644 index 0000000..d6ea3dd --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS_ACCESS_KEY_ID_ACTIVATION diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/put.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/put.py new file mode 100644 index 0000000..6143f72 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/put.py @@ -0,0 +1,334 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +ModeSchema = schemas.IntSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'mode': typing.Union[ModeSchema, decimal.Decimal, int, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_mode = api_client.QueryParameter( + name="mode", + style=api_client.ParameterStyle.FORM, + schema=ModeSchema, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +AccessKeyIdSchema = schemas.Int64Schema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'accessKeyId': typing.Union[AccessKeyIdSchema, decimal.Decimal, int, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_access_key_id = api_client.PathParameter( + name="accessKeyId", + style=api_client.ParameterStyle.SIMPLE, + schema=AccessKeyIdSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _enable_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _enable_access_key_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _enable_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _enable_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 启用AccessKey + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_access_key_id, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_mode, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='put'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class EnableAccessKey(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def enable_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def enable_access_key( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def enable_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def enable_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._enable_access_key_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForput(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def put( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def put( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def put( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def put( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._enable_access_key_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/put.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/put.pyi new file mode 100644 index 0000000..dfd3daf --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/put.pyi @@ -0,0 +1,326 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +ModeSchema = schemas.IntSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'mode': typing.Union[ModeSchema, decimal.Decimal, int, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_mode = api_client.QueryParameter( + name="mode", + style=api_client.ParameterStyle.FORM, + schema=ModeSchema, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +AccessKeyIdSchema = schemas.Int64Schema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'accessKeyId': typing.Union[AccessKeyIdSchema, decimal.Decimal, int, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_access_key_id = api_client.PathParameter( + name="accessKeyId", + style=api_client.ParameterStyle.SIMPLE, + schema=AccessKeyIdSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _enable_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _enable_access_key_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _enable_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _enable_access_key_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 启用AccessKey + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_access_key_id, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_mode, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='put'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class EnableAccessKey(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def enable_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def enable_access_key( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def enable_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def enable_access_key( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._enable_access_key_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForput(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def put( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def put( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def put( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def put( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._enable_access_key_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/__init__.py new file mode 100644 index 0000000..869795b --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_ACCESSKEYS_ACCESS_KEY_ID_DEACTIVATION diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/put.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/put.py new file mode 100644 index 0000000..8415a2c --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/put.py @@ -0,0 +1,280 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +AccessKeyIdSchema = schemas.Int64Schema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'accessKeyId': typing.Union[AccessKeyIdSchema, decimal.Decimal, int, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_access_key_id = api_client.PathParameter( + name="accessKeyId", + style=api_client.ParameterStyle.SIMPLE, + schema=AccessKeyIdSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _disable_access_key_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _disable_access_key_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _disable_access_key_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _disable_access_key_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 禁用AccessKey + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_access_key_id, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='put'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class DisableAccessKey(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def disable_access_key( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def disable_access_key( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def disable_access_key( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def disable_access_key( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._disable_access_key_oapg( + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForput(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def put( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def put( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def put( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def put( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._disable_access_key_oapg( + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/put.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/put.pyi new file mode 100644 index 0000000..03b4c09 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/put.pyi @@ -0,0 +1,272 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +AccessKeyIdSchema = schemas.Int64Schema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'accessKeyId': typing.Union[AccessKeyIdSchema, decimal.Decimal, int, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_access_key_id = api_client.PathParameter( + name="accessKeyId", + style=api_client.ParameterStyle.SIMPLE, + schema=AccessKeyIdSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _disable_access_key_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _disable_access_key_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _disable_access_key_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _disable_access_key_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 禁用AccessKey + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_access_key_id, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='put'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class DisableAccessKey(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def disable_access_key( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def disable_access_key( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def disable_access_key( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def disable_access_key( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._disable_access_key_oapg( + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForput(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def put( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def put( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def put( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def put( + self, + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._disable_access_key_oapg( + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_missing_namespaces/post.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_missing_namespaces/post.py index 757fe8c..8cc1d5f 100644 --- a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_missing_namespaces/post.py +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_missing_namespaces/post.py @@ -9,7 +9,6 @@ from dataclasses import dataclass import typing_extensions import urllib3 -from urllib3._collections import HTTPHeaderDict from apollo_openapi import api_client, exceptions from datetime import date, datetime # noqa: F401 @@ -98,31 +97,21 @@ class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): _auth = [ 'ApiKeyAuth', ] -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] + body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, ) _status_code_to_response = { '200': _response_for_200, } -_all_accept_content_types = ( - 'application/json', -) class BaseApi(api_client.Api): @@ -131,7 +120,6 @@ def _create_missing_namespaces_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -145,7 +133,6 @@ def _create_missing_namespaces_oapg( skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -155,7 +142,6 @@ def _create_missing_namespaces_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -168,7 +154,6 @@ def _create_missing_namespaces_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -210,17 +195,11 @@ class instances serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) for serialized_value in serialized_data.values(): used_path += serialized_value - - _headers = HTTPHeaderDict() # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) response = self.api_client.call_api( resource_path=used_path, method='post'.upper(), - headers=_headers, auth_settings=_auth, stream=stream, timeout=timeout, @@ -253,7 +232,6 @@ def create_missing_namespaces( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -267,7 +245,6 @@ def create_missing_namespaces( skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -277,7 +254,6 @@ def create_missing_namespaces( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -290,7 +266,6 @@ def create_missing_namespaces( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -298,7 +273,6 @@ def create_missing_namespaces( return self._create_missing_namespaces_oapg( query_params=query_params, path_params=path_params, - accept_content_types=accept_content_types, stream=stream, timeout=timeout, skip_deserialization=skip_deserialization @@ -313,7 +287,6 @@ def post( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -327,7 +300,6 @@ def post( skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -337,7 +309,6 @@ def post( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -350,7 +321,6 @@ def post( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -358,7 +328,6 @@ def post( return self._create_missing_namespaces_oapg( query_params=query_params, path_params=path_params, - accept_content_types=accept_content_types, stream=stream, timeout=timeout, skip_deserialization=skip_deserialization diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_missing_namespaces/post.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_missing_namespaces/post.pyi index 6e73666..6dc597e 100644 --- a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_missing_namespaces/post.pyi +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_missing_namespaces/post.pyi @@ -9,7 +9,6 @@ from dataclasses import dataclass import typing_extensions import urllib3 -from urllib3._collections import HTTPHeaderDict from apollo_openapi import api_client, exceptions from datetime import date, datetime # noqa: F401 @@ -93,27 +92,17 @@ request_path_cluster_name = api_client.PathParameter( schema=ClusterNameSchema, required=True, ) -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] + body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', ) @@ -123,7 +112,6 @@ class BaseApi(api_client.Api): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -137,7 +125,6 @@ class BaseApi(api_client.Api): skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -147,7 +134,6 @@ class BaseApi(api_client.Api): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -160,7 +146,6 @@ class BaseApi(api_client.Api): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -202,17 +187,11 @@ class BaseApi(api_client.Api): serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) for serialized_value in serialized_data.values(): used_path += serialized_value - - _headers = HTTPHeaderDict() # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) response = self.api_client.call_api( resource_path=used_path, method='post'.upper(), - headers=_headers, auth_settings=_auth, stream=stream, timeout=timeout, @@ -245,7 +224,6 @@ class CreateMissingNamespaces(BaseApi): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -259,7 +237,6 @@ class CreateMissingNamespaces(BaseApi): skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -269,7 +246,6 @@ class CreateMissingNamespaces(BaseApi): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -282,7 +258,6 @@ class CreateMissingNamespaces(BaseApi): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -290,7 +265,6 @@ class CreateMissingNamespaces(BaseApi): return self._create_missing_namespaces_oapg( query_params=query_params, path_params=path_params, - accept_content_types=accept_content_types, stream=stream, timeout=timeout, skip_deserialization=skip_deserialization @@ -305,7 +279,6 @@ class ApiForpost(BaseApi): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -319,7 +292,6 @@ class ApiForpost(BaseApi): skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -329,7 +301,6 @@ class ApiForpost(BaseApi): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -342,7 +313,6 @@ class ApiForpost(BaseApi): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -350,7 +320,6 @@ class ApiForpost(BaseApi): return self._create_missing_namespaces_oapg( query_params=query_params, path_params=path_params, - accept_content_types=accept_content_types, stream=stream, timeout=timeout, skip_deserialization=skip_deserialization diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/__init__.py new file mode 100644 index 0000000..eefe4b2 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_NAMESPACES_PERMISSIONINIT diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/post.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/post.py new file mode 100644 index 0000000..b26b3ac --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/post.py @@ -0,0 +1,334 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +ClusterNameSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'clusterName': typing.Union[ClusterNameSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_cluster_name = api_client.PathParameter( + name="clusterName", + style=api_client.ParameterStyle.SIMPLE, + schema=ClusterNameSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _init_cluster_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _init_cluster_namespace_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _init_cluster_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _init_cluster_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 初始化集群Namespace权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_cluster_name, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class InitClusterNamespacePermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def init_cluster_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def init_cluster_namespace_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def init_cluster_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def init_cluster_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._init_cluster_namespace_permission_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._init_cluster_namespace_permission_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/post.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/post.pyi new file mode 100644 index 0000000..a4f3783 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/post.pyi @@ -0,0 +1,326 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +ClusterNameSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'clusterName': typing.Union[ClusterNameSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_cluster_name = api_client.PathParameter( + name="clusterName", + style=api_client.ParameterStyle.SIMPLE, + schema=ClusterNameSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _init_cluster_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _init_cluster_namespace_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _init_cluster_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _init_cluster_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 初始化集群Namespace权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_cluster_name, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class InitClusterNamespacePermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def init_cluster_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def init_cluster_namespace_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def init_cluster_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def init_cluster_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._init_cluster_namespace_permission_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._init_cluster_namespace_permission_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/__init__.py new file mode 100644 index 0000000..d479b22 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_NAMESPACES_PERMISSIONS_PERMISSION_TYPE diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/get.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/get.py new file mode 100644 index 0000000..f233a03 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/get.py @@ -0,0 +1,377 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO + +from . import path + +# Query params +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +ClusterNameSchema = schemas.StrSchema +PermissionTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'clusterName': typing.Union[ClusterNameSchema, str, ], + 'permissionType': typing.Union[PermissionTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_cluster_name = api_client.PathParameter( + name="clusterName", + style=api_client.ParameterStyle.SIMPLE, + schema=ClusterNameSchema, + required=True, +) +request_path_permission_type = api_client.PathParameter( + name="permissionType", + style=api_client.ParameterStyle.SIMPLE, + schema=PermissionTypeSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] +SchemaFor200ResponseBodyApplicationJson = OpenPermissionConditionDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _has_cluster_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _has_cluster_namespace_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _has_cluster_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _has_cluster_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 校验集群Namespace权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_cluster_name, + request_path_permission_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class HasClusterNamespacePermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def has_cluster_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def has_cluster_namespace_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def has_cluster_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def has_cluster_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_cluster_namespace_permission_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_cluster_namespace_permission_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/get.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/get.pyi new file mode 100644 index 0000000..3a7f6ed --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/get.pyi @@ -0,0 +1,369 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO + +# Query params +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +ClusterNameSchema = schemas.StrSchema +PermissionTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'clusterName': typing.Union[ClusterNameSchema, str, ], + 'permissionType': typing.Union[PermissionTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_cluster_name = api_client.PathParameter( + name="clusterName", + style=api_client.ParameterStyle.SIMPLE, + schema=ClusterNameSchema, + required=True, +) +request_path_permission_type = api_client.PathParameter( + name="permissionType", + style=api_client.ParameterStyle.SIMPLE, + schema=PermissionTypeSchema, + required=True, +) +SchemaFor200ResponseBodyApplicationJson = OpenPermissionConditionDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _has_cluster_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _has_cluster_namespace_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _has_cluster_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _has_cluster_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 校验集群Namespace权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_cluster_name, + request_path_permission_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class HasClusterNamespacePermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def has_cluster_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def has_cluster_namespace_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def has_cluster_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def has_cluster_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_cluster_namespace_permission_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_cluster_namespace_permission_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/__init__.py new file mode 100644 index 0000000..edc8e32 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_NAMESPACES_ROLEUSERS diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/get.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/get.py new file mode 100644 index 0000000..64dea30 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/get.py @@ -0,0 +1,313 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_cluster_namespace_role_user_dto import OpenClusterNamespaceRoleUserDTO + +from . import path + +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +ClusterNameSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'clusterName': typing.Union[ClusterNameSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_cluster_name = api_client.PathParameter( + name="clusterName", + style=api_client.ParameterStyle.SIMPLE, + schema=ClusterNameSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] +SchemaFor200ResponseBodyApplicationJson = OpenClusterNamespaceRoleUserDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_cluster_namespace_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _get_cluster_namespace_roles_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_cluster_namespace_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_cluster_namespace_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 获取集群Namespace用户 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_cluster_name, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetClusterNamespaceRoles(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def get_cluster_namespace_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get_cluster_namespace_roles( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_cluster_namespace_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_cluster_namespace_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_cluster_namespace_roles_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_cluster_namespace_roles_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/get.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/get.pyi new file mode 100644 index 0000000..d9a45df --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/get.pyi @@ -0,0 +1,305 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_cluster_namespace_role_user_dto import OpenClusterNamespaceRoleUserDTO + +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +ClusterNameSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'clusterName': typing.Union[ClusterNameSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_cluster_name = api_client.PathParameter( + name="clusterName", + style=api_client.ParameterStyle.SIMPLE, + schema=ClusterNameSchema, + required=True, +) +SchemaFor200ResponseBodyApplicationJson = OpenClusterNamespaceRoleUserDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_cluster_namespace_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _get_cluster_namespace_roles_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_cluster_namespace_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_cluster_namespace_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 获取集群Namespace用户 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_cluster_name, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetClusterNamespaceRoles(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def get_cluster_namespace_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get_cluster_namespace_roles( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_cluster_namespace_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_cluster_namespace_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_cluster_namespace_roles_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_cluster_namespace_roles_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/__init__.py new file mode 100644 index 0000000..1bebcfd --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_CLUSTERS_CLUSTER_NAME_ROLES_ROLE_TYPE diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/delete.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/delete.py new file mode 100644 index 0000000..ad5e9ec --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/delete.py @@ -0,0 +1,353 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +ClusterNameSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'clusterName': typing.Union[ClusterNameSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_cluster_name = api_client.PathParameter( + name="clusterName", + style=api_client.ParameterStyle.SIMPLE, + schema=ClusterNameSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _remove_cluster_namespace_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _remove_cluster_namespace_role_from_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _remove_cluster_namespace_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _remove_cluster_namespace_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 移除集群Namespace角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_cluster_name, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class RemoveClusterNamespaceRoleFromUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def remove_cluster_namespace_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def remove_cluster_namespace_role_from_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def remove_cluster_namespace_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def remove_cluster_namespace_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_cluster_namespace_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_cluster_namespace_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/delete.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/delete.pyi new file mode 100644 index 0000000..42ffe4a --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/delete.pyi @@ -0,0 +1,345 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +ClusterNameSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'clusterName': typing.Union[ClusterNameSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_cluster_name = api_client.PathParameter( + name="clusterName", + style=api_client.ParameterStyle.SIMPLE, + schema=ClusterNameSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _remove_cluster_namespace_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _remove_cluster_namespace_role_from_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _remove_cluster_namespace_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _remove_cluster_namespace_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 移除集群Namespace角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_cluster_name, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class RemoveClusterNamespaceRoleFromUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def remove_cluster_namespace_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def remove_cluster_namespace_role_from_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def remove_cluster_namespace_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def remove_cluster_namespace_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_cluster_namespace_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_cluster_namespace_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/post.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/post.py new file mode 100644 index 0000000..b8cfeaa --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/post.py @@ -0,0 +1,353 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +ClusterNameSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'clusterName': typing.Union[ClusterNameSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_cluster_name = api_client.PathParameter( + name="clusterName", + style=api_client.ParameterStyle.SIMPLE, + schema=ClusterNameSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _assign_cluster_namespace_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _assign_cluster_namespace_role_to_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _assign_cluster_namespace_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _assign_cluster_namespace_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 分配集群Namespace角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_cluster_name, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AssignClusterNamespaceRoleToUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def assign_cluster_namespace_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def assign_cluster_namespace_role_to_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def assign_cluster_namespace_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def assign_cluster_namespace_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_cluster_namespace_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_cluster_namespace_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/post.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/post.pyi new file mode 100644 index 0000000..9596621 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/post.pyi @@ -0,0 +1,345 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +ClusterNameSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'clusterName': typing.Union[ClusterNameSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_cluster_name = api_client.PathParameter( + name="clusterName", + style=api_client.ParameterStyle.SIMPLE, + schema=ClusterNameSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _assign_cluster_namespace_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _assign_cluster_namespace_role_to_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _assign_cluster_namespace_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _assign_cluster_namespace_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 分配集群Namespace角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_cluster_name, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AssignClusterNamespaceRoleToUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def assign_cluster_namespace_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def assign_cluster_namespace_role_to_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def assign_cluster_namespace_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def assign_cluster_namespace_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_cluster_namespace_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_cluster_namespace_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/__init__.py new file mode 100644 index 0000000..04a24b5 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_NAMESPACES_NAMESPACE_NAME_PERMISSIONS_PERMISSION_TYPE diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/get.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/get.py similarity index 86% rename from python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/get.py rename to python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/get.py index e8fd38e..a447685 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/get.py +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/get.py @@ -25,18 +25,16 @@ from apollo_openapi import schemas # noqa: F401 -from apollo_openapi.model.open_release_bo import OpenReleaseBO +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO from . import path # Query params -PageSchema = schemas.IntSchema -SizeSchema = schemas.IntSchema +UserIdSchema = schemas.StrSchema RequestRequiredQueryParams = typing_extensions.TypedDict( 'RequestRequiredQueryParams', { - 'page': typing.Union[PageSchema, decimal.Decimal, int, ], - 'size': typing.Union[SizeSchema, decimal.Decimal, int, ], + 'userId': typing.Union[UserIdSchema, str, ], } ) RequestOptionalQueryParams = typing_extensions.TypedDict( @@ -51,32 +49,25 @@ class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams) pass -request_query_page = api_client.QueryParameter( - name="page", +request_query_user_id = api_client.QueryParameter( + name="userId", style=api_client.ParameterStyle.FORM, - schema=PageSchema, - required=True, - explode=True, -) -request_query_size = api_client.QueryParameter( - name="size", - style=api_client.ParameterStyle.FORM, - schema=SizeSchema, + schema=UserIdSchema, required=True, explode=True, ) # Path params AppIdSchema = schemas.StrSchema EnvSchema = schemas.StrSchema -ClusterNameSchema = schemas.StrSchema NamespaceNameSchema = schemas.StrSchema +PermissionTypeSchema = schemas.StrSchema RequestRequiredPathParams = typing_extensions.TypedDict( 'RequestRequiredPathParams', { 'appId': typing.Union[AppIdSchema, str, ], 'env': typing.Union[EnvSchema, str, ], - 'clusterName': typing.Union[ClusterNameSchema, str, ], 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'permissionType': typing.Union[PermissionTypeSchema, str, ], } ) RequestOptionalPathParams = typing_extensions.TypedDict( @@ -103,47 +94,22 @@ class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): schema=EnvSchema, required=True, ) -request_path_cluster_name = api_client.PathParameter( - name="clusterName", - style=api_client.ParameterStyle.SIMPLE, - schema=ClusterNameSchema, - required=True, -) request_path_namespace_name = api_client.PathParameter( name="namespaceName", style=api_client.ParameterStyle.SIMPLE, schema=NamespaceNameSchema, required=True, ) +request_path_permission_type = api_client.PathParameter( + name="permissionType", + style=api_client.ParameterStyle.SIMPLE, + schema=PermissionTypeSchema, + required=True, +) _auth = [ 'ApiKeyAuth', ] - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['OpenReleaseBO']: - return OpenReleaseBO - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['OpenReleaseBO'], typing.List['OpenReleaseBO']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'OpenReleaseBO': - return super().__getitem__(i) +SchemaFor200ResponseBodyApplicationJson = OpenPermissionConditionDTO @dataclass @@ -172,7 +138,7 @@ class ApiResponseFor200(api_client.ApiResponse): class BaseApi(api_client.Api): @typing.overload - def _find_all_releases_oapg( + def _has_env_namespace_permission_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), @@ -185,7 +151,7 @@ def _find_all_releases_oapg( ]: ... @typing.overload - def _find_all_releases_oapg( + def _has_env_namespace_permission_oapg( self, skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), @@ -196,7 +162,7 @@ def _find_all_releases_oapg( ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload - def _find_all_releases_oapg( + def _has_env_namespace_permission_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), @@ -209,7 +175,7 @@ def _find_all_releases_oapg( api_client.ApiResponseWithoutDeserialization, ]: ... - def _find_all_releases_oapg( + def _has_env_namespace_permission_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), @@ -219,7 +185,7 @@ def _find_all_releases_oapg( skip_deserialization: bool = False, ): """ - 获取所有发布(分页) (new added) + 校验环境Namespace权限 (new added) :param skip_deserialization: If true then api_response.response will be set but api_response.body and api_response.headers will not be deserialized into schema class instances @@ -232,8 +198,8 @@ class instances for parameter in ( request_path_app_id, request_path_env, - request_path_cluster_name, request_path_namespace_name, + request_path_permission_type, ): parameter_data = path_params.get(parameter.name, schemas.unset) if parameter_data is schemas.unset: @@ -246,8 +212,7 @@ class instances prefix_separator_iterator = None for parameter in ( - request_query_page, - request_query_size, + request_query_user_id, ): parameter_data = query_params.get(parameter.name, schemas.unset) if parameter_data is schemas.unset: @@ -292,11 +257,11 @@ class instances return api_response -class FindAllReleases(BaseApi): +class HasEnvNamespacePermission(BaseApi): # this class is used by api classes that refer to endpoints with operationId fn names @typing.overload - def find_all_releases( + def has_env_namespace_permission( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), @@ -309,7 +274,7 @@ def find_all_releases( ]: ... @typing.overload - def find_all_releases( + def has_env_namespace_permission( self, skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), @@ -320,7 +285,7 @@ def find_all_releases( ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload - def find_all_releases( + def has_env_namespace_permission( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), @@ -333,7 +298,7 @@ def find_all_releases( api_client.ApiResponseWithoutDeserialization, ]: ... - def find_all_releases( + def has_env_namespace_permission( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), @@ -342,7 +307,7 @@ def find_all_releases( timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, ): - return self._find_all_releases_oapg( + return self._has_env_namespace_permission_oapg( query_params=query_params, path_params=path_params, accept_content_types=accept_content_types, @@ -402,7 +367,7 @@ def get( timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, ): - return self._find_all_releases_oapg( + return self._has_env_namespace_permission_oapg( query_params=query_params, path_params=path_params, accept_content_types=accept_content_types, diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/get.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/get.pyi similarity index 86% rename from python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/get.pyi rename to python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/get.pyi index 3ccc481..618ca24 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/get.pyi +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/get.pyi @@ -25,16 +25,14 @@ import frozendict # noqa: F401 from apollo_openapi import schemas # noqa: F401 -from apollo_openapi.model.open_release_bo import OpenReleaseBO +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO # Query params -PageSchema = schemas.IntSchema -SizeSchema = schemas.IntSchema +UserIdSchema = schemas.StrSchema RequestRequiredQueryParams = typing_extensions.TypedDict( 'RequestRequiredQueryParams', { - 'page': typing.Union[PageSchema, decimal.Decimal, int, ], - 'size': typing.Union[SizeSchema, decimal.Decimal, int, ], + 'userId': typing.Union[UserIdSchema, str, ], } ) RequestOptionalQueryParams = typing_extensions.TypedDict( @@ -49,32 +47,25 @@ class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams) pass -request_query_page = api_client.QueryParameter( - name="page", +request_query_user_id = api_client.QueryParameter( + name="userId", style=api_client.ParameterStyle.FORM, - schema=PageSchema, - required=True, - explode=True, -) -request_query_size = api_client.QueryParameter( - name="size", - style=api_client.ParameterStyle.FORM, - schema=SizeSchema, + schema=UserIdSchema, required=True, explode=True, ) # Path params AppIdSchema = schemas.StrSchema EnvSchema = schemas.StrSchema -ClusterNameSchema = schemas.StrSchema NamespaceNameSchema = schemas.StrSchema +PermissionTypeSchema = schemas.StrSchema RequestRequiredPathParams = typing_extensions.TypedDict( 'RequestRequiredPathParams', { 'appId': typing.Union[AppIdSchema, str, ], 'env': typing.Union[EnvSchema, str, ], - 'clusterName': typing.Union[ClusterNameSchema, str, ], 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'permissionType': typing.Union[PermissionTypeSchema, str, ], } ) RequestOptionalPathParams = typing_extensions.TypedDict( @@ -101,44 +92,19 @@ request_path_env = api_client.PathParameter( schema=EnvSchema, required=True, ) -request_path_cluster_name = api_client.PathParameter( - name="clusterName", - style=api_client.ParameterStyle.SIMPLE, - schema=ClusterNameSchema, - required=True, -) request_path_namespace_name = api_client.PathParameter( name="namespaceName", style=api_client.ParameterStyle.SIMPLE, schema=NamespaceNameSchema, required=True, ) - - -class SchemaFor200ResponseBodyApplicationJson( - schemas.ListSchema -): - - - class MetaOapg: - - @staticmethod - def items() -> typing.Type['OpenReleaseBO']: - return OpenReleaseBO - - def __new__( - cls, - _arg: typing.Union[typing.Tuple['OpenReleaseBO'], typing.List['OpenReleaseBO']], - _configuration: typing.Optional[schemas.Configuration] = None, - ) -> 'SchemaFor200ResponseBodyApplicationJson': - return super().__new__( - cls, - _arg, - _configuration=_configuration, - ) - - def __getitem__(self, i: int) -> 'OpenReleaseBO': - return super().__getitem__(i) +request_path_permission_type = api_client.PathParameter( + name="permissionType", + style=api_client.ParameterStyle.SIMPLE, + schema=PermissionTypeSchema, + required=True, +) +SchemaFor200ResponseBodyApplicationJson = OpenPermissionConditionDTO @dataclass @@ -164,7 +130,7 @@ _all_accept_content_types = ( class BaseApi(api_client.Api): @typing.overload - def _find_all_releases_oapg( + def _has_env_namespace_permission_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), @@ -177,7 +143,7 @@ class BaseApi(api_client.Api): ]: ... @typing.overload - def _find_all_releases_oapg( + def _has_env_namespace_permission_oapg( self, skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), @@ -188,7 +154,7 @@ class BaseApi(api_client.Api): ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload - def _find_all_releases_oapg( + def _has_env_namespace_permission_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), @@ -201,7 +167,7 @@ class BaseApi(api_client.Api): api_client.ApiResponseWithoutDeserialization, ]: ... - def _find_all_releases_oapg( + def _has_env_namespace_permission_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), @@ -211,7 +177,7 @@ class BaseApi(api_client.Api): skip_deserialization: bool = False, ): """ - 获取所有发布(分页) (new added) + 校验环境Namespace权限 (new added) :param skip_deserialization: If true then api_response.response will be set but api_response.body and api_response.headers will not be deserialized into schema class instances @@ -224,8 +190,8 @@ class BaseApi(api_client.Api): for parameter in ( request_path_app_id, request_path_env, - request_path_cluster_name, request_path_namespace_name, + request_path_permission_type, ): parameter_data = path_params.get(parameter.name, schemas.unset) if parameter_data is schemas.unset: @@ -238,8 +204,7 @@ class BaseApi(api_client.Api): prefix_separator_iterator = None for parameter in ( - request_query_page, - request_query_size, + request_query_user_id, ): parameter_data = query_params.get(parameter.name, schemas.unset) if parameter_data is schemas.unset: @@ -284,11 +249,11 @@ class BaseApi(api_client.Api): return api_response -class FindAllReleases(BaseApi): +class HasEnvNamespacePermission(BaseApi): # this class is used by api classes that refer to endpoints with operationId fn names @typing.overload - def find_all_releases( + def has_env_namespace_permission( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), @@ -301,7 +266,7 @@ class FindAllReleases(BaseApi): ]: ... @typing.overload - def find_all_releases( + def has_env_namespace_permission( self, skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), @@ -312,7 +277,7 @@ class FindAllReleases(BaseApi): ) -> api_client.ApiResponseWithoutDeserialization: ... @typing.overload - def find_all_releases( + def has_env_namespace_permission( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), @@ -325,7 +290,7 @@ class FindAllReleases(BaseApi): api_client.ApiResponseWithoutDeserialization, ]: ... - def find_all_releases( + def has_env_namespace_permission( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), @@ -334,7 +299,7 @@ class FindAllReleases(BaseApi): timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, ): - return self._find_all_releases_oapg( + return self._has_env_namespace_permission_oapg( query_params=query_params, path_params=path_params, accept_content_types=accept_content_types, @@ -394,7 +359,7 @@ class ApiForget(BaseApi): timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, ): - return self._find_all_releases_oapg( + return self._has_env_namespace_permission_oapg( query_params=query_params, path_params=path_params, accept_content_types=accept_content_types, diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/__init__.py new file mode 100644 index 0000000..d5fa1dd --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_NAMESPACES_NAMESPACE_NAME_ROLEUSERS diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/get.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/get.py new file mode 100644 index 0000000..b6799d1 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/get.py @@ -0,0 +1,313 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_env_namespace_role_user_dto import OpenEnvNamespaceRoleUserDTO + +from . import path + +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] +SchemaFor200ResponseBodyApplicationJson = OpenEnvNamespaceRoleUserDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_namespace_env_role_users_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _get_namespace_env_role_users_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_namespace_env_role_users_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_namespace_env_role_users_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 获取环境Namespace用户 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_namespace_name, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetNamespaceEnvRoleUsers(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def get_namespace_env_role_users( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get_namespace_env_role_users( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_namespace_env_role_users( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_namespace_env_role_users( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_namespace_env_role_users_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_namespace_env_role_users_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/get.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/get.pyi new file mode 100644 index 0000000..5009776 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/get.pyi @@ -0,0 +1,305 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_env_namespace_role_user_dto import OpenEnvNamespaceRoleUserDTO + +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +SchemaFor200ResponseBodyApplicationJson = OpenEnvNamespaceRoleUserDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_namespace_env_role_users_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _get_namespace_env_role_users_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_namespace_env_role_users_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_namespace_env_role_users_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 获取环境Namespace用户 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_namespace_name, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetNamespaceEnvRoleUsers(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def get_namespace_env_role_users( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get_namespace_env_role_users( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_namespace_env_role_users( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_namespace_env_role_users( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_namespace_env_role_users_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_namespace_env_role_users_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/__init__.py new file mode 100644 index 0000000..2eb0536 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ENVS_ENV_NAMESPACES_NAMESPACE_NAME_ROLES_ROLE_TYPE diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/delete.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/delete.py new file mode 100644 index 0000000..1dcf073 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/delete.py @@ -0,0 +1,353 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _remove_namespace_env_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _remove_namespace_env_role_from_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _remove_namespace_env_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _remove_namespace_env_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 移除环境Namespace角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_namespace_name, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class RemoveNamespaceEnvRoleFromUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def remove_namespace_env_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def remove_namespace_env_role_from_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def remove_namespace_env_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def remove_namespace_env_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_namespace_env_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_namespace_env_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/delete.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/delete.pyi new file mode 100644 index 0000000..1c453d9 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/delete.pyi @@ -0,0 +1,345 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _remove_namespace_env_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _remove_namespace_env_role_from_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _remove_namespace_env_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _remove_namespace_env_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 移除环境Namespace角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_namespace_name, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class RemoveNamespaceEnvRoleFromUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def remove_namespace_env_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def remove_namespace_env_role_from_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def remove_namespace_env_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def remove_namespace_env_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_namespace_env_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_namespace_env_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/post.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/post.py new file mode 100644 index 0000000..3c0d682 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/post.py @@ -0,0 +1,353 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _assign_namespace_env_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _assign_namespace_env_role_to_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _assign_namespace_env_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _assign_namespace_env_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 分配环境Namespace角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_namespace_name, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AssignNamespaceEnvRoleToUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def assign_namespace_env_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def assign_namespace_env_role_to_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def assign_namespace_env_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def assign_namespace_env_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_namespace_env_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_namespace_env_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/post.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/post.pyi new file mode 100644 index 0000000..ce088a1 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/post.pyi @@ -0,0 +1,345 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +EnvSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'env': typing.Union[EnvSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _assign_namespace_env_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _assign_namespace_env_role_to_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _assign_namespace_env_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _assign_namespace_env_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 分配环境Namespace角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_env, + request_path_namespace_name, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AssignNamespaceEnvRoleToUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def assign_namespace_env_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def assign_namespace_env_role_to_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def assign_namespace_env_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def assign_namespace_env_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_namespace_env_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_namespace_env_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/__init__.py new file mode 100644 index 0000000..71361dd --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_permission_init import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_PERMISSIONINIT diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/post.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/post.py new file mode 100644 index 0000000..762c76c --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/post.py @@ -0,0 +1,325 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _init_app_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _init_app_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _init_app_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _init_app_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 初始化应用权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_namespace_name, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class InitAppPermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def init_app_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def init_app_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def init_app_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def init_app_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._init_app_permission_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._init_app_permission_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/post.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/post.pyi new file mode 100644 index 0000000..4f25cc6 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/post.pyi @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _init_app_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _init_app_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _init_app_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _init_app_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 初始化应用权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_namespace_name, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class InitAppPermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def init_app_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def init_app_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def init_app_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def init_app_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._init_app_permission_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._init_app_permission_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/__init__.py new file mode 100644 index 0000000..7737627 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_PERMISSIONS_PERMISSION_TYPE diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/get.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/get.py new file mode 100644 index 0000000..2c657cf --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/get.py @@ -0,0 +1,368 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO + +from . import path + +# Query params +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +PermissionTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'permissionType': typing.Union[PermissionTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +request_path_permission_type = api_client.PathParameter( + name="permissionType", + style=api_client.ParameterStyle.SIMPLE, + schema=PermissionTypeSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] +SchemaFor200ResponseBodyApplicationJson = OpenPermissionConditionDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _has_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _has_namespace_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _has_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _has_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 校验Namespace权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_namespace_name, + request_path_permission_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class HasNamespacePermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def has_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def has_namespace_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def has_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def has_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_namespace_permission_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_namespace_permission_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/get.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/get.pyi new file mode 100644 index 0000000..213c0df --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/get.pyi @@ -0,0 +1,360 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO + +# Query params +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +PermissionTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'permissionType': typing.Union[PermissionTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +request_path_permission_type = api_client.PathParameter( + name="permissionType", + style=api_client.ParameterStyle.SIMPLE, + schema=PermissionTypeSchema, + required=True, +) +SchemaFor200ResponseBodyApplicationJson = OpenPermissionConditionDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _has_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _has_namespace_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _has_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _has_namespace_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 校验Namespace权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_namespace_name, + request_path_permission_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class HasNamespacePermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def has_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def has_namespace_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def has_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def has_namespace_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_namespace_permission_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_namespace_permission_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users/__init__.py new file mode 100644 index 0000000..d386af8 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_role_users import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_ROLEUSERS diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users/get.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users/get.py new file mode 100644 index 0000000..127d34a --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users/get.py @@ -0,0 +1,304 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_namespace_role_user_dto import OpenNamespaceRoleUserDTO + +from . import path + +# Path params +AppIdSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] +SchemaFor200ResponseBodyApplicationJson = OpenNamespaceRoleUserDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_namespace_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _get_namespace_roles_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_namespace_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_namespace_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 获取Namespace用户 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_namespace_name, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetNamespaceRoles(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def get_namespace_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get_namespace_roles( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_namespace_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_namespace_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_namespace_roles_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_namespace_roles_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users/get.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users/get.pyi new file mode 100644 index 0000000..4ceca9a --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_role_users/get.pyi @@ -0,0 +1,296 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_namespace_role_user_dto import OpenNamespaceRoleUserDTO + +# Path params +AppIdSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +SchemaFor200ResponseBodyApplicationJson = OpenNamespaceRoleUserDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_namespace_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _get_namespace_roles_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_namespace_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_namespace_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 获取Namespace用户 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_namespace_name, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetNamespaceRoles(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def get_namespace_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get_namespace_roles( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_namespace_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_namespace_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_namespace_roles_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_namespace_roles_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/__init__.py new file mode 100644 index 0000000..99fe1db --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_NAMESPACES_NAMESPACE_NAME_ROLES_ROLE_TYPE diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/delete.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/delete.py new file mode 100644 index 0000000..90f40c5 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/delete.py @@ -0,0 +1,344 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _remove_namespace_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _remove_namespace_role_from_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _remove_namespace_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _remove_namespace_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 移除Namespace角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_namespace_name, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class RemoveNamespaceRoleFromUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def remove_namespace_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def remove_namespace_role_from_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def remove_namespace_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def remove_namespace_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_namespace_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_namespace_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/delete.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/delete.pyi new file mode 100644 index 0000000..2b55cf2 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/delete.pyi @@ -0,0 +1,336 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _remove_namespace_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _remove_namespace_role_from_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _remove_namespace_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _remove_namespace_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 移除Namespace角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_namespace_name, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class RemoveNamespaceRoleFromUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def remove_namespace_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def remove_namespace_role_from_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def remove_namespace_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def remove_namespace_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_namespace_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_namespace_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/post.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/post.py new file mode 100644 index 0000000..8981ba9 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/post.py @@ -0,0 +1,344 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _assign_namespace_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _assign_namespace_role_to_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _assign_namespace_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _assign_namespace_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 分配Namespace角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_namespace_name, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AssignNamespaceRoleToUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def assign_namespace_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def assign_namespace_role_to_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def assign_namespace_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def assign_namespace_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_namespace_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_namespace_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/post.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/post.pyi new file mode 100644 index 0000000..1c562e5 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/post.pyi @@ -0,0 +1,336 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +NamespaceNameSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_namespace_name = api_client.PathParameter( + name="namespaceName", + style=api_client.ParameterStyle.SIMPLE, + schema=NamespaceNameSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _assign_namespace_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _assign_namespace_role_to_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _assign_namespace_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _assign_namespace_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 分配Namespace角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_namespace_name, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AssignNamespaceRoleToUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def assign_namespace_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def assign_namespace_role_to_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def assign_namespace_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def assign_namespace_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_namespace_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_namespace_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_permissions_permission_type/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_permissions_permission_type/__init__.py new file mode 100644 index 0000000..a07fd7a --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_permissions_permission_type/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_permissions_permission_type import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_PERMISSIONS_PERMISSION_TYPE diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_permissions_permission_type/get.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_permissions_permission_type/get.py new file mode 100644 index 0000000..6f27f42 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_permissions_permission_type/get.py @@ -0,0 +1,359 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO + +from . import path + +# Query params +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +PermissionTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'permissionType': typing.Union[PermissionTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_permission_type = api_client.PathParameter( + name="permissionType", + style=api_client.ParameterStyle.SIMPLE, + schema=PermissionTypeSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] +SchemaFor200ResponseBodyApplicationJson = OpenPermissionConditionDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _has_app_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _has_app_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _has_app_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _has_app_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 校验应用权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_permission_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class HasAppPermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def has_app_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def has_app_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def has_app_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def has_app_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_app_permission_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_app_permission_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_permissions_permission_type/get.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_permissions_permission_type/get.pyi new file mode 100644 index 0000000..f2fce34 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_permissions_permission_type/get.pyi @@ -0,0 +1,351 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO + +# Query params +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +PermissionTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'permissionType': typing.Union[PermissionTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_permission_type = api_client.PathParameter( + name="permissionType", + style=api_client.ParameterStyle.SIMPLE, + schema=PermissionTypeSchema, + required=True, +) +SchemaFor200ResponseBodyApplicationJson = OpenPermissionConditionDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _has_app_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _has_app_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _has_app_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _has_app_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 校验应用权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_permission_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class HasAppPermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def has_app_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def has_app_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def has_app_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def has_app_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_app_permission_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_app_permission_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_role_users/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_role_users/__init__.py new file mode 100644 index 0000000..87c5b74 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_role_users/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_role_users import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ROLEUSERS diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_role_users/get.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_role_users/get.py new file mode 100644 index 0000000..cf6f4a6 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_role_users/get.py @@ -0,0 +1,295 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_app_role_user_dto import OpenAppRoleUserDTO + +from . import path + +# Path params +AppIdSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] +SchemaFor200ResponseBodyApplicationJson = OpenAppRoleUserDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_app_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _get_app_roles_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_app_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_app_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 获取应用角色用户 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetAppRoles(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def get_app_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get_app_roles( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_app_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_app_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_app_roles_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_app_roles_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_role_users/get.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_role_users/get.pyi new file mode 100644 index 0000000..24304d1 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_role_users/get.pyi @@ -0,0 +1,287 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_app_role_user_dto import OpenAppRoleUserDTO + +# Path params +AppIdSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +SchemaFor200ResponseBodyApplicationJson = OpenAppRoleUserDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_app_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _get_app_roles_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_app_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_app_roles_oapg( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 获取应用角色用户 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetAppRoles(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def get_app_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get_app_roles( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_app_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_app_roles( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_app_roles_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_app_roles_oapg( + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/__init__.py new file mode 100644 index 0000000..97c3850 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_roles_master import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ROLES_MASTER diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/delete.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/delete.py new file mode 100644 index 0000000..3737c7f --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/delete.py @@ -0,0 +1,326 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _remove_manage_app_master_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _remove_manage_app_master_role_from_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _remove_manage_app_master_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _remove_manage_app_master_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 移除AppMaster (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class RemoveManageAppMasterRoleFromUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def remove_manage_app_master_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def remove_manage_app_master_role_from_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def remove_manage_app_master_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def remove_manage_app_master_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_manage_app_master_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_manage_app_master_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/delete.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/delete.pyi new file mode 100644 index 0000000..ae103b0 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/delete.pyi @@ -0,0 +1,318 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _remove_manage_app_master_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _remove_manage_app_master_role_from_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _remove_manage_app_master_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _remove_manage_app_master_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 移除AppMaster (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class RemoveManageAppMasterRoleFromUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def remove_manage_app_master_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def remove_manage_app_master_role_from_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def remove_manage_app_master_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def remove_manage_app_master_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_manage_app_master_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_manage_app_master_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/post.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/post.py new file mode 100644 index 0000000..cacdbdc --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/post.py @@ -0,0 +1,326 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _add_manage_app_master_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _add_manage_app_master_role_to_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _add_manage_app_master_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _add_manage_app_master_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 分配AppMaster (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AddManageAppMasterRoleToUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def add_manage_app_master_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def add_manage_app_master_role_to_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def add_manage_app_master_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def add_manage_app_master_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._add_manage_app_master_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._add_manage_app_master_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/post.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/post.pyi new file mode 100644 index 0000000..cd7ccb3 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_master/post.pyi @@ -0,0 +1,318 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _add_manage_app_master_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _add_manage_app_master_role_to_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _add_manage_app_master_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _add_manage_app_master_role_to_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 分配AppMaster (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AddManageAppMasterRoleToUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def add_manage_app_master_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def add_manage_app_master_role_to_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def add_manage_app_master_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def add_manage_app_master_role_to_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._add_manage_app_master_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._add_manage_app_master_role_to_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/__init__.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/__init__.py new file mode 100644 index 0000000..6104a19 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_apps_app_id_roles_role_type import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_APPS_APP_ID_ROLES_ROLE_TYPE diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/delete.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/delete.py new file mode 100644 index 0000000..fc1bc4b --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/delete.py @@ -0,0 +1,335 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _remove_app_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _remove_app_role_from_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _remove_app_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _remove_app_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 移除应用角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class RemoveAppRoleFromUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def remove_app_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def remove_app_role_from_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def remove_app_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def remove_app_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_app_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_app_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/delete.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/delete.pyi new file mode 100644 index 0000000..92405b2 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/delete.pyi @@ -0,0 +1,327 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _remove_app_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _remove_app_role_from_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _remove_app_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _remove_app_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 移除应用角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class RemoveAppRoleFromUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def remove_app_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def remove_app_role_from_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def remove_app_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def remove_app_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_app_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._remove_app_role_from_user_oapg( + query_params=query_params, + path_params=path_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/post.py b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/post.py new file mode 100644 index 0000000..a6547f1 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/post.py @@ -0,0 +1,433 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) +# body param +SchemaForRequestBodyApplicationJson = schemas.StrSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _assign_app_role_to_user_oapg( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _assign_app_role_to_user_oapg( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + + @typing.overload + def _assign_app_role_to_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _assign_app_role_to_user_oapg( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _assign_app_role_to_user_oapg( + self, + content_type: str = 'application/json', + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 分配应用角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AssignAppRoleToUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def assign_app_role_to_user( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def assign_app_role_to_user( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + + @typing.overload + def assign_app_role_to_user( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def assign_app_role_to_user( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def assign_app_role_to_user( + self, + content_type: str = 'application/json', + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_app_role_to_user_oapg( + body=body, + query_params=query_params, + path_params=path_params, + content_type=content_type, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_app_role_to_user_oapg( + body=body, + query_params=query_params, + path_params=path_params, + content_type=content_type, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/post.pyi b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/post.pyi new file mode 100644 index 0000000..0e6e44e --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_apps_app_id_roles_role_type/post.pyi @@ -0,0 +1,425 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +# Path params +AppIdSchema = schemas.StrSchema +RoleTypeSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'appId': typing.Union[AppIdSchema, str, ], + 'roleType': typing.Union[RoleTypeSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_app_id = api_client.PathParameter( + name="appId", + style=api_client.ParameterStyle.SIMPLE, + schema=AppIdSchema, + required=True, +) +request_path_role_type = api_client.PathParameter( + name="roleType", + style=api_client.ParameterStyle.SIMPLE, + schema=RoleTypeSchema, + required=True, +) +# body param +SchemaForRequestBodyApplicationJson = schemas.StrSchema + + +request_body_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _assign_app_role_to_user_oapg( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _assign_app_role_to_user_oapg( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + + @typing.overload + def _assign_app_role_to_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _assign_app_role_to_user_oapg( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _assign_app_role_to_user_oapg( + self, + content_type: str = 'application/json', + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 分配应用角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_app_id, + request_path_role_type, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AssignAppRoleToUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def assign_app_role_to_user( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def assign_app_role_to_user( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + + @typing.overload + def assign_app_role_to_user( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def assign_app_role_to_user( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def assign_app_role_to_user( + self, + content_type: str = 'application/json', + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_app_role_to_user_oapg( + body=body, + query_params=query_params, + path_params=path_params, + content_type=content_type, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[SchemaForRequestBodyApplicationJson, str, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._assign_app_role_to_user_oapg( + body=body, + query_params=query_params, + path_params=path_params, + content_type=content_type, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_apps_envs_env/post.py b/python/apollo_openapi/paths/openapi_v1_apps_envs_env/post.py index 1e54681..581c089 100644 --- a/python/apollo_openapi/paths/openapi_v1_apps_envs_env/post.py +++ b/python/apollo_openapi/paths/openapi_v1_apps_envs_env/post.py @@ -96,24 +96,17 @@ class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): _auth = [ 'ApiKeyAuth', ] -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] + body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, ) SchemaFor400ResponseBodyApplicationJson = ExceptionResponse diff --git a/python/apollo_openapi/paths/openapi_v1_apps_envs_env/post.pyi b/python/apollo_openapi/paths/openapi_v1_apps_envs_env/post.pyi index 0ef02df..394d528 100644 --- a/python/apollo_openapi/paths/openapi_v1_apps_envs_env/post.pyi +++ b/python/apollo_openapi/paths/openapi_v1_apps_envs_env/post.pyi @@ -91,24 +91,17 @@ request_body_open_app_dto = api_client.RequestBody( }, required=True, ) -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] + body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, ) SchemaFor400ResponseBodyApplicationJson = ExceptionResponse diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name/delete.py b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name/delete.py index cca0bee..5854cc4 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name/delete.py +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name/delete.py @@ -100,24 +100,17 @@ class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): _auth = [ 'ApiKeyAuth', ] -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] + body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, ) SchemaFor400ResponseBodyApplicationJson = ExceptionResponse diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name/delete.pyi b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name/delete.pyi index a8bb963..3582363 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name/delete.pyi +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name/delete.pyi @@ -95,24 +95,17 @@ request_path_cluster_name = api_client.PathParameter( schema=ClusterNameSchema, required=True, ) -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] + body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, ) SchemaFor400ResponseBodyApplicationJson = ExceptionResponse diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_gray_del_releases/post.py b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_gray_del_releases/post.py index 65d5205..94578ee 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_gray_del_releases/post.py +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_gray_del_releases/post.py @@ -30,6 +30,32 @@ from . import path +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) # Path params AppIdSchema = schemas.StrSchema EnvSchema = schemas.StrSchema @@ -135,6 +161,7 @@ def _create_gray_del_release_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -149,6 +176,7 @@ def _create_gray_del_release_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -165,6 +193,7 @@ def _create_gray_del_release_oapg( body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -176,6 +205,7 @@ def _create_gray_del_release_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -190,6 +220,7 @@ def _create_gray_del_release_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -202,6 +233,7 @@ def _create_gray_del_release_oapg( api_response.body and api_response.headers will not be deserialized into schema class instances """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) used_path = path.value @@ -222,6 +254,19 @@ class instances for k, v in _path_params.items(): used_path = used_path.replace('{%s}' % k, v) + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + _headers = HTTPHeaderDict() # TODO add cookie handling if accept_content_types: @@ -277,6 +322,7 @@ def create_gray_del_release( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -291,6 +337,7 @@ def create_gray_del_release( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -307,6 +354,7 @@ def create_gray_del_release( body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -318,6 +366,7 @@ def create_gray_del_release( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -332,6 +381,7 @@ def create_gray_del_release( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -340,6 +390,7 @@ def create_gray_del_release( ): return self._create_gray_del_release_oapg( body=body, + query_params=query_params, path_params=path_params, content_type=content_type, accept_content_types=accept_content_types, @@ -357,6 +408,7 @@ def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -371,6 +423,7 @@ def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -387,6 +440,7 @@ def post( body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -398,6 +452,7 @@ def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -412,6 +467,7 @@ def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -420,6 +476,7 @@ def post( ): return self._create_gray_del_release_oapg( body=body, + query_params=query_params, path_params=path_params, content_type=content_type, accept_content_types=accept_content_types, diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_gray_del_releases/post.pyi b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_gray_del_releases/post.pyi index 0f3f2c4..ed44b88 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_gray_del_releases/post.pyi +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_gray_del_releases/post.pyi @@ -28,6 +28,32 @@ from apollo_openapi import schemas # noqa: F401 from apollo_openapi.model.open_release_dto import OpenReleaseDTO from apollo_openapi.model.namespace_gray_del_release_dto import NamespaceGrayDelReleaseDTO +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) # Path params AppIdSchema = schemas.StrSchema EnvSchema = schemas.StrSchema @@ -127,6 +153,7 @@ class BaseApi(api_client.Api): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -141,6 +168,7 @@ class BaseApi(api_client.Api): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -157,6 +185,7 @@ class BaseApi(api_client.Api): body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -168,6 +197,7 @@ class BaseApi(api_client.Api): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -182,6 +212,7 @@ class BaseApi(api_client.Api): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -194,6 +225,7 @@ class BaseApi(api_client.Api): api_response.body and api_response.headers will not be deserialized into schema class instances """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) used_path = path.value @@ -214,6 +246,19 @@ class BaseApi(api_client.Api): for k, v in _path_params.items(): used_path = used_path.replace('{%s}' % k, v) + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + _headers = HTTPHeaderDict() # TODO add cookie handling if accept_content_types: @@ -269,6 +314,7 @@ class CreateGrayDelRelease(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -283,6 +329,7 @@ class CreateGrayDelRelease(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -299,6 +346,7 @@ class CreateGrayDelRelease(BaseApi): body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -310,6 +358,7 @@ class CreateGrayDelRelease(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -324,6 +373,7 @@ class CreateGrayDelRelease(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -332,6 +382,7 @@ class CreateGrayDelRelease(BaseApi): ): return self._create_gray_del_release_oapg( body=body, + query_params=query_params, path_params=path_params, content_type=content_type, accept_content_types=accept_content_types, @@ -349,6 +400,7 @@ class ApiForpost(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -363,6 +415,7 @@ class ApiForpost(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -379,6 +432,7 @@ class ApiForpost(BaseApi): body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -390,6 +444,7 @@ class ApiForpost(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -404,6 +459,7 @@ class ApiForpost(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -412,6 +468,7 @@ class ApiForpost(BaseApi): ): return self._create_gray_del_release_oapg( body=body, + query_params=query_params, path_params=path_params, content_type=content_type, accept_content_types=accept_content_types, diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_releases/post.py b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_releases/post.py index 2613dc5..8e436e9 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_releases/post.py +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_releases/post.py @@ -30,6 +30,32 @@ from . import path +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) # Path params AppIdSchema = schemas.StrSchema EnvSchema = schemas.StrSchema @@ -135,6 +161,7 @@ def _create_gray_release_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -149,6 +176,7 @@ def _create_gray_release_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -165,6 +193,7 @@ def _create_gray_release_oapg( body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -176,6 +205,7 @@ def _create_gray_release_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -190,6 +220,7 @@ def _create_gray_release_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -202,6 +233,7 @@ def _create_gray_release_oapg( api_response.body and api_response.headers will not be deserialized into schema class instances """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) used_path = path.value @@ -222,6 +254,19 @@ class instances for k, v in _path_params.items(): used_path = used_path.replace('{%s}' % k, v) + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + _headers = HTTPHeaderDict() # TODO add cookie handling if accept_content_types: @@ -277,6 +322,7 @@ def create_gray_release( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -291,6 +337,7 @@ def create_gray_release( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -307,6 +354,7 @@ def create_gray_release( body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -318,6 +366,7 @@ def create_gray_release( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -332,6 +381,7 @@ def create_gray_release( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -340,6 +390,7 @@ def create_gray_release( ): return self._create_gray_release_oapg( body=body, + query_params=query_params, path_params=path_params, content_type=content_type, accept_content_types=accept_content_types, @@ -357,6 +408,7 @@ def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -371,6 +423,7 @@ def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -387,6 +440,7 @@ def post( body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -398,6 +452,7 @@ def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -412,6 +467,7 @@ def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -420,6 +476,7 @@ def post( ): return self._create_gray_release_oapg( body=body, + query_params=query_params, path_params=path_params, content_type=content_type, accept_content_types=accept_content_types, diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_releases/post.pyi b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_releases/post.pyi index 1958542..ecd01c3 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_releases/post.pyi +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_branches_branch_name_releases/post.pyi @@ -28,6 +28,32 @@ from apollo_openapi import schemas # noqa: F401 from apollo_openapi.model.open_release_dto import OpenReleaseDTO from apollo_openapi.model.namespace_release_dto import NamespaceReleaseDTO +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) # Path params AppIdSchema = schemas.StrSchema EnvSchema = schemas.StrSchema @@ -127,6 +153,7 @@ class BaseApi(api_client.Api): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -141,6 +168,7 @@ class BaseApi(api_client.Api): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -157,6 +185,7 @@ class BaseApi(api_client.Api): body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -168,6 +197,7 @@ class BaseApi(api_client.Api): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -182,6 +212,7 @@ class BaseApi(api_client.Api): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -194,6 +225,7 @@ class BaseApi(api_client.Api): api_response.body and api_response.headers will not be deserialized into schema class instances """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) used_path = path.value @@ -214,6 +246,19 @@ class BaseApi(api_client.Api): for k, v in _path_params.items(): used_path = used_path.replace('{%s}' % k, v) + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + _headers = HTTPHeaderDict() # TODO add cookie handling if accept_content_types: @@ -269,6 +314,7 @@ class CreateGrayRelease(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -283,6 +329,7 @@ class CreateGrayRelease(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -299,6 +346,7 @@ class CreateGrayRelease(BaseApi): body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -310,6 +358,7 @@ class CreateGrayRelease(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -324,6 +373,7 @@ class CreateGrayRelease(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -332,6 +382,7 @@ class CreateGrayRelease(BaseApi): ): return self._create_gray_release_oapg( body=body, + query_params=query_params, path_params=path_params, content_type=content_type, accept_content_types=accept_content_types, @@ -349,6 +400,7 @@ class ApiForpost(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -363,6 +415,7 @@ class ApiForpost(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -379,6 +432,7 @@ class ApiForpost(BaseApi): body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -390,6 +444,7 @@ class ApiForpost(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -404,6 +459,7 @@ class ApiForpost(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -412,6 +468,7 @@ class ApiForpost(BaseApi): ): return self._create_gray_release_oapg( body=body, + query_params=query_params, path_params=path_params, content_type=content_type, accept_content_types=accept_content_types, diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases/post.py b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases/post.py index 2f90210..6a93040 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases/post.py +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases/post.py @@ -31,6 +31,32 @@ from . import path +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) # Path params AppIdSchema = schemas.StrSchema EnvSchema = schemas.StrSchema @@ -168,6 +194,7 @@ def _create_release_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -182,6 +209,7 @@ def _create_release_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -198,6 +226,7 @@ def _create_release_oapg( body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -209,6 +238,7 @@ def _create_release_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -223,6 +253,7 @@ def _create_release_oapg( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -235,6 +266,7 @@ def _create_release_oapg( api_response.body and api_response.headers will not be deserialized into schema class instances """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) used_path = path.value @@ -254,6 +286,19 @@ class instances for k, v in _path_params.items(): used_path = used_path.replace('{%s}' % k, v) + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + _headers = HTTPHeaderDict() # TODO add cookie handling if accept_content_types: @@ -309,6 +354,7 @@ def create_release( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -323,6 +369,7 @@ def create_release( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -339,6 +386,7 @@ def create_release( body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -350,6 +398,7 @@ def create_release( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -364,6 +413,7 @@ def create_release( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -372,6 +422,7 @@ def create_release( ): return self._create_release_oapg( body=body, + query_params=query_params, path_params=path_params, content_type=content_type, accept_content_types=accept_content_types, @@ -389,6 +440,7 @@ def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -403,6 +455,7 @@ def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -419,6 +472,7 @@ def post( body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -430,6 +484,7 @@ def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -444,6 +499,7 @@ def post( self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -452,6 +508,7 @@ def post( ): return self._create_release_oapg( body=body, + query_params=query_params, path_params=path_params, content_type=content_type, accept_content_types=accept_content_types, diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases/post.pyi b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases/post.pyi index 2d36851..62a8c1e 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases/post.pyi +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases/post.pyi @@ -29,6 +29,32 @@ from apollo_openapi.model.open_release_dto import OpenReleaseDTO from apollo_openapi.model.namespace_release_dto import NamespaceReleaseDTO from apollo_openapi.model.exception_response import ExceptionResponse +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) # Path params AppIdSchema = schemas.StrSchema EnvSchema = schemas.StrSchema @@ -158,6 +184,7 @@ class BaseApi(api_client.Api): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -172,6 +199,7 @@ class BaseApi(api_client.Api): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -188,6 +216,7 @@ class BaseApi(api_client.Api): body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -199,6 +228,7 @@ class BaseApi(api_client.Api): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -213,6 +243,7 @@ class BaseApi(api_client.Api): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -225,6 +256,7 @@ class BaseApi(api_client.Api): api_response.body and api_response.headers will not be deserialized into schema class instances """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) used_path = path.value @@ -244,6 +276,19 @@ class BaseApi(api_client.Api): for k, v in _path_params.items(): used_path = used_path.replace('{%s}' % k, v) + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + _headers = HTTPHeaderDict() # TODO add cookie handling if accept_content_types: @@ -299,6 +344,7 @@ class CreateRelease(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -313,6 +359,7 @@ class CreateRelease(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -329,6 +376,7 @@ class CreateRelease(BaseApi): body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -340,6 +388,7 @@ class CreateRelease(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -354,6 +403,7 @@ class CreateRelease(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -362,6 +412,7 @@ class CreateRelease(BaseApi): ): return self._create_release_oapg( body=body, + query_params=query_params, path_params=path_params, content_type=content_type, accept_content_types=accept_content_types, @@ -379,6 +430,7 @@ class ApiForpost(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: typing_extensions.Literal["application/json"] = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -393,6 +445,7 @@ class ApiForpost(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -409,6 +462,7 @@ class ApiForpost(BaseApi): body: typing.Union[SchemaForRequestBodyApplicationJson,], skip_deserialization: typing_extensions.Literal[True], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -420,6 +474,7 @@ class ApiForpost(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = ..., + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -434,6 +489,7 @@ class ApiForpost(BaseApi): self, body: typing.Union[SchemaForRequestBodyApplicationJson,], content_type: str = 'application/json', + query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, @@ -442,6 +498,7 @@ class ApiForpost(BaseApi): ): return self._create_release_oapg( body=body, + query_params=query_params, path_params=path_params, content_type=content_type, accept_content_types=accept_content_types, diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/__init__.py b/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/__init__.py deleted file mode 100644 index a672d42..0000000 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# do not import all endpoints into this module because that uses a lot of memory and stack frames -# if you need the ability to import all endpoints from this module, import them with -# from apollo_openapi.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all import Api - -from apollo_openapi.paths import PathValues - -path = PathValues.OPENAPI_V1_ENVS_ENV_APPS_APP_ID_CLUSTERS_CLUSTER_NAME_NAMESPACES_NAMESPACE_NAME_RELEASES_ALL diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_instances_by_namespace_and_releases_not_in/get.py b/python/apollo_openapi/paths/openapi_v1_envs_env_instances_by_namespace_and_releases_not_in/get.py index 13fc970..971d80b 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_instances_by_namespace_and_releases_not_in/get.py +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_instances_by_namespace_and_releases_not_in/get.py @@ -40,12 +40,12 @@ 'appId': typing.Union[AppIdSchema, str, ], 'clusterName': typing.Union[ClusterNameSchema, str, ], 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'releaseIds': typing.Union[ReleaseIdsSchema, str, ], } ) RequestOptionalQueryParams = typing_extensions.TypedDict( 'RequestOptionalQueryParams', { - 'releaseIds': typing.Union[ReleaseIdsSchema, str, ], }, total=False ) @@ -80,6 +80,7 @@ class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams) name="releaseIds", style=api_client.ParameterStyle.FORM, schema=ReleaseIdsSchema, + required=True, explode=True, ) # Path params diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_instances_by_namespace_and_releases_not_in/get.pyi b/python/apollo_openapi/paths/openapi_v1_envs_env_instances_by_namespace_and_releases_not_in/get.pyi index d72216d..72c1f4b 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_instances_by_namespace_and_releases_not_in/get.pyi +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_instances_by_namespace_and_releases_not_in/get.pyi @@ -38,12 +38,12 @@ RequestRequiredQueryParams = typing_extensions.TypedDict( 'appId': typing.Union[AppIdSchema, str, ], 'clusterName': typing.Union[ClusterNameSchema, str, ], 'namespaceName': typing.Union[NamespaceNameSchema, str, ], + 'releaseIds': typing.Union[ReleaseIdsSchema, str, ], } ) RequestOptionalQueryParams = typing_extensions.TypedDict( 'RequestOptionalQueryParams', { - 'releaseIds': typing.Union[ReleaseIdsSchema, str, ], }, total=False ) @@ -78,6 +78,7 @@ request_query_release_ids = api_client.QueryParameter( name="releaseIds", style=api_client.ParameterStyle.FORM, schema=ReleaseIdsSchema, + required=True, explode=True, ) # Path params diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_releases_comparison/__init__.py b/python/apollo_openapi/paths/openapi_v1_envs_env_releases_comparison/__init__.py new file mode 100644 index 0000000..ca1acbe --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_releases_comparison/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_envs_env_releases_comparison import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_ENVS_ENV_RELEASES_COMPARISON diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_releases_comparison/get.py b/python/apollo_openapi/paths/openapi_v1_envs_env_releases_comparison/get.py new file mode 100644 index 0000000..226f14d --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_releases_comparison/get.py @@ -0,0 +1,360 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_release_diff_dto import OpenReleaseDiffDTO + +from . import path + +# Query params +BaseReleaseIdSchema = schemas.Int64Schema +ToCompareReleaseIdSchema = schemas.Int64Schema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'baseReleaseId': typing.Union[BaseReleaseIdSchema, decimal.Decimal, int, ], + 'toCompareReleaseId': typing.Union[ToCompareReleaseIdSchema, decimal.Decimal, int, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_base_release_id = api_client.QueryParameter( + name="baseReleaseId", + style=api_client.ParameterStyle.FORM, + schema=BaseReleaseIdSchema, + required=True, + explode=True, +) +request_query_to_compare_release_id = api_client.QueryParameter( + name="toCompareReleaseId", + style=api_client.ParameterStyle.FORM, + schema=ToCompareReleaseIdSchema, + required=True, + explode=True, +) +# Path params +EnvSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'env': typing.Union[EnvSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +_auth = [ + 'ApiKeyAuth', +] +SchemaFor200ResponseBodyApplicationJson = OpenReleaseDiffDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _compare_release_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _compare_release_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _compare_release_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _compare_release_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Compare two releases + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_env, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_base_release_id, + request_query_to_compare_release_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class CompareRelease(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def compare_release( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def compare_release( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def compare_release( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def compare_release( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._compare_release_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._compare_release_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_releases_comparison/get.pyi b/python/apollo_openapi/paths/openapi_v1_envs_env_releases_comparison/get.pyi new file mode 100644 index 0000000..9e59267 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_releases_comparison/get.pyi @@ -0,0 +1,352 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_release_diff_dto import OpenReleaseDiffDTO + +# Query params +BaseReleaseIdSchema = schemas.Int64Schema +ToCompareReleaseIdSchema = schemas.Int64Schema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'baseReleaseId': typing.Union[BaseReleaseIdSchema, decimal.Decimal, int, ], + 'toCompareReleaseId': typing.Union[ToCompareReleaseIdSchema, decimal.Decimal, int, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_base_release_id = api_client.QueryParameter( + name="baseReleaseId", + style=api_client.ParameterStyle.FORM, + schema=BaseReleaseIdSchema, + required=True, + explode=True, +) +request_query_to_compare_release_id = api_client.QueryParameter( + name="toCompareReleaseId", + style=api_client.ParameterStyle.FORM, + schema=ToCompareReleaseIdSchema, + required=True, + explode=True, +) +# Path params +EnvSchema = schemas.StrSchema +RequestRequiredPathParams = typing_extensions.TypedDict( + 'RequestRequiredPathParams', + { + 'env': typing.Union[EnvSchema, str, ], + } +) +RequestOptionalPathParams = typing_extensions.TypedDict( + 'RequestOptionalPathParams', + { + }, + total=False +) + + +class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): + pass + + +request_path_env = api_client.PathParameter( + name="env", + style=api_client.ParameterStyle.SIMPLE, + schema=EnvSchema, + required=True, +) +SchemaFor200ResponseBodyApplicationJson = OpenReleaseDiffDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _compare_release_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _compare_release_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _compare_release_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _compare_release_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + Compare two releases + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + self._verify_typed_dict_inputs_oapg(RequestPathParams, path_params) + used_path = path.value + + _path_params = {} + for parameter in ( + request_path_env, + ): + parameter_data = path_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + serialized_data = parameter.serialize(parameter_data) + _path_params.update(serialized_data) + + for k, v in _path_params.items(): + used_path = used_path.replace('{%s}' % k, v) + + prefix_separator_iterator = None + for parameter in ( + request_query_base_release_id, + request_query_to_compare_release_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class CompareRelease(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def compare_release( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def compare_release( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def compare_release( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def compare_release( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._compare_release_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + path_params: RequestPathParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._compare_release_oapg( + query_params=query_params, + path_params=path_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_releases_release_id_rollback/put.py b/python/apollo_openapi/paths/openapi_v1_envs_env_releases_release_id_rollback/put.py index 3dacff7..cf96f80 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_releases_release_id_rollback/put.py +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_releases_release_id_rollback/put.py @@ -9,7 +9,6 @@ from dataclasses import dataclass import typing_extensions import urllib3 -from urllib3._collections import HTTPHeaderDict from apollo_openapi import api_client, exceptions from datetime import date, datetime # noqa: F401 @@ -90,31 +89,21 @@ class RequestPathParams(RequestRequiredPathParams, RequestOptionalPathParams): _auth = [ 'ApiKeyAuth', ] -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] + body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, ) _status_code_to_response = { '200': _response_for_200, } -_all_accept_content_types = ( - 'application/json', -) class BaseApi(api_client.Api): @@ -123,7 +112,6 @@ def _rollback_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -137,7 +125,6 @@ def _rollback_oapg( skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -147,7 +134,6 @@ def _rollback_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -160,7 +146,6 @@ def _rollback_oapg( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -201,17 +186,11 @@ class instances serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) for serialized_value in serialized_data.values(): used_path += serialized_value - - _headers = HTTPHeaderDict() # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) response = self.api_client.call_api( resource_path=used_path, method='put'.upper(), - headers=_headers, auth_settings=_auth, stream=stream, timeout=timeout, @@ -244,7 +223,6 @@ def rollback( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -258,7 +236,6 @@ def rollback( skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -268,7 +245,6 @@ def rollback( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -281,7 +257,6 @@ def rollback( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -289,7 +264,6 @@ def rollback( return self._rollback_oapg( query_params=query_params, path_params=path_params, - accept_content_types=accept_content_types, stream=stream, timeout=timeout, skip_deserialization=skip_deserialization @@ -304,7 +278,6 @@ def put( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -318,7 +291,6 @@ def put( skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -328,7 +300,6 @@ def put( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -341,7 +312,6 @@ def put( self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -349,7 +319,6 @@ def put( return self._rollback_oapg( query_params=query_params, path_params=path_params, - accept_content_types=accept_content_types, stream=stream, timeout=timeout, skip_deserialization=skip_deserialization diff --git a/python/apollo_openapi/paths/openapi_v1_envs_env_releases_release_id_rollback/put.pyi b/python/apollo_openapi/paths/openapi_v1_envs_env_releases_release_id_rollback/put.pyi index f13c10b..e1c89d9 100644 --- a/python/apollo_openapi/paths/openapi_v1_envs_env_releases_release_id_rollback/put.pyi +++ b/python/apollo_openapi/paths/openapi_v1_envs_env_releases_release_id_rollback/put.pyi @@ -9,7 +9,6 @@ from dataclasses import dataclass import typing_extensions import urllib3 -from urllib3._collections import HTTPHeaderDict from apollo_openapi import api_client, exceptions from datetime import date, datetime # noqa: F401 @@ -85,27 +84,17 @@ request_path_release_id = api_client.PathParameter( schema=ReleaseIdSchema, required=True, ) -SchemaFor200ResponseBodyApplicationJson = schemas.DictSchema @dataclass class ApiResponseFor200(api_client.ApiResponse): response: urllib3.HTTPResponse - body: typing.Union[ - SchemaFor200ResponseBodyApplicationJson, - ] + body: schemas.Unset = schemas.unset headers: schemas.Unset = schemas.unset _response_for_200 = api_client.OpenApiResponse( response_cls=ApiResponseFor200, - content={ - 'application/json': api_client.MediaType( - schema=SchemaFor200ResponseBodyApplicationJson), - }, -) -_all_accept_content_types = ( - 'application/json', ) @@ -115,7 +104,6 @@ class BaseApi(api_client.Api): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -129,7 +117,6 @@ class BaseApi(api_client.Api): skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -139,7 +126,6 @@ class BaseApi(api_client.Api): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -152,7 +138,6 @@ class BaseApi(api_client.Api): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -193,17 +178,11 @@ class BaseApi(api_client.Api): serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) for serialized_value in serialized_data.values(): used_path += serialized_value - - _headers = HTTPHeaderDict() # TODO add cookie handling - if accept_content_types: - for accept_content_type in accept_content_types: - _headers.add('Accept', accept_content_type) response = self.api_client.call_api( resource_path=used_path, method='put'.upper(), - headers=_headers, auth_settings=_auth, stream=stream, timeout=timeout, @@ -236,7 +215,6 @@ class Rollback(BaseApi): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -250,7 +228,6 @@ class Rollback(BaseApi): skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -260,7 +237,6 @@ class Rollback(BaseApi): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -273,7 +249,6 @@ class Rollback(BaseApi): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -281,7 +256,6 @@ class Rollback(BaseApi): return self._rollback_oapg( query_params=query_params, path_params=path_params, - accept_content_types=accept_content_types, stream=stream, timeout=timeout, skip_deserialization=skip_deserialization @@ -296,7 +270,6 @@ class ApiForput(BaseApi): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: typing_extensions.Literal[False] = ..., @@ -310,7 +283,6 @@ class ApiForput(BaseApi): skip_deserialization: typing_extensions.Literal[True], query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, ) -> api_client.ApiResponseWithoutDeserialization: ... @@ -320,7 +292,6 @@ class ApiForput(BaseApi): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = ..., @@ -333,7 +304,6 @@ class ApiForput(BaseApi): self, query_params: RequestQueryParams = frozendict.frozendict(), path_params: RequestPathParams = frozendict.frozendict(), - accept_content_types: typing.Tuple[str] = _all_accept_content_types, stream: bool = False, timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, skip_deserialization: bool = False, @@ -341,7 +311,6 @@ class ApiForput(BaseApi): return self._rollback_oapg( query_params=query_params, path_params=path_params, - accept_content_types=accept_content_types, stream=stream, timeout=timeout, skip_deserialization=skip_deserialization diff --git a/python/apollo_openapi/paths/openapi_v1_permissions_root/__init__.py b/python/apollo_openapi/paths/openapi_v1_permissions_root/__init__.py new file mode 100644 index 0000000..76bd6b5 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_permissions_root/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_permissions_root import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_PERMISSIONS_ROOT diff --git a/python/apollo_openapi/paths/openapi_v1_permissions_root/get.py b/python/apollo_openapi/paths/openapi_v1_permissions_root/get.py new file mode 100644 index 0000000..867c37b --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_permissions_root/get.py @@ -0,0 +1,296 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO + +from . import path + +# Query params +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +_auth = [ + 'ApiKeyAuth', +] +SchemaFor200ResponseBodyApplicationJson = OpenPermissionConditionDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _has_root_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _has_root_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _has_root_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _has_root_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 校验Root权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + used_path = path.value + + prefix_separator_iterator = None + for parameter in ( + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class HasRootPermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def has_root_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def has_root_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def has_root_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def has_root_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_root_permission_oapg( + query_params=query_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_root_permission_oapg( + query_params=query_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_permissions_root/get.pyi b/python/apollo_openapi/paths/openapi_v1_permissions_root/get.pyi new file mode 100644 index 0000000..1f9ffd6 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_permissions_root/get.pyi @@ -0,0 +1,288 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO + +# Query params +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +SchemaFor200ResponseBodyApplicationJson = OpenPermissionConditionDTO + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _has_root_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _has_root_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _has_root_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _has_root_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 校验Root权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + used_path = path.value + + prefix_separator_iterator = None + for parameter in ( + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class HasRootPermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def has_root_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def has_root_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def has_root_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def has_root_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_root_permission_oapg( + query_params=query_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_root_permission_oapg( + query_params=query_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_system_role_manage_app_master/__init__.py b/python/apollo_openapi/paths/openapi_v1_system_role_manage_app_master/__init__.py new file mode 100644 index 0000000..a815914 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_system_role_manage_app_master/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_system_role_manage_app_master import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_SYSTEM_ROLE_MANAGEAPPMASTER diff --git a/python/apollo_openapi/paths/openapi_v1_system_role_manage_app_master/get.py b/python/apollo_openapi/paths/openapi_v1_system_role_manage_app_master/get.py new file mode 100644 index 0000000..d5c916c --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_system_role_manage_app_master/get.py @@ -0,0 +1,267 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +_auth = [ + 'ApiKeyAuth', +] + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.DictSchema +): + + + class MetaOapg: + additional_properties = schemas.BoolSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + *_args, + _configuration=_configuration, + **kwargs, + ) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _is_manage_app_master_permission_enabled_oapg( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _is_manage_app_master_permission_enabled_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _is_manage_app_master_permission_enabled_oapg( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _is_manage_app_master_permission_enabled_oapg( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 校验AppMaster开关 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path.value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class IsManageAppMasterPermissionEnabled(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def is_manage_app_master_permission_enabled( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def is_manage_app_master_permission_enabled( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def is_manage_app_master_permission_enabled( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def is_manage_app_master_permission_enabled( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._is_manage_app_master_permission_enabled_oapg( + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._is_manage_app_master_permission_enabled_oapg( + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_system_role_manage_app_master/get.pyi b/python/apollo_openapi/paths/openapi_v1_system_role_manage_app_master/get.pyi new file mode 100644 index 0000000..d95f80f --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_system_role_manage_app_master/get.pyi @@ -0,0 +1,259 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 SchemaFor200ResponseBodyApplicationJson( + schemas.DictSchema +): + + + class MetaOapg: + additional_properties = schemas.BoolSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + *_args, + _configuration=_configuration, + **kwargs, + ) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _is_manage_app_master_permission_enabled_oapg( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _is_manage_app_master_permission_enabled_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _is_manage_app_master_permission_enabled_oapg( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _is_manage_app_master_permission_enabled_oapg( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 校验AppMaster开关 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path.value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class IsManageAppMasterPermissionEnabled(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def is_manage_app_master_permission_enabled( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def is_manage_app_master_permission_enabled( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def is_manage_app_master_permission_enabled( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def is_manage_app_master_permission_enabled( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._is_manage_app_master_permission_enabled_oapg( + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._is_manage_app_master_permission_enabled_oapg( + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/__init__.py b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/__init__.py new file mode 100644 index 0000000..ae847b8 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_system_roles_create_application import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_SYSTEM_ROLES_CREATEAPPLICATION diff --git a/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/delete.py b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/delete.py new file mode 100644 index 0000000..3eb46e7 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/delete.py @@ -0,0 +1,272 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _delete_create_application_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _delete_create_application_role_from_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _delete_create_application_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _delete_create_application_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 移除建应用角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + used_path = path.value + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class DeleteCreateApplicationRoleFromUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def delete_create_application_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete_create_application_role_from_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete_create_application_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete_create_application_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_create_application_role_from_user_oapg( + query_params=query_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_create_application_role_from_user_oapg( + query_params=query_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/delete.pyi b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/delete.pyi new file mode 100644 index 0000000..6c00a6b --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/delete.pyi @@ -0,0 +1,264 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _delete_create_application_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _delete_create_application_role_from_user_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _delete_create_application_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _delete_create_application_role_from_user_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 移除建应用角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + used_path = path.value + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + # TODO add cookie handling + + response = self.api_client.call_api( + resource_path=used_path, + method='delete'.upper(), + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class DeleteCreateApplicationRoleFromUser(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def delete_create_application_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete_create_application_role_from_user( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete_create_application_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete_create_application_role_from_user( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_create_application_role_from_user_oapg( + query_params=query_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiFordelete(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def delete( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def delete( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._delete_create_application_role_from_user_oapg( + query_params=query_params, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/get.py b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/get.py new file mode 100644 index 0000000..be01a03 --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/get.py @@ -0,0 +1,322 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) +_auth = [ + 'ApiKeyAuth', +] + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.DictSchema +): + + + class MetaOapg: + additional_properties = schemas.BoolSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + *_args, + _configuration=_configuration, + **kwargs, + ) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _has_create_application_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _has_create_application_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _has_create_application_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _has_create_application_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 校验建应用权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + used_path = path.value + + prefix_separator_iterator = None + for parameter in ( + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class HasCreateApplicationPermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def has_create_application_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def has_create_application_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def has_create_application_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def has_create_application_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_create_application_permission_oapg( + query_params=query_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_create_application_permission_oapg( + query_params=query_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/get.pyi b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/get.pyi new file mode 100644 index 0000000..6d37abc --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/get.pyi @@ -0,0 +1,314 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +# Query params +UserIdSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + 'userId': typing.Union[UserIdSchema, str, ], + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_user_id = api_client.QueryParameter( + name="userId", + style=api_client.ParameterStyle.FORM, + schema=UserIdSchema, + required=True, + explode=True, +) + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.DictSchema +): + + + class MetaOapg: + additional_properties = schemas.BoolSchema + + def __getitem__(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + # dict_instance[name] accessor + return super().__getitem__(name) + + def get_item_oapg(self, name: typing.Union[str, ]) -> MetaOapg.additional_properties: + return super().get_item_oapg(name) + + def __new__( + cls, + *_args: typing.Union[dict, frozendict.frozendict, ], + _configuration: typing.Optional[schemas.Configuration] = None, + **kwargs: typing.Union[MetaOapg.additional_properties, bool, ], + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + *_args, + _configuration=_configuration, + **kwargs, + ) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _has_create_application_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _has_create_application_permission_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _has_create_application_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _has_create_application_permission_oapg( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 校验建应用权限 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + used_path = path.value + + prefix_separator_iterator = None + for parameter in ( + request_query_user_id, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class HasCreateApplicationPermission(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def has_create_application_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def has_create_application_permission( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def has_create_application_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def has_create_application_permission( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_create_application_permission_oapg( + query_params=query_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + query_params: RequestQueryParams = frozendict.frozendict(), + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._has_create_application_permission_oapg( + query_params=query_params, + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/post.py b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/post.py new file mode 100644 index 0000000..edfe78c --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/post.py @@ -0,0 +1,379 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +# body param + + +class SchemaForRequestBodyApplicationJson( + schemas.ListSchema +): + + + class MetaOapg: + items = schemas.StrSchema + + def __new__( + cls, + _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + +request_body_request_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) +_auth = [ + 'ApiKeyAuth', +] + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) +_status_code_to_response = { + '200': _response_for_200, +} + + +class BaseApi(api_client.Api): + @typing.overload + def _add_create_application_role_to_users_oapg( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _add_create_application_role_to_users_oapg( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + + @typing.overload + def _add_create_application_role_to_users_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _add_create_application_role_to_users_oapg( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _add_create_application_role_to_users_oapg( + self, + content_type: str = 'application/json', + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 分配建应用角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + used_path = path.value + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body_request_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AddCreateApplicationRoleToUsers(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def add_create_application_role_to_users( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def add_create_application_role_to_users( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + + @typing.overload + def add_create_application_role_to_users( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def add_create_application_role_to_users( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def add_create_application_role_to_users( + self, + content_type: str = 'application/json', + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._add_create_application_role_to_users_oapg( + body=body, + query_params=query_params, + content_type=content_type, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._add_create_application_role_to_users_oapg( + body=body, + query_params=query_params, + content_type=content_type, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/post.pyi b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/post.pyi new file mode 100644 index 0000000..f447a5d --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application/post.pyi @@ -0,0 +1,371 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +# Query params +OperatorSchema = schemas.StrSchema +RequestRequiredQueryParams = typing_extensions.TypedDict( + 'RequestRequiredQueryParams', + { + } +) +RequestOptionalQueryParams = typing_extensions.TypedDict( + 'RequestOptionalQueryParams', + { + 'operator': typing.Union[OperatorSchema, str, ], + }, + total=False +) + + +class RequestQueryParams(RequestRequiredQueryParams, RequestOptionalQueryParams): + pass + + +request_query_operator = api_client.QueryParameter( + name="operator", + style=api_client.ParameterStyle.FORM, + schema=OperatorSchema, + explode=True, +) +# body param + + +class SchemaForRequestBodyApplicationJson( + schemas.ListSchema +): + + + class MetaOapg: + items = schemas.StrSchema + + def __new__( + cls, + _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'SchemaForRequestBodyApplicationJson': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + +request_body_request_body = api_client.RequestBody( + content={ + 'application/json': api_client.MediaType( + schema=SchemaForRequestBodyApplicationJson), + }, +) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: schemas.Unset = schemas.unset + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, +) + + +class BaseApi(api_client.Api): + @typing.overload + def _add_create_application_role_to_users_oapg( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _add_create_application_role_to_users_oapg( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + + @typing.overload + def _add_create_application_role_to_users_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _add_create_application_role_to_users_oapg( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _add_create_application_role_to_users_oapg( + self, + content_type: str = 'application/json', + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 分配建应用角色 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + self._verify_typed_dict_inputs_oapg(RequestQueryParams, query_params) + used_path = path.value + + prefix_separator_iterator = None + for parameter in ( + request_query_operator, + ): + parameter_data = query_params.get(parameter.name, schemas.unset) + if parameter_data is schemas.unset: + continue + if prefix_separator_iterator is None: + prefix_separator_iterator = parameter.get_prefix_separator_iterator() + serialized_data = parameter.serialize(parameter_data, prefix_separator_iterator) + for serialized_value in serialized_data.values(): + used_path += serialized_value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + + _fields = None + _body = None + if body is not schemas.unset: + serialized_data = request_body_request_body.serialize(body, content_type) + _headers.add('Content-Type', content_type) + if 'fields' in serialized_data: + _fields = serialized_data['fields'] + elif 'body' in serialized_data: + _body = serialized_data['body'] + response = self.api_client.call_api( + resource_path=used_path, + method='post'.upper(), + headers=_headers, + fields=_fields, + body=_body, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class AddCreateApplicationRoleToUsers(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def add_create_application_role_to_users( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def add_create_application_role_to_users( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + + @typing.overload + def add_create_application_role_to_users( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def add_create_application_role_to_users( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def add_create_application_role_to_users( + self, + content_type: str = 'application/json', + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._add_create_application_role_to_users_oapg( + body=body, + query_params=query_params, + content_type=content_type, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForpost(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def post( + self, + content_type: typing_extensions.Literal["application/json"] = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + + @typing.overload + def post( + self, + skip_deserialization: typing_extensions.Literal[True], + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def post( + self, + content_type: str = ..., + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def post( + self, + content_type: str = 'application/json', + body: typing.Union[SchemaForRequestBodyApplicationJson, list, tuple, schemas.Unset] = schemas.unset, + query_params: RequestQueryParams = frozendict.frozendict(), + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._add_create_application_role_to_users_oapg( + body=body, + query_params=query_params, + content_type=content_type, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_system_roles_create_application_role_users/__init__.py b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application_role_users/__init__.py new file mode 100644 index 0000000..86868cb --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application_role_users/__init__.py @@ -0,0 +1,7 @@ +# do not import all endpoints into this module because that uses a lot of memory and stack frames +# if you need the ability to import all endpoints from this module, import them with +# from apollo_openapi.paths.openapi_v1_system_roles_create_application_role_users import Api + +from apollo_openapi.paths import PathValues + +path = PathValues.OPENAPI_V1_SYSTEM_ROLES_CREATEAPPLICATION_ROLEUSERS diff --git a/python/apollo_openapi/paths/openapi_v1_system_roles_create_application_role_users/get.py b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application_role_users/get.py new file mode 100644 index 0000000..03f634a --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application_role_users/get.py @@ -0,0 +1,261 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 + +from . import path + +_auth = [ + 'ApiKeyAuth', +] + + +class SchemaFor200ResponseBodyApplicationJson( + schemas.ListSchema +): + + + class MetaOapg: + items = schemas.StrSchema + + def __new__( + cls, + _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_status_code_to_response = { + '200': _response_for_200, +} +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_create_application_role_users_oapg( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _get_create_application_role_users_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_create_application_role_users_oapg( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_create_application_role_users_oapg( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 获取建应用用户 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path.value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetCreateApplicationRoleUsers(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def get_create_application_role_users( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get_create_application_role_users( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_create_application_role_users( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_create_application_role_users( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_create_application_role_users_oapg( + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_create_application_role_users_oapg( + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/apollo_openapi/paths/openapi_v1_system_roles_create_application_role_users/get.pyi b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application_role_users/get.pyi new file mode 100644 index 0000000..7cc75ed --- /dev/null +++ b/python/apollo_openapi/paths/openapi_v1_system_roles_create_application_role_users/get.pyi @@ -0,0 +1,253 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +from dataclasses import dataclass +import typing_extensions +import urllib3 +from urllib3._collections import HTTPHeaderDict + +from apollo_openapi import api_client, exceptions +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 SchemaFor200ResponseBodyApplicationJson( + schemas.ListSchema +): + + + class MetaOapg: + items = schemas.StrSchema + + def __new__( + cls, + _arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]], + _configuration: typing.Optional[schemas.Configuration] = None, + ) -> 'SchemaFor200ResponseBodyApplicationJson': + return super().__new__( + cls, + _arg, + _configuration=_configuration, + ) + + def __getitem__(self, i: int) -> MetaOapg.items: + return super().__getitem__(i) + + +@dataclass +class ApiResponseFor200(api_client.ApiResponse): + response: urllib3.HTTPResponse + body: typing.Union[ + SchemaFor200ResponseBodyApplicationJson, + ] + headers: schemas.Unset = schemas.unset + + +_response_for_200 = api_client.OpenApiResponse( + response_cls=ApiResponseFor200, + content={ + 'application/json': api_client.MediaType( + schema=SchemaFor200ResponseBodyApplicationJson), + }, +) +_all_accept_content_types = ( + 'application/json', +) + + +class BaseApi(api_client.Api): + @typing.overload + def _get_create_application_role_users_oapg( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def _get_create_application_role_users_oapg( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def _get_create_application_role_users_oapg( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def _get_create_application_role_users_oapg( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + """ + 获取建应用用户 (new added) + :param skip_deserialization: If true then api_response.response will be set but + api_response.body and api_response.headers will not be deserialized into schema + class instances + """ + used_path = path.value + + _headers = HTTPHeaderDict() + # TODO add cookie handling + if accept_content_types: + for accept_content_type in accept_content_types: + _headers.add('Accept', accept_content_type) + + response = self.api_client.call_api( + resource_path=used_path, + method='get'.upper(), + headers=_headers, + auth_settings=_auth, + stream=stream, + timeout=timeout, + ) + + if skip_deserialization: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + else: + response_for_status = _status_code_to_response.get(str(response.status)) + if response_for_status: + api_response = response_for_status.deserialize(response, self.api_client.configuration) + else: + api_response = api_client.ApiResponseWithoutDeserialization(response=response) + + if not 200 <= response.status <= 299: + raise exceptions.ApiException( + status=response.status, + reason=response.reason, + api_response=api_response + ) + + return api_response + + +class GetCreateApplicationRoleUsers(BaseApi): + # this class is used by api classes that refer to endpoints with operationId fn names + + @typing.overload + def get_create_application_role_users( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get_create_application_role_users( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get_create_application_role_users( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get_create_application_role_users( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_create_application_role_users_oapg( + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) + + +class ApiForget(BaseApi): + # this class is used by api classes that refer to endpoints by path and http method names + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: typing_extensions.Literal[False] = ..., + ) -> typing.Union[ + ApiResponseFor200, + ]: ... + + @typing.overload + def get( + self, + skip_deserialization: typing_extensions.Literal[True], + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + ) -> api_client.ApiResponseWithoutDeserialization: ... + + @typing.overload + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = ..., + ) -> typing.Union[ + ApiResponseFor200, + api_client.ApiResponseWithoutDeserialization, + ]: ... + + def get( + self, + accept_content_types: typing.Tuple[str] = _all_accept_content_types, + stream: bool = False, + timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + skip_deserialization: bool = False, + ): + return self._get_create_application_role_users_oapg( + accept_content_types=accept_content_types, + stream=stream, + timeout=timeout, + skip_deserialization=skip_deserialization + ) diff --git a/python/docs/apis/tags/AccessKeyManagementApi.md b/python/docs/apis/tags/AccessKeyManagementApi.md new file mode 100644 index 0000000..a0a0482 --- /dev/null +++ b/python/docs/apis/tags/AccessKeyManagementApi.md @@ -0,0 +1,664 @@ + +# apollo_openapi.apis.tags.access_key_management_api.AccessKeyManagementApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_access_key**](#create_access_key) | **post** /openapi/v1/apps/{appId}/envs/{env}/accesskeys | 创建AccessKey +[**delete_access_key**](#delete_access_key) | **delete** /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId} | 删除AccessKey +[**disable_access_key**](#disable_access_key) | **put** /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation | 禁用AccessKey +[**enable_access_key**](#enable_access_key) | **put** /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/activation | 启用AccessKey +[**find_access_keys**](#find_access_keys) | **get** /openapi/v1/apps/{appId}/envs/{env}/accesskeys | 查找AccessKey + +# **create_access_key** + +> OpenAccessKeyDTO create_access_key(app_idenv) + +创建AccessKey + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import access_key_management_api +from apollo_openapi.model.open_access_key_dto import OpenAccessKeyDTO +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = access_key_management_api.AccessKeyManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + } + query_params = { + } + try: + # 创建AccessKey + api_response = api_instance.create_access_key( + path_params=path_params, + query_params=query_params, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling AccessKeyManagementApi->create_access_key: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'env': "env_example", + } + query_params = { + 'operator': "operator_example", + } + try: + # 创建AccessKey + api_response = api_instance.create_access_key( + path_params=path_params, + query_params=query_params, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling AccessKeyManagementApi->create_access_key: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#create_access_key.ApiResponseFor200) | + +#### create_access_key.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OpenAccessKeyDTO**](../../models/OpenAccessKeyDTO.md) | | + + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **delete_access_key** + +> delete_access_key(app_idenvaccess_key_id) + +删除AccessKey + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import access_key_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = access_key_management_api.AccessKeyManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'accessKeyId': 1, + } + query_params = { + } + try: + # 删除AccessKey + api_response = api_instance.delete_access_key( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling AccessKeyManagementApi->delete_access_key: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'accessKeyId': 1, + } + query_params = { + 'operator': "operator_example", + } + try: + # 删除AccessKey + api_response = api_instance.delete_access_key( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling AccessKeyManagementApi->delete_access_key: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | +accessKeyId | AccessKeyIdSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# AccessKeyIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#delete_access_key.ApiResponseFor200) | + +#### delete_access_key.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **disable_access_key** + +> disable_access_key(app_idenvaccess_key_id) + +禁用AccessKey + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import access_key_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = access_key_management_api.AccessKeyManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'accessKeyId': 1, + } + try: + # 禁用AccessKey + api_response = api_instance.disable_access_key( + path_params=path_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling AccessKeyManagementApi->disable_access_key: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | +accessKeyId | AccessKeyIdSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# AccessKeyIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#disable_access_key.ApiResponseFor200) | + +#### disable_access_key.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **enable_access_key** + +> enable_access_key(app_idenvaccess_key_id) + +启用AccessKey + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import access_key_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = access_key_management_api.AccessKeyManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'accessKeyId': 1, + } + query_params = { + } + try: + # 启用AccessKey + api_response = api_instance.enable_access_key( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling AccessKeyManagementApi->enable_access_key: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'accessKeyId': 1, + } + query_params = { + 'mode': 0, + } + try: + # 启用AccessKey + api_response = api_instance.enable_access_key( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling AccessKeyManagementApi->enable_access_key: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +mode | ModeSchema | | optional + + +# ModeSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, | decimal.Decimal, | | if omitted the server will use the default value of 0 + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | +accessKeyId | AccessKeyIdSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# AccessKeyIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#enable_access_key.ApiResponseFor200) | + +#### enable_access_key.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **find_access_keys** + +> [OpenAccessKeyDTO] find_access_keys(app_idenv) + +查找AccessKey + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import access_key_management_api +from apollo_openapi.model.open_access_key_dto import OpenAccessKeyDTO +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = access_key_management_api.AccessKeyManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + } + try: + # 查找AccessKey + api_response = api_instance.find_access_keys( + path_params=path_params, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling AccessKeyManagementApi->find_access_keys: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +path_params | RequestPathParams | | +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#find_access_keys.ApiResponseFor200) | + +#### find_access_keys.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple, | tuple, | | + +### Tuple Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**OpenAccessKeyDTO**]({{complexTypePrefix}}OpenAccessKeyDTO.md) | [**OpenAccessKeyDTO**]({{complexTypePrefix}}OpenAccessKeyDTO.md) | [**OpenAccessKeyDTO**]({{complexTypePrefix}}OpenAccessKeyDTO.md) | | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) diff --git a/python/docs/apis/tags/AppManagementApi.md b/python/docs/apis/tags/AppManagementApi.md index c88e156..820bd13 100644 --- a/python/docs/apis/tags/AppManagementApi.md +++ b/python/docs/apis/tags/AppManagementApi.md @@ -160,7 +160,7 @@ Type | Description | Notes # **create_app_in_env** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} create_app_in_env(envopen_app_dto) +> create_app_in_env(envopen_app_dto) 在指定环境创建应用(new added) @@ -222,7 +222,6 @@ with apollo_openapi.ApiClient(configuration) as api_client: query_params=query_params, body=body, ) - pprint(api_response) except apollo_openapi.ApiException as e: print("Exception when calling AppManagementApi->create_app_in_env: %s\n" % e) @@ -253,7 +252,6 @@ with apollo_openapi.ApiClient(configuration) as api_client: query_params=query_params, body=body, ) - pprint(api_response) except apollo_openapi.ApiException as e: print("Exception when calling AppManagementApi->create_app_in_env: %s\n" % e) ``` @@ -320,16 +318,9 @@ n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization i Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +body | Unset | body was not defined | headers | Unset | headers were not defined | -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - #### create_app_in_env.ApiResponseFor400 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -364,7 +355,7 @@ Type | Description | Notes # **delete_app** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} delete_app(app_id) +> delete_app(app_id) 删除应用(new added) @@ -411,7 +402,6 @@ with apollo_openapi.ApiClient(configuration) as api_client: path_params=path_params, query_params=query_params, ) - pprint(api_response) except apollo_openapi.ApiException as e: print("Exception when calling AppManagementApi->delete_app: %s\n" % e) @@ -428,7 +418,6 @@ with apollo_openapi.ApiClient(configuration) as api_client: path_params=path_params, query_params=query_params, ) - pprint(api_response) except apollo_openapi.ApiException as e: print("Exception when calling AppManagementApi->delete_app: %s\n" % e) ``` @@ -485,16 +474,9 @@ n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization i Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +body | Unset | body was not defined | headers | Unset | headers were not defined | -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - #### delete_app.ApiResponseFor403 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -1340,7 +1322,7 @@ Type | Description | Notes # **update_app** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} update_app(app_idopen_app_dto) +> update_app(app_idopen_app_dto) 更新应用(new added) @@ -1402,7 +1384,6 @@ with apollo_openapi.ApiClient(configuration) as api_client: query_params=query_params, body=body, ) - pprint(api_response) except apollo_openapi.ApiException as e: print("Exception when calling AppManagementApi->update_app: %s\n" % e) @@ -1433,7 +1414,6 @@ with apollo_openapi.ApiClient(configuration) as api_client: query_params=query_params, body=body, ) - pprint(api_response) except apollo_openapi.ApiException as e: print("Exception when calling AppManagementApi->update_app: %s\n" % e) ``` @@ -1500,16 +1480,9 @@ n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization i Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +body | Unset | body was not defined | headers | Unset | headers were not defined | -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - #### update_app.ApiResponseFor400 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- diff --git a/python/docs/apis/tags/ClusterManagementApi.md b/python/docs/apis/tags/ClusterManagementApi.md index bfcf95f..7bb96ab 100644 --- a/python/docs/apis/tags/ClusterManagementApi.md +++ b/python/docs/apis/tags/ClusterManagementApi.md @@ -171,7 +171,7 @@ Type | Description | Notes # **delete_cluster** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} delete_cluster(envapp_idcluster_name) +> delete_cluster(envapp_idcluster_name) 删除集群 (new added) @@ -220,7 +220,6 @@ with apollo_openapi.ApiClient(configuration) as api_client: path_params=path_params, query_params=query_params, ) - pprint(api_response) except apollo_openapi.ApiException as e: print("Exception when calling ClusterManagementApi->delete_cluster: %s\n" % e) @@ -239,7 +238,6 @@ with apollo_openapi.ApiClient(configuration) as api_client: path_params=path_params, query_params=query_params, ) - pprint(api_response) except apollo_openapi.ApiException as e: print("Exception when calling ClusterManagementApi->delete_cluster: %s\n" % e) ``` @@ -313,16 +311,9 @@ n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization i Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +body | Unset | body was not defined | headers | Unset | headers were not defined | -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - #### delete_cluster.ApiResponseFor400 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- diff --git a/python/docs/apis/tags/InstanceManagementApi.md b/python/docs/apis/tags/InstanceManagementApi.md index bd6aa27..db40301 100644 --- a/python/docs/apis/tags/InstanceManagementApi.md +++ b/python/docs/apis/tags/InstanceManagementApi.md @@ -334,7 +334,7 @@ Type | Description | Notes # **get_by_releases_and_namespace_not_in** -> [OpenInstanceDTO] get_by_releases_and_namespace_not_in(envapp_idcluster_namenamespace_name) +> [OpenInstanceDTO] get_by_releases_and_namespace_not_in(envapp_idcluster_namenamespace_namerelease_ids) 查询不在指定发布版本中的实例 (new added) @@ -371,25 +371,6 @@ with apollo_openapi.ApiClient(configuration) as api_client: path_params = { 'env': "env_example", } - query_params = { - 'appId': "appId_example", - 'clusterName': "clusterName_example", - 'namespaceName': "namespaceName_example", - } - try: - # 查询不在指定发布版本中的实例 (new added) - api_response = api_instance.get_by_releases_and_namespace_not_in( - path_params=path_params, - query_params=query_params, - ) - pprint(api_response) - except apollo_openapi.ApiException as e: - print("Exception when calling InstanceManagementApi->get_by_releases_and_namespace_not_in: %s\n" % e) - - # example passing only optional values - path_params = { - 'env': "env_example", - } query_params = { 'appId': "appId_example", 'clusterName': "clusterName_example", @@ -425,7 +406,7 @@ Name | Type | Description | Notes appId | AppIdSchema | | clusterName | ClusterNameSchema | | namespaceName | NamespaceNameSchema | | -releaseIds | ReleaseIdsSchema | | optional +releaseIds | ReleaseIdsSchema | | # AppIdSchema diff --git a/python/docs/apis/tags/NamespaceManagementApi.md b/python/docs/apis/tags/NamespaceManagementApi.md index 198d806..6b0be59 100644 --- a/python/docs/apis/tags/NamespaceManagementApi.md +++ b/python/docs/apis/tags/NamespaceManagementApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description # **create_missing_namespaces** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} create_missing_namespaces(app_idenvcluster_name) +> create_missing_namespaces(app_idenvcluster_name) 创建缺失的Namespace (new added) @@ -65,7 +65,6 @@ with apollo_openapi.ApiClient(configuration) as api_client: path_params=path_params, query_params=query_params, ) - pprint(api_response) except apollo_openapi.ApiException as e: print("Exception when calling NamespaceManagementApi->create_missing_namespaces: %s\n" % e) @@ -84,7 +83,6 @@ with apollo_openapi.ApiClient(configuration) as api_client: path_params=path_params, query_params=query_params, ) - pprint(api_response) except apollo_openapi.ApiException as e: print("Exception when calling NamespaceManagementApi->create_missing_namespaces: %s\n" % e) ``` @@ -94,7 +92,6 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- query_params | RequestQueryParams | | path_params | RequestPathParams | | -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned @@ -155,16 +152,9 @@ n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization i Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +body | Unset | body was not defined | headers | Unset | headers were not defined | -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - ### Authorization [ApiKeyAuth](../../../README.md#ApiKeyAuth) diff --git a/python/docs/apis/tags/PermissionManagementApi.md b/python/docs/apis/tags/PermissionManagementApi.md new file mode 100644 index 0000000..c01a492 --- /dev/null +++ b/python/docs/apis/tags/PermissionManagementApi.md @@ -0,0 +1,3412 @@ + +# apollo_openapi.apis.tags.permission_management_api.PermissionManagementApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_create_application_role_to_users**](#add_create_application_role_to_users) | **post** /openapi/v1/system/roles/create-application | 分配建应用角色 (new added) +[**add_manage_app_master_role_to_user**](#add_manage_app_master_role_to_user) | **post** /openapi/v1/apps/{appId}/roles/master | 分配AppMaster (new added) +[**assign_app_role_to_user**](#assign_app_role_to_user) | **post** /openapi/v1/apps/{appId}/roles/{roleType} | 分配应用角色 (new added) +[**assign_cluster_namespace_role_to_user**](#assign_cluster_namespace_role_to_user) | **post** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType} | 分配集群Namespace角色 (new added) +[**assign_namespace_env_role_to_user**](#assign_namespace_env_role_to_user) | **post** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType} | 分配环境Namespace角色 (new added) +[**assign_namespace_role_to_user**](#assign_namespace_role_to_user) | **post** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType} | 分配Namespace角色 (new added) +[**delete_create_application_role_from_user**](#delete_create_application_role_from_user) | **delete** /openapi/v1/system/roles/create-application | 移除建应用角色 (new added) +[**get_app_roles**](#get_app_roles) | **get** /openapi/v1/apps/{appId}/role-users | 获取应用角色用户 (new added) +[**get_cluster_namespace_roles**](#get_cluster_namespace_roles) | **get** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/role-users | 获取集群Namespace用户 (new added) +[**get_create_application_role_users**](#get_create_application_role_users) | **get** /openapi/v1/system/roles/create-application/role-users | 获取建应用用户 (new added) +[**get_namespace_env_role_users**](#get_namespace_env_role_users) | **get** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/role-users | 获取环境Namespace用户 (new added) +[**get_namespace_roles**](#get_namespace_roles) | **get** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/role-users | 获取Namespace用户 (new added) +[**has_app_permission**](#has_app_permission) | **get** /openapi/v1/apps/{appId}/permissions/{permissionType} | 校验应用权限 (new added) +[**has_cluster_namespace_permission**](#has_cluster_namespace_permission) | **get** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permissions/{permissionType} | 校验集群Namespace权限 (new added) +[**has_create_application_permission**](#has_create_application_permission) | **get** /openapi/v1/system/roles/create-application | 校验建应用权限 (new added) +[**has_env_namespace_permission**](#has_env_namespace_permission) | **get** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/permissions/{permissionType} | 校验环境Namespace权限 (new added) +[**has_namespace_permission**](#has_namespace_permission) | **get** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permissions/{permissionType} | 校验Namespace权限 (new added) +[**has_root_permission**](#has_root_permission) | **get** /openapi/v1/permissions/root | 校验Root权限 (new added) +[**init_app_permission**](#init_app_permission) | **post** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init | 初始化应用权限 (new added) +[**init_cluster_namespace_permission**](#init_cluster_namespace_permission) | **post** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permission-init | 初始化集群Namespace权限 (new added) +[**is_manage_app_master_permission_enabled**](#is_manage_app_master_permission_enabled) | **get** /openapi/v1/system/role/manage-app-master | 校验AppMaster开关 (new added) +[**remove_app_role_from_user**](#remove_app_role_from_user) | **delete** /openapi/v1/apps/{appId}/roles/{roleType} | 移除应用角色 (new added) +[**remove_cluster_namespace_role_from_user**](#remove_cluster_namespace_role_from_user) | **delete** /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType} | 移除集群Namespace角色 (new added) +[**remove_manage_app_master_role_from_user**](#remove_manage_app_master_role_from_user) | **delete** /openapi/v1/apps/{appId}/roles/master | 移除AppMaster (new added) +[**remove_namespace_env_role_from_user**](#remove_namespace_env_role_from_user) | **delete** /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType} | 移除环境Namespace角色 (new added) +[**remove_namespace_role_from_user**](#remove_namespace_role_from_user) | **delete** /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType} | 移除Namespace角色 (new added) + +# **add_create_application_role_to_users** + +> add_create_application_role_to_users() + +分配建应用角色 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only optional values + query_params = { + 'operator': "operator_example", + } + body = [ + "request_body_example" + ] + try: + # 分配建应用角色 (new added) + api_response = api_instance.add_create_application_role_to_users( + query_params=query_params, + body=body, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->add_create_application_role_to_users: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | +query_params | RequestQueryParams | | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +# SchemaForRequestBodyApplicationJson + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple, | tuple, | | + +### Tuple Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str, | str, | | + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#add_create_application_role_to_users.ApiResponseFor200) | + +#### add_create_application_role_to_users.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **add_manage_app_master_role_to_user** + +> add_manage_app_master_role_to_user(app_iduser_id) + +分配AppMaster (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 分配AppMaster (new added) + api_response = api_instance.add_manage_app_master_role_to_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->add_manage_app_master_role_to_user: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + } + query_params = { + 'operator': "operator_example", + 'userId': "userId_example", + } + try: + # 分配AppMaster (new added) + api_response = api_instance.add_manage_app_master_role_to_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->add_manage_app_master_role_to_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional +userId | UserIdSchema | | + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#add_manage_app_master_role_to_user.ApiResponseFor200) | + +#### add_manage_app_master_role_to_user.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **assign_app_role_to_user** + +> assign_app_role_to_user(app_idrole_typeuser_id) + +分配应用角色 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'roleType': "roleType_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 分配应用角色 (new added) + api_response = api_instance.assign_app_role_to_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->assign_app_role_to_user: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'roleType': "roleType_example", + } + query_params = { + 'operator': "operator_example", + 'userId': "userId_example", + } + body = "body_example" + try: + # 分配应用角色 (new added) + api_response = api_instance.assign_app_role_to_user( + path_params=path_params, + query_params=query_params, + body=body, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->assign_app_role_to_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson, Unset] | optional, default is unset | +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### body + +# SchemaForRequestBodyApplicationJson + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional +userId | UserIdSchema | | + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +roleType | RoleTypeSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# RoleTypeSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#assign_app_role_to_user.ApiResponseFor200) | + +#### assign_app_role_to_user.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **assign_cluster_namespace_role_to_user** + +> assign_cluster_namespace_role_to_user(app_idenvcluster_namerole_typeuser_id) + +分配集群Namespace角色 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'clusterName': "clusterName_example", + 'roleType': "roleType_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 分配集群Namespace角色 (new added) + api_response = api_instance.assign_cluster_namespace_role_to_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->assign_cluster_namespace_role_to_user: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'clusterName': "clusterName_example", + 'roleType': "roleType_example", + } + query_params = { + 'operator': "operator_example", + 'userId': "userId_example", + } + try: + # 分配集群Namespace角色 (new added) + api_response = api_instance.assign_cluster_namespace_role_to_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->assign_cluster_namespace_role_to_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional +userId | UserIdSchema | | + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | +clusterName | ClusterNameSchema | | +roleType | RoleTypeSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# ClusterNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# RoleTypeSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#assign_cluster_namespace_role_to_user.ApiResponseFor200) | + +#### assign_cluster_namespace_role_to_user.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **assign_namespace_env_role_to_user** + +> assign_namespace_env_role_to_user(app_idenvnamespace_namerole_typeuser_id) + +分配环境Namespace角色 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'namespaceName': "namespaceName_example", + 'roleType': "roleType_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 分配环境Namespace角色 (new added) + api_response = api_instance.assign_namespace_env_role_to_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->assign_namespace_env_role_to_user: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'namespaceName': "namespaceName_example", + 'roleType': "roleType_example", + } + query_params = { + 'operator': "operator_example", + 'userId': "userId_example", + } + try: + # 分配环境Namespace角色 (new added) + api_response = api_instance.assign_namespace_env_role_to_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->assign_namespace_env_role_to_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional +userId | UserIdSchema | | + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | +namespaceName | NamespaceNameSchema | | +roleType | RoleTypeSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# NamespaceNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# RoleTypeSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#assign_namespace_env_role_to_user.ApiResponseFor200) | + +#### assign_namespace_env_role_to_user.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **assign_namespace_role_to_user** + +> assign_namespace_role_to_user(app_idnamespace_namerole_typeuser_id) + +分配Namespace角色 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'namespaceName': "namespaceName_example", + 'roleType': "roleType_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 分配Namespace角色 (new added) + api_response = api_instance.assign_namespace_role_to_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->assign_namespace_role_to_user: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'namespaceName': "namespaceName_example", + 'roleType': "roleType_example", + } + query_params = { + 'operator': "operator_example", + 'userId': "userId_example", + } + try: + # 分配Namespace角色 (new added) + api_response = api_instance.assign_namespace_role_to_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->assign_namespace_role_to_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional +userId | UserIdSchema | | + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +namespaceName | NamespaceNameSchema | | +roleType | RoleTypeSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# NamespaceNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# RoleTypeSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#assign_namespace_role_to_user.ApiResponseFor200) | + +#### assign_namespace_role_to_user.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **delete_create_application_role_from_user** + +> delete_create_application_role_from_user(user_id) + +移除建应用角色 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + query_params = { + 'userId': "userId_example", + } + try: + # 移除建应用角色 (new added) + api_response = api_instance.delete_create_application_role_from_user( + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->delete_create_application_role_from_user: %s\n" % e) + + # example passing only optional values + query_params = { + 'operator': "operator_example", + 'userId': "userId_example", + } + try: + # 移除建应用角色 (new added) + api_response = api_instance.delete_create_application_role_from_user( + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->delete_create_application_role_from_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional +userId | UserIdSchema | | + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#delete_create_application_role_from_user.ApiResponseFor200) | + +#### delete_create_application_role_from_user.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **get_app_roles** + +> OpenAppRoleUserDTO get_app_roles(app_id) + +获取应用角色用户 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +from apollo_openapi.model.open_app_role_user_dto import OpenAppRoleUserDTO +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + } + try: + # 获取应用角色用户 (new added) + api_response = api_instance.get_app_roles( + path_params=path_params, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->get_app_roles: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +path_params | RequestPathParams | | +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#get_app_roles.ApiResponseFor200) | + +#### get_app_roles.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OpenAppRoleUserDTO**](../../models/OpenAppRoleUserDTO.md) | | + + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **get_cluster_namespace_roles** + +> OpenClusterNamespaceRoleUserDTO get_cluster_namespace_roles(app_idenvcluster_name) + +获取集群Namespace用户 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +from apollo_openapi.model.open_cluster_namespace_role_user_dto import OpenClusterNamespaceRoleUserDTO +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'clusterName': "clusterName_example", + } + try: + # 获取集群Namespace用户 (new added) + api_response = api_instance.get_cluster_namespace_roles( + path_params=path_params, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->get_cluster_namespace_roles: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +path_params | RequestPathParams | | +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | +clusterName | ClusterNameSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# ClusterNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#get_cluster_namespace_roles.ApiResponseFor200) | + +#### get_cluster_namespace_roles.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OpenClusterNamespaceRoleUserDTO**](../../models/OpenClusterNamespaceRoleUserDTO.md) | | + + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **get_create_application_role_users** + +> [str] get_create_application_role_users() + +获取建应用用户 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # 获取建应用用户 (new added) + api_response = api_instance.get_create_application_role_users() + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->get_create_application_role_users: %s\n" % e) +``` +### Parameters +This endpoint does not need any parameter. + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#get_create_application_role_users.ApiResponseFor200) | + +#### get_create_application_role_users.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple, | tuple, | | + +### Tuple Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +items | str, | str, | | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **get_namespace_env_role_users** + +> OpenEnvNamespaceRoleUserDTO get_namespace_env_role_users(app_idenvnamespace_name) + +获取环境Namespace用户 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +from apollo_openapi.model.open_env_namespace_role_user_dto import OpenEnvNamespaceRoleUserDTO +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'namespaceName': "namespaceName_example", + } + try: + # 获取环境Namespace用户 (new added) + api_response = api_instance.get_namespace_env_role_users( + path_params=path_params, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->get_namespace_env_role_users: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +path_params | RequestPathParams | | +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | +namespaceName | NamespaceNameSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# NamespaceNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#get_namespace_env_role_users.ApiResponseFor200) | + +#### get_namespace_env_role_users.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OpenEnvNamespaceRoleUserDTO**](../../models/OpenEnvNamespaceRoleUserDTO.md) | | + + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **get_namespace_roles** + +> OpenNamespaceRoleUserDTO get_namespace_roles(app_idnamespace_name) + +获取Namespace用户 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +from apollo_openapi.model.open_namespace_role_user_dto import OpenNamespaceRoleUserDTO +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'namespaceName': "namespaceName_example", + } + try: + # 获取Namespace用户 (new added) + api_response = api_instance.get_namespace_roles( + path_params=path_params, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->get_namespace_roles: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +path_params | RequestPathParams | | +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +namespaceName | NamespaceNameSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# NamespaceNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#get_namespace_roles.ApiResponseFor200) | + +#### get_namespace_roles.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OpenNamespaceRoleUserDTO**](../../models/OpenNamespaceRoleUserDTO.md) | | + + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **has_app_permission** + +> OpenPermissionConditionDTO has_app_permission(app_idpermission_typeuser_id) + +校验应用权限 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'permissionType': "permissionType_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 校验应用权限 (new added) + api_response = api_instance.has_app_permission( + path_params=path_params, + query_params=query_params, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->has_app_permission: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +userId | UserIdSchema | | + + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +permissionType | PermissionTypeSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# PermissionTypeSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#has_app_permission.ApiResponseFor200) | + +#### has_app_permission.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OpenPermissionConditionDTO**](../../models/OpenPermissionConditionDTO.md) | | + + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **has_cluster_namespace_permission** + +> OpenPermissionConditionDTO has_cluster_namespace_permission(app_idenvcluster_namepermission_typeuser_id) + +校验集群Namespace权限 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'clusterName': "clusterName_example", + 'permissionType': "permissionType_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 校验集群Namespace权限 (new added) + api_response = api_instance.has_cluster_namespace_permission( + path_params=path_params, + query_params=query_params, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->has_cluster_namespace_permission: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +userId | UserIdSchema | | + + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | +clusterName | ClusterNameSchema | | +permissionType | PermissionTypeSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# ClusterNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# PermissionTypeSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#has_cluster_namespace_permission.ApiResponseFor200) | + +#### has_cluster_namespace_permission.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OpenPermissionConditionDTO**](../../models/OpenPermissionConditionDTO.md) | | + + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **has_create_application_permission** + +> {str: (bool,)} has_create_application_permission(user_id) + +校验建应用权限 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + query_params = { + 'userId': "userId_example", + } + try: + # 校验建应用权限 (new added) + api_response = api_instance.has_create_application_permission( + query_params=query_params, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->has_create_application_permission: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +userId | UserIdSchema | | + + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#has_create_application_permission.ApiResponseFor200) | + +#### has_create_application_permission.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | + +### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | bool, | BoolClass, | any string name can be used but the value must be the correct type | [optional] + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **has_env_namespace_permission** + +> OpenPermissionConditionDTO has_env_namespace_permission(app_idenvnamespace_namepermission_typeuser_id) + +校验环境Namespace权限 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'namespaceName': "namespaceName_example", + 'permissionType': "permissionType_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 校验环境Namespace权限 (new added) + api_response = api_instance.has_env_namespace_permission( + path_params=path_params, + query_params=query_params, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->has_env_namespace_permission: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +userId | UserIdSchema | | + + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | +namespaceName | NamespaceNameSchema | | +permissionType | PermissionTypeSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# NamespaceNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# PermissionTypeSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#has_env_namespace_permission.ApiResponseFor200) | + +#### has_env_namespace_permission.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OpenPermissionConditionDTO**](../../models/OpenPermissionConditionDTO.md) | | + + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **has_namespace_permission** + +> OpenPermissionConditionDTO has_namespace_permission(app_idnamespace_namepermission_typeuser_id) + +校验Namespace权限 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'namespaceName': "namespaceName_example", + 'permissionType': "permissionType_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 校验Namespace权限 (new added) + api_response = api_instance.has_namespace_permission( + path_params=path_params, + query_params=query_params, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->has_namespace_permission: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +userId | UserIdSchema | | + + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +namespaceName | NamespaceNameSchema | | +permissionType | PermissionTypeSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# NamespaceNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# PermissionTypeSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#has_namespace_permission.ApiResponseFor200) | + +#### has_namespace_permission.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OpenPermissionConditionDTO**](../../models/OpenPermissionConditionDTO.md) | | + + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **has_root_permission** + +> OpenPermissionConditionDTO has_root_permission(user_id) + +校验Root权限 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + query_params = { + 'userId': "userId_example", + } + try: + # 校验Root权限 (new added) + api_response = api_instance.has_root_permission( + query_params=query_params, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->has_root_permission: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +userId | UserIdSchema | | + + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#has_root_permission.ApiResponseFor200) | + +#### has_root_permission.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OpenPermissionConditionDTO**](../../models/OpenPermissionConditionDTO.md) | | + + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **init_app_permission** + +> init_app_permission(app_idnamespace_name) + +初始化应用权限 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'namespaceName': "namespaceName_example", + } + query_params = { + } + try: + # 初始化应用权限 (new added) + api_response = api_instance.init_app_permission( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->init_app_permission: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'namespaceName': "namespaceName_example", + } + query_params = { + 'operator': "operator_example", + } + try: + # 初始化应用权限 (new added) + api_response = api_instance.init_app_permission( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->init_app_permission: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +namespaceName | NamespaceNameSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# NamespaceNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#init_app_permission.ApiResponseFor200) | 初始化成功 + +#### init_app_permission.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **init_cluster_namespace_permission** + +> init_cluster_namespace_permission(app_idenvcluster_name) + +初始化集群Namespace权限 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'clusterName': "clusterName_example", + } + query_params = { + } + try: + # 初始化集群Namespace权限 (new added) + api_response = api_instance.init_cluster_namespace_permission( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->init_cluster_namespace_permission: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'clusterName': "clusterName_example", + } + query_params = { + 'operator': "operator_example", + } + try: + # 初始化集群Namespace权限 (new added) + api_response = api_instance.init_cluster_namespace_permission( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->init_cluster_namespace_permission: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | +clusterName | ClusterNameSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# ClusterNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#init_cluster_namespace_permission.ApiResponseFor200) | + +#### init_cluster_namespace_permission.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **is_manage_app_master_permission_enabled** + +> {str: (bool,)} is_manage_app_master_permission_enabled() + +校验AppMaster开关 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example, this endpoint has no required or optional parameters + try: + # 校验AppMaster开关 (new added) + api_response = api_instance.is_manage_app_master_permission_enabled() + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->is_manage_app_master_permission_enabled: %s\n" % e) +``` +### Parameters +This endpoint does not need any parameter. + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#is_manage_app_master_permission_enabled.ApiResponseFor200) | + +#### is_manage_app_master_permission_enabled.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor200ResponseBodyApplicationJson + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | + +### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**any_string_name** | bool, | BoolClass, | any string name can be used but the value must be the correct type | [optional] + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **remove_app_role_from_user** + +> remove_app_role_from_user(app_idrole_typeuser_id) + +移除应用角色 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'roleType': "roleType_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 移除应用角色 (new added) + api_response = api_instance.remove_app_role_from_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->remove_app_role_from_user: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'roleType': "roleType_example", + } + query_params = { + 'operator': "operator_example", + 'userId': "userId_example", + } + try: + # 移除应用角色 (new added) + api_response = api_instance.remove_app_role_from_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->remove_app_role_from_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional +userId | UserIdSchema | | + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +roleType | RoleTypeSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# RoleTypeSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#remove_app_role_from_user.ApiResponseFor200) | + +#### remove_app_role_from_user.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **remove_cluster_namespace_role_from_user** + +> remove_cluster_namespace_role_from_user(app_idenvcluster_namerole_typeuser_id) + +移除集群Namespace角色 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'clusterName': "clusterName_example", + 'roleType': "roleType_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 移除集群Namespace角色 (new added) + api_response = api_instance.remove_cluster_namespace_role_from_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->remove_cluster_namespace_role_from_user: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'clusterName': "clusterName_example", + 'roleType': "roleType_example", + } + query_params = { + 'operator': "operator_example", + 'userId': "userId_example", + } + try: + # 移除集群Namespace角色 (new added) + api_response = api_instance.remove_cluster_namespace_role_from_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->remove_cluster_namespace_role_from_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional +userId | UserIdSchema | | + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | +clusterName | ClusterNameSchema | | +roleType | RoleTypeSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# ClusterNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# RoleTypeSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#remove_cluster_namespace_role_from_user.ApiResponseFor200) | + +#### remove_cluster_namespace_role_from_user.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **remove_manage_app_master_role_from_user** + +> remove_manage_app_master_role_from_user(app_iduser_id) + +移除AppMaster (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 移除AppMaster (new added) + api_response = api_instance.remove_manage_app_master_role_from_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->remove_manage_app_master_role_from_user: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + } + query_params = { + 'operator': "operator_example", + 'userId': "userId_example", + } + try: + # 移除AppMaster (new added) + api_response = api_instance.remove_manage_app_master_role_from_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->remove_manage_app_master_role_from_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional +userId | UserIdSchema | | + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#remove_manage_app_master_role_from_user.ApiResponseFor200) | + +#### remove_manage_app_master_role_from_user.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **remove_namespace_env_role_from_user** + +> remove_namespace_env_role_from_user(app_idenvnamespace_namerole_typeuser_id) + +移除环境Namespace角色 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'namespaceName': "namespaceName_example", + 'roleType': "roleType_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 移除环境Namespace角色 (new added) + api_response = api_instance.remove_namespace_env_role_from_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->remove_namespace_env_role_from_user: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'namespaceName': "namespaceName_example", + 'roleType': "roleType_example", + } + query_params = { + 'operator': "operator_example", + 'userId': "userId_example", + } + try: + # 移除环境Namespace角色 (new added) + api_response = api_instance.remove_namespace_env_role_from_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->remove_namespace_env_role_from_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional +userId | UserIdSchema | | + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +env | EnvSchema | | +namespaceName | NamespaceNameSchema | | +roleType | RoleTypeSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# EnvSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# NamespaceNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# RoleTypeSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#remove_namespace_env_role_from_user.ApiResponseFor200) | + +#### remove_namespace_env_role_from_user.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) + +# **remove_namespace_role_from_user** + +> remove_namespace_role_from_user(app_idnamespace_namerole_typeuser_id) + +移除Namespace角色 (new added) + +### Example + +* Api Key Authentication (ApiKeyAuth): +```python +import apollo_openapi +from apollo_openapi.apis.tags import permission_management_api +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. +configuration = apollo_openapi.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' +# Enter a context with an instance of the API client +with apollo_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = permission_management_api.PermissionManagementApi(api_client) + + # example passing only required values which don't have defaults set + path_params = { + 'appId': "appId_example", + 'namespaceName': "namespaceName_example", + 'roleType': "roleType_example", + } + query_params = { + 'userId': "userId_example", + } + try: + # 移除Namespace角色 (new added) + api_response = api_instance.remove_namespace_role_from_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->remove_namespace_role_from_user: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'namespaceName': "namespaceName_example", + 'roleType': "roleType_example", + } + query_params = { + 'operator': "operator_example", + 'userId': "userId_example", + } + try: + # 移除Namespace角色 (new added) + api_response = api_instance.remove_namespace_role_from_user( + path_params=path_params, + query_params=query_params, + ) + except apollo_openapi.ApiException as e: + print("Exception when calling PermissionManagementApi->remove_namespace_role_from_user: %s\n" % e) +``` +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +query_params | RequestQueryParams | | +path_params | RequestPathParams | | +stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file +timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client +skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional +userId | UserIdSchema | | + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# UserIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### path_params +#### RequestPathParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +appId | AppIdSchema | | +namespaceName | NamespaceNameSchema | | +roleType | RoleTypeSchema | | + +# AppIdSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# NamespaceNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +# RoleTypeSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + +### Return Types, Responses + +Code | Class | Description +------------- | ------------- | ------------- +n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned +200 | [ApiResponseFor200](#remove_namespace_role_from_user.ApiResponseFor200) | + +#### remove_namespace_role_from_user.ApiResponseFor200 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | Unset | body was not defined | +headers | Unset | headers were not defined | + +### Authorization + +[ApiKeyAuth](../../../README.md#ApiKeyAuth) + +[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) diff --git a/python/docs/apis/tags/ReleaseManagementApi.md b/python/docs/apis/tags/ReleaseManagementApi.md index c78c423..f348811 100644 --- a/python/docs/apis/tags/ReleaseManagementApi.md +++ b/python/docs/apis/tags/ReleaseManagementApi.md @@ -5,20 +5,22 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[**compare_release**](#compare_release) | **get** /openapi/v1/envs/{env}/releases/comparison | Compare two releases [**create_gray_del_release**](#create_gray_del_release) | **post** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/gray-del-releases | 创建灰度删除发布 (original openapi) [**create_gray_release**](#create_gray_release) | **post** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/releases | 创建灰度发布 (original openapi) [**create_release**](#create_release) | **post** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases | 创建发布 (original openapi) [**find_active_releases**](#find_active_releases) | **get** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active | 获取活跃发布(分页) (new added) -[**find_all_releases**](#find_all_releases) | **get** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all | 获取所有发布(分页) (new added) [**get_release_by_id**](#get_release_by_id) | **get** /openapi/v1/envs/{env}/releases/{releaseId} | 获取发布详情 (new added) [**load_latest_active_release**](#load_latest_active_release) | **get** /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/latest | 获取最新活跃发布 (original openapi) [**rollback**](#rollback) | **put** /openapi/v1/envs/{env}/releases/{releaseId}/rollback | 回滚发布 (original openapi) -# **create_gray_del_release** - -> OpenReleaseDTO create_gray_del_release(app_idenvcluster_namenamespace_namebranch_namenamespace_gray_del_release_dto) +# **compare_release** + +> OpenReleaseDiffDTO compare_release(envbase_release_idto_compare_release_id) -创建灰度删除发布 (original openapi) +Compare two releases + +Get the configuration differences between two releases. ### Example @@ -26,8 +28,7 @@ Method | HTTP request | Description ```python import apollo_openapi from apollo_openapi.apis.tags import release_management_api -from apollo_openapi.model.open_release_dto import OpenReleaseDTO -from apollo_openapi.model.namespace_gray_del_release_dto import NamespaceGrayDelReleaseDTO +from apollo_openapi.model.open_release_diff_dto import OpenReleaseDiffDTO 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. @@ -52,91 +53,64 @@ with apollo_openapi.ApiClient(configuration) as api_client: # example passing only required values which don't have defaults set path_params = { - 'appId': "appId_example", 'env': "env_example", - 'clusterName': "clusterName_example", - 'namespaceName': "namespaceName_example", - 'branchName': "branchName_example", } - body = NamespaceGrayDelReleaseDTO( - release_title="release_title_example", - release_comment="release_comment_example", - released_by="released_by_example", - is_emergency_publish=True, - gray_del_keys=[ - "gray_del_keys_example" - ], - ) + query_params = { + 'baseReleaseId': 1, + 'toCompareReleaseId': 1, + } try: - # 创建灰度删除发布 (original openapi) - api_response = api_instance.create_gray_del_release( + # Compare two releases + api_response = api_instance.compare_release( path_params=path_params, - body=body, + query_params=query_params, ) pprint(api_response) except apollo_openapi.ApiException as e: - print("Exception when calling ReleaseManagementApi->create_gray_del_release: %s\n" % e) + print("Exception when calling ReleaseManagementApi->compare_release: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +query_params | RequestQueryParams | | path_params | RequestPathParams | | -content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned -### body - -# SchemaForRequestBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**NamespaceGrayDelReleaseDTO**](../../models/NamespaceGrayDelReleaseDTO.md) | | - - -### path_params -#### RequestPathParams +### query_params +#### RequestQueryParams Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -appId | AppIdSchema | | -env | EnvSchema | | -clusterName | ClusterNameSchema | | -namespaceName | NamespaceNameSchema | | -branchName | BranchNameSchema | | +baseReleaseId | BaseReleaseIdSchema | | +toCompareReleaseId | ToCompareReleaseIdSchema | | -# AppIdSchema - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | -# EnvSchema +# BaseReleaseIdSchema ## Model Type Info Input Type | Accessed Type | Description | Notes ------------ | ------------- | ------------- | ------------- -str, | str, | | +decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer -# ClusterNameSchema +# ToCompareReleaseIdSchema ## Model Type Info Input Type | Accessed Type | Description | Notes ------------ | ------------- | ------------- | ------------- -str, | str, | | +decimal.Decimal, int, | decimal.Decimal, | | value must be a 64 bit integer -# NamespaceNameSchema +### path_params +#### RequestPathParams -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -str, | str, | | +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +env | EnvSchema | | -# BranchNameSchema +# EnvSchema ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -148,9 +122,9 @@ str, | str, | | Code | Class | Description ------------- | ------------- | ------------- n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#create_gray_del_release.ApiResponseFor200) | +200 | [ApiResponseFor200](#compare_release.ApiResponseFor200) | Successful comparison -#### create_gray_del_release.ApiResponseFor200 +#### compare_release.ApiResponseFor200 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- response | urllib3.HTTPResponse | Raw response | @@ -160,7 +134,7 @@ headers | Unset | headers were not defined | # SchemaFor200ResponseBodyApplicationJson Type | Description | Notes ------------- | ------------- | ------------- -[**OpenReleaseDTO**](../../models/OpenReleaseDTO.md) | | +[**OpenReleaseDiffDTO**](../../models/OpenReleaseDiffDTO.md) | | ### Authorization @@ -169,13 +143,11 @@ Type | Description | Notes [[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) -# **create_gray_release** - -> OpenReleaseDTO create_gray_release(app_idenvcluster_namenamespace_namebranch_namenamespace_release_dto) - -创建灰度发布 (original openapi) +# **create_gray_del_release** + +> OpenReleaseDTO create_gray_del_release(app_idenvcluster_namenamespace_namebranch_namenamespace_gray_del_release_dto) -创建灰度发布 +创建灰度删除发布 (original openapi) ### Example @@ -184,7 +156,7 @@ Type | Description | Notes import apollo_openapi from apollo_openapi.apis.tags import release_management_api from apollo_openapi.model.open_release_dto import OpenReleaseDTO -from apollo_openapi.model.namespace_release_dto import NamespaceReleaseDTO +from apollo_openapi.model.namespace_gray_del_release_dto import NamespaceGrayDelReleaseDTO 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. @@ -215,27 +187,65 @@ with apollo_openapi.ApiClient(configuration) as api_client: 'namespaceName': "namespaceName_example", 'branchName': "branchName_example", } - body = NamespaceReleaseDTO( + query_params = { + } + body = NamespaceGrayDelReleaseDTO( release_title="release_title_example", release_comment="release_comment_example", released_by="released_by_example", is_emergency_publish=True, + gray_del_keys=[ + "gray_del_keys_example" + ], ) try: - # 创建灰度发布 (original openapi) - api_response = api_instance.create_gray_release( + # 创建灰度删除发布 (original openapi) + api_response = api_instance.create_gray_del_release( path_params=path_params, + query_params=query_params, body=body, ) pprint(api_response) except apollo_openapi.ApiException as e: - print("Exception when calling ReleaseManagementApi->create_gray_release: %s\n" % e) + print("Exception when calling ReleaseManagementApi->create_gray_del_release: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'clusterName': "clusterName_example", + 'namespaceName': "namespaceName_example", + 'branchName': "branchName_example", + } + query_params = { + 'operator': "operator_example", + } + body = NamespaceGrayDelReleaseDTO( + release_title="release_title_example", + release_comment="release_comment_example", + released_by="released_by_example", + is_emergency_publish=True, + gray_del_keys=[ + "gray_del_keys_example" + ], + ) + try: + # 创建灰度删除发布 (original openapi) + api_response = api_instance.create_gray_del_release( + path_params=path_params, + query_params=query_params, + body=body, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling ReleaseManagementApi->create_gray_del_release: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +query_params | RequestQueryParams | | path_params | RequestPathParams | | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client @@ -248,8 +258,23 @@ skip_deserialization | bool | default is False | when True, headers and body wil # SchemaForRequestBodyApplicationJson Type | Description | Notes ------------- | ------------- | ------------- -[**NamespaceReleaseDTO**](../../models/NamespaceReleaseDTO.md) | | +[**NamespaceGrayDelReleaseDTO**](../../models/NamespaceGrayDelReleaseDTO.md) | | + +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | ### path_params #### RequestPathParams @@ -302,9 +327,9 @@ str, | str, | | Code | Class | Description ------------- | ------------- | ------------- n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#create_gray_release.ApiResponseFor200) | 灰度发布创建成功 +200 | [ApiResponseFor200](#create_gray_del_release.ApiResponseFor200) | -#### create_gray_release.ApiResponseFor200 +#### create_gray_del_release.ApiResponseFor200 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- response | urllib3.HTTPResponse | Raw response | @@ -323,13 +348,13 @@ Type | Description | Notes [[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) -# **create_release** - -> OpenReleaseDTO create_release(app_idenvcluster_namenamespace_namenamespace_release_dto) +# **create_gray_release** + +> OpenReleaseDTO create_gray_release(app_idenvcluster_namenamespace_namebranch_namenamespace_release_dto) -创建发布 (original openapi) +创建灰度发布 (original openapi) -创建发布 +创建灰度发布 ### Example @@ -339,7 +364,6 @@ import apollo_openapi from apollo_openapi.apis.tags import release_management_api from apollo_openapi.model.open_release_dto import OpenReleaseDTO from apollo_openapi.model.namespace_release_dto import NamespaceReleaseDTO -from apollo_openapi.model.exception_response import ExceptionResponse 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. @@ -368,6 +392,9 @@ with apollo_openapi.ApiClient(configuration) as api_client: 'env': "env_example", 'clusterName': "clusterName_example", 'namespaceName': "namespaceName_example", + 'branchName': "branchName_example", + } + query_params = { } body = NamespaceReleaseDTO( release_title="release_title_example", @@ -376,20 +403,50 @@ with apollo_openapi.ApiClient(configuration) as api_client: is_emergency_publish=True, ) try: - # 创建发布 (original openapi) - api_response = api_instance.create_release( + # 创建灰度发布 (original openapi) + api_response = api_instance.create_gray_release( path_params=path_params, + query_params=query_params, body=body, ) pprint(api_response) except apollo_openapi.ApiException as e: - print("Exception when calling ReleaseManagementApi->create_release: %s\n" % e) + print("Exception when calling ReleaseManagementApi->create_gray_release: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'clusterName': "clusterName_example", + 'namespaceName': "namespaceName_example", + 'branchName': "branchName_example", + } + query_params = { + 'operator': "operator_example", + } + body = NamespaceReleaseDTO( + release_title="release_title_example", + release_comment="release_comment_example", + released_by="released_by_example", + is_emergency_publish=True, + ) + try: + # 创建灰度发布 (original openapi) + api_response = api_instance.create_gray_release( + path_params=path_params, + query_params=query_params, + body=body, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling ReleaseManagementApi->create_gray_release: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- body | typing.Union[SchemaForRequestBodyApplicationJson] | required | +query_params | RequestQueryParams | | path_params | RequestPathParams | | content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client @@ -405,6 +462,21 @@ Type | Description | Notes [**NamespaceReleaseDTO**](../../models/NamespaceReleaseDTO.md) | | +### query_params +#### RequestQueryParams + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +operator | OperatorSchema | | optional + + +# OperatorSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + ### path_params #### RequestPathParams @@ -414,6 +486,7 @@ appId | AppIdSchema | | env | EnvSchema | | clusterName | ClusterNameSchema | | namespaceName | NamespaceNameSchema | | +branchName | BranchNameSchema | | # AppIdSchema @@ -443,16 +516,21 @@ Input Type | Accessed Type | Description | Notes ------------ | ------------- | ------------- | ------------- str, | str, | | +# BranchNameSchema + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +str, | str, | | + ### Return Types, Responses Code | Class | Description ------------- | ------------- | ------------- n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#create_release.ApiResponseFor200) | 发布创建成功 -400 | [ApiResponseFor400](#create_release.ApiResponseFor400) | 发布参数错误 -403 | [ApiResponseFor403](#create_release.ApiResponseFor403) | 权限不足 +200 | [ApiResponseFor200](#create_gray_release.ApiResponseFor200) | 灰度发布创建成功 -#### create_release.ApiResponseFor200 +#### create_gray_release.ApiResponseFor200 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- response | urllib3.HTTPResponse | Raw response | @@ -465,45 +543,19 @@ Type | Description | Notes [**OpenReleaseDTO**](../../models/OpenReleaseDTO.md) | | -#### create_release.ApiResponseFor400 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor400ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor400ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ExceptionResponse**](../../models/ExceptionResponse.md) | | - - -#### create_release.ApiResponseFor403 -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor403ResponseBodyApplicationJson, ] | | -headers | Unset | headers were not defined | - -# SchemaFor403ResponseBodyApplicationJson -Type | Description | Notes -------------- | ------------- | ------------- -[**ExceptionResponse**](../../models/ExceptionResponse.md) | | - - ### Authorization [ApiKeyAuth](../../../README.md#ApiKeyAuth) [[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) -# **find_active_releases** - -> [OpenReleaseDTO] find_active_releases(app_idenvcluster_namenamespace_namepagesize) +# **create_release** + +> OpenReleaseDTO create_release(app_idenvcluster_namenamespace_namenamespace_release_dto) -获取活跃发布(分页) (new added) +创建发布 (original openapi) -GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active +创建发布 ### Example @@ -512,6 +564,8 @@ GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{names import apollo_openapi from apollo_openapi.apis.tags import release_management_api from apollo_openapi.model.open_release_dto import OpenReleaseDTO +from apollo_openapi.model.namespace_release_dto import NamespaceReleaseDTO +from apollo_openapi.model.exception_response import ExceptionResponse 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. @@ -542,52 +596,86 @@ with apollo_openapi.ApiClient(configuration) as api_client: 'namespaceName': "namespaceName_example", } query_params = { - 'page': 0, - 'size': 5, } + body = NamespaceReleaseDTO( + release_title="release_title_example", + release_comment="release_comment_example", + released_by="released_by_example", + is_emergency_publish=True, + ) try: - # 获取活跃发布(分页) (new added) - api_response = api_instance.find_active_releases( + # 创建发布 (original openapi) + api_response = api_instance.create_release( path_params=path_params, query_params=query_params, + body=body, ) pprint(api_response) except apollo_openapi.ApiException as e: - print("Exception when calling ReleaseManagementApi->find_active_releases: %s\n" % e) + print("Exception when calling ReleaseManagementApi->create_release: %s\n" % e) + + # example passing only optional values + path_params = { + 'appId': "appId_example", + 'env': "env_example", + 'clusterName': "clusterName_example", + 'namespaceName': "namespaceName_example", + } + query_params = { + 'operator': "operator_example", + } + body = NamespaceReleaseDTO( + release_title="release_title_example", + release_comment="release_comment_example", + released_by="released_by_example", + is_emergency_publish=True, + ) + try: + # 创建发布 (original openapi) + api_response = api_instance.create_release( + path_params=path_params, + query_params=query_params, + body=body, + ) + pprint(api_response) + except apollo_openapi.ApiException as e: + print("Exception when calling ReleaseManagementApi->create_release: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +body | typing.Union[SchemaForRequestBodyApplicationJson] | required | query_params | RequestQueryParams | | path_params | RequestPathParams | | +content_type | str | optional, default is 'application/json' | Selects the schema and serialization of the request body accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned +### body + +# SchemaForRequestBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**NamespaceReleaseDTO**](../../models/NamespaceReleaseDTO.md) | | + + ### query_params #### RequestQueryParams Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -page | PageSchema | | -size | SizeSchema | | - - -# PageSchema +operator | OperatorSchema | | optional -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | -# SizeSchema +# OperatorSchema ## Model Type Info Input Type | Accessed Type | Description | Notes ------------ | ------------- | ------------- | ------------- -decimal.Decimal, int, | decimal.Decimal, | | +str, | str, | | ### path_params #### RequestPathParams @@ -632,9 +720,11 @@ str, | str, | | Code | Class | Description ------------- | ------------- | ------------- n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#find_active_releases.ApiResponseFor200) | 成功获取活跃发布列表 +200 | [ApiResponseFor200](#create_release.ApiResponseFor200) | 发布创建成功 +400 | [ApiResponseFor400](#create_release.ApiResponseFor400) | 发布参数错误 +403 | [ApiResponseFor403](#create_release.ApiResponseFor403) | 权限不足 -#### find_active_releases.ApiResponseFor200 +#### create_release.ApiResponseFor200 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- response | urllib3.HTTPResponse | Raw response | @@ -642,16 +732,36 @@ body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | headers | Unset | headers were not defined | # SchemaFor200ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**OpenReleaseDTO**](../../models/OpenReleaseDTO.md) | | -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -list, tuple, | tuple, | | -### Tuple Items -Class Name | Input Type | Accessed Type | Description | Notes -------------- | ------------- | ------------- | ------------- | ------------- -[**OpenReleaseDTO**]({{complexTypePrefix}}OpenReleaseDTO.md) | [**OpenReleaseDTO**]({{complexTypePrefix}}OpenReleaseDTO.md) | [**OpenReleaseDTO**]({{complexTypePrefix}}OpenReleaseDTO.md) | | +#### create_release.ApiResponseFor400 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor400ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor400ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ExceptionResponse**](../../models/ExceptionResponse.md) | | + + +#### create_release.ApiResponseFor403 +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +response | urllib3.HTTPResponse | Raw response | +body | typing.Union[SchemaFor403ResponseBodyApplicationJson, ] | | +headers | Unset | headers were not defined | + +# SchemaFor403ResponseBodyApplicationJson +Type | Description | Notes +------------- | ------------- | ------------- +[**ExceptionResponse**](../../models/ExceptionResponse.md) | | + ### Authorization @@ -659,13 +769,13 @@ Class Name | Input Type | Accessed Type | Description | Notes [[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md) -# **find_all_releases** - -> [OpenReleaseBO] find_all_releases(app_idenvcluster_namenamespace_namepagesize) +# **find_active_releases** + +> [OpenReleaseDTO] find_active_releases(app_idenvcluster_namenamespace_namepagesize) -获取所有发布(分页) (new added) +获取活跃发布(分页) (new added) -GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all +GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active ### Example @@ -673,7 +783,7 @@ GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{names ```python import apollo_openapi from apollo_openapi.apis.tags import release_management_api -from apollo_openapi.model.open_release_bo import OpenReleaseBO +from apollo_openapi.model.open_release_dto import OpenReleaseDTO 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. @@ -708,14 +818,14 @@ with apollo_openapi.ApiClient(configuration) as api_client: 'size': 5, } try: - # 获取所有发布(分页) (new added) - api_response = api_instance.find_all_releases( + # 获取活跃发布(分页) (new added) + api_response = api_instance.find_active_releases( path_params=path_params, query_params=query_params, ) pprint(api_response) except apollo_openapi.ApiException as e: - print("Exception when calling ReleaseManagementApi->find_all_releases: %s\n" % e) + print("Exception when calling ReleaseManagementApi->find_active_releases: %s\n" % e) ``` ### Parameters @@ -794,9 +904,9 @@ str, | str, | | Code | Class | Description ------------- | ------------- | ------------- n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned -200 | [ApiResponseFor200](#find_all_releases.ApiResponseFor200) | 成功获取发布列表 +200 | [ApiResponseFor200](#find_active_releases.ApiResponseFor200) | 成功获取活跃发布列表 -#### find_all_releases.ApiResponseFor200 +#### find_active_releases.ApiResponseFor200 Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- response | urllib3.HTTPResponse | Raw response | @@ -813,7 +923,7 @@ list, tuple, | tuple, | | ### Tuple Items Class Name | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -[**OpenReleaseBO**]({{complexTypePrefix}}OpenReleaseBO.md) | [**OpenReleaseBO**]({{complexTypePrefix}}OpenReleaseBO.md) | [**OpenReleaseBO**]({{complexTypePrefix}}OpenReleaseBO.md) | | +[**OpenReleaseDTO**]({{complexTypePrefix}}OpenReleaseDTO.md) | [**OpenReleaseDTO**]({{complexTypePrefix}}OpenReleaseDTO.md) | [**OpenReleaseDTO**]({{complexTypePrefix}}OpenReleaseDTO.md) | | ### Authorization @@ -1074,7 +1184,7 @@ Type | Description | Notes # **rollback** -> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} rollback(envrelease_id) +> rollback(envrelease_id) 回滚发布 (original openapi) @@ -1121,7 +1231,6 @@ with apollo_openapi.ApiClient(configuration) as api_client: path_params=path_params, query_params=query_params, ) - pprint(api_response) except apollo_openapi.ApiException as e: print("Exception when calling ReleaseManagementApi->rollback: %s\n" % e) @@ -1139,7 +1248,6 @@ with apollo_openapi.ApiClient(configuration) as api_client: path_params=path_params, query_params=query_params, ) - pprint(api_response) except apollo_openapi.ApiException as e: print("Exception when calling ReleaseManagementApi->rollback: %s\n" % e) ``` @@ -1149,7 +1257,6 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- query_params | RequestQueryParams | | path_params | RequestPathParams | | -accept_content_types | typing.Tuple[str] | default is ('application/json', ) | Tells the server the content type(s) that are accepted by the client stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned @@ -1202,16 +1309,9 @@ n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization i Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- response | urllib3.HTTPResponse | Raw response | -body | typing.Union[SchemaFor200ResponseBodyApplicationJson, ] | | +body | Unset | body was not defined | headers | Unset | headers were not defined | -# SchemaFor200ResponseBodyApplicationJson - -## Model Type Info -Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- -dict, frozendict.frozendict, | frozendict.frozendict, | | - ### Authorization [ApiKeyAuth](../../../README.md#ApiKeyAuth) diff --git a/python/docs/models/OpenAccessKeyDTO.md b/python/docs/models/OpenAccessKeyDTO.md new file mode 100644 index 0000000..a042252 --- /dev/null +++ b/python/docs/models/OpenAccessKeyDTO.md @@ -0,0 +1,24 @@ +# apollo_openapi.model.open_access_key_dto.OpenAccessKeyDTO + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | + +### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**dataChangeCreatedBy** | str, | str, | | [optional] +**dataChangeLastModifiedBy** | str, | str, | | [optional] +**dataChangeCreatedByDisplayName** | str, | str, | | [optional] +**dataChangeLastModifiedByDisplayName** | str, | str, | | [optional] +**dataChangeCreatedTime** | str, | str, | | [optional] +**dataChangeLastModifiedTime** | str, | str, | | [optional] +**id** | decimal.Decimal, int, | decimal.Decimal, | | [optional] value must be a 64 bit integer +**secret** | str, | str, | | [optional] +**appId** | str, | str, | | [optional] +**mode** | decimal.Decimal, int, | decimal.Decimal, | | [optional] +**enabled** | bool, | BoolClass, | | [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/OpenReleaseBO.md b/python/docs/models/OpenAppRoleUserDTO.md similarity index 77% rename from python/docs/models/OpenReleaseBO.md rename to python/docs/models/OpenAppRoleUserDTO.md index c955761..112354b 100644 --- a/python/docs/models/OpenReleaseBO.md +++ b/python/docs/models/OpenAppRoleUserDTO.md @@ -1,4 +1,4 @@ -# apollo_openapi.model.open_release_bo.OpenReleaseBO +# apollo_openapi.model.open_app_role_user_dto.OpenAppRoleUserDTO ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -8,11 +8,11 @@ dict, frozendict.frozendict, | frozendict.frozendict, | | ### Dictionary Keys Key | Input Type | Accessed Type | Description | Notes ------------ | ------------- | ------------- | ------------- | ------------- -**baseInfo** | [**OpenReleaseDTO**](OpenReleaseDTO.md) | [**OpenReleaseDTO**](OpenReleaseDTO.md) | | [optional] -**[items](#items)** | list, tuple, | tuple, | | [optional] +**appId** | str, | str, | | [optional] +**[masterUsers](#masterUsers)** | list, tuple, | tuple, | | [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] -# items +# masterUsers ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -22,6 +22,6 @@ list, tuple, | tuple, | | ### Tuple Items Class Name | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -[**KVEntity**](KVEntity.md) | [**KVEntity**](KVEntity.md) | [**KVEntity**](KVEntity.md) | | +[**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | | [[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/OpenClusterNamespaceRoleUserDTO.md b/python/docs/models/OpenClusterNamespaceRoleUserDTO.md new file mode 100644 index 0000000..bf80623 --- /dev/null +++ b/python/docs/models/OpenClusterNamespaceRoleUserDTO.md @@ -0,0 +1,42 @@ +# apollo_openapi.model.open_cluster_namespace_role_user_dto.OpenClusterNamespaceRoleUserDTO + +## 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, | | [optional] +**env** | str, | str, | | [optional] +**cluster** | str, | str, | | [optional] +**[modifyRoleUsers](#modifyRoleUsers)** | list, tuple, | tuple, | | [optional] +**[releaseRoleUsers](#releaseRoleUsers)** | list, tuple, | tuple, | | [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] + +# modifyRoleUsers + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple, | tuple, | | + +### Tuple Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | | + +# releaseRoleUsers + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple, | tuple, | | + +### Tuple Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | | + +[[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/OpenEnvNamespaceRoleUserDTO.md b/python/docs/models/OpenEnvNamespaceRoleUserDTO.md new file mode 100644 index 0000000..75f23c6 --- /dev/null +++ b/python/docs/models/OpenEnvNamespaceRoleUserDTO.md @@ -0,0 +1,42 @@ +# apollo_openapi.model.open_env_namespace_role_user_dto.OpenEnvNamespaceRoleUserDTO + +## 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, | | [optional] +**namespaceName** | str, | str, | | [optional] +**[modifyRoleUsers](#modifyRoleUsers)** | list, tuple, | tuple, | | [optional] +**[releaseRoleUsers](#releaseRoleUsers)** | list, tuple, | tuple, | | [optional] +**env** | str, | str, | | [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] + +# modifyRoleUsers + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple, | tuple, | | + +### Tuple Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | | + +# releaseRoleUsers + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple, | tuple, | | + +### Tuple Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | | + +[[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/OpenNamespaceRoleUserDTO.md b/python/docs/models/OpenNamespaceRoleUserDTO.md new file mode 100644 index 0000000..769a063 --- /dev/null +++ b/python/docs/models/OpenNamespaceRoleUserDTO.md @@ -0,0 +1,41 @@ +# apollo_openapi.model.open_namespace_role_user_dto.OpenNamespaceRoleUserDTO + +## 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, | | [optional] +**namespaceName** | str, | str, | | [optional] +**[modifyRoleUsers](#modifyRoleUsers)** | list, tuple, | tuple, | | [optional] +**[releaseRoleUsers](#releaseRoleUsers)** | list, tuple, | tuple, | | [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] + +# modifyRoleUsers + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple, | tuple, | | + +### Tuple Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | | + +# releaseRoleUsers + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple, | tuple, | | + +### Tuple Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | [**OpenUserInfoDTO**](OpenUserInfoDTO.md) | | + +[[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/KVEntity.md b/python/docs/models/OpenPermissionConditionDTO.md similarity index 86% rename from python/docs/models/KVEntity.md rename to python/docs/models/OpenPermissionConditionDTO.md index fb21c26..1de393a 100644 --- a/python/docs/models/KVEntity.md +++ b/python/docs/models/OpenPermissionConditionDTO.md @@ -1,4 +1,4 @@ -# apollo_openapi.model.kv_entity.KVEntity +# apollo_openapi.model.open_permission_condition_dto.OpenPermissionConditionDTO ## Model Type Info Input Type | Accessed Type | Description | Notes @@ -8,8 +8,7 @@ dict, frozendict.frozendict, | frozendict.frozendict, | | ### Dictionary Keys Key | Input Type | Accessed Type | Description | Notes ------------ | ------------- | ------------- | ------------- | ------------- -**key** | str, | str, | 键 | [optional] -**value** | str, | str, | 值 | [optional] +**hasPermission** | bool, | BoolClass, | | [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/OpenReleaseChangeDTO.md b/python/docs/models/OpenReleaseChangeDTO.md new file mode 100644 index 0000000..92e0b2d --- /dev/null +++ b/python/docs/models/OpenReleaseChangeDTO.md @@ -0,0 +1,17 @@ +# apollo_openapi.model.open_release_change_dto.OpenReleaseChangeDTO + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | + +### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**changeType** | str, | str, | 修改类型 | [optional] +**key** | str, | str, | key | [optional] +**newValue** | str, | str, | new value | [optional] +**oldValue** | str, | str, | old value | [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/OpenReleaseDiffDTO.md b/python/docs/models/OpenReleaseDiffDTO.md new file mode 100644 index 0000000..1881214 --- /dev/null +++ b/python/docs/models/OpenReleaseDiffDTO.md @@ -0,0 +1,28 @@ +# apollo_openapi.model.open_release_diff_dto.OpenReleaseDiffDTO + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | + +### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**[changes](#changes)** | list, tuple, | tuple, | A list of changes, ensuring order if necessary. | [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] + +# changes + +A list of changes, ensuring order if necessary. + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +list, tuple, | tuple, | A list of changes, ensuring order if necessary. | + +### Tuple Items +Class Name | Input Type | Accessed Type | Description | Notes +------------- | ------------- | ------------- | ------------- | ------------- +[**OpenReleaseChangeDTO**](OpenReleaseChangeDTO.md) | [**OpenReleaseChangeDTO**](OpenReleaseChangeDTO.md) | [**OpenReleaseChangeDTO**](OpenReleaseChangeDTO.md) | | + +[[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/OpenUserInfoDTO.md b/python/docs/models/OpenUserInfoDTO.md new file mode 100644 index 0000000..694e428 --- /dev/null +++ b/python/docs/models/OpenUserInfoDTO.md @@ -0,0 +1,17 @@ +# apollo_openapi.model.open_user_info_dto.OpenUserInfoDTO + +## Model Type Info +Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- +dict, frozendict.frozendict, | frozendict.frozendict, | | + +### Dictionary Keys +Key | Input Type | Accessed Type | Description | Notes +------------ | ------------- | ------------- | ------------- | ------------- +**userId** | str, | str, | | [optional] +**name** | str, | str, | | [optional] +**email** | str, | str, | | [optional] +**enabled** | decimal.Decimal, int, | decimal.Decimal, | | [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/test/test_models/test_open_release_bo.py b/python/test/test_models/test_open_access_key_dto.py similarity index 86% rename from python/test/test_models/test_open_release_bo.py rename to python/test/test_models/test_open_access_key_dto.py index b068b01..cd827f0 100644 --- a/python/test/test_models/test_open_release_bo.py +++ b/python/test/test_models/test_open_access_key_dto.py @@ -12,12 +12,12 @@ import unittest import apollo_openapi -from apollo_openapi.model.open_release_bo import OpenReleaseBO +from apollo_openapi.model.open_access_key_dto import OpenAccessKeyDTO from apollo_openapi import configuration -class TestOpenReleaseBO(unittest.TestCase): - """OpenReleaseBO unit test stubs""" +class TestOpenAccessKeyDTO(unittest.TestCase): + """OpenAccessKeyDTO unit test stubs""" _configuration = configuration.Configuration() diff --git a/python/test/test_models/test_open_app_role_user_dto.py b/python/test/test_models/test_open_app_role_user_dto.py new file mode 100644 index 0000000..80043ae --- /dev/null +++ b/python/test/test_models/test_open_app_role_user_dto.py @@ -0,0 +1,25 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +import apollo_openapi +from apollo_openapi.model.open_app_role_user_dto import OpenAppRoleUserDTO +from apollo_openapi import configuration + + +class TestOpenAppRoleUserDTO(unittest.TestCase): + """OpenAppRoleUserDTO unit test stubs""" + _configuration = configuration.Configuration() + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_models/test_open_cluster_namespace_role_user_dto.py b/python/test/test_models/test_open_cluster_namespace_role_user_dto.py new file mode 100644 index 0000000..8387e88 --- /dev/null +++ b/python/test/test_models/test_open_cluster_namespace_role_user_dto.py @@ -0,0 +1,25 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +import apollo_openapi +from apollo_openapi.model.open_cluster_namespace_role_user_dto import OpenClusterNamespaceRoleUserDTO +from apollo_openapi import configuration + + +class TestOpenClusterNamespaceRoleUserDTO(unittest.TestCase): + """OpenClusterNamespaceRoleUserDTO unit test stubs""" + _configuration = configuration.Configuration() + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_models/test_open_env_namespace_role_user_dto.py b/python/test/test_models/test_open_env_namespace_role_user_dto.py new file mode 100644 index 0000000..40a8736 --- /dev/null +++ b/python/test/test_models/test_open_env_namespace_role_user_dto.py @@ -0,0 +1,25 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +import apollo_openapi +from apollo_openapi.model.open_env_namespace_role_user_dto import OpenEnvNamespaceRoleUserDTO +from apollo_openapi import configuration + + +class TestOpenEnvNamespaceRoleUserDTO(unittest.TestCase): + """OpenEnvNamespaceRoleUserDTO unit test stubs""" + _configuration = configuration.Configuration() + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_models/test_open_namespace_role_user_dto.py b/python/test/test_models/test_open_namespace_role_user_dto.py new file mode 100644 index 0000000..6f2db0f --- /dev/null +++ b/python/test/test_models/test_open_namespace_role_user_dto.py @@ -0,0 +1,25 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +import apollo_openapi +from apollo_openapi.model.open_namespace_role_user_dto import OpenNamespaceRoleUserDTO +from apollo_openapi import configuration + + +class TestOpenNamespaceRoleUserDTO(unittest.TestCase): + """OpenNamespaceRoleUserDTO unit test stubs""" + _configuration = configuration.Configuration() + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_models/test_open_permission_condition_dto.py b/python/test/test_models/test_open_permission_condition_dto.py new file mode 100644 index 0000000..91c1368 --- /dev/null +++ b/python/test/test_models/test_open_permission_condition_dto.py @@ -0,0 +1,25 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +import apollo_openapi +from apollo_openapi.model.open_permission_condition_dto import OpenPermissionConditionDTO +from apollo_openapi import configuration + + +class TestOpenPermissionConditionDTO(unittest.TestCase): + """OpenPermissionConditionDTO unit test stubs""" + _configuration = configuration.Configuration() + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_models/test_open_release_change_dto.py b/python/test/test_models/test_open_release_change_dto.py new file mode 100644 index 0000000..99b5575 --- /dev/null +++ b/python/test/test_models/test_open_release_change_dto.py @@ -0,0 +1,25 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +import apollo_openapi +from apollo_openapi.model.open_release_change_dto import OpenReleaseChangeDTO +from apollo_openapi import configuration + + +class TestOpenReleaseChangeDTO(unittest.TestCase): + """OpenReleaseChangeDTO unit test stubs""" + _configuration = configuration.Configuration() + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_models/test_open_release_diff_dto.py b/python/test/test_models/test_open_release_diff_dto.py new file mode 100644 index 0000000..a2405f9 --- /dev/null +++ b/python/test/test_models/test_open_release_diff_dto.py @@ -0,0 +1,25 @@ +# 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 + + The version of the OpenAPI document: 1.0.0 + Generated by: https://openapi-generator.tech +""" + +import unittest + +import apollo_openapi +from apollo_openapi.model.open_release_diff_dto import OpenReleaseDiffDTO +from apollo_openapi import configuration + + +class TestOpenReleaseDiffDTO(unittest.TestCase): + """OpenReleaseDiffDTO unit test stubs""" + _configuration = configuration.Configuration() + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_models/test_kv_entity.py b/python/test/test_models/test_open_user_info_dto.py similarity index 87% rename from python/test/test_models/test_kv_entity.py rename to python/test/test_models/test_open_user_info_dto.py index 6ece88f..dc087ea 100644 --- a/python/test/test_models/test_kv_entity.py +++ b/python/test/test_models/test_open_user_info_dto.py @@ -12,12 +12,12 @@ import unittest import apollo_openapi -from apollo_openapi.model.kv_entity import KVEntity +from apollo_openapi.model.open_user_info_dto import OpenUserInfoDTO from apollo_openapi import configuration -class TestKVEntity(unittest.TestCase): - """KVEntity unit test stubs""" +class TestOpenUserInfoDTO(unittest.TestCase): + """OpenUserInfoDTO unit test stubs""" _configuration = configuration.Configuration() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id/test_delete.py b/python/test/test_paths/test_openapi_v1_apps_app_id/test_delete.py index 9a11db9..1b937bf 100644 --- a/python/test/test_paths/test_openapi_v1_apps_app_id/test_delete.py +++ b/python/test/test_paths/test_openapi_v1_apps_app_id/test_delete.py @@ -33,8 +33,7 @@ def tearDown(self): pass response_status = 200 - - + response_body = '' if __name__ == '__main__': diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id/test_put.py b/python/test/test_paths/test_openapi_v1_apps_app_id/test_put.py index fe013b1..fcebe44 100644 --- a/python/test/test_paths/test_openapi_v1_apps_app_id/test_put.py +++ b/python/test/test_paths/test_openapi_v1_apps_app_id/test_put.py @@ -33,8 +33,7 @@ def tearDown(self): pass response_status = 200 - - + response_body = '' diff --git a/python/test/test_paths/test_openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys/__init__.py similarity index 100% rename from python/test/test_paths/test_openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/__init__.py rename to python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys/__init__.py diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys/test_get.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys/test_get.py new file mode 100644 index 0000000..13c4fff --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys import get # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdEnvsEnvAccesskeys(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdEnvsEnvAccesskeys unit test stubs + 查找AccessKey # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys/test_post.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys/test_post.py new file mode 100644 index 0000000..64fd22e --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys/test_post.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys import post # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdEnvsEnvAccesskeys(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdEnvsEnvAccesskeys unit test stubs + 创建AccessKey # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/test_delete.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/test_delete.py new file mode 100644 index 0000000..e694bbe --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id/test_delete.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id import delete # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyId(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyId unit test stubs + 删除AccessKey # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = delete.ApiFordelete(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/test_put.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/test_put.py new file mode 100644 index 0000000..e66c5d0 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation/test_put.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_activation import put # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyIdActivation(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyIdActivation unit test stubs + 启用AccessKey # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = put.ApiForput(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/test_put.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/test_put.py new file mode 100644 index 0000000..d2220c0 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation/test_put.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_accesskeys_access_key_id_deactivation import put # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyIdDeactivation(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdEnvsEnvAccesskeysAccessKeyIdDeactivation unit test stubs + 禁用AccessKey # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = put.ApiForput(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_missing_namespaces/test_post.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_missing_namespaces/test_post.py index 151bf90..a424cdc 100644 --- a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_missing_namespaces/test_post.py +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_missing_namespaces/test_post.py @@ -33,8 +33,7 @@ def tearDown(self): pass response_status = 200 - - + response_body = '' if __name__ == '__main__': diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/test_post.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/test_post.py new file mode 100644 index 0000000..c8a8e36 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init/test_post.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permission_init import post # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesPermissionInit(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesPermissionInit unit test stubs + 初始化集群Namespace权限 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/test_get.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/test_get.py similarity index 60% rename from python/test/test_paths/test_openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/test_get.py rename to python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/test_get.py index 4dd19ff..01be795 100644 --- a/python/test/test_paths/test_openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all/test_get.py +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type/test_get.py @@ -12,16 +12,16 @@ import urllib3 import apollo_openapi -from apollo_openapi.paths.openapi_v1_envs_env_apps_app_id_clusters_cluster_name_namespaces_namespace_name_releases_all import get # noqa: E501 +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_permissions_permission_type import get # noqa: E501 from apollo_openapi import configuration, schemas, api_client from .. import ApiTestMixin -class TestOpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameReleasesAll(ApiTestMixin, unittest.TestCase): +class TestOpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesPermissionsPermissionType(ApiTestMixin, unittest.TestCase): """ - OpenapiV1EnvsEnvAppsAppIdClustersClusterNameNamespacesNamespaceNameReleasesAll unit test stubs - 获取所有发布(分页) (new added) # noqa: E501 + OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesPermissionsPermissionType unit test stubs + 校验集群Namespace权限 (new added) # noqa: E501 """ _configuration = configuration.Configuration() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/test_get.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/test_get.py new file mode 100644 index 0000000..a4c553c --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_namespaces_role_users import get # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesRoleUsers(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdEnvsEnvClustersClusterNameNamespacesRoleUsers unit test stubs + 获取集群Namespace用户 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/test_delete.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/test_delete.py new file mode 100644 index 0000000..6a6ec01 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/test_delete.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type import delete # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdEnvsEnvClustersClusterNameRolesRoleType(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdEnvsEnvClustersClusterNameRolesRoleType unit test stubs + 移除集群Namespace角色 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = delete.ApiFordelete(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/test_post.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/test_post.py new file mode 100644 index 0000000..84d0fbd --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type/test_post.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_clusters_cluster_name_roles_role_type import post # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdEnvsEnvClustersClusterNameRolesRoleType(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdEnvsEnvClustersClusterNameRolesRoleType unit test stubs + 分配集群Namespace角色 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/test_get.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/test_get.py new file mode 100644 index 0000000..a67060b --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_permissions_permission_type import get # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNamePermissionsPermissionType(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNamePermissionsPermissionType unit test stubs + 校验环境Namespace权限 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/test_get.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/test_get.py new file mode 100644 index 0000000..9552669 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_role_users import get # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRoleUsers(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRoleUsers unit test stubs + 获取环境Namespace用户 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/test_delete.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/test_delete.py new file mode 100644 index 0000000..3b35b8a --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/test_delete.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type import delete # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRolesRoleType(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRolesRoleType unit test stubs + 移除环境Namespace角色 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = delete.ApiFordelete(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/test_post.py b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/test_post.py new file mode 100644 index 0000000..962d8fa --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type/test_post.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_envs_env_namespaces_namespace_name_roles_role_type import post # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRolesRoleType(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdEnvsEnvNamespacesNamespaceNameRolesRoleType unit test stubs + 分配环境Namespace角色 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/test_post.py b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/test_post.py new file mode 100644 index 0000000..751b285 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permission_init/test_post.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_permission_init import post # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdNamespacesNamespaceNamePermissionInit(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdNamespacesNamespaceNamePermissionInit unit test stubs + 初始化应用权限 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/test_get.py b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/test_get.py new file mode 100644 index 0000000..0e7f26f --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_permissions_permission_type import get # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdNamespacesNamespaceNamePermissionsPermissionType(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdNamespacesNamespaceNamePermissionsPermissionType unit test stubs + 校验Namespace权限 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_role_users/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_role_users/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_role_users/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_role_users/test_get.py b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_role_users/test_get.py new file mode 100644 index 0000000..38a0d86 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_role_users/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_role_users import get # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdNamespacesNamespaceNameRoleUsers(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdNamespacesNamespaceNameRoleUsers unit test stubs + 获取Namespace用户 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/test_delete.py b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/test_delete.py new file mode 100644 index 0000000..8403d49 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/test_delete.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type import delete # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdNamespacesNamespaceNameRolesRoleType(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdNamespacesNamespaceNameRolesRoleType unit test stubs + 移除Namespace角色 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = delete.ApiFordelete(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/test_post.py b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/test_post.py new file mode 100644 index 0000000..847a970 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type/test_post.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_namespaces_namespace_name_roles_role_type import post # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdNamespacesNamespaceNameRolesRoleType(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdNamespacesNamespaceNameRolesRoleType unit test stubs + 分配Namespace角色 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_permissions_permission_type/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_permissions_permission_type/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_permissions_permission_type/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_permissions_permission_type/test_get.py b/python/test/test_paths/test_openapi_v1_apps_app_id_permissions_permission_type/test_get.py new file mode 100644 index 0000000..fd7fee3 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_permissions_permission_type/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_permissions_permission_type import get # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdPermissionsPermissionType(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdPermissionsPermissionType unit test stubs + 校验应用权限 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_role_users/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_role_users/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_role_users/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_role_users/test_get.py b/python/test/test_paths/test_openapi_v1_apps_app_id_role_users/test_get.py new file mode 100644 index 0000000..85d2d90 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_role_users/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_role_users import get # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdRoleUsers(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdRoleUsers unit test stubs + 获取应用角色用户 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_roles_master/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_roles_master/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_roles_master/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_roles_master/test_delete.py b/python/test/test_paths/test_openapi_v1_apps_app_id_roles_master/test_delete.py new file mode 100644 index 0000000..2ed7cd3 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_roles_master/test_delete.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_roles_master import delete # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdRolesMaster(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdRolesMaster unit test stubs + 移除AppMaster (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = delete.ApiFordelete(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_roles_master/test_post.py b/python/test/test_paths/test_openapi_v1_apps_app_id_roles_master/test_post.py new file mode 100644 index 0000000..c3047ae --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_roles_master/test_post.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_roles_master import post # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdRolesMaster(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdRolesMaster unit test stubs + 分配AppMaster (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_roles_role_type/__init__.py b/python/test/test_paths/test_openapi_v1_apps_app_id_roles_role_type/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_roles_role_type/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_roles_role_type/test_delete.py b/python/test/test_paths/test_openapi_v1_apps_app_id_roles_role_type/test_delete.py new file mode 100644 index 0000000..a5557fe --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_roles_role_type/test_delete.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_roles_role_type import delete # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdRolesRoleType(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdRolesRoleType unit test stubs + 移除应用角色 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = delete.ApiFordelete(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_app_id_roles_role_type/test_post.py b/python/test/test_paths/test_openapi_v1_apps_app_id_roles_role_type/test_post.py new file mode 100644 index 0000000..480932a --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_apps_app_id_roles_role_type/test_post.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_apps_app_id_roles_role_type import post # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1AppsAppIdRolesRoleType(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1AppsAppIdRolesRoleType unit test stubs + 分配应用角色 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_apps_envs_env/test_post.py b/python/test/test_paths/test_openapi_v1_apps_envs_env/test_post.py index 2898b27..1b07147 100644 --- a/python/test/test_paths/test_openapi_v1_apps_envs_env/test_post.py +++ b/python/test/test_paths/test_openapi_v1_apps_envs_env/test_post.py @@ -33,8 +33,7 @@ def tearDown(self): pass response_status = 200 - - + response_body = '' diff --git a/python/test/test_paths/test_openapi_v1_envs_env_apps_app_id_clusters_cluster_name/test_delete.py b/python/test/test_paths/test_openapi_v1_envs_env_apps_app_id_clusters_cluster_name/test_delete.py index 788a76a..04c4346 100644 --- a/python/test/test_paths/test_openapi_v1_envs_env_apps_app_id_clusters_cluster_name/test_delete.py +++ b/python/test/test_paths/test_openapi_v1_envs_env_apps_app_id_clusters_cluster_name/test_delete.py @@ -33,8 +33,7 @@ def tearDown(self): pass response_status = 200 - - + response_body = '' if __name__ == '__main__': diff --git a/python/test/test_paths/test_openapi_v1_envs_env_releases_comparison/__init__.py b/python/test/test_paths/test_openapi_v1_envs_env_releases_comparison/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_envs_env_releases_comparison/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_envs_env_releases_comparison/test_get.py b/python/test/test_paths/test_openapi_v1_envs_env_releases_comparison/test_get.py new file mode 100644 index 0000000..08ea374 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_envs_env_releases_comparison/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_envs_env_releases_comparison import get # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1EnvsEnvReleasesComparison(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1EnvsEnvReleasesComparison unit test stubs + Compare two releases # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_envs_env_releases_release_id_rollback/test_put.py b/python/test/test_paths/test_openapi_v1_envs_env_releases_release_id_rollback/test_put.py index f2a5f0e..28d2de3 100644 --- a/python/test/test_paths/test_openapi_v1_envs_env_releases_release_id_rollback/test_put.py +++ b/python/test/test_paths/test_openapi_v1_envs_env_releases_release_id_rollback/test_put.py @@ -33,8 +33,7 @@ def tearDown(self): pass response_status = 200 - - + response_body = '' if __name__ == '__main__': diff --git a/python/test/test_paths/test_openapi_v1_permissions_root/__init__.py b/python/test/test_paths/test_openapi_v1_permissions_root/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_permissions_root/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_permissions_root/test_get.py b/python/test/test_paths/test_openapi_v1_permissions_root/test_get.py new file mode 100644 index 0000000..a69a45e --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_permissions_root/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_permissions_root import get # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1PermissionsRoot(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1PermissionsRoot unit test stubs + 校验Root权限 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_system_role_manage_app_master/__init__.py b/python/test/test_paths/test_openapi_v1_system_role_manage_app_master/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_system_role_manage_app_master/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_system_role_manage_app_master/test_get.py b/python/test/test_paths/test_openapi_v1_system_role_manage_app_master/test_get.py new file mode 100644 index 0000000..7f2258a --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_system_role_manage_app_master/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_system_role_manage_app_master import get # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1SystemRoleManageAppMaster(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1SystemRoleManageAppMaster unit test stubs + 校验AppMaster开关 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_system_roles_create_application/__init__.py b/python/test/test_paths/test_openapi_v1_system_roles_create_application/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_system_roles_create_application/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_system_roles_create_application/test_delete.py b/python/test/test_paths/test_openapi_v1_system_roles_create_application/test_delete.py new file mode 100644 index 0000000..91a6144 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_system_roles_create_application/test_delete.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_system_roles_create_application import delete # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1SystemRolesCreateApplication(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1SystemRolesCreateApplication unit test stubs + 移除建应用角色 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = delete.ApiFordelete(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_system_roles_create_application/test_get.py b/python/test/test_paths/test_openapi_v1_system_roles_create_application/test_get.py new file mode 100644 index 0000000..594bfd0 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_system_roles_create_application/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_system_roles_create_application import get # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1SystemRolesCreateApplication(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1SystemRolesCreateApplication unit test stubs + 校验建应用权限 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_system_roles_create_application/test_post.py b/python/test/test_paths/test_openapi_v1_system_roles_create_application/test_post.py new file mode 100644 index 0000000..d6b8e4d --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_system_roles_create_application/test_post.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_system_roles_create_application import post # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1SystemRolesCreateApplication(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1SystemRolesCreateApplication unit test stubs + 分配建应用角色 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = post.ApiForpost(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + response_body = '' + + +if __name__ == '__main__': + unittest.main() diff --git a/python/test/test_paths/test_openapi_v1_system_roles_create_application_role_users/__init__.py b/python/test/test_paths/test_openapi_v1_system_roles_create_application_role_users/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_system_roles_create_application_role_users/__init__.py @@ -0,0 +1 @@ + diff --git a/python/test/test_paths/test_openapi_v1_system_roles_create_application_role_users/test_get.py b/python/test/test_paths/test_openapi_v1_system_roles_create_application_role_users/test_get.py new file mode 100644 index 0000000..c015516 --- /dev/null +++ b/python/test/test_paths/test_openapi_v1_system_roles_create_application_role_users/test_get.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + + + Generated by: https://openapi-generator.tech +""" + +import unittest +from unittest.mock import patch + +import urllib3 + +import apollo_openapi +from apollo_openapi.paths.openapi_v1_system_roles_create_application_role_users import get # noqa: E501 +from apollo_openapi import configuration, schemas, api_client + +from .. import ApiTestMixin + + +class TestOpenapiV1SystemRolesCreateApplicationRoleUsers(ApiTestMixin, unittest.TestCase): + """ + OpenapiV1SystemRolesCreateApplicationRoleUsers unit test stubs + 获取建应用用户 (new added) # noqa: E501 + """ + _configuration = configuration.Configuration() + + def setUp(self): + used_api_client = api_client.ApiClient(configuration=self._configuration) + self.api = get.ApiForget(api_client=used_api_client) # noqa: E501 + + def tearDown(self): + pass + + response_status = 200 + + + + +if __name__ == '__main__': + unittest.main() diff --git a/rust/.openapi-generator/FILES b/rust/.openapi-generator/FILES index ff9f9d6..38d8d3f 100644 --- a/rust/.openapi-generator/FILES +++ b/rust/.openapi-generator/FILES @@ -4,17 +4,20 @@ Cargo.toml README.md docs/ExceptionResponse.md -docs/KvEntity.md docs/NamespaceGrayDelReleaseDto.md docs/NamespaceReleaseDto.md +docs/OpenAccessKeyDto.md docs/OpenAppDto.md docs/OpenAppNamespaceDto.md +docs/OpenAppRoleUserDto.md docs/OpenClusterDto.md +docs/OpenClusterNamespaceRoleUserDto.md docs/OpenCreateAppDto.md docs/OpenCreateItemDto.md docs/OpenCreateNamespaceDto.md docs/OpenEnvClusterDto.md docs/OpenEnvClusterInfo.md +docs/OpenEnvNamespaceRoleUserDto.md docs/OpenGrayReleaseRuleDto.md docs/OpenGrayReleaseRuleItemDto.md docs/OpenInstanceConfigDto.md @@ -30,29 +33,36 @@ docs/OpenNamespaceDto.md docs/OpenNamespaceExtendDto.md docs/OpenNamespaceIdentifier.md docs/OpenNamespaceLockDto.md +docs/OpenNamespaceRoleUserDto.md docs/OpenNamespaceSyncDto.md docs/OpenNamespaceTextModel.md docs/OpenNamespaceUsageDto.md docs/OpenOrganizationDto.md -docs/OpenReleaseBo.md +docs/OpenPermissionConditionDto.md +docs/OpenReleaseChangeDto.md +docs/OpenReleaseDiffDto.md docs/OpenReleaseDto.md +docs/OpenUserInfoDto.md git_push.sh src/apis/configuration.rs src/apis/mod.rs src/lib.rs src/models/exception_response.rs -src/models/kv_entity.rs src/models/mod.rs src/models/namespace_gray_del_release_dto.rs src/models/namespace_release_dto.rs +src/models/open_access_key_dto.rs src/models/open_app_dto.rs 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_create_app_dto.rs src/models/open_create_item_dto.rs src/models/open_create_namespace_dto.rs src/models/open_env_cluster_dto.rs src/models/open_env_cluster_info.rs +src/models/open_env_namespace_role_user_dto.rs src/models/open_gray_release_rule_dto.rs src/models/open_gray_release_rule_item_dto.rs src/models/open_instance_config_dto.rs @@ -68,9 +78,13 @@ src/models/open_namespace_dto.rs src/models/open_namespace_extend_dto.rs src/models/open_namespace_identifier.rs src/models/open_namespace_lock_dto.rs +src/models/open_namespace_role_user_dto.rs src/models/open_namespace_sync_dto.rs src/models/open_namespace_text_model.rs src/models/open_namespace_usage_dto.rs src/models/open_organization_dto.rs -src/models/open_release_bo.rs +src/models/open_permission_condition_dto.rs +src/models/open_release_change_dto.rs +src/models/open_release_diff_dto.rs src/models/open_release_dto.rs +src/models/open_user_info_dto.rs diff --git a/rust/README.md b/rust/README.md index 0739314..ce031a6 100644 --- a/rust/README.md +++ b/rust/README.md @@ -45,17 +45,20 @@ Class | Method | HTTP request | Description ## Documentation For Models - [ExceptionResponse](docs/ExceptionResponse.md) - - [KvEntity](docs/KvEntity.md) - [NamespaceGrayDelReleaseDto](docs/NamespaceGrayDelReleaseDto.md) - [NamespaceReleaseDto](docs/NamespaceReleaseDto.md) + - [OpenAccessKeyDto](docs/OpenAccessKeyDto.md) - [OpenAppDto](docs/OpenAppDto.md) - [OpenAppNamespaceDto](docs/OpenAppNamespaceDto.md) + - [OpenAppRoleUserDto](docs/OpenAppRoleUserDto.md) - [OpenClusterDto](docs/OpenClusterDto.md) + - [OpenClusterNamespaceRoleUserDto](docs/OpenClusterNamespaceRoleUserDto.md) - [OpenCreateAppDto](docs/OpenCreateAppDto.md) - [OpenCreateItemDto](docs/OpenCreateItemDto.md) - [OpenCreateNamespaceDto](docs/OpenCreateNamespaceDto.md) - [OpenEnvClusterDto](docs/OpenEnvClusterDto.md) - [OpenEnvClusterInfo](docs/OpenEnvClusterInfo.md) + - [OpenEnvNamespaceRoleUserDto](docs/OpenEnvNamespaceRoleUserDto.md) - [OpenGrayReleaseRuleDto](docs/OpenGrayReleaseRuleDto.md) - [OpenGrayReleaseRuleItemDto](docs/OpenGrayReleaseRuleItemDto.md) - [OpenInstanceConfigDto](docs/OpenInstanceConfigDto.md) @@ -71,12 +74,16 @@ Class | Method | HTTP request | Description - [OpenNamespaceExtendDto](docs/OpenNamespaceExtendDto.md) - [OpenNamespaceIdentifier](docs/OpenNamespaceIdentifier.md) - [OpenNamespaceLockDto](docs/OpenNamespaceLockDto.md) + - [OpenNamespaceRoleUserDto](docs/OpenNamespaceRoleUserDto.md) - [OpenNamespaceSyncDto](docs/OpenNamespaceSyncDto.md) - [OpenNamespaceTextModel](docs/OpenNamespaceTextModel.md) - [OpenNamespaceUsageDto](docs/OpenNamespaceUsageDto.md) - [OpenOrganizationDto](docs/OpenOrganizationDto.md) - - [OpenReleaseBo](docs/OpenReleaseBo.md) + - [OpenPermissionConditionDto](docs/OpenPermissionConditionDto.md) + - [OpenReleaseChangeDto](docs/OpenReleaseChangeDto.md) + - [OpenReleaseDiffDto](docs/OpenReleaseDiffDto.md) - [OpenReleaseDto](docs/OpenReleaseDto.md) + - [OpenUserInfoDto](docs/OpenUserInfoDto.md) To get access to the crate's generated documentation, use: diff --git a/rust/docs/OpenAccessKeyDto.md b/rust/docs/OpenAccessKeyDto.md new file mode 100644 index 0000000..668d766 --- /dev/null +++ b/rust/docs/OpenAccessKeyDto.md @@ -0,0 +1,19 @@ +# OpenAccessKeyDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data_change_created_by** | Option<**String**> | | [optional] +**data_change_last_modified_by** | Option<**String**> | | [optional] +**data_change_created_by_display_name** | Option<**String**> | | [optional] +**data_change_last_modified_by_display_name** | Option<**String**> | | [optional] +**data_change_created_time** | Option<**String**> | | [optional] +**data_change_last_modified_time** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**secret** | Option<**String**> | | [optional] +**app_id** | Option<**String**> | | [optional] +**mode** | Option<**i32**> | | [optional] +**enabled** | Option<**bool**> | | [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/OpenReleaseBo.md b/rust/docs/OpenAppRoleUserDto.md similarity index 58% rename from rust/docs/OpenReleaseBo.md rename to rust/docs/OpenAppRoleUserDto.md index 792e6ad..2bc5027 100644 --- a/rust/docs/OpenReleaseBo.md +++ b/rust/docs/OpenAppRoleUserDto.md @@ -1,10 +1,10 @@ -# OpenReleaseBo +# OpenAppRoleUserDto ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**base_info** | Option<[**crate::models::OpenReleaseDto**](OpenReleaseDTO.md)> | | [optional] -**items** | Option<[**Vec**](KVEntity.md)> | | [optional] +**app_id** | Option<**String**> | | [optional] +**master_users** | Option<[**Vec**](OpenUserInfoDTO.md)> | | [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/OpenClusterNamespaceRoleUserDto.md b/rust/docs/OpenClusterNamespaceRoleUserDto.md new file mode 100644 index 0000000..aa12286 --- /dev/null +++ b/rust/docs/OpenClusterNamespaceRoleUserDto.md @@ -0,0 +1,13 @@ +# OpenClusterNamespaceRoleUserDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_id** | Option<**String**> | | [optional] +**env** | Option<**String**> | | [optional] +**cluster** | Option<**String**> | | [optional] +**modify_role_users** | Option<[**Vec**](OpenUserInfoDTO.md)> | | [optional] +**release_role_users** | Option<[**Vec**](OpenUserInfoDTO.md)> | | [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/OpenEnvNamespaceRoleUserDto.md b/rust/docs/OpenEnvNamespaceRoleUserDto.md new file mode 100644 index 0000000..8ff84da --- /dev/null +++ b/rust/docs/OpenEnvNamespaceRoleUserDto.md @@ -0,0 +1,13 @@ +# OpenEnvNamespaceRoleUserDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_id** | Option<**String**> | | [optional] +**namespace_name** | Option<**String**> | | [optional] +**modify_role_users** | Option<[**Vec**](OpenUserInfoDTO.md)> | | [optional] +**release_role_users** | Option<[**Vec**](OpenUserInfoDTO.md)> | | [optional] +**env** | 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/docs/OpenNamespaceRoleUserDto.md b/rust/docs/OpenNamespaceRoleUserDto.md new file mode 100644 index 0000000..abd7992 --- /dev/null +++ b/rust/docs/OpenNamespaceRoleUserDto.md @@ -0,0 +1,12 @@ +# OpenNamespaceRoleUserDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_id** | Option<**String**> | | [optional] +**namespace_name** | Option<**String**> | | [optional] +**modify_role_users** | Option<[**Vec**](OpenUserInfoDTO.md)> | | [optional] +**release_role_users** | Option<[**Vec**](OpenUserInfoDTO.md)> | | [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/KvEntity.md b/rust/docs/OpenPermissionConditionDto.md similarity index 71% rename from rust/docs/KvEntity.md rename to rust/docs/OpenPermissionConditionDto.md index 9de29ca..679645f 100644 --- a/rust/docs/KvEntity.md +++ b/rust/docs/OpenPermissionConditionDto.md @@ -1,10 +1,9 @@ -# KvEntity +# OpenPermissionConditionDto ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**key** | Option<**String**> | 键 | [optional] -**value** | Option<**String**> | 值 | [optional] +**has_permission** | Option<**bool**> | | [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/OpenReleaseChangeDto.md b/rust/docs/OpenReleaseChangeDto.md new file mode 100644 index 0000000..f164f1e --- /dev/null +++ b/rust/docs/OpenReleaseChangeDto.md @@ -0,0 +1,12 @@ +# OpenReleaseChangeDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**change_type** | Option<**String**> | 修改类型 | [optional] +**key** | Option<**String**> | key | [optional] +**new_value** | Option<**String**> | new value | [optional] +**old_value** | Option<**String**> | old value | [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/OpenReleaseDiffDto.md b/rust/docs/OpenReleaseDiffDto.md new file mode 100644 index 0000000..61a801f --- /dev/null +++ b/rust/docs/OpenReleaseDiffDto.md @@ -0,0 +1,9 @@ +# OpenReleaseDiffDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**changes** | Option<[**Vec**](OpenReleaseChangeDTO.md)> | A list of changes, ensuring order if necessary. | [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/OpenUserInfoDto.md b/rust/docs/OpenUserInfoDto.md new file mode 100644 index 0000000..e164f69 --- /dev/null +++ b/rust/docs/OpenUserInfoDto.md @@ -0,0 +1,12 @@ +# OpenUserInfoDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | Option<**String**> | | [optional] +**name** | Option<**String**> | | [optional] +**email** | Option<**String**> | | [optional] +**enabled** | Option<**i32**> | | [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/models/mod.rs b/rust/src/models/mod.rs index f3a5ce9..62543b7 100644 --- a/rust/src/models/mod.rs +++ b/rust/src/models/mod.rs @@ -1,17 +1,21 @@ pub mod exception_response; pub use self::exception_response::ExceptionResponse; -pub mod kv_entity; -pub use self::kv_entity::KvEntity; pub mod namespace_gray_del_release_dto; pub use self::namespace_gray_del_release_dto::NamespaceGrayDelReleaseDto; pub mod namespace_release_dto; pub use self::namespace_release_dto::NamespaceReleaseDto; +pub mod open_access_key_dto; +pub use self::open_access_key_dto::OpenAccessKeyDto; pub mod open_app_dto; pub use self::open_app_dto::OpenAppDto; pub mod open_app_namespace_dto; pub use self::open_app_namespace_dto::OpenAppNamespaceDto; +pub mod open_app_role_user_dto; +pub use self::open_app_role_user_dto::OpenAppRoleUserDto; 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_create_app_dto; pub use self::open_create_app_dto::OpenCreateAppDto; pub mod open_create_item_dto; @@ -22,6 +26,8 @@ pub mod open_env_cluster_dto; pub use self::open_env_cluster_dto::OpenEnvClusterDto; pub mod open_env_cluster_info; pub use self::open_env_cluster_info::OpenEnvClusterInfo; +pub mod open_env_namespace_role_user_dto; +pub use self::open_env_namespace_role_user_dto::OpenEnvNamespaceRoleUserDto; pub mod open_gray_release_rule_dto; pub use self::open_gray_release_rule_dto::OpenGrayReleaseRuleDto; pub mod open_gray_release_rule_item_dto; @@ -52,6 +58,8 @@ pub mod open_namespace_identifier; pub use self::open_namespace_identifier::OpenNamespaceIdentifier; pub mod open_namespace_lock_dto; pub use self::open_namespace_lock_dto::OpenNamespaceLockDto; +pub mod open_namespace_role_user_dto; +pub use self::open_namespace_role_user_dto::OpenNamespaceRoleUserDto; pub mod open_namespace_sync_dto; pub use self::open_namespace_sync_dto::OpenNamespaceSyncDto; pub mod open_namespace_text_model; @@ -60,7 +68,13 @@ pub mod open_namespace_usage_dto; pub use self::open_namespace_usage_dto::OpenNamespaceUsageDto; pub mod open_organization_dto; pub use self::open_organization_dto::OpenOrganizationDto; -pub mod open_release_bo; -pub use self::open_release_bo::OpenReleaseBo; +pub mod open_permission_condition_dto; +pub use self::open_permission_condition_dto::OpenPermissionConditionDto; +pub mod open_release_change_dto; +pub use self::open_release_change_dto::OpenReleaseChangeDto; +pub mod open_release_diff_dto; +pub use self::open_release_diff_dto::OpenReleaseDiffDto; pub mod open_release_dto; pub use self::open_release_dto::OpenReleaseDto; +pub mod open_user_info_dto; +pub use self::open_user_info_dto::OpenUserInfoDto; diff --git a/rust/src/models/open_access_key_dto.rs b/rust/src/models/open_access_key_dto.rs new file mode 100644 index 0000000..73409e9 --- /dev/null +++ b/rust/src/models/open_access_key_dto.rs @@ -0,0 +1,67 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OpenAccessKeyDto { + /// + #[serde(rename = "dataChangeCreatedBy", skip_serializing_if = "Option::is_none")] + pub data_change_created_by: Option, + /// + #[serde(rename = "dataChangeLastModifiedBy", skip_serializing_if = "Option::is_none")] + pub data_change_last_modified_by: Option, + /// + #[serde(rename = "dataChangeCreatedByDisplayName", skip_serializing_if = "Option::is_none")] + pub data_change_created_by_display_name: Option, + /// + #[serde(rename = "dataChangeLastModifiedByDisplayName", skip_serializing_if = "Option::is_none")] + pub data_change_last_modified_by_display_name: Option, + /// + #[serde(rename = "dataChangeCreatedTime", skip_serializing_if = "Option::is_none")] + pub data_change_created_time: Option, + /// + #[serde(rename = "dataChangeLastModifiedTime", skip_serializing_if = "Option::is_none")] + pub data_change_last_modified_time: Option, + /// + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// + #[serde(rename = "secret", skip_serializing_if = "Option::is_none")] + pub secret: Option, + /// + #[serde(rename = "appId", skip_serializing_if = "Option::is_none")] + pub app_id: Option, + /// + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} + +impl OpenAccessKeyDto { + pub fn new() -> OpenAccessKeyDto { + OpenAccessKeyDto { + data_change_created_by: None, + data_change_last_modified_by: None, + data_change_created_by_display_name: None, + data_change_last_modified_by_display_name: None, + data_change_created_time: None, + data_change_last_modified_time: None, + id: None, + secret: None, + app_id: None, + mode: None, + enabled: None, + } + } +} diff --git a/rust/src/models/open_app_role_user_dto.rs b/rust/src/models/open_app_role_user_dto.rs new file mode 100644 index 0000000..04f6b08 --- /dev/null +++ b/rust/src/models/open_app_role_user_dto.rs @@ -0,0 +1,31 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OpenAppRoleUserDto { + /// + #[serde(rename = "appId", skip_serializing_if = "Option::is_none")] + pub app_id: Option, + /// + #[serde(rename = "masterUsers", skip_serializing_if = "Option::is_none")] + pub master_users: Option>, +} + +impl OpenAppRoleUserDto { + pub fn new() -> OpenAppRoleUserDto { + OpenAppRoleUserDto { + app_id: None, + master_users: None, + } + } +} diff --git a/rust/src/models/open_cluster_namespace_role_user_dto.rs b/rust/src/models/open_cluster_namespace_role_user_dto.rs new file mode 100644 index 0000000..d507085 --- /dev/null +++ b/rust/src/models/open_cluster_namespace_role_user_dto.rs @@ -0,0 +1,43 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OpenClusterNamespaceRoleUserDto { + /// + #[serde(rename = "appId", skip_serializing_if = "Option::is_none")] + pub app_id: Option, + /// + #[serde(rename = "env", skip_serializing_if = "Option::is_none")] + pub env: Option, + /// + #[serde(rename = "cluster", skip_serializing_if = "Option::is_none")] + pub cluster: Option, + /// + #[serde(rename = "modifyRoleUsers", skip_serializing_if = "Option::is_none")] + pub modify_role_users: Option>, + /// + #[serde(rename = "releaseRoleUsers", skip_serializing_if = "Option::is_none")] + pub release_role_users: Option>, +} + +impl OpenClusterNamespaceRoleUserDto { + pub fn new() -> OpenClusterNamespaceRoleUserDto { + OpenClusterNamespaceRoleUserDto { + app_id: None, + env: None, + cluster: None, + modify_role_users: None, + release_role_users: None, + } + } +} diff --git a/rust/src/models/open_env_namespace_role_user_dto.rs b/rust/src/models/open_env_namespace_role_user_dto.rs new file mode 100644 index 0000000..098f6f1 --- /dev/null +++ b/rust/src/models/open_env_namespace_role_user_dto.rs @@ -0,0 +1,43 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OpenEnvNamespaceRoleUserDto { + /// + #[serde(rename = "appId", skip_serializing_if = "Option::is_none")] + pub app_id: Option, + /// + #[serde(rename = "namespaceName", skip_serializing_if = "Option::is_none")] + pub namespace_name: Option, + /// + #[serde(rename = "modifyRoleUsers", skip_serializing_if = "Option::is_none")] + pub modify_role_users: Option>, + /// + #[serde(rename = "releaseRoleUsers", skip_serializing_if = "Option::is_none")] + pub release_role_users: Option>, + /// + #[serde(rename = "env", skip_serializing_if = "Option::is_none")] + pub env: Option, +} + +impl OpenEnvNamespaceRoleUserDto { + pub fn new() -> OpenEnvNamespaceRoleUserDto { + OpenEnvNamespaceRoleUserDto { + app_id: None, + namespace_name: None, + modify_role_users: None, + release_role_users: None, + env: None, + } + } +} diff --git a/rust/src/models/open_namespace_role_user_dto.rs b/rust/src/models/open_namespace_role_user_dto.rs new file mode 100644 index 0000000..d07f656 --- /dev/null +++ b/rust/src/models/open_namespace_role_user_dto.rs @@ -0,0 +1,39 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OpenNamespaceRoleUserDto { + /// + #[serde(rename = "appId", skip_serializing_if = "Option::is_none")] + pub app_id: Option, + /// + #[serde(rename = "namespaceName", skip_serializing_if = "Option::is_none")] + pub namespace_name: Option, + /// + #[serde(rename = "modifyRoleUsers", skip_serializing_if = "Option::is_none")] + pub modify_role_users: Option>, + /// + #[serde(rename = "releaseRoleUsers", skip_serializing_if = "Option::is_none")] + pub release_role_users: Option>, +} + +impl OpenNamespaceRoleUserDto { + pub fn new() -> OpenNamespaceRoleUserDto { + OpenNamespaceRoleUserDto { + app_id: None, + namespace_name: None, + modify_role_users: None, + release_role_users: None, + } + } +} diff --git a/rust/src/models/kv_entity.rs b/rust/src/models/open_permission_condition_dto.rs similarity index 72% rename from rust/src/models/kv_entity.rs rename to rust/src/models/open_permission_condition_dto.rs index f85e707..198c291 100644 --- a/rust/src/models/kv_entity.rs +++ b/rust/src/models/open_permission_condition_dto.rs @@ -12,20 +12,16 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct KvEntity { - /// 键 - #[serde(rename = "key", skip_serializing_if = "Option::is_none")] - pub key: Option, - /// 值 - #[serde(rename = "value", skip_serializing_if = "Option::is_none")] - pub value: Option, +pub struct OpenPermissionConditionDto { + /// + #[serde(rename = "hasPermission", skip_serializing_if = "Option::is_none")] + pub has_permission: Option, } -impl KvEntity { - pub fn new() -> KvEntity { - KvEntity { - key: None, - value: None, +impl OpenPermissionConditionDto { + pub fn new() -> OpenPermissionConditionDto { + OpenPermissionConditionDto { + has_permission: None, } } } diff --git a/rust/src/models/open_release_change_dto.rs b/rust/src/models/open_release_change_dto.rs new file mode 100644 index 0000000..cc7397e --- /dev/null +++ b/rust/src/models/open_release_change_dto.rs @@ -0,0 +1,39 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OpenReleaseChangeDto { + /// 修改类型 + #[serde(rename = "changeType", skip_serializing_if = "Option::is_none")] + pub change_type: Option, + /// key + #[serde(rename = "key", skip_serializing_if = "Option::is_none")] + pub key: Option, + /// new value + #[serde(rename = "newValue", skip_serializing_if = "Option::is_none")] + pub new_value: Option, + /// old value + #[serde(rename = "oldValue", skip_serializing_if = "Option::is_none")] + pub old_value: Option, +} + +impl OpenReleaseChangeDto { + pub fn new() -> OpenReleaseChangeDto { + OpenReleaseChangeDto { + change_type: None, + key: None, + new_value: None, + old_value: None, + } + } +} diff --git a/rust/src/models/open_release_bo.rs b/rust/src/models/open_release_diff_dto.rs similarity index 68% rename from rust/src/models/open_release_bo.rs rename to rust/src/models/open_release_diff_dto.rs index cf062bc..7d7dcc4 100644 --- a/rust/src/models/open_release_bo.rs +++ b/rust/src/models/open_release_diff_dto.rs @@ -12,18 +12,16 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] -pub struct OpenReleaseBo { - #[serde(rename = "baseInfo", skip_serializing_if = "Option::is_none")] - pub base_info: Option>, - #[serde(rename = "items", skip_serializing_if = "Option::is_none")] - pub items: Option>, +pub struct OpenReleaseDiffDto { + /// A list of changes, ensuring order if necessary. + #[serde(rename = "changes", skip_serializing_if = "Option::is_none")] + pub changes: Option>, } -impl OpenReleaseBo { - pub fn new() -> OpenReleaseBo { - OpenReleaseBo { - base_info: None, - items: None, +impl OpenReleaseDiffDto { + pub fn new() -> OpenReleaseDiffDto { + OpenReleaseDiffDto { + changes: None, } } } diff --git a/rust/src/models/open_user_info_dto.rs b/rust/src/models/open_user_info_dto.rs new file mode 100644 index 0000000..bcb6133 --- /dev/null +++ b/rust/src/models/open_user_info_dto.rs @@ -0,0 +1,39 @@ +/* + * 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OpenUserInfoDto { + /// + #[serde(rename = "userId", skip_serializing_if = "Option::is_none")] + pub user_id: Option, + /// + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} + +impl OpenUserInfoDto { + pub fn new() -> OpenUserInfoDto { + OpenUserInfoDto { + user_id: None, + name: None, + email: None, + enabled: None, + } + } +} diff --git a/spring-boot2/.openapi-generator/FILES b/spring-boot2/.openapi-generator/FILES index d556a25..b42efd1 100644 --- a/spring-boot2/.openapi-generator/FILES +++ b/spring-boot2/.openapi-generator/FILES @@ -3,6 +3,9 @@ README.md pom.xml src/main/java/com/apollo/openapi/server/OpenApiGeneratorApplication.java src/main/java/com/apollo/openapi/server/RFC3339DateFormat.java +src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApi.java +src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApiController.java +src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApiDelegate.java src/main/java/com/apollo/openapi/server/api/ApiUtil.java src/main/java/com/apollo/openapi/server/api/AppManagementApi.java src/main/java/com/apollo/openapi/server/api/AppManagementApiController.java @@ -34,23 +37,29 @@ src/main/java/com/apollo/openapi/server/api/NamespaceManagementApiDelegate.java src/main/java/com/apollo/openapi/server/api/OrganizationManagementApi.java src/main/java/com/apollo/openapi/server/api/OrganizationManagementApiController.java src/main/java/com/apollo/openapi/server/api/OrganizationManagementApiDelegate.java +src/main/java/com/apollo/openapi/server/api/PermissionManagementApi.java +src/main/java/com/apollo/openapi/server/api/PermissionManagementApiController.java +src/main/java/com/apollo/openapi/server/api/PermissionManagementApiDelegate.java src/main/java/com/apollo/openapi/server/api/ReleaseManagementApi.java src/main/java/com/apollo/openapi/server/api/ReleaseManagementApiController.java src/main/java/com/apollo/openapi/server/api/ReleaseManagementApiDelegate.java src/main/java/com/apollo/openapi/server/config/HomeController.java src/main/java/com/apollo/openapi/server/config/SpringDocConfiguration.java src/main/java/com/apollo/openapi/server/model/ExceptionResponse.java -src/main/java/com/apollo/openapi/server/model/KVEntity.java src/main/java/com/apollo/openapi/server/model/NamespaceGrayDelReleaseDTO.java src/main/java/com/apollo/openapi/server/model/NamespaceReleaseDTO.java +src/main/java/com/apollo/openapi/server/model/OpenAccessKeyDTO.java src/main/java/com/apollo/openapi/server/model/OpenAppDTO.java 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/OpenCreateAppDTO.java src/main/java/com/apollo/openapi/server/model/OpenCreateItemDTO.java src/main/java/com/apollo/openapi/server/model/OpenCreateNamespaceDTO.java src/main/java/com/apollo/openapi/server/model/OpenEnvClusterDTO.java src/main/java/com/apollo/openapi/server/model/OpenEnvClusterInfo.java +src/main/java/com/apollo/openapi/server/model/OpenEnvNamespaceRoleUserDTO.java src/main/java/com/apollo/openapi/server/model/OpenGrayReleaseRuleDTO.java src/main/java/com/apollo/openapi/server/model/OpenGrayReleaseRuleItemDTO.java src/main/java/com/apollo/openapi/server/model/OpenInstanceConfigDTO.java @@ -66,12 +75,16 @@ src/main/java/com/apollo/openapi/server/model/OpenNamespaceDTO.java src/main/java/com/apollo/openapi/server/model/OpenNamespaceExtendDTO.java src/main/java/com/apollo/openapi/server/model/OpenNamespaceIdentifier.java src/main/java/com/apollo/openapi/server/model/OpenNamespaceLockDTO.java +src/main/java/com/apollo/openapi/server/model/OpenNamespaceRoleUserDTO.java src/main/java/com/apollo/openapi/server/model/OpenNamespaceSyncDTO.java src/main/java/com/apollo/openapi/server/model/OpenNamespaceTextModel.java src/main/java/com/apollo/openapi/server/model/OpenNamespaceUsageDTO.java src/main/java/com/apollo/openapi/server/model/OpenOrganizationDto.java -src/main/java/com/apollo/openapi/server/model/OpenReleaseBO.java +src/main/java/com/apollo/openapi/server/model/OpenPermissionConditionDTO.java +src/main/java/com/apollo/openapi/server/model/OpenReleaseChangeDTO.java src/main/java/com/apollo/openapi/server/model/OpenReleaseDTO.java +src/main/java/com/apollo/openapi/server/model/OpenReleaseDiffDTO.java +src/main/java/com/apollo/openapi/server/model/OpenUserInfoDTO.java src/main/resources/application.properties src/main/resources/openapi.yaml src/test/java/com/apollo/openapi/server/OpenApiGeneratorApplicationTests.java diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApi.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApi.java new file mode 100644 index 0000000..ed5eb4e --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApi.java @@ -0,0 +1,217 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.6.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package com.apollo.openapi.server.api; + +import com.apollo.openapi.server.model.OpenAccessKeyDTO; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "AccessKey Management", description = "the AccessKey Management API") +public interface AccessKeyManagementApi { + + default AccessKeyManagementApiDelegate getDelegate() { + return new AccessKeyManagementApiDelegate() {}; + } + + /** + * POST /openapi/v1/apps/{appId}/envs/{env}/accesskeys : 创建AccessKey + * + * + * @param appId (required) + * @param env (required) + * @param operator (optional) + * @return (status code 200) + */ + @Operation( + operationId = "createAccessKey", + summary = "创建AccessKey", + description = "", + tags = { "AccessKey Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = OpenAccessKeyDTO.class)) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys", + produces = { "application/json" } + ) + default ResponseEntity createAccessKey( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @Parameter(name = "operator", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().createAccessKey(appId, env, operator); + } + + + /** + * DELETE /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId} : 删除AccessKey + * + * + * @param appId (required) + * @param env (required) + * @param accessKeyId (required) + * @param operator (optional) + * @return (status code 200) + */ + @Operation( + operationId = "deleteAccessKey", + summary = "删除AccessKey", + description = "", + tags = { "AccessKey Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}" + ) + default ResponseEntity deleteAccessKey( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @Parameter(name = "accessKeyId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("accessKeyId") Long accessKeyId, + @Parameter(name = "operator", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().deleteAccessKey(appId, env, accessKeyId, operator); + } + + + /** + * PUT /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation : 禁用AccessKey + * + * + * @param appId (required) + * @param env (required) + * @param accessKeyId (required) + * @return (status code 200) + */ + @Operation( + operationId = "disableAccessKey", + summary = "禁用AccessKey", + description = "", + tags = { "AccessKey Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation" + ) + default ResponseEntity disableAccessKey( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @Parameter(name = "accessKeyId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("accessKeyId") Long accessKeyId + ) { + return getDelegate().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) + * @return (status code 200) + */ + @Operation( + operationId = "enableAccessKey", + summary = "启用AccessKey", + description = "", + tags = { "AccessKey Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.PUT, + value = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/activation" + ) + default ResponseEntity enableAccessKey( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @Parameter(name = "accessKeyId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("accessKeyId") Long accessKeyId, + @Parameter(name = "mode", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "mode", required = false, defaultValue = "0") Integer mode + ) { + return getDelegate().enableAccessKey(appId, env, accessKeyId, mode); + } + + + /** + * GET /openapi/v1/apps/{appId}/envs/{env}/accesskeys : 查找AccessKey + * + * + * @param appId (required) + * @param env (required) + * @return (status code 200) + */ + @Operation( + operationId = "findAccessKeys", + summary = "查找AccessKey", + description = "", + tags = { "AccessKey Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = OpenAccessKeyDTO.class))) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/apps/{appId}/envs/{env}/accesskeys", + produces = { "application/json" } + ) + default ResponseEntity> findAccessKeys( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env + ) { + return getDelegate().findAccessKeys(appId, env); + } + +} diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApiController.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApiController.java new file mode 100644 index 0000000..ed156be --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApiController.java @@ -0,0 +1,44 @@ +package com.apollo.openapi.server.api; + +import com.apollo.openapi.server.model.OpenAccessKeyDTO; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Controller +@RequestMapping("${openapi.apolloOpen.base-path:}") +public class AccessKeyManagementApiController implements AccessKeyManagementApi { + + private final AccessKeyManagementApiDelegate delegate; + + public AccessKeyManagementApiController(@Autowired(required = false) AccessKeyManagementApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new AccessKeyManagementApiDelegate() {}); + } + + @Override + public AccessKeyManagementApiDelegate getDelegate() { + return delegate; + } + +} 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 new file mode 100644 index 0000000..a8650a3 --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/AccessKeyManagementApiDelegate.java @@ -0,0 +1,131 @@ +package com.apollo.openapi.server.api; + +import com.apollo.openapi.server.model.OpenAccessKeyDTO; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +/** + * A delegate to be called by the {@link AccessKeyManagementApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public interface AccessKeyManagementApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /openapi/v1/apps/{appId}/envs/{env}/accesskeys : 创建AccessKey + * + * + * @param appId (required) + * @param env (required) + * @param operator (optional) + * @return (status code 200) + * @see AccessKeyManagementApi#createAccessKey + */ + default ResponseEntity createAccessKey(String appId, + String env, + String operator) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"mode\" : 6, \"dataChangeLastModifiedByDisplayName\" : \"dataChangeLastModifiedByDisplayName\", \"dataChangeCreatedByDisplayName\" : \"dataChangeCreatedByDisplayName\", \"dataChangeCreatedTime\" : \"dataChangeCreatedTime\", \"dataChangeLastModifiedBy\" : \"dataChangeLastModifiedBy\", \"appId\" : \"appId\", \"dataChangeCreatedBy\" : \"dataChangeCreatedBy\", \"id\" : 0, \"secret\" : \"secret\", \"dataChangeLastModifiedTime\" : \"dataChangeLastModifiedTime\", \"enabled\" : true }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId} : 删除AccessKey + * + * + * @param appId (required) + * @param env (required) + * @param accessKeyId (required) + * @param operator (optional) + * @return (status code 200) + * @see AccessKeyManagementApi#deleteAccessKey + */ + default ResponseEntity deleteAccessKey(String appId, + String env, + Long accessKeyId, + String operator) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * PUT /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation : 禁用AccessKey + * + * + * @param appId (required) + * @param env (required) + * @param accessKeyId (required) + * @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}/activation : 启用AccessKey + * + * + * @param appId (required) + * @param env (required) + * @param accessKeyId (required) + * @param mode (optional, default to 0) + * @return (status code 200) + * @see AccessKeyManagementApi#enableAccessKey + */ + default ResponseEntity enableAccessKey(String appId, + String env, + Long accessKeyId, + Integer mode) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /openapi/v1/apps/{appId}/envs/{env}/accesskeys : 查找AccessKey + * + * + * @param appId (required) + * @param env (required) + * @return (status code 200) + * @see AccessKeyManagementApi#findAccessKeys + */ + default ResponseEntity> findAccessKeys(String appId, + String env) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"mode\" : 6, \"dataChangeLastModifiedByDisplayName\" : \"dataChangeLastModifiedByDisplayName\", \"dataChangeCreatedByDisplayName\" : \"dataChangeCreatedByDisplayName\", \"dataChangeCreatedTime\" : \"dataChangeCreatedTime\", \"dataChangeLastModifiedBy\" : \"dataChangeLastModifiedBy\", \"appId\" : \"appId\", \"dataChangeCreatedBy\" : \"dataChangeCreatedBy\", \"id\" : 0, \"secret\" : \"secret\", \"dataChangeLastModifiedTime\" : \"dataChangeLastModifiedTime\", \"enabled\" : true }, { \"mode\" : 6, \"dataChangeLastModifiedByDisplayName\" : \"dataChangeLastModifiedByDisplayName\", \"dataChangeCreatedByDisplayName\" : \"dataChangeCreatedByDisplayName\", \"dataChangeCreatedTime\" : \"dataChangeCreatedTime\", \"dataChangeLastModifiedBy\" : \"dataChangeLastModifiedBy\", \"appId\" : \"appId\", \"dataChangeCreatedBy\" : \"dataChangeCreatedBy\", \"id\" : 0, \"secret\" : \"secret\", \"dataChangeLastModifiedTime\" : \"dataChangeLastModifiedTime\", \"enabled\" : true } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/AppManagementApi.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/AppManagementApi.java index c8fe3e8..2c7bfc2 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/AppManagementApi.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/AppManagementApi.java @@ -101,9 +101,7 @@ default ResponseEntity createApp( description = "POST /openapi/v1/apps/envs/{env}", tags = { "App Management" }, responses = { - @ApiResponse(responseCode = "200", description = "应用在指定环境创建成功", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Object.class)) - }), + @ApiResponse(responseCode = "200", description = "应用在指定环境创建成功"), @ApiResponse(responseCode = "400", description = "请求参数错误", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionResponse.class)) }), @@ -121,7 +119,7 @@ default ResponseEntity createApp( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity createAppInEnv( + default ResponseEntity createAppInEnv( @Parameter(name = "env", description = "环境标识,例如 DEV、FAT、UAT、PROD", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, @Parameter(name = "OpenAppDTO", description = "", required = true) @Valid @RequestBody OpenAppDTO openAppDTO, @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator @@ -146,9 +144,7 @@ default ResponseEntity createAppInEnv( description = "DELETE /openapi/v1/apps/{appId}", tags = { "App Management" }, responses = { - @ApiResponse(responseCode = "200", description = "应用删除成功", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Object.class)) - }), + @ApiResponse(responseCode = "200", description = "应用删除成功"), @ApiResponse(responseCode = "403", description = "权限不足,需要超级管理员权限", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionResponse.class)) }), @@ -165,7 +161,7 @@ default ResponseEntity createAppInEnv( value = "/openapi/v1/apps/{appId}", produces = { "application/json" } ) - default ResponseEntity deleteApp( + default ResponseEntity deleteApp( @Parameter(name = "appId", description = "应用ID", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator ) { @@ -446,9 +442,7 @@ default ResponseEntity> getEnvClusters( description = "PUT /openapi/v1/apps/{appId}", tags = { "App Management" }, responses = { - @ApiResponse(responseCode = "200", description = "应用更新成功", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Object.class)) - }), + @ApiResponse(responseCode = "200", description = "应用更新成功"), @ApiResponse(responseCode = "400", description = "请求参数错误", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionResponse.class)) }), @@ -466,7 +460,7 @@ default ResponseEntity> getEnvClusters( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity updateApp( + default ResponseEntity updateApp( @Parameter(name = "appId", description = "应用ID", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, @Parameter(name = "OpenAppDTO", description = "", required = true) @Valid @RequestBody OpenAppDTO openAppDTO, @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/AppManagementApiDelegate.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/AppManagementApiDelegate.java index 8695a14..4634c10 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/AppManagementApiDelegate.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/AppManagementApiDelegate.java @@ -64,7 +64,7 @@ default ResponseEntity createApp(OpenCreateAppDTO openCreateAppDTO) * or 权限不足 (status code 403) * @see AppManagementApi#createAppInEnv */ - default ResponseEntity createAppInEnv(String env, + default ResponseEntity createAppInEnv(String env, OpenAppDTO openAppDTO, String operator) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -82,7 +82,7 @@ default ResponseEntity createAppInEnv(String env, * or 应用不存在 (status code 404) * @see AppManagementApi#deleteApp */ - default ResponseEntity deleteApp(String appId, + default ResponseEntity deleteApp(String appId, String operator) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -261,7 +261,7 @@ default ResponseEntity> getEnvClusters(String appId) { * or 权限不足 (status code 403) * @see AppManagementApi#updateApp */ - default ResponseEntity updateApp(String appId, + default ResponseEntity updateApp(String appId, OpenAppDTO openAppDTO, String operator) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/ClusterManagementApi.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/ClusterManagementApi.java index 1f6e465..e341a38 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/ClusterManagementApi.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/ClusterManagementApi.java @@ -103,9 +103,7 @@ default ResponseEntity createCluster( description = "DELETE /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}", tags = { "Cluster Management" }, responses = { - @ApiResponse(responseCode = "200", description = "集群删除成功", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Object.class)) - }), + @ApiResponse(responseCode = "200", description = "集群删除成功"), @ApiResponse(responseCode = "400", description = "删除失败,集群可能包含配置", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionResponse.class)) }), @@ -125,7 +123,7 @@ default ResponseEntity createCluster( value = "/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}", produces = { "application/json" } ) - default ResponseEntity deleteCluster( + default ResponseEntity deleteCluster( @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, @Parameter(name = "clusterName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("clusterName") String clusterName, diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/ClusterManagementApiDelegate.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/ClusterManagementApiDelegate.java index ecda305..8679efc 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/ClusterManagementApiDelegate.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/ClusterManagementApiDelegate.java @@ -66,7 +66,7 @@ default ResponseEntity createCluster(String appId, * or 集群不存在 (status code 404) * @see ClusterManagementApi#deleteCluster */ - default ResponseEntity deleteCluster(String env, + default ResponseEntity deleteCluster(String env, String appId, String clusterName, String operator) { diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/InstanceManagementApi.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/InstanceManagementApi.java index 501a864..b897620 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/InstanceManagementApi.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/InstanceManagementApi.java @@ -127,7 +127,7 @@ default ResponseEntity getByRelease( * @param appId 应用ID (required) * @param clusterName 集群名称 (required) * @param namespaceName 命名空间名称 (required) - * @param releaseIds 排除的发布ID列表,用逗号分隔 (optional) + * @param releaseIds 排除的发布ID列表,用逗号分隔 (required) * @return (status code 200) */ @Operation( @@ -153,7 +153,7 @@ default ResponseEntity> getByReleasesAndNamespaceNotIn( @NotNull @Parameter(name = "appId", description = "应用ID", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "appId", required = true) String appId, @NotNull @Parameter(name = "clusterName", description = "集群名称", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "clusterName", required = true) String clusterName, @NotNull @Parameter(name = "namespaceName", description = "命名空间名称", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "namespaceName", required = true) String namespaceName, - @Parameter(name = "releaseIds", description = "排除的发布ID列表,用逗号分隔", in = ParameterIn.QUERY) @Valid @RequestParam(value = "releaseIds", required = false) String releaseIds + @NotNull @Parameter(name = "releaseIds", description = "排除的发布ID列表,用逗号分隔", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "releaseIds", required = true) String releaseIds ) { return getDelegate().getByReleasesAndNamespaceNotIn(env, appId, clusterName, namespaceName, releaseIds); } diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/InstanceManagementApiDelegate.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/InstanceManagementApiDelegate.java index 15013c9..5a51de7 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/InstanceManagementApiDelegate.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/InstanceManagementApiDelegate.java @@ -92,7 +92,7 @@ default ResponseEntity getByRelease(String env, * @param appId 应用ID (required) * @param clusterName 集群名称 (required) * @param namespaceName 命名空间名称 (required) - * @param releaseIds 排除的发布ID列表,用逗号分隔 (optional) + * @param releaseIds 排除的发布ID列表,用逗号分隔 (required) * @return (status code 200) * @see InstanceManagementApi#getByReleasesAndNamespaceNotIn */ diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/NamespaceManagementApi.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/NamespaceManagementApi.java index f42ed7a..50bd619 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/NamespaceManagementApi.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/NamespaceManagementApi.java @@ -56,9 +56,7 @@ default NamespaceManagementApiDelegate getDelegate() { description = "POST /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/missing-namespaces", tags = { "Namespace Management" }, responses = { - @ApiResponse(responseCode = "200", description = "缺失的命名空间创建成功", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Object.class)) - }) + @ApiResponse(responseCode = "200", description = "缺失的命名空间创建成功") }, security = { @SecurityRequirement(name = "ApiKeyAuth") @@ -66,10 +64,9 @@ default NamespaceManagementApiDelegate getDelegate() { ) @RequestMapping( method = RequestMethod.POST, - value = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/missing-namespaces", - produces = { "application/json" } + value = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/missing-namespaces" ) - default ResponseEntity createMissingNamespaces( + default ResponseEntity createMissingNamespaces( @Parameter(name = "appId", description = "应用ID", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, @Parameter(name = "env", description = "环境标识", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, @Parameter(name = "clusterName", description = "集群名称", required = true, in = ParameterIn.PATH) @PathVariable("clusterName") String clusterName, diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/NamespaceManagementApiDelegate.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/NamespaceManagementApiDelegate.java index b2fb556..8fbbba9 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/NamespaceManagementApiDelegate.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/NamespaceManagementApiDelegate.java @@ -37,7 +37,7 @@ default Optional getRequest() { * @return 缺失的命名空间创建成功 (status code 200) * @see NamespaceManagementApi#createMissingNamespaces */ - default ResponseEntity createMissingNamespaces(String appId, + default ResponseEntity createMissingNamespaces(String appId, String env, String clusterName, String operator) { diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/PermissionManagementApi.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/PermissionManagementApi.java new file mode 100644 index 0000000..f3b50e2 --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/PermissionManagementApi.java @@ -0,0 +1,989 @@ +/** + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.6.0). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package com.apollo.openapi.server.api; + +import java.util.List; +import java.util.Map; +import com.apollo.openapi.server.model.OpenAppRoleUserDTO; +import com.apollo.openapi.server.model.OpenClusterNamespaceRoleUserDTO; +import com.apollo.openapi.server.model.OpenEnvNamespaceRoleUserDTO; +import com.apollo.openapi.server.model.OpenNamespaceRoleUserDTO; +import com.apollo.openapi.server.model.OpenPermissionConditionDTO; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Validated +@Tag(name = "Permission Management", description = "权限管理相关接口,包括权限查询等功能") +public interface PermissionManagementApi { + + default PermissionManagementApiDelegate getDelegate() { + return new PermissionManagementApiDelegate() {}; + } + + /** + * POST /openapi/v1/system/roles/create-application : 分配建应用角色 (new added) + * + * + * @param operator 操作人用户名 (optional) + * @param requestBody (optional) + * @return (status code 200) + */ + @Operation( + operationId = "addCreateApplicationRoleToUsers", + summary = "分配建应用角色 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/openapi/v1/system/roles/create-application", + consumes = { "application/json" } + ) + default ResponseEntity addCreateApplicationRoleToUsers( + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator, + @Parameter(name = "request_body", description = "") @Valid @RequestBody(required = false) List requestBody + ) { + return getDelegate().addCreateApplicationRoleToUsers(operator, requestBody); + } + + + /** + * POST /openapi/v1/apps/{appId}/roles/master : 分配AppMaster (new added) + * + * + * @param appId (required) + * @param userId the user which role assign to (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + */ + @Operation( + operationId = "addManageAppMasterRoleToUser", + summary = "分配AppMaster (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/openapi/v1/apps/{appId}/roles/master" + ) + default ResponseEntity addManageAppMasterRoleToUser( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @NotNull @Parameter(name = "userId", description = "the user which role assign to", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().addManageAppMasterRoleToUser(appId, userId, operator); + } + + + /** + * POST /openapi/v1/apps/{appId}/roles/{roleType} : 分配应用角色 (new added) + * + * + * @param appId (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @param body (optional) + * @return (status code 200) + */ + @Operation( + operationId = "assignAppRoleToUser", + summary = "分配应用角色 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/openapi/v1/apps/{appId}/roles/{roleType}", + consumes = { "application/json" } + ) + default ResponseEntity assignAppRoleToUser( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "roleType", description = "", required = true, in = ParameterIn.PATH) @PathVariable("roleType") String roleType, + @NotNull @Parameter(name = "userId", description = "the user which role removed from", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator, + @Parameter(name = "body", description = "") @Valid @RequestBody(required = false) String body + ) { + return getDelegate().assignAppRoleToUser(appId, roleType, userId, operator, body); + } + + + /** + * POST /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType} : 分配集群Namespace角色 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + */ + @Operation( + operationId = "assignClusterNamespaceRoleToUser", + summary = "分配集群Namespace角色 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType}" + ) + default ResponseEntity assignClusterNamespaceRoleToUser( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @Parameter(name = "clusterName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("clusterName") String clusterName, + @Parameter(name = "roleType", description = "", required = true, in = ParameterIn.PATH) @PathVariable("roleType") String roleType, + @NotNull @Parameter(name = "userId", description = "the user which role assigned to", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().assignClusterNamespaceRoleToUser(appId, env, clusterName, roleType, userId, operator); + } + + + /** + * POST /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType} : 分配环境Namespace角色 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + */ + @Operation( + operationId = "assignNamespaceEnvRoleToUser", + summary = "分配环境Namespace角色 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType}" + ) + default ResponseEntity assignNamespaceEnvRoleToUser( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @Parameter(name = "namespaceName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("namespaceName") String namespaceName, + @Parameter(name = "roleType", description = "", required = true, in = ParameterIn.PATH) @PathVariable("roleType") String roleType, + @NotNull @Parameter(name = "userId", description = "the user which role assigned to", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().assignNamespaceEnvRoleToUser(appId, env, namespaceName, roleType, userId, operator); + } + + + /** + * POST /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType} : 分配Namespace角色 (new added) + * + * + * @param appId (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + */ + @Operation( + operationId = "assignNamespaceRoleToUser", + summary = "分配Namespace角色 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType}" + ) + default ResponseEntity assignNamespaceRoleToUser( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "namespaceName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("namespaceName") String namespaceName, + @Parameter(name = "roleType", description = "", required = true, in = ParameterIn.PATH) @PathVariable("roleType") String roleType, + @NotNull @Parameter(name = "userId", description = "the user which role assigned to", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().assignNamespaceRoleToUser(appId, namespaceName, roleType, userId, operator); + } + + + /** + * DELETE /openapi/v1/system/roles/create-application : 移除建应用角色 (new added) + * + * + * @param userId (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + */ + @Operation( + operationId = "deleteCreateApplicationRoleFromUser", + summary = "移除建应用角色 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/openapi/v1/system/roles/create-application" + ) + default ResponseEntity deleteCreateApplicationRoleFromUser( + @NotNull @Parameter(name = "userId", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().deleteCreateApplicationRoleFromUser(userId, operator); + } + + + /** + * GET /openapi/v1/apps/{appId}/role-users : 获取应用角色用户 (new added) + * + * + * @param appId (required) + * @return (status code 200) + */ + @Operation( + operationId = "getAppRoles", + summary = "获取应用角色用户 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = OpenAppRoleUserDTO.class)) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/apps/{appId}/role-users", + produces = { "application/json" } + ) + default ResponseEntity getAppRoles( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId + ) { + return getDelegate().getAppRoles(appId); + } + + + /** + * GET /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/role-users : 获取集群Namespace用户 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @return (status code 200) + */ + @Operation( + operationId = "getClusterNamespaceRoles", + summary = "获取集群Namespace用户 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = OpenClusterNamespaceRoleUserDTO.class)) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/role-users", + produces = { "application/json" } + ) + default ResponseEntity getClusterNamespaceRoles( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @Parameter(name = "clusterName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("clusterName") String clusterName + ) { + return getDelegate().getClusterNamespaceRoles(appId, env, clusterName); + } + + + /** + * GET /openapi/v1/system/roles/create-application/role-users : 获取建应用用户 (new added) + * + * + * @return (status code 200) + */ + @Operation( + operationId = "getCreateApplicationRoleUsers", + summary = "获取建应用用户 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = String.class))) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/system/roles/create-application/role-users", + produces = { "application/json" } + ) + default ResponseEntity> getCreateApplicationRoleUsers( + + ) { + return getDelegate().getCreateApplicationRoleUsers(); + } + + + /** + * GET /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/role-users : 获取环境Namespace用户 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @return (status code 200) + */ + @Operation( + operationId = "getNamespaceEnvRoleUsers", + summary = "获取环境Namespace用户 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = OpenEnvNamespaceRoleUserDTO.class)) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/role-users", + produces = { "application/json" } + ) + default ResponseEntity getNamespaceEnvRoleUsers( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @Parameter(name = "namespaceName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("namespaceName") String namespaceName + ) { + return getDelegate().getNamespaceEnvRoleUsers(appId, env, namespaceName); + } + + + /** + * GET /openapi/v1/apps/{appId}/namespaces/{namespaceName}/role-users : 获取Namespace用户 (new added) + * + * + * @param appId (required) + * @param namespaceName (required) + * @return (status code 200) + */ + @Operation( + operationId = "getNamespaceRoles", + summary = "获取Namespace用户 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = OpenNamespaceRoleUserDTO.class)) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/role-users", + produces = { "application/json" } + ) + default ResponseEntity getNamespaceRoles( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "namespaceName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("namespaceName") String namespaceName + ) { + return getDelegate().getNamespaceRoles(appId, namespaceName); + } + + + /** + * GET /openapi/v1/apps/{appId}/permissions/{permissionType} : 校验应用权限 (new added) + * + * + * @param appId (required) + * @param permissionType (required) + * @param userId (required) + * @return (status code 200) + */ + @Operation( + operationId = "hasAppPermission", + summary = "校验应用权限 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = OpenPermissionConditionDTO.class)) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/apps/{appId}/permissions/{permissionType}", + produces = { "application/json" } + ) + default ResponseEntity hasAppPermission( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "permissionType", description = "", required = true, in = ParameterIn.PATH) @PathVariable("permissionType") String permissionType, + @NotNull @Parameter(name = "userId", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId + ) { + return getDelegate().hasAppPermission(appId, permissionType, userId); + } + + + /** + * GET /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permissions/{permissionType} : 校验集群Namespace权限 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param permissionType (required) + * @param userId (required) + * @return (status code 200) + */ + @Operation( + operationId = "hasClusterNamespacePermission", + summary = "校验集群Namespace权限 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = OpenPermissionConditionDTO.class)) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permissions/{permissionType}", + produces = { "application/json" } + ) + default ResponseEntity hasClusterNamespacePermission( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @Parameter(name = "clusterName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("clusterName") String clusterName, + @Parameter(name = "permissionType", description = "", required = true, in = ParameterIn.PATH) @PathVariable("permissionType") String permissionType, + @NotNull @Parameter(name = "userId", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId + ) { + return getDelegate().hasClusterNamespacePermission(appId, env, clusterName, permissionType, userId); + } + + + /** + * GET /openapi/v1/system/roles/create-application : 校验建应用权限 (new added) + * + * + * @param userId (required) + * @return (status code 200) + */ + @Operation( + operationId = "hasCreateApplicationPermission", + summary = "校验建应用权限 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/system/roles/create-application", + produces = { "application/json" } + ) + default ResponseEntity> hasCreateApplicationPermission( + @NotNull @Parameter(name = "userId", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId + ) { + return getDelegate().hasCreateApplicationPermission(userId); + } + + + /** + * GET /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/permissions/{permissionType} : 校验环境Namespace权限 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param permissionType (required) + * @param userId (required) + * @return (status code 200) + */ + @Operation( + operationId = "hasEnvNamespacePermission", + summary = "校验环境Namespace权限 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = OpenPermissionConditionDTO.class)) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/permissions/{permissionType}", + produces = { "application/json" } + ) + default ResponseEntity hasEnvNamespacePermission( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @Parameter(name = "namespaceName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("namespaceName") String namespaceName, + @Parameter(name = "permissionType", description = "", required = true, in = ParameterIn.PATH) @PathVariable("permissionType") String permissionType, + @NotNull @Parameter(name = "userId", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId + ) { + return getDelegate().hasEnvNamespacePermission(appId, env, namespaceName, permissionType, userId); + } + + + /** + * GET /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permissions/{permissionType} : 校验Namespace权限 (new added) + * + * + * @param appId (required) + * @param namespaceName (required) + * @param permissionType (required) + * @param userId (required) + * @return (status code 200) + */ + @Operation( + operationId = "hasNamespacePermission", + summary = "校验Namespace权限 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = OpenPermissionConditionDTO.class)) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/permissions/{permissionType}", + produces = { "application/json" } + ) + default ResponseEntity hasNamespacePermission( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "namespaceName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("namespaceName") String namespaceName, + @Parameter(name = "permissionType", description = "", required = true, in = ParameterIn.PATH) @PathVariable("permissionType") String permissionType, + @NotNull @Parameter(name = "userId", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId + ) { + return getDelegate().hasNamespacePermission(appId, namespaceName, permissionType, userId); + } + + + /** + * GET /openapi/v1/permissions/root : 校验Root权限 (new added) + * + * + * @param userId (required) + * @return (status code 200) + */ + @Operation( + operationId = "hasRootPermission", + summary = "校验Root权限 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = OpenPermissionConditionDTO.class)) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/permissions/root", + produces = { "application/json" } + ) + default ResponseEntity hasRootPermission( + @NotNull @Parameter(name = "userId", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId + ) { + return getDelegate().hasRootPermission(userId); + } + + + /** + * POST /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init : 初始化应用权限 (new added) + * + * + * @param appId (required) + * @param namespaceName (required) + * @param operator 操作人用户名 (optional) + * @return 初始化成功 (status code 200) + */ + @Operation( + operationId = "initAppPermission", + summary = "初始化应用权限 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "初始化成功") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init" + ) + default ResponseEntity initAppPermission( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "namespaceName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("namespaceName") String namespaceName, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().initAppPermission(appId, namespaceName, operator); + } + + + /** + * POST /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permission-init : 初始化集群Namespace权限 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + */ + @Operation( + operationId = "initClusterNamespacePermission", + summary = "初始化集群Namespace权限 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permission-init" + ) + default ResponseEntity initClusterNamespacePermission( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @Parameter(name = "clusterName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("clusterName") String clusterName, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().initClusterNamespacePermission(appId, env, clusterName, operator); + } + + + /** + * GET /openapi/v1/system/role/manage-app-master : 校验AppMaster开关 (new added) + * + * + * @return (status code 200) + */ + @Operation( + operationId = "isManageAppMasterPermissionEnabled", + summary = "校验AppMaster开关 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/system/role/manage-app-master", + produces = { "application/json" } + ) + default ResponseEntity> isManageAppMasterPermissionEnabled( + + ) { + return getDelegate().isManageAppMasterPermissionEnabled(); + } + + + /** + * DELETE /openapi/v1/apps/{appId}/roles/{roleType} : 移除应用角色 (new added) + * + * + * @param appId (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + */ + @Operation( + operationId = "removeAppRoleFromUser", + summary = "移除应用角色 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/openapi/v1/apps/{appId}/roles/{roleType}" + ) + default ResponseEntity removeAppRoleFromUser( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "roleType", description = "", required = true, in = ParameterIn.PATH) @PathVariable("roleType") String roleType, + @NotNull @Parameter(name = "userId", description = "the user which role removed from", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().removeAppRoleFromUser(appId, roleType, userId, operator); + } + + + /** + * DELETE /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType} : 移除集群Namespace角色 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + */ + @Operation( + operationId = "removeClusterNamespaceRoleFromUser", + summary = "移除集群Namespace角色 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType}" + ) + default ResponseEntity removeClusterNamespaceRoleFromUser( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @Parameter(name = "clusterName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("clusterName") String clusterName, + @Parameter(name = "roleType", description = "", required = true, in = ParameterIn.PATH) @PathVariable("roleType") String roleType, + @NotNull @Parameter(name = "userId", description = "the user which role removed from", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().removeClusterNamespaceRoleFromUser(appId, env, clusterName, roleType, userId, operator); + } + + + /** + * DELETE /openapi/v1/apps/{appId}/roles/master : 移除AppMaster (new added) + * + * + * @param appId (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + */ + @Operation( + operationId = "removeManageAppMasterRoleFromUser", + summary = "移除AppMaster (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/openapi/v1/apps/{appId}/roles/master" + ) + default ResponseEntity removeManageAppMasterRoleFromUser( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @NotNull @Parameter(name = "userId", description = "the user which role removed from", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().removeManageAppMasterRoleFromUser(appId, userId, operator); + } + + + /** + * DELETE /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType} : 移除环境Namespace角色 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + */ + @Operation( + operationId = "removeNamespaceEnvRoleFromUser", + summary = "移除环境Namespace角色 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType}" + ) + default ResponseEntity removeNamespaceEnvRoleFromUser( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "env", description = "", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @Parameter(name = "namespaceName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("namespaceName") String namespaceName, + @Parameter(name = "roleType", description = "", required = true, in = ParameterIn.PATH) @PathVariable("roleType") String roleType, + @NotNull @Parameter(name = "userId", description = "the user which role removed from", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().removeNamespaceEnvRoleFromUser(appId, env, namespaceName, roleType, userId, operator); + } + + + /** + * DELETE /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType} : 移除Namespace角色 (new added) + * + * + * @param appId (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + */ + @Operation( + operationId = "removeNamespaceRoleFromUser", + summary = "移除Namespace角色 (new added)", + description = "", + tags = { "Permission Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "") + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.DELETE, + value = "/openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType}" + ) + default ResponseEntity removeNamespaceRoleFromUser( + @Parameter(name = "appId", description = "", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, + @Parameter(name = "namespaceName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("namespaceName") String namespaceName, + @Parameter(name = "roleType", description = "", required = true, in = ParameterIn.PATH) @PathVariable("roleType") String roleType, + @NotNull @Parameter(name = "userId", description = "the user which role removed from", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "userId", required = true) String userId, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator + ) { + return getDelegate().removeNamespaceRoleFromUser(appId, namespaceName, roleType, userId, operator); + } + +} diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/PermissionManagementApiController.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/PermissionManagementApiController.java new file mode 100644 index 0000000..6f9cb52 --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/PermissionManagementApiController.java @@ -0,0 +1,50 @@ +package com.apollo.openapi.server.api; + +import java.util.List; +import java.util.Map; +import com.apollo.openapi.server.model.OpenAppRoleUserDTO; +import com.apollo.openapi.server.model.OpenClusterNamespaceRoleUserDTO; +import com.apollo.openapi.server.model.OpenEnvNamespaceRoleUserDTO; +import com.apollo.openapi.server.model.OpenNamespaceRoleUserDTO; +import com.apollo.openapi.server.model.OpenPermissionConditionDTO; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +@Controller +@RequestMapping("${openapi.apolloOpen.base-path:}") +public class PermissionManagementApiController implements PermissionManagementApi { + + private final PermissionManagementApiDelegate delegate; + + public PermissionManagementApiController(@Autowired(required = false) PermissionManagementApiDelegate delegate) { + this.delegate = Optional.ofNullable(delegate).orElse(new PermissionManagementApiDelegate() {}); + } + + @Override + public PermissionManagementApiDelegate getDelegate() { + return delegate; + } + +} diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/PermissionManagementApiDelegate.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/PermissionManagementApiDelegate.java new file mode 100644 index 0000000..353aa25 --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/PermissionManagementApiDelegate.java @@ -0,0 +1,586 @@ +package com.apollo.openapi.server.api; + +import java.util.List; +import java.util.Map; +import com.apollo.openapi.server.model.OpenAppRoleUserDTO; +import com.apollo.openapi.server.model.OpenClusterNamespaceRoleUserDTO; +import com.apollo.openapi.server.model.OpenEnvNamespaceRoleUserDTO; +import com.apollo.openapi.server.model.OpenNamespaceRoleUserDTO; +import com.apollo.openapi.server.model.OpenPermissionConditionDTO; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +/** + * A delegate to be called by the {@link PermissionManagementApiController}}. + * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. + */ +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public interface PermissionManagementApiDelegate { + + default Optional getRequest() { + return Optional.empty(); + } + + /** + * POST /openapi/v1/system/roles/create-application : 分配建应用角色 (new added) + * + * + * @param operator 操作人用户名 (optional) + * @param requestBody (optional) + * @return (status code 200) + * @see PermissionManagementApi#addCreateApplicationRoleToUsers + */ + default ResponseEntity addCreateApplicationRoleToUsers(String operator, + List requestBody) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /openapi/v1/apps/{appId}/roles/master : 分配AppMaster (new added) + * + * + * @param appId (required) + * @param userId the user which role assign to (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + * @see PermissionManagementApi#addManageAppMasterRoleToUser + */ + default ResponseEntity addManageAppMasterRoleToUser(String appId, + String userId, + String operator) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /openapi/v1/apps/{appId}/roles/{roleType} : 分配应用角色 (new added) + * + * + * @param appId (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @param body (optional) + * @return (status code 200) + * @see PermissionManagementApi#assignAppRoleToUser + */ + default ResponseEntity assignAppRoleToUser(String appId, + String roleType, + String userId, + String operator, + String body) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType} : 分配集群Namespace角色 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + * @see PermissionManagementApi#assignClusterNamespaceRoleToUser + */ + default ResponseEntity assignClusterNamespaceRoleToUser(String appId, + String env, + String clusterName, + String roleType, + String userId, + String operator) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType} : 分配环境Namespace角色 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + * @see PermissionManagementApi#assignNamespaceEnvRoleToUser + */ + default ResponseEntity assignNamespaceEnvRoleToUser(String appId, + String env, + String namespaceName, + String roleType, + String userId, + String operator) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType} : 分配Namespace角色 (new added) + * + * + * @param appId (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role assigned to (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + * @see PermissionManagementApi#assignNamespaceRoleToUser + */ + default ResponseEntity assignNamespaceRoleToUser(String appId, + String namespaceName, + String roleType, + String userId, + String operator) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /openapi/v1/system/roles/create-application : 移除建应用角色 (new added) + * + * + * @param userId (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + * @see PermissionManagementApi#deleteCreateApplicationRoleFromUser + */ + default ResponseEntity deleteCreateApplicationRoleFromUser(String userId, + String operator) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /openapi/v1/apps/{appId}/role-users : 获取应用角色用户 (new added) + * + * + * @param appId (required) + * @return (status code 200) + * @see PermissionManagementApi#getAppRoles + */ + default ResponseEntity getAppRoles(String appId) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"appId\" : \"appId\", \"masterUsers\" : [ { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 }, { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/role-users : 获取集群Namespace用户 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @return (status code 200) + * @see PermissionManagementApi#getClusterNamespaceRoles + */ + default ResponseEntity getClusterNamespaceRoles(String appId, + String env, + String clusterName) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"cluster\" : \"cluster\", \"releaseRoleUsers\" : [ { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 }, { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 } ], \"appId\" : \"appId\", \"modifyRoleUsers\" : [ { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 }, { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 } ], \"env\" : \"env\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /openapi/v1/system/roles/create-application/role-users : 获取建应用用户 (new added) + * + * + * @return (status code 200) + * @see PermissionManagementApi#getCreateApplicationRoleUsers + */ + default ResponseEntity> getCreateApplicationRoleUsers() { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ \"\", \"\" ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/role-users : 获取环境Namespace用户 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @return (status code 200) + * @see PermissionManagementApi#getNamespaceEnvRoleUsers + */ + default ResponseEntity getNamespaceEnvRoleUsers(String appId, + String env, + String namespaceName) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"releaseRoleUsers\" : [ { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 }, { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 } ], \"appId\" : \"appId\", \"modifyRoleUsers\" : [ { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 }, { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 } ], \"env\" : \"env\", \"namespaceName\" : \"namespaceName\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /openapi/v1/apps/{appId}/namespaces/{namespaceName}/role-users : 获取Namespace用户 (new added) + * + * + * @param appId (required) + * @param namespaceName (required) + * @return (status code 200) + * @see PermissionManagementApi#getNamespaceRoles + */ + default ResponseEntity getNamespaceRoles(String appId, + String namespaceName) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"releaseRoleUsers\" : [ { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 }, { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 } ], \"appId\" : \"appId\", \"modifyRoleUsers\" : [ { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 }, { \"name\" : \"name\", \"userId\" : \"userId\", \"email\" : \"email\", \"enabled\" : 0 } ], \"namespaceName\" : \"namespaceName\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /openapi/v1/apps/{appId}/permissions/{permissionType} : 校验应用权限 (new added) + * + * + * @param appId (required) + * @param permissionType (required) + * @param userId (required) + * @return (status code 200) + * @see PermissionManagementApi#hasAppPermission + */ + default ResponseEntity hasAppPermission(String appId, + String permissionType, + String userId) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"hasPermission\" : true }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permissions/{permissionType} : 校验集群Namespace权限 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param permissionType (required) + * @param userId (required) + * @return (status code 200) + * @see PermissionManagementApi#hasClusterNamespacePermission + */ + default ResponseEntity hasClusterNamespacePermission(String appId, + String env, + String clusterName, + String permissionType, + String userId) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"hasPermission\" : true }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /openapi/v1/system/roles/create-application : 校验建应用权限 (new added) + * + * + * @param userId (required) + * @return (status code 200) + * @see PermissionManagementApi#hasCreateApplicationPermission + */ + default ResponseEntity> hasCreateApplicationPermission(String userId) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/permissions/{permissionType} : 校验环境Namespace权限 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param permissionType (required) + * @param userId (required) + * @return (status code 200) + * @see PermissionManagementApi#hasEnvNamespacePermission + */ + default ResponseEntity hasEnvNamespacePermission(String appId, + String env, + String namespaceName, + String permissionType, + String userId) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"hasPermission\" : true }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permissions/{permissionType} : 校验Namespace权限 (new added) + * + * + * @param appId (required) + * @param namespaceName (required) + * @param permissionType (required) + * @param userId (required) + * @return (status code 200) + * @see PermissionManagementApi#hasNamespacePermission + */ + default ResponseEntity hasNamespacePermission(String appId, + String namespaceName, + String permissionType, + String userId) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"hasPermission\" : true }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /openapi/v1/permissions/root : 校验Root权限 (new added) + * + * + * @param userId (required) + * @return (status code 200) + * @see PermissionManagementApi#hasRootPermission + */ + default ResponseEntity hasRootPermission(String userId) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"hasPermission\" : true }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init : 初始化应用权限 (new added) + * + * + * @param appId (required) + * @param namespaceName (required) + * @param operator 操作人用户名 (optional) + * @return 初始化成功 (status code 200) + * @see PermissionManagementApi#initAppPermission + */ + default ResponseEntity initAppPermission(String appId, + String namespaceName, + String operator) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * POST /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permission-init : 初始化集群Namespace权限 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + * @see PermissionManagementApi#initClusterNamespacePermission + */ + default ResponseEntity initClusterNamespacePermission(String appId, + String env, + String clusterName, + String operator) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * GET /openapi/v1/system/role/manage-app-master : 校验AppMaster开关 (new added) + * + * + * @return (status code 200) + * @see PermissionManagementApi#isManageAppMasterPermissionEnabled + */ + default ResponseEntity> isManageAppMasterPermissionEnabled() { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /openapi/v1/apps/{appId}/roles/{roleType} : 移除应用角色 (new added) + * + * + * @param appId (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + * @see PermissionManagementApi#removeAppRoleFromUser + */ + default ResponseEntity removeAppRoleFromUser(String appId, + String roleType, + String userId, + String operator) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType} : 移除集群Namespace角色 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param clusterName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + * @see PermissionManagementApi#removeClusterNamespaceRoleFromUser + */ + default ResponseEntity removeClusterNamespaceRoleFromUser(String appId, + String env, + String clusterName, + String roleType, + String userId, + String operator) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /openapi/v1/apps/{appId}/roles/master : 移除AppMaster (new added) + * + * + * @param appId (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + * @see PermissionManagementApi#removeManageAppMasterRoleFromUser + */ + default ResponseEntity removeManageAppMasterRoleFromUser(String appId, + String userId, + String operator) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType} : 移除环境Namespace角色 (new added) + * + * + * @param appId (required) + * @param env (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + * @see PermissionManagementApi#removeNamespaceEnvRoleFromUser + */ + default ResponseEntity removeNamespaceEnvRoleFromUser(String appId, + String env, + String namespaceName, + String roleType, + String userId, + String operator) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + /** + * DELETE /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType} : 移除Namespace角色 (new added) + * + * + * @param appId (required) + * @param namespaceName (required) + * @param roleType (required) + * @param userId the user which role removed from (required) + * @param operator 操作人用户名 (optional) + * @return (status code 200) + * @see PermissionManagementApi#removeNamespaceRoleFromUser + */ + default ResponseEntity removeNamespaceRoleFromUser(String appId, + String namespaceName, + String roleType, + String userId, + String operator) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/ReleaseManagementApi.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/ReleaseManagementApi.java index ba06f55..1d9092d 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/ReleaseManagementApi.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/ReleaseManagementApi.java @@ -8,8 +8,8 @@ import com.apollo.openapi.server.model.ExceptionResponse; import com.apollo.openapi.server.model.NamespaceGrayDelReleaseDTO; import com.apollo.openapi.server.model.NamespaceReleaseDTO; -import com.apollo.openapi.server.model.OpenReleaseBO; import com.apollo.openapi.server.model.OpenReleaseDTO; +import com.apollo.openapi.server.model.OpenReleaseDiffDTO; import io.swagger.v3.oas.annotations.ExternalDocumentation; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -41,6 +41,43 @@ default ReleaseManagementApiDelegate getDelegate() { return new ReleaseManagementApiDelegate() {}; } + /** + * GET /openapi/v1/envs/{env}/releases/comparison : Compare two releases + * Get the configuration differences between two releases. + * + * @param env Environment (required) + * @param baseReleaseId The base release ID (required) + * @param toCompareReleaseId The release ID to compare against (required) + * @return Successful comparison (status code 200) + */ + @Operation( + operationId = "compareRelease", + summary = "Compare two releases", + description = "Get the configuration differences between two releases.", + tags = { "Release Management" }, + responses = { + @ApiResponse(responseCode = "200", description = "Successful comparison", content = { + @Content(mediaType = "application/json", schema = @Schema(implementation = OpenReleaseDiffDTO.class)) + }) + }, + security = { + @SecurityRequirement(name = "ApiKeyAuth") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = "/openapi/v1/envs/{env}/releases/comparison", + produces = { "application/json" } + ) + default ResponseEntity compareRelease( + @Parameter(name = "env", description = "Environment", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, + @NotNull @Parameter(name = "baseReleaseId", description = "The base release ID", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "baseReleaseId", required = true) Long baseReleaseId, + @NotNull @Parameter(name = "toCompareReleaseId", description = "The release ID to compare against", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "toCompareReleaseId", required = true) Long toCompareReleaseId + ) { + return getDelegate().compareRelease(env, baseReleaseId, toCompareReleaseId); + } + + /** * POST /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/gray-del-releases : 创建灰度删除发布 (original openapi) * @@ -51,6 +88,7 @@ default ReleaseManagementApiDelegate getDelegate() { * @param namespaceName (required) * @param branchName (required) * @param namespaceGrayDelReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @return (status code 200) */ @Operation( @@ -79,9 +117,10 @@ default ResponseEntity createGrayDelRelease( @Parameter(name = "clusterName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("clusterName") String clusterName, @Parameter(name = "namespaceName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("namespaceName") String namespaceName, @Parameter(name = "branchName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("branchName") String branchName, - @Parameter(name = "NamespaceGrayDelReleaseDTO", description = "", required = true) @Valid @RequestBody NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO + @Parameter(name = "NamespaceGrayDelReleaseDTO", description = "", required = true) @Valid @RequestBody NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator ) { - return getDelegate().createGrayDelRelease(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO); + return getDelegate().createGrayDelRelease(appId, env, clusterName, namespaceName, branchName, namespaceGrayDelReleaseDTO, operator); } @@ -95,6 +134,7 @@ default ResponseEntity createGrayDelRelease( * @param namespaceName 命名空间名称 (required) * @param branchName 分支名称 (required) * @param namespaceReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @return 灰度发布创建成功 (status code 200) */ @Operation( @@ -123,9 +163,10 @@ default ResponseEntity createGrayRelease( @Parameter(name = "clusterName", description = "集群名称", required = true, in = ParameterIn.PATH) @PathVariable("clusterName") String clusterName, @Parameter(name = "namespaceName", description = "命名空间名称", required = true, in = ParameterIn.PATH) @PathVariable("namespaceName") String namespaceName, @Parameter(name = "branchName", description = "分支名称", required = true, in = ParameterIn.PATH) @PathVariable("branchName") String branchName, - @Parameter(name = "NamespaceReleaseDTO", description = "", required = true) @Valid @RequestBody NamespaceReleaseDTO namespaceReleaseDTO + @Parameter(name = "NamespaceReleaseDTO", description = "", required = true) @Valid @RequestBody NamespaceReleaseDTO namespaceReleaseDTO, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator ) { - return getDelegate().createGrayRelease(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO); + return getDelegate().createGrayRelease(appId, env, clusterName, namespaceName, branchName, namespaceReleaseDTO, operator); } @@ -138,6 +179,7 @@ default ResponseEntity createGrayRelease( * @param clusterName (required) * @param namespaceName 命名空间名称 (required) * @param namespaceReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @return 发布创建成功 (status code 200) * or 发布参数错误 (status code 400) * or 权限不足 (status code 403) @@ -173,9 +215,10 @@ default ResponseEntity createRelease( @Parameter(name = "env", description = "环境标识", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, @Parameter(name = "clusterName", description = "", required = true, in = ParameterIn.PATH) @PathVariable("clusterName") String clusterName, @Parameter(name = "namespaceName", description = "命名空间名称", required = true, in = ParameterIn.PATH) @PathVariable("namespaceName") String namespaceName, - @Parameter(name = "NamespaceReleaseDTO", description = "", required = true) @Valid @RequestBody NamespaceReleaseDTO namespaceReleaseDTO + @Parameter(name = "NamespaceReleaseDTO", description = "", required = true) @Valid @RequestBody NamespaceReleaseDTO namespaceReleaseDTO, + @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator ) { - return getDelegate().createRelease(appId, env, clusterName, namespaceName, namespaceReleaseDTO); + return getDelegate().createRelease(appId, env, clusterName, namespaceName, namespaceReleaseDTO, operator); } @@ -222,49 +265,6 @@ default ResponseEntity> findActiveReleases( } - /** - * GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all : 获取所有发布(分页) (new added) - * GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all - * - * @param appId 应用ID (required) - * @param env 环境标识 (required) - * @param clusterName 集群名称 (required) - * @param namespaceName 命名空间名称 (required) - * @param page 页码,从0开始 (required) - * @param size 每页数量 (required) - * @return 成功获取发布列表 (status code 200) - */ - @Operation( - operationId = "findAllReleases", - summary = "获取所有发布(分页) (new added)", - description = "GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all", - tags = { "Release Management" }, - responses = { - @ApiResponse(responseCode = "200", description = "成功获取发布列表", content = { - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = OpenReleaseBO.class))) - }) - }, - security = { - @SecurityRequirement(name = "ApiKeyAuth") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all", - produces = { "application/json" } - ) - default ResponseEntity> findAllReleases( - @Parameter(name = "appId", description = "应用ID", required = true, in = ParameterIn.PATH) @PathVariable("appId") String appId, - @Parameter(name = "env", description = "环境标识", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, - @Parameter(name = "clusterName", description = "集群名称", required = true, in = ParameterIn.PATH) @PathVariable("clusterName") String clusterName, - @Parameter(name = "namespaceName", description = "命名空间名称", required = true, in = ParameterIn.PATH) @PathVariable("namespaceName") String namespaceName, - @NotNull @Parameter(name = "page", description = "页码,从0开始", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "page", required = true) Integer page, - @NotNull @Parameter(name = "size", description = "每页数量", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "size", required = true) Integer size - ) { - return getDelegate().findAllReleases(appId, env, clusterName, namespaceName, page, size); - } - - /** * GET /openapi/v1/envs/{env}/releases/{releaseId} : 获取发布详情 (new added) * GET /openapi/v1/envs/{env}/releases/{releaseId} @@ -358,9 +358,7 @@ default ResponseEntity loadLatestActiveRelease( description = "回滚到指定的发布版本", tags = { "Release Management" }, responses = { - @ApiResponse(responseCode = "200", description = "发布回滚成功", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Object.class)) - }) + @ApiResponse(responseCode = "200", description = "发布回滚成功") }, security = { @SecurityRequirement(name = "ApiKeyAuth") @@ -368,10 +366,9 @@ default ResponseEntity loadLatestActiveRelease( ) @RequestMapping( method = RequestMethod.PUT, - value = "/openapi/v1/envs/{env}/releases/{releaseId}/rollback", - produces = { "application/json" } + value = "/openapi/v1/envs/{env}/releases/{releaseId}/rollback" ) - default ResponseEntity rollback( + default ResponseEntity rollback( @Parameter(name = "env", description = "环境标识", required = true, in = ParameterIn.PATH) @PathVariable("env") String env, @Parameter(name = "releaseId", description = "发布ID", required = true, in = ParameterIn.PATH) @PathVariable("releaseId") Long releaseId, @Parameter(name = "operator", description = "操作人用户名", in = ParameterIn.QUERY) @Valid @RequestParam(value = "operator", required = false) String operator diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/api/ReleaseManagementApiController.java b/spring-boot2/src/main/java/com/apollo/openapi/server/api/ReleaseManagementApiController.java index 0a666ff..6cbd8f4 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/api/ReleaseManagementApiController.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/api/ReleaseManagementApiController.java @@ -3,8 +3,8 @@ import com.apollo.openapi.server.model.ExceptionResponse; import com.apollo.openapi.server.model.NamespaceGrayDelReleaseDTO; import com.apollo.openapi.server.model.NamespaceReleaseDTO; -import com.apollo.openapi.server.model.OpenReleaseBO; import com.apollo.openapi.server.model.OpenReleaseDTO; +import com.apollo.openapi.server.model.OpenReleaseDiffDTO; import org.springframework.beans.factory.annotation.Autowired; 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 ad98a8c..ab41aa5 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 @@ -3,8 +3,8 @@ import com.apollo.openapi.server.model.ExceptionResponse; import com.apollo.openapi.server.model.NamespaceGrayDelReleaseDTO; import com.apollo.openapi.server.model.NamespaceReleaseDTO; -import com.apollo.openapi.server.model.OpenReleaseBO; import com.apollo.openapi.server.model.OpenReleaseDTO; +import com.apollo.openapi.server.model.OpenReleaseDiffDTO; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -27,6 +27,32 @@ default Optional getRequest() { return Optional.empty(); } + /** + * GET /openapi/v1/envs/{env}/releases/comparison : Compare two releases + * Get the configuration differences between two releases. + * + * @param env Environment (required) + * @param baseReleaseId The base release ID (required) + * @param toCompareReleaseId The release ID to compare against (required) + * @return Successful comparison (status code 200) + * @see ReleaseManagementApi#compareRelease + */ + default ResponseEntity compareRelease(String env, + Long baseReleaseId, + Long toCompareReleaseId) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"changes\" : [ { \"newValue\" : \"newValue\", \"changeType\" : \"changeType\", \"oldValue\" : \"oldValue\", \"key\" : \"key\" }, { \"newValue\" : \"newValue\", \"changeType\" : \"changeType\", \"oldValue\" : \"oldValue\", \"key\" : \"key\" } ] }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + /** * POST /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/branches/{branchName}/gray-del-releases : 创建灰度删除发布 (original openapi) * @@ -37,6 +63,7 @@ default Optional getRequest() { * @param namespaceName (required) * @param branchName (required) * @param namespaceGrayDelReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @return (status code 200) * @see ReleaseManagementApi#createGrayDelRelease */ @@ -45,7 +72,8 @@ default ResponseEntity createGrayDelRelease(String appId, String clusterName, String namespaceName, String branchName, - NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO) { + NamespaceGrayDelReleaseDTO namespaceGrayDelReleaseDTO, + String operator) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -69,6 +97,7 @@ default ResponseEntity createGrayDelRelease(String appId, * @param namespaceName 命名空间名称 (required) * @param branchName 分支名称 (required) * @param namespaceReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @return 灰度发布创建成功 (status code 200) * @see ReleaseManagementApi#createGrayRelease */ @@ -77,7 +106,8 @@ default ResponseEntity createGrayRelease(String appId, String clusterName, String namespaceName, String branchName, - NamespaceReleaseDTO namespaceReleaseDTO) { + NamespaceReleaseDTO namespaceReleaseDTO, + String operator) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -100,6 +130,7 @@ default ResponseEntity createGrayRelease(String appId, * @param clusterName (required) * @param namespaceName 命名空间名称 (required) * @param namespaceReleaseDTO (required) + * @param operator 操作人用户名 (optional) * @return 发布创建成功 (status code 200) * or 发布参数错误 (status code 400) * or 权限不足 (status code 403) @@ -109,7 +140,8 @@ default ResponseEntity createRelease(String appId, String env, String clusterName, String namespaceName, - NamespaceReleaseDTO namespaceReleaseDTO) { + NamespaceReleaseDTO namespaceReleaseDTO, + String operator) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -155,38 +187,6 @@ default ResponseEntity> findActiveReleases(String appId, } - /** - * GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all : 获取所有发布(分页) (new added) - * GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all - * - * @param appId 应用ID (required) - * @param env 环境标识 (required) - * @param clusterName 集群名称 (required) - * @param namespaceName 命名空间名称 (required) - * @param page 页码,从0开始 (required) - * @param size 每页数量 (required) - * @return 成功获取发布列表 (status code 200) - * @see ReleaseManagementApi#findAllReleases - */ - default ResponseEntity> findAllReleases(String appId, - String env, - String clusterName, - String namespaceName, - Integer page, - Integer size) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"baseInfo\" : { \"dataChangeCreatedTime\" : \"2025-09-29T12:34:56Z\", \"dataChangeLastModifiedBy\" : \"dataChangeLastModifiedBy\", \"configurations\" : { \"key\" : \"configurations\" }, \"appId\" : \"appId\", \"clusterName\" : \"clusterName\", \"dataChangeCreatedBy\" : \"dataChangeCreatedBy\", \"name\" : \"name\", \"comment\" : \"comment\", \"id\" : 0, \"dataChangeLastModifiedTime\" : \"2025-09-29T12:34:56Z\", \"namespaceName\" : \"namespaceName\" }, \"items\" : [ { \"value\" : \"value\", \"key\" : \"key\" }, { \"value\" : \"value\", \"key\" : \"key\" } ] }, { \"baseInfo\" : { \"dataChangeCreatedTime\" : \"2025-09-29T12:34:56Z\", \"dataChangeLastModifiedBy\" : \"dataChangeLastModifiedBy\", \"configurations\" : { \"key\" : \"configurations\" }, \"appId\" : \"appId\", \"clusterName\" : \"clusterName\", \"dataChangeCreatedBy\" : \"dataChangeCreatedBy\", \"name\" : \"name\", \"comment\" : \"comment\", \"id\" : 0, \"dataChangeLastModifiedTime\" : \"2025-09-29T12:34:56Z\", \"namespaceName\" : \"namespaceName\" }, \"items\" : [ { \"value\" : \"value\", \"key\" : \"key\" }, { \"value\" : \"value\", \"key\" : \"key\" } ] } ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - /** * GET /openapi/v1/envs/{env}/releases/{releaseId} : 获取发布详情 (new added) * GET /openapi/v1/envs/{env}/releases/{releaseId} @@ -250,7 +250,7 @@ default ResponseEntity loadLatestActiveRelease(String appId, * @return 发布回滚成功 (status code 200) * @see ReleaseManagementApi#rollback */ - default ResponseEntity rollback(String env, + default ResponseEntity rollback(String env, Long releaseId, String operator) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenAccessKeyDTO.java b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenAccessKeyDTO.java new file mode 100644 index 0000000..b71fbec --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenAccessKeyDTO.java @@ -0,0 +1,322 @@ +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; + +/** + * OpenAccessKeyDTO + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class OpenAccessKeyDTO { + + private String dataChangeCreatedBy; + + private String dataChangeLastModifiedBy; + + private String dataChangeCreatedByDisplayName; + + private String dataChangeLastModifiedByDisplayName; + + private String dataChangeCreatedTime; + + private String dataChangeLastModifiedTime; + + private Long id; + + private String secret; + + private String appId; + + private Integer mode; + + private Boolean enabled; + + public OpenAccessKeyDTO 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 OpenAccessKeyDTO 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 OpenAccessKeyDTO dataChangeCreatedByDisplayName(String dataChangeCreatedByDisplayName) { + this.dataChangeCreatedByDisplayName = dataChangeCreatedByDisplayName; + return this; + } + + /** + * + * @return dataChangeCreatedByDisplayName + */ + + @Schema(name = "dataChangeCreatedByDisplayName", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dataChangeCreatedByDisplayName") + public String getDataChangeCreatedByDisplayName() { + return dataChangeCreatedByDisplayName; + } + + public void setDataChangeCreatedByDisplayName(String dataChangeCreatedByDisplayName) { + this.dataChangeCreatedByDisplayName = dataChangeCreatedByDisplayName; + } + + public OpenAccessKeyDTO dataChangeLastModifiedByDisplayName(String dataChangeLastModifiedByDisplayName) { + this.dataChangeLastModifiedByDisplayName = dataChangeLastModifiedByDisplayName; + return this; + } + + /** + * + * @return dataChangeLastModifiedByDisplayName + */ + + @Schema(name = "dataChangeLastModifiedByDisplayName", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dataChangeLastModifiedByDisplayName") + public String getDataChangeLastModifiedByDisplayName() { + return dataChangeLastModifiedByDisplayName; + } + + public void setDataChangeLastModifiedByDisplayName(String dataChangeLastModifiedByDisplayName) { + this.dataChangeLastModifiedByDisplayName = dataChangeLastModifiedByDisplayName; + } + + public OpenAccessKeyDTO dataChangeCreatedTime(String dataChangeCreatedTime) { + this.dataChangeCreatedTime = dataChangeCreatedTime; + return this; + } + + /** + * + * @return dataChangeCreatedTime + */ + + @Schema(name = "dataChangeCreatedTime", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dataChangeCreatedTime") + public String getDataChangeCreatedTime() { + return dataChangeCreatedTime; + } + + public void setDataChangeCreatedTime(String dataChangeCreatedTime) { + this.dataChangeCreatedTime = dataChangeCreatedTime; + } + + public OpenAccessKeyDTO dataChangeLastModifiedTime(String dataChangeLastModifiedTime) { + this.dataChangeLastModifiedTime = dataChangeLastModifiedTime; + return this; + } + + /** + * + * @return dataChangeLastModifiedTime + */ + + @Schema(name = "dataChangeLastModifiedTime", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("dataChangeLastModifiedTime") + public String getDataChangeLastModifiedTime() { + return dataChangeLastModifiedTime; + } + + public void setDataChangeLastModifiedTime(String dataChangeLastModifiedTime) { + this.dataChangeLastModifiedTime = dataChangeLastModifiedTime; + } + + public OpenAccessKeyDTO id(Long id) { + this.id = id; + return this; + } + + /** + * + * @return id + */ + + @Schema(name = "id", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public OpenAccessKeyDTO secret(String secret) { + this.secret = secret; + return this; + } + + /** + * + * @return secret + */ + + @Schema(name = "secret", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("secret") + public String getSecret() { + return secret; + } + + public void setSecret(String secret) { + this.secret = secret; + } + + public OpenAccessKeyDTO appId(String appId) { + this.appId = appId; + return this; + } + + /** + * + * @return appId + */ + + @Schema(name = "appId", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("appId") + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public OpenAccessKeyDTO mode(Integer mode) { + this.mode = mode; + return this; + } + + /** + * + * @return mode + */ + + @Schema(name = "mode", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("mode") + public Integer getMode() { + return mode; + } + + public void setMode(Integer mode) { + this.mode = mode; + } + + public OpenAccessKeyDTO enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * + * @return enabled + */ + + @Schema(name = "enabled", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enabled") + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenAccessKeyDTO openAccessKeyDTO = (OpenAccessKeyDTO) o; + return Objects.equals(this.dataChangeCreatedBy, openAccessKeyDTO.dataChangeCreatedBy) && + Objects.equals(this.dataChangeLastModifiedBy, openAccessKeyDTO.dataChangeLastModifiedBy) && + Objects.equals(this.dataChangeCreatedByDisplayName, openAccessKeyDTO.dataChangeCreatedByDisplayName) && + Objects.equals(this.dataChangeLastModifiedByDisplayName, openAccessKeyDTO.dataChangeLastModifiedByDisplayName) && + Objects.equals(this.dataChangeCreatedTime, openAccessKeyDTO.dataChangeCreatedTime) && + Objects.equals(this.dataChangeLastModifiedTime, openAccessKeyDTO.dataChangeLastModifiedTime) && + Objects.equals(this.id, openAccessKeyDTO.id) && + Objects.equals(this.secret, openAccessKeyDTO.secret) && + Objects.equals(this.appId, openAccessKeyDTO.appId) && + Objects.equals(this.mode, openAccessKeyDTO.mode) && + Objects.equals(this.enabled, openAccessKeyDTO.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(dataChangeCreatedBy, dataChangeLastModifiedBy, dataChangeCreatedByDisplayName, dataChangeLastModifiedByDisplayName, dataChangeCreatedTime, dataChangeLastModifiedTime, id, secret, appId, mode, enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenAccessKeyDTO {\n"); + sb.append(" dataChangeCreatedBy: ").append(toIndentedString(dataChangeCreatedBy)).append("\n"); + sb.append(" dataChangeLastModifiedBy: ").append(toIndentedString(dataChangeLastModifiedBy)).append("\n"); + sb.append(" dataChangeCreatedByDisplayName: ").append(toIndentedString(dataChangeCreatedByDisplayName)).append("\n"); + sb.append(" dataChangeLastModifiedByDisplayName: ").append(toIndentedString(dataChangeLastModifiedByDisplayName)).append("\n"); + sb.append(" dataChangeCreatedTime: ").append(toIndentedString(dataChangeCreatedTime)).append("\n"); + sb.append(" dataChangeLastModifiedTime: ").append(toIndentedString(dataChangeLastModifiedTime)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).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/OpenAppRoleUserDTO.java b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenAppRoleUserDTO.java new file mode 100644 index 0000000..60a3024 --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenAppRoleUserDTO.java @@ -0,0 +1,118 @@ +package com.apollo.openapi.server.model; + +import java.net.URI; +import java.util.Objects; +import com.apollo.openapi.server.model.OpenUserInfoDTO; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.List; +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; + +/** + * OpenAppRoleUserDTO + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class OpenAppRoleUserDTO { + + private String appId; + + @Valid + private List<@Valid OpenUserInfoDTO> masterUsers; + + public OpenAppRoleUserDTO appId(String appId) { + this.appId = appId; + return this; + } + + /** + * + * @return appId + */ + + @Schema(name = "appId", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("appId") + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public OpenAppRoleUserDTO masterUsers(List<@Valid OpenUserInfoDTO> masterUsers) { + this.masterUsers = masterUsers; + return this; + } + + public OpenAppRoleUserDTO addMasterUsersItem(OpenUserInfoDTO masterUsersItem) { + if (this.masterUsers == null) { + this.masterUsers = new ArrayList<>(); + } + this.masterUsers.add(masterUsersItem); + return this; + } + + /** + * + * @return masterUsers + */ + @Valid + @Schema(name = "masterUsers", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("masterUsers") + public List<@Valid OpenUserInfoDTO> getMasterUsers() { + return masterUsers; + } + + public void setMasterUsers(List<@Valid OpenUserInfoDTO> masterUsers) { + this.masterUsers = masterUsers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenAppRoleUserDTO openAppRoleUserDTO = (OpenAppRoleUserDTO) o; + return Objects.equals(this.appId, openAppRoleUserDTO.appId) && + Objects.equals(this.masterUsers, openAppRoleUserDTO.masterUsers); + } + + @Override + public int hashCode() { + return Objects.hash(appId, masterUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenAppRoleUserDTO {\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" masterUsers: ").append(toIndentedString(masterUsers)).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/OpenClusterNamespaceRoleUserDTO.java b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenClusterNamespaceRoleUserDTO.java new file mode 100644 index 0000000..c81f59e --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenClusterNamespaceRoleUserDTO.java @@ -0,0 +1,199 @@ +package com.apollo.openapi.server.model; + +import java.net.URI; +import java.util.Objects; +import com.apollo.openapi.server.model.OpenUserInfoDTO; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.List; +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; + +/** + * OpenClusterNamespaceRoleUserDTO + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class OpenClusterNamespaceRoleUserDTO { + + private String appId; + + private String env; + + private String cluster; + + @Valid + private List<@Valid OpenUserInfoDTO> modifyRoleUsers; + + @Valid + private List<@Valid OpenUserInfoDTO> releaseRoleUsers; + + public OpenClusterNamespaceRoleUserDTO appId(String appId) { + this.appId = appId; + return this; + } + + /** + * + * @return appId + */ + + @Schema(name = "appId", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("appId") + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public OpenClusterNamespaceRoleUserDTO env(String env) { + this.env = env; + return this; + } + + /** + * + * @return env + */ + + @Schema(name = "env", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("env") + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + public OpenClusterNamespaceRoleUserDTO cluster(String cluster) { + this.cluster = cluster; + return this; + } + + /** + * + * @return cluster + */ + + @Schema(name = "cluster", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("cluster") + public String getCluster() { + return cluster; + } + + public void setCluster(String cluster) { + this.cluster = cluster; + } + + public OpenClusterNamespaceRoleUserDTO modifyRoleUsers(List<@Valid OpenUserInfoDTO> modifyRoleUsers) { + this.modifyRoleUsers = modifyRoleUsers; + return this; + } + + public OpenClusterNamespaceRoleUserDTO addModifyRoleUsersItem(OpenUserInfoDTO modifyRoleUsersItem) { + if (this.modifyRoleUsers == null) { + this.modifyRoleUsers = new ArrayList<>(); + } + this.modifyRoleUsers.add(modifyRoleUsersItem); + return this; + } + + /** + * + * @return modifyRoleUsers + */ + @Valid + @Schema(name = "modifyRoleUsers", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("modifyRoleUsers") + public List<@Valid OpenUserInfoDTO> getModifyRoleUsers() { + return modifyRoleUsers; + } + + public void setModifyRoleUsers(List<@Valid OpenUserInfoDTO> modifyRoleUsers) { + this.modifyRoleUsers = modifyRoleUsers; + } + + public OpenClusterNamespaceRoleUserDTO releaseRoleUsers(List<@Valid OpenUserInfoDTO> releaseRoleUsers) { + this.releaseRoleUsers = releaseRoleUsers; + return this; + } + + public OpenClusterNamespaceRoleUserDTO addReleaseRoleUsersItem(OpenUserInfoDTO releaseRoleUsersItem) { + if (this.releaseRoleUsers == null) { + this.releaseRoleUsers = new ArrayList<>(); + } + this.releaseRoleUsers.add(releaseRoleUsersItem); + return this; + } + + /** + * + * @return releaseRoleUsers + */ + @Valid + @Schema(name = "releaseRoleUsers", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("releaseRoleUsers") + public List<@Valid OpenUserInfoDTO> getReleaseRoleUsers() { + return releaseRoleUsers; + } + + public void setReleaseRoleUsers(List<@Valid OpenUserInfoDTO> releaseRoleUsers) { + this.releaseRoleUsers = releaseRoleUsers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenClusterNamespaceRoleUserDTO openClusterNamespaceRoleUserDTO = (OpenClusterNamespaceRoleUserDTO) o; + return Objects.equals(this.appId, openClusterNamespaceRoleUserDTO.appId) && + Objects.equals(this.env, openClusterNamespaceRoleUserDTO.env) && + Objects.equals(this.cluster, openClusterNamespaceRoleUserDTO.cluster) && + Objects.equals(this.modifyRoleUsers, openClusterNamespaceRoleUserDTO.modifyRoleUsers) && + Objects.equals(this.releaseRoleUsers, openClusterNamespaceRoleUserDTO.releaseRoleUsers); + } + + @Override + public int hashCode() { + return Objects.hash(appId, env, cluster, modifyRoleUsers, releaseRoleUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenClusterNamespaceRoleUserDTO {\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" cluster: ").append(toIndentedString(cluster)).append("\n"); + sb.append(" modifyRoleUsers: ").append(toIndentedString(modifyRoleUsers)).append("\n"); + sb.append(" releaseRoleUsers: ").append(toIndentedString(releaseRoleUsers)).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/OpenEnvNamespaceRoleUserDTO.java b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenEnvNamespaceRoleUserDTO.java new file mode 100644 index 0000000..c32182b --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenEnvNamespaceRoleUserDTO.java @@ -0,0 +1,199 @@ +package com.apollo.openapi.server.model; + +import java.net.URI; +import java.util.Objects; +import com.apollo.openapi.server.model.OpenUserInfoDTO; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.List; +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; + +/** + * OpenEnvNamespaceRoleUserDTO + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class OpenEnvNamespaceRoleUserDTO { + + private String appId; + + private String namespaceName; + + @Valid + private List<@Valid OpenUserInfoDTO> modifyRoleUsers; + + @Valid + private List<@Valid OpenUserInfoDTO> releaseRoleUsers; + + private String env; + + public OpenEnvNamespaceRoleUserDTO appId(String appId) { + this.appId = appId; + return this; + } + + /** + * + * @return appId + */ + + @Schema(name = "appId", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("appId") + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public OpenEnvNamespaceRoleUserDTO namespaceName(String namespaceName) { + this.namespaceName = namespaceName; + return this; + } + + /** + * + * @return namespaceName + */ + + @Schema(name = "namespaceName", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespaceName") + public String getNamespaceName() { + return namespaceName; + } + + public void setNamespaceName(String namespaceName) { + this.namespaceName = namespaceName; + } + + public OpenEnvNamespaceRoleUserDTO modifyRoleUsers(List<@Valid OpenUserInfoDTO> modifyRoleUsers) { + this.modifyRoleUsers = modifyRoleUsers; + return this; + } + + public OpenEnvNamespaceRoleUserDTO addModifyRoleUsersItem(OpenUserInfoDTO modifyRoleUsersItem) { + if (this.modifyRoleUsers == null) { + this.modifyRoleUsers = new ArrayList<>(); + } + this.modifyRoleUsers.add(modifyRoleUsersItem); + return this; + } + + /** + * + * @return modifyRoleUsers + */ + @Valid + @Schema(name = "modifyRoleUsers", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("modifyRoleUsers") + public List<@Valid OpenUserInfoDTO> getModifyRoleUsers() { + return modifyRoleUsers; + } + + public void setModifyRoleUsers(List<@Valid OpenUserInfoDTO> modifyRoleUsers) { + this.modifyRoleUsers = modifyRoleUsers; + } + + public OpenEnvNamespaceRoleUserDTO releaseRoleUsers(List<@Valid OpenUserInfoDTO> releaseRoleUsers) { + this.releaseRoleUsers = releaseRoleUsers; + return this; + } + + public OpenEnvNamespaceRoleUserDTO addReleaseRoleUsersItem(OpenUserInfoDTO releaseRoleUsersItem) { + if (this.releaseRoleUsers == null) { + this.releaseRoleUsers = new ArrayList<>(); + } + this.releaseRoleUsers.add(releaseRoleUsersItem); + return this; + } + + /** + * + * @return releaseRoleUsers + */ + @Valid + @Schema(name = "releaseRoleUsers", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("releaseRoleUsers") + public List<@Valid OpenUserInfoDTO> getReleaseRoleUsers() { + return releaseRoleUsers; + } + + public void setReleaseRoleUsers(List<@Valid OpenUserInfoDTO> releaseRoleUsers) { + this.releaseRoleUsers = releaseRoleUsers; + } + + public OpenEnvNamespaceRoleUserDTO env(String env) { + this.env = env; + return this; + } + + /** + * + * @return env + */ + + @Schema(name = "env", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("env") + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenEnvNamespaceRoleUserDTO openEnvNamespaceRoleUserDTO = (OpenEnvNamespaceRoleUserDTO) o; + return Objects.equals(this.appId, openEnvNamespaceRoleUserDTO.appId) && + Objects.equals(this.namespaceName, openEnvNamespaceRoleUserDTO.namespaceName) && + Objects.equals(this.modifyRoleUsers, openEnvNamespaceRoleUserDTO.modifyRoleUsers) && + Objects.equals(this.releaseRoleUsers, openEnvNamespaceRoleUserDTO.releaseRoleUsers) && + Objects.equals(this.env, openEnvNamespaceRoleUserDTO.env); + } + + @Override + public int hashCode() { + return Objects.hash(appId, namespaceName, modifyRoleUsers, releaseRoleUsers, env); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenEnvNamespaceRoleUserDTO {\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" namespaceName: ").append(toIndentedString(namespaceName)).append("\n"); + sb.append(" modifyRoleUsers: ").append(toIndentedString(modifyRoleUsers)).append("\n"); + sb.append(" releaseRoleUsers: ").append(toIndentedString(releaseRoleUsers)).append("\n"); + sb.append(" env: ").append(toIndentedString(env)).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/OpenNamespaceRoleUserDTO.java b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenNamespaceRoleUserDTO.java new file mode 100644 index 0000000..152d931 --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenNamespaceRoleUserDTO.java @@ -0,0 +1,175 @@ +package com.apollo.openapi.server.model; + +import java.net.URI; +import java.util.Objects; +import com.apollo.openapi.server.model.OpenUserInfoDTO; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.List; +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; + +/** + * OpenNamespaceRoleUserDTO + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class OpenNamespaceRoleUserDTO { + + private String appId; + + private String namespaceName; + + @Valid + private List<@Valid OpenUserInfoDTO> modifyRoleUsers; + + @Valid + private List<@Valid OpenUserInfoDTO> releaseRoleUsers; + + public OpenNamespaceRoleUserDTO appId(String appId) { + this.appId = appId; + return this; + } + + /** + * + * @return appId + */ + + @Schema(name = "appId", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("appId") + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public OpenNamespaceRoleUserDTO namespaceName(String namespaceName) { + this.namespaceName = namespaceName; + return this; + } + + /** + * + * @return namespaceName + */ + + @Schema(name = "namespaceName", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("namespaceName") + public String getNamespaceName() { + return namespaceName; + } + + public void setNamespaceName(String namespaceName) { + this.namespaceName = namespaceName; + } + + public OpenNamespaceRoleUserDTO modifyRoleUsers(List<@Valid OpenUserInfoDTO> modifyRoleUsers) { + this.modifyRoleUsers = modifyRoleUsers; + return this; + } + + public OpenNamespaceRoleUserDTO addModifyRoleUsersItem(OpenUserInfoDTO modifyRoleUsersItem) { + if (this.modifyRoleUsers == null) { + this.modifyRoleUsers = new ArrayList<>(); + } + this.modifyRoleUsers.add(modifyRoleUsersItem); + return this; + } + + /** + * + * @return modifyRoleUsers + */ + @Valid + @Schema(name = "modifyRoleUsers", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("modifyRoleUsers") + public List<@Valid OpenUserInfoDTO> getModifyRoleUsers() { + return modifyRoleUsers; + } + + public void setModifyRoleUsers(List<@Valid OpenUserInfoDTO> modifyRoleUsers) { + this.modifyRoleUsers = modifyRoleUsers; + } + + public OpenNamespaceRoleUserDTO releaseRoleUsers(List<@Valid OpenUserInfoDTO> releaseRoleUsers) { + this.releaseRoleUsers = releaseRoleUsers; + return this; + } + + public OpenNamespaceRoleUserDTO addReleaseRoleUsersItem(OpenUserInfoDTO releaseRoleUsersItem) { + if (this.releaseRoleUsers == null) { + this.releaseRoleUsers = new ArrayList<>(); + } + this.releaseRoleUsers.add(releaseRoleUsersItem); + return this; + } + + /** + * + * @return releaseRoleUsers + */ + @Valid + @Schema(name = "releaseRoleUsers", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("releaseRoleUsers") + public List<@Valid OpenUserInfoDTO> getReleaseRoleUsers() { + return releaseRoleUsers; + } + + public void setReleaseRoleUsers(List<@Valid OpenUserInfoDTO> releaseRoleUsers) { + this.releaseRoleUsers = releaseRoleUsers; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenNamespaceRoleUserDTO openNamespaceRoleUserDTO = (OpenNamespaceRoleUserDTO) o; + return Objects.equals(this.appId, openNamespaceRoleUserDTO.appId) && + Objects.equals(this.namespaceName, openNamespaceRoleUserDTO.namespaceName) && + Objects.equals(this.modifyRoleUsers, openNamespaceRoleUserDTO.modifyRoleUsers) && + Objects.equals(this.releaseRoleUsers, openNamespaceRoleUserDTO.releaseRoleUsers); + } + + @Override + public int hashCode() { + return Objects.hash(appId, namespaceName, modifyRoleUsers, releaseRoleUsers); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenNamespaceRoleUserDTO {\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" namespaceName: ").append(toIndentedString(namespaceName)).append("\n"); + sb.append(" modifyRoleUsers: ").append(toIndentedString(modifyRoleUsers)).append("\n"); + sb.append(" releaseRoleUsers: ").append(toIndentedString(releaseRoleUsers)).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/KVEntity.java b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenPermissionConditionDTO.java similarity index 52% rename from spring-boot2/src/main/java/com/apollo/openapi/server/model/KVEntity.java rename to spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenPermissionConditionDTO.java index eee0e1c..890c2a5 100644 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/model/KVEntity.java +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenPermissionConditionDTO.java @@ -15,54 +15,32 @@ import javax.annotation.Generated; /** - * KVEntity + * OpenPermissionConditionDTO */ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class KVEntity { +public class OpenPermissionConditionDTO { - private String key; + private Boolean hasPermission; - private String value; - - public KVEntity key(String key) { - this.key = key; - return this; - } - - /** - * 键 - * @return key - */ - - @Schema(name = "key", description = "键", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("key") - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public KVEntity value(String value) { - this.value = value; + public OpenPermissionConditionDTO hasPermission(Boolean hasPermission) { + this.hasPermission = hasPermission; return this; } /** - * 值 - * @return value + * + * @return hasPermission */ - @Schema(name = "value", description = "值", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("value") - public String getValue() { - return value; + @Schema(name = "hasPermission", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("hasPermission") + public Boolean getHasPermission() { + return hasPermission; } - public void setValue(String value) { - this.value = value; + public void setHasPermission(Boolean hasPermission) { + this.hasPermission = hasPermission; } @Override @@ -73,22 +51,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - KVEntity kvEntity = (KVEntity) o; - return Objects.equals(this.key, kvEntity.key) && - Objects.equals(this.value, kvEntity.value); + OpenPermissionConditionDTO openPermissionConditionDTO = (OpenPermissionConditionDTO) o; + return Objects.equals(this.hasPermission, openPermissionConditionDTO.hasPermission); } @Override public int hashCode() { - return Objects.hash(key, value); + return Objects.hash(hasPermission); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class KVEntity {\n"); - sb.append(" key: ").append(toIndentedString(key)).append("\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("class OpenPermissionConditionDTO {\n"); + sb.append(" hasPermission: ").append(toIndentedString(hasPermission)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenReleaseBO.java b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenReleaseBO.java deleted file mode 100644 index 1a2a395..0000000 --- a/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenReleaseBO.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.apollo.openapi.server.model; - -import java.net.URI; -import java.util.Objects; -import com.apollo.openapi.server.model.KVEntity; -import com.apollo.openapi.server.model.OpenReleaseDTO; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.List; -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; - -/** - * OpenReleaseBO - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OpenReleaseBO { - - private OpenReleaseDTO baseInfo; - - @Valid - private List<@Valid KVEntity> items; - - public OpenReleaseBO baseInfo(OpenReleaseDTO baseInfo) { - this.baseInfo = baseInfo; - return this; - } - - /** - * Get baseInfo - * @return baseInfo - */ - @Valid - @Schema(name = "baseInfo", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("baseInfo") - public OpenReleaseDTO getBaseInfo() { - return baseInfo; - } - - public void setBaseInfo(OpenReleaseDTO baseInfo) { - this.baseInfo = baseInfo; - } - - public OpenReleaseBO items(List<@Valid KVEntity> items) { - this.items = items; - return this; - } - - public OpenReleaseBO addItemsItem(KVEntity itemsItem) { - if (this.items == null) { - this.items = new ArrayList<>(); - } - this.items.add(itemsItem); - return this; - } - - /** - * Get items - * @return items - */ - @Valid - @Schema(name = "items", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("items") - public List<@Valid KVEntity> getItems() { - return items; - } - - public void setItems(List<@Valid KVEntity> items) { - this.items = items; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OpenReleaseBO openReleaseBO = (OpenReleaseBO) o; - return Objects.equals(this.baseInfo, openReleaseBO.baseInfo) && - Objects.equals(this.items, openReleaseBO.items); - } - - @Override - public int hashCode() { - return Objects.hash(baseInfo, items); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OpenReleaseBO {\n"); - sb.append(" baseInfo: ").append(toIndentedString(baseInfo)).append("\n"); - sb.append(" items: ").append(toIndentedString(items)).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/OpenReleaseChangeDTO.java b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenReleaseChangeDTO.java new file mode 100644 index 0000000..cf057c6 --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenReleaseChangeDTO.java @@ -0,0 +1,154 @@ +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; + +/** + * OpenReleaseChangeDTO + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class OpenReleaseChangeDTO { + + private String changeType; + + private String key; + + private String newValue; + + private String oldValue; + + public OpenReleaseChangeDTO changeType(String changeType) { + this.changeType = changeType; + return this; + } + + /** + * 修改类型 + * @return changeType + */ + + @Schema(name = "changeType", description = "修改类型", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("changeType") + public String getChangeType() { + return changeType; + } + + public void setChangeType(String changeType) { + this.changeType = changeType; + } + + public OpenReleaseChangeDTO key(String key) { + this.key = key; + return this; + } + + /** + * key + * @return key + */ + + @Schema(name = "key", description = "key", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("key") + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public OpenReleaseChangeDTO newValue(String newValue) { + this.newValue = newValue; + return this; + } + + /** + * new value + * @return newValue + */ + + @Schema(name = "newValue", description = "new value", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("newValue") + public String getNewValue() { + return newValue; + } + + public void setNewValue(String newValue) { + this.newValue = newValue; + } + + public OpenReleaseChangeDTO oldValue(String oldValue) { + this.oldValue = oldValue; + return this; + } + + /** + * old value + * @return oldValue + */ + + @Schema(name = "oldValue", description = "old value", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("oldValue") + public String getOldValue() { + return oldValue; + } + + public void setOldValue(String oldValue) { + this.oldValue = oldValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenReleaseChangeDTO openReleaseChangeDTO = (OpenReleaseChangeDTO) o; + return Objects.equals(this.changeType, openReleaseChangeDTO.changeType) && + Objects.equals(this.key, openReleaseChangeDTO.key) && + Objects.equals(this.newValue, openReleaseChangeDTO.newValue) && + Objects.equals(this.oldValue, openReleaseChangeDTO.oldValue); + } + + @Override + public int hashCode() { + return Objects.hash(changeType, key, newValue, oldValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenReleaseChangeDTO {\n"); + sb.append(" changeType: ").append(toIndentedString(changeType)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" newValue: ").append(toIndentedString(newValue)).append("\n"); + sb.append(" oldValue: ").append(toIndentedString(oldValue)).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/OpenReleaseDiffDTO.java b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenReleaseDiffDTO.java new file mode 100644 index 0000000..9c299dd --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenReleaseDiffDTO.java @@ -0,0 +1,94 @@ +package com.apollo.openapi.server.model; + +import java.net.URI; +import java.util.Objects; +import com.apollo.openapi.server.model.OpenReleaseChangeDTO; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.List; +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; + +/** + * OpenReleaseDiffDTO + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class OpenReleaseDiffDTO { + + @Valid + private List<@Valid OpenReleaseChangeDTO> changes; + + public OpenReleaseDiffDTO changes(List<@Valid OpenReleaseChangeDTO> changes) { + this.changes = changes; + return this; + } + + public OpenReleaseDiffDTO addChangesItem(OpenReleaseChangeDTO changesItem) { + if (this.changes == null) { + this.changes = new ArrayList<>(); + } + this.changes.add(changesItem); + return this; + } + + /** + * A list of changes, ensuring order if necessary. + * @return changes + */ + @Valid + @Schema(name = "changes", description = "A list of changes, ensuring order if necessary.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("changes") + public List<@Valid OpenReleaseChangeDTO> getChanges() { + return changes; + } + + public void setChanges(List<@Valid OpenReleaseChangeDTO> changes) { + this.changes = changes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenReleaseDiffDTO openReleaseDiffDTO = (OpenReleaseDiffDTO) o; + return Objects.equals(this.changes, openReleaseDiffDTO.changes); + } + + @Override + public int hashCode() { + return Objects.hash(changes); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenReleaseDiffDTO {\n"); + sb.append(" changes: ").append(toIndentedString(changes)).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/OpenUserInfoDTO.java b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenUserInfoDTO.java new file mode 100644 index 0000000..be847be --- /dev/null +++ b/spring-boot2/src/main/java/com/apollo/openapi/server/model/OpenUserInfoDTO.java @@ -0,0 +1,154 @@ +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; + +/** + * OpenUserInfoDTO + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class OpenUserInfoDTO { + + private String userId; + + private String name; + + private String email; + + private Integer enabled; + + public OpenUserInfoDTO userId(String userId) { + this.userId = userId; + return this; + } + + /** + * + * @return userId + */ + + @Schema(name = "userId", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("userId") + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public OpenUserInfoDTO 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 OpenUserInfoDTO email(String email) { + this.email = email; + return this; + } + + /** + * + * @return email + */ + + @Schema(name = "email", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("email") + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public OpenUserInfoDTO enabled(Integer enabled) { + this.enabled = enabled; + return this; + } + + /** + * + * @return enabled + */ + + @Schema(name = "enabled", description = "", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("enabled") + public Integer getEnabled() { + return enabled; + } + + public void setEnabled(Integer enabled) { + this.enabled = enabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpenUserInfoDTO openUserInfoDTO = (OpenUserInfoDTO) o; + return Objects.equals(this.userId, openUserInfoDTO.userId) && + Objects.equals(this.name, openUserInfoDTO.name) && + Objects.equals(this.email, openUserInfoDTO.email) && + Objects.equals(this.enabled, openUserInfoDTO.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(userId, name, email, enabled); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpenUserInfoDTO {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).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 0f10ebf..c38f4a3 100644 --- a/spring-boot2/src/main/resources/openapi.yaml +++ b/spring-boot2/src/main/resources/openapi.yaml @@ -45,6 +45,8 @@ tags: name: Organization Management - description: 环境管理相关接口,包括环境查询等功能 name: Environment Management +- description: 权限管理相关接口,包括权限查询等功能 + name: Permission Management paths: /openapi/v1/apps: get: @@ -257,10 +259,6 @@ paths: style: form responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' description: 应用删除成功 "403": content: @@ -352,10 +350,6 @@ paths: required: true responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' description: 应用更新成功 "400": content: @@ -517,10 +511,6 @@ paths: required: true responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' description: 应用在指定环境创建成功 "400": content: @@ -1748,10 +1738,6 @@ paths: style: form responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' description: 集群删除成功 "400": content: @@ -1930,6 +1916,14 @@ paths: schema: type: string style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form requestBody: content: application/json: @@ -2199,6 +2193,14 @@ paths: schema: type: string style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form requestBody: content: application/json: @@ -2279,6 +2281,14 @@ paths: schema: type: string style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form requestBody: content: application/json: @@ -2346,10 +2356,6 @@ paths: style: form responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' description: 发布回滚成功 summary: 回滚发布 (original openapi) tags: @@ -2406,11 +2412,11 @@ paths: x-accepts: application/json x-tags: - tag: Release Management - /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all: + /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active: get: deprecated: false - description: "GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all" - operationId: findAllReleases + description: "GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active" + operationId: findActiveReleases parameters: - description: 应用ID explode: false @@ -2467,51 +2473,36 @@ paths: content: application/json: example: - - baseInfo: - dataChangeCreatedBy: "" - dataChangeLastModifiedBy: "" - dataChangeCreatedByDisplayName: "" - dataChangeLastModifiedByDisplayName: "" - dataChangeCreatedTime: "" - dataChangeLastModifiedTime: "" - id: 0 - releaseKey: "" - name: "" - appId: "" - clusterName: "" - namespaceName: "" - configurations: "" - comment: "" - isAbandoned: false - items: - - key: "" - value: "" + - dataChangeCreatedBy: "" + dataChangeLastModifiedBy: "" + dataChangeCreatedTime: "" + dataChangeLastModifiedTime: "" + id: 0 + appId: "" + clusterName: "" + namespaceName: "" + name: "" + configurations: + ? "" + : "" + comment: "" schema: items: - $ref: '#/components/schemas/OpenReleaseBO' + $ref: '#/components/schemas/OpenReleaseDTO' type: array - description: 成功获取发布列表 - summary: 获取所有发布(分页) (new added) + description: 成功获取活跃发布列表 + summary: 获取活跃发布(分页) (new added) tags: - Release Management x-accepts: application/json x-tags: - tag: Release Management - /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active: + /openapi/v1/envs/{env}/releases/comparison: get: - deprecated: false - description: "GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active" - operationId: findActiveReleases + description: Get the configuration differences between two releases. + operationId: compareRelease parameters: - - description: 应用ID - explode: false - in: path - name: appId - required: true - schema: - type: string - style: simple - - description: 环境标识 + - description: Environment explode: false in: path name: env @@ -2519,64 +2510,32 @@ paths: schema: type: string style: simple - - description: 集群名称 - explode: false - in: path - name: clusterName - required: true - schema: - type: string - style: simple - - description: 命名空间名称 - explode: false - in: path - name: namespaceName - required: true - schema: - type: string - style: simple - - description: 页码,从0开始 - example: 0 + - description: The base release ID explode: true in: query - name: page + name: baseReleaseId required: true schema: + format: int64 type: integer style: form - - description: 每页数量 - example: 5 + - description: The release ID to compare against explode: true in: query - name: size + name: toCompareReleaseId required: true schema: + format: int64 type: integer style: form responses: "200": content: application/json: - example: - - dataChangeCreatedBy: "" - dataChangeLastModifiedBy: "" - dataChangeCreatedTime: "" - dataChangeLastModifiedTime: "" - id: 0 - appId: "" - clusterName: "" - namespaceName: "" - name: "" - configurations: - ? "" - : "" - comment: "" schema: - items: - $ref: '#/components/schemas/OpenReleaseDTO' - type: array - description: 成功获取活跃发布列表 - summary: 获取活跃发布(分页) (new added) + $ref: '#/components/schemas/OpenReleaseDiffDTO' + description: Successful comparison + summary: Compare two releases tags: - Release Management x-accepts: application/json @@ -2861,7 +2820,7 @@ paths: explode: true in: query name: releaseIds - required: false + required: true schema: type: string style: form @@ -3750,10 +3709,6 @@ paths: style: form responses: "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SuccessEmptyResponse' description: 缺失的命名空间创建成功 summary: 创建缺失的Namespace (new added) tags: @@ -4349,54 +4304,1505 @@ paths: x-accepts: application/json x-tags: - tag: Environment Management -components: - schemas: - OpenAppDTO: - description: Apollo应用信息数据传输对象,包含应用的基本信息和元数据 - example: - dataChangeCreatedTime: 2025-09-29T12:34:56Z - orgName: orgName - dataChangeLastModifiedBy: dataChangeLastModifiedBy - ownerName: ownerName - ownerDisplayName: ownerDisplayName - appId: appId - dataChangeCreatedBy: dataChangeCreatedBy - name: name - dataChangeLastModifiedTime: 2025-09-29T12:34:56Z - orgId: orgId - ownerEmail: ownerEmail - properties: - dataChangeCreatedBy: - description: 数据创建者用户名,记录是谁创建了这个应用 - type: string - dataChangeLastModifiedBy: - description: 数据最后修改者用户名,记录最后一次修改应用信息的用户 + /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init: + post: + deprecated: false + description: "" + operationId: initAppPermission + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: type: string - dataChangeCreatedTime: - description: 数据创建时间,ISO 8601格式的时间戳 - example: 2025-09-29T12:34:56Z + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: type: string - dataChangeLastModifiedTime: - description: 数据最后修改时间,ISO 8601格式的时间戳 - example: 2025-09-29T12:34:56Z + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: type: string - name: - description: 应用名称,用于显示的友好名称 + style: form + responses: + "200": + description: 初始化成功 + summary: 初始化应用权限 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permission-init: + post: + deprecated: false + description: "" + operationId: initClusterNamespacePermission + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: type: string - appId: - description: 应用唯一标识符,全局唯一的应用ID + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: type: string - orgId: - description: 组织ID,应用所属组织的唯一标识 + style: simple + - description: "" + explode: false + in: path + name: clusterName + required: true + schema: type: string - orgName: - description: 组织名称,应用所属组织的显示名称 + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: type: string - ownerName: - description: 应用负责人姓名,应用的主要负责人 + style: form + responses: + "200": + description: "" + summary: 初始化集群Namespace权限 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/permissions/{permissionType}: + get: + deprecated: false + description: "" + operationId: hasAppPermission + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: type: string - ownerEmail: - description: 应用负责人邮箱地址,用于接收应用相关通知 + style: simple + - description: "" + explode: false + in: path + name: permissionType + required: true + schema: + type: string + style: simple + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + hasPermission: false + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + description: "" + summary: 校验应用权限 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/namespaces/{namespaceName}/permissions/{permissionType}: + get: + deprecated: false + description: "" + operationId: hasNamespacePermission + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: permissionType + required: true + schema: + type: string + style: simple + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + hasPermission: false + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + description: "" + summary: 校验Namespace权限 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/permissions/{permissionType}: + get: + deprecated: false + description: "" + operationId: hasEnvNamespacePermission + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: permissionType + required: true + schema: + type: string + style: simple + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + hasPermission: false + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + description: "" + summary: 校验环境Namespace权限 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permissions/{permissionType}: + get: + deprecated: false + description: "" + operationId: hasClusterNamespacePermission + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: clusterName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: permissionType + required: true + schema: + type: string + style: simple + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + hasPermission: false + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + description: "" + summary: 校验集群Namespace权限 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/permissions/root: + get: + deprecated: false + description: "" + operationId: hasRootPermission + parameters: + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + hasPermission: false + schema: + $ref: '#/components/schemas/OpenPermissionConditionDTO' + description: "" + summary: 校验Root权限 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/role-users: + get: + deprecated: false + description: "" + operationId: getNamespaceEnvRoleUsers + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + appId: "" + namespaceName: "" + modifyRoleUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + releaseRoleUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + env: "" + schema: + $ref: '#/components/schemas/OpenEnvNamespaceRoleUserDTO' + description: "" + summary: 获取环境Namespace用户 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType}: + delete: + deprecated: false + description: "" + operationId: removeNamespaceEnvRoleFromUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role removed from + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 移除环境Namespace角色 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + post: + deprecated: false + description: "" + operationId: assignNamespaceEnvRoleToUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role assigned to + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 分配环境Namespace角色 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/role-users: + get: + deprecated: false + description: "" + operationId: getClusterNamespaceRoles + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: clusterName + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + appId: "" + env: "" + cluster: "" + modifyRoleUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + releaseRoleUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + schema: + $ref: '#/components/schemas/OpenClusterNamespaceRoleUserDTO' + description: "" + summary: 获取集群Namespace用户 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType}: + delete: + deprecated: false + description: "" + operationId: removeClusterNamespaceRoleFromUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: clusterName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role removed from + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 移除集群Namespace角色 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + post: + deprecated: false + description: "" + operationId: assignClusterNamespaceRoleToUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: clusterName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role assigned to + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 分配集群Namespace角色 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/namespaces/{namespaceName}/role-users: + get: + deprecated: false + description: "" + operationId: getNamespaceRoles + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + appId: "" + namespaceName: "" + modifyRoleUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + releaseRoleUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + schema: + $ref: '#/components/schemas/OpenNamespaceRoleUserDTO' + description: "" + summary: 获取Namespace用户 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType}: + delete: + deprecated: false + description: "" + operationId: removeNamespaceRoleFromUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role removed from + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 移除Namespace角色 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + post: + deprecated: false + description: "" + operationId: assignNamespaceRoleToUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: namespaceName + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role assigned to + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 分配Namespace角色 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/role-users: + get: + deprecated: false + description: "" + operationId: getAppRoles + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + appId: "" + masterUsers: + - userId: "" + name: "" + email: "" + enabled: 0 + schema: + $ref: '#/components/schemas/OpenAppRoleUserDTO' + description: "" + summary: 获取应用角色用户 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/roles/{roleType}: + delete: + deprecated: false + description: "" + operationId: removeAppRoleFromUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role removed from + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 移除应用角色 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + post: + deprecated: false + description: "" + operationId: assignAppRoleToUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: roleType + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role removed from + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + description: "" + type: string + responses: + "200": + description: "" + summary: 分配应用角色 (new added) + tags: + - Permission Management + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/system/roles/create-application: + delete: + deprecated: false + description: "" + operationId: deleteCreateApplicationRoleFromUser + parameters: + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 移除建应用角色 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + get: + deprecated: false + description: "" + operationId: hasCreateApplicationPermission + parameters: + - description: "" + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + members: + ? "" + : {} + schema: + additionalProperties: + type: boolean + type: object + description: "" + summary: 校验建应用权限 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + post: + deprecated: false + description: "" + operationId: addCreateApplicationRoleToUsers + parameters: + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + description: "" + items: + type: string + title: userIds + type: array + responses: + "200": + description: "" + summary: 分配建应用角色 (new added) + tags: + - Permission Management + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/system/roles/create-application/role-users: + get: + deprecated: false + description: "" + operationId: getCreateApplicationRoleUsers + parameters: [] + responses: + "200": + content: + application/json: + example: + - "" + schema: + items: + type: string + type: array + description: "" + summary: 获取建应用用户 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/roles/master: + delete: + deprecated: false + description: "" + operationId: removeManageAppMasterRoleFromUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role removed from + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 移除AppMaster (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + post: + deprecated: false + description: "" + operationId: addManageAppMasterRoleToUser + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: 操作人用户名 + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + - description: the user which role assign to + explode: true + in: query + name: userId + required: true + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 分配AppMaster (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/system/role/manage-app-master: + get: + deprecated: false + description: "" + operationId: isManageAppMasterPermissionEnabled + parameters: [] + responses: + "200": + content: + application/json: + example: + members: + ? "" + : {} + schema: + additionalProperties: + type: boolean + type: object + description: "" + summary: 校验AppMaster开关 (new added) + tags: + - Permission Management + x-accepts: application/json + x-tags: + - tag: Permission Management + /openapi/v1/apps/{appId}/envs/{env}/accesskeys: + get: + deprecated: false + description: "" + operationId: findAccessKeys + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + - dataChangeCreatedBy: "" + dataChangeLastModifiedBy: "" + dataChangeCreatedByDisplayName: "" + dataChangeLastModifiedByDisplayName: "" + dataChangeCreatedTime: "" + dataChangeLastModifiedTime: "" + id: 0 + secret: "" + appId: "" + mode: 0 + enabled: false + schema: + items: + $ref: '#/components/schemas/OpenAccessKeyDTO' + type: array + description: "" + summary: 查找AccessKey + tags: + - AccessKey Management + x-accepts: application/json + x-tags: + - tag: AccessKey Management + post: + deprecated: false + description: "" + operationId: createAccessKey + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + dataChangeCreatedBy: "" + dataChangeLastModifiedBy: "" + dataChangeCreatedByDisplayName: "" + dataChangeLastModifiedByDisplayName: "" + dataChangeCreatedTime: "" + dataChangeLastModifiedTime: "" + id: 0 + secret: "" + appId: "" + mode: 0 + enabled: false + schema: + $ref: '#/components/schemas/OpenAccessKeyDTO' + description: "" + summary: 创建AccessKey + tags: + - AccessKey Management + x-accepts: application/json + x-tags: + - tag: AccessKey Management + /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}: + delete: + deprecated: false + description: "" + operationId: deleteAccessKey + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: accessKeyId + required: true + schema: + format: int64 + type: integer + style: simple + - description: "" + explode: true + in: query + name: operator + required: false + schema: + type: string + style: form + responses: + "200": + description: "" + summary: 删除AccessKey + tags: + - AccessKey Management + x-accepts: application/json + x-tags: + - tag: AccessKey Management + /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/activation: + put: + deprecated: false + description: "" + operationId: enableAccessKey + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: accessKeyId + required: true + schema: + format: int64 + type: integer + style: simple + - description: "" + example: 0 + explode: true + in: query + name: mode + required: false + schema: + default: 0 + type: integer + style: form + responses: + "200": + description: "" + summary: 启用AccessKey + tags: + - AccessKey Management + x-accepts: application/json + x-tags: + - tag: AccessKey Management + /openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation: + put: + deprecated: false + description: "" + operationId: disableAccessKey + parameters: + - description: "" + explode: false + in: path + name: appId + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: env + required: true + schema: + type: string + style: simple + - description: "" + explode: false + in: path + name: accessKeyId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + description: "" + summary: 禁用AccessKey + tags: + - AccessKey Management + x-accepts: application/json + x-tags: + - tag: AccessKey Management +components: + schemas: + OpenAppDTO: + description: Apollo应用信息数据传输对象,包含应用的基本信息和元数据 + example: + dataChangeCreatedTime: 2025-09-29T12:34:56Z + orgName: orgName + dataChangeLastModifiedBy: dataChangeLastModifiedBy + ownerName: ownerName + ownerDisplayName: ownerDisplayName + appId: appId + dataChangeCreatedBy: dataChangeCreatedBy + name: name + dataChangeLastModifiedTime: 2025-09-29T12:34:56Z + orgId: orgId + ownerEmail: ownerEmail + properties: + dataChangeCreatedBy: + description: 数据创建者用户名,记录是谁创建了这个应用 + type: string + dataChangeLastModifiedBy: + description: 数据最后修改者用户名,记录最后一次修改应用信息的用户 + type: string + dataChangeCreatedTime: + description: 数据创建时间,ISO 8601格式的时间戳 + example: 2025-09-29T12:34:56Z + type: string + dataChangeLastModifiedTime: + description: 数据最后修改时间,ISO 8601格式的时间戳 + example: 2025-09-29T12:34:56Z + type: string + name: + description: 应用名称,用于显示的友好名称 + type: string + appId: + description: 应用唯一标识符,全局唯一的应用ID + type: string + orgId: + description: 组织ID,应用所属组织的唯一标识 + type: string + orgName: + description: 组织名称,应用所属组织的显示名称 + type: string + ownerName: + description: 应用负责人姓名,应用的主要负责人 + type: string + ownerEmail: + description: 应用负责人邮箱地址,用于接收应用相关通知 type: string ownerDisplayName: type: string @@ -5489,46 +6895,6 @@ components: $ref: '#/components/schemas/OpenItemDTO' type: array type: object - KVEntity: - example: - value: value - key: key - properties: - key: - description: 键 - type: string - value: - description: 值 - type: string - type: object - OpenReleaseBO: - example: - baseInfo: - dataChangeCreatedTime: 2025-09-29T12:34:56Z - dataChangeLastModifiedBy: dataChangeLastModifiedBy - configurations: - key: configurations - appId: appId - clusterName: clusterName - dataChangeCreatedBy: dataChangeCreatedBy - name: name - comment: comment - id: 0 - dataChangeLastModifiedTime: 2025-09-29T12:34:56Z - namespaceName: namespaceName - items: - - value: value - key: key - - value: value - key: key - properties: - baseInfo: - $ref: '#/components/schemas/OpenReleaseDTO' - items: - items: - $ref: '#/components/schemas/KVEntity' - type: array - type: object OpenInstanceConfigDTO: example: releaseDeliveryTime: 2025-09-29T12:34:56Z @@ -5657,8 +7023,270 @@ components: description: 错误类名 type: string type: object - SuccessEmptyResponse: - properties: {} + OpenPermissionConditionDTO: + example: + hasPermission: true + properties: + hasPermission: + description: "" + type: boolean + type: object + OpenUserInfoDTO: + example: + name: name + userId: userId + email: email + enabled: 0 + properties: + userId: + description: "" + type: string + name: + description: "" + type: string + email: + description: "" + type: string + enabled: + description: "" + type: integer + type: object + OpenEnvNamespaceRoleUserDTO: + example: + releaseRoleUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + appId: appId + modifyRoleUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + env: env + namespaceName: namespaceName + properties: + appId: + description: "" + type: string + namespaceName: + description: "" + type: string + modifyRoleUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + releaseRoleUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + env: + description: "" + type: string + type: object + OpenClusterNamespaceRoleUserDTO: + example: + cluster: cluster + releaseRoleUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + appId: appId + modifyRoleUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + env: env + properties: + appId: + description: "" + type: string + env: + description: "" + type: string + cluster: + description: "" + type: string + modifyRoleUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + releaseRoleUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + type: object + OpenNamespaceRoleUserDTO: + example: + releaseRoleUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + appId: appId + modifyRoleUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + namespaceName: namespaceName + properties: + appId: + description: "" + type: string + namespaceName: + description: "" + type: string + modifyRoleUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + releaseRoleUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + type: object + OpenAppRoleUserDTO: + example: + appId: appId + masterUsers: + - name: name + userId: userId + email: email + enabled: 0 + - name: name + userId: userId + email: email + enabled: 0 + properties: + appId: + description: "" + type: string + masterUsers: + description: "" + items: + $ref: '#/components/schemas/OpenUserInfoDTO' + type: array + type: object + OpenReleaseDiffDTO: + example: + changes: + - newValue: newValue + changeType: changeType + oldValue: oldValue + key: key + - newValue: newValue + changeType: changeType + oldValue: oldValue + key: key + properties: + changes: + description: "A list of changes, ensuring order if necessary." + items: + $ref: '#/components/schemas/OpenReleaseChangeDTO' + type: array + type: object + OpenReleaseChangeDTO: + example: + newValue: newValue + changeType: changeType + oldValue: oldValue + key: key + properties: + changeType: + description: 修改类型 + type: string + key: + description: key + type: string + newValue: + description: new value + type: string + oldValue: + description: old value + type: string + type: object + OpenAccessKeyDTO: + example: + mode: 6 + dataChangeLastModifiedByDisplayName: dataChangeLastModifiedByDisplayName + dataChangeCreatedByDisplayName: dataChangeCreatedByDisplayName + dataChangeCreatedTime: dataChangeCreatedTime + dataChangeLastModifiedBy: dataChangeLastModifiedBy + appId: appId + dataChangeCreatedBy: dataChangeCreatedBy + id: 0 + secret: secret + dataChangeLastModifiedTime: dataChangeLastModifiedTime + enabled: true + properties: + dataChangeCreatedBy: + description: "" + type: string + dataChangeLastModifiedBy: + description: "" + type: string + dataChangeCreatedByDisplayName: + description: "" + type: string + dataChangeLastModifiedByDisplayName: + description: "" + type: string + dataChangeCreatedTime: + description: "" + type: string + dataChangeLastModifiedTime: + description: "" + type: string + id: + description: "" + format: int64 + type: integer + secret: + description: "" + type: string + appId: + description: "" + type: string + mode: + description: "" + type: integer + enabled: + description: "" + type: boolean type: object StringToStringBoolMap: additionalProperties: diff --git a/typescript/.openapi-generator/FILES b/typescript/.openapi-generator/FILES index 036c467..3541f50 100644 --- a/typescript/.openapi-generator/FILES +++ b/typescript/.openapi-generator/FILES @@ -3,6 +3,7 @@ .openapi-generator-ignore README.md package.json +src/apis/AccessKeyManagementApi.ts src/apis/AppManagementApi.ts src/apis/AppNamespaceManagementApi.ts src/apis/ClusterManagementApi.ts @@ -13,21 +14,25 @@ src/apis/NamespaceBranchManagementApi.ts src/apis/NamespaceLockManagementApi.ts src/apis/NamespaceManagementApi.ts src/apis/OrganizationManagementApi.ts +src/apis/PermissionManagementApi.ts src/apis/ReleaseManagementApi.ts src/apis/index.ts src/index.ts src/models/ExceptionResponse.ts -src/models/KVEntity.ts src/models/NamespaceGrayDelReleaseDTO.ts src/models/NamespaceReleaseDTO.ts +src/models/OpenAccessKeyDTO.ts src/models/OpenAppDTO.ts src/models/OpenAppNamespaceDTO.ts +src/models/OpenAppRoleUserDTO.ts src/models/OpenClusterDTO.ts +src/models/OpenClusterNamespaceRoleUserDTO.ts src/models/OpenCreateAppDTO.ts src/models/OpenCreateItemDTO.ts src/models/OpenCreateNamespaceDTO.ts src/models/OpenEnvClusterDTO.ts src/models/OpenEnvClusterInfo.ts +src/models/OpenEnvNamespaceRoleUserDTO.ts src/models/OpenGrayReleaseRuleDTO.ts src/models/OpenGrayReleaseRuleItemDTO.ts src/models/OpenInstanceConfigDTO.ts @@ -43,12 +48,16 @@ src/models/OpenNamespaceDTO.ts src/models/OpenNamespaceExtendDTO.ts src/models/OpenNamespaceIdentifier.ts src/models/OpenNamespaceLockDTO.ts +src/models/OpenNamespaceRoleUserDTO.ts src/models/OpenNamespaceSyncDTO.ts src/models/OpenNamespaceTextModel.ts src/models/OpenNamespaceUsageDTO.ts src/models/OpenOrganizationDto.ts -src/models/OpenReleaseBO.ts +src/models/OpenPermissionConditionDTO.ts +src/models/OpenReleaseChangeDTO.ts src/models/OpenReleaseDTO.ts +src/models/OpenReleaseDiffDTO.ts +src/models/OpenUserInfoDTO.ts src/models/index.ts src/runtime.ts tsconfig.json diff --git a/typescript/src/apis/AccessKeyManagementApi.ts b/typescript/src/apis/AccessKeyManagementApi.ts new file mode 100644 index 0000000..3675675 --- /dev/null +++ b/typescript/src/apis/AccessKeyManagementApi.ts @@ -0,0 +1,282 @@ +/* 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + OpenAccessKeyDTO, +} from '../models'; +import { + OpenAccessKeyDTOFromJSON, + OpenAccessKeyDTOToJSON, +} from '../models'; + +export interface CreateAccessKeyRequest { + appId: string; + env: string; + operator?: string; +} + +export interface DeleteAccessKeyRequest { + appId: string; + env: string; + accessKeyId: number; + operator?: string; +} + +export interface DisableAccessKeyRequest { + appId: string; + env: string; + accessKeyId: number; +} + +export interface EnableAccessKeyRequest { + appId: string; + env: string; + accessKeyId: number; + mode?: number; +} + +export interface FindAccessKeysRequest { + appId: string; + env: string; +} + +/** + * + */ +export class AccessKeyManagementApi extends runtime.BaseAPI { + + /** + * + * 创建AccessKey + */ + async createAccessKeyRaw(requestParameters: CreateAccessKeyRequest, 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 createAccessKey.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling createAccessKey.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/accesskeys`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OpenAccessKeyDTOFromJSON(jsonValue)); + } + + /** + * + * 创建AccessKey + */ + async createAccessKey(requestParameters: CreateAccessKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createAccessKeyRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * 删除AccessKey + */ + async deleteAccessKeyRaw(requestParameters: DeleteAccessKeyRequest, 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 deleteAccessKey.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling deleteAccessKey.'); + } + + if (requestParameters.accessKeyId === null || requestParameters.accessKeyId === undefined) { + throw new runtime.RequiredError('accessKeyId','Required parameter requestParameters.accessKeyId was null or undefined when calling deleteAccessKey.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))).replace(`{${"accessKeyId"}}`, encodeURIComponent(String(requestParameters.accessKeyId))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 删除AccessKey + */ + async deleteAccessKey(requestParameters: DeleteAccessKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteAccessKeyRaw(requestParameters, initOverrides); + } + + /** + * + * 禁用AccessKey + */ + async disableAccessKeyRaw(requestParameters: DisableAccessKeyRequest, 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 disableAccessKey.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling disableAccessKey.'); + } + + if (requestParameters.accessKeyId === null || requestParameters.accessKeyId === undefined) { + throw new runtime.RequiredError('accessKeyId','Required parameter requestParameters.accessKeyId was null or undefined when calling disableAccessKey.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/deactivation`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))).replace(`{${"accessKeyId"}}`, encodeURIComponent(String(requestParameters.accessKeyId))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 禁用AccessKey + */ + async disableAccessKey(requestParameters: DisableAccessKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.disableAccessKeyRaw(requestParameters, initOverrides); + } + + /** + * + * 启用AccessKey + */ + async enableAccessKeyRaw(requestParameters: EnableAccessKeyRequest, 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 enableAccessKey.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling enableAccessKey.'); + } + + if (requestParameters.accessKeyId === null || requestParameters.accessKeyId === undefined) { + throw new runtime.RequiredError('accessKeyId','Required parameter requestParameters.accessKeyId was null or undefined when calling enableAccessKey.'); + } + + const queryParameters: any = {}; + + if (requestParameters.mode !== undefined) { + queryParameters['mode'] = requestParameters.mode; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/accesskeys/{accessKeyId}/activation`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))).replace(`{${"accessKeyId"}}`, encodeURIComponent(String(requestParameters.accessKeyId))), + method: 'PUT', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 启用AccessKey + */ + async enableAccessKey(requestParameters: EnableAccessKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.enableAccessKeyRaw(requestParameters, initOverrides); + } + + /** + * + * 查找AccessKey + */ + async findAccessKeysRaw(requestParameters: FindAccessKeysRequest, 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 findAccessKeys.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling findAccessKeys.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/accesskeys`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(OpenAccessKeyDTOFromJSON)); + } + + /** + * + * 查找AccessKey + */ + async findAccessKeys(requestParameters: FindAccessKeysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.findAccessKeysRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/typescript/src/apis/AppManagementApi.ts b/typescript/src/apis/AppManagementApi.ts index 8c84078..7b44383 100644 --- a/typescript/src/apis/AppManagementApi.ts +++ b/typescript/src/apis/AppManagementApi.ts @@ -131,7 +131,7 @@ export class AppManagementApi extends runtime.BaseAPI { * POST /openapi/v1/apps/envs/{env} * 在指定环境创建应用(new added) */ - async createAppInEnvRaw(requestParameters: CreateAppInEnvRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async createAppInEnvRaw(requestParameters: CreateAppInEnvRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.env === null || requestParameters.env === undefined) { throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling createAppInEnv.'); } @@ -162,23 +162,22 @@ export class AppManagementApi extends runtime.BaseAPI { body: OpenAppDTOToJSON(requestParameters.openAppDTO), }, initOverrides); - return new runtime.JSONApiResponse(response); + return new runtime.VoidApiResponse(response); } /** * POST /openapi/v1/apps/envs/{env} * 在指定环境创建应用(new added) */ - async createAppInEnv(requestParameters: CreateAppInEnvRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.createAppInEnvRaw(requestParameters, initOverrides); - return await response.value(); + async createAppInEnv(requestParameters: CreateAppInEnvRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.createAppInEnvRaw(requestParameters, initOverrides); } /** * DELETE /openapi/v1/apps/{appId} * 删除应用(new added) */ - async deleteAppRaw(requestParameters: DeleteAppRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async deleteAppRaw(requestParameters: DeleteAppRequest, 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 deleteApp.'); } @@ -202,16 +201,15 @@ export class AppManagementApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response); + return new runtime.VoidApiResponse(response); } /** * DELETE /openapi/v1/apps/{appId} * 删除应用(new added) */ - async deleteApp(requestParameters: DeleteAppRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteAppRaw(requestParameters, initOverrides); - return await response.value(); + async deleteApp(requestParameters: DeleteAppRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteAppRaw(requestParameters, initOverrides); } /** @@ -478,7 +476,7 @@ export class AppManagementApi extends runtime.BaseAPI { * PUT /openapi/v1/apps/{appId} * 更新应用(new added) */ - async updateAppRaw(requestParameters: UpdateAppRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async updateAppRaw(requestParameters: UpdateAppRequest, 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 updateApp.'); } @@ -509,16 +507,15 @@ export class AppManagementApi extends runtime.BaseAPI { body: OpenAppDTOToJSON(requestParameters.openAppDTO), }, initOverrides); - return new runtime.JSONApiResponse(response); + return new runtime.VoidApiResponse(response); } /** * PUT /openapi/v1/apps/{appId} * 更新应用(new added) */ - async updateApp(requestParameters: UpdateAppRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.updateAppRaw(requestParameters, initOverrides); - return await response.value(); + async updateApp(requestParameters: UpdateAppRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.updateAppRaw(requestParameters, initOverrides); } } diff --git a/typescript/src/apis/ClusterManagementApi.ts b/typescript/src/apis/ClusterManagementApi.ts index 6f51d0f..a869c34 100644 --- a/typescript/src/apis/ClusterManagementApi.ts +++ b/typescript/src/apis/ClusterManagementApi.ts @@ -100,7 +100,7 @@ export class ClusterManagementApi extends runtime.BaseAPI { * DELETE /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName} * 删除集群 (new added) */ - async deleteClusterRaw(requestParameters: DeleteClusterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async deleteClusterRaw(requestParameters: DeleteClusterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.env === null || requestParameters.env === undefined) { throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling deleteCluster.'); } @@ -132,16 +132,15 @@ export class ClusterManagementApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response); + return new runtime.VoidApiResponse(response); } /** * DELETE /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName} * 删除集群 (new added) */ - async deleteCluster(requestParameters: DeleteClusterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.deleteClusterRaw(requestParameters, initOverrides); - return await response.value(); + async deleteCluster(requestParameters: DeleteClusterRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteClusterRaw(requestParameters, initOverrides); } /** diff --git a/typescript/src/apis/InstanceManagementApi.ts b/typescript/src/apis/InstanceManagementApi.ts index ae6c183..bcf6bae 100644 --- a/typescript/src/apis/InstanceManagementApi.ts +++ b/typescript/src/apis/InstanceManagementApi.ts @@ -47,7 +47,7 @@ export interface GetByReleasesAndNamespaceNotInRequest { appId: string; clusterName: string; namespaceName: string; - releaseIds?: string; + releaseIds: string; } export interface GetInstanceCountByNamespaceRequest { @@ -220,6 +220,10 @@ export class InstanceManagementApi extends runtime.BaseAPI { throw new runtime.RequiredError('namespaceName','Required parameter requestParameters.namespaceName was null or undefined when calling getByReleasesAndNamespaceNotIn.'); } + if (requestParameters.releaseIds === null || requestParameters.releaseIds === undefined) { + throw new runtime.RequiredError('releaseIds','Required parameter requestParameters.releaseIds was null or undefined when calling getByReleasesAndNamespaceNotIn.'); + } + const queryParameters: any = {}; if (requestParameters.appId !== undefined) { diff --git a/typescript/src/apis/NamespaceManagementApi.ts b/typescript/src/apis/NamespaceManagementApi.ts index a196746..0aac9ea 100644 --- a/typescript/src/apis/NamespaceManagementApi.ts +++ b/typescript/src/apis/NamespaceManagementApi.ts @@ -99,7 +99,7 @@ export class NamespaceManagementApi extends runtime.BaseAPI { * POST /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/missing-namespaces * 创建缺失的Namespace (new added) */ - async createMissingNamespacesRaw(requestParameters: CreateMissingNamespacesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async createMissingNamespacesRaw(requestParameters: CreateMissingNamespacesRequest, 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 createMissingNamespaces.'); } @@ -131,16 +131,15 @@ export class NamespaceManagementApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response); + return new runtime.VoidApiResponse(response); } /** * POST /openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/missing-namespaces * 创建缺失的Namespace (new added) */ - async createMissingNamespaces(requestParameters: CreateMissingNamespacesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.createMissingNamespacesRaw(requestParameters, initOverrides); - return await response.value(); + async createMissingNamespaces(requestParameters: CreateMissingNamespacesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.createMissingNamespacesRaw(requestParameters, initOverrides); } /** diff --git a/typescript/src/apis/PermissionManagementApi.ts b/typescript/src/apis/PermissionManagementApi.ts new file mode 100644 index 0000000..bfc5d41 --- /dev/null +++ b/typescript/src/apis/PermissionManagementApi.ts @@ -0,0 +1,1438 @@ +/* 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + OpenAppRoleUserDTO, + OpenClusterNamespaceRoleUserDTO, + OpenEnvNamespaceRoleUserDTO, + OpenNamespaceRoleUserDTO, + OpenPermissionConditionDTO, +} from '../models'; +import { + OpenAppRoleUserDTOFromJSON, + OpenAppRoleUserDTOToJSON, + OpenClusterNamespaceRoleUserDTOFromJSON, + OpenClusterNamespaceRoleUserDTOToJSON, + OpenEnvNamespaceRoleUserDTOFromJSON, + OpenEnvNamespaceRoleUserDTOToJSON, + OpenNamespaceRoleUserDTOFromJSON, + OpenNamespaceRoleUserDTOToJSON, + OpenPermissionConditionDTOFromJSON, + OpenPermissionConditionDTOToJSON, +} from '../models'; + +export interface AddCreateApplicationRoleToUsersRequest { + operator?: string; + requestBody?: Array; +} + +export interface AddManageAppMasterRoleToUserRequest { + appId: string; + userId: string; + operator?: string; +} + +export interface AssignAppRoleToUserRequest { + appId: string; + roleType: string; + userId: string; + operator?: string; + body?: string; +} + +export interface AssignClusterNamespaceRoleToUserRequest { + appId: string; + env: string; + clusterName: string; + roleType: string; + userId: string; + operator?: string; +} + +export interface AssignNamespaceEnvRoleToUserRequest { + appId: string; + env: string; + namespaceName: string; + roleType: string; + userId: string; + operator?: string; +} + +export interface AssignNamespaceRoleToUserRequest { + appId: string; + namespaceName: string; + roleType: string; + userId: string; + operator?: string; +} + +export interface DeleteCreateApplicationRoleFromUserRequest { + userId: string; + operator?: string; +} + +export interface GetAppRolesRequest { + appId: string; +} + +export interface GetClusterNamespaceRolesRequest { + appId: string; + env: string; + clusterName: string; +} + +export interface GetNamespaceEnvRoleUsersRequest { + appId: string; + env: string; + namespaceName: string; +} + +export interface GetNamespaceRolesRequest { + appId: string; + namespaceName: string; +} + +export interface HasAppPermissionRequest { + appId: string; + permissionType: string; + userId: string; +} + +export interface HasClusterNamespacePermissionRequest { + appId: string; + env: string; + clusterName: string; + permissionType: string; + userId: string; +} + +export interface HasCreateApplicationPermissionRequest { + userId: string; +} + +export interface HasEnvNamespacePermissionRequest { + appId: string; + env: string; + namespaceName: string; + permissionType: string; + userId: string; +} + +export interface HasNamespacePermissionRequest { + appId: string; + namespaceName: string; + permissionType: string; + userId: string; +} + +export interface HasRootPermissionRequest { + userId: string; +} + +export interface InitAppPermissionRequest { + appId: string; + namespaceName: string; + operator?: string; +} + +export interface InitClusterNamespacePermissionRequest { + appId: string; + env: string; + clusterName: string; + operator?: string; +} + +export interface RemoveAppRoleFromUserRequest { + appId: string; + roleType: string; + userId: string; + operator?: string; +} + +export interface RemoveClusterNamespaceRoleFromUserRequest { + appId: string; + env: string; + clusterName: string; + roleType: string; + userId: string; + operator?: string; +} + +export interface RemoveManageAppMasterRoleFromUserRequest { + appId: string; + userId: string; + operator?: string; +} + +export interface RemoveNamespaceEnvRoleFromUserRequest { + appId: string; + env: string; + namespaceName: string; + roleType: string; + userId: string; + operator?: string; +} + +export interface RemoveNamespaceRoleFromUserRequest { + appId: string; + namespaceName: string; + roleType: string; + userId: string; + operator?: string; +} + +/** + * + */ +export class PermissionManagementApi extends runtime.BaseAPI { + + /** + * + * 分配建应用角色 (new added) + */ + async addCreateApplicationRoleToUsersRaw(requestParameters: AddCreateApplicationRoleToUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/system/roles/create-application`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.requestBody, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 分配建应用角色 (new added) + */ + async addCreateApplicationRoleToUsers(requestParameters: AddCreateApplicationRoleToUsersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.addCreateApplicationRoleToUsersRaw(requestParameters, initOverrides); + } + + /** + * + * 分配AppMaster (new added) + */ + async addManageAppMasterRoleToUserRaw(requestParameters: AddManageAppMasterRoleToUserRequest, 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 addManageAppMasterRoleToUser.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling addManageAppMasterRoleToUser.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/roles/master`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 分配AppMaster (new added) + */ + async addManageAppMasterRoleToUser(requestParameters: AddManageAppMasterRoleToUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.addManageAppMasterRoleToUserRaw(requestParameters, initOverrides); + } + + /** + * + * 分配应用角色 (new added) + */ + async assignAppRoleToUserRaw(requestParameters: AssignAppRoleToUserRequest, 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 assignAppRoleToUser.'); + } + + if (requestParameters.roleType === null || requestParameters.roleType === undefined) { + throw new runtime.RequiredError('roleType','Required parameter requestParameters.roleType was null or undefined when calling assignAppRoleToUser.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling assignAppRoleToUser.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/roles/{roleType}`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"roleType"}}`, encodeURIComponent(String(requestParameters.roleType))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters.body as any, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 分配应用角色 (new added) + */ + async assignAppRoleToUser(requestParameters: AssignAppRoleToUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.assignAppRoleToUserRaw(requestParameters, initOverrides); + } + + /** + * + * 分配集群Namespace角色 (new added) + */ + async assignClusterNamespaceRoleToUserRaw(requestParameters: AssignClusterNamespaceRoleToUserRequest, 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 assignClusterNamespaceRoleToUser.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling assignClusterNamespaceRoleToUser.'); + } + + if (requestParameters.clusterName === null || requestParameters.clusterName === undefined) { + throw new runtime.RequiredError('clusterName','Required parameter requestParameters.clusterName was null or undefined when calling assignClusterNamespaceRoleToUser.'); + } + + if (requestParameters.roleType === null || requestParameters.roleType === undefined) { + throw new runtime.RequiredError('roleType','Required parameter requestParameters.roleType was null or undefined when calling assignClusterNamespaceRoleToUser.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling assignClusterNamespaceRoleToUser.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType}`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))).replace(`{${"clusterName"}}`, encodeURIComponent(String(requestParameters.clusterName))).replace(`{${"roleType"}}`, encodeURIComponent(String(requestParameters.roleType))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 分配集群Namespace角色 (new added) + */ + async assignClusterNamespaceRoleToUser(requestParameters: AssignClusterNamespaceRoleToUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.assignClusterNamespaceRoleToUserRaw(requestParameters, initOverrides); + } + + /** + * + * 分配环境Namespace角色 (new added) + */ + async assignNamespaceEnvRoleToUserRaw(requestParameters: AssignNamespaceEnvRoleToUserRequest, 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 assignNamespaceEnvRoleToUser.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling assignNamespaceEnvRoleToUser.'); + } + + if (requestParameters.namespaceName === null || requestParameters.namespaceName === undefined) { + throw new runtime.RequiredError('namespaceName','Required parameter requestParameters.namespaceName was null or undefined when calling assignNamespaceEnvRoleToUser.'); + } + + if (requestParameters.roleType === null || requestParameters.roleType === undefined) { + throw new runtime.RequiredError('roleType','Required parameter requestParameters.roleType was null or undefined when calling assignNamespaceEnvRoleToUser.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling assignNamespaceEnvRoleToUser.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType}`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))).replace(`{${"namespaceName"}}`, encodeURIComponent(String(requestParameters.namespaceName))).replace(`{${"roleType"}}`, encodeURIComponent(String(requestParameters.roleType))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 分配环境Namespace角色 (new added) + */ + async assignNamespaceEnvRoleToUser(requestParameters: AssignNamespaceEnvRoleToUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.assignNamespaceEnvRoleToUserRaw(requestParameters, initOverrides); + } + + /** + * + * 分配Namespace角色 (new added) + */ + async assignNamespaceRoleToUserRaw(requestParameters: AssignNamespaceRoleToUserRequest, 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 assignNamespaceRoleToUser.'); + } + + if (requestParameters.namespaceName === null || requestParameters.namespaceName === undefined) { + throw new runtime.RequiredError('namespaceName','Required parameter requestParameters.namespaceName was null or undefined when calling assignNamespaceRoleToUser.'); + } + + if (requestParameters.roleType === null || requestParameters.roleType === undefined) { + throw new runtime.RequiredError('roleType','Required parameter requestParameters.roleType was null or undefined when calling assignNamespaceRoleToUser.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling assignNamespaceRoleToUser.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType}`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"namespaceName"}}`, encodeURIComponent(String(requestParameters.namespaceName))).replace(`{${"roleType"}}`, encodeURIComponent(String(requestParameters.roleType))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 分配Namespace角色 (new added) + */ + async assignNamespaceRoleToUser(requestParameters: AssignNamespaceRoleToUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.assignNamespaceRoleToUserRaw(requestParameters, initOverrides); + } + + /** + * + * 移除建应用角色 (new added) + */ + async deleteCreateApplicationRoleFromUserRaw(requestParameters: DeleteCreateApplicationRoleFromUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling deleteCreateApplicationRoleFromUser.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/system/roles/create-application`, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 移除建应用角色 (new added) + */ + async deleteCreateApplicationRoleFromUser(requestParameters: DeleteCreateApplicationRoleFromUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteCreateApplicationRoleFromUserRaw(requestParameters, initOverrides); + } + + /** + * + * 获取应用角色用户 (new added) + */ + async getAppRolesRaw(requestParameters: GetAppRolesRequest, 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 getAppRoles.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/role-users`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OpenAppRoleUserDTOFromJSON(jsonValue)); + } + + /** + * + * 获取应用角色用户 (new added) + */ + async getAppRoles(requestParameters: GetAppRolesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getAppRolesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * 获取集群Namespace用户 (new added) + */ + async getClusterNamespaceRolesRaw(requestParameters: GetClusterNamespaceRolesRequest, 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 getClusterNamespaceRoles.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling getClusterNamespaceRoles.'); + } + + if (requestParameters.clusterName === null || requestParameters.clusterName === undefined) { + throw new runtime.RequiredError('clusterName','Required parameter requestParameters.clusterName was null or undefined when calling getClusterNamespaceRoles.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/role-users`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))).replace(`{${"clusterName"}}`, encodeURIComponent(String(requestParameters.clusterName))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OpenClusterNamespaceRoleUserDTOFromJSON(jsonValue)); + } + + /** + * + * 获取集群Namespace用户 (new added) + */ + async getClusterNamespaceRoles(requestParameters: GetClusterNamespaceRolesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getClusterNamespaceRolesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * 获取建应用用户 (new added) + */ + async getCreateApplicationRoleUsersRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/system/roles/create-application/role-users`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * + * 获取建应用用户 (new added) + */ + async getCreateApplicationRoleUsers(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.getCreateApplicationRoleUsersRaw(initOverrides); + return await response.value(); + } + + /** + * + * 获取环境Namespace用户 (new added) + */ + async getNamespaceEnvRoleUsersRaw(requestParameters: GetNamespaceEnvRoleUsersRequest, 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 getNamespaceEnvRoleUsers.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling getNamespaceEnvRoleUsers.'); + } + + if (requestParameters.namespaceName === null || requestParameters.namespaceName === undefined) { + throw new runtime.RequiredError('namespaceName','Required parameter requestParameters.namespaceName was null or undefined when calling getNamespaceEnvRoleUsers.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/role-users`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))).replace(`{${"namespaceName"}}`, encodeURIComponent(String(requestParameters.namespaceName))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OpenEnvNamespaceRoleUserDTOFromJSON(jsonValue)); + } + + /** + * + * 获取环境Namespace用户 (new added) + */ + async getNamespaceEnvRoleUsers(requestParameters: GetNamespaceEnvRoleUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getNamespaceEnvRoleUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * 获取Namespace用户 (new added) + */ + async getNamespaceRolesRaw(requestParameters: GetNamespaceRolesRequest, 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 getNamespaceRoles.'); + } + + if (requestParameters.namespaceName === null || requestParameters.namespaceName === undefined) { + throw new runtime.RequiredError('namespaceName','Required parameter requestParameters.namespaceName was null or undefined when calling getNamespaceRoles.'); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/namespaces/{namespaceName}/role-users`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"namespaceName"}}`, encodeURIComponent(String(requestParameters.namespaceName))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OpenNamespaceRoleUserDTOFromJSON(jsonValue)); + } + + /** + * + * 获取Namespace用户 (new added) + */ + async getNamespaceRoles(requestParameters: GetNamespaceRolesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getNamespaceRolesRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * 校验应用权限 (new added) + */ + async hasAppPermissionRaw(requestParameters: HasAppPermissionRequest, 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 hasAppPermission.'); + } + + if (requestParameters.permissionType === null || requestParameters.permissionType === undefined) { + throw new runtime.RequiredError('permissionType','Required parameter requestParameters.permissionType was null or undefined when calling hasAppPermission.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling hasAppPermission.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/permissions/{permissionType}`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"permissionType"}}`, encodeURIComponent(String(requestParameters.permissionType))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OpenPermissionConditionDTOFromJSON(jsonValue)); + } + + /** + * + * 校验应用权限 (new added) + */ + async hasAppPermission(requestParameters: HasAppPermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.hasAppPermissionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * 校验集群Namespace权限 (new added) + */ + async hasClusterNamespacePermissionRaw(requestParameters: HasClusterNamespacePermissionRequest, 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 hasClusterNamespacePermission.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling hasClusterNamespacePermission.'); + } + + if (requestParameters.clusterName === null || requestParameters.clusterName === undefined) { + throw new runtime.RequiredError('clusterName','Required parameter requestParameters.clusterName was null or undefined when calling hasClusterNamespacePermission.'); + } + + if (requestParameters.permissionType === null || requestParameters.permissionType === undefined) { + throw new runtime.RequiredError('permissionType','Required parameter requestParameters.permissionType was null or undefined when calling hasClusterNamespacePermission.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling hasClusterNamespacePermission.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permissions/{permissionType}`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))).replace(`{${"clusterName"}}`, encodeURIComponent(String(requestParameters.clusterName))).replace(`{${"permissionType"}}`, encodeURIComponent(String(requestParameters.permissionType))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OpenPermissionConditionDTOFromJSON(jsonValue)); + } + + /** + * + * 校验集群Namespace权限 (new added) + */ + async hasClusterNamespacePermission(requestParameters: HasClusterNamespacePermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.hasClusterNamespacePermissionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * 校验建应用权限 (new added) + */ + async hasCreateApplicationPermissionRaw(requestParameters: HasCreateApplicationPermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling hasCreateApplicationPermission.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/system/roles/create-application`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * + * 校验建应用权限 (new added) + */ + async hasCreateApplicationPermission(requestParameters: HasCreateApplicationPermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: boolean; }> { + const response = await this.hasCreateApplicationPermissionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * 校验环境Namespace权限 (new added) + */ + async hasEnvNamespacePermissionRaw(requestParameters: HasEnvNamespacePermissionRequest, 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 hasEnvNamespacePermission.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling hasEnvNamespacePermission.'); + } + + if (requestParameters.namespaceName === null || requestParameters.namespaceName === undefined) { + throw new runtime.RequiredError('namespaceName','Required parameter requestParameters.namespaceName was null or undefined when calling hasEnvNamespacePermission.'); + } + + if (requestParameters.permissionType === null || requestParameters.permissionType === undefined) { + throw new runtime.RequiredError('permissionType','Required parameter requestParameters.permissionType was null or undefined when calling hasEnvNamespacePermission.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling hasEnvNamespacePermission.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/permissions/{permissionType}`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))).replace(`{${"namespaceName"}}`, encodeURIComponent(String(requestParameters.namespaceName))).replace(`{${"permissionType"}}`, encodeURIComponent(String(requestParameters.permissionType))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OpenPermissionConditionDTOFromJSON(jsonValue)); + } + + /** + * + * 校验环境Namespace权限 (new added) + */ + async hasEnvNamespacePermission(requestParameters: HasEnvNamespacePermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.hasEnvNamespacePermissionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * 校验Namespace权限 (new added) + */ + async hasNamespacePermissionRaw(requestParameters: HasNamespacePermissionRequest, 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 hasNamespacePermission.'); + } + + if (requestParameters.namespaceName === null || requestParameters.namespaceName === undefined) { + throw new runtime.RequiredError('namespaceName','Required parameter requestParameters.namespaceName was null or undefined when calling hasNamespacePermission.'); + } + + if (requestParameters.permissionType === null || requestParameters.permissionType === undefined) { + throw new runtime.RequiredError('permissionType','Required parameter requestParameters.permissionType was null or undefined when calling hasNamespacePermission.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling hasNamespacePermission.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/namespaces/{namespaceName}/permissions/{permissionType}`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"namespaceName"}}`, encodeURIComponent(String(requestParameters.namespaceName))).replace(`{${"permissionType"}}`, encodeURIComponent(String(requestParameters.permissionType))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OpenPermissionConditionDTOFromJSON(jsonValue)); + } + + /** + * + * 校验Namespace权限 (new added) + */ + async hasNamespacePermission(requestParameters: HasNamespacePermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.hasNamespacePermissionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * 校验Root权限 (new added) + */ + async hasRootPermissionRaw(requestParameters: HasRootPermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling hasRootPermission.'); + } + + const queryParameters: any = {}; + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/permissions/root`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OpenPermissionConditionDTOFromJSON(jsonValue)); + } + + /** + * + * 校验Root权限 (new added) + */ + async hasRootPermission(requestParameters: HasRootPermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.hasRootPermissionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * + * 初始化应用权限 (new added) + */ + async initAppPermissionRaw(requestParameters: InitAppPermissionRequest, 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 initAppPermission.'); + } + + if (requestParameters.namespaceName === null || requestParameters.namespaceName === undefined) { + throw new runtime.RequiredError('namespaceName','Required parameter requestParameters.namespaceName was null or undefined when calling initAppPermission.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/namespaces/{namespaceName}/permission-init`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"namespaceName"}}`, encodeURIComponent(String(requestParameters.namespaceName))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 初始化应用权限 (new added) + */ + async initAppPermission(requestParameters: InitAppPermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.initAppPermissionRaw(requestParameters, initOverrides); + } + + /** + * + * 初始化集群Namespace权限 (new added) + */ + async initClusterNamespacePermissionRaw(requestParameters: InitClusterNamespacePermissionRequest, 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 initClusterNamespacePermission.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling initClusterNamespacePermission.'); + } + + if (requestParameters.clusterName === null || requestParameters.clusterName === undefined) { + throw new runtime.RequiredError('clusterName','Required parameter requestParameters.clusterName was null or undefined when calling initClusterNamespacePermission.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/permission-init`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))).replace(`{${"clusterName"}}`, encodeURIComponent(String(requestParameters.clusterName))), + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 初始化集群Namespace权限 (new added) + */ + async initClusterNamespacePermission(requestParameters: InitClusterNamespacePermissionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.initClusterNamespacePermissionRaw(requestParameters, initOverrides); + } + + /** + * + * 校验AppMaster开关 (new added) + */ + async isManageAppMasterPermissionEnabledRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/system/role/manage-app-master`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * + * 校验AppMaster开关 (new added) + */ + async isManageAppMasterPermissionEnabled(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: boolean; }> { + const response = await this.isManageAppMasterPermissionEnabledRaw(initOverrides); + return await response.value(); + } + + /** + * + * 移除应用角色 (new added) + */ + async removeAppRoleFromUserRaw(requestParameters: RemoveAppRoleFromUserRequest, 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 removeAppRoleFromUser.'); + } + + if (requestParameters.roleType === null || requestParameters.roleType === undefined) { + throw new runtime.RequiredError('roleType','Required parameter requestParameters.roleType was null or undefined when calling removeAppRoleFromUser.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling removeAppRoleFromUser.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/roles/{roleType}`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"roleType"}}`, encodeURIComponent(String(requestParameters.roleType))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 移除应用角色 (new added) + */ + async removeAppRoleFromUser(requestParameters: RemoveAppRoleFromUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.removeAppRoleFromUserRaw(requestParameters, initOverrides); + } + + /** + * + * 移除集群Namespace角色 (new added) + */ + async removeClusterNamespaceRoleFromUserRaw(requestParameters: RemoveClusterNamespaceRoleFromUserRequest, 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 removeClusterNamespaceRoleFromUser.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling removeClusterNamespaceRoleFromUser.'); + } + + if (requestParameters.clusterName === null || requestParameters.clusterName === undefined) { + throw new runtime.RequiredError('clusterName','Required parameter requestParameters.clusterName was null or undefined when calling removeClusterNamespaceRoleFromUser.'); + } + + if (requestParameters.roleType === null || requestParameters.roleType === undefined) { + throw new runtime.RequiredError('roleType','Required parameter requestParameters.roleType was null or undefined when calling removeClusterNamespaceRoleFromUser.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling removeClusterNamespaceRoleFromUser.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/clusters/{clusterName}/roles/{roleType}`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))).replace(`{${"clusterName"}}`, encodeURIComponent(String(requestParameters.clusterName))).replace(`{${"roleType"}}`, encodeURIComponent(String(requestParameters.roleType))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 移除集群Namespace角色 (new added) + */ + async removeClusterNamespaceRoleFromUser(requestParameters: RemoveClusterNamespaceRoleFromUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.removeClusterNamespaceRoleFromUserRaw(requestParameters, initOverrides); + } + + /** + * + * 移除AppMaster (new added) + */ + async removeManageAppMasterRoleFromUserRaw(requestParameters: RemoveManageAppMasterRoleFromUserRequest, 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 removeManageAppMasterRoleFromUser.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling removeManageAppMasterRoleFromUser.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/roles/master`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 移除AppMaster (new added) + */ + async removeManageAppMasterRoleFromUser(requestParameters: RemoveManageAppMasterRoleFromUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.removeManageAppMasterRoleFromUserRaw(requestParameters, initOverrides); + } + + /** + * + * 移除环境Namespace角色 (new added) + */ + async removeNamespaceEnvRoleFromUserRaw(requestParameters: RemoveNamespaceEnvRoleFromUserRequest, 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 removeNamespaceEnvRoleFromUser.'); + } + + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling removeNamespaceEnvRoleFromUser.'); + } + + if (requestParameters.namespaceName === null || requestParameters.namespaceName === undefined) { + throw new runtime.RequiredError('namespaceName','Required parameter requestParameters.namespaceName was null or undefined when calling removeNamespaceEnvRoleFromUser.'); + } + + if (requestParameters.roleType === null || requestParameters.roleType === undefined) { + throw new runtime.RequiredError('roleType','Required parameter requestParameters.roleType was null or undefined when calling removeNamespaceEnvRoleFromUser.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling removeNamespaceEnvRoleFromUser.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/envs/{env}/namespaces/{namespaceName}/roles/{roleType}`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))).replace(`{${"namespaceName"}}`, encodeURIComponent(String(requestParameters.namespaceName))).replace(`{${"roleType"}}`, encodeURIComponent(String(requestParameters.roleType))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 移除环境Namespace角色 (new added) + */ + async removeNamespaceEnvRoleFromUser(requestParameters: RemoveNamespaceEnvRoleFromUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.removeNamespaceEnvRoleFromUserRaw(requestParameters, initOverrides); + } + + /** + * + * 移除Namespace角色 (new added) + */ + async removeNamespaceRoleFromUserRaw(requestParameters: RemoveNamespaceRoleFromUserRequest, 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 removeNamespaceRoleFromUser.'); + } + + if (requestParameters.namespaceName === null || requestParameters.namespaceName === undefined) { + throw new runtime.RequiredError('namespaceName','Required parameter requestParameters.namespaceName was null or undefined when calling removeNamespaceRoleFromUser.'); + } + + if (requestParameters.roleType === null || requestParameters.roleType === undefined) { + throw new runtime.RequiredError('roleType','Required parameter requestParameters.roleType was null or undefined when calling removeNamespaceRoleFromUser.'); + } + + if (requestParameters.userId === null || requestParameters.userId === undefined) { + throw new runtime.RequiredError('userId','Required parameter requestParameters.userId was null or undefined when calling removeNamespaceRoleFromUser.'); + } + + const queryParameters: any = {}; + + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + + if (requestParameters.userId !== undefined) { + queryParameters['userId'] = requestParameters.userId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/apps/{appId}/namespaces/{namespaceName}/roles/{roleType}`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"namespaceName"}}`, encodeURIComponent(String(requestParameters.namespaceName))).replace(`{${"roleType"}}`, encodeURIComponent(String(requestParameters.roleType))), + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * 移除Namespace角色 (new added) + */ + async removeNamespaceRoleFromUser(requestParameters: RemoveNamespaceRoleFromUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.removeNamespaceRoleFromUserRaw(requestParameters, initOverrides); + } + +} diff --git a/typescript/src/apis/ReleaseManagementApi.ts b/typescript/src/apis/ReleaseManagementApi.ts index ac583c0..2cf32b1 100644 --- a/typescript/src/apis/ReleaseManagementApi.ts +++ b/typescript/src/apis/ReleaseManagementApi.ts @@ -18,8 +18,8 @@ import type { ExceptionResponse, NamespaceGrayDelReleaseDTO, NamespaceReleaseDTO, - OpenReleaseBO, OpenReleaseDTO, + OpenReleaseDiffDTO, } from '../models'; import { ExceptionResponseFromJSON, @@ -28,12 +28,18 @@ import { NamespaceGrayDelReleaseDTOToJSON, NamespaceReleaseDTOFromJSON, NamespaceReleaseDTOToJSON, - OpenReleaseBOFromJSON, - OpenReleaseBOToJSON, OpenReleaseDTOFromJSON, OpenReleaseDTOToJSON, + OpenReleaseDiffDTOFromJSON, + OpenReleaseDiffDTOToJSON, } from '../models'; +export interface CompareReleaseRequest { + env: string; + baseReleaseId: number; + toCompareReleaseId: number; +} + export interface CreateGrayDelReleaseRequest { appId: string; env: string; @@ -41,6 +47,7 @@ export interface CreateGrayDelReleaseRequest { namespaceName: string; branchName: string; namespaceGrayDelReleaseDTO: NamespaceGrayDelReleaseDTO; + operator?: string; } export interface CreateGrayReleaseRequest { @@ -50,6 +57,7 @@ export interface CreateGrayReleaseRequest { namespaceName: string; branchName: string; namespaceReleaseDTO: NamespaceReleaseDTO; + operator?: string; } export interface CreateReleaseRequest { @@ -58,6 +66,7 @@ export interface CreateReleaseRequest { clusterName: string; namespaceName: string; namespaceReleaseDTO: NamespaceReleaseDTO; + operator?: string; } export interface FindActiveReleasesRequest { @@ -69,15 +78,6 @@ export interface FindActiveReleasesRequest { size: number; } -export interface FindAllReleasesRequest { - appId: string; - env: string; - clusterName: string; - namespaceName: string; - page: number; - size: number; -} - export interface GetReleaseByIdRequest { env: string; releaseId: number; @@ -101,6 +101,58 @@ export interface RollbackRequest { */ export class ReleaseManagementApi extends runtime.BaseAPI { + /** + * Get the configuration differences between two releases. + * Compare two releases + */ + async compareReleaseRaw(requestParameters: CompareReleaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters.env === null || requestParameters.env === undefined) { + throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling compareRelease.'); + } + + if (requestParameters.baseReleaseId === null || requestParameters.baseReleaseId === undefined) { + throw new runtime.RequiredError('baseReleaseId','Required parameter requestParameters.baseReleaseId was null or undefined when calling compareRelease.'); + } + + if (requestParameters.toCompareReleaseId === null || requestParameters.toCompareReleaseId === undefined) { + throw new runtime.RequiredError('toCompareReleaseId','Required parameter requestParameters.toCompareReleaseId was null or undefined when calling compareRelease.'); + } + + const queryParameters: any = {}; + + if (requestParameters.baseReleaseId !== undefined) { + queryParameters['baseReleaseId'] = requestParameters.baseReleaseId; + } + + if (requestParameters.toCompareReleaseId !== undefined) { + queryParameters['toCompareReleaseId'] = requestParameters.toCompareReleaseId; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication + } + + const response = await this.request({ + path: `/openapi/v1/envs/{env}/releases/comparison`.replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OpenReleaseDiffDTOFromJSON(jsonValue)); + } + + /** + * Get the configuration differences between two releases. + * Compare two releases + */ + async compareRelease(requestParameters: CompareReleaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.compareReleaseRaw(requestParameters, initOverrides); + return await response.value(); + } + /** * * 创建灰度删除发布 (original openapi) @@ -132,6 +184,10 @@ export class ReleaseManagementApi extends runtime.BaseAPI { const queryParameters: any = {}; + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; @@ -191,6 +247,10 @@ export class ReleaseManagementApi extends runtime.BaseAPI { const queryParameters: any = {}; + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; @@ -246,6 +306,10 @@ export class ReleaseManagementApi extends runtime.BaseAPI { const queryParameters: any = {}; + if (requestParameters.operator !== undefined) { + queryParameters['operator'] = requestParameters.operator; + } + const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; @@ -338,70 +402,6 @@ export class ReleaseManagementApi extends runtime.BaseAPI { return await response.value(); } - /** - * GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all - * 获取所有发布(分页) (new added) - */ - async findAllReleasesRaw(requestParameters: FindAllReleasesRequest, 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 findAllReleases.'); - } - - if (requestParameters.env === null || requestParameters.env === undefined) { - throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling findAllReleases.'); - } - - if (requestParameters.clusterName === null || requestParameters.clusterName === undefined) { - throw new runtime.RequiredError('clusterName','Required parameter requestParameters.clusterName was null or undefined when calling findAllReleases.'); - } - - if (requestParameters.namespaceName === null || requestParameters.namespaceName === undefined) { - throw new runtime.RequiredError('namespaceName','Required parameter requestParameters.namespaceName was null or undefined when calling findAllReleases.'); - } - - if (requestParameters.page === null || requestParameters.page === undefined) { - throw new runtime.RequiredError('page','Required parameter requestParameters.page was null or undefined when calling findAllReleases.'); - } - - if (requestParameters.size === null || requestParameters.size === undefined) { - throw new runtime.RequiredError('size','Required parameter requestParameters.size was null or undefined when calling findAllReleases.'); - } - - const queryParameters: any = {}; - - if (requestParameters.page !== undefined) { - queryParameters['page'] = requestParameters.page; - } - - if (requestParameters.size !== undefined) { - queryParameters['size'] = requestParameters.size; - } - - const headerParameters: runtime.HTTPHeaders = {}; - - if (this.configuration && this.configuration.apiKey) { - headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication - } - - const response = await this.request({ - path: `/openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all`.replace(`{${"appId"}}`, encodeURIComponent(String(requestParameters.appId))).replace(`{${"env"}}`, encodeURIComponent(String(requestParameters.env))).replace(`{${"clusterName"}}`, encodeURIComponent(String(requestParameters.clusterName))).replace(`{${"namespaceName"}}`, encodeURIComponent(String(requestParameters.namespaceName))), - method: 'GET', - headers: headerParameters, - query: queryParameters, - }, initOverrides); - - return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(OpenReleaseBOFromJSON)); - } - - /** - * GET /openapi/v1/envs/{env}/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all - * 获取所有发布(分页) (new added) - */ - async findAllReleases(requestParameters: FindAllReleasesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { - const response = await this.findAllReleasesRaw(requestParameters, initOverrides); - return await response.value(); - } - /** * GET /openapi/v1/envs/{env}/releases/{releaseId} * 获取发布详情 (new added) @@ -494,7 +494,7 @@ export class ReleaseManagementApi extends runtime.BaseAPI { * 回滚到指定的发布版本 * 回滚发布 (original openapi) */ - async rollbackRaw(requestParameters: RollbackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async rollbackRaw(requestParameters: RollbackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.env === null || requestParameters.env === undefined) { throw new runtime.RequiredError('env','Required parameter requestParameters.env was null or undefined when calling rollback.'); } @@ -522,16 +522,15 @@ export class ReleaseManagementApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.JSONApiResponse(response); + return new runtime.VoidApiResponse(response); } /** * 回滚到指定的发布版本 * 回滚发布 (original openapi) */ - async rollback(requestParameters: RollbackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - const response = await this.rollbackRaw(requestParameters, initOverrides); - return await response.value(); + async rollback(requestParameters: RollbackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.rollbackRaw(requestParameters, initOverrides); } } diff --git a/typescript/src/apis/index.ts b/typescript/src/apis/index.ts index e84d125..4dac672 100644 --- a/typescript/src/apis/index.ts +++ b/typescript/src/apis/index.ts @@ -1,5 +1,6 @@ /* tslint:disable */ /* eslint-disable */ +export * from './AccessKeyManagementApi'; export * from './AppManagementApi'; export * from './AppNamespaceManagementApi'; export * from './ClusterManagementApi'; @@ -10,4 +11,5 @@ export * from './NamespaceBranchManagementApi'; export * from './NamespaceLockManagementApi'; export * from './NamespaceManagementApi'; export * from './OrganizationManagementApi'; +export * from './PermissionManagementApi'; export * from './ReleaseManagementApi'; diff --git a/typescript/src/models/OpenAccessKeyDTO.ts b/typescript/src/models/OpenAccessKeyDTO.ts new file mode 100644 index 0000000..d8213bd --- /dev/null +++ b/typescript/src/models/OpenAccessKeyDTO.ts @@ -0,0 +1,144 @@ +/* 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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 OpenAccessKeyDTO + */ +export interface OpenAccessKeyDTO { + /** + * + * @type {string} + * @memberof OpenAccessKeyDTO + */ + dataChangeCreatedBy?: string; + /** + * + * @type {string} + * @memberof OpenAccessKeyDTO + */ + dataChangeLastModifiedBy?: string; + /** + * + * @type {string} + * @memberof OpenAccessKeyDTO + */ + dataChangeCreatedByDisplayName?: string; + /** + * + * @type {string} + * @memberof OpenAccessKeyDTO + */ + dataChangeLastModifiedByDisplayName?: string; + /** + * + * @type {string} + * @memberof OpenAccessKeyDTO + */ + dataChangeCreatedTime?: string; + /** + * + * @type {string} + * @memberof OpenAccessKeyDTO + */ + dataChangeLastModifiedTime?: string; + /** + * + * @type {number} + * @memberof OpenAccessKeyDTO + */ + id?: number; + /** + * + * @type {string} + * @memberof OpenAccessKeyDTO + */ + secret?: string; + /** + * + * @type {string} + * @memberof OpenAccessKeyDTO + */ + appId?: string; + /** + * + * @type {number} + * @memberof OpenAccessKeyDTO + */ + mode?: number; + /** + * + * @type {boolean} + * @memberof OpenAccessKeyDTO + */ + enabled?: boolean; +} + +/** + * Check if a given object implements the OpenAccessKeyDTO interface. + */ +export function instanceOfOpenAccessKeyDTO(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function OpenAccessKeyDTOFromJSON(json: any): OpenAccessKeyDTO { + return OpenAccessKeyDTOFromJSONTyped(json, false); +} + +export function OpenAccessKeyDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenAccessKeyDTO { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'dataChangeCreatedBy': !exists(json, 'dataChangeCreatedBy') ? undefined : json['dataChangeCreatedBy'], + 'dataChangeLastModifiedBy': !exists(json, 'dataChangeLastModifiedBy') ? undefined : json['dataChangeLastModifiedBy'], + 'dataChangeCreatedByDisplayName': !exists(json, 'dataChangeCreatedByDisplayName') ? undefined : json['dataChangeCreatedByDisplayName'], + 'dataChangeLastModifiedByDisplayName': !exists(json, 'dataChangeLastModifiedByDisplayName') ? undefined : json['dataChangeLastModifiedByDisplayName'], + 'dataChangeCreatedTime': !exists(json, 'dataChangeCreatedTime') ? undefined : json['dataChangeCreatedTime'], + 'dataChangeLastModifiedTime': !exists(json, 'dataChangeLastModifiedTime') ? undefined : json['dataChangeLastModifiedTime'], + 'id': !exists(json, 'id') ? undefined : json['id'], + 'secret': !exists(json, 'secret') ? undefined : json['secret'], + 'appId': !exists(json, 'appId') ? undefined : json['appId'], + 'mode': !exists(json, 'mode') ? undefined : json['mode'], + 'enabled': !exists(json, 'enabled') ? undefined : json['enabled'], + }; +} + +export function OpenAccessKeyDTOToJSON(value?: OpenAccessKeyDTO | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'dataChangeCreatedBy': value.dataChangeCreatedBy, + 'dataChangeLastModifiedBy': value.dataChangeLastModifiedBy, + 'dataChangeCreatedByDisplayName': value.dataChangeCreatedByDisplayName, + 'dataChangeLastModifiedByDisplayName': value.dataChangeLastModifiedByDisplayName, + 'dataChangeCreatedTime': value.dataChangeCreatedTime, + 'dataChangeLastModifiedTime': value.dataChangeLastModifiedTime, + 'id': value.id, + 'secret': value.secret, + 'appId': value.appId, + 'mode': value.mode, + 'enabled': value.enabled, + }; +} diff --git a/typescript/src/models/OpenReleaseBO.ts b/typescript/src/models/OpenAppRoleUserDTO.ts similarity index 51% rename from typescript/src/models/OpenReleaseBO.ts rename to typescript/src/models/OpenAppRoleUserDTO.ts index 67a3ff3..ab1730e 100644 --- a/typescript/src/models/OpenReleaseBO.ts +++ b/typescript/src/models/OpenAppRoleUserDTO.ts @@ -13,64 +13,58 @@ */ import { exists, mapValues } from '../runtime'; -import type { KVEntity } from './KVEntity'; +import type { OpenUserInfoDTO } from './OpenUserInfoDTO'; import { - KVEntityFromJSON, - KVEntityFromJSONTyped, - KVEntityToJSON, -} from './KVEntity'; -import type { OpenReleaseDTO } from './OpenReleaseDTO'; -import { - OpenReleaseDTOFromJSON, - OpenReleaseDTOFromJSONTyped, - OpenReleaseDTOToJSON, -} from './OpenReleaseDTO'; + OpenUserInfoDTOFromJSON, + OpenUserInfoDTOFromJSONTyped, + OpenUserInfoDTOToJSON, +} from './OpenUserInfoDTO'; /** * * @export - * @interface OpenReleaseBO + * @interface OpenAppRoleUserDTO */ -export interface OpenReleaseBO { +export interface OpenAppRoleUserDTO { /** * - * @type {OpenReleaseDTO} - * @memberof OpenReleaseBO + * @type {string} + * @memberof OpenAppRoleUserDTO */ - baseInfo?: OpenReleaseDTO; + appId?: string; /** * - * @type {Array} - * @memberof OpenReleaseBO + * @type {Array} + * @memberof OpenAppRoleUserDTO */ - items?: Array; + masterUsers?: Array; } /** - * Check if a given object implements the OpenReleaseBO interface. + * Check if a given object implements the OpenAppRoleUserDTO interface. */ -export function instanceOfOpenReleaseBO(value: object): boolean { +export function instanceOfOpenAppRoleUserDTO(value: object): boolean { let isInstance = true; return isInstance; } -export function OpenReleaseBOFromJSON(json: any): OpenReleaseBO { - return OpenReleaseBOFromJSONTyped(json, false); +export function OpenAppRoleUserDTOFromJSON(json: any): OpenAppRoleUserDTO { + return OpenAppRoleUserDTOFromJSONTyped(json, false); } -export function OpenReleaseBOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenReleaseBO { +export function OpenAppRoleUserDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenAppRoleUserDTO { if ((json === undefined) || (json === null)) { return json; } return { - 'baseInfo': !exists(json, 'baseInfo') ? undefined : OpenReleaseDTOFromJSON(json['baseInfo']), - 'items': !exists(json, 'items') ? undefined : ((json['items'] as Array).map(KVEntityFromJSON)), + 'appId': !exists(json, 'appId') ? undefined : json['appId'], + 'masterUsers': !exists(json, 'masterUsers') ? undefined : ((json['masterUsers'] as Array).map(OpenUserInfoDTOFromJSON)), }; } -export function OpenReleaseBOToJSON(value?: OpenReleaseBO | null): any { +export function OpenAppRoleUserDTOToJSON(value?: OpenAppRoleUserDTO | null): any { if (value === undefined) { return undefined; } @@ -79,7 +73,7 @@ export function OpenReleaseBOToJSON(value?: OpenReleaseBO | null): any { } return { - 'baseInfo': OpenReleaseDTOToJSON(value.baseInfo), - 'items': value.items === undefined ? undefined : ((value.items as Array).map(KVEntityToJSON)), + 'appId': value.appId, + 'masterUsers': value.masterUsers === undefined ? undefined : ((value.masterUsers as Array).map(OpenUserInfoDTOToJSON)), }; } diff --git a/typescript/src/models/OpenClusterNamespaceRoleUserDTO.ts b/typescript/src/models/OpenClusterNamespaceRoleUserDTO.ts new file mode 100644 index 0000000..2e4b03d --- /dev/null +++ b/typescript/src/models/OpenClusterNamespaceRoleUserDTO.ts @@ -0,0 +1,103 @@ +/* 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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'; +import type { OpenUserInfoDTO } from './OpenUserInfoDTO'; +import { + OpenUserInfoDTOFromJSON, + OpenUserInfoDTOFromJSONTyped, + OpenUserInfoDTOToJSON, +} from './OpenUserInfoDTO'; + +/** + * + * @export + * @interface OpenClusterNamespaceRoleUserDTO + */ +export interface OpenClusterNamespaceRoleUserDTO { + /** + * + * @type {string} + * @memberof OpenClusterNamespaceRoleUserDTO + */ + appId?: string; + /** + * + * @type {string} + * @memberof OpenClusterNamespaceRoleUserDTO + */ + env?: string; + /** + * + * @type {string} + * @memberof OpenClusterNamespaceRoleUserDTO + */ + cluster?: string; + /** + * + * @type {Array} + * @memberof OpenClusterNamespaceRoleUserDTO + */ + modifyRoleUsers?: Array; + /** + * + * @type {Array} + * @memberof OpenClusterNamespaceRoleUserDTO + */ + releaseRoleUsers?: Array; +} + +/** + * Check if a given object implements the OpenClusterNamespaceRoleUserDTO interface. + */ +export function instanceOfOpenClusterNamespaceRoleUserDTO(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function OpenClusterNamespaceRoleUserDTOFromJSON(json: any): OpenClusterNamespaceRoleUserDTO { + return OpenClusterNamespaceRoleUserDTOFromJSONTyped(json, false); +} + +export function OpenClusterNamespaceRoleUserDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenClusterNamespaceRoleUserDTO { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'appId': !exists(json, 'appId') ? undefined : json['appId'], + 'env': !exists(json, 'env') ? undefined : json['env'], + 'cluster': !exists(json, 'cluster') ? undefined : json['cluster'], + 'modifyRoleUsers': !exists(json, 'modifyRoleUsers') ? undefined : ((json['modifyRoleUsers'] as Array).map(OpenUserInfoDTOFromJSON)), + 'releaseRoleUsers': !exists(json, 'releaseRoleUsers') ? undefined : ((json['releaseRoleUsers'] as Array).map(OpenUserInfoDTOFromJSON)), + }; +} + +export function OpenClusterNamespaceRoleUserDTOToJSON(value?: OpenClusterNamespaceRoleUserDTO | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'appId': value.appId, + 'env': value.env, + 'cluster': value.cluster, + 'modifyRoleUsers': value.modifyRoleUsers === undefined ? undefined : ((value.modifyRoleUsers as Array).map(OpenUserInfoDTOToJSON)), + 'releaseRoleUsers': value.releaseRoleUsers === undefined ? undefined : ((value.releaseRoleUsers as Array).map(OpenUserInfoDTOToJSON)), + }; +} diff --git a/typescript/src/models/OpenEnvNamespaceRoleUserDTO.ts b/typescript/src/models/OpenEnvNamespaceRoleUserDTO.ts new file mode 100644 index 0000000..9d51691 --- /dev/null +++ b/typescript/src/models/OpenEnvNamespaceRoleUserDTO.ts @@ -0,0 +1,103 @@ +/* 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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'; +import type { OpenUserInfoDTO } from './OpenUserInfoDTO'; +import { + OpenUserInfoDTOFromJSON, + OpenUserInfoDTOFromJSONTyped, + OpenUserInfoDTOToJSON, +} from './OpenUserInfoDTO'; + +/** + * + * @export + * @interface OpenEnvNamespaceRoleUserDTO + */ +export interface OpenEnvNamespaceRoleUserDTO { + /** + * + * @type {string} + * @memberof OpenEnvNamespaceRoleUserDTO + */ + appId?: string; + /** + * + * @type {string} + * @memberof OpenEnvNamespaceRoleUserDTO + */ + namespaceName?: string; + /** + * + * @type {Array} + * @memberof OpenEnvNamespaceRoleUserDTO + */ + modifyRoleUsers?: Array; + /** + * + * @type {Array} + * @memberof OpenEnvNamespaceRoleUserDTO + */ + releaseRoleUsers?: Array; + /** + * + * @type {string} + * @memberof OpenEnvNamespaceRoleUserDTO + */ + env?: string; +} + +/** + * Check if a given object implements the OpenEnvNamespaceRoleUserDTO interface. + */ +export function instanceOfOpenEnvNamespaceRoleUserDTO(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function OpenEnvNamespaceRoleUserDTOFromJSON(json: any): OpenEnvNamespaceRoleUserDTO { + return OpenEnvNamespaceRoleUserDTOFromJSONTyped(json, false); +} + +export function OpenEnvNamespaceRoleUserDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenEnvNamespaceRoleUserDTO { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'appId': !exists(json, 'appId') ? undefined : json['appId'], + 'namespaceName': !exists(json, 'namespaceName') ? undefined : json['namespaceName'], + 'modifyRoleUsers': !exists(json, 'modifyRoleUsers') ? undefined : ((json['modifyRoleUsers'] as Array).map(OpenUserInfoDTOFromJSON)), + 'releaseRoleUsers': !exists(json, 'releaseRoleUsers') ? undefined : ((json['releaseRoleUsers'] as Array).map(OpenUserInfoDTOFromJSON)), + 'env': !exists(json, 'env') ? undefined : json['env'], + }; +} + +export function OpenEnvNamespaceRoleUserDTOToJSON(value?: OpenEnvNamespaceRoleUserDTO | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'appId': value.appId, + 'namespaceName': value.namespaceName, + 'modifyRoleUsers': value.modifyRoleUsers === undefined ? undefined : ((value.modifyRoleUsers as Array).map(OpenUserInfoDTOToJSON)), + 'releaseRoleUsers': value.releaseRoleUsers === undefined ? undefined : ((value.releaseRoleUsers as Array).map(OpenUserInfoDTOToJSON)), + 'env': value.env, + }; +} diff --git a/typescript/src/models/OpenNamespaceRoleUserDTO.ts b/typescript/src/models/OpenNamespaceRoleUserDTO.ts new file mode 100644 index 0000000..dcada37 --- /dev/null +++ b/typescript/src/models/OpenNamespaceRoleUserDTO.ts @@ -0,0 +1,95 @@ +/* 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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'; +import type { OpenUserInfoDTO } from './OpenUserInfoDTO'; +import { + OpenUserInfoDTOFromJSON, + OpenUserInfoDTOFromJSONTyped, + OpenUserInfoDTOToJSON, +} from './OpenUserInfoDTO'; + +/** + * + * @export + * @interface OpenNamespaceRoleUserDTO + */ +export interface OpenNamespaceRoleUserDTO { + /** + * + * @type {string} + * @memberof OpenNamespaceRoleUserDTO + */ + appId?: string; + /** + * + * @type {string} + * @memberof OpenNamespaceRoleUserDTO + */ + namespaceName?: string; + /** + * + * @type {Array} + * @memberof OpenNamespaceRoleUserDTO + */ + modifyRoleUsers?: Array; + /** + * + * @type {Array} + * @memberof OpenNamespaceRoleUserDTO + */ + releaseRoleUsers?: Array; +} + +/** + * Check if a given object implements the OpenNamespaceRoleUserDTO interface. + */ +export function instanceOfOpenNamespaceRoleUserDTO(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function OpenNamespaceRoleUserDTOFromJSON(json: any): OpenNamespaceRoleUserDTO { + return OpenNamespaceRoleUserDTOFromJSONTyped(json, false); +} + +export function OpenNamespaceRoleUserDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenNamespaceRoleUserDTO { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'appId': !exists(json, 'appId') ? undefined : json['appId'], + 'namespaceName': !exists(json, 'namespaceName') ? undefined : json['namespaceName'], + 'modifyRoleUsers': !exists(json, 'modifyRoleUsers') ? undefined : ((json['modifyRoleUsers'] as Array).map(OpenUserInfoDTOFromJSON)), + 'releaseRoleUsers': !exists(json, 'releaseRoleUsers') ? undefined : ((json['releaseRoleUsers'] as Array).map(OpenUserInfoDTOFromJSON)), + }; +} + +export function OpenNamespaceRoleUserDTOToJSON(value?: OpenNamespaceRoleUserDTO | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'appId': value.appId, + 'namespaceName': value.namespaceName, + 'modifyRoleUsers': value.modifyRoleUsers === undefined ? undefined : ((value.modifyRoleUsers as Array).map(OpenUserInfoDTOToJSON)), + 'releaseRoleUsers': value.releaseRoleUsers === undefined ? undefined : ((value.releaseRoleUsers as Array).map(OpenUserInfoDTOToJSON)), + }; +} diff --git a/typescript/src/models/KVEntity.ts b/typescript/src/models/OpenPermissionConditionDTO.ts similarity index 61% rename from typescript/src/models/KVEntity.ts rename to typescript/src/models/OpenPermissionConditionDTO.ts index e9644c4..4ef06a8 100644 --- a/typescript/src/models/KVEntity.ts +++ b/typescript/src/models/OpenPermissionConditionDTO.ts @@ -16,48 +16,41 @@ import { exists, mapValues } from '../runtime'; /** * * @export - * @interface KVEntity + * @interface OpenPermissionConditionDTO */ -export interface KVEntity { +export interface OpenPermissionConditionDTO { /** - * 键 - * @type {string} - * @memberof KVEntity + * + * @type {boolean} + * @memberof OpenPermissionConditionDTO */ - key?: string; - /** - * 值 - * @type {string} - * @memberof KVEntity - */ - value?: string; + hasPermission?: boolean; } /** - * Check if a given object implements the KVEntity interface. + * Check if a given object implements the OpenPermissionConditionDTO interface. */ -export function instanceOfKVEntity(value: object): boolean { +export function instanceOfOpenPermissionConditionDTO(value: object): boolean { let isInstance = true; return isInstance; } -export function KVEntityFromJSON(json: any): KVEntity { - return KVEntityFromJSONTyped(json, false); +export function OpenPermissionConditionDTOFromJSON(json: any): OpenPermissionConditionDTO { + return OpenPermissionConditionDTOFromJSONTyped(json, false); } -export function KVEntityFromJSONTyped(json: any, ignoreDiscriminator: boolean): KVEntity { +export function OpenPermissionConditionDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenPermissionConditionDTO { if ((json === undefined) || (json === null)) { return json; } return { - 'key': !exists(json, 'key') ? undefined : json['key'], - 'value': !exists(json, 'value') ? undefined : json['value'], + 'hasPermission': !exists(json, 'hasPermission') ? undefined : json['hasPermission'], }; } -export function KVEntityToJSON(value?: KVEntity | null): any { +export function OpenPermissionConditionDTOToJSON(value?: OpenPermissionConditionDTO | null): any { if (value === undefined) { return undefined; } @@ -66,7 +59,6 @@ export function KVEntityToJSON(value?: KVEntity | null): any { } return { - 'key': value.key, - 'value': value.value, + 'hasPermission': value.hasPermission, }; } diff --git a/typescript/src/models/OpenReleaseChangeDTO.ts b/typescript/src/models/OpenReleaseChangeDTO.ts new file mode 100644 index 0000000..b10f7dd --- /dev/null +++ b/typescript/src/models/OpenReleaseChangeDTO.ts @@ -0,0 +1,88 @@ +/* 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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 OpenReleaseChangeDTO + */ +export interface OpenReleaseChangeDTO { + /** + * 修改类型 + * @type {string} + * @memberof OpenReleaseChangeDTO + */ + changeType?: string; + /** + * key + * @type {string} + * @memberof OpenReleaseChangeDTO + */ + key?: string; + /** + * new value + * @type {string} + * @memberof OpenReleaseChangeDTO + */ + newValue?: string; + /** + * old value + * @type {string} + * @memberof OpenReleaseChangeDTO + */ + oldValue?: string; +} + +/** + * Check if a given object implements the OpenReleaseChangeDTO interface. + */ +export function instanceOfOpenReleaseChangeDTO(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function OpenReleaseChangeDTOFromJSON(json: any): OpenReleaseChangeDTO { + return OpenReleaseChangeDTOFromJSONTyped(json, false); +} + +export function OpenReleaseChangeDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenReleaseChangeDTO { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'changeType': !exists(json, 'changeType') ? undefined : json['changeType'], + 'key': !exists(json, 'key') ? undefined : json['key'], + 'newValue': !exists(json, 'newValue') ? undefined : json['newValue'], + 'oldValue': !exists(json, 'oldValue') ? undefined : json['oldValue'], + }; +} + +export function OpenReleaseChangeDTOToJSON(value?: OpenReleaseChangeDTO | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'changeType': value.changeType, + 'key': value.key, + 'newValue': value.newValue, + 'oldValue': value.oldValue, + }; +} diff --git a/typescript/src/models/OpenReleaseDiffDTO.ts b/typescript/src/models/OpenReleaseDiffDTO.ts new file mode 100644 index 0000000..1baf713 --- /dev/null +++ b/typescript/src/models/OpenReleaseDiffDTO.ts @@ -0,0 +1,71 @@ +/* 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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'; +import type { OpenReleaseChangeDTO } from './OpenReleaseChangeDTO'; +import { + OpenReleaseChangeDTOFromJSON, + OpenReleaseChangeDTOFromJSONTyped, + OpenReleaseChangeDTOToJSON, +} from './OpenReleaseChangeDTO'; + +/** + * + * @export + * @interface OpenReleaseDiffDTO + */ +export interface OpenReleaseDiffDTO { + /** + * A list of changes, ensuring order if necessary. + * @type {Array} + * @memberof OpenReleaseDiffDTO + */ + changes?: Array; +} + +/** + * Check if a given object implements the OpenReleaseDiffDTO interface. + */ +export function instanceOfOpenReleaseDiffDTO(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function OpenReleaseDiffDTOFromJSON(json: any): OpenReleaseDiffDTO { + return OpenReleaseDiffDTOFromJSONTyped(json, false); +} + +export function OpenReleaseDiffDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenReleaseDiffDTO { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'changes': !exists(json, 'changes') ? undefined : ((json['changes'] as Array).map(OpenReleaseChangeDTOFromJSON)), + }; +} + +export function OpenReleaseDiffDTOToJSON(value?: OpenReleaseDiffDTO | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'changes': value.changes === undefined ? undefined : ((value.changes as Array).map(OpenReleaseChangeDTOToJSON)), + }; +} diff --git a/typescript/src/models/OpenUserInfoDTO.ts b/typescript/src/models/OpenUserInfoDTO.ts new file mode 100644 index 0000000..90da43b --- /dev/null +++ b/typescript/src/models/OpenUserInfoDTO.ts @@ -0,0 +1,88 @@ +/* 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\"
+ * + * The version of the OpenAPI document: 1.0.0 + * + * + * 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 OpenUserInfoDTO + */ +export interface OpenUserInfoDTO { + /** + * + * @type {string} + * @memberof OpenUserInfoDTO + */ + userId?: string; + /** + * + * @type {string} + * @memberof OpenUserInfoDTO + */ + name?: string; + /** + * + * @type {string} + * @memberof OpenUserInfoDTO + */ + email?: string; + /** + * + * @type {number} + * @memberof OpenUserInfoDTO + */ + enabled?: number; +} + +/** + * Check if a given object implements the OpenUserInfoDTO interface. + */ +export function instanceOfOpenUserInfoDTO(value: object): boolean { + let isInstance = true; + + return isInstance; +} + +export function OpenUserInfoDTOFromJSON(json: any): OpenUserInfoDTO { + return OpenUserInfoDTOFromJSONTyped(json, false); +} + +export function OpenUserInfoDTOFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpenUserInfoDTO { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'userId': !exists(json, 'userId') ? undefined : json['userId'], + 'name': !exists(json, 'name') ? undefined : json['name'], + 'email': !exists(json, 'email') ? undefined : json['email'], + 'enabled': !exists(json, 'enabled') ? undefined : json['enabled'], + }; +} + +export function OpenUserInfoDTOToJSON(value?: OpenUserInfoDTO | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'userId': value.userId, + 'name': value.name, + 'email': value.email, + 'enabled': value.enabled, + }; +} diff --git a/typescript/src/models/index.ts b/typescript/src/models/index.ts index c946878..39405b4 100644 --- a/typescript/src/models/index.ts +++ b/typescript/src/models/index.ts @@ -1,17 +1,20 @@ /* tslint:disable */ /* eslint-disable */ export * from './ExceptionResponse'; -export * from './KVEntity'; export * from './NamespaceGrayDelReleaseDTO'; export * from './NamespaceReleaseDTO'; +export * from './OpenAccessKeyDTO'; export * from './OpenAppDTO'; export * from './OpenAppNamespaceDTO'; +export * from './OpenAppRoleUserDTO'; export * from './OpenClusterDTO'; +export * from './OpenClusterNamespaceRoleUserDTO'; export * from './OpenCreateAppDTO'; export * from './OpenCreateItemDTO'; export * from './OpenCreateNamespaceDTO'; export * from './OpenEnvClusterDTO'; export * from './OpenEnvClusterInfo'; +export * from './OpenEnvNamespaceRoleUserDTO'; export * from './OpenGrayReleaseRuleDTO'; export * from './OpenGrayReleaseRuleItemDTO'; export * from './OpenInstanceConfigDTO'; @@ -27,9 +30,13 @@ export * from './OpenNamespaceDTO'; export * from './OpenNamespaceExtendDTO'; export * from './OpenNamespaceIdentifier'; export * from './OpenNamespaceLockDTO'; +export * from './OpenNamespaceRoleUserDTO'; export * from './OpenNamespaceSyncDTO'; export * from './OpenNamespaceTextModel'; export * from './OpenNamespaceUsageDTO'; export * from './OpenOrganizationDto'; -export * from './OpenReleaseBO'; +export * from './OpenPermissionConditionDTO'; +export * from './OpenReleaseChangeDTO'; export * from './OpenReleaseDTO'; +export * from './OpenReleaseDiffDTO'; +export * from './OpenUserInfoDTO';