From ef71a8e5ff2f8c74683b2b8753f0679422ea84ef Mon Sep 17 00:00:00 2001 From: Doppler Bot <57646694+doppler-bot@users.noreply.github.com> Date: Wed, 3 Apr 2024 19:05:09 -0400 Subject: [PATCH] liblab SDK update for version v1.3.0 --- .manifest.json | 415 +++ LICENSE | 2 +- examples/README.md | 8 +- examples/install.cmd | 6 + examples/install.sh | 2 +- examples/install_py3.sh | 2 +- install.cmd | 4 + pyproject.toml | 9 +- src/dopplersdk/README.md | 3081 ++++++++++------- src/dopplersdk/models/AddMemberRequest.py | 8 +- src/dopplersdk/models/AddRequest.py | 8 +- src/dopplersdk/models/DisableResponse.py | 1 + src/dopplersdk/models/EnableResponse.py | 1 + src/dopplersdk/models/GetResponse.py | 78 +- src/dopplersdk/models/MemberResponse.py | 93 + src/dopplersdk/models/MemberType.py | 8 + src/dopplersdk/models/OptionsResponse.py | 1 + .../models/ProjectRolesCreateRequest.py | 17 + .../models/ProjectRolesUpdateRequest.py | 17 + src/dopplersdk/models/README.md | 250 +- src/dopplersdk/models/SecretsListResponse.py | 48 +- src/dopplersdk/models/SecretsUpdateRequest.py | 75 +- .../ServiceAccountTokensCreateRequest.py | 16 + .../ServiceAccountTokensCreateResponse.py | 50 + .../models/ServiceAccountTokensGetResponse.py | 41 + .../ServiceAccountTokensListResponse.py | 47 + src/dopplersdk/models/SyncsCreateRequest.py | 10 +- src/dopplersdk/models/UpdateNoteRequest.py | 12 +- src/dopplersdk/models/UpdateRequest.py | 35 +- src/dopplersdk/models/UpdateResponse.py | 82 +- src/dopplersdk/models/WebhooksAddRequest.py | 72 + src/dopplersdk/models/WebhooksAddResponse.py | 1 + .../models/WebhooksDeleteResponse.py | 1 + src/dopplersdk/models/WebhooksGetResponse.py | 1 + src/dopplersdk/models/WebhooksListResponse.py | 1 + .../models/WebhooksUpdateRequest.py | 76 + .../models/WebhooksUpdateResponse.py | 1 + .../models/WorkplaceRolesCreateRequest.py | 17 + .../models/WorkplaceRolesUpdateRequest.py | 17 + src/dopplersdk/models/__init__.py | 94 +- src/dopplersdk/models/base.py | 11 +- src/dopplersdk/net/environment.py | 1 + src/dopplersdk/net/http_client.py | 4 +- src/dopplersdk/net/http_content_types.py | 3 +- src/dopplersdk/net/query_serializer.py | 23 +- src/dopplersdk/net/utils.py | 6 +- src/dopplersdk/sdk.py | 155 +- src/dopplersdk/services/README.md | 3034 ++++++++++------ src/dopplersdk/services/activity_logs.py | 46 +- src/dopplersdk/services/auth.py | 2 +- src/dopplersdk/services/base.py | 4 +- src/dopplersdk/services/config_logs.py | 58 +- src/dopplersdk/services/configs.py | 168 +- src/dopplersdk/services/dynamic_secrets.py | 36 +- src/dopplersdk/services/environments.py | 106 +- src/dopplersdk/services/get.py | 32 + src/dopplersdk/services/groups.py | 132 +- src/dopplersdk/services/integrations.py | 84 +- src/dopplersdk/services/project_members.py | 10 +- src/dopplersdk/services/project_roles.py | 88 +- src/dopplersdk/services/projects.py | 26 +- src/dopplersdk/services/retrieve.py | 67 + src/dopplersdk/services/secrets.py | 59 +- .../services/service_account_tokens.py | 192 + src/dopplersdk/services/service_accounts.py | 116 +- src/dopplersdk/services/service_tokens.py | 44 +- src/dopplersdk/services/syncs.py | 2 +- src/dopplersdk/services/users.py | 8 +- src/dopplersdk/services/webhooks.py | 244 ++ src/dopplersdk/services/workplace.py | 2 +- src/dopplersdk/services/workplace_roles.py | 60 +- src/dopplersdk/setup.py | 2 +- .../test_activity_logs_list_response.py | 4 +- test/models/test_add_member_request.py | 4 +- test/models/test_add_request.py | 12 +- test/models/test_add_response.py | 4 +- test/models/test_add_trusted_ip_request.py | 4 +- test/models/test_add_trusted_ip_response.py | 4 +- test/models/test_clone_request.py | 10 +- test/models/test_clone_response.py | 4 +- test/models/test_config_logs_get_response.py | 4 +- test/models/test_config_logs_list_response.py | 6 +- test/models/test_configs_create_request.py | 8 +- test/models/test_configs_create_response.py | 4 +- test/models/test_configs_delete_request.py | 6 +- test/models/test_configs_get_response.py | 4 +- test/models/test_configs_list_response.py | 6 +- test/models/test_configs_update_request.py | 10 +- test/models/test_configs_update_response.py | 4 +- test/models/test_create_request.py | 6 +- test/models/test_create_response.py | 4 +- test/models/test_delete_request.py | 4 +- test/models/test_delete_trusted_ip_request.py | 4 +- test/models/test_disable_response.py | 15 + test/models/test_download_response.py | 8 +- test/models/test_enable_response.py | 15 + .../test_environments_create_request.py | 6 +- .../test_environments_create_response.py | 4 +- test/models/test_environments_get_response.py | 4 +- .../models/test_environments_list_response.py | 6 +- test/models/test_get_response.py | 4 +- test/models/test_get_user_response.py | 4 +- test/models/test_groups_create_request.py | 8 +- test/models/test_groups_create_response.py | 4 +- test/models/test_groups_get_response.py | 4 +- test/models/test_groups_list_response.py | 4 +- test/models/test_groups_update_request.py | 4 +- test/models/test_groups_update_response.py | 4 +- .../test_integrations_create_request.py | 8 +- .../test_integrations_create_response.py | 4 +- test/models/test_integrations_get_response.py | 4 +- .../models/test_integrations_list_response.py | 4 +- .../test_integrations_update_request.py | 6 +- test/models/test_invites_list_response.py | 4 +- test/models/test_issue_lease_request.py | 10 +- test/models/test_issue_lease_response.py | 8 +- test/models/test_list_permissions_response.py | 4 +- test/models/test_list_response.py | 6 +- test/models/test_list_trusted_ips_response.py | 4 +- test/models/test_lock_request.py | 6 +- test/models/test_lock_response.py | 4 +- test/models/test_me_response.py | 28 +- test/models/test_member_response.py | 16 + test/models/test_names_response.py | 4 +- test/models/test_options_response.py | 15 + .../test_project_members_get_response.py | 4 +- .../test_project_members_list_response.py | 4 +- .../test_project_members_update_request.py | 6 +- .../test_project_members_update_response.py | 4 +- .../test_project_roles_create_request.py | 24 + .../test_project_roles_create_response.py | 4 +- .../models/test_project_roles_get_response.py | 4 +- ...project_roles_list_permissions_response.py | 6 +- .../test_project_roles_list_response.py | 4 +- .../test_project_roles_update_request.py | 19 + .../test_project_roles_update_response.py | 4 +- test/models/test_rename_request.py | 6 +- test/models/test_rename_response.py | 4 +- test/models/test_retrieve_response.py | 4 +- test/models/test_revoke_lease_request.py | 11 +- test/models/test_revoke_request.py | 4 +- test/models/test_rollback_response.py | 4 +- test/models/test_secrets_get_response.py | 6 +- test/models/test_secrets_list_response.py | 4 +- test/models/test_secrets_update_request.py | 12 +- test/models/test_secrets_update_response.py | 4 +- ...t_service_account_tokens_create_request.py | 21 + ..._service_account_tokens_create_response.py | 22 + ...est_service_account_tokens_get_response.py | 21 + ...st_service_account_tokens_list_response.py | 21 + .../test_service_accounts_create_request.py | 6 +- .../test_service_accounts_create_response.py | 4 +- .../test_service_accounts_get_response.py | 4 +- .../test_service_accounts_list_response.py | 6 +- .../test_service_accounts_update_request.py | 6 +- .../test_service_accounts_update_response.py | 4 +- .../test_service_tokens_create_request.py | 16 +- .../test_service_tokens_create_response.py | 32 +- .../test_service_tokens_delete_request.py | 13 +- .../test_service_tokens_list_response.py | 4 +- test/models/test_syncs_create_request.py | 10 +- test/models/test_syncs_create_response.py | 4 +- test/models/test_syncs_get_response.py | 4 +- test/models/test_unlock_request.py | 6 +- test/models/test_unlock_response.py | 4 +- test/models/test_update_note_request.py | 10 +- test/models/test_update_note_response.py | 6 +- test/models/test_update_request.py | 8 +- test/models/test_update_response.py | 4 +- test/models/test_users_get_response.py | 4 +- test/models/test_users_list_response.py | 6 +- test/models/test_webhooks_add_request.py | 31 + test/models/test_webhooks_add_response.py | 15 + test/models/test_webhooks_delete_response.py | 15 + test/models/test_webhooks_get_response.py | 15 + test/models/test_webhooks_list_response.py | 15 + test/models/test_webhooks_update_request.py | 28 + test/models/test_webhooks_update_response.py | 15 + test/models/test_workplace_get_response.py | 4 +- .../test_workplace_roles_create_request.py | 26 + .../test_workplace_roles_create_response.py | 4 +- .../test_workplace_roles_get_response.py | 4 +- .../test_workplace_roles_list_response.py | 4 +- .../test_workplace_roles_update_request.py | 21 + .../test_workplace_roles_update_response.py | 4 +- test/models/test_workplace_update_request.py | 8 +- test/models/test_workplace_update_response.py | 4 +- test/services/test_activity_logs.py | 42 +- test/services/test_audit.py | 10 +- test/services/test_config_logs.py | 40 +- test/services/test_configs.py | 134 +- test/services/test_dynamic_secrets.py | 32 +- test/services/test_environments.py | 114 +- test/services/test_get.py | 54 + test/services/test_groups.py | 178 +- test/services/test_integrations.py | 88 +- test/services/test_invites.py | 4 +- test/services/test_project_members.py | 38 +- test/services/test_project_roles.py | 118 +- test/services/test_projects.py | 8 +- test/services/test_retrieve.py | 54 + test/services/test_secrets.py | 80 +- test/services/test_service_account_tokens.py | 174 + test/services/test_service_accounts.py | 122 +- test/services/test_service_tokens.py | 58 +- test/services/test_syncs.py | 12 +- test/services/test_users.py | 14 +- test/services/test_webhooks.py | 232 ++ test/services/test_workplace_roles.py | 90 +- 209 files changed, 8050 insertions(+), 4125 deletions(-) create mode 100644 .manifest.json create mode 100644 examples/install.cmd create mode 100644 install.cmd create mode 100644 src/dopplersdk/models/DisableResponse.py create mode 100644 src/dopplersdk/models/EnableResponse.py create mode 100644 src/dopplersdk/models/MemberResponse.py create mode 100644 src/dopplersdk/models/MemberType.py create mode 100644 src/dopplersdk/models/OptionsResponse.py create mode 100644 src/dopplersdk/models/ProjectRolesCreateRequest.py create mode 100644 src/dopplersdk/models/ProjectRolesUpdateRequest.py create mode 100644 src/dopplersdk/models/ServiceAccountTokensCreateRequest.py create mode 100644 src/dopplersdk/models/ServiceAccountTokensCreateResponse.py create mode 100644 src/dopplersdk/models/ServiceAccountTokensGetResponse.py create mode 100644 src/dopplersdk/models/ServiceAccountTokensListResponse.py create mode 100644 src/dopplersdk/models/WebhooksAddRequest.py create mode 100644 src/dopplersdk/models/WebhooksAddResponse.py create mode 100644 src/dopplersdk/models/WebhooksDeleteResponse.py create mode 100644 src/dopplersdk/models/WebhooksGetResponse.py create mode 100644 src/dopplersdk/models/WebhooksListResponse.py create mode 100644 src/dopplersdk/models/WebhooksUpdateRequest.py create mode 100644 src/dopplersdk/models/WebhooksUpdateResponse.py create mode 100644 src/dopplersdk/models/WorkplaceRolesCreateRequest.py create mode 100644 src/dopplersdk/models/WorkplaceRolesUpdateRequest.py create mode 100644 src/dopplersdk/services/get.py create mode 100644 src/dopplersdk/services/retrieve.py create mode 100644 src/dopplersdk/services/service_account_tokens.py create mode 100644 src/dopplersdk/services/webhooks.py create mode 100644 test/models/test_disable_response.py create mode 100644 test/models/test_enable_response.py create mode 100644 test/models/test_member_response.py create mode 100644 test/models/test_options_response.py create mode 100644 test/models/test_project_roles_create_request.py create mode 100644 test/models/test_project_roles_update_request.py create mode 100644 test/models/test_service_account_tokens_create_request.py create mode 100644 test/models/test_service_account_tokens_create_response.py create mode 100644 test/models/test_service_account_tokens_get_response.py create mode 100644 test/models/test_service_account_tokens_list_response.py create mode 100644 test/models/test_webhooks_add_request.py create mode 100644 test/models/test_webhooks_add_response.py create mode 100644 test/models/test_webhooks_delete_response.py create mode 100644 test/models/test_webhooks_get_response.py create mode 100644 test/models/test_webhooks_list_response.py create mode 100644 test/models/test_webhooks_update_request.py create mode 100644 test/models/test_webhooks_update_response.py create mode 100644 test/models/test_workplace_roles_create_request.py create mode 100644 test/models/test_workplace_roles_update_request.py create mode 100644 test/services/test_get.py create mode 100644 test/services/test_retrieve.py create mode 100644 test/services/test_service_account_tokens.py create mode 100644 test/services/test_webhooks.py diff --git a/.manifest.json b/.manifest.json new file mode 100644 index 0000000..5cf0fcc --- /dev/null +++ b/.manifest.json @@ -0,0 +1,415 @@ +{ + "liblabVersion": "1.1.43", + "date": "2024-04-03T23:04:33.643Z", + "config": { + "authentication": { + "access": { + "prefix": "Bearer" + } + }, + "deliveryType": "zip", + "languages": ["python"], + "inputFileName": "/tmp/resources/spec/open-api-spec.json", + "environmentVariables": [], + "fileOutput": "/tmp", + "tempDir": "/tmp/liblab-codegen-1.1.43-LsCLFP", + "inferServiceNames": true, + "httpLibrary": { + "name": "axios", + "packages": { + "axios": "^1.0.0" + }, + "languages": ["javascript", "typescript"] + }, + "auth": ["bearer"], + "privateRepo": false, + "githubRef": "", + "sdkName": "DopplerSDK", + "sdkVersion": "1.3.0", + "retry": { + "enabled": true, + "maxAttempts": 3, + "retryDelay": 150 + }, + "customQueries": { + "paths": [], + "rawQueries": [], + "queriesData": [] + }, + "generateEnv": false, + "injectedModels": [], + "includeWatermark": false, + "license": { + "type": "MIT", + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "ignoreFiles": ["./README.md", ".devcontainer"], + "alwaysInitializeOptionals": true, + "pypiPackageName": "doppler-sdk", + "environments": [], + "reservedKeywords": {}, + "deliveryMethods": [], + "bundle": false, + "exportClassDefault": false, + "responseHeaders": false, + "renameIllegalModelProperties": false, + "devContainer": false, + "strictVersion": false, + "authors": [], + "classifiers": [ + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3 :: Only", + "Operating System :: OS Independent", + "Topic :: Security" + ], + "projectUrls": { + "Documentation": "https://docs.doppler.com/docs/sdk-python", + "Source": "https://github.com/DopplerHQ/python-sdk", + "Tracker": "https://github.com/DopplerHQ/python-sdk/issues", + "Homepage": "https://doppler.com" + }, + "homepage": "https://doppler.com", + "enforceRequestValidation": false, + "denoteCommon": false, + "includeOptionalSnippetParameters": true, + "hooks": { + "enabled": false, + "sourceDir": "" + }, + "spec": { + "type": "openapi", + "version": "3.1" + }, + "usesFormData": false + }, + "files": [ + ".gitignore", + "LICENSE", + "examples/README.md", + "examples/install.cmd", + "examples/install.sh", + "examples/install_py3.sh", + "examples/sample.py", + "install.cmd", + "install.sh", + "pyproject.toml", + "requirements.txt", + "src/dopplersdk/README.md", + "src/dopplersdk/__init__.py", + "src/dopplersdk/hooks/__init__.py", + "src/dopplersdk/hooks/hook.py", + "src/dopplersdk/models/ActivityLogsListResponse.py", + "src/dopplersdk/models/AddMemberRequest.py", + "src/dopplersdk/models/AddRequest.py", + "src/dopplersdk/models/AddResponse.py", + "src/dopplersdk/models/AddTrustedIpRequest.py", + "src/dopplersdk/models/AddTrustedIpResponse.py", + "src/dopplersdk/models/CloneRequest.py", + "src/dopplersdk/models/CloneResponse.py", + "src/dopplersdk/models/ConfigLogsGetResponse.py", + "src/dopplersdk/models/ConfigLogsListResponse.py", + "src/dopplersdk/models/ConfigsCreateRequest.py", + "src/dopplersdk/models/ConfigsCreateResponse.py", + "src/dopplersdk/models/ConfigsDeleteRequest.py", + "src/dopplersdk/models/ConfigsGetResponse.py", + "src/dopplersdk/models/ConfigsListResponse.py", + "src/dopplersdk/models/ConfigsUpdateRequest.py", + "src/dopplersdk/models/ConfigsUpdateResponse.py", + "src/dopplersdk/models/CreateRequest.py", + "src/dopplersdk/models/CreateResponse.py", + "src/dopplersdk/models/DeleteRequest.py", + "src/dopplersdk/models/DeleteResponse.py", + "src/dopplersdk/models/DeleteTrustedIpRequest.py", + "src/dopplersdk/models/DisableResponse.py", + "src/dopplersdk/models/DownloadResponse.py", + "src/dopplersdk/models/EnableResponse.py", + "src/dopplersdk/models/EnvironmentsCreateRequest.py", + "src/dopplersdk/models/EnvironmentsCreateResponse.py", + "src/dopplersdk/models/EnvironmentsGetResponse.py", + "src/dopplersdk/models/EnvironmentsListResponse.py", + "src/dopplersdk/models/Format.py", + "src/dopplersdk/models/GetResponse.py", + "src/dopplersdk/models/GetUserResponse.py", + "src/dopplersdk/models/GroupsCreateRequest.py", + "src/dopplersdk/models/GroupsCreateResponse.py", + "src/dopplersdk/models/GroupsGetResponse.py", + "src/dopplersdk/models/GroupsListResponse.py", + "src/dopplersdk/models/GroupsType.py", + "src/dopplersdk/models/GroupsUpdateRequest.py", + "src/dopplersdk/models/GroupsUpdateResponse.py", + "src/dopplersdk/models/IntegrationsCreateRequest.py", + "src/dopplersdk/models/IntegrationsCreateResponse.py", + "src/dopplersdk/models/IntegrationsDeleteResponse.py", + "src/dopplersdk/models/IntegrationsGetResponse.py", + "src/dopplersdk/models/IntegrationsListResponse.py", + "src/dopplersdk/models/IntegrationsUpdateRequest.py", + "src/dopplersdk/models/IntegrationsUpdateResponse.py", + "src/dopplersdk/models/InvitesListResponse.py", + "src/dopplersdk/models/IssueLeaseRequest.py", + "src/dopplersdk/models/IssueLeaseResponse.py", + "src/dopplersdk/models/ListPermissionsResponse.py", + "src/dopplersdk/models/ListResponse.py", + "src/dopplersdk/models/ListTrustedIpsResponse.py", + "src/dopplersdk/models/LockRequest.py", + "src/dopplersdk/models/LockResponse.py", + "src/dopplersdk/models/MeResponse.py", + "src/dopplersdk/models/MemberResponse.py", + "src/dopplersdk/models/MemberType.py", + "src/dopplersdk/models/NameTransformer.py", + "src/dopplersdk/models/NamesResponse.py", + "src/dopplersdk/models/OptionsResponse.py", + "src/dopplersdk/models/ProjectMembersGetResponse.py", + "src/dopplersdk/models/ProjectMembersListResponse.py", + "src/dopplersdk/models/ProjectMembersUpdateRequest.py", + "src/dopplersdk/models/ProjectMembersUpdateResponse.py", + "src/dopplersdk/models/ProjectRolesCreateRequest.py", + "src/dopplersdk/models/ProjectRolesCreateResponse.py", + "src/dopplersdk/models/ProjectRolesGetResponse.py", + "src/dopplersdk/models/ProjectRolesListPermissionsResponse.py", + "src/dopplersdk/models/ProjectRolesListResponse.py", + "src/dopplersdk/models/ProjectRolesUpdateRequest.py", + "src/dopplersdk/models/ProjectRolesUpdateResponse.py", + "src/dopplersdk/models/README.md", + "src/dopplersdk/models/RenameRequest.py", + "src/dopplersdk/models/RenameResponse.py", + "src/dopplersdk/models/RetrieveResponse.py", + "src/dopplersdk/models/RevokeLeaseRequest.py", + "src/dopplersdk/models/RevokeLeaseResponse.py", + "src/dopplersdk/models/RevokeRequest.py", + "src/dopplersdk/models/RollbackResponse.py", + "src/dopplersdk/models/SecretsGetResponse.py", + "src/dopplersdk/models/SecretsListResponse.py", + "src/dopplersdk/models/SecretsUpdateRequest.py", + "src/dopplersdk/models/SecretsUpdateResponse.py", + "src/dopplersdk/models/ServiceAccountTokensCreateRequest.py", + "src/dopplersdk/models/ServiceAccountTokensCreateResponse.py", + "src/dopplersdk/models/ServiceAccountTokensGetResponse.py", + "src/dopplersdk/models/ServiceAccountTokensListResponse.py", + "src/dopplersdk/models/ServiceAccountsCreateRequest.py", + "src/dopplersdk/models/ServiceAccountsCreateResponse.py", + "src/dopplersdk/models/ServiceAccountsGetResponse.py", + "src/dopplersdk/models/ServiceAccountsListResponse.py", + "src/dopplersdk/models/ServiceAccountsUpdateRequest.py", + "src/dopplersdk/models/ServiceAccountsUpdateResponse.py", + "src/dopplersdk/models/ServiceTokensCreateRequest.py", + "src/dopplersdk/models/ServiceTokensCreateResponse.py", + "src/dopplersdk/models/ServiceTokensDeleteRequest.py", + "src/dopplersdk/models/ServiceTokensListResponse.py", + "src/dopplersdk/models/SyncsCreateRequest.py", + "src/dopplersdk/models/SyncsCreateResponse.py", + "src/dopplersdk/models/SyncsDeleteResponse.py", + "src/dopplersdk/models/SyncsGetResponse.py", + "src/dopplersdk/models/Type.py", + "src/dopplersdk/models/UnlockRequest.py", + "src/dopplersdk/models/UnlockResponse.py", + "src/dopplersdk/models/UpdateNoteRequest.py", + "src/dopplersdk/models/UpdateNoteResponse.py", + "src/dopplersdk/models/UpdateRequest.py", + "src/dopplersdk/models/UpdateResponse.py", + "src/dopplersdk/models/UsersGetResponse.py", + "src/dopplersdk/models/UsersListResponse.py", + "src/dopplersdk/models/WebhooksAddRequest.py", + "src/dopplersdk/models/WebhooksAddResponse.py", + "src/dopplersdk/models/WebhooksDeleteResponse.py", + "src/dopplersdk/models/WebhooksGetResponse.py", + "src/dopplersdk/models/WebhooksListResponse.py", + "src/dopplersdk/models/WebhooksUpdateRequest.py", + "src/dopplersdk/models/WebhooksUpdateResponse.py", + "src/dopplersdk/models/WorkplaceGetResponse.py", + "src/dopplersdk/models/WorkplaceRolesCreateRequest.py", + "src/dopplersdk/models/WorkplaceRolesCreateResponse.py", + "src/dopplersdk/models/WorkplaceRolesGetResponse.py", + "src/dopplersdk/models/WorkplaceRolesListResponse.py", + "src/dopplersdk/models/WorkplaceRolesUpdateRequest.py", + "src/dopplersdk/models/WorkplaceRolesUpdateResponse.py", + "src/dopplersdk/models/WorkplaceUpdateRequest.py", + "src/dopplersdk/models/WorkplaceUpdateResponse.py", + "src/dopplersdk/models/__init__.py", + "src/dopplersdk/models/base.py", + "src/dopplersdk/net/__init__.py", + "src/dopplersdk/net/environment.py", + "src/dopplersdk/net/http_client.py", + "src/dopplersdk/net/http_content_types.py", + "src/dopplersdk/net/query_serializer.py", + "src/dopplersdk/net/utils.py", + "src/dopplersdk/sdk.py", + "src/dopplersdk/services/README.md", + "src/dopplersdk/services/__init__.py", + "src/dopplersdk/services/activity_logs.py", + "src/dopplersdk/services/audit.py", + "src/dopplersdk/services/auth.py", + "src/dopplersdk/services/base.py", + "src/dopplersdk/services/config_logs.py", + "src/dopplersdk/services/configs.py", + "src/dopplersdk/services/dynamic_secrets.py", + "src/dopplersdk/services/environments.py", + "src/dopplersdk/services/get.py", + "src/dopplersdk/services/groups.py", + "src/dopplersdk/services/integrations.py", + "src/dopplersdk/services/invites.py", + "src/dopplersdk/services/project_members.py", + "src/dopplersdk/services/project_roles.py", + "src/dopplersdk/services/projects.py", + "src/dopplersdk/services/retrieve.py", + "src/dopplersdk/services/secrets.py", + "src/dopplersdk/services/service_account_tokens.py", + "src/dopplersdk/services/service_accounts.py", + "src/dopplersdk/services/service_tokens.py", + "src/dopplersdk/services/syncs.py", + "src/dopplersdk/services/users.py", + "src/dopplersdk/services/webhooks.py", + "src/dopplersdk/services/workplace.py", + "src/dopplersdk/services/workplace_roles.py", + "src/dopplersdk/setup.py", + "test/__init__.py", + "test/models/__init__.py", + "test/models/test_activity_logs_list_response.py", + "test/models/test_add_member_request.py", + "test/models/test_add_request.py", + "test/models/test_add_response.py", + "test/models/test_add_trusted_ip_request.py", + "test/models/test_add_trusted_ip_response.py", + "test/models/test_base.py", + "test/models/test_clone_request.py", + "test/models/test_clone_response.py", + "test/models/test_config_logs_get_response.py", + "test/models/test_config_logs_list_response.py", + "test/models/test_configs_create_request.py", + "test/models/test_configs_create_response.py", + "test/models/test_configs_delete_request.py", + "test/models/test_configs_get_response.py", + "test/models/test_configs_list_response.py", + "test/models/test_configs_update_request.py", + "test/models/test_configs_update_response.py", + "test/models/test_create_request.py", + "test/models/test_create_response.py", + "test/models/test_delete_request.py", + "test/models/test_delete_response.py", + "test/models/test_delete_trusted_ip_request.py", + "test/models/test_disable_response.py", + "test/models/test_download_response.py", + "test/models/test_enable_response.py", + "test/models/test_environments_create_request.py", + "test/models/test_environments_create_response.py", + "test/models/test_environments_get_response.py", + "test/models/test_environments_list_response.py", + "test/models/test_get_response.py", + "test/models/test_get_user_response.py", + "test/models/test_groups_create_request.py", + "test/models/test_groups_create_response.py", + "test/models/test_groups_get_response.py", + "test/models/test_groups_list_response.py", + "test/models/test_groups_update_request.py", + "test/models/test_groups_update_response.py", + "test/models/test_integrations_create_request.py", + "test/models/test_integrations_create_response.py", + "test/models/test_integrations_delete_response.py", + "test/models/test_integrations_get_response.py", + "test/models/test_integrations_list_response.py", + "test/models/test_integrations_update_request.py", + "test/models/test_integrations_update_response.py", + "test/models/test_invites_list_response.py", + "test/models/test_issue_lease_request.py", + "test/models/test_issue_lease_response.py", + "test/models/test_list_permissions_response.py", + "test/models/test_list_response.py", + "test/models/test_list_trusted_ips_response.py", + "test/models/test_lock_request.py", + "test/models/test_lock_response.py", + "test/models/test_me_response.py", + "test/models/test_member_response.py", + "test/models/test_names_response.py", + "test/models/test_options_response.py", + "test/models/test_project_members_get_response.py", + "test/models/test_project_members_list_response.py", + "test/models/test_project_members_update_request.py", + "test/models/test_project_members_update_response.py", + "test/models/test_project_roles_create_request.py", + "test/models/test_project_roles_create_response.py", + "test/models/test_project_roles_get_response.py", + "test/models/test_project_roles_list_permissions_response.py", + "test/models/test_project_roles_list_response.py", + "test/models/test_project_roles_update_request.py", + "test/models/test_project_roles_update_response.py", + "test/models/test_rename_request.py", + "test/models/test_rename_response.py", + "test/models/test_retrieve_response.py", + "test/models/test_revoke_lease_request.py", + "test/models/test_revoke_lease_response.py", + "test/models/test_revoke_request.py", + "test/models/test_rollback_response.py", + "test/models/test_secrets_get_response.py", + "test/models/test_secrets_list_response.py", + "test/models/test_secrets_update_request.py", + "test/models/test_secrets_update_response.py", + "test/models/test_service_account_tokens_create_request.py", + "test/models/test_service_account_tokens_create_response.py", + "test/models/test_service_account_tokens_get_response.py", + "test/models/test_service_account_tokens_list_response.py", + "test/models/test_service_accounts_create_request.py", + "test/models/test_service_accounts_create_response.py", + "test/models/test_service_accounts_get_response.py", + "test/models/test_service_accounts_list_response.py", + "test/models/test_service_accounts_update_request.py", + "test/models/test_service_accounts_update_response.py", + "test/models/test_service_tokens_create_request.py", + "test/models/test_service_tokens_create_response.py", + "test/models/test_service_tokens_delete_request.py", + "test/models/test_service_tokens_list_response.py", + "test/models/test_syncs_create_request.py", + "test/models/test_syncs_create_response.py", + "test/models/test_syncs_delete_response.py", + "test/models/test_syncs_get_response.py", + "test/models/test_unlock_request.py", + "test/models/test_unlock_response.py", + "test/models/test_update_note_request.py", + "test/models/test_update_note_response.py", + "test/models/test_update_request.py", + "test/models/test_update_response.py", + "test/models/test_users_get_response.py", + "test/models/test_users_list_response.py", + "test/models/test_webhooks_add_request.py", + "test/models/test_webhooks_add_response.py", + "test/models/test_webhooks_delete_response.py", + "test/models/test_webhooks_get_response.py", + "test/models/test_webhooks_list_response.py", + "test/models/test_webhooks_update_request.py", + "test/models/test_webhooks_update_response.py", + "test/models/test_workplace_get_response.py", + "test/models/test_workplace_roles_create_request.py", + "test/models/test_workplace_roles_create_response.py", + "test/models/test_workplace_roles_get_response.py", + "test/models/test_workplace_roles_list_response.py", + "test/models/test_workplace_roles_update_request.py", + "test/models/test_workplace_roles_update_response.py", + "test/models/test_workplace_update_request.py", + "test/models/test_workplace_update_response.py", + "test/services/__init__.py", + "test/services/test_activity_logs.py", + "test/services/test_audit.py", + "test/services/test_auth.py", + "test/services/test_base.py", + "test/services/test_config_logs.py", + "test/services/test_configs.py", + "test/services/test_dynamic_secrets.py", + "test/services/test_environments.py", + "test/services/test_get.py", + "test/services/test_groups.py", + "test/services/test_integrations.py", + "test/services/test_invites.py", + "test/services/test_project_members.py", + "test/services/test_project_roles.py", + "test/services/test_projects.py", + "test/services/test_retrieve.py", + "test/services/test_secrets.py", + "test/services/test_service_account_tokens.py", + "test/services/test_service_accounts.py", + "test/services/test_service_tokens.py", + "test/services/test_syncs.py", + "test/services/test_users.py", + "test/services/test_webhooks.py", + "test/services/test_workplace.py", + "test/services/test_workplace_roles.py" + ] +} diff --git a/LICENSE b/LICENSE index cb511c8..4dc8223 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2023 +Copyright (c) 2024 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/examples/README.md b/examples/README.md index 9fe72db..4b2874c 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,14 +1,17 @@ # doppler-sdk-example + A basic example of how to use the doppler-sdk package. ## Installation If `doppler-sdk` is published to pypi: + ```sh -pip install doppler-sdk==1.2.1 +pip install doppler-sdk==1.3.0 ``` In the event `doppler-sdk` is not published to pypi, you can install it locally by running the following command in the example folder: + ```sh . ./install.sh ``` @@ -16,11 +19,13 @@ In the event `doppler-sdk` is not published to pypi, you can install it locally This will create and start a virtual environment and install the package locally in it. To close the virtual environment run: + ```sh deactivate ``` To re-activate the virtual environment once it is installed run: + ```sh source .venv/bin/activate ``` @@ -28,6 +33,7 @@ source .venv/bin/activate ## Usage To run the example, run the following command in the examples folder: + ```sh python sample.py ``` diff --git a/examples/install.cmd b/examples/install.cmd new file mode 100644 index 0000000..76ed2df --- /dev/null +++ b/examples/install.cmd @@ -0,0 +1,6 @@ + +python -m venv .venv +call .venv\Scripts\activate +pip install build +python -m build --outdir dist ..\ +pip install dist\doppler_sdk-1.3.0-py3-none-any.whl --force-reinstall \ No newline at end of file diff --git a/examples/install.sh b/examples/install.sh index fd68975..a7123c4 100644 --- a/examples/install.sh +++ b/examples/install.sh @@ -2,4 +2,4 @@ python -m venv .venv source .venv/bin/activate pip install build python -m build --outdir dist ../ -pip install dist/doppler_sdk-1.2.1-py3-none-any.whl +pip install dist/doppler_sdk-1.3.0-py3-none-any.whl --force-reinstall diff --git a/examples/install_py3.sh b/examples/install_py3.sh index 4b401d8..8dcfb60 100644 --- a/examples/install_py3.sh +++ b/examples/install_py3.sh @@ -2,4 +2,4 @@ python3 -m venv .venv source .venv/bin/activate pip3 install build python3 -m build --outdir dist ../ -pip3 install dist/doppler_sdk-1.2.1-py3-none-any.whl \ No newline at end of file +pip3 install dist/doppler_sdk-1.3.0-py3-none-any.whl --force-reinstall \ No newline at end of file diff --git a/install.cmd b/install.cmd new file mode 100644 index 0000000..325e73f --- /dev/null +++ b/install.cmd @@ -0,0 +1,4 @@ + +pip install -r requirements.txt +pip install -e src\dopplersdk\ +python -m unittest discover -p "test*.py" diff --git a/pyproject.toml b/pyproject.toml index abb78ac..0c549ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "doppler-sdk" -version = "1.2.1" +version = "1.3.0" license = { text = "MIT" } description = """""" readme = "README.md" @@ -17,11 +17,14 @@ classifiers = [ ] dependencies = [ "requests", - "http-exceptions", + "http-exceptions" +] + +[project.optional-dependencies] +test = [ "pytest", "responses" ] - [project.urls] Documentation = "https://docs.doppler.com/docs/sdk-python" Source = "https://github.com/DopplerHQ/python-sdk" diff --git a/src/dopplersdk/README.md b/src/dopplersdk/README.md index 18a0a36..8599a6a 100644 --- a/src/dopplersdk/README.md +++ b/src/dopplersdk/README.md @@ -1,17 +1,17 @@ -# DopplerSDK Python SDK 1.2.1 -A Python SDK for DopplerSDK. - +# DopplerSDK Python SDK 1.3.0 +A Python SDK for DopplerSDK. -- API version: 1.2.1 -- SDK version: 1.2.1 +- API version: 1.3.0 +- SDK version: 1.3.0 ## Table of Contents + - [Requirements](#requirements) - [Installation](#installation) - - [Dependencies](#dependencies) + - [Dependencies](#dependencies) - [Authentication](#authentication) - - [Access Token Authentication](#bearer-authentication) + - [Access Token Authentication](#bearer-authentication) - [API Endpoint Services](#api-endpoint-services) - [API Models](#api-models) - [Testing](#testing) @@ -21,6 +21,7 @@ A Python SDK for DopplerSDK. - [License](#license) ## Installation + ```bash pip install doppler-sdk ``` @@ -28,6 +29,7 @@ pip install doppler-sdk ### Dependencies This SDK uses the following dependencies: + - requests 2.28.1 - http-exceptions 0.2.10 - pytest 7.1.2 @@ -38,19 +40,22 @@ This SDK uses the following dependencies: To see whether an endpoint needs a specific type of authentication check the endpoint's documentation. ### Access Token Authentication -The DopplerSDK API uses bearer tokens as a form of authentication.You can set the bearer token when initializing the SDK through the constructor: + +The DopplerSDK API uses bearer tokens as a form of authentication.You can set the bearer token when initializing the SDK through the constructor: ```py sdk = DopplerSDK('YOUR_BEARER_TOKEN') ``` Or through the `set_access_token` method: + ```py sdk = DopplerSDK() sdk.set_access_token('YOUR_BEARER_TOKEN') ``` You can also set it for each service individually: + ```py sdk = DopplerSDK() sdk.projects.set_access_token('YOUR_BEARER_TOKEN') @@ -62,30 +67,35 @@ All URIs are relative to https://api.doppler.com. Click the service name for a full list of the service methods. -| Service | -| :------ | -|[Projects](./services/README.md#projects)| -|[Secrets](./services/README.md#secrets)| -|[ConfigLogs](./services/README.md#configlogs)| -|[Environments](./services/README.md#environments)| -|[Configs](./services/README.md#configs)| -|[ActivityLogs](./services/README.md#activitylogs)| -|[Workplace](./services/README.md#workplace)| -|[ServiceTokens](./services/README.md#servicetokens)| -|[Audit](./services/README.md#audit)| -|[DynamicSecrets](./services/README.md#dynamicsecrets)| -|[Auth](./services/README.md#auth)| -|[Integrations](./services/README.md#integrations)| -|[Syncs](./services/README.md#syncs)| -|[WorkplaceRoles](./services/README.md#workplaceroles)| -|[ProjectRoles](./services/README.md#projectroles)| -|[ProjectMembers](./services/README.md#projectmembers)| -|[Invites](./services/README.md#invites)| -|[ServiceAccounts](./services/README.md#serviceaccounts)| -|[Groups](./services/README.md#groups)| -|[Users](./services/README.md#users)| +| Service | +| :---------------------------------------------------------------- | +| [Projects](./services/README.md#projects) | +| [Environments](./services/README.md#environments) | +| [Configs](./services/README.md#configs) | +| [ConfigLogs](./services/README.md#configlogs) | +| [Secrets](./services/README.md#secrets) | +| [Workplace](./services/README.md#workplace) | +| [ActivityLogs](./services/README.md#activitylogs) | +| [ServiceTokens](./services/README.md#servicetokens) | +| [Audit](./services/README.md#audit) | +| [DynamicSecrets](./services/README.md#dynamicsecrets) | +| [Auth](./services/README.md#auth) | +| [Integrations](./services/README.md#integrations) | +| [Syncs](./services/README.md#syncs) | +| [WorkplaceRoles](./services/README.md#workplaceroles) | +| [ProjectRoles](./services/README.md#projectroles) | +| [ProjectMembers](./services/README.md#projectmembers) | +| [Invites](./services/README.md#invites) | +| [ServiceAccounts](./services/README.md#serviceaccounts) | +| [Groups](./services/README.md#groups) | +| [Users](./services/README.md#users) | +| [Get](./services/README.md#get) | +| [Retrieve](./services/README.md#retrieve) | +| [Webhooks](./services/README.md#webhooks) | +| [ServiceAccountTokens](./services/README.md#serviceaccounttokens) | ## API Models + [A list documenting all API models for this SDK](./models/README.md#dopplersdk-models). ## Testing @@ -93,7 +103,7 @@ Click the service name for a full list of the service methods. Run unit tests with this command: ```sh -python -m unittest discover -p "test*.py" +python -m unittest discover -p "test*.py" ``` ## Sample Usage @@ -111,280 +121,302 @@ results = sdk.projects.list() pprint(vars(results)) ``` - # DopplerSDK Services -A list of all services and services methods. -- Services - - - [Projects](#projects) - - [Secrets](#secrets) +A list of all services and services methods. - - [ConfigLogs](#configlogs) +- Services - - [Environments](#environments) + - [Projects](#projects) - - [Configs](#configs) + - [Environments](#environments) - - [ActivityLogs](#activitylogs) + - [Configs](#configs) - - [Workplace](#workplace) + - [ConfigLogs](#configlogs) - - [ServiceTokens](#servicetokens) + - [Secrets](#secrets) - - [Audit](#audit) + - [Workplace](#workplace) - - [DynamicSecrets](#dynamicsecrets) + - [ActivityLogs](#activitylogs) - - [Auth](#auth) + - [ServiceTokens](#servicetokens) - - [Integrations](#integrations) + - [Audit](#audit) - - [Syncs](#syncs) + - [DynamicSecrets](#dynamicsecrets) - - [WorkplaceRoles](#workplaceroles) + - [Auth](#auth) - - [ProjectRoles](#projectroles) + - [Integrations](#integrations) - - [ProjectMembers](#projectmembers) + - [Syncs](#syncs) - - [Invites](#invites) + - [WorkplaceRoles](#workplaceroles) - - [ServiceAccounts](#serviceaccounts) + - [ProjectRoles](#projectroles) - - [Groups](#groups) + - [ProjectMembers](#projectmembers) - - [Users](#users) -- [All Methods](#all-methods) + - [Invites](#invites) + - [ServiceAccounts](#serviceaccounts) -## Projects + - [Groups](#groups) -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [update](#update) | Update | -| [get](#get) | Retrieve | -| [delete](#delete) | Delete | + - [Users](#users) + - [Get](#get) -## Secrets + - [Retrieve](#retrieve) -| Method | Description| -| :-------- | :----------| -| [update](#update) | Update | -| [list](#list) | List | -| [get](#get) | Retrieve | -| [delete](#delete) | Delete | -| [download](#download) | Download | -| [names](#names) | List Names | -| [update_note](#update_note) | Update Note | + - [Webhooks](#webhooks) + - [ServiceAccountTokens](#serviceaccounttokens) -## ConfigLogs +- [All Methods](#all-methods) -| Method | Description| -| :-------- | :----------| -| [list](#list) | List | -| [get](#get) | Retrieve | -| [rollback](#rollback) | Rollback | +## Projects +| Method | Description | +| :---------------- | :---------- | +| [create](#create) | Create | +| [list](#list) | List | +| [update](#update) | Update | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | ## Environments -| Method | Description| -| :-------- | :----------| -| [get](#get) | Retrieve | -| [delete](#delete) | Delete | -| [rename](#rename) | Rename | -| [create](#create) | Create | -| [list](#list) | List | - +| Method | Description | +| :---------------- | :---------- | +| [create](#create) | Create | +| [list](#list) | List | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | +| [rename](#rename) | Rename | ## Configs -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [update](#update) | Update | -| [get](#get) | Retrieve | -| [delete](#delete) | Delete | -| [clone](#clone) | Clone | -| [lock](#lock) | Lock | -| [unlock](#unlock) | Unlock | -| [add_trusted_ip](#add_trusted_ip) | Add | -| [list_trusted_ips](#list_trusted_ips) | List | -| [delete_trusted_ip](#delete_trusted_ip) | Delete | +| Method | Description | +| :-------------------------------------- | :---------- | +| [update](#update) | Update | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | +| [create](#create) | Create | +| [list](#list) | List | +| [unlock](#unlock) | Unlock | +| [clone](#clone) | Clone | +| [lock](#lock) | Lock | +| [add_trusted_ip](#add_trusted_ip) | Add | +| [list_trusted_ips](#list_trusted_ips) | List | +| [delete_trusted_ip](#delete_trusted_ip) | Delete | +## ConfigLogs -## ActivityLogs +| Method | Description | +| :-------------------- | :---------- | +| [get](#get) | Retrieve | +| [list](#list) | List | +| [rollback](#rollback) | Rollback | -| Method | Description| -| :-------- | :----------| -| [retrieve](#retrieve) | Retrieve | -| [list](#list) | List | +## Secrets +| Method | Description | +| :-------------------------- | :---------- | +| [update](#update) | Update | +| [list](#list) | List | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | +| [download](#download) | Download | +| [update_note](#update_note) | Update Note | +| [names](#names) | List Names | ## Workplace -| Method | Description| -| :-------- | :----------| -| [update](#update) | Update | -| [get](#get) | Retrieve | +| Method | Description | +| :---------------- | :---------- | +| [update](#update) | Update | +| [get](#get) | Retrieve | +## ActivityLogs -## ServiceTokens +| Method | Description | +| :-------------------- | :---------- | +| [list](#list) | List | +| [retrieve](#retrieve) | Retrieve | -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [delete](#delete) | Delete | +## ServiceTokens +| Method | Description | +| :---------------- | :---------- | +| [delete](#delete) | Delete | +| [create](#create) | Create | +| [list](#list) | List | ## Audit -| Method | Description| -| :-------- | :----------| +| Method | Description | +| :-------------------- | :------------- | | [get_user](#get_user) | Workplace User | - ## DynamicSecrets -| Method | Description| -| :-------- | :----------| -| [issue_lease](#issue_lease) | Issue Lease | +| Method | Description | +| :---------------------------- | :----------- | | [revoke_lease](#revoke_lease) | Revoke Lease | - +| [issue_lease](#issue_lease) | Issue Lease | ## Auth -| Method | Description| -| :-------- | :----------| -| [revoke](#revoke) | Revoke | -| [me](#me) | Me | - +| Method | Description | +| :---------------- | :---------- | +| [revoke](#revoke) | Revoke | +| [me](#me) | Me | ## Integrations -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [get](#get) | Retrieve | -| [delete](#delete) | Delete | -| [update](#update) | Update | - +| Method | Description | +| :---------------- | :---------- | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | +| [update](#update) | Update | +| [create](#create) | Create | +| [list](#list) | List | ## Syncs -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [get](#get) | Retrieve | -| [delete](#delete) | Delete | - +| Method | Description | +| :---------------- | :---------- | +| [create](#create) | Create | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | ## WorkplaceRoles -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | +| Method | Description | +| :------------------------------------ | :--------------- | +| [create](#create) | Create | +| [list](#list) | List | +| [get](#get) | Retrieve | +| [update](#update) | Update | +| [delete](#delete) | Delete | | [list_permissions](#list_permissions) | List Permissions | -| [get](#get) | Retrieve | -| [update](#update) | Update | -| [delete](#delete) | Delete | - ## ProjectRoles -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [get](#get) | Retrieve | -| [update](#update) | Update | -| [delete](#delete) | Delete | +| Method | Description | +| :------------------------------------ | :--------------- | +| [get](#get) | Retrieve | +| [update](#update) | Update | +| [delete](#delete) | Delete | +| [create](#create) | Create | +| [list](#list) | List | | [list_permissions](#list_permissions) | List Permissions | - ## ProjectMembers -| Method | Description| -| :-------- | :----------| -| [add](#add) | Add | -| [list](#list) | List | -| [get](#get) | Retrieve | -| [update](#update) | Update | -| [delete](#delete) | Delete | - +| Method | Description | +| :---------------- | :---------- | +| [add](#add) | Add | +| [list](#list) | List | +| [get](#get) | Retrieve | +| [update](#update) | Update | +| [delete](#delete) | Delete | ## Invites -| Method | Description| -| :-------- | :----------| -| [list](#list) | List | - +| Method | Description | +| :------------ | :---------- | +| [list](#list) | List | ## ServiceAccounts -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [get](#get) | Retrieve | -| [update](#update) | Update | -| [delete](#delete) | Delete | - +| Method | Description | +| :---------------- | :---------- | +| [get](#get) | Retrieve | +| [update](#update) | Update | +| [delete](#delete) | Delete | +| [create](#create) | Create | +| [list](#list) | List | ## Groups -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [get](#get) | Retrieve | -| [update](#update) | Update | -| [delete](#delete) | Delete | -| [add_member](#add_member) | Add Member | +| Method | Description | +| :------------------------------ | :------------ | +| [get](#get) | Retrieve | +| [update](#update) | Update | +| [delete](#delete) | Delete | +| [create](#create) | Create | +| [list](#list) | List | | [delete_member](#delete_member) | Delete Member | - +| [add_member](#add_member) | Add Member | ## Users -| Method | Description| -| :-------- | :----------| -| [list](#list) | List | -| [get](#get) | Retrieve | +| Method | Description | +| :------------ | :---------- | +| [list](#list) | List | +| [get](#get) | Retrieve | +## Get +| Method | Description | +| :------------------ | :---------- | +| [options](#options) | Get Options | +## Retrieve -## All Methods +| Method | Description | +| :---------------- | :-------------- | +| [member](#member) | Retrieve Member | + +## Webhooks +| Method | Description | +| :------------------ | :---------- | +| [add](#add) | Add | +| [list](#list) | List | +| [get](#get) | Retrieve | +| [update](#update) | Update | +| [delete](#delete) | Delete | +| [enable](#enable) | Enable | +| [disable](#disable) | Disable | + +## ServiceAccountTokens + +| Method | Description | +| :---------------- | :---------- | +| [create](#create) | Create | +| [list](#list) | List | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | + +## All Methods ### **create** + Create + - HTTP Method: POST - Endpoint: /v3/projects **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| | request_input | [CreateRequest](/src/dopplersdk/models/README.md#createrequest) | Optional | Request body. | **Return Type** -[CreateResponse](/src/dopplersdk/models/README.md#createresponse) +[CreateResponse](/src/dopplersdk/models/README.md#createresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { @@ -398,25 +430,28 @@ pprint(vars(results)) ``` ### **list** + List + - HTTP Method: GET - Endpoint: /v3/projects **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| | page | int | Optional | Page number | | per_page | int | Optional | Items per page | **Return Type** -[ListResponse](/src/dopplersdk/models/README.md#listresponse) +[ListResponse](/src/dopplersdk/models/README.md#listresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) results = sdk.projects.list( @@ -429,24 +464,27 @@ pprint(vars(results)) ``` ### **update** + Update + - HTTP Method: POST - Endpoint: /v3/projects/project **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ProjectsUpdateRequest](/src/dopplersdk/models/README.md#projectsupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [UpdateRequest](/src/dopplersdk/models/README.md#updaterequest) | Optional | Request body. | **Return Type** -[ProjectsUpdateResponse](/src/dopplersdk/models/README.md#projectsupdateresponse) +[UpdateResponse](/src/dopplersdk/models/README.md#updateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { @@ -461,24 +499,27 @@ pprint(vars(results)) ``` ### **get** + Retrieve + - HTTP Method: GET - Endpoint: /v3/projects/project **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| | project | str | Required | Unique identifier for the project object. | **Return Type** -[ProjectsGetResponse](/src/dopplersdk/models/README.md#projectsgetresponse) +[GetResponse](/src/dopplersdk/models/README.md#getresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) results = sdk.projects.get(project = 'PROJECT_NAME') @@ -488,13 +529,15 @@ pprint(vars(results)) ``` ### **delete** + Delete + - HTTP Method: DELETE - Endpoint: /v3/projects/project **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| | request_input | [DeleteRequest](/src/dopplersdk/models/README.md#deleterequest) | Optional | Request body. | **Return Type** @@ -502,10 +545,11 @@ Delete Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = {'project': 'PROJECT_NAME'} @@ -515,107 +559,102 @@ pprint(vars(results)) ``` +### **create** + +Create -### **update** -Update - HTTP Method: POST -- Endpoint: /v3/configs/config/secrets +- Endpoint: /v3/environments **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [UpdateRequest](/src/dopplersdk/models/README.md#updaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project's name | +| request_input | [EnvironmentsCreateRequest](/src/dopplersdk/models/README.md#environmentscreaterequest) | Optional | Request body. | **Return Type** -[UpdateResponse](/src/dopplersdk/models/README.md#updateresponse) +[EnvironmentsCreateResponse](/src/dopplersdk/models/README.md#environmentscreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'config': 'CONFIG_NAME', - 'project': 'PROJECT_NAME', - 'secrets': {"ALGOLIA":"N9TOPUCTO","DATABASE":"${USER}@aws.dynamodb.com:9876","STRIPE":"sk_test_9YxLnoLDdvOPn2dfjBVPB"} + 'name': 'name', + 'slug': 'slug' } -results = sdk.secrets.update(request_input = request_body) +results = sdk.environments.create( + request_input = request_body, + project = 'project' +) pprint(vars(results)) ``` ### **list** + List + - HTTP Method: GET -- Endpoint: /v3/configs/config/secrets +- Endpoint: /v3/environments **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | -| accepts | str | Optional | Available options are: **application/json**, **text/plain** | -| include_dynamic_secrets | bool | Optional | Whether or not to issue leases and include dynamic secret values for the config | -| dynamic_secrets_ttl_sec | int | Optional | The number of seconds until dynamic leases expire. Must be used with `include_dynamic_secrets`. Defaults to 1800 (30 minutes). | -| secrets | str | Optional | A comma-separated list of secrets to include in the response | -| include_managed_secrets | bool | Optional | Whether to include Doppler's auto-generated (managed) secrets | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project's name | **Return Type** -[SecretsListResponse](/src/dopplersdk/models/README.md#secretslistresponse) +[EnvironmentsListResponse](/src/dopplersdk/models/README.md#environmentslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.secrets.list( - project = 'PROJECT_NAME', - config = 'CONFIG_NAME', - accepts = 'application/json', - include_dynamic_secrets = True, - dynamic_secrets_ttl_sec = -76810366, - secrets = 'secrets', - include_managed_secrets = True -) +results = sdk.environments.list(project = 'project') pprint(vars(results)) ``` ### **get** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/configs/config/secret +- Endpoint: /v3/environments/environment **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | -| name | str | Required | Name of the secret. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project's name | +| environment | str | Required | The environment's slug | **Return Type** -[SecretsGetResponse](/src/dopplersdk/models/README.md#secretsgetresponse) +[EnvironmentsGetResponse](/src/dopplersdk/models/README.md#environmentsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.secrets.get( - project = 'PROJECT_NAME', - config = 'CONFIG_NAME', - name = 'SECRET_NAME' +results = sdk.environments.get( + project = 'project', + environment = 'environment' ) pprint(vars(results)) @@ -623,202 +662,490 @@ pprint(vars(results)) ``` ### **delete** + Delete + - HTTP Method: DELETE -- Endpoint: /v3/configs/config/secret +- Endpoint: /v3/environments/environment **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | -| name | str | Required | Name of the secret. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project's name | +| environment | str | Required | The environment's slug | **Return Type** Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.secrets.delete( - project = 'PROJECT_NAME', - config = 'CONFIG_NAME', - name = 'SECRET_NAME' +results = sdk.environments.delete( + project = 'project', + environment = 'environment' ) pprint(vars(results)) ``` -### **download** -Download -- HTTP Method: GET -- Endpoint: /v3/configs/config/secrets/download +### **rename** + +Rename + +- HTTP Method: PUT +- Endpoint: /v3/environments/environment **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. Not required if using a Service Token. | -| config | str | Required | Name of the config object. Not required if using a Service Token. | -| format | [Format](/src/dopplersdk/models/README.md#format) | Optional | | -| name_transformer | [NameTransformer](/src/dopplersdk/models/README.md#nametransformer) | Optional | Transform secret names to a different case | -| include_dynamic_secrets | bool | Optional | Whether or not to issue leases and include dynamic secret values for the config | -| dynamic_secrets_ttl_sec | int | Optional | The number of seconds until dynamic leases expire. Must be used with `include_dynamic_secrets`. Defaults to 1800 (30 minutes). | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project's name | +| environment | str | Required | The environment's slug | +| request_input | [RenameRequest](/src/dopplersdk/models/README.md#renamerequest) | Optional | Request body. | **Return Type** -[DownloadResponse](/src/dopplersdk/models/README.md#downloadresponse) +[RenameResponse](/src/dopplersdk/models/README.md#renameresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.secrets.download( +request_body = { + 'name': 'name', + 'slug': 'slug' +} +results = sdk.environments.rename( + request_input = request_body, project = 'project', - config = 'config', - format = 'json', - name_transformer = 'camel', - include_dynamic_secrets = True, - dynamic_secrets_ttl_sec = 1800 + environment = 'environment' ) pprint(vars(results)) ``` -### **names** -List Names -- HTTP Method: GET -- Endpoint: /v3/configs/config/secrets/names - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | -| include_dynamic_secrets | bool | Optional | Whether or not to issue leases and include dynamic secret values for the config | -| include_managed_secrets | bool | Optional | Whether to include Doppler's auto-generated (managed) secrets | - -**Return Type** - -[NamesResponse](/src/dopplersdk/models/README.md#namesresponse) - -**Example Usage Code Snippet** -```Python -from pprint import pprint -from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' -sdk = DopplerSDK() -sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.secrets.names( - project = 'PROJECT_NAME', - config = 'CONFIG_NAME', - include_dynamic_secrets = True, - include_managed_secrets = True -) - -pprint(vars(results)) +### **update** -``` +Update -### **update_note** -Update Note - HTTP Method: POST -- Endpoint: /v3/configs/config/secrets/note +- Endpoint: /v3/configs/config **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [UpdateNoteRequest](/src/dopplersdk/models/README.md#updatenoterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ConfigsUpdateRequest](/src/dopplersdk/models/README.md#configsupdaterequest) | Optional | Request body. | **Return Type** -[UpdateNoteResponse](/src/dopplersdk/models/README.md#updatenoteresponse) +[ConfigsUpdateResponse](/src/dopplersdk/models/README.md#configsupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { 'config': 'CONFIG_NAME', - 'note': 'note', - 'project': 'PROJECT_NAME', - 'secret': 'secret' + 'name': 'CONFIG_NEW_NAME', + 'project': 'PROJECT_NAME' } -results = sdk.secrets.update_note(request_input = request_body) +results = sdk.configs.update(request_input = request_body) pprint(vars(results)) ``` +### **get** + +Retrieve -### **list** -List - HTTP Method: GET -- Endpoint: /v3/configs/config/logs +- Endpoint: /v3/configs/config **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| | project | str | Required | Unique identifier for the project object. | | config | str | Required | Name of the config object. | -| page | int | Optional | Page number | -| per_page | int | Optional | Items per page | **Return Type** -[ConfigLogsListResponse](/src/dopplersdk/models/README.md#configlogslistresponse) +[ConfigsGetResponse](/src/dopplersdk/models/README.md#configsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.config_logs.list( +results = sdk.configs.get( project = 'PROJECT_NAME', - config = 'CONFIG_NAME', - page = 1, - per_page = 20 + config = 'CONFIG_NAME' ) pprint(vars(results)) ``` -### **get** -Retrieve -- HTTP Method: GET -- Endpoint: /v3/configs/config/logs/log +### **delete** + +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/configs/config **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | -| log | str | Required | Unique identifier for the log object. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ConfigsDeleteRequest](/src/dopplersdk/models/README.md#configsdeleterequest) | Optional | Request body. | **Return Type** -[GetResponse](/src/dopplersdk/models/README.md#getresponse) +[DeleteResponse](/src/dopplersdk/models/README.md#deleteresponse) **Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = { + 'config': 'CONFIG_NAME', + 'project': 'PROJECT_NAME' +} +results = sdk.configs.delete(request_input = request_body) + +pprint(vars(results)) + +``` + +### **create** + +Create + +- HTTP Method: POST +- Endpoint: /v3/configs + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ConfigsCreateRequest](/src/dopplersdk/models/README.md#configscreaterequest) | Optional | Request body. | + +**Return Type** + +[ConfigsCreateResponse](/src/dopplersdk/models/README.md#configscreateresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = { + 'environment': 'ENVIRONMENT_ID', + 'name': 'CONFIG_NAME', + 'project': 'PROJECT_NAME' +} +results = sdk.configs.create(request_input = request_body) + +pprint(vars(results)) + +``` + +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/configs + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project's name | +| environment | str | Optional | (optional) the environment from which to list configs | +| page | int | Optional | Page number | +| per_page | int | Optional | Items per page | + +**Return Type** + +[ConfigsListResponse](/src/dopplersdk/models/README.md#configslistresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +results = sdk.configs.list( + project = 'project', + environment = 'Environment slug', + page = 1, + per_page = 20 +) + +pprint(vars(results)) + +``` + +### **unlock** + +Unlock + +- HTTP Method: POST +- Endpoint: /v3/configs/config/unlock + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [UnlockRequest](/src/dopplersdk/models/README.md#unlockrequest) | Optional | Request body. | + +**Return Type** + +[UnlockResponse](/src/dopplersdk/models/README.md#unlockresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = { + 'config': 'CONFIG_NAME', + 'project': 'PROJECT_NAME' +} +results = sdk.configs.unlock(request_input = request_body) + +pprint(vars(results)) + +``` + +### **clone** + +Clone + +- HTTP Method: POST +- Endpoint: /v3/configs/config/clone + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [CloneRequest](/src/dopplersdk/models/README.md#clonerequest) | Optional | Request body. | + +**Return Type** + +[CloneResponse](/src/dopplersdk/models/README.md#cloneresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = { + 'config': 'CONFIG_NAME', + 'name': 'NEW_CONFIG_NAME', + 'project': 'PROJECT_NAME' +} +results = sdk.configs.clone(request_input = request_body) + +pprint(vars(results)) + +``` + +### **lock** + +Lock + +- HTTP Method: POST +- Endpoint: /v3/configs/config/lock + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [LockRequest](/src/dopplersdk/models/README.md#lockrequest) | Optional | Request body. | + +**Return Type** + +[LockResponse](/src/dopplersdk/models/README.md#lockresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = { + 'config': 'CONFIG_NAME', + 'project': 'PROJECT_NAME' +} +results = sdk.configs.lock(request_input = request_body) + +pprint(vars(results)) + +``` + +### **add_trusted_ip** + +Add + +- HTTP Method: POST +- Endpoint: /v3/configs/config/trusted_ips + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | | +| config | str | Required | | +| request_input | [AddTrustedIpRequest](/src/dopplersdk/models/README.md#addtrustediprequest) | Optional | Request body. | + +**Return Type** + +[AddTrustedIpResponse](/src/dopplersdk/models/README.md#addtrustedipresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = {'ip': 'ip'} +results = sdk.configs.add_trusted_ip( + request_input = request_body, + project = 'project', + config = 'config' +) + +pprint(vars(results)) + +``` + +### **list_trusted_ips** + +List + +- HTTP Method: GET +- Endpoint: /v3/configs/config/trusted_ips + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | | +| config | str | Required | | + +**Return Type** + +[ListTrustedIpsResponse](/src/dopplersdk/models/README.md#listtrustedipsresponse) + +**Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +results = sdk.configs.list_trusted_ips( + project = 'project', + config = 'config' +) + +pprint(vars(results)) + +``` + +### **delete_trusted_ip** + +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/configs/config/trusted_ips + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | | +| config | str | Required | | +| request_input | [DeleteTrustedIpRequest](/src/dopplersdk/models/README.md#deletetrustediprequest) | Optional | Request body. | + +**Return Type** + +Returns a dict object. + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = {'ip': 'ip'} +results = sdk.configs.delete_trusted_ip( + request_input = request_body, + project = 'project', + config = 'config' +) + +pprint(vars(results)) + +``` + +### **get** + +Retrieve + +- HTTP Method: GET +- Endpoint: /v3/configs/config/logs/log + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | +| log | str | Required | Unique identifier for the log object. | + +**Return Type** + +[ConfigLogsGetResponse](/src/dopplersdk/models/README.md#configlogsgetresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) results = sdk.config_logs.get( @@ -831,27 +1158,68 @@ pprint(vars(results)) ``` +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/configs/config/logs + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | +| page | int | Optional | Page number | +| per_page | int | Optional | Items per page | + +**Return Type** + +[ConfigLogsListResponse](/src/dopplersdk/models/README.md#configlogslistresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +results = sdk.config_logs.list( + project = 'PROJECT_NAME', + config = 'CONFIG_NAME', + page = 1, + per_page = 20 +) + +pprint(vars(results)) + +``` + ### **rollback** + Rollback + - HTTP Method: POST - Endpoint: /v3/configs/config/logs/log/rollback **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| | project | str | Required | Unique identifier for the project object. | | config | str | Required | Name of the config object. | | log | str | Required | Unique identifier for the log object. | **Return Type** -[RollbackResponse](/src/dopplersdk/models/README.md#rollbackresponse) +[RollbackResponse](/src/dopplersdk/models/README.md#rollbackresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) results = sdk.config_logs.rollback( @@ -864,32 +1232,116 @@ pprint(vars(results)) ``` +### **update** + +Update + +- HTTP Method: POST +- Endpoint: /v3/configs/config/secrets + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [SecretsUpdateRequest](/src/dopplersdk/models/README.md#secretsupdaterequest) | Optional | Request body. | + +**Return Type** + +[SecretsUpdateResponse](/src/dopplersdk/models/README.md#secretsupdateresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = { + 'change_requests': [{"name":"quis et","originalName":"Ut voluptate reprehenderit culpa","originalValue":"sed ex","originalVisibility":"do nisi exercitation","shouldConverge":true,"shouldDelete":true,"shouldPromote":false,"value":"laboris anim","visibility":"sit nostrud ut est consectetur"},{"name":"officia consectetur velit amet cupidatat","originalName":"consequat nostrud deserunt ut","originalValue":"eiusmod esse veniam commodo officia","originalVisibility":"cillum","shouldConverge":false,"shouldDelete":true,"shouldPromote":true,"value":"nulla Lorem in dolore","visibility":"in"}], + 'config': 'CONFIG_NAME', + 'project': 'PROJECT_NAME', + 'secrets': {} +} +results = sdk.secrets.update(request_input = request_body) + +pprint(vars(results)) + +``` + +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/configs/config/secrets + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | +| accepts | str | Optional | Available options are: **application/json**, **text/plain** | +| include_dynamic_secrets | bool | Optional | Whether or not to issue leases and include dynamic secret values for the config | +| dynamic_secrets_ttl_sec | int | Optional | The number of seconds until dynamic leases expire. Must be used with `include_dynamic_secrets`. Defaults to 1800 (30 minutes). | +| secrets | str | Optional | A comma-separated list of secrets to include in the response | +| include_managed_secrets | bool | Optional | Whether to include Doppler's auto-generated (managed) secrets | + +**Return Type** + +[SecretsListResponse](/src/dopplersdk/models/README.md#secretslistresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +results = sdk.secrets.list( + project = 'PROJECT_NAME', + config = 'CONFIG_NAME', + accepts = 'application/json', + include_dynamic_secrets = True, + dynamic_secrets_ttl_sec = -20553545, + secrets = 'secrets', + include_managed_secrets = True +) + +pprint(vars(results)) + +``` ### **get** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/environments/environment +- Endpoint: /v3/configs/config/secret **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project's name | -| environment | str | Required | The environment's slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | +| name | str | Required | Name of the secret. | **Return Type** -[EnvironmentsGetResponse](/src/dopplersdk/models/README.md#environmentsgetresponse) +[SecretsGetResponse](/src/dopplersdk/models/README.md#secretsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.environments.get( - project = 'project', - environment = 'environment' +results = sdk.secrets.get( + project = 'PROJECT_NAME', + config = 'CONFIG_NAME', + name = 'SECRET_NAME' ) pprint(vars(results)) @@ -897,1121 +1349,1195 @@ pprint(vars(results)) ``` ### **delete** + Delete + - HTTP Method: DELETE -- Endpoint: /v3/environments/environment +- Endpoint: /v3/configs/config/secret **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project's name | -| environment | str | Required | The environment's slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | +| name | str | Required | Name of the secret. | **Return Type** Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.environments.delete( - project = 'project', - environment = 'environment' +results = sdk.secrets.delete( + project = 'PROJECT_NAME', + config = 'CONFIG_NAME', + name = 'SECRET_NAME' ) pprint(vars(results)) ``` -### **rename** -Rename -- HTTP Method: PUT -- Endpoint: /v3/environments/environment +### **download** -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project's name | -| environment | str | Required | The environment's slug | -| request_input | [RenameRequest](/src/dopplersdk/models/README.md#renamerequest) | Optional | Request body. | +Download + +- HTTP Method: GET +- Endpoint: /v3/configs/config/secrets/download + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. Not required if using a Service Token. | +| config | str | Required | Name of the config object. Not required if using a Service Token. | +| format | [Format](/src/dopplersdk/models/README.md#format) | Optional | | +| name_transformer | [NameTransformer](/src/dopplersdk/models/README.md#nametransformer) | Optional | Transform secret names to a different case | +| include_dynamic_secrets | bool | Optional | Whether or not to issue leases and include dynamic secret values for the config | +| dynamic_secrets_ttl_sec | int | Optional | The number of seconds until dynamic leases expire. Must be used with `include_dynamic_secrets`. Defaults to 1800 (30 minutes). | +| secrets | str | Optional | Comma-delimited list of secrets to include in the download. Defaults to all secrets if left unspecified. | **Return Type** -[RenameResponse](/src/dopplersdk/models/README.md#renameresponse) +[DownloadResponse](/src/dopplersdk/models/README.md#downloadresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'name': 'name', - 'slug': 'slug' -} -results = sdk.environments.rename( - request_input = request_body, +results = sdk.secrets.download( project = 'project', - environment = 'environment' + config = 'config', + format = 'json', + name_transformer = 'camel', + include_dynamic_secrets = True, + dynamic_secrets_ttl_sec = 1800, + secrets = 'secrets' ) pprint(vars(results)) ``` -### **create** -Create +### **update_note** + +Update Note + - HTTP Method: POST -- Endpoint: /v3/environments +- Endpoint: /v3/configs/config/secrets/note **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project's name | -| request_input | [EnvironmentsCreateRequest](/src/dopplersdk/models/README.md#environmentscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [UpdateNoteRequest](/src/dopplersdk/models/README.md#updatenoterequest) | Optional | Request body. | **Return Type** -[EnvironmentsCreateResponse](/src/dopplersdk/models/README.md#environmentscreateresponse) +[UpdateNoteResponse](/src/dopplersdk/models/README.md#updatenoteresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'name': 'name', - 'slug': 'slug' + 'config': 'config', + 'note': 'YOUR_NOTE', + 'project': 'PROJECT_NAME', + 'secret': 'SECRET_NAME' } -results = sdk.environments.create( - request_input = request_body, - project = 'project' -) +results = sdk.secrets.update_note(request_input = request_body) pprint(vars(results)) ``` -### **list** -List +### **names** + +List Names + - HTTP Method: GET -- Endpoint: /v3/environments +- Endpoint: /v3/configs/config/secrets/names **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project's name | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | +| include_dynamic_secrets | bool | Optional | Whether or not to issue leases and include dynamic secret values for the config | +| include_managed_secrets | bool | Optional | Whether to include Doppler's auto-generated (managed) secrets | **Return Type** -[EnvironmentsListResponse](/src/dopplersdk/models/README.md#environmentslistresponse) +[NamesResponse](/src/dopplersdk/models/README.md#namesresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.environments.list(project = 'project') +results = sdk.secrets.names( + project = 'PROJECT_NAME', + config = 'CONFIG_NAME', + include_dynamic_secrets = True, + include_managed_secrets = True +) pprint(vars(results)) ``` +### **update** + +Update -### **create** -Create - HTTP Method: POST -- Endpoint: /v3/configs +- Endpoint: /v3/workplace **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ConfigsCreateRequest](/src/dopplersdk/models/README.md#configscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [WorkplaceUpdateRequest](/src/dopplersdk/models/README.md#workplaceupdaterequest) | Optional | Request body. | **Return Type** -[ConfigsCreateResponse](/src/dopplersdk/models/README.md#configscreateresponse) +[WorkplaceUpdateResponse](/src/dopplersdk/models/README.md#workplaceupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'environment': 'ENVIRONMENT_ID', - 'name': 'CONFIG_NAME', - 'project': 'PROJECT_NAME' + 'billing_email': 'billing_email', + 'name': 'name', + 'security_email': 'security_email' } -results = sdk.configs.create(request_input = request_body) +results = sdk.workplace.update(request_input = request_body) pprint(vars(results)) ``` -### **list** -List +### **get** + +Retrieve + - HTTP Method: GET -- Endpoint: /v3/configs +- Endpoint: /v3/workplace **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project's name | -| environment | str | Optional | (optional) the environment from which to list configs | -| page | int | Optional | Page number | -| per_page | int | Optional | Items per page | + +This method has no parameters. **Return Type** -[ConfigsListResponse](/src/dopplersdk/models/README.md#configslistresponse) +[WorkplaceGetResponse](/src/dopplersdk/models/README.md#workplacegetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.configs.list( - project = 'project', - environment = 'Environment slug', - page = 1, - per_page = 20 -) +results = sdk.workplace.get() pprint(vars(results)) ``` -### **update** -Update -- HTTP Method: POST -- Endpoint: /v3/configs/config +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/logs **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ConfigsUpdateRequest](/src/dopplersdk/models/README.md#configsupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| page | str | Optional | Page number | +| per_page | int | Optional | Items per page | **Return Type** -[ConfigsUpdateResponse](/src/dopplersdk/models/README.md#configsupdateresponse) +[ActivityLogsListResponse](/src/dopplersdk/models/README.md#activitylogslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'config': 'CONFIG_NAME', - 'name': 'CONFIG_NEW_NAME', - 'project': 'PROJECT_NAME' -} -results = sdk.configs.update(request_input = request_body) +results = sdk.activity_logs.list( + page = '1', + per_page = 20 +) pprint(vars(results)) ``` -### **get** +### **retrieve** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/configs/config +- Endpoint: /v3/logs/log **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| log | str | Required | Unique identifier for the log object. | **Return Type** -[ConfigsGetResponse](/src/dopplersdk/models/README.md#configsgetresponse) +[RetrieveResponse](/src/dopplersdk/models/README.md#retrieveresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.configs.get( - project = 'PROJECT_NAME', - config = 'CONFIG_NAME' -) +results = sdk.activity_logs.retrieve(log = 'LOG_ID') pprint(vars(results)) ``` ### **delete** + Delete + - HTTP Method: DELETE -- Endpoint: /v3/configs/config +- Endpoint: /v3/configs/config/tokens/token **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ConfigsDeleteRequest](/src/dopplersdk/models/README.md#configsdeleterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ServiceTokensDeleteRequest](/src/dopplersdk/models/README.md#servicetokensdeleterequest) | Optional | Request body. | **Return Type** -[DeleteResponse](/src/dopplersdk/models/README.md#deleteresponse) +[DeleteResponse](/src/dopplersdk/models/README.md#deleteresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { 'config': 'CONFIG_NAME', - 'project': 'PROJECT_NAME' + 'project': 'PROJECT_NAME', + 'slug': 'TOKEN_SLUG', + 'token': 'TOKEN_VALUE' } -results = sdk.configs.delete(request_input = request_body) +results = sdk.service_tokens.delete(request_input = request_body) pprint(vars(results)) ``` -### **clone** -Clone +### **create** + +Create + - HTTP Method: POST -- Endpoint: /v3/configs/config/clone +- Endpoint: /v3/configs/config/tokens **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [CloneRequest](/src/dopplersdk/models/README.md#clonerequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ServiceTokensCreateRequest](/src/dopplersdk/models/README.md#servicetokenscreaterequest) | Optional | Request body. | **Return Type** -[CloneResponse](/src/dopplersdk/models/README.md#cloneresponse) +[ServiceTokensCreateResponse](/src/dopplersdk/models/README.md#servicetokenscreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { + 'access': 'read', 'config': 'CONFIG_NAME', - 'name': 'NEW_CONFIG_NAME', + 'expire_at': '1898-12-29T20:03:18.0Z', + 'name': 'TOKEN_NAME', 'project': 'PROJECT_NAME' } -results = sdk.configs.clone(request_input = request_body) +results = sdk.service_tokens.create(request_input = request_body) pprint(vars(results)) ``` -### **lock** -Lock -- HTTP Method: POST -- Endpoint: /v3/configs/config/lock +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/configs/config/tokens **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [LockRequest](/src/dopplersdk/models/README.md#lockrequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | **Return Type** -[LockResponse](/src/dopplersdk/models/README.md#lockresponse) +[ServiceTokensListResponse](/src/dopplersdk/models/README.md#servicetokenslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'config': 'CONFIG_NAME', - 'project': 'PROJECT_NAME' -} -results = sdk.configs.lock(request_input = request_body) +results = sdk.service_tokens.list( + project = 'PROJECT_NAME', + config = 'CONFIG_NAME' +) pprint(vars(results)) ``` -### **unlock** -Unlock -- HTTP Method: POST -- Endpoint: /v3/configs/config/unlock +### **get_user** + +Workplace User + +- HTTP Method: GET +- Endpoint: /v3/workplace/users/{workplace_user_id} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [UnlockRequest](/src/dopplersdk/models/README.md#unlockrequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| workplace_user_id | str | Required | The ID of the workplace user | +| settings | bool | Optional | If true, the api will return more information if the user has e.g. SAML enabled and/or Multi Factor Auth enabled | **Return Type** -[UnlockResponse](/src/dopplersdk/models/README.md#unlockresponse) +[GetUserResponse](/src/dopplersdk/models/README.md#getuserresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'config': 'CONFIG_NAME', - 'project': 'PROJECT_NAME' -} -results = sdk.configs.unlock(request_input = request_body) +results = sdk.audit.get_user( + workplace_user_id = 'workplace_user_id', + settings = True +) pprint(vars(results)) ``` -### **add_trusted_ip** -Add -- HTTP Method: POST -- Endpoint: /v3/configs/config/trusted_ips +### **revoke_lease** + +Revoke Lease + +- HTTP Method: DELETE +- Endpoint: /v3/configs/config/dynamic_secrets/dynamic_secret/leases/lease **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | | -| config | str | Required | | -| request_input | [AddTrustedIpRequest](/src/dopplersdk/models/README.md#addtrustediprequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [RevokeLeaseRequest](/src/dopplersdk/models/README.md#revokeleaserequest) | Optional | Request body. | **Return Type** -[AddTrustedIpResponse](/src/dopplersdk/models/README.md#addtrustedipresponse) +[RevokeLeaseResponse](/src/dopplersdk/models/README.md#revokeleaseresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = {'ip': 'ip'} -results = sdk.configs.add_trusted_ip( - request_input = request_body, - project = 'project', - config = 'config' -) +request_body = { + 'config': 'config', + 'dynamic_secret': 'dynamic_secret', + 'project': 'project', + 'slug': 'slug' +} +results = sdk.dynamic_secrets.revoke_lease(request_input = request_body) pprint(vars(results)) -``` +``` + +### **issue_lease** + +Issue Lease -### **list_trusted_ips** -List -- HTTP Method: GET -- Endpoint: /v3/configs/config/trusted_ips +- HTTP Method: POST +- Endpoint: /v3/configs/config/dynamic_secrets/dynamic_secret/leases **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | | -| config | str | Required | | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [IssueLeaseRequest](/src/dopplersdk/models/README.md#issueleaserequest) | Optional | Request body. | **Return Type** -[ListTrustedIpsResponse](/src/dopplersdk/models/README.md#listtrustedipsresponse) +[IssueLeaseResponse](/src/dopplersdk/models/README.md#issueleaseresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.configs.list_trusted_ips( - project = 'project', - config = 'config' -) +request_body = { + 'config': 'config', + 'dynamic_secret': 'dynamic_secret', + 'project': 'project', + 'ttl_sec': 56600272 +} +results = sdk.dynamic_secrets.issue_lease(request_input = request_body) pprint(vars(results)) ``` -### **delete_trusted_ip** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/configs/config/trusted_ips +### **revoke** + +Revoke + +- HTTP Method: POST +- Endpoint: /v3/auth/revoke **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | | -| config | str | Required | | -| request_input | [DeleteTrustedIpRequest](/src/dopplersdk/models/README.md#deletetrustediprequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [RevokeRequest](/src/dopplersdk/models/README.md#revokerequest) | Optional | Request body. | **Return Type** Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = {'ip': 'ip'} -results = sdk.configs.delete_trusted_ip( - request_input = request_body, - project = 'project', - config = 'config' -) +request_body = {'token': 'token'} +results = sdk.auth.revoke(request_input = request_body) pprint(vars(results)) ``` +### **me** + +Me -### **retrieve** -Retrieve - HTTP Method: GET -- Endpoint: /v3/logs/log +- Endpoint: /v3/me **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| log | str | Required | Unique identifier for the log object. | + +This method has no parameters. **Return Type** -[RetrieveResponse](/src/dopplersdk/models/README.md#retrieveresponse) +[MeResponse](/src/dopplersdk/models/README.md#meresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.activity_logs.retrieve(log = 'LOG_ID') +results = sdk.auth.me() pprint(vars(results)) ``` -### **list** -List +### **get** + +Retrieve + - HTTP Method: GET -- Endpoint: /v3/logs +- Endpoint: /v3/integrations/integration **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| page | str | Optional | Page number | -| per_page | int | Optional | Items per page | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| integration | str | Required | The integration slug | **Return Type** -[ActivityLogsListResponse](/src/dopplersdk/models/README.md#activitylogslistresponse) +[IntegrationsGetResponse](/src/dopplersdk/models/README.md#integrationsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.activity_logs.list( - page = '1', - per_page = 20 -) +results = sdk.integrations.get(integration = 'integration') pprint(vars(results)) ``` +### **delete** -### **update** -Update -- HTTP Method: POST -- Endpoint: /v3/workplace +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/integrations/integration **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [WorkplaceUpdateRequest](/src/dopplersdk/models/README.md#workplaceupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| integration | str | Required | The slug of the integration to delete | **Return Type** -[WorkplaceUpdateResponse](/src/dopplersdk/models/README.md#workplaceupdateresponse) +[IntegrationsDeleteResponse](/src/dopplersdk/models/README.md#integrationsdeleteresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'billing_email': 'billing_email', - 'name': 'name', - 'security_email': 'security_email' -} -results = sdk.workplace.update(request_input = request_body) +results = sdk.integrations.delete(integration = 'integration') pprint(vars(results)) ``` -### **get** -Retrieve -- HTTP Method: GET -- Endpoint: /v3/workplace +### **update** -**Parameters** +Update -This method has no parameters. +- HTTP Method: PUT +- Endpoint: /v3/integrations/integration + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| integration | str | Required | The slug of the integration to update | +| request_input | [IntegrationsUpdateRequest](/src/dopplersdk/models/README.md#integrationsupdaterequest) | Optional | Request body. | **Return Type** -[WorkplaceGetResponse](/src/dopplersdk/models/README.md#workplacegetresponse) +[IntegrationsUpdateResponse](/src/dopplersdk/models/README.md#integrationsupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace.get() +request_body = { + 'data': 'data', + 'name': 'name' +} +results = sdk.integrations.update( + request_input = request_body, + integration = 'integration' +) pprint(vars(results)) ``` - ### **create** + Create + - HTTP Method: POST -- Endpoint: /v3/configs/config/tokens +- Endpoint: /v3/integrations **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ServiceTokensCreateRequest](/src/dopplersdk/models/README.md#servicetokenscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [IntegrationsCreateRequest](/src/dopplersdk/models/README.md#integrationscreaterequest) | Optional | Request body. | **Return Type** -[ServiceTokensCreateResponse](/src/dopplersdk/models/README.md#servicetokenscreateresponse) +[IntegrationsCreateResponse](/src/dopplersdk/models/README.md#integrationscreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'access': 'read', - 'config': 'CONFIG_NAME', - 'expire_at': '1904-01-08T14:23:04.0Z', - 'name': 'TOKEN_NAME', - 'project': 'PROJECT_NAME' + 'data': {}, + 'name': 'name', + 'type_': 'type' } -results = sdk.service_tokens.create(request_input = request_body) +results = sdk.integrations.create(request_input = request_body) pprint(vars(results)) ``` ### **list** + List + - HTTP Method: GET -- Endpoint: /v3/configs/config/tokens +- Endpoint: /v3/integrations **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | + +This method has no parameters. **Return Type** -[ServiceTokensListResponse](/src/dopplersdk/models/README.md#servicetokenslistresponse) +[IntegrationsListResponse](/src/dopplersdk/models/README.md#integrationslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.service_tokens.list( - project = 'PROJECT_NAME', - config = 'CONFIG_NAME' -) +results = sdk.integrations.list() pprint(vars(results)) ``` -### **delete** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/configs/config/tokens/token +### **create** + +Create + +- HTTP Method: POST +- Endpoint: /v3/configs/config/syncs **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ServiceTokensDeleteRequest](/src/dopplersdk/models/README.md#servicetokensdeleterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project slug | +| config | str | Required | The config slug | +| request_input | [SyncsCreateRequest](/src/dopplersdk/models/README.md#syncscreaterequest) | Optional | Request body. | **Return Type** -[DeleteResponse](/src/dopplersdk/models/README.md#deleteresponse) +[SyncsCreateResponse](/src/dopplersdk/models/README.md#syncscreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'config': 'CONFIG_NAME', - 'project': 'PROJECT_NAME', - 'slug': 'TOKEN_SLUG', - 'token': 'TOKEN_VALUE' + 'await_initial_sync': True, + 'data': {}, + 'import_option': 'none', + 'integration': 'integration' } -results = sdk.service_tokens.delete(request_input = request_body) +results = sdk.syncs.create( + request_input = request_body, + project = 'project', + config = 'config' +) pprint(vars(results)) ``` +### **get** + +Retrieve -### **get_user** -Workplace User - HTTP Method: GET -- Endpoint: /v3/workplace/users/{workplace_user_id} +- Endpoint: /v3/configs/config/syncs/sync **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| workplace_user_id | str | Required | The ID of the workplace user | -| settings | bool | Optional | If true, the api will return more information if the user has e.g. SAML enabled and/or Multi Factor Auth enabled | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project slug | +| config | str | Required | The config slug | +| sync | str | Required | The sync slug | **Return Type** -[GetUserResponse](/src/dopplersdk/models/README.md#getuserresponse) +[SyncsGetResponse](/src/dopplersdk/models/README.md#syncsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.audit.get_user( - workplace_user_id = 'workplace_user_id', - settings = True +results = sdk.syncs.get( + project = 'project', + config = 'config', + sync = 'sync' ) pprint(vars(results)) ``` +### **delete** -### **issue_lease** -Issue Lease -- HTTP Method: POST -- Endpoint: /v3/configs/config/dynamic_secrets/dynamic_secret/leases +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/configs/config/syncs/sync **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [IssueLeaseRequest](/src/dopplersdk/models/README.md#issueleaserequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project slug | +| config | str | Required | The config slug | +| sync | str | Required | The sync slug | +| delete_from_target | bool | Required | Whether or not to delete the synced data from the target integration | **Return Type** -[IssueLeaseResponse](/src/dopplersdk/models/README.md#issueleaseresponse) +[SyncsDeleteResponse](/src/dopplersdk/models/README.md#syncsdeleteresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'config': 'config', - 'dynamic_secret': 'dynamic_secret', - 'project': 'project', - 'ttl_sec': -29276405 -} -results = sdk.dynamic_secrets.issue_lease(request_input = request_body) +results = sdk.syncs.delete( + project = 'project', + config = 'config', + sync = 'sync', + delete_from_target = True +) pprint(vars(results)) ``` -### **revoke_lease** -Revoke Lease -- HTTP Method: DELETE -- Endpoint: /v3/configs/config/dynamic_secrets/dynamic_secret/leases/lease +### **create** + +Create + +- HTTP Method: POST +- Endpoint: /v3/workplace/roles **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [RevokeLeaseRequest](/src/dopplersdk/models/README.md#revokeleaserequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [WorkplaceRolesCreateRequest](/src/dopplersdk/models/README.md#workplacerolescreaterequest) | Optional | Request body. | **Return Type** -[RevokeLeaseResponse](/src/dopplersdk/models/README.md#revokeleaseresponse) +[WorkplaceRolesCreateResponse](/src/dopplersdk/models/README.md#workplacerolescreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'config': 'config', - 'dynamic_secret': 'dynamic_secret', - 'project': 'project', - 'slug': 'slug' + 'name': 'name', + 'permissions': ["aliqua do","ullamco Lorem sunt eu"] } -results = sdk.dynamic_secrets.revoke_lease(request_input = request_body) +results = sdk.workplace_roles.create(request_input = request_body) pprint(vars(results)) ``` +### **list** -### **revoke** -Revoke -- HTTP Method: POST -- Endpoint: /v3/auth/revoke +List + +- HTTP Method: GET +- Endpoint: /v3/workplace/roles **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [RevokeRequest](/src/dopplersdk/models/README.md#revokerequest) | Optional | Request body. | + +This method has no parameters. **Return Type** -Returns a dict object. +[WorkplaceRolesListResponse](/src/dopplersdk/models/README.md#workplaceroleslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = {'token': 'token'} -results = sdk.auth.revoke(request_input = request_body) +results = sdk.workplace_roles.list() pprint(vars(results)) ``` -### **me** -Me +### **get** + +Retrieve + - HTTP Method: GET -- Endpoint: /v3/me +- Endpoint: /v3/workplace/roles/role/{role} **Parameters** - -This method has no parameters. +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| role | str | Required | The role's unique identifier | **Return Type** -[MeResponse](/src/dopplersdk/models/README.md#meresponse) +[WorkplaceRolesGetResponse](/src/dopplersdk/models/README.md#workplacerolesgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.auth.me() +results = sdk.workplace_roles.get(role = 'role') pprint(vars(results)) ``` +### **update** -### **create** -Create -- HTTP Method: POST -- Endpoint: /v3/integrations +Update + +- HTTP Method: PATCH +- Endpoint: /v3/workplace/roles/role/{role} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [IntegrationsCreateRequest](/src/dopplersdk/models/README.md#integrationscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| role | str | Required | The role's unique identifier, which is the initial name the role was given | +| request_input | [WorkplaceRolesUpdateRequest](/src/dopplersdk/models/README.md#workplacerolesupdaterequest) | Optional | Request body. | **Return Type** -[IntegrationsCreateResponse](/src/dopplersdk/models/README.md#integrationscreateresponse) +[WorkplaceRolesUpdateResponse](/src/dopplersdk/models/README.md#workplacerolesupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'data': {}, 'name': 'name', - 'type_': 'type' + 'permissions': ["Ut labore sunt in","veniam qui laborum nisi"] } -results = sdk.integrations.create(request_input = request_body) +results = sdk.workplace_roles.update( + request_input = request_body, + role = 'role' +) pprint(vars(results)) ``` -### **list** -List -- HTTP Method: GET -- Endpoint: /v3/integrations +### **delete** -**Parameters** +Delete -This method has no parameters. +- HTTP Method: DELETE +- Endpoint: /v3/workplace/roles/role/{role} + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| role | str | Required | The role's unique identifier | **Return Type** -[IntegrationsListResponse](/src/dopplersdk/models/README.md#integrationslistresponse) +Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.integrations.list() +results = sdk.workplace_roles.delete(role = 'role') pprint(vars(results)) ``` -### **get** -Retrieve +### **list_permissions** + +List Permissions + - HTTP Method: GET -- Endpoint: /v3/integrations/integration +- Endpoint: /v3/workplace/permissions **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| integration | str | Required | The integration slug | + +This method has no parameters. **Return Type** -[IntegrationsGetResponse](/src/dopplersdk/models/README.md#integrationsgetresponse) +[ListPermissionsResponse](/src/dopplersdk/models/README.md#listpermissionsresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.integrations.get(integration = 'integration') +results = sdk.workplace_roles.list_permissions() pprint(vars(results)) ``` -### **delete** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/integrations/integration +### **get** + +Retrieve + +- HTTP Method: GET +- Endpoint: /v3/projects/roles/role/{role} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| integration | str | Required | The slug of the integration to delete | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| role | str | Required | The role's unique identifier | **Return Type** -[IntegrationsDeleteResponse](/src/dopplersdk/models/README.md#integrationsdeleteresponse) +[ProjectRolesGetResponse](/src/dopplersdk/models/README.md#projectrolesgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.integrations.delete(integration = 'integration') +results = sdk.project_roles.get(role = 'role') pprint(vars(results)) ``` ### **update** + Update -- HTTP Method: PUT -- Endpoint: /v3/integrations/integration + +- HTTP Method: PATCH +- Endpoint: /v3/projects/roles/role/{role} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| integration | str | Required | The slug of the integration to update | -| request_input | [IntegrationsUpdateRequest](/src/dopplersdk/models/README.md#integrationsupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| role | str | Required | The role's unique identifier | +| request_input | [ProjectRolesUpdateRequest](/src/dopplersdk/models/README.md#projectrolesupdaterequest) | Optional | Request body. | **Return Type** -[IntegrationsUpdateResponse](/src/dopplersdk/models/README.md#integrationsupdateresponse) +[ProjectRolesUpdateResponse](/src/dopplersdk/models/README.md#projectrolesupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'data': 'data', - 'name': 'name' + 'name': 'name', + 'permissions': ["eiusmod tempor laboris id","dolore proident"] } -results = sdk.integrations.update( +results = sdk.project_roles.update( request_input = request_body, - integration = 'integration' + role = 'role' ) pprint(vars(results)) ``` +### **delete** -### **create** -Create -- HTTP Method: POST -- Endpoint: /v3/configs/config/syncs +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/projects/roles/role/{role} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project slug | -| config | str | Required | The config slug | -| request_input | [SyncsCreateRequest](/src/dopplersdk/models/README.md#syncscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| role | str | Required | The role's unique identifier | **Return Type** -[SyncsCreateResponse](/src/dopplersdk/models/README.md#syncscreateresponse) +Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'data': {}, - 'import_option': 'none', - 'integration': 'integration' -} -results = sdk.syncs.create( - request_input = request_body, - project = 'project', - config = 'config' -) +results = sdk.project_roles.delete(role = 'role') pprint(vars(results)) ``` -### **get** -Retrieve -- HTTP Method: GET -- Endpoint: /v3/configs/config/syncs/sync +### **create** + +Create + +- HTTP Method: POST +- Endpoint: /v3/projects/roles **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project slug | -| config | str | Required | The config slug | -| sync | str | Required | The sync slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ProjectRolesCreateRequest](/src/dopplersdk/models/README.md#projectrolescreaterequest) | Optional | Request body. | **Return Type** -[SyncsGetResponse](/src/dopplersdk/models/README.md#syncsgetresponse) +[ProjectRolesCreateResponse](/src/dopplersdk/models/README.md#projectrolescreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.syncs.get( - project = 'project', - config = 'config', - sync = 'sync' -) +request_body = { + 'name': 'name', + 'permissions': ["velit reprehenderit ipsum","incididunt elit sint qui"] +} +results = sdk.project_roles.create(request_input = request_body) pprint(vars(results)) ``` -### **delete** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/configs/config/syncs/sync +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/projects/roles **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project slug | -| config | str | Required | The config slug | -| sync | str | Required | The sync slug | -| delete_from_target | bool | Required | Whether or not to delete the synced data from the target integration | + +This method has no parameters. **Return Type** -[SyncsDeleteResponse](/src/dopplersdk/models/README.md#syncsdeleteresponse) +[ProjectRolesListResponse](/src/dopplersdk/models/README.md#projectroleslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.syncs.delete( - project = 'project', - config = 'config', - sync = 'sync', - delete_from_target = True -) +results = sdk.project_roles.list() pprint(vars(results)) ``` +### **list_permissions** -### **create** -Create -- HTTP Method: POST -- Endpoint: /v3/workplace/roles +List Permissions + +- HTTP Method: GET +- Endpoint: /v3/projects/permissions **Parameters** @@ -2019,579 +2545,680 @@ This method has no parameters. **Return Type** -[WorkplaceRolesCreateResponse](/src/dopplersdk/models/README.md#workplacerolescreateresponse) +[ProjectRolesListPermissionsResponse](/src/dopplersdk/models/README.md#projectroleslistpermissionsresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace_roles.create() +results = sdk.project_roles.list_permissions() pprint(vars(results)) ``` -### **list** -List -- HTTP Method: GET -- Endpoint: /v3/workplace/roles +### **add** -**Parameters** +Add -This method has no parameters. +- HTTP Method: POST +- Endpoint: /v3/projects/project/members + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Project slug | +| request_input | [AddRequest](/src/dopplersdk/models/README.md#addrequest) | Optional | Request body. | **Return Type** -[WorkplaceRolesListResponse](/src/dopplersdk/models/README.md#workplaceroleslistresponse) +[AddResponse](/src/dopplersdk/models/README.md#addresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace_roles.list() +request_body = { + 'environments': ["Excepteur mollit","magna eiusmod sunt enim"], + 'role': 'role', + 'slug': 'slug', + 'type_': 'service_account' +} +results = sdk.project_members.add( + request_input = request_body, + project = 'project' +) pprint(vars(results)) ``` -### **list_permissions** -List Permissions +### **list** + +List + - HTTP Method: GET -- Endpoint: /v3/workplace/permissions +- Endpoint: /v3/projects/project/members **Parameters** - -This method has no parameters. +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Project slug | +| page | int | Optional | | +| per_page | int | Optional | | **Return Type** -[ListPermissionsResponse](/src/dopplersdk/models/README.md#listpermissionsresponse) +[ProjectMembersListResponse](/src/dopplersdk/models/README.md#projectmemberslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace_roles.list_permissions() +results = sdk.project_members.list( + project = 'project', + page = 1, + per_page = 20 +) pprint(vars(results)) ``` ### **get** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/workplace/roles/role/{role} +- Endpoint: /v3/projects/project/members/member/{type}/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| role | str | Required | The role's unique identifier | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Project slug | +| type\_ | [Type](/src/dopplersdk/models/README.md#type) | Required | | +| slug | str | Required | Member's slug | **Return Type** -[WorkplaceRolesGetResponse](/src/dopplersdk/models/README.md#workplacerolesgetresponse) +[ProjectMembersGetResponse](/src/dopplersdk/models/README.md#projectmembersgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace_roles.get(role = 'role') +results = sdk.project_members.get( + project = 'project', + type_ = 'workplace_user', + slug = 'slug' +) pprint(vars(results)) ``` ### **update** + Update + - HTTP Method: PATCH -- Endpoint: /v3/workplace/roles/role/{role} +- Endpoint: /v3/projects/project/members/member/{type}/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| role | str | Required | The role's unique identifier | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| type\_ | [Type](/src/dopplersdk/models/README.md#type) | Required | | +| slug | str | Required | Member's slug | +| project | str | Required | Project slug | +| request_input | [ProjectMembersUpdateRequest](/src/dopplersdk/models/README.md#projectmembersupdaterequest) | Optional | Request body. | **Return Type** -[WorkplaceRolesUpdateResponse](/src/dopplersdk/models/README.md#workplacerolesupdateresponse) +[ProjectMembersUpdateResponse](/src/dopplersdk/models/README.md#projectmembersupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace_roles.update(role = 'role') +request_body = { + 'environments': ["culpa","ut aliquip officia"], + 'role': 'role' +} +results = sdk.project_members.update( + request_input = request_body, + type_ = 'group', + slug = 'slug', + project = 'project' +) pprint(vars(results)) ``` ### **delete** + Delete + - HTTP Method: DELETE -- Endpoint: /v3/workplace/roles/role/{role} +- Endpoint: /v3/projects/project/members/member/{type}/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| role | str | Required | The role's unique identifier | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| type\_ | [Type](/src/dopplersdk/models/README.md#type) | Required | | +| slug | str | Required | Member's slug | +| project | str | Required | Project slug | **Return Type** Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace_roles.delete(role = 'role') +results = sdk.project_members.delete( + type_ = 'service_account', + slug = 'slug', + project = 'project' +) pprint(vars(results)) ``` +### **list** + +List -### **create** -Create -- HTTP Method: POST -- Endpoint: /v3/projects/roles +- HTTP Method: GET +- Endpoint: /v3/workplace/invites **Parameters** - -This method has no parameters. +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| page | int | Optional | | +| per_page | int | Optional | | **Return Type** -[ProjectRolesCreateResponse](/src/dopplersdk/models/README.md#projectrolescreateresponse) +[InvitesListResponse](/src/dopplersdk/models/README.md#inviteslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_roles.create() +results = sdk.invites.list( + page = 1, + per_page = 20 +) pprint(vars(results)) ``` -### **list** -List +### **get** + +Retrieve + - HTTP Method: GET -- Endpoint: /v3/projects/roles +- Endpoint: /v3/workplace/service_accounts/service_account/{slug} **Parameters** - -This method has no parameters. +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | Slug of the service account | **Return Type** -[ProjectRolesListResponse](/src/dopplersdk/models/README.md#projectroleslistresponse) +[ServiceAccountsGetResponse](/src/dopplersdk/models/README.md#serviceaccountsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_roles.list() +results = sdk.service_accounts.get(slug = 'slug') pprint(vars(results)) ``` -### **get** -Retrieve -- HTTP Method: GET -- Endpoint: /v3/projects/roles/role/{role} +### **update** + +Update + +- HTTP Method: PATCH +- Endpoint: /v3/workplace/service_accounts/service_account/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| role | str | Required | The role's unique identifier | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | Slug of the service account | +| request_input | [ServiceAccountsUpdateRequest](/src/dopplersdk/models/README.md#serviceaccountsupdaterequest) | Optional | Request body. | **Return Type** -[ProjectRolesGetResponse](/src/dopplersdk/models/README.md#projectrolesgetresponse) +[ServiceAccountsUpdateResponse](/src/dopplersdk/models/README.md#serviceaccountsupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_roles.get(role = 'role') +request_body = { + 'name': 'name', + 'workplace_role': {"identifier":"identifier","permissions":["nulla","dolore"]} +} +results = sdk.service_accounts.update( + request_input = request_body, + slug = 'slug' +) pprint(vars(results)) ``` -### **update** -Update -- HTTP Method: PATCH -- Endpoint: /v3/projects/roles/role/{role} +### **delete** + +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/workplace/service_accounts/service_account/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| role | str | Required | The role's unique identifier | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | Slug of the service account | **Return Type** -[ProjectRolesUpdateResponse](/src/dopplersdk/models/README.md#projectrolesupdateresponse) +Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_roles.update(role = 'role') +results = sdk.service_accounts.delete(slug = 'slug') pprint(vars(results)) ``` -### **delete** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/projects/roles/role/{role} +### **create** + +Create + +- HTTP Method: POST +- Endpoint: /v3/workplace/service_accounts **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| role | str | Required | The role's unique identifier | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ServiceAccountsCreateRequest](/src/dopplersdk/models/README.md#serviceaccountscreaterequest) | Optional | Request body. | **Return Type** -Returns a dict object. +[ServiceAccountsCreateResponse](/src/dopplersdk/models/README.md#serviceaccountscreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_roles.delete(role = 'role') +request_body = { + 'name': 'name', + 'workplace_role': {"identifier":"identifier","permissions":["consectetur voluptate","ipsum cupidatat est qui"]} +} +results = sdk.service_accounts.create(request_input = request_body) pprint(vars(results)) ``` -### **list_permissions** -List Permissions +### **list** + +List + - HTTP Method: GET -- Endpoint: /v3/projects/permissions +- Endpoint: /v3/workplace/service_accounts **Parameters** - -This method has no parameters. +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| page | int | Optional | | +| per_page | int | Optional | | **Return Type** -[ProjectRolesListPermissionsResponse](/src/dopplersdk/models/README.md#projectroleslistpermissionsresponse) +[ServiceAccountsListResponse](/src/dopplersdk/models/README.md#serviceaccountslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_roles.list_permissions() +results = sdk.service_accounts.list( + page = 1, + per_page = 20 +) pprint(vars(results)) ``` +### **get** -### **add** -Add -- HTTP Method: POST -- Endpoint: /v3/projects/project/members +Retrieve + +- HTTP Method: GET +- Endpoint: /v3/workplace/groups/group/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Project slug | -| request_input | [AddRequest](/src/dopplersdk/models/README.md#addrequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | The group's slug | **Return Type** -[AddResponse](/src/dopplersdk/models/README.md#addresponse) +[GroupsGetResponse](/src/dopplersdk/models/README.md#groupsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'environments': ["ad","Lorem do sit in"], - 'role': 'role', - 'slug': 'slug', - 'type_': 'group' -} -results = sdk.project_members.add( - request_input = request_body, - project = 'project' -) +results = sdk.groups.get(slug = 'slug') pprint(vars(results)) ``` -### **list** -List -- HTTP Method: GET -- Endpoint: /v3/projects/project/members +### **update** + +Update + +- HTTP Method: PATCH +- Endpoint: /v3/workplace/groups/group/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Project slug | -| page | int | Optional | | -| per_page | int | Optional | | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | The group's slug | +| request_input | [GroupsUpdateRequest](/src/dopplersdk/models/README.md#groupsupdaterequest) | Optional | Request body. | **Return Type** -[ProjectMembersListResponse](/src/dopplersdk/models/README.md#projectmemberslistresponse) +[GroupsUpdateResponse](/src/dopplersdk/models/README.md#groupsupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_members.list( - project = 'project', - page = 1, - per_page = 20 +request_body = { + 'default_project_role': 'default_project_role', + 'name': 'name' +} +results = sdk.groups.update( + request_input = request_body, + slug = 'slug' ) pprint(vars(results)) ``` -### **get** -Retrieve -- HTTP Method: GET -- Endpoint: /v3/projects/project/members/member/{type}/{slug} +### **delete** + +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/workplace/groups/group/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Project slug | -| type | [Type](/src/dopplersdk/models/README.md#type) | Required | | -| slug | str | Required | Member's slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | The group's slug | **Return Type** -[ProjectMembersGetResponse](/src/dopplersdk/models/README.md#projectmembersgetresponse) +Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_members.get( - project = 'project', - type = 'service_account', - slug = 'slug' -) +results = sdk.groups.delete(slug = 'slug') pprint(vars(results)) ``` -### **update** -Update -- HTTP Method: PATCH -- Endpoint: /v3/projects/project/members/member/{type}/{slug} +### **create** + +Create + +- HTTP Method: POST +- Endpoint: /v3/workplace/groups **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| type | [Type](/src/dopplersdk/models/README.md#type) | Required | | -| slug | str | Required | Member's slug | -| project | str | Required | Project slug | -| request_input | [ProjectMembersUpdateRequest](/src/dopplersdk/models/README.md#projectmembersupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [GroupsCreateRequest](/src/dopplersdk/models/README.md#groupscreaterequest) | Optional | Request body. | **Return Type** -[ProjectMembersUpdateResponse](/src/dopplersdk/models/README.md#projectmembersupdateresponse) +[GroupsCreateResponse](/src/dopplersdk/models/README.md#groupscreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'environments': ["cillum ut exercitation","Excepteur incididunt"], - 'role': 'role' + 'default_project_role': 'default_project_role', + 'name': 'name' } -results = sdk.project_members.update( - request_input = request_body, - type = 'group', - slug = 'slug', - project = 'project' -) +results = sdk.groups.create(request_input = request_body) pprint(vars(results)) ``` -### **delete** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/projects/project/members/member/{type}/{slug} +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/workplace/groups **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| type | [Type](/src/dopplersdk/models/README.md#type) | Required | | -| slug | str | Required | Member's slug | -| project | str | Required | Project slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| page | int | Optional | | +| per_page | int | Optional | | **Return Type** -Returns a dict object. +[GroupsListResponse](/src/dopplersdk/models/README.md#groupslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_members.delete( - type = 'workplace_user', - slug = 'slug', - project = 'project' +results = sdk.groups.list( + page = 1, + per_page = 20 ) pprint(vars(results)) ``` +### **delete_member** + +Delete Member -### **list** -List -- HTTP Method: GET -- Endpoint: /v3/workplace/invites +- HTTP Method: DELETE +- Endpoint: /v3/workplace/groups/group/{slug}/members/{type}/{member_slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| page | int | Optional | | -| per_page | int | Optional | | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | The group's slug | +| type\_ | [GroupsType](/src/dopplersdk/models/README.md#groupstype) | Required | | +| member_slug | str | Required | The member's slug | **Return Type** -[InvitesListResponse](/src/dopplersdk/models/README.md#inviteslistresponse) +Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.invites.list( - page = 1, - per_page = 20 +results = sdk.groups.delete_member( + slug = 'slug', + type_ = 'workplace_user', + member_slug = 'member_slug' ) pprint(vars(results)) ``` +### **add_member** + +Add Member -### **create** -Create - HTTP Method: POST -- Endpoint: /v3/workplace/service_accounts +- Endpoint: /v3/workplace/groups/group/{slug}/members **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ServiceAccountsCreateRequest](/src/dopplersdk/models/README.md#serviceaccountscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | The group's slug | +| request_input | [AddMemberRequest](/src/dopplersdk/models/README.md#addmemberrequest) | Optional | Request body. | **Return Type** -[ServiceAccountsCreateResponse](/src/dopplersdk/models/README.md#serviceaccountscreateresponse) +Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'name': 'name', - 'workplace_role': {"identifier":"identifier","permissions":["Excepteur dolore nisi tempor","tempor aliquip"]} + 'slug': 'slug', + 'type_': 'workplace_user' } -results = sdk.service_accounts.create(request_input = request_body) +results = sdk.groups.add_member( + request_input = request_body, + slug = 'slug' +) pprint(vars(results)) ``` ### **list** + List + - HTTP Method: GET -- Endpoint: /v3/workplace/service_accounts +- Endpoint: /v3/workplace/users **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| page | int | Optional | | -| per_page | int | Optional | | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| page | int | Optional | The page of users to fetch | +| email | str | Optional | Filter results to only include the user with the provided email address | **Return Type** -[ServiceAccountsListResponse](/src/dopplersdk/models/README.md#serviceaccountslistresponse) +[UsersListResponse](/src/dopplersdk/models/README.md#userslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.service_accounts.list( +results = sdk.users.list( page = 1, - per_page = 20 + email = 'email' ) pprint(vars(results)) @@ -2599,213 +3226,231 @@ pprint(vars(results)) ``` ### **get** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/workplace/service_accounts/service_account/{slug} +- Endpoint: /v3/workplace/users/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | Slug of the service account | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | The slug of the workplace user | **Return Type** -[ServiceAccountsGetResponse](/src/dopplersdk/models/README.md#serviceaccountsgetresponse) +[UsersGetResponse](/src/dopplersdk/models/README.md#usersgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.service_accounts.get(slug = 'slug') +results = sdk.users.get(slug = 'slug') pprint(vars(results)) ``` -### **update** -Update -- HTTP Method: PATCH -- Endpoint: /v3/workplace/service_accounts/service_account/{slug} +### **options** + +Get Options + +- HTTP Method: GET +- Endpoint: /v3/integrations/integration/options **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | Slug of the service account | -| request_input | [ServiceAccountsUpdateRequest](/src/dopplersdk/models/README.md#serviceaccountsupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| integration | str | Required | The integration slug | **Return Type** -[ServiceAccountsUpdateResponse](/src/dopplersdk/models/README.md#serviceaccountsupdateresponse) +[OptionsResponse](/src/dopplersdk/models/README.md#optionsresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'name': 'name', - 'workplace_role': {"identifier":"identifier","permissions":["ipsum id reprehenderit ut","sint anim Excepteur eu sit"]} -} -results = sdk.service_accounts.update( - request_input = request_body, - slug = 'slug' -) +results = sdk.get.options(integration = 'integration') pprint(vars(results)) ``` -### **delete** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/workplace/service_accounts/service_account/{slug} +### **member** + +Retrieve Member + +- HTTP Method: GET +- Endpoint: /v3/workplace/groups/group/{group_slug}/members/{member_type}/{member_slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | Slug of the service account | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| group_slug | str | Required | The group's slug | +| member_type | [MemberType](/src/dopplersdk/models/README.md#membertype) | Required | | +| member_slug | str | Required | The member's slug | **Return Type** -Returns a dict object. +[MemberResponse](/src/dopplersdk/models/README.md#memberresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.service_accounts.delete(slug = 'slug') +results = sdk.retrieve.member( + group_slug = 'group_slug', + member_type = 'workplace_user', + member_slug = 'member_slug' +) pprint(vars(results)) ``` +### **add** + +Add -### **create** -Create - HTTP Method: POST -- Endpoint: /v3/workplace/groups +- Endpoint: /v3/webhooks **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [GroupsCreateRequest](/src/dopplersdk/models/README.md#groupscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Optional | The project's name | +| request_input | [WebhooksAddRequest](/src/dopplersdk/models/README.md#webhooksaddrequest) | Optional | Request body. | **Return Type** -[GroupsCreateResponse](/src/dopplersdk/models/README.md#groupscreateresponse) +[WebhooksAddResponse](/src/dopplersdk/models/README.md#webhooksaddresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'default_project_role': 'default_project_role', - 'name': 'name' -} -results = sdk.groups.create(request_input = request_body) +request_body = {} +results = sdk.webhooks.add( + request_input = request_body, + project = 'project' +) pprint(vars(results)) ``` ### **list** + List + - HTTP Method: GET -- Endpoint: /v3/workplace/groups +- Endpoint: /v3/webhooks **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| page | int | Optional | | -| per_page | int | Optional | | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Optional | The project's name | **Return Type** -[GroupsListResponse](/src/dopplersdk/models/README.md#groupslistresponse) +[WebhooksListResponse](/src/dopplersdk/models/README.md#webhookslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.groups.list( - page = 1, - per_page = 20 -) +results = sdk.webhooks.list(project = 'project') pprint(vars(results)) ``` ### **get** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/workplace/groups/group/{slug} +- Endpoint: /v3/webhooks/webhook/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | The group's slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | Webhook's slug | +| project | str | Optional | The project's name | **Return Type** -[GroupsGetResponse](/src/dopplersdk/models/README.md#groupsgetresponse) +[WebhooksGetResponse](/src/dopplersdk/models/README.md#webhooksgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.groups.get(slug = 'slug') +results = sdk.webhooks.get( + slug = 'slug', + project = 'project' +) pprint(vars(results)) ``` ### **update** + Update + - HTTP Method: PATCH -- Endpoint: /v3/workplace/groups/group/{slug} +- Endpoint: /v3/webhooks/webhook/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | The group's slug | -| request_input | [GroupsUpdateRequest](/src/dopplersdk/models/README.md#groupsupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Optional | The project's name | +| slug | str | Required | Webhook's slug | +| request_input | [WebhooksUpdateRequest](/src/dopplersdk/models/README.md#webhooksupdaterequest) | Optional | Request body. | **Return Type** -[GroupsUpdateResponse](/src/dopplersdk/models/README.md#groupsupdateresponse) +[WebhooksUpdateResponse](/src/dopplersdk/models/README.md#webhooksupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'default_project_role': 'default_project_role', - 'name': 'name' -} -results = sdk.groups.update( +request_body = {} +results = sdk.webhooks.update( request_input = request_body, - slug = 'slug' + slug = 'slug', + project = 'project' ) pprint(vars(results)) @@ -2813,158 +3458,248 @@ pprint(vars(results)) ``` ### **delete** + Delete + - HTTP Method: DELETE -- Endpoint: /v3/workplace/groups/group/{slug} +- Endpoint: /v3/webhooks/webhook/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | The group's slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Optional | The project's name | +| slug | str | Required | Webhook's slug | **Return Type** -Returns a dict object. +[WebhooksDeleteResponse](/src/dopplersdk/models/README.md#webhooksdeleteresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.groups.delete(slug = 'slug') +results = sdk.webhooks.delete( + slug = 'slug', + project = 'project' +) pprint(vars(results)) ``` -### **add_member** -Add Member +### **enable** + +Enable + - HTTP Method: POST -- Endpoint: /v3/workplace/groups/group/{slug}/members +- Endpoint: /v3/webhooks/webhook/{slug}/enable **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | The group's slug | -| request_input | [AddMemberRequest](/src/dopplersdk/models/README.md#addmemberrequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Optional | The project's name | +| slug | str | Required | Webhook's slug | **Return Type** -Returns a dict object. +[EnableResponse](/src/dopplersdk/models/README.md#enableresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'slug': 'slug', - 'type_': 'workplace_user' -} -results = sdk.groups.add_member( - request_input = request_body, - slug = 'slug' +results = sdk.webhooks.enable( + slug = 'slug', + project = 'project' ) pprint(vars(results)) ``` -### **delete_member** -Delete Member -- HTTP Method: DELETE -- Endpoint: /v3/workplace/groups/group/{slug}/members/{type}/{member_slug} +### **disable** + +Disable + +- HTTP Method: POST +- Endpoint: /v3/webhooks/webhook/{slug}/disable **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | The group's slug | -| type | [GroupsType](/src/dopplersdk/models/README.md#groupstype) | Required | | -| member_slug | str | Required | The member's slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Optional | The project's name | +| slug | str | Required | Webhook's slug | **Return Type** -Returns a dict object. +[DisableResponse](/src/dopplersdk/models/README.md#disableresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.groups.delete_member( +results = sdk.webhooks.disable( slug = 'slug', - type = 'workplace_user', - member_slug = 'member_slug' + project = 'project' ) pprint(vars(results)) ``` +### **create** + +Create + +- HTTP Method: POST +- Endpoint: /v3/workplace/service_accounts/service_account/{service_account}/tokens + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| service_account | str | Required | Slug of the service account | +| request_input | [ServiceAccountTokensCreateRequest](/src/dopplersdk/models/README.md#serviceaccounttokenscreaterequest) | Optional | Request body. | + +**Return Type** + +[ServiceAccountTokensCreateResponse](/src/dopplersdk/models/README.md#serviceaccounttokenscreateresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = { + 'expires_at': '1920-11-18T08:18:44.0Z', + 'name': 'name' +} +results = sdk.service_account_tokens.create( + request_input = request_body, + service_account = 'service_account' +) + +pprint(vars(results)) + +``` ### **list** + List + - HTTP Method: GET -- Endpoint: /v3/workplace/users +- Endpoint: /v3/workplace/service_accounts/service_account/{service_account}/tokens **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| page | int | Optional | The page of users to fetch | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| page | int | Optional | | +| per_page | int | Optional | | +| service_account | str | Required | Slug of the service account | **Return Type** -[UsersListResponse](/src/dopplersdk/models/README.md#userslistresponse) +[ServiceAccountTokensListResponse](/src/dopplersdk/models/README.md#serviceaccounttokenslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.users.list(page = 1) +results = sdk.service_account_tokens.list( + service_account = 'service_account', + page = 1, + per_page = 20 +) pprint(vars(results)) ``` ### **get** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/workplace/users/{slug} +- Endpoint: /v3/workplace/service_accounts/service_account/{service_account}/tokens/token/{api_token} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | The slug of the workplace user | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| service_account | str | Required | Slug of the service account | +| api_token | str | Required | Slug of the API token | **Return Type** -[UsersGetResponse](/src/dopplersdk/models/README.md#usersgetresponse) +[ServiceAccountTokensGetResponse](/src/dopplersdk/models/README.md#serviceaccounttokensgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.users.get(slug = 'slug') +results = sdk.service_account_tokens.get( + service_account = 'service_account', + api_token = 'api_token' +) pprint(vars(results)) ``` +### **delete** + +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/workplace/service_accounts/service_account/{service_account}/tokens/token/{api_token} + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| service_account | str | Required | Slug of the service account | +| api_token | str | Required | Slug of the API token | + +**Return Type** + +Returns a dict object. + +**Example Usage Code Snippet** +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +results = sdk.service_account_tokens.delete( + service_account = 'service_account', + api_token = 'api_token' +) +pprint(vars(results)) +``` ## License diff --git a/src/dopplersdk/models/AddMemberRequest.py b/src/dopplersdk/models/AddMemberRequest.py index b2c6646..301631a 100644 --- a/src/dopplersdk/models/AddMemberRequest.py +++ b/src/dopplersdk/models/AddMemberRequest.py @@ -2,15 +2,15 @@ from enum import Enum -class Type(Enum): +class Type_(Enum): WORKPLACE_USER = "workplace_user" def list(): - return list(map(lambda x: x.value, Type._member_map_.values())) + return list(map(lambda x: x.value, Type_._member_map_.values())) class AddMemberRequest(BaseModel): - def __init__(self, type_: Type, slug: str, **kwargs): + def __init__(self, type_: Type_, slug: str, **kwargs): """ Initialize AddMemberRequest Parameters: @@ -19,5 +19,5 @@ def __init__(self, type_: Type, slug: str, **kwargs): slug: str The member's slug """ - self.type_ = self._enum_matching(type_, Type.list(), "type_") + self.type_ = self._enum_matching(type_, Type_.list(), "type_") self.slug = slug diff --git a/src/dopplersdk/models/AddRequest.py b/src/dopplersdk/models/AddRequest.py index a6b5a4b..248f010 100644 --- a/src/dopplersdk/models/AddRequest.py +++ b/src/dopplersdk/models/AddRequest.py @@ -3,20 +3,20 @@ from enum import Enum -class Type(Enum): +class Type_(Enum): WORKPLACE_USER = "workplace_user" GROUP = "group" INVITE = "invite" SERVICE_ACCOUNT = "service_account" def list(): - return list(map(lambda x: x.value, Type._member_map_.values())) + return list(map(lambda x: x.value, Type_._member_map_.values())) class AddRequest(BaseModel): def __init__( self, - type_: Type, + type_: Type_, slug: str, role: str = None, environments: List[str] = None, @@ -34,7 +34,7 @@ def __init__( environments: list of AddRequestEnvironments Environment slugs to grant the member access to """ - self.type_ = self._enum_matching(type_, Type.list(), "type_") + self.type_ = self._enum_matching(type_, Type_.list(), "type_") self.slug = slug self.role = role self.environments = environments diff --git a/src/dopplersdk/models/DisableResponse.py b/src/dopplersdk/models/DisableResponse.py new file mode 100644 index 0000000..3aadd10 --- /dev/null +++ b/src/dopplersdk/models/DisableResponse.py @@ -0,0 +1 @@ +DisableResponse = dict diff --git a/src/dopplersdk/models/EnableResponse.py b/src/dopplersdk/models/EnableResponse.py new file mode 100644 index 0000000..d09c035 --- /dev/null +++ b/src/dopplersdk/models/EnableResponse.py @@ -0,0 +1 @@ +EnableResponse = dict diff --git a/src/dopplersdk/models/GetResponse.py b/src/dopplersdk/models/GetResponse.py index b5c1717..3fabb67 100644 --- a/src/dopplersdk/models/GetResponse.py +++ b/src/dopplersdk/models/GetResponse.py @@ -1,92 +1,36 @@ from .base import BaseModel -from typing import List -class LogDiff(BaseModel): - def __init__(self, name: str = None, added: str = None, **kwargs): - """ - Initialize LogDiff - Parameters: - ---------- - name: str - added: str - """ - self.name = name - self.added = added - - -class User(BaseModel): - def __init__( - self, - email: str = None, - name: str = None, - username: str = None, - profile_image_url: str = None, - **kwargs, - ): - """ - Initialize User - Parameters: - ---------- - email: str - name: str - username: str - profile_image_url: str - """ - self.email = email - self.name = name - self.username = username - self.profile_image_url = profile_image_url - - -class Log(BaseModel): +class Project(BaseModel): def __init__( self, id: str = None, - text: str = None, - html: str = None, - diff: List[LogDiff] = None, - rollback: bool = None, + name: str = None, + description: str = None, created_at: str = None, - config: str = None, - environment: str = None, - project: str = None, - user: User = None, **kwargs, ): """ - Initialize Log + Initialize Project Parameters: ---------- id: str - text: str - html: str - diff: list of LogDiff - rollback: bool + name: str + description: str created_at: str - config: str - environment: str - project: str - user: User """ self.id = id - self.text = text - self.html = html - self.diff = diff - self.rollback = rollback + self.name = name + self.description = description self.created_at = created_at - self.config = config - self.environment = environment - self.project = project - self.user = user class GetResponse(BaseModel): - def __init__(self, log: Log = None, **kwargs): + def __init__(self, project: Project = None, **kwargs): """ Initialize GetResponse Parameters: ---------- - log: Log + project: Project """ - self.log = log + self.project = project diff --git a/src/dopplersdk/models/MemberResponse.py b/src/dopplersdk/models/MemberResponse.py new file mode 100644 index 0000000..9805db1 --- /dev/null +++ b/src/dopplersdk/models/MemberResponse.py @@ -0,0 +1,93 @@ +from .base import BaseModel +from typing import List + + +class DefaultProjectRole(BaseModel): + def __init__(self, identifier: str = None, **kwargs): + """ + Initialize DefaultProjectRole + Parameters: + ---------- + identifier: str + """ + self.identifier = identifier + + +class Role(BaseModel): + def __init__(self, identifier: str = None, **kwargs): + """ + Initialize Role + Parameters: + ---------- + identifier: str + """ + self.identifier = identifier + + +class GroupProjects(BaseModel): + def __init__(self, name: str = None, slug: str = None, role: Role = None, **kwargs): + """ + Initialize GroupProjects + Parameters: + ---------- + name: str + slug: str + role: Role + """ + self.name = name + self.slug = slug + self.role = role + + +class GroupMembers(BaseModel): + def __init__(self, slug: str = None, type_: str = None, **kwargs): + """ + Initialize GroupMembers + Parameters: + ---------- + slug: str + type_: str + """ + self.slug = slug + self.type_ = type_ + + +class Group(BaseModel): + def __init__( + self, + name: str = None, + slug: str = None, + created_at: str = None, + default_project_role: DefaultProjectRole = None, + projects: List[GroupProjects] = None, + members: List[GroupMembers] = None, + **kwargs, + ): + """ + Initialize Group + Parameters: + ---------- + name: str + slug: str + created_at: str + default_project_role: DefaultProjectRole + projects: list of GroupProjects + members: list of GroupMembers + """ + self.name = name + self.slug = slug + self.created_at = created_at + self.default_project_role = default_project_role + self.projects = projects + self.members = members + + +class MemberResponse(BaseModel): + def __init__(self, group: Group = None, **kwargs): + """ + Initialize MemberResponse + Parameters: + ---------- + group: Group + """ + self.group = group diff --git a/src/dopplersdk/models/MemberType.py b/src/dopplersdk/models/MemberType.py new file mode 100644 index 0000000..7e34340 --- /dev/null +++ b/src/dopplersdk/models/MemberType.py @@ -0,0 +1,8 @@ +from enum import Enum + + +class MemberType(Enum): + WORKPLACE_USER = "workplace_user" + + def list(): + return list(map(lambda x: x.value, MemberType._member_map_.values())) diff --git a/src/dopplersdk/models/OptionsResponse.py b/src/dopplersdk/models/OptionsResponse.py new file mode 100644 index 0000000..83c22e3 --- /dev/null +++ b/src/dopplersdk/models/OptionsResponse.py @@ -0,0 +1 @@ +OptionsResponse = dict diff --git a/src/dopplersdk/models/ProjectRolesCreateRequest.py b/src/dopplersdk/models/ProjectRolesCreateRequest.py new file mode 100644 index 0000000..509ed2e --- /dev/null +++ b/src/dopplersdk/models/ProjectRolesCreateRequest.py @@ -0,0 +1,17 @@ +from .base import BaseModel +from typing import List + + +class ProjectRolesCreateRequest(BaseModel): + def __init__(self, permissions: List[str], name: str, **kwargs): + """ + Initialize ProjectRolesCreateRequest + Parameters: + ---------- + permissions: list of ProjectRolesCreateRequestPermissions + An array containing the permissions the role has. Valid permissions are: `enclave_config_logs`, `enclave_project_config_secrets_read`, `enclave_project_config_dynamic_secrets_read`, `enclave_project_config_dynamic_secrets_leases_write`, `enclave_project_config_rotated_secrets_read`, `enclave_config_syncs_manage`, `enclave_project_secrets_notes_manage`, `enclave_project_config_create`, `enclave_project_config_duplicate`, `enclave_project_config_secrets_write`, `enclave_project_config_service_tokens`, `enclave_project_config_trusted_ips`, `enclave_project_config_logs_rollback`, `enclave_project_config_list_all`, `enclave_project_pull_request_create`, `enclave_project_pull_request_respond`, `enclave_project_pull_request_view`, `enclave_secret_reminders`, `enclave_config_access_logs`, `enclave_project_members`, `enclave_project_rename`, `enclave_project_delete`, `enclave_project_webhooks`, `enclave_project_config_dynamic_secrets_manage`, `enclave_project_config_rotated_secrets_manage`, `enclave_project_config_rename`, `enclave_project_config_lock`, `enclave_project_config_delete`, `enclave_project_environment_list_all`, `enclave_project_environment_all`, `enclave_project_environment_order`, `enclave_project_environment_create`, `enclave_project_environment_delete`, `enclave_project_environment_rename`, `enclave_project_environment_settings_manage`, `enclave_project_secrets_referencing`, `enclave_config_secrets_referencing` + name: str + The name of the role + """ + self.permissions = permissions + self.name = name diff --git a/src/dopplersdk/models/ProjectRolesUpdateRequest.py b/src/dopplersdk/models/ProjectRolesUpdateRequest.py new file mode 100644 index 0000000..7595114 --- /dev/null +++ b/src/dopplersdk/models/ProjectRolesUpdateRequest.py @@ -0,0 +1,17 @@ +from .base import BaseModel +from typing import List + + +class ProjectRolesUpdateRequest(BaseModel): + def __init__(self, name: str = None, permissions: List[str] = None, **kwargs): + """ + Initialize ProjectRolesUpdateRequest + Parameters: + ---------- + name: str + The name of the role + permissions: list of ProjectRolesUpdateRequestPermissions + An array containing the permissions the role has. Valid permissions are: `enclave_config_logs`, `enclave_project_config_secrets_read`, `enclave_project_config_dynamic_secrets_read`, `enclave_project_config_dynamic_secrets_leases_write`, `enclave_project_config_rotated_secrets_read`, `enclave_config_syncs_manage`, `enclave_project_secrets_notes_manage`, `enclave_project_config_create`, `enclave_project_config_duplicate`, `enclave_project_config_secrets_write`, `enclave_project_config_service_tokens`, `enclave_project_config_trusted_ips`, `enclave_project_config_logs_rollback`, `enclave_project_config_list_all`, `enclave_project_pull_request_create`, `enclave_project_pull_request_respond`, `enclave_project_pull_request_view`, `enclave_secret_reminders`, `enclave_config_access_logs`, `enclave_project_members`, `enclave_project_rename`, `enclave_project_delete`, `enclave_project_webhooks`, `enclave_project_config_dynamic_secrets_manage`, `enclave_project_config_rotated_secrets_manage`, `enclave_project_config_rename`, `enclave_project_config_lock`, `enclave_project_config_delete`, `enclave_project_environment_list_all`, `enclave_project_environment_all`, `enclave_project_environment_order`, `enclave_project_environment_create`, `enclave_project_environment_delete`, `enclave_project_environment_rename`, `enclave_project_environment_settings_manage`, `enclave_project_secrets_referencing`, `enclave_config_secrets_referencing` + """ + self.name = name + self.permissions = permissions diff --git a/src/dopplersdk/models/README.md b/src/dopplersdk/models/README.md index 574cc35..4118ebd 100644 --- a/src/dopplersdk/models/README.md +++ b/src/dopplersdk/models/README.md @@ -1,46 +1,46 @@ # DopplerSDK Models A list of all models. + - [Format](#format) - [NameTransformer](#nametransformer) - [Type](#type) - [GroupsType](#groupstype) +- [MemberType](#membertype) - [ListResponse](#listresponse) - [CreateResponse](#createresponse) -- [SecretsListResponse](#secretslistresponse) -- [UpdateResponse](#updateresponse) -- [ConfigLogsListResponse](#configlogslistresponse) +- [EnvironmentsListResponse](#environmentslistresponse) +- [EnvironmentsCreateResponse](#environmentscreateresponse) - [GetResponse](#getresponse) +- [UpdateResponse](#updateresponse) +- [ConfigsGetResponse](#configsgetresponse) +- [ConfigsUpdateResponse](#configsupdateresponse) +- [DeleteResponse](#deleteresponse) - [EnvironmentsGetResponse](#environmentsgetresponse) - [RenameResponse](#renameresponse) -- [ProjectsGetResponse](#projectsgetresponse) -- [ProjectsUpdateResponse](#projectsupdateresponse) - [ConfigsListResponse](#configslistresponse) - [ConfigsCreateResponse](#configscreateresponse) -- [ConfigsGetResponse](#configsgetresponse) -- [ConfigsUpdateResponse](#configsupdateresponse) -- [DeleteResponse](#deleteresponse) -- [EnvironmentsListResponse](#environmentslistresponse) -- [EnvironmentsCreateResponse](#environmentscreateresponse) -- [RollbackResponse](#rollbackresponse) -- [RetrieveResponse](#retrieveresponse) +- [ConfigLogsGetResponse](#configlogsgetresponse) +- [ConfigLogsListResponse](#configlogslistresponse) +- [SecretsListResponse](#secretslistresponse) +- [SecretsUpdateResponse](#secretsupdateresponse) - [WorkplaceGetResponse](#workplacegetresponse) - [WorkplaceUpdateResponse](#workplaceupdateresponse) - [ActivityLogsListResponse](#activitylogslistresponse) +- [RetrieveResponse](#retrieveresponse) - [SecretsGetResponse](#secretsgetresponse) - [ServiceTokensListResponse](#servicetokenslistresponse) - [ServiceTokensCreateResponse](#servicetokenscreateresponse) +- [RollbackResponse](#rollbackresponse) +- [UnlockResponse](#unlockresponse) - [CloneResponse](#cloneresponse) - [LockResponse](#lockresponse) -- [UnlockResponse](#unlockresponse) -- [GetUserResponse](#getuserresponse) - [DownloadResponse](#downloadresponse) -- [IssueLeaseResponse](#issueleaseresponse) +- [GetUserResponse](#getuserresponse) - [RevokeLeaseResponse](#revokeleaseresponse) -- [NamesResponse](#namesresponse) +- [IssueLeaseResponse](#issueleaseresponse) - [UpdateNoteResponse](#updatenoteresponse) -- [IntegrationsListResponse](#integrationslistresponse) -- [IntegrationsCreateResponse](#integrationscreateresponse) +- [NamesResponse](#namesresponse) - [IntegrationsGetResponse](#integrationsgetresponse) - [IntegrationsUpdateResponse](#integrationsupdateresponse) - [IntegrationsDeleteResponse](#integrationsdeleteresponse) @@ -48,64 +48,85 @@ A list of all models. - [SyncsGetResponse](#syncsgetresponse) - [SyncsDeleteResponse](#syncsdeleteresponse) - [MeResponse](#meresponse) +- [IntegrationsListResponse](#integrationslistresponse) +- [IntegrationsCreateResponse](#integrationscreateresponse) - [ListTrustedIpsResponse](#listtrustedipsresponse) - [AddTrustedIpResponse](#addtrustedipresponse) - [WorkplaceRolesListResponse](#workplaceroleslistresponse) - [WorkplaceRolesCreateResponse](#workplacerolescreateresponse) -- [ListPermissionsResponse](#listpermissionsresponse) - [WorkplaceRolesGetResponse](#workplacerolesgetresponse) - [WorkplaceRolesUpdateResponse](#workplacerolesupdateresponse) -- [ProjectRolesListResponse](#projectroleslistresponse) -- [ProjectRolesCreateResponse](#projectrolescreateresponse) - [ProjectRolesGetResponse](#projectrolesgetresponse) - [ProjectRolesUpdateResponse](#projectrolesupdateresponse) -- [ProjectRolesListPermissionsResponse](#projectroleslistpermissionsresponse) +- [ListPermissionsResponse](#listpermissionsresponse) - [ProjectMembersListResponse](#projectmemberslistresponse) - [AddResponse](#addresponse) +- [InvitesListResponse](#inviteslistresponse) +- [ProjectRolesListResponse](#projectroleslistresponse) +- [ProjectRolesCreateResponse](#projectrolescreateresponse) - [ProjectMembersGetResponse](#projectmembersgetresponse) - [ProjectMembersUpdateResponse](#projectmembersupdateresponse) -- [InvitesListResponse](#inviteslistresponse) -- [ServiceAccountsListResponse](#serviceaccountslistresponse) -- [ServiceAccountsCreateResponse](#serviceaccountscreateresponse) - [ServiceAccountsGetResponse](#serviceaccountsgetresponse) - [ServiceAccountsUpdateResponse](#serviceaccountsupdateresponse) -- [GroupsListResponse](#groupslistresponse) -- [GroupsCreateResponse](#groupscreateresponse) +- [ProjectRolesListPermissionsResponse](#projectroleslistpermissionsresponse) - [GroupsGetResponse](#groupsgetresponse) - [GroupsUpdateResponse](#groupsupdateresponse) +- [ServiceAccountsListResponse](#serviceaccountslistresponse) +- [ServiceAccountsCreateResponse](#serviceaccountscreateresponse) +- [GroupsListResponse](#groupslistresponse) +- [GroupsCreateResponse](#groupscreateresponse) - [UsersListResponse](#userslistresponse) - [UsersGetResponse](#usersgetresponse) +- [OptionsResponse](#optionsresponse) +- [MemberResponse](#memberresponse) +- [WebhooksListResponse](#webhookslistresponse) +- [WebhooksAddResponse](#webhooksaddresponse) +- [WebhooksGetResponse](#webhooksgetresponse) +- [WebhooksUpdateResponse](#webhooksupdateresponse) +- [WebhooksDeleteResponse](#webhooksdeleteresponse) +- [EnableResponse](#enableresponse) +- [DisableResponse](#disableresponse) +- [ServiceAccountTokensListResponse](#serviceaccounttokenslistresponse) +- [ServiceAccountTokensCreateResponse](#serviceaccounttokenscreateresponse) +- [ServiceAccountTokensGetResponse](#serviceaccounttokensgetresponse) - [CreateRequest](#createrequest) +- [EnvironmentsCreateRequest](#environmentscreaterequest) - [UpdateRequest](#updaterequest) -- [RenameRequest](#renamerequest) -- [ProjectsUpdateRequest](#projectsupdaterequest) - [DeleteRequest](#deleterequest) -- [ConfigsCreateRequest](#configscreaterequest) - [ConfigsUpdateRequest](#configsupdaterequest) - [ConfigsDeleteRequest](#configsdeleterequest) -- [EnvironmentsCreateRequest](#environmentscreaterequest) +- [RenameRequest](#renamerequest) +- [ConfigsCreateRequest](#configscreaterequest) +- [SecretsUpdateRequest](#secretsupdaterequest) - [WorkplaceUpdateRequest](#workplaceupdaterequest) -- [ServiceTokensCreateRequest](#servicetokenscreaterequest) - [ServiceTokensDeleteRequest](#servicetokensdeleterequest) +- [ServiceTokensCreateRequest](#servicetokenscreaterequest) +- [UnlockRequest](#unlockrequest) - [CloneRequest](#clonerequest) - [LockRequest](#lockrequest) -- [UnlockRequest](#unlockrequest) -- [IssueLeaseRequest](#issueleaserequest) - [RevokeLeaseRequest](#revokeleaserequest) - [RevokeRequest](#revokerequest) +- [IssueLeaseRequest](#issueleaserequest) - [UpdateNoteRequest](#updatenoterequest) -- [IntegrationsCreateRequest](#integrationscreaterequest) - [IntegrationsUpdateRequest](#integrationsupdaterequest) - [SyncsCreateRequest](#syncscreaterequest) +- [IntegrationsCreateRequest](#integrationscreaterequest) - [AddTrustedIpRequest](#addtrustediprequest) - [DeleteTrustedIpRequest](#deletetrustediprequest) +- [WorkplaceRolesCreateRequest](#workplacerolescreaterequest) +- [WorkplaceRolesUpdateRequest](#workplacerolesupdaterequest) +- [ProjectRolesUpdateRequest](#projectrolesupdaterequest) - [AddRequest](#addrequest) +- [ProjectRolesCreateRequest](#projectrolescreaterequest) - [ProjectMembersUpdateRequest](#projectmembersupdaterequest) -- [ServiceAccountsCreateRequest](#serviceaccountscreaterequest) - [ServiceAccountsUpdateRequest](#serviceaccountsupdaterequest) -- [GroupsCreateRequest](#groupscreaterequest) - [GroupsUpdateRequest](#groupsupdaterequest) +- [ServiceAccountsCreateRequest](#serviceaccountscreaterequest) +- [GroupsCreateRequest](#groupscreaterequest) - [AddMemberRequest](#addmemberrequest) +- [WebhooksAddRequest](#webhooksaddrequest) +- [WebhooksUpdateRequest](#webhooksupdaterequest) +- [ServiceAccountTokensCreateRequest](#serviceaccounttokenscreaterequest) ## Format @@ -115,43 +136,41 @@ A list of all models. ## GroupsType +## MemberType + ## ListResponse ## CreateResponse -## SecretsListResponse +## EnvironmentsListResponse + +## EnvironmentsCreateResponse + +## GetResponse ## UpdateResponse -## ConfigLogsListResponse +## ConfigsGetResponse -## GetResponse +## ConfigsUpdateResponse + +## DeleteResponse ## EnvironmentsGetResponse ## RenameResponse -## ProjectsGetResponse - -## ProjectsUpdateResponse - ## ConfigsListResponse ## ConfigsCreateResponse -## ConfigsGetResponse - -## ConfigsUpdateResponse - -## DeleteResponse - -## EnvironmentsListResponse +## ConfigLogsGetResponse -## EnvironmentsCreateResponse +## ConfigLogsListResponse -## RollbackResponse +## SecretsListResponse -## RetrieveResponse +## SecretsUpdateResponse ## WorkplaceGetResponse @@ -159,33 +178,33 @@ A list of all models. ## ActivityLogsListResponse +## RetrieveResponse + ## SecretsGetResponse ## ServiceTokensListResponse ## ServiceTokensCreateResponse -## CloneResponse - -## LockResponse +## RollbackResponse ## UnlockResponse -## GetUserResponse +## CloneResponse + +## LockResponse ## DownloadResponse -## IssueLeaseResponse +## GetUserResponse ## RevokeLeaseResponse -## NamesResponse +## IssueLeaseResponse ## UpdateNoteResponse -## IntegrationsListResponse - -## IntegrationsCreateResponse +## NamesResponse ## IntegrationsGetResponse @@ -201,6 +220,10 @@ A list of all models. ## MeResponse +## IntegrationsListResponse + +## IntegrationsCreateResponse + ## ListTrustedIpsResponse ## AddTrustedIpResponse @@ -209,113 +232,148 @@ A list of all models. ## WorkplaceRolesCreateResponse -## ListPermissionsResponse - ## WorkplaceRolesGetResponse ## WorkplaceRolesUpdateResponse -## ProjectRolesListResponse - -## ProjectRolesCreateResponse - ## ProjectRolesGetResponse ## ProjectRolesUpdateResponse -## ProjectRolesListPermissionsResponse +## ListPermissionsResponse ## ProjectMembersListResponse ## AddResponse -## ProjectMembersGetResponse +## InvitesListResponse -## ProjectMembersUpdateResponse +## ProjectRolesListResponse -## InvitesListResponse +## ProjectRolesCreateResponse -## ServiceAccountsListResponse +## ProjectMembersGetResponse -## ServiceAccountsCreateResponse +## ProjectMembersUpdateResponse ## ServiceAccountsGetResponse ## ServiceAccountsUpdateResponse -## GroupsListResponse - -## GroupsCreateResponse +## ProjectRolesListPermissionsResponse ## GroupsGetResponse ## GroupsUpdateResponse +## ServiceAccountsListResponse + +## ServiceAccountsCreateResponse + +## GroupsListResponse + +## GroupsCreateResponse + ## UsersListResponse ## UsersGetResponse -## CreateRequest +## OptionsResponse -## UpdateRequest +## MemberResponse -## RenameRequest +## WebhooksListResponse -## ProjectsUpdateRequest +## WebhooksAddResponse -## DeleteRequest +## WebhooksGetResponse -## ConfigsCreateRequest +## WebhooksUpdateResponse + +## WebhooksDeleteResponse + +## EnableResponse + +## DisableResponse + +## ServiceAccountTokensListResponse + +## ServiceAccountTokensCreateResponse + +## ServiceAccountTokensGetResponse + +## CreateRequest + +## EnvironmentsCreateRequest + +## UpdateRequest + +## DeleteRequest ## ConfigsUpdateRequest ## ConfigsDeleteRequest -## EnvironmentsCreateRequest +## RenameRequest + +## ConfigsCreateRequest + +## SecretsUpdateRequest ## WorkplaceUpdateRequest +## ServiceTokensDeleteRequest + ## ServiceTokensCreateRequest -## ServiceTokensDeleteRequest +## UnlockRequest ## CloneRequest ## LockRequest -## UnlockRequest - -## IssueLeaseRequest - ## RevokeLeaseRequest ## RevokeRequest -## UpdateNoteRequest +## IssueLeaseRequest -## IntegrationsCreateRequest +## UpdateNoteRequest ## IntegrationsUpdateRequest ## SyncsCreateRequest +## IntegrationsCreateRequest + ## AddTrustedIpRequest ## DeleteTrustedIpRequest +## WorkplaceRolesCreateRequest + +## WorkplaceRolesUpdateRequest + +## ProjectRolesUpdateRequest + ## AddRequest -## ProjectMembersUpdateRequest +## ProjectRolesCreateRequest -## ServiceAccountsCreateRequest +## ProjectMembersUpdateRequest ## ServiceAccountsUpdateRequest -## GroupsCreateRequest - ## GroupsUpdateRequest +## ServiceAccountsCreateRequest + +## GroupsCreateRequest + ## AddMemberRequest +## WebhooksAddRequest +## WebhooksUpdateRequest +## ServiceAccountTokensCreateRequest diff --git a/src/dopplersdk/models/SecretsListResponse.py b/src/dopplersdk/models/SecretsListResponse.py index c585b63..6caa2c2 100644 --- a/src/dopplersdk/models/SecretsListResponse.py +++ b/src/dopplersdk/models/SecretsListResponse.py @@ -3,7 +3,13 @@ class Stripe(BaseModel): def __init__( - self, raw: str = None, computed: str = None, note: str = None, **kwargs + self, + raw: str = None, + computed: str = None, + note: str = None, + rawVisibility: str = None, + computedVisibility: str = None, + **kwargs, ): """ Initialize Stripe @@ -12,15 +18,25 @@ def __init__( raw: str computed: str note: str + rawVisibility: str + computedVisibility: str """ self.raw = raw self.computed = computed self.note = note + self.rawVisibility = rawVisibility + self.computedVisibility = computedVisibility class Algolia(BaseModel): def __init__( - self, raw: str = None, computed: str = None, note: str = None, **kwargs + self, + raw: str = None, + computed: str = None, + note: str = None, + rawVisibility: str = None, + computedVisibility: str = None, + **kwargs, ): """ Initialize Algolia @@ -29,15 +45,25 @@ def __init__( raw: str computed: str note: str + rawVisibility: str + computedVisibility: str """ self.raw = raw self.computed = computed self.note = note + self.rawVisibility = rawVisibility + self.computedVisibility = computedVisibility class Database(BaseModel): def __init__( - self, raw: str = None, computed: str = None, note: str = None, **kwargs + self, + raw: str = None, + computed: str = None, + note: str = None, + rawVisibility: str = None, + computedVisibility: str = None, + **kwargs, ): """ Initialize Database @@ -46,15 +72,25 @@ def __init__( raw: str computed: str note: str + rawVisibility: str + computedVisibility: str """ self.raw = raw self.computed = computed self.note = note + self.rawVisibility = rawVisibility + self.computedVisibility = computedVisibility class User(BaseModel): def __init__( - self, raw: str = None, computed: str = None, note: str = None, **kwargs + self, + raw: str = None, + computed: str = None, + note: str = None, + rawVisibility: str = None, + computedVisibility: str = None, + **kwargs, ): """ Initialize User @@ -63,10 +99,14 @@ def __init__( raw: str computed: str note: str + rawVisibility: str + computedVisibility: str """ self.raw = raw self.computed = computed self.note = note + self.rawVisibility = rawVisibility + self.computedVisibility = computedVisibility class Secrets(BaseModel): diff --git a/src/dopplersdk/models/SecretsUpdateRequest.py b/src/dopplersdk/models/SecretsUpdateRequest.py index fd70d4a..e1f0857 100644 --- a/src/dopplersdk/models/SecretsUpdateRequest.py +++ b/src/dopplersdk/models/SecretsUpdateRequest.py @@ -1,40 +1,83 @@ from .base import BaseModel +from typing import List -class Secrets(BaseModel): - """ - Object of secrets you would like to save to the config. Try it with the sample secrets below: - """ +class Secrets(dict): + def __init__(self, *args, **kwargs): + dict.__init__(self, *args, **kwargs) + +class SecretsUpdateRequestChangeRequests(BaseModel): def __init__( - self, STRIPE: str, ALGOLIA: str = None, DATABASE: str = None, **kwargs + self, + value: str, + originalName: str, + name: str, + originalValue: str = None, + visibility: str = None, + originalVisibility: str = None, + shouldPromote: bool = None, + shouldDelete: bool = None, + shouldConverge: bool = None, + **kwargs, ): """ - Initialize Secrets + Initialize SecretsUpdateRequestChangeRequests Parameters: ---------- - STRIPE: str - ALGOLIA: str - DATABASE: str + value: str + The value the secret should have. Use `null` (an actual `null`, not the string `null`) to leave the existing secret value unchanged. + originalName: str + The original name of the secret. Use `null` (an actual `null`, not the string `null`) or omit this parameter for new secrets. If it differs from `name` then a rename is inferred. + name: str + The name of the secret. + originalValue: str + The value you expect the secret to have before `name` is applied. If specified, the request will only be processed if the provided value matches what's found in Doppler. + visibility: str + Must be set to either `masked`, `unmasked`, or `restricted`. + originalVisibility: str + Must be set to either `masked`, `unmasked`, or `restricted`. The visibility you expect the secret to have before `visibility` is applied. If specified, the request will only be processed if the provided visibility matches what's found in Doppler. + shouldPromote: bool + Defaults to `false`. Can only be set to `true` if the config being updated is a branch config. If set to `true`, the provided secret will be set in both the branch config as well as the root config in that environment. + shouldDelete: bool + Defaults to `false`. If set to `true`, will delete the secret matching the `name` field. + shouldConverge: bool + Defaults to `false`. Can only be set to `true` if the config being updated is a branch config and there is a secret with the same name in the root config. In this case, the branch secret will inherit the value and visibility type from the root secret. """ - self.STRIPE = STRIPE - self.ALGOLIA = ALGOLIA - self.DATABASE = DATABASE + self.value = value + self.originalName = originalName + self.name = name + self.originalValue = originalValue + self.visibility = visibility + self.originalVisibility = originalVisibility + self.shouldPromote = shouldPromote + self.shouldDelete = shouldDelete + self.shouldConverge = shouldConverge class SecretsUpdateRequest(BaseModel): - def __init__(self, secrets: Secrets, config: str, project: str, **kwargs): + def __init__( + self, + config: str, + project: str, + secrets: Secrets = None, + change_requests: List[SecretsUpdateRequestChangeRequests] = None, + **kwargs, + ): """ Initialize SecretsUpdateRequest Parameters: ---------- - secrets: Secrets - Object of secrets you would like to save to the config. Try it with the sample secrets below: config: str Name of the config object. project: str Unique identifier for the project object. + secrets: Secrets + Either `secrets` or `change_requests` is required (can't use both). Object of secrets you would like to save to the config. Try it with the sample secrets below. + change_requests: list of SecretsUpdateRequestChangeRequests + Either `secrets` or `change_requests` is required (can't use both). Object of secrets you would like to save to the config. Try it with the sample secrets below. """ - self.secrets = secrets self.config = config self.project = project + self.secrets = secrets + self.change_requests = change_requests diff --git a/src/dopplersdk/models/ServiceAccountTokensCreateRequest.py b/src/dopplersdk/models/ServiceAccountTokensCreateRequest.py new file mode 100644 index 0000000..facf761 --- /dev/null +++ b/src/dopplersdk/models/ServiceAccountTokensCreateRequest.py @@ -0,0 +1,16 @@ +from .base import BaseModel + + +class ServiceAccountTokensCreateRequest(BaseModel): + def __init__(self, name: str = None, expires_at: str = None, **kwargs): + """ + Initialize ServiceAccountTokensCreateRequest + Parameters: + ---------- + name: str + The display name of the API token + expires_at: str + The datetime at which the API token should expire. If not provided, the API token will remain vaild indefinitely unless manually revoked + """ + self.name = name + self.expires_at = expires_at diff --git a/src/dopplersdk/models/ServiceAccountTokensCreateResponse.py b/src/dopplersdk/models/ServiceAccountTokensCreateResponse.py new file mode 100644 index 0000000..a908d6b --- /dev/null +++ b/src/dopplersdk/models/ServiceAccountTokensCreateResponse.py @@ -0,0 +1,50 @@ +from .base import BaseModel +from typing import Any + + +class ApiToken(BaseModel): + def __init__( + self, + name: str = None, + slug: str = None, + created_at: str = None, + last_seen_at: Any = None, + expires_at: str = None, + **kwargs, + ): + """ + Initialize ApiToken + Parameters: + ---------- + name: str + slug: str + created_at: str + last_seen_at + expires_at: str + """ + self.name = name + self.slug = slug + self.created_at = created_at + self.last_seen_at = last_seen_at + self.expires_at = expires_at + + +class ServiceAccountTokensCreateResponse(BaseModel): + def __init__( + self, + api_token: ApiToken = None, + api_key: str = None, + success: bool = None, + **kwargs, + ): + """ + Initialize ServiceAccountTokensCreateResponse + Parameters: + ---------- + api_token: ApiToken + api_key: str + success: bool + """ + self.api_token = api_token + self.api_key = api_key + self.success = success diff --git a/src/dopplersdk/models/ServiceAccountTokensGetResponse.py b/src/dopplersdk/models/ServiceAccountTokensGetResponse.py new file mode 100644 index 0000000..d580f52 --- /dev/null +++ b/src/dopplersdk/models/ServiceAccountTokensGetResponse.py @@ -0,0 +1,41 @@ +from .base import BaseModel + + +class ApiToken(BaseModel): + def __init__( + self, + name: str = None, + slug: str = None, + created_at: str = None, + last_seen_at: str = None, + expires_at: str = None, + **kwargs, + ): + """ + Initialize ApiToken + Parameters: + ---------- + name: str + slug: str + created_at: str + last_seen_at: str + expires_at: str + """ + self.name = name + self.slug = slug + self.created_at = created_at + self.last_seen_at = last_seen_at + self.expires_at = expires_at + + +class ServiceAccountTokensGetResponse(BaseModel): + def __init__(self, api_token: ApiToken = None, success: bool = None, **kwargs): + """ + Initialize ServiceAccountTokensGetResponse + Parameters: + ---------- + api_token: ApiToken + success: bool + """ + self.api_token = api_token + self.success = success diff --git a/src/dopplersdk/models/ServiceAccountTokensListResponse.py b/src/dopplersdk/models/ServiceAccountTokensListResponse.py new file mode 100644 index 0000000..4bb436d --- /dev/null +++ b/src/dopplersdk/models/ServiceAccountTokensListResponse.py @@ -0,0 +1,47 @@ +from .base import BaseModel +from typing import List + + +class ServiceAccountTokensListResponseApiTokens(BaseModel): + def __init__( + self, + name: str = None, + slug: str = None, + created_at: str = None, + last_seen_at: str = None, + expires_at: str = None, + **kwargs, + ): + """ + Initialize ServiceAccountTokensListResponseApiTokens + Parameters: + ---------- + name: str + slug: str + created_at: str + last_seen_at: str + expires_at: str + """ + self.name = name + self.slug = slug + self.created_at = created_at + self.last_seen_at = last_seen_at + self.expires_at = expires_at + + +class ServiceAccountTokensListResponse(BaseModel): + def __init__( + self, + api_tokens: List[ServiceAccountTokensListResponseApiTokens] = None, + success: bool = None, + **kwargs, + ): + """ + Initialize ServiceAccountTokensListResponse + Parameters: + ---------- + api_tokens: list of ServiceAccountTokensListResponseApiTokens + success: bool + """ + self.api_tokens = api_tokens + self.success = success diff --git a/src/dopplersdk/models/SyncsCreateRequest.py b/src/dopplersdk/models/SyncsCreateRequest.py index 87bb962..6acd62a 100644 --- a/src/dopplersdk/models/SyncsCreateRequest.py +++ b/src/dopplersdk/models/SyncsCreateRequest.py @@ -22,7 +22,12 @@ def list(): class SyncsCreateRequest(BaseModel): def __init__( - self, data: Data, integration: str, import_option: ImportOption = None, **kwargs + self, + data: Data, + integration: str, + import_option: ImportOption = None, + await_initial_sync: bool = None, + **kwargs, ): """ Initialize SyncsCreateRequest @@ -34,6 +39,8 @@ def __init__( The integration slug which the sync will use import_option: str An option indicating if and how Doppler should attempt to import secrets from the sync destination + await_initial_sync: bool + Causes sync creation to wait for the initial sync to complete before returning. """ self.data = data self.integration = integration @@ -42,3 +49,4 @@ def __init__( if import_option else None ) + self.await_initial_sync = await_initial_sync diff --git a/src/dopplersdk/models/UpdateNoteRequest.py b/src/dopplersdk/models/UpdateNoteRequest.py index 58861d3..3cabbb5 100644 --- a/src/dopplersdk/models/UpdateNoteRequest.py +++ b/src/dopplersdk/models/UpdateNoteRequest.py @@ -2,19 +2,23 @@ class UpdateNoteRequest(BaseModel): - def __init__(self, note: str, secret: str, config: str, project: str, **kwargs): + def __init__( + self, note: str, secret: str, project: str, config: str = None, **kwargs + ): """ Initialize UpdateNoteRequest Parameters: ---------- note: str + The note you want to set on the secret. This note will be applied to the specified secret in all environments. secret: str - config: str - Name of the config object. + The name of the secret project: str Unique identifier for the project object. + config: str + Deprecated: Config is no longer required as notes have always been set at the project level. """ self.note = note self.secret = secret - self.config = config self.project = project + self.config = config diff --git a/src/dopplersdk/models/UpdateRequest.py b/src/dopplersdk/models/UpdateRequest.py index 8b763d3..f8ea6f9 100644 --- a/src/dopplersdk/models/UpdateRequest.py +++ b/src/dopplersdk/models/UpdateRequest.py @@ -1,40 +1,19 @@ from .base import BaseModel -class Secrets(BaseModel): - """ - Object of secrets you would like to save to the config. Try it with the sample secrets below: - """ - - def __init__( - self, STRIPE: str, ALGOLIA: str = None, DATABASE: str = None, **kwargs - ): - """ - Initialize Secrets - Parameters: - ---------- - STRIPE: str - ALGOLIA: str - DATABASE: str - """ - self.STRIPE = STRIPE - self.ALGOLIA = ALGOLIA - self.DATABASE = DATABASE - - class UpdateRequest(BaseModel): - def __init__(self, secrets: Secrets, config: str, project: str, **kwargs): + def __init__(self, name: str, project: str, description: str = None, **kwargs): """ Initialize UpdateRequest Parameters: ---------- - secrets: Secrets - Object of secrets you would like to save to the config. Try it with the sample secrets below: - config: str - Name of the config object. + name: str + Name of the project. project: str Unique identifier for the project object. + description: str + Description of the project. """ - self.secrets = secrets - self.config = config + self.name = name self.project = project + self.description = description diff --git a/src/dopplersdk/models/UpdateResponse.py b/src/dopplersdk/models/UpdateResponse.py index 4d90127..16b826c 100644 --- a/src/dopplersdk/models/UpdateResponse.py +++ b/src/dopplersdk/models/UpdateResponse.py @@ -1,84 +1,36 @@ from .base import BaseModel -class Stripe(BaseModel): - def __init__( - self, raw: str = None, computed: str = None, note: str = None, **kwargs - ): - """ - Initialize Stripe - Parameters: - ---------- - raw: str - computed: str - note: str - """ - self.raw = raw - self.computed = computed - self.note = note - - -class Algolia(BaseModel): - def __init__( - self, raw: str = None, computed: str = None, note: str = None, **kwargs - ): - """ - Initialize Algolia - Parameters: - ---------- - raw: str - computed: str - note: str - """ - self.raw = raw - self.computed = computed - self.note = note - - -class Database(BaseModel): - def __init__( - self, raw: str = None, computed: str = None, note: str = None, **kwargs - ): - """ - Initialize Database - Parameters: - ---------- - raw: str - computed: str - note: str - """ - self.raw = raw - self.computed = computed - self.note = note - - -class Secrets(BaseModel): +class Project(BaseModel): def __init__( self, - STRIPE: Stripe = None, - ALGOLIA: Algolia = None, - DATABASE: Database = None, + id: str = None, + name: str = None, + description: str = None, + created_at: str = None, **kwargs, ): """ - Initialize Secrets + Initialize Project Parameters: ---------- - STRIPE: Stripe - ALGOLIA: Algolia - DATABASE: Database + id: str + name: str + description: str + created_at: str """ - self.STRIPE = STRIPE - self.ALGOLIA = ALGOLIA - self.DATABASE = DATABASE + self.id = id + self.name = name + self.description = description + self.created_at = created_at class UpdateResponse(BaseModel): - def __init__(self, secrets: Secrets = None, **kwargs): + def __init__(self, project: Project = None, **kwargs): """ Initialize UpdateResponse Parameters: ---------- - secrets: Secrets + project: Project """ - self.secrets = secrets + self.project = project diff --git a/src/dopplersdk/models/WebhooksAddRequest.py b/src/dopplersdk/models/WebhooksAddRequest.py new file mode 100644 index 0000000..2310b19 --- /dev/null +++ b/src/dopplersdk/models/WebhooksAddRequest.py @@ -0,0 +1,72 @@ +from .base import BaseModel +from typing import List +from enum import Enum + + +class Type_(Enum): + NONE = "None" + BEARER = "Bearer" + BASIC = "Basic" + + def list(): + return list(map(lambda x: x.value, Type_._member_map_.values())) + + +class Authentication(BaseModel): + def __init__( + self, + token: str = None, + username: str = None, + password: str = None, + type_: Type_ = None, + **kwargs, + ): + """ + Initialize Authentication + Parameters: + ---------- + token: str + Used when type = Bearer + username: str + Used when type = Basic + password: str + Used when type = Basic + type_: str + """ + self.token = token + self.username = username + self.password = password + self.type_ = ( + self._enum_matching(type_, Type_.list(), "type_") if type_ else None + ) + + +class WebhooksAddRequest(BaseModel): + def __init__( + self, + url: str, + secret: str = None, + authentication: Authentication = None, + payload: str = None, + enableConfigs: List[str] = None, + **kwargs, + ): + """ + Initialize WebhooksAddRequest + Parameters: + ---------- + url: str + The webhook URL. Must be https + secret: str + See: https://docs.doppler.com/docs/webhooks#verify-webhook-with-request-signing + authentication: Authentication + payload: str + See: https://docs.doppler.com/docs/webhooks#default-payload + enableConfigs: list of WebhooksAddRequestEnableConfigs + Config slugs that the webhook should be enabled for + """ + self.url = url + self.secret = secret + self.authentication = authentication + self.payload = payload + self.enableConfigs = enableConfigs diff --git a/src/dopplersdk/models/WebhooksAddResponse.py b/src/dopplersdk/models/WebhooksAddResponse.py new file mode 100644 index 0000000..41e86c3 --- /dev/null +++ b/src/dopplersdk/models/WebhooksAddResponse.py @@ -0,0 +1 @@ +WebhooksAddResponse = dict diff --git a/src/dopplersdk/models/WebhooksDeleteResponse.py b/src/dopplersdk/models/WebhooksDeleteResponse.py new file mode 100644 index 0000000..e666eee --- /dev/null +++ b/src/dopplersdk/models/WebhooksDeleteResponse.py @@ -0,0 +1 @@ +WebhooksDeleteResponse = dict diff --git a/src/dopplersdk/models/WebhooksGetResponse.py b/src/dopplersdk/models/WebhooksGetResponse.py new file mode 100644 index 0000000..5cabe09 --- /dev/null +++ b/src/dopplersdk/models/WebhooksGetResponse.py @@ -0,0 +1 @@ +WebhooksGetResponse = dict diff --git a/src/dopplersdk/models/WebhooksListResponse.py b/src/dopplersdk/models/WebhooksListResponse.py new file mode 100644 index 0000000..bf4bb94 --- /dev/null +++ b/src/dopplersdk/models/WebhooksListResponse.py @@ -0,0 +1 @@ +WebhooksListResponse = dict diff --git a/src/dopplersdk/models/WebhooksUpdateRequest.py b/src/dopplersdk/models/WebhooksUpdateRequest.py new file mode 100644 index 0000000..32ab589 --- /dev/null +++ b/src/dopplersdk/models/WebhooksUpdateRequest.py @@ -0,0 +1,76 @@ +from .base import BaseModel +from typing import List +from enum import Enum + + +class Type_(Enum): + NONE = "None" + BEARER = "Bearer" + BASIC = "Basic" + + def list(): + return list(map(lambda x: x.value, Type_._member_map_.values())) + + +class Authentication(BaseModel): + def __init__( + self, + token: str = None, + username: str = None, + password: str = None, + type_: Type_ = None, + **kwargs, + ): + """ + Initialize Authentication + Parameters: + ---------- + token: str + Used when type = Bearer + username: str + Used when type = Basic + password: str + Used when type = Basic + type_: str + """ + self.token = token + self.username = username + self.password = password + self.type_ = ( + self._enum_matching(type_, Type_.list(), "type_") if type_ else None + ) + + +class WebhooksUpdateRequest(BaseModel): + def __init__( + self, + url: str = None, + secret: str = None, + authentication: Authentication = None, + payload: str = None, + enableConfigs: List[str] = None, + disableConfigs: List[str] = None, + **kwargs, + ): + """ + Initialize WebhooksUpdateRequest + Parameters: + ---------- + url: str + The webhook URL. Must be https + secret: str + See: https://docs.doppler.com/docs/webhooks#verify-webhook-with-request-signing + authentication: Authentication + payload: str + See: https://docs.doppler.com/docs/webhooks#default-payload + enableConfigs: list of WebhooksUpdateRequestEnableConfigs + Config slugs that the webhook should be enabled for + disableConfigs: list of WebhooksUpdateRequestDisableConfigs + Config slugs that the webhook should be disabled for + """ + self.url = url + self.secret = secret + self.authentication = authentication + self.payload = payload + self.enableConfigs = enableConfigs + self.disableConfigs = disableConfigs diff --git a/src/dopplersdk/models/WebhooksUpdateResponse.py b/src/dopplersdk/models/WebhooksUpdateResponse.py new file mode 100644 index 0000000..bde7d3d --- /dev/null +++ b/src/dopplersdk/models/WebhooksUpdateResponse.py @@ -0,0 +1 @@ +WebhooksUpdateResponse = dict diff --git a/src/dopplersdk/models/WorkplaceRolesCreateRequest.py b/src/dopplersdk/models/WorkplaceRolesCreateRequest.py new file mode 100644 index 0000000..d5f20b6 --- /dev/null +++ b/src/dopplersdk/models/WorkplaceRolesCreateRequest.py @@ -0,0 +1,17 @@ +from .base import BaseModel +from typing import List + + +class WorkplaceRolesCreateRequest(BaseModel): + def __init__(self, permissions: List[str], name: str, **kwargs): + """ + Initialize WorkplaceRolesCreateRequest + Parameters: + ---------- + permissions: list of WorkplaceRolesCreateRequestPermissions + An array containing the permissions the role has. Valid permissions are: `all_enclave_projects_admin`, `all_enclave_projects`, `billing_manage`, `billing`, `create_enclave_project`, `custom_roles_manage`, `ekm`, `enclave_secrets_referencing`, `logs_audit`, `logs`, `service_account_api_tokens_manage`, `service_account_api_tokens`, `service_accounts_manage`, `service_accounts`, `settings_manage`, `settings`, `team_manage`, `team`, `verified_domains_manage`, `verified_domains`, `workplace_default_environments_manage`, `workplace_default_environments_read`, `workplace_integrations_list`, `workplace_integrations_manage`, `workplace_integrations_read` + name: str + The name of the role + """ + self.permissions = permissions + self.name = name diff --git a/src/dopplersdk/models/WorkplaceRolesUpdateRequest.py b/src/dopplersdk/models/WorkplaceRolesUpdateRequest.py new file mode 100644 index 0000000..04cbd94 --- /dev/null +++ b/src/dopplersdk/models/WorkplaceRolesUpdateRequest.py @@ -0,0 +1,17 @@ +from .base import BaseModel +from typing import List + + +class WorkplaceRolesUpdateRequest(BaseModel): + def __init__(self, name: str = None, permissions: List[str] = None, **kwargs): + """ + Initialize WorkplaceRolesUpdateRequest + Parameters: + ---------- + name: str + The name of the role + permissions: list of WorkplaceRolesUpdateRequestPermissions + An array containing the permissions the role has. Valid permissions are: `all_enclave_projects_admin`, `all_enclave_projects`, `billing_manage`, `billing`, `create_enclave_project`, `custom_roles_manage`, `ekm`, `enclave_secrets_referencing`, `logs_audit`, `logs`, `service_account_api_tokens_manage`, `service_account_api_tokens`, `service_accounts_manage`, `service_accounts`, `settings_manage`, `settings`, `team_manage`, `team`, `verified_domains_manage`, `verified_domains`, `workplace_default_environments_manage`, `workplace_default_environments_read`, `workplace_integrations_list`, `workplace_integrations_manage`, `workplace_integrations_read` + """ + self.name = name + self.permissions = permissions diff --git a/src/dopplersdk/models/__init__.py b/src/dopplersdk/models/__init__.py index e19b8c1..bd48cc3 100644 --- a/src/dopplersdk/models/__init__.py +++ b/src/dopplersdk/models/__init__.py @@ -2,42 +2,41 @@ from .NameTransformer import NameTransformer from .Type import Type from .GroupsType import GroupsType +from .MemberType import MemberType from .ListResponse import ListResponse from .CreateResponse import CreateResponse -from .SecretsListResponse import SecretsListResponse -from .UpdateResponse import UpdateResponse -from .ConfigLogsListResponse import ConfigLogsListResponse +from .EnvironmentsListResponse import EnvironmentsListResponse +from .EnvironmentsCreateResponse import EnvironmentsCreateResponse from .GetResponse import GetResponse +from .UpdateResponse import UpdateResponse +from .ConfigsGetResponse import ConfigsGetResponse +from .ConfigsUpdateResponse import ConfigsUpdateResponse +from .DeleteResponse import DeleteResponse from .EnvironmentsGetResponse import EnvironmentsGetResponse from .RenameResponse import RenameResponse -from .ProjectsGetResponse import ProjectsGetResponse -from .ProjectsUpdateResponse import ProjectsUpdateResponse from .ConfigsListResponse import ConfigsListResponse from .ConfigsCreateResponse import ConfigsCreateResponse -from .ConfigsGetResponse import ConfigsGetResponse -from .ConfigsUpdateResponse import ConfigsUpdateResponse -from .DeleteResponse import DeleteResponse -from .EnvironmentsListResponse import EnvironmentsListResponse -from .EnvironmentsCreateResponse import EnvironmentsCreateResponse -from .RollbackResponse import RollbackResponse -from .RetrieveResponse import RetrieveResponse +from .ConfigLogsGetResponse import ConfigLogsGetResponse +from .ConfigLogsListResponse import ConfigLogsListResponse +from .SecretsListResponse import SecretsListResponse +from .SecretsUpdateResponse import SecretsUpdateResponse from .WorkplaceGetResponse import WorkplaceGetResponse from .WorkplaceUpdateResponse import WorkplaceUpdateResponse from .ActivityLogsListResponse import ActivityLogsListResponse +from .RetrieveResponse import RetrieveResponse from .SecretsGetResponse import SecretsGetResponse from .ServiceTokensListResponse import ServiceTokensListResponse from .ServiceTokensCreateResponse import ServiceTokensCreateResponse +from .RollbackResponse import RollbackResponse +from .UnlockResponse import UnlockResponse from .CloneResponse import CloneResponse from .LockResponse import LockResponse -from .UnlockResponse import UnlockResponse -from .GetUserResponse import GetUserResponse from .DownloadResponse import DownloadResponse -from .IssueLeaseResponse import IssueLeaseResponse +from .GetUserResponse import GetUserResponse from .RevokeLeaseResponse import RevokeLeaseResponse -from .NamesResponse import NamesResponse +from .IssueLeaseResponse import IssueLeaseResponse from .UpdateNoteResponse import UpdateNoteResponse -from .IntegrationsListResponse import IntegrationsListResponse -from .IntegrationsCreateResponse import IntegrationsCreateResponse +from .NamesResponse import NamesResponse from .IntegrationsGetResponse import IntegrationsGetResponse from .IntegrationsUpdateResponse import IntegrationsUpdateResponse from .IntegrationsDeleteResponse import IntegrationsDeleteResponse @@ -45,61 +44,82 @@ from .SyncsGetResponse import SyncsGetResponse from .SyncsDeleteResponse import SyncsDeleteResponse from .MeResponse import MeResponse +from .IntegrationsListResponse import IntegrationsListResponse +from .IntegrationsCreateResponse import IntegrationsCreateResponse from .ListTrustedIpsResponse import ListTrustedIpsResponse from .AddTrustedIpResponse import AddTrustedIpResponse from .WorkplaceRolesListResponse import WorkplaceRolesListResponse from .WorkplaceRolesCreateResponse import WorkplaceRolesCreateResponse -from .ListPermissionsResponse import ListPermissionsResponse from .WorkplaceRolesGetResponse import WorkplaceRolesGetResponse from .WorkplaceRolesUpdateResponse import WorkplaceRolesUpdateResponse -from .ProjectRolesListResponse import ProjectRolesListResponse -from .ProjectRolesCreateResponse import ProjectRolesCreateResponse from .ProjectRolesGetResponse import ProjectRolesGetResponse from .ProjectRolesUpdateResponse import ProjectRolesUpdateResponse -from .ProjectRolesListPermissionsResponse import ProjectRolesListPermissionsResponse +from .ListPermissionsResponse import ListPermissionsResponse from .ProjectMembersListResponse import ProjectMembersListResponse from .AddResponse import AddResponse +from .InvitesListResponse import InvitesListResponse +from .ProjectRolesListResponse import ProjectRolesListResponse +from .ProjectRolesCreateResponse import ProjectRolesCreateResponse from .ProjectMembersGetResponse import ProjectMembersGetResponse from .ProjectMembersUpdateResponse import ProjectMembersUpdateResponse -from .InvitesListResponse import InvitesListResponse -from .ServiceAccountsListResponse import ServiceAccountsListResponse -from .ServiceAccountsCreateResponse import ServiceAccountsCreateResponse from .ServiceAccountsGetResponse import ServiceAccountsGetResponse from .ServiceAccountsUpdateResponse import ServiceAccountsUpdateResponse -from .GroupsListResponse import GroupsListResponse -from .GroupsCreateResponse import GroupsCreateResponse +from .ProjectRolesListPermissionsResponse import ProjectRolesListPermissionsResponse from .GroupsGetResponse import GroupsGetResponse from .GroupsUpdateResponse import GroupsUpdateResponse +from .ServiceAccountsListResponse import ServiceAccountsListResponse +from .ServiceAccountsCreateResponse import ServiceAccountsCreateResponse +from .GroupsListResponse import GroupsListResponse +from .GroupsCreateResponse import GroupsCreateResponse from .UsersListResponse import UsersListResponse from .UsersGetResponse import UsersGetResponse +from .OptionsResponse import OptionsResponse +from .MemberResponse import MemberResponse +from .WebhooksListResponse import WebhooksListResponse +from .WebhooksAddResponse import WebhooksAddResponse +from .WebhooksGetResponse import WebhooksGetResponse +from .WebhooksUpdateResponse import WebhooksUpdateResponse +from .WebhooksDeleteResponse import WebhooksDeleteResponse +from .EnableResponse import EnableResponse +from .DisableResponse import DisableResponse +from .ServiceAccountTokensListResponse import ServiceAccountTokensListResponse +from .ServiceAccountTokensCreateResponse import ServiceAccountTokensCreateResponse +from .ServiceAccountTokensGetResponse import ServiceAccountTokensGetResponse from .CreateRequest import CreateRequest +from .EnvironmentsCreateRequest import EnvironmentsCreateRequest from .UpdateRequest import UpdateRequest -from .RenameRequest import RenameRequest -from .ProjectsUpdateRequest import ProjectsUpdateRequest from .DeleteRequest import DeleteRequest -from .ConfigsCreateRequest import ConfigsCreateRequest from .ConfigsUpdateRequest import ConfigsUpdateRequest from .ConfigsDeleteRequest import ConfigsDeleteRequest -from .EnvironmentsCreateRequest import EnvironmentsCreateRequest +from .RenameRequest import RenameRequest +from .ConfigsCreateRequest import ConfigsCreateRequest +from .SecretsUpdateRequest import SecretsUpdateRequest from .WorkplaceUpdateRequest import WorkplaceUpdateRequest -from .ServiceTokensCreateRequest import ServiceTokensCreateRequest from .ServiceTokensDeleteRequest import ServiceTokensDeleteRequest +from .ServiceTokensCreateRequest import ServiceTokensCreateRequest +from .UnlockRequest import UnlockRequest from .CloneRequest import CloneRequest from .LockRequest import LockRequest -from .UnlockRequest import UnlockRequest -from .IssueLeaseRequest import IssueLeaseRequest from .RevokeLeaseRequest import RevokeLeaseRequest from .RevokeRequest import RevokeRequest +from .IssueLeaseRequest import IssueLeaseRequest from .UpdateNoteRequest import UpdateNoteRequest -from .IntegrationsCreateRequest import IntegrationsCreateRequest from .IntegrationsUpdateRequest import IntegrationsUpdateRequest from .SyncsCreateRequest import SyncsCreateRequest +from .IntegrationsCreateRequest import IntegrationsCreateRequest from .AddTrustedIpRequest import AddTrustedIpRequest from .DeleteTrustedIpRequest import DeleteTrustedIpRequest +from .WorkplaceRolesCreateRequest import WorkplaceRolesCreateRequest +from .WorkplaceRolesUpdateRequest import WorkplaceRolesUpdateRequest +from .ProjectRolesUpdateRequest import ProjectRolesUpdateRequest from .AddRequest import AddRequest +from .ProjectRolesCreateRequest import ProjectRolesCreateRequest from .ProjectMembersUpdateRequest import ProjectMembersUpdateRequest -from .ServiceAccountsCreateRequest import ServiceAccountsCreateRequest from .ServiceAccountsUpdateRequest import ServiceAccountsUpdateRequest -from .GroupsCreateRequest import GroupsCreateRequest from .GroupsUpdateRequest import GroupsUpdateRequest +from .ServiceAccountsCreateRequest import ServiceAccountsCreateRequest +from .GroupsCreateRequest import GroupsCreateRequest from .AddMemberRequest import AddMemberRequest +from .WebhooksAddRequest import WebhooksAddRequest +from .WebhooksUpdateRequest import WebhooksUpdateRequest +from .ServiceAccountTokensCreateRequest import ServiceAccountTokensCreateRequest diff --git a/src/dopplersdk/models/base.py b/src/dopplersdk/models/base.py index 5d5663a..341c6a6 100644 --- a/src/dopplersdk/models/base.py +++ b/src/dopplersdk/models/base.py @@ -5,7 +5,7 @@ class BaseModel: """ - A base class that all models in the SDK inherite from (expect for Enum models). + A base class that all models in the SDK inherit from (expect for Enum models). Methods ------- @@ -16,7 +16,7 @@ class BaseModel: Checks if a value (str or enum) matches the required enum values. Returns the value if there's a match, otherwise throws an error. _one_of(cls, required_array, all_array, functions_array, input_data): - Validates wheter an input_data satisfies the oneOf requirments. + Validates whether an input_data satisfies the oneOf requirements. """ def __init__(self): @@ -43,15 +43,16 @@ def _enum_matching( def _one_of(cls, required_array, all_array, functions_array, input_data): input_array = list(input_data.keys()) for model, fields in required_array.items(): + input_copy = input_array.copy() matches_required = True for param in fields: - if param not in input_array: + if param not in input_copy: matches_required = False break - input_array.remove(param) + input_copy.remove(param) if matches_required: matches_all = True - for input in input_array: + for input in input_copy: if input not in all_array[model]: matches_all = False break diff --git a/src/dopplersdk/net/environment.py b/src/dopplersdk/net/environment.py index 978d79d..f0184a4 100644 --- a/src/dopplersdk/net/environment.py +++ b/src/dopplersdk/net/environment.py @@ -2,6 +2,7 @@ An enum class containing all the possible environments that a user can switch between in this SDK. """ + from enum import Enum diff --git a/src/dopplersdk/net/http_client.py b/src/dopplersdk/net/http_client.py index 869fd4f..3da218b 100644 --- a/src/dopplersdk/net/http_client.py +++ b/src/dopplersdk/net/http_client.py @@ -40,8 +40,8 @@ def _make_http_request(self, method, endpoint_url, headers, body_input): """ request_method = getattr(requests, method) serialized_body = rename_to_reserved_keys(to_serialize(body_input)) - if "Content-type" in headers: - data_type, subtype = headers["Content-type"].split("/") + if "Content-Type" in headers: + data_type, subtype = headers["Content-Type"].split("/") if data_type == "multipart": return multipart_form_data_request( method, endpoint_url, headers, serialized_body diff --git a/src/dopplersdk/net/http_content_types.py b/src/dopplersdk/net/http_content_types.py index 4b2b8f8..0aad706 100644 --- a/src/dopplersdk/net/http_content_types.py +++ b/src/dopplersdk/net/http_content_types.py @@ -4,6 +4,7 @@ Functions: multipart_form_data_request """ + import requests import io from mimetypes import guess_type @@ -27,7 +28,7 @@ def multipart_form_data_request(method, endpoint_url, headers, body_input): data = {} files = {} request_method = getattr(requests, method) - del headers["Content-type"] + del headers["Content-Type"] for key, value in body_input.items(): if isinstance(value, (io.TextIOWrapper, io.BufferedIOBase)): mime_type, encoding = guess_type(value.name) diff --git a/src/dopplersdk/net/query_serializer.py b/src/dopplersdk/net/query_serializer.py index 0d9668e..b720b8f 100644 --- a/src/dopplersdk/net/query_serializer.py +++ b/src/dopplersdk/net/query_serializer.py @@ -1,27 +1,40 @@ from typing import Any, Dict, List +from enum import Enum explode = bool def simple(value: Any, explode: bool) -> str: - # Check if the value is a list + if value is None: + return "null" + + if isinstance(value, Enum): + return str(value.value) + + if isinstance(value, bool): + return str(value).lower() + if isinstance(value, list): - return ",".join(value) if explode else "".join(value) + serialized_list = [simple(item, explode) for item in value] + return ",".join(serialized_list) if isinstance(value, dict): if explode: # Serialize object with exploded format: "key=value,key2=value2" - return ",".join([f"{k}={v}" for k, v in value.items()]) + return ",".join([f"{k}={simple(v, explode)}" for k, v in value.items()]) else: # Serialize object with non-exploded format: "key,value,key2,value2" return ",".join( - [str(item) for sublist in value.items() for item in sublist] + [simple(item, explode) for sublist in value.items() for item in sublist] ) return str(value) def form(parameter_name: str, parameter_value: Any, explode: bool) -> str: + if isinstance(parameter_value, Enum): + return f"{parameter_name}=" + str(parameter_value.value) + if isinstance(parameter_value, list): return ( "&".join([f"{parameter_name}={v}" for v in parameter_value]) @@ -56,6 +69,8 @@ def serialize_query(parameter_style, explode, key: str, parameter_value: Any) -> def serialize_header(explode: bool, parameter_value: Any): if not style_methods.get("simple"): return "" + if hasattr(parameter_value, "__dict__"): + parameter_value = parameter_value.__dict__ return style_methods["simple"](parameter_value, explode) diff --git a/src/dopplersdk/net/utils.py b/src/dopplersdk/net/utils.py index 21b1c19..0994d60 100644 --- a/src/dopplersdk/net/utils.py +++ b/src/dopplersdk/net/utils.py @@ -27,8 +27,12 @@ def to_serialize(obj): for key, value in iter_obj: if isinstance(value, (io.TextIOWrapper, io.BufferedIOBase)): result[key] = value - if isinstance(value, Enum): + elif isinstance(value, Enum): result[key] = value.value + elif isinstance(value, (list, set, tuple)): + for i in range(len(value)): + value[i] = to_serialize(value[i]) + result[key] = value elif hasattr(value, "__dict__"): result[key] = to_serialize(value) else: diff --git a/src/dopplersdk/sdk.py b/src/dopplersdk/sdk.py index 86c891f..d13e046 100644 --- a/src/dopplersdk/sdk.py +++ b/src/dopplersdk/sdk.py @@ -5,27 +5,33 @@ Class: DopplerSDK """ + from .net.environment import Environment -from .services.projects import Projects -from .services.secrets import Secrets -from .services.config_logs import ConfigLogs -from .services.environments import Environments -from .services.configs import Configs + from .services.activity_logs import ActivityLogs -from .services.workplace import Workplace -from .services.service_tokens import ServiceTokens from .services.audit import Audit -from .services.dynamic_secrets import DynamicSecrets from .services.auth import Auth +from .services.config_logs import ConfigLogs +from .services.configs import Configs +from .services.dynamic_secrets import DynamicSecrets +from .services.environments import Environments +from .services.get import Get +from .services.groups import Groups from .services.integrations import Integrations -from .services.syncs import Syncs -from .services.workplace_roles import WorkplaceRoles -from .services.project_roles import ProjectRoles -from .services.project_members import ProjectMembers from .services.invites import Invites +from .services.project_members import ProjectMembers +from .services.project_roles import ProjectRoles +from .services.projects import Projects +from .services.retrieve import Retrieve +from .services.secrets import Secrets +from .services.service_account_tokens import ServiceAccountTokens from .services.service_accounts import ServiceAccounts -from .services.groups import Groups +from .services.service_tokens import ServiceTokens +from .services.syncs import Syncs from .services.users import Users +from .services.webhooks import Webhooks +from .services.workplace import Workplace +from .services.workplace_roles import WorkplaceRoles class DopplerSDK: @@ -34,26 +40,30 @@ class DopplerSDK: Attributes ---------- - projects : Projects - secrets : Secrets - config_logs : ConfigLogs - environments : Environments - configs : Configs activity_logs : ActivityLogs - workplace : Workplace - service_tokens : ServiceTokens audit : Audit - dynamic_secrets : DynamicSecrets auth : Auth + config_logs : ConfigLogs + configs : Configs + dynamic_secrets : DynamicSecrets + environments : Environments + get : Get + groups : Groups integrations : Integrations - syncs : Syncs - workplace_roles : WorkplaceRoles - project_roles : ProjectRoles - project_members : ProjectMembers invites : Invites + project_members : ProjectMembers + project_roles : ProjectRoles + projects : Projects + retrieve : Retrieve + secrets : Secrets + service_account_tokens : ServiceAccountTokens service_accounts : ServiceAccounts - groups : Groups + service_tokens : ServiceTokens + syncs : Syncs users : Users + webhooks : Webhooks + workplace : Workplace + workplace_roles : WorkplaceRoles Methods ------- @@ -73,26 +83,30 @@ def __init__(self, access_token="", environment=Environment.DEFAULT) -> None: access_token : str The access token """ - self.projects = Projects(access_token) - self.secrets = Secrets(access_token) - self.config_logs = ConfigLogs(access_token) - self.environments = Environments(access_token) - self.configs = Configs(access_token) self.activity_logs = ActivityLogs(access_token) - self.workplace = Workplace(access_token) - self.service_tokens = ServiceTokens(access_token) self.audit = Audit(access_token) - self.dynamic_secrets = DynamicSecrets(access_token) self.auth = Auth(access_token) + self.config_logs = ConfigLogs(access_token) + self.configs = Configs(access_token) + self.dynamic_secrets = DynamicSecrets(access_token) + self.environments = Environments(access_token) + self.get = Get(access_token) + self.groups = Groups(access_token) self.integrations = Integrations(access_token) - self.syncs = Syncs(access_token) - self.workplace_roles = WorkplaceRoles(access_token) - self.project_roles = ProjectRoles(access_token) - self.project_members = ProjectMembers(access_token) self.invites = Invites(access_token) + self.project_members = ProjectMembers(access_token) + self.project_roles = ProjectRoles(access_token) + self.projects = Projects(access_token) + self.retrieve = Retrieve(access_token) + self.secrets = Secrets(access_token) + self.service_account_tokens = ServiceAccountTokens(access_token) self.service_accounts = ServiceAccounts(access_token) - self.groups = Groups(access_token) + self.service_tokens = ServiceTokens(access_token) + self.syncs = Syncs(access_token) self.users = Users(access_token) + self.webhooks = Webhooks(access_token) + self.workplace = Workplace(access_token) + self.workplace_roles = WorkplaceRoles(access_token) self.set_base_url(environment.value) @@ -105,26 +119,30 @@ def set_base_url(self, url: str) -> None: url: The end URL """ - self.projects.set_base_url(url) - self.secrets.set_base_url(url) - self.config_logs.set_base_url(url) - self.environments.set_base_url(url) - self.configs.set_base_url(url) self.activity_logs.set_base_url(url) - self.workplace.set_base_url(url) - self.service_tokens.set_base_url(url) self.audit.set_base_url(url) - self.dynamic_secrets.set_base_url(url) self.auth.set_base_url(url) + self.config_logs.set_base_url(url) + self.configs.set_base_url(url) + self.dynamic_secrets.set_base_url(url) + self.environments.set_base_url(url) + self.get.set_base_url(url) + self.groups.set_base_url(url) self.integrations.set_base_url(url) - self.syncs.set_base_url(url) - self.workplace_roles.set_base_url(url) - self.project_roles.set_base_url(url) - self.project_members.set_base_url(url) self.invites.set_base_url(url) + self.project_members.set_base_url(url) + self.project_roles.set_base_url(url) + self.projects.set_base_url(url) + self.retrieve.set_base_url(url) + self.secrets.set_base_url(url) + self.service_account_tokens.set_base_url(url) self.service_accounts.set_base_url(url) - self.groups.set_base_url(url) + self.service_tokens.set_base_url(url) + self.syncs.set_base_url(url) self.users.set_base_url(url) + self.webhooks.set_base_url(url) + self.workplace.set_base_url(url) + self.workplace_roles.set_base_url(url) def set_access_token(self, token: str) -> None: """ @@ -135,23 +153,30 @@ def set_access_token(self, token: str) -> None: token: string Auth token value """ - self.projects.set_access_token(token) - self.secrets.set_access_token(token) - self.config_logs.set_access_token(token) - self.environments.set_access_token(token) - self.configs.set_access_token(token) self.activity_logs.set_access_token(token) - self.workplace.set_access_token(token) - self.service_tokens.set_access_token(token) self.audit.set_access_token(token) - self.dynamic_secrets.set_access_token(token) self.auth.set_access_token(token) + self.config_logs.set_access_token(token) + self.configs.set_access_token(token) + self.dynamic_secrets.set_access_token(token) + self.environments.set_access_token(token) + self.get.set_access_token(token) + self.groups.set_access_token(token) self.integrations.set_access_token(token) - self.syncs.set_access_token(token) - self.workplace_roles.set_access_token(token) - self.project_roles.set_access_token(token) - self.project_members.set_access_token(token) self.invites.set_access_token(token) + self.project_members.set_access_token(token) + self.project_roles.set_access_token(token) + self.projects.set_access_token(token) + self.retrieve.set_access_token(token) + self.secrets.set_access_token(token) + self.service_account_tokens.set_access_token(token) self.service_accounts.set_access_token(token) - self.groups.set_access_token(token) + self.service_tokens.set_access_token(token) + self.syncs.set_access_token(token) self.users.set_access_token(token) + self.webhooks.set_access_token(token) + self.workplace.set_access_token(token) + self.workplace_roles.set_access_token(token) + + +# c029837e0e474b76bc487506e8799df5e3335891efe4fb02bda7a1441840310c diff --git a/src/dopplersdk/services/README.md b/src/dopplersdk/services/README.md index 44c7cb7..b9263a6 100644 --- a/src/dopplersdk/services/README.md +++ b/src/dopplersdk/services/README.md @@ -1,276 +1,299 @@ # DopplerSDK Services -A list of all services and services methods. -- Services - - [Projects](#projects) - - - [Secrets](#secrets) +A list of all services and services methods. - - [ConfigLogs](#configlogs) +- Services - - [Environments](#environments) + - [Projects](#projects) - - [Configs](#configs) + - [Environments](#environments) - - [ActivityLogs](#activitylogs) + - [Configs](#configs) - - [Workplace](#workplace) + - [ConfigLogs](#configlogs) - - [ServiceTokens](#servicetokens) + - [Secrets](#secrets) - - [Audit](#audit) + - [Workplace](#workplace) - - [DynamicSecrets](#dynamicsecrets) + - [ActivityLogs](#activitylogs) - - [Auth](#auth) + - [ServiceTokens](#servicetokens) - - [Integrations](#integrations) + - [Audit](#audit) - - [Syncs](#syncs) + - [DynamicSecrets](#dynamicsecrets) - - [WorkplaceRoles](#workplaceroles) + - [Auth](#auth) - - [ProjectRoles](#projectroles) + - [Integrations](#integrations) - - [ProjectMembers](#projectmembers) + - [Syncs](#syncs) - - [Invites](#invites) + - [WorkplaceRoles](#workplaceroles) - - [ServiceAccounts](#serviceaccounts) + - [ProjectRoles](#projectroles) - - [Groups](#groups) + - [ProjectMembers](#projectmembers) - - [Users](#users) -- [All Methods](#all-methods) + - [Invites](#invites) + - [ServiceAccounts](#serviceaccounts) -## Projects + - [Groups](#groups) -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [update](#update) | Update | -| [get](#get) | Retrieve | -| [delete](#delete) | Delete | + - [Users](#users) + - [Get](#get) -## Secrets + - [Retrieve](#retrieve) -| Method | Description| -| :-------- | :----------| -| [update](#update) | Update | -| [list](#list) | List | -| [get](#get) | Retrieve | -| [delete](#delete) | Delete | -| [download](#download) | Download | -| [names](#names) | List Names | -| [update_note](#update_note) | Update Note | + - [Webhooks](#webhooks) + - [ServiceAccountTokens](#serviceaccounttokens) -## ConfigLogs +- [All Methods](#all-methods) -| Method | Description| -| :-------- | :----------| -| [list](#list) | List | -| [get](#get) | Retrieve | -| [rollback](#rollback) | Rollback | +## Projects +| Method | Description | +| :---------------- | :---------- | +| [create](#create) | Create | +| [list](#list) | List | +| [update](#update) | Update | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | ## Environments -| Method | Description| -| :-------- | :----------| -| [get](#get) | Retrieve | -| [delete](#delete) | Delete | -| [rename](#rename) | Rename | -| [create](#create) | Create | -| [list](#list) | List | - +| Method | Description | +| :---------------- | :---------- | +| [create](#create) | Create | +| [list](#list) | List | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | +| [rename](#rename) | Rename | ## Configs -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [update](#update) | Update | -| [get](#get) | Retrieve | -| [delete](#delete) | Delete | -| [clone](#clone) | Clone | -| [lock](#lock) | Lock | -| [unlock](#unlock) | Unlock | -| [add_trusted_ip](#add_trusted_ip) | Add | -| [list_trusted_ips](#list_trusted_ips) | List | -| [delete_trusted_ip](#delete_trusted_ip) | Delete | +| Method | Description | +| :-------------------------------------- | :---------- | +| [update](#update) | Update | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | +| [create](#create) | Create | +| [list](#list) | List | +| [unlock](#unlock) | Unlock | +| [clone](#clone) | Clone | +| [lock](#lock) | Lock | +| [add_trusted_ip](#add_trusted_ip) | Add | +| [list_trusted_ips](#list_trusted_ips) | List | +| [delete_trusted_ip](#delete_trusted_ip) | Delete | +## ConfigLogs -## ActivityLogs +| Method | Description | +| :-------------------- | :---------- | +| [get](#get) | Retrieve | +| [list](#list) | List | +| [rollback](#rollback) | Rollback | -| Method | Description| -| :-------- | :----------| -| [retrieve](#retrieve) | Retrieve | -| [list](#list) | List | +## Secrets +| Method | Description | +| :-------------------------- | :---------- | +| [update](#update) | Update | +| [list](#list) | List | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | +| [download](#download) | Download | +| [update_note](#update_note) | Update Note | +| [names](#names) | List Names | ## Workplace -| Method | Description| -| :-------- | :----------| -| [update](#update) | Update | -| [get](#get) | Retrieve | +| Method | Description | +| :---------------- | :---------- | +| [update](#update) | Update | +| [get](#get) | Retrieve | + +## ActivityLogs +| Method | Description | +| :-------------------- | :---------- | +| [list](#list) | List | +| [retrieve](#retrieve) | Retrieve | ## ServiceTokens -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [delete](#delete) | Delete | - +| Method | Description | +| :---------------- | :---------- | +| [delete](#delete) | Delete | +| [create](#create) | Create | +| [list](#list) | List | ## Audit -| Method | Description| -| :-------- | :----------| +| Method | Description | +| :-------------------- | :------------- | | [get_user](#get_user) | Workplace User | - ## DynamicSecrets -| Method | Description| -| :-------- | :----------| -| [issue_lease](#issue_lease) | Issue Lease | +| Method | Description | +| :---------------------------- | :----------- | | [revoke_lease](#revoke_lease) | Revoke Lease | - +| [issue_lease](#issue_lease) | Issue Lease | ## Auth -| Method | Description| -| :-------- | :----------| -| [revoke](#revoke) | Revoke | -| [me](#me) | Me | - +| Method | Description | +| :---------------- | :---------- | +| [revoke](#revoke) | Revoke | +| [me](#me) | Me | ## Integrations -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [get](#get) | Retrieve | -| [delete](#delete) | Delete | -| [update](#update) | Update | - +| Method | Description | +| :---------------- | :---------- | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | +| [update](#update) | Update | +| [create](#create) | Create | +| [list](#list) | List | ## Syncs -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [get](#get) | Retrieve | -| [delete](#delete) | Delete | - +| Method | Description | +| :---------------- | :---------- | +| [create](#create) | Create | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | ## WorkplaceRoles -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | +| Method | Description | +| :------------------------------------ | :--------------- | +| [create](#create) | Create | +| [list](#list) | List | +| [get](#get) | Retrieve | +| [update](#update) | Update | +| [delete](#delete) | Delete | | [list_permissions](#list_permissions) | List Permissions | -| [get](#get) | Retrieve | -| [update](#update) | Update | -| [delete](#delete) | Delete | - ## ProjectRoles -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [get](#get) | Retrieve | -| [update](#update) | Update | -| [delete](#delete) | Delete | +| Method | Description | +| :------------------------------------ | :--------------- | +| [get](#get) | Retrieve | +| [update](#update) | Update | +| [delete](#delete) | Delete | +| [create](#create) | Create | +| [list](#list) | List | | [list_permissions](#list_permissions) | List Permissions | - ## ProjectMembers -| Method | Description| -| :-------- | :----------| -| [add](#add) | Add | -| [list](#list) | List | -| [get](#get) | Retrieve | -| [update](#update) | Update | -| [delete](#delete) | Delete | - +| Method | Description | +| :---------------- | :---------- | +| [add](#add) | Add | +| [list](#list) | List | +| [get](#get) | Retrieve | +| [update](#update) | Update | +| [delete](#delete) | Delete | ## Invites -| Method | Description| -| :-------- | :----------| -| [list](#list) | List | - +| Method | Description | +| :------------ | :---------- | +| [list](#list) | List | ## ServiceAccounts -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [get](#get) | Retrieve | -| [update](#update) | Update | -| [delete](#delete) | Delete | - +| Method | Description | +| :---------------- | :---------- | +| [get](#get) | Retrieve | +| [update](#update) | Update | +| [delete](#delete) | Delete | +| [create](#create) | Create | +| [list](#list) | List | ## Groups -| Method | Description| -| :-------- | :----------| -| [create](#create) | Create | -| [list](#list) | List | -| [get](#get) | Retrieve | -| [update](#update) | Update | -| [delete](#delete) | Delete | -| [add_member](#add_member) | Add Member | +| Method | Description | +| :------------------------------ | :------------ | +| [get](#get) | Retrieve | +| [update](#update) | Update | +| [delete](#delete) | Delete | +| [create](#create) | Create | +| [list](#list) | List | | [delete_member](#delete_member) | Delete Member | - +| [add_member](#add_member) | Add Member | ## Users -| Method | Description| -| :-------- | :----------| -| [list](#list) | List | -| [get](#get) | Retrieve | +| Method | Description | +| :------------ | :---------- | +| [list](#list) | List | +| [get](#get) | Retrieve | +## Get +| Method | Description | +| :------------------ | :---------- | +| [options](#options) | Get Options | +## Retrieve -## All Methods +| Method | Description | +| :---------------- | :-------------- | +| [member](#member) | Retrieve Member | +## Webhooks + +| Method | Description | +| :------------------ | :---------- | +| [add](#add) | Add | +| [list](#list) | List | +| [get](#get) | Retrieve | +| [update](#update) | Update | +| [delete](#delete) | Delete | +| [enable](#enable) | Enable | +| [disable](#disable) | Disable | + +## ServiceAccountTokens + +| Method | Description | +| :---------------- | :---------- | +| [create](#create) | Create | +| [list](#list) | List | +| [get](#get) | Retrieve | +| [delete](#delete) | Delete | + +## All Methods ### **create** + Create + - HTTP Method: POST - Endpoint: /v3/projects **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| | request_input | [CreateRequest](/src/dopplersdk/models/README.md#createrequest) | Optional | Request body. | **Return Type** -[CreateResponse](/src/dopplersdk/models/README.md#createresponse) +[CreateResponse](/src/dopplersdk/models/README.md#createresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { @@ -284,25 +307,28 @@ pprint(vars(results)) ``` ### **list** + List + - HTTP Method: GET - Endpoint: /v3/projects **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| | page | int | Optional | Page number | | per_page | int | Optional | Items per page | **Return Type** -[ListResponse](/src/dopplersdk/models/README.md#listresponse) +[ListResponse](/src/dopplersdk/models/README.md#listresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) results = sdk.projects.list( @@ -315,24 +341,27 @@ pprint(vars(results)) ``` ### **update** + Update + - HTTP Method: POST - Endpoint: /v3/projects/project **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ProjectsUpdateRequest](/src/dopplersdk/models/README.md#projectsupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [UpdateRequest](/src/dopplersdk/models/README.md#updaterequest) | Optional | Request body. | **Return Type** -[ProjectsUpdateResponse](/src/dopplersdk/models/README.md#projectsupdateresponse) +[UpdateResponse](/src/dopplersdk/models/README.md#updateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { @@ -347,24 +376,27 @@ pprint(vars(results)) ``` ### **get** + Retrieve + - HTTP Method: GET - Endpoint: /v3/projects/project **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| | project | str | Required | Unique identifier for the project object. | **Return Type** -[ProjectsGetResponse](/src/dopplersdk/models/README.md#projectsgetresponse) +[GetResponse](/src/dopplersdk/models/README.md#getresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) results = sdk.projects.get(project = 'PROJECT_NAME') @@ -374,13 +406,15 @@ pprint(vars(results)) ``` ### **delete** + Delete + - HTTP Method: DELETE - Endpoint: /v3/projects/project **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| | request_input | [DeleteRequest](/src/dopplersdk/models/README.md#deleterequest) | Optional | Request body. | **Return Type** @@ -388,10 +422,11 @@ Delete Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = {'project': 'PROJECT_NAME'} @@ -401,107 +436,102 @@ pprint(vars(results)) ``` +### **create** + +Create -### **update** -Update - HTTP Method: POST -- Endpoint: /v3/configs/config/secrets +- Endpoint: /v3/environments **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [UpdateRequest](/src/dopplersdk/models/README.md#updaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project's name | +| request_input | [EnvironmentsCreateRequest](/src/dopplersdk/models/README.md#environmentscreaterequest) | Optional | Request body. | **Return Type** -[UpdateResponse](/src/dopplersdk/models/README.md#updateresponse) +[EnvironmentsCreateResponse](/src/dopplersdk/models/README.md#environmentscreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'config': 'CONFIG_NAME', - 'project': 'PROJECT_NAME', - 'secrets': {"ALGOLIA":"N9TOPUCTO","DATABASE":"${USER}@aws.dynamodb.com:9876","STRIPE":"sk_test_9YxLnoLDdvOPn2dfjBVPB"} + 'name': 'name', + 'slug': 'slug' } -results = sdk.secrets.update(request_input = request_body) +results = sdk.environments.create( + request_input = request_body, + project = 'project' +) pprint(vars(results)) ``` ### **list** + List + - HTTP Method: GET -- Endpoint: /v3/configs/config/secrets +- Endpoint: /v3/environments **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | -| accepts | str | Optional | Available options are: **application/json**, **text/plain** | -| include_dynamic_secrets | bool | Optional | Whether or not to issue leases and include dynamic secret values for the config | -| dynamic_secrets_ttl_sec | int | Optional | The number of seconds until dynamic leases expire. Must be used with `include_dynamic_secrets`. Defaults to 1800 (30 minutes). | -| secrets | str | Optional | A comma-separated list of secrets to include in the response | -| include_managed_secrets | bool | Optional | Whether to include Doppler's auto-generated (managed) secrets | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project's name | **Return Type** -[SecretsListResponse](/src/dopplersdk/models/README.md#secretslistresponse) +[EnvironmentsListResponse](/src/dopplersdk/models/README.md#environmentslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.secrets.list( - project = 'PROJECT_NAME', - config = 'CONFIG_NAME', - accepts = 'application/json', - include_dynamic_secrets = True, - dynamic_secrets_ttl_sec = -76810366, - secrets = 'secrets', - include_managed_secrets = True -) +results = sdk.environments.list(project = 'project') pprint(vars(results)) ``` ### **get** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/configs/config/secret +- Endpoint: /v3/environments/environment **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | -| name | str | Required | Name of the secret. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project's name | +| environment | str | Required | The environment's slug | **Return Type** -[SecretsGetResponse](/src/dopplersdk/models/README.md#secretsgetresponse) +[EnvironmentsGetResponse](/src/dopplersdk/models/README.md#environmentsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.secrets.get( - project = 'PROJECT_NAME', - config = 'CONFIG_NAME', - name = 'SECRET_NAME' +results = sdk.environments.get( + project = 'project', + environment = 'environment' ) pprint(vars(results)) @@ -509,273 +539,686 @@ pprint(vars(results)) ``` ### **delete** + Delete + - HTTP Method: DELETE -- Endpoint: /v3/configs/config/secret +- Endpoint: /v3/environments/environment **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | -| name | str | Required | Name of the secret. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project's name | +| environment | str | Required | The environment's slug | **Return Type** Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.secrets.delete( - project = 'PROJECT_NAME', - config = 'CONFIG_NAME', - name = 'SECRET_NAME' +results = sdk.environments.delete( + project = 'project', + environment = 'environment' ) pprint(vars(results)) ``` -### **download** -Download -- HTTP Method: GET -- Endpoint: /v3/configs/config/secrets/download +### **rename** + +Rename + +- HTTP Method: PUT +- Endpoint: /v3/environments/environment **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. Not required if using a Service Token. | -| config | str | Required | Name of the config object. Not required if using a Service Token. | -| format | [Format](/src/dopplersdk/models/README.md#format) | Optional | | -| name_transformer | [NameTransformer](/src/dopplersdk/models/README.md#nametransformer) | Optional | Transform secret names to a different case | -| include_dynamic_secrets | bool | Optional | Whether or not to issue leases and include dynamic secret values for the config | -| dynamic_secrets_ttl_sec | int | Optional | The number of seconds until dynamic leases expire. Must be used with `include_dynamic_secrets`. Defaults to 1800 (30 minutes). | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project's name | +| environment | str | Required | The environment's slug | +| request_input | [RenameRequest](/src/dopplersdk/models/README.md#renamerequest) | Optional | Request body. | **Return Type** -[DownloadResponse](/src/dopplersdk/models/README.md#downloadresponse) +[RenameResponse](/src/dopplersdk/models/README.md#renameresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.secrets.download( +request_body = { + 'name': 'name', + 'slug': 'slug' +} +results = sdk.environments.rename( + request_input = request_body, project = 'project', - config = 'config', - format = 'json', - name_transformer = 'camel', - include_dynamic_secrets = True, - dynamic_secrets_ttl_sec = 1800 + environment = 'environment' ) pprint(vars(results)) ``` -### **names** -List Names -- HTTP Method: GET -- Endpoint: /v3/configs/config/secrets/names - -**Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | -| include_dynamic_secrets | bool | Optional | Whether or not to issue leases and include dynamic secret values for the config | -| include_managed_secrets | bool | Optional | Whether to include Doppler's auto-generated (managed) secrets | - -**Return Type** - -[NamesResponse](/src/dopplersdk/models/README.md#namesresponse) - -**Example Usage Code Snippet** -```Python -from pprint import pprint -from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' -sdk = DopplerSDK() -sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.secrets.names( - project = 'PROJECT_NAME', - config = 'CONFIG_NAME', - include_dynamic_secrets = True, - include_managed_secrets = True -) - -pprint(vars(results)) +### **update** -``` +Update -### **update_note** -Update Note - HTTP Method: POST -- Endpoint: /v3/configs/config/secrets/note +- Endpoint: /v3/configs/config **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [UpdateNoteRequest](/src/dopplersdk/models/README.md#updatenoterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ConfigsUpdateRequest](/src/dopplersdk/models/README.md#configsupdaterequest) | Optional | Request body. | **Return Type** -[UpdateNoteResponse](/src/dopplersdk/models/README.md#updatenoteresponse) +[ConfigsUpdateResponse](/src/dopplersdk/models/README.md#configsupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { 'config': 'CONFIG_NAME', - 'note': 'note', - 'project': 'PROJECT_NAME', - 'secret': 'secret' + 'name': 'CONFIG_NEW_NAME', + 'project': 'PROJECT_NAME' } -results = sdk.secrets.update_note(request_input = request_body) +results = sdk.configs.update(request_input = request_body) pprint(vars(results)) ``` +### **get** + +Retrieve -### **list** -List - HTTP Method: GET -- Endpoint: /v3/configs/config/logs +- Endpoint: /v3/configs/config **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| | project | str | Required | Unique identifier for the project object. | | config | str | Required | Name of the config object. | -| page | int | Optional | Page number | -| per_page | int | Optional | Items per page | **Return Type** -[ConfigLogsListResponse](/src/dopplersdk/models/README.md#configlogslistresponse) +[ConfigsGetResponse](/src/dopplersdk/models/README.md#configsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.config_logs.list( +results = sdk.configs.get( project = 'PROJECT_NAME', - config = 'CONFIG_NAME', - page = 1, - per_page = 20 + config = 'CONFIG_NAME' ) pprint(vars(results)) ``` -### **get** -Retrieve -- HTTP Method: GET -- Endpoint: /v3/configs/config/logs/log +### **delete** + +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/configs/config **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | -| log | str | Required | Unique identifier for the log object. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ConfigsDeleteRequest](/src/dopplersdk/models/README.md#configsdeleterequest) | Optional | Request body. | **Return Type** -[GetResponse](/src/dopplersdk/models/README.md#getresponse) +[DeleteResponse](/src/dopplersdk/models/README.md#deleteresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.config_logs.get( - project = 'PROJECT_NAME', - config = 'CONFIG_NAME', - log = 'LOG_ID' -) +request_body = { + 'config': 'CONFIG_NAME', + 'project': 'PROJECT_NAME' +} +results = sdk.configs.delete(request_input = request_body) pprint(vars(results)) ``` -### **rollback** -Rollback +### **create** + +Create + - HTTP Method: POST -- Endpoint: /v3/configs/config/logs/log/rollback +- Endpoint: /v3/configs **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | -| log | str | Required | Unique identifier for the log object. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ConfigsCreateRequest](/src/dopplersdk/models/README.md#configscreaterequest) | Optional | Request body. | **Return Type** -[RollbackResponse](/src/dopplersdk/models/README.md#rollbackresponse) +[ConfigsCreateResponse](/src/dopplersdk/models/README.md#configscreateresponse) **Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = { + 'environment': 'ENVIRONMENT_ID', + 'name': 'CONFIG_NAME', + 'project': 'PROJECT_NAME' +} +results = sdk.configs.create(request_input = request_body) + +pprint(vars(results)) + +``` + +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/configs + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project's name | +| environment | str | Optional | (optional) the environment from which to list configs | +| page | int | Optional | Page number | +| per_page | int | Optional | Items per page | + +**Return Type** + +[ConfigsListResponse](/src/dopplersdk/models/README.md#configslistresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +results = sdk.configs.list( + project = 'project', + environment = 'Environment slug', + page = 1, + per_page = 20 +) + +pprint(vars(results)) + +``` + +### **unlock** + +Unlock + +- HTTP Method: POST +- Endpoint: /v3/configs/config/unlock + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [UnlockRequest](/src/dopplersdk/models/README.md#unlockrequest) | Optional | Request body. | + +**Return Type** + +[UnlockResponse](/src/dopplersdk/models/README.md#unlockresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = { + 'config': 'CONFIG_NAME', + 'project': 'PROJECT_NAME' +} +results = sdk.configs.unlock(request_input = request_body) + +pprint(vars(results)) + +``` + +### **clone** + +Clone + +- HTTP Method: POST +- Endpoint: /v3/configs/config/clone + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [CloneRequest](/src/dopplersdk/models/README.md#clonerequest) | Optional | Request body. | + +**Return Type** + +[CloneResponse](/src/dopplersdk/models/README.md#cloneresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = { + 'config': 'CONFIG_NAME', + 'name': 'NEW_CONFIG_NAME', + 'project': 'PROJECT_NAME' +} +results = sdk.configs.clone(request_input = request_body) + +pprint(vars(results)) + +``` + +### **lock** + +Lock + +- HTTP Method: POST +- Endpoint: /v3/configs/config/lock + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [LockRequest](/src/dopplersdk/models/README.md#lockrequest) | Optional | Request body. | + +**Return Type** + +[LockResponse](/src/dopplersdk/models/README.md#lockresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = { + 'config': 'CONFIG_NAME', + 'project': 'PROJECT_NAME' +} +results = sdk.configs.lock(request_input = request_body) + +pprint(vars(results)) + +``` + +### **add_trusted_ip** + +Add + +- HTTP Method: POST +- Endpoint: /v3/configs/config/trusted_ips + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | | +| config | str | Required | | +| request_input | [AddTrustedIpRequest](/src/dopplersdk/models/README.md#addtrustediprequest) | Optional | Request body. | + +**Return Type** + +[AddTrustedIpResponse](/src/dopplersdk/models/README.md#addtrustedipresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = {'ip': 'ip'} +results = sdk.configs.add_trusted_ip( + request_input = request_body, + project = 'project', + config = 'config' +) + +pprint(vars(results)) + +``` + +### **list_trusted_ips** + +List + +- HTTP Method: GET +- Endpoint: /v3/configs/config/trusted_ips + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | | +| config | str | Required | | + +**Return Type** + +[ListTrustedIpsResponse](/src/dopplersdk/models/README.md#listtrustedipsresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +results = sdk.configs.list_trusted_ips( + project = 'project', + config = 'config' +) + +pprint(vars(results)) + +``` + +### **delete_trusted_ip** + +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/configs/config/trusted_ips + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | | +| config | str | Required | | +| request_input | [DeleteTrustedIpRequest](/src/dopplersdk/models/README.md#deletetrustediprequest) | Optional | Request body. | + +**Return Type** + +Returns a dict object. + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = {'ip': 'ip'} +results = sdk.configs.delete_trusted_ip( + request_input = request_body, + project = 'project', + config = 'config' +) + +pprint(vars(results)) + +``` + +### **get** + +Retrieve + +- HTTP Method: GET +- Endpoint: /v3/configs/config/logs/log + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | +| log | str | Required | Unique identifier for the log object. | + +**Return Type** + +[ConfigLogsGetResponse](/src/dopplersdk/models/README.md#configlogsgetresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +results = sdk.config_logs.get( + project = 'PROJECT_NAME', + config = 'CONFIG_NAME', + log = 'LOG_ID' +) + +pprint(vars(results)) + +``` + +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/configs/config/logs + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | +| page | int | Optional | Page number | +| per_page | int | Optional | Items per page | + +**Return Type** + +[ConfigLogsListResponse](/src/dopplersdk/models/README.md#configlogslistresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +results = sdk.config_logs.list( + project = 'PROJECT_NAME', + config = 'CONFIG_NAME', + page = 1, + per_page = 20 +) + +pprint(vars(results)) + +``` + +### **rollback** + +Rollback + +- HTTP Method: POST +- Endpoint: /v3/configs/config/logs/log/rollback + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | +| log | str | Required | Unique identifier for the log object. | + +**Return Type** + +[RollbackResponse](/src/dopplersdk/models/README.md#rollbackresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +results = sdk.config_logs.rollback( + project = 'PROJECT_NAME', + config = 'CONFIG_NAME', + log = 'LOG_ID' +) + +pprint(vars(results)) + +``` + +### **update** + +Update + +- HTTP Method: POST +- Endpoint: /v3/configs/config/secrets + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [SecretsUpdateRequest](/src/dopplersdk/models/README.md#secretsupdaterequest) | Optional | Request body. | + +**Return Type** + +[SecretsUpdateResponse](/src/dopplersdk/models/README.md#secretsupdateresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = { + 'change_requests': [{"name":"quis et","originalName":"Ut voluptate reprehenderit culpa","originalValue":"sed ex","originalVisibility":"do nisi exercitation","shouldConverge":true,"shouldDelete":true,"shouldPromote":false,"value":"laboris anim","visibility":"sit nostrud ut est consectetur"},{"name":"officia consectetur velit amet cupidatat","originalName":"consequat nostrud deserunt ut","originalValue":"eiusmod esse veniam commodo officia","originalVisibility":"cillum","shouldConverge":false,"shouldDelete":true,"shouldPromote":true,"value":"nulla Lorem in dolore","visibility":"in"}], + 'config': 'CONFIG_NAME', + 'project': 'PROJECT_NAME', + 'secrets': {} +} +results = sdk.secrets.update(request_input = request_body) + +pprint(vars(results)) + +``` + +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/configs/config/secrets + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | +| accepts | str | Optional | Available options are: **application/json**, **text/plain** | +| include_dynamic_secrets | bool | Optional | Whether or not to issue leases and include dynamic secret values for the config | +| dynamic_secrets_ttl_sec | int | Optional | The number of seconds until dynamic leases expire. Must be used with `include_dynamic_secrets`. Defaults to 1800 (30 minutes). | +| secrets | str | Optional | A comma-separated list of secrets to include in the response | +| include_managed_secrets | bool | Optional | Whether to include Doppler's auto-generated (managed) secrets | + +**Return Type** + +[SecretsListResponse](/src/dopplersdk/models/README.md#secretslistresponse) + +**Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.config_logs.rollback( +results = sdk.secrets.list( project = 'PROJECT_NAME', config = 'CONFIG_NAME', - log = 'LOG_ID' + accepts = 'application/json', + include_dynamic_secrets = True, + dynamic_secrets_ttl_sec = -20553545, + secrets = 'secrets', + include_managed_secrets = True ) pprint(vars(results)) ``` - ### **get** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/environments/environment +- Endpoint: /v3/configs/config/secret **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project's name | -| environment | str | Required | The environment's slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | +| name | str | Required | Name of the secret. | **Return Type** -[EnvironmentsGetResponse](/src/dopplersdk/models/README.md#environmentsgetresponse) +[SecretsGetResponse](/src/dopplersdk/models/README.md#secretsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.environments.get( - project = 'project', - environment = 'environment' +results = sdk.secrets.get( + project = 'PROJECT_NAME', + config = 'CONFIG_NAME', + name = 'SECRET_NAME' ) pprint(vars(results)) @@ -783,1121 +1226,1195 @@ pprint(vars(results)) ``` ### **delete** + Delete + - HTTP Method: DELETE -- Endpoint: /v3/environments/environment +- Endpoint: /v3/configs/config/secret **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project's name | -| environment | str | Required | The environment's slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | +| name | str | Required | Name of the secret. | **Return Type** Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.environments.delete( - project = 'project', - environment = 'environment' +results = sdk.secrets.delete( + project = 'PROJECT_NAME', + config = 'CONFIG_NAME', + name = 'SECRET_NAME' ) pprint(vars(results)) ``` -### **rename** -Rename -- HTTP Method: PUT -- Endpoint: /v3/environments/environment +### **download** + +Download + +- HTTP Method: GET +- Endpoint: /v3/configs/config/secrets/download **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project's name | -| environment | str | Required | The environment's slug | -| request_input | [RenameRequest](/src/dopplersdk/models/README.md#renamerequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. Not required if using a Service Token. | +| config | str | Required | Name of the config object. Not required if using a Service Token. | +| format | [Format](/src/dopplersdk/models/README.md#format) | Optional | | +| name_transformer | [NameTransformer](/src/dopplersdk/models/README.md#nametransformer) | Optional | Transform secret names to a different case | +| include_dynamic_secrets | bool | Optional | Whether or not to issue leases and include dynamic secret values for the config | +| dynamic_secrets_ttl_sec | int | Optional | The number of seconds until dynamic leases expire. Must be used with `include_dynamic_secrets`. Defaults to 1800 (30 minutes). | +| secrets | str | Optional | Comma-delimited list of secrets to include in the download. Defaults to all secrets if left unspecified. | **Return Type** -[RenameResponse](/src/dopplersdk/models/README.md#renameresponse) +[DownloadResponse](/src/dopplersdk/models/README.md#downloadresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'name': 'name', - 'slug': 'slug' -} -results = sdk.environments.rename( - request_input = request_body, +results = sdk.secrets.download( project = 'project', - environment = 'environment' + config = 'config', + format = 'json', + name_transformer = 'camel', + include_dynamic_secrets = True, + dynamic_secrets_ttl_sec = 1800, + secrets = 'secrets' ) pprint(vars(results)) ``` -### **create** -Create +### **update_note** + +Update Note + - HTTP Method: POST -- Endpoint: /v3/environments +- Endpoint: /v3/configs/config/secrets/note **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project's name | -| request_input | [EnvironmentsCreateRequest](/src/dopplersdk/models/README.md#environmentscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [UpdateNoteRequest](/src/dopplersdk/models/README.md#updatenoterequest) | Optional | Request body. | **Return Type** -[EnvironmentsCreateResponse](/src/dopplersdk/models/README.md#environmentscreateresponse) +[UpdateNoteResponse](/src/dopplersdk/models/README.md#updatenoteresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'name': 'name', - 'slug': 'slug' + 'config': 'config', + 'note': 'YOUR_NOTE', + 'project': 'PROJECT_NAME', + 'secret': 'SECRET_NAME' } -results = sdk.environments.create( - request_input = request_body, - project = 'project' -) +results = sdk.secrets.update_note(request_input = request_body) pprint(vars(results)) ``` -### **list** -List +### **names** + +List Names + - HTTP Method: GET -- Endpoint: /v3/environments +- Endpoint: /v3/configs/config/secrets/names **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project's name | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | +| include_dynamic_secrets | bool | Optional | Whether or not to issue leases and include dynamic secret values for the config | +| include_managed_secrets | bool | Optional | Whether to include Doppler's auto-generated (managed) secrets | **Return Type** -[EnvironmentsListResponse](/src/dopplersdk/models/README.md#environmentslistresponse) +[NamesResponse](/src/dopplersdk/models/README.md#namesresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.environments.list(project = 'project') +results = sdk.secrets.names( + project = 'PROJECT_NAME', + config = 'CONFIG_NAME', + include_dynamic_secrets = True, + include_managed_secrets = True +) pprint(vars(results)) ``` +### **update** + +Update -### **create** -Create - HTTP Method: POST -- Endpoint: /v3/configs +- Endpoint: /v3/workplace **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ConfigsCreateRequest](/src/dopplersdk/models/README.md#configscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [WorkplaceUpdateRequest](/src/dopplersdk/models/README.md#workplaceupdaterequest) | Optional | Request body. | **Return Type** -[ConfigsCreateResponse](/src/dopplersdk/models/README.md#configscreateresponse) +[WorkplaceUpdateResponse](/src/dopplersdk/models/README.md#workplaceupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'environment': 'ENVIRONMENT_ID', - 'name': 'CONFIG_NAME', - 'project': 'PROJECT_NAME' + 'billing_email': 'billing_email', + 'name': 'name', + 'security_email': 'security_email' } -results = sdk.configs.create(request_input = request_body) +results = sdk.workplace.update(request_input = request_body) pprint(vars(results)) ``` -### **list** -List +### **get** + +Retrieve + - HTTP Method: GET -- Endpoint: /v3/configs +- Endpoint: /v3/workplace **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project's name | -| environment | str | Optional | (optional) the environment from which to list configs | -| page | int | Optional | Page number | -| per_page | int | Optional | Items per page | + +This method has no parameters. **Return Type** -[ConfigsListResponse](/src/dopplersdk/models/README.md#configslistresponse) +[WorkplaceGetResponse](/src/dopplersdk/models/README.md#workplacegetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.configs.list( - project = 'project', - environment = 'Environment slug', - page = 1, - per_page = 20 -) +results = sdk.workplace.get() pprint(vars(results)) ``` -### **update** -Update -- HTTP Method: POST -- Endpoint: /v3/configs/config +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/logs **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ConfigsUpdateRequest](/src/dopplersdk/models/README.md#configsupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| page | str | Optional | Page number | +| per_page | int | Optional | Items per page | **Return Type** -[ConfigsUpdateResponse](/src/dopplersdk/models/README.md#configsupdateresponse) +[ActivityLogsListResponse](/src/dopplersdk/models/README.md#activitylogslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'config': 'CONFIG_NAME', - 'name': 'CONFIG_NEW_NAME', - 'project': 'PROJECT_NAME' -} -results = sdk.configs.update(request_input = request_body) +results = sdk.activity_logs.list( + page = '1', + per_page = 20 +) pprint(vars(results)) ``` -### **get** +### **retrieve** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/configs/config +- Endpoint: /v3/logs/log **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| log | str | Required | Unique identifier for the log object. | **Return Type** -[ConfigsGetResponse](/src/dopplersdk/models/README.md#configsgetresponse) +[RetrieveResponse](/src/dopplersdk/models/README.md#retrieveresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.configs.get( - project = 'PROJECT_NAME', - config = 'CONFIG_NAME' -) +results = sdk.activity_logs.retrieve(log = 'LOG_ID') pprint(vars(results)) ``` ### **delete** + Delete + - HTTP Method: DELETE -- Endpoint: /v3/configs/config +- Endpoint: /v3/configs/config/tokens/token **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ConfigsDeleteRequest](/src/dopplersdk/models/README.md#configsdeleterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ServiceTokensDeleteRequest](/src/dopplersdk/models/README.md#servicetokensdeleterequest) | Optional | Request body. | **Return Type** -[DeleteResponse](/src/dopplersdk/models/README.md#deleteresponse) +[DeleteResponse](/src/dopplersdk/models/README.md#deleteresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { 'config': 'CONFIG_NAME', - 'project': 'PROJECT_NAME' + 'project': 'PROJECT_NAME', + 'slug': 'TOKEN_SLUG', + 'token': 'TOKEN_VALUE' } -results = sdk.configs.delete(request_input = request_body) +results = sdk.service_tokens.delete(request_input = request_body) pprint(vars(results)) ``` -### **clone** -Clone +### **create** + +Create + - HTTP Method: POST -- Endpoint: /v3/configs/config/clone +- Endpoint: /v3/configs/config/tokens **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [CloneRequest](/src/dopplersdk/models/README.md#clonerequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ServiceTokensCreateRequest](/src/dopplersdk/models/README.md#servicetokenscreaterequest) | Optional | Request body. | **Return Type** -[CloneResponse](/src/dopplersdk/models/README.md#cloneresponse) +[ServiceTokensCreateResponse](/src/dopplersdk/models/README.md#servicetokenscreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { + 'access': 'read', 'config': 'CONFIG_NAME', - 'name': 'NEW_CONFIG_NAME', + 'expire_at': '1898-12-29T20:03:18.0Z', + 'name': 'TOKEN_NAME', 'project': 'PROJECT_NAME' } -results = sdk.configs.clone(request_input = request_body) +results = sdk.service_tokens.create(request_input = request_body) pprint(vars(results)) ``` -### **lock** -Lock -- HTTP Method: POST -- Endpoint: /v3/configs/config/lock +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/configs/config/tokens **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [LockRequest](/src/dopplersdk/models/README.md#lockrequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Unique identifier for the project object. | +| config | str | Required | Name of the config object. | **Return Type** -[LockResponse](/src/dopplersdk/models/README.md#lockresponse) +[ServiceTokensListResponse](/src/dopplersdk/models/README.md#servicetokenslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'config': 'CONFIG_NAME', - 'project': 'PROJECT_NAME' -} -results = sdk.configs.lock(request_input = request_body) +results = sdk.service_tokens.list( + project = 'PROJECT_NAME', + config = 'CONFIG_NAME' +) pprint(vars(results)) ``` -### **unlock** -Unlock -- HTTP Method: POST -- Endpoint: /v3/configs/config/unlock +### **get_user** + +Workplace User + +- HTTP Method: GET +- Endpoint: /v3/workplace/users/{workplace_user_id} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [UnlockRequest](/src/dopplersdk/models/README.md#unlockrequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| workplace_user_id | str | Required | The ID of the workplace user | +| settings | bool | Optional | If true, the api will return more information if the user has e.g. SAML enabled and/or Multi Factor Auth enabled | **Return Type** -[UnlockResponse](/src/dopplersdk/models/README.md#unlockresponse) +[GetUserResponse](/src/dopplersdk/models/README.md#getuserresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'config': 'CONFIG_NAME', - 'project': 'PROJECT_NAME' -} -results = sdk.configs.unlock(request_input = request_body) +results = sdk.audit.get_user( + workplace_user_id = 'workplace_user_id', + settings = True +) pprint(vars(results)) ``` -### **add_trusted_ip** -Add -- HTTP Method: POST -- Endpoint: /v3/configs/config/trusted_ips +### **revoke_lease** + +Revoke Lease + +- HTTP Method: DELETE +- Endpoint: /v3/configs/config/dynamic_secrets/dynamic_secret/leases/lease **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | | -| config | str | Required | | -| request_input | [AddTrustedIpRequest](/src/dopplersdk/models/README.md#addtrustediprequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [RevokeLeaseRequest](/src/dopplersdk/models/README.md#revokeleaserequest) | Optional | Request body. | **Return Type** -[AddTrustedIpResponse](/src/dopplersdk/models/README.md#addtrustedipresponse) +[RevokeLeaseResponse](/src/dopplersdk/models/README.md#revokeleaseresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = {'ip': 'ip'} -results = sdk.configs.add_trusted_ip( - request_input = request_body, - project = 'project', - config = 'config' -) +request_body = { + 'config': 'config', + 'dynamic_secret': 'dynamic_secret', + 'project': 'project', + 'slug': 'slug' +} +results = sdk.dynamic_secrets.revoke_lease(request_input = request_body) pprint(vars(results)) ``` -### **list_trusted_ips** -List -- HTTP Method: GET -- Endpoint: /v3/configs/config/trusted_ips +### **issue_lease** + +Issue Lease + +- HTTP Method: POST +- Endpoint: /v3/configs/config/dynamic_secrets/dynamic_secret/leases **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | | -| config | str | Required | | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [IssueLeaseRequest](/src/dopplersdk/models/README.md#issueleaserequest) | Optional | Request body. | **Return Type** -[ListTrustedIpsResponse](/src/dopplersdk/models/README.md#listtrustedipsresponse) +[IssueLeaseResponse](/src/dopplersdk/models/README.md#issueleaseresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.configs.list_trusted_ips( - project = 'project', - config = 'config' -) +request_body = { + 'config': 'config', + 'dynamic_secret': 'dynamic_secret', + 'project': 'project', + 'ttl_sec': 56600272 +} +results = sdk.dynamic_secrets.issue_lease(request_input = request_body) pprint(vars(results)) ``` -### **delete_trusted_ip** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/configs/config/trusted_ips +### **revoke** + +Revoke + +- HTTP Method: POST +- Endpoint: /v3/auth/revoke **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | | -| config | str | Required | | -| request_input | [DeleteTrustedIpRequest](/src/dopplersdk/models/README.md#deletetrustediprequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [RevokeRequest](/src/dopplersdk/models/README.md#revokerequest) | Optional | Request body. | **Return Type** Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = {'ip': 'ip'} -results = sdk.configs.delete_trusted_ip( - request_input = request_body, - project = 'project', - config = 'config' -) +request_body = {'token': 'token'} +results = sdk.auth.revoke(request_input = request_body) pprint(vars(results)) ``` +### **me** + +Me -### **retrieve** -Retrieve - HTTP Method: GET -- Endpoint: /v3/logs/log +- Endpoint: /v3/me **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| log | str | Required | Unique identifier for the log object. | + +This method has no parameters. **Return Type** -[RetrieveResponse](/src/dopplersdk/models/README.md#retrieveresponse) +[MeResponse](/src/dopplersdk/models/README.md#meresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.activity_logs.retrieve(log = 'LOG_ID') +results = sdk.auth.me() pprint(vars(results)) ``` -### **list** -List +### **get** + +Retrieve + - HTTP Method: GET -- Endpoint: /v3/logs +- Endpoint: /v3/integrations/integration **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| page | str | Optional | Page number | -| per_page | int | Optional | Items per page | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| integration | str | Required | The integration slug | **Return Type** -[ActivityLogsListResponse](/src/dopplersdk/models/README.md#activitylogslistresponse) +[IntegrationsGetResponse](/src/dopplersdk/models/README.md#integrationsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.activity_logs.list( - page = '1', - per_page = 20 -) +results = sdk.integrations.get(integration = 'integration') pprint(vars(results)) ``` +### **delete** -### **update** -Update -- HTTP Method: POST -- Endpoint: /v3/workplace +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/integrations/integration **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [WorkplaceUpdateRequest](/src/dopplersdk/models/README.md#workplaceupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| integration | str | Required | The slug of the integration to delete | **Return Type** -[WorkplaceUpdateResponse](/src/dopplersdk/models/README.md#workplaceupdateresponse) +[IntegrationsDeleteResponse](/src/dopplersdk/models/README.md#integrationsdeleteresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'billing_email': 'billing_email', - 'name': 'name', - 'security_email': 'security_email' -} -results = sdk.workplace.update(request_input = request_body) +results = sdk.integrations.delete(integration = 'integration') pprint(vars(results)) ``` -### **get** -Retrieve -- HTTP Method: GET -- Endpoint: /v3/workplace +### **update** -**Parameters** +Update -This method has no parameters. +- HTTP Method: PUT +- Endpoint: /v3/integrations/integration + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| integration | str | Required | The slug of the integration to update | +| request_input | [IntegrationsUpdateRequest](/src/dopplersdk/models/README.md#integrationsupdaterequest) | Optional | Request body. | **Return Type** -[WorkplaceGetResponse](/src/dopplersdk/models/README.md#workplacegetresponse) +[IntegrationsUpdateResponse](/src/dopplersdk/models/README.md#integrationsupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace.get() +request_body = { + 'data': 'data', + 'name': 'name' +} +results = sdk.integrations.update( + request_input = request_body, + integration = 'integration' +) pprint(vars(results)) ``` - ### **create** + Create + - HTTP Method: POST -- Endpoint: /v3/configs/config/tokens +- Endpoint: /v3/integrations **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ServiceTokensCreateRequest](/src/dopplersdk/models/README.md#servicetokenscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [IntegrationsCreateRequest](/src/dopplersdk/models/README.md#integrationscreaterequest) | Optional | Request body. | **Return Type** -[ServiceTokensCreateResponse](/src/dopplersdk/models/README.md#servicetokenscreateresponse) +[IntegrationsCreateResponse](/src/dopplersdk/models/README.md#integrationscreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'access': 'read', - 'config': 'CONFIG_NAME', - 'expire_at': '1904-01-08T14:23:04.0Z', - 'name': 'TOKEN_NAME', - 'project': 'PROJECT_NAME' + 'data': {}, + 'name': 'name', + 'type_': 'type' } -results = sdk.service_tokens.create(request_input = request_body) +results = sdk.integrations.create(request_input = request_body) pprint(vars(results)) ``` ### **list** + List + - HTTP Method: GET -- Endpoint: /v3/configs/config/tokens +- Endpoint: /v3/integrations **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Unique identifier for the project object. | -| config | str | Required | Name of the config object. | + +This method has no parameters. **Return Type** -[ServiceTokensListResponse](/src/dopplersdk/models/README.md#servicetokenslistresponse) +[IntegrationsListResponse](/src/dopplersdk/models/README.md#integrationslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.service_tokens.list( - project = 'PROJECT_NAME', - config = 'CONFIG_NAME' -) +results = sdk.integrations.list() pprint(vars(results)) ``` -### **delete** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/configs/config/tokens/token +### **create** + +Create + +- HTTP Method: POST +- Endpoint: /v3/configs/config/syncs **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ServiceTokensDeleteRequest](/src/dopplersdk/models/README.md#servicetokensdeleterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project slug | +| config | str | Required | The config slug | +| request_input | [SyncsCreateRequest](/src/dopplersdk/models/README.md#syncscreaterequest) | Optional | Request body. | **Return Type** -[DeleteResponse](/src/dopplersdk/models/README.md#deleteresponse) +[SyncsCreateResponse](/src/dopplersdk/models/README.md#syncscreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'config': 'CONFIG_NAME', - 'project': 'PROJECT_NAME', - 'slug': 'TOKEN_SLUG', - 'token': 'TOKEN_VALUE' + 'await_initial_sync': True, + 'data': {}, + 'import_option': 'none', + 'integration': 'integration' } -results = sdk.service_tokens.delete(request_input = request_body) +results = sdk.syncs.create( + request_input = request_body, + project = 'project', + config = 'config' +) pprint(vars(results)) ``` +### **get** + +Retrieve -### **get_user** -Workplace User - HTTP Method: GET -- Endpoint: /v3/workplace/users/{workplace_user_id} +- Endpoint: /v3/configs/config/syncs/sync **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| workplace_user_id | str | Required | The ID of the workplace user | -| settings | bool | Optional | If true, the api will return more information if the user has e.g. SAML enabled and/or Multi Factor Auth enabled | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project slug | +| config | str | Required | The config slug | +| sync | str | Required | The sync slug | **Return Type** -[GetUserResponse](/src/dopplersdk/models/README.md#getuserresponse) +[SyncsGetResponse](/src/dopplersdk/models/README.md#syncsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.audit.get_user( - workplace_user_id = 'workplace_user_id', - settings = True +results = sdk.syncs.get( + project = 'project', + config = 'config', + sync = 'sync' ) pprint(vars(results)) ``` +### **delete** -### **issue_lease** -Issue Lease -- HTTP Method: POST -- Endpoint: /v3/configs/config/dynamic_secrets/dynamic_secret/leases +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/configs/config/syncs/sync **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [IssueLeaseRequest](/src/dopplersdk/models/README.md#issueleaserequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | The project slug | +| config | str | Required | The config slug | +| sync | str | Required | The sync slug | +| delete_from_target | bool | Required | Whether or not to delete the synced data from the target integration | **Return Type** -[IssueLeaseResponse](/src/dopplersdk/models/README.md#issueleaseresponse) +[SyncsDeleteResponse](/src/dopplersdk/models/README.md#syncsdeleteresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'config': 'config', - 'dynamic_secret': 'dynamic_secret', - 'project': 'project', - 'ttl_sec': -29276405 -} -results = sdk.dynamic_secrets.issue_lease(request_input = request_body) +results = sdk.syncs.delete( + project = 'project', + config = 'config', + sync = 'sync', + delete_from_target = True +) pprint(vars(results)) ``` -### **revoke_lease** -Revoke Lease -- HTTP Method: DELETE -- Endpoint: /v3/configs/config/dynamic_secrets/dynamic_secret/leases/lease +### **create** + +Create + +- HTTP Method: POST +- Endpoint: /v3/workplace/roles **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [RevokeLeaseRequest](/src/dopplersdk/models/README.md#revokeleaserequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [WorkplaceRolesCreateRequest](/src/dopplersdk/models/README.md#workplacerolescreaterequest) | Optional | Request body. | **Return Type** -[RevokeLeaseResponse](/src/dopplersdk/models/README.md#revokeleaseresponse) +[WorkplaceRolesCreateResponse](/src/dopplersdk/models/README.md#workplacerolescreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'config': 'config', - 'dynamic_secret': 'dynamic_secret', - 'project': 'project', - 'slug': 'slug' + 'name': 'name', + 'permissions': ["aliqua do","ullamco Lorem sunt eu"] } -results = sdk.dynamic_secrets.revoke_lease(request_input = request_body) +results = sdk.workplace_roles.create(request_input = request_body) pprint(vars(results)) ``` +### **list** -### **revoke** -Revoke -- HTTP Method: POST -- Endpoint: /v3/auth/revoke +List + +- HTTP Method: GET +- Endpoint: /v3/workplace/roles **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [RevokeRequest](/src/dopplersdk/models/README.md#revokerequest) | Optional | Request body. | + +This method has no parameters. **Return Type** -Returns a dict object. +[WorkplaceRolesListResponse](/src/dopplersdk/models/README.md#workplaceroleslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = {'token': 'token'} -results = sdk.auth.revoke(request_input = request_body) +results = sdk.workplace_roles.list() pprint(vars(results)) ``` -### **me** -Me +### **get** + +Retrieve + - HTTP Method: GET -- Endpoint: /v3/me +- Endpoint: /v3/workplace/roles/role/{role} **Parameters** - -This method has no parameters. +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| role | str | Required | The role's unique identifier | **Return Type** -[MeResponse](/src/dopplersdk/models/README.md#meresponse) +[WorkplaceRolesGetResponse](/src/dopplersdk/models/README.md#workplacerolesgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.auth.me() +results = sdk.workplace_roles.get(role = 'role') pprint(vars(results)) ``` +### **update** -### **create** -Create -- HTTP Method: POST -- Endpoint: /v3/integrations +Update + +- HTTP Method: PATCH +- Endpoint: /v3/workplace/roles/role/{role} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [IntegrationsCreateRequest](/src/dopplersdk/models/README.md#integrationscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| role | str | Required | The role's unique identifier, which is the initial name the role was given | +| request_input | [WorkplaceRolesUpdateRequest](/src/dopplersdk/models/README.md#workplacerolesupdaterequest) | Optional | Request body. | **Return Type** -[IntegrationsCreateResponse](/src/dopplersdk/models/README.md#integrationscreateresponse) +[WorkplaceRolesUpdateResponse](/src/dopplersdk/models/README.md#workplacerolesupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'data': {}, 'name': 'name', - 'type_': 'type' + 'permissions': ["Ut labore sunt in","veniam qui laborum nisi"] } -results = sdk.integrations.create(request_input = request_body) +results = sdk.workplace_roles.update( + request_input = request_body, + role = 'role' +) pprint(vars(results)) ``` -### **list** -List -- HTTP Method: GET -- Endpoint: /v3/integrations +### **delete** -**Parameters** +Delete -This method has no parameters. +- HTTP Method: DELETE +- Endpoint: /v3/workplace/roles/role/{role} + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| role | str | Required | The role's unique identifier | **Return Type** -[IntegrationsListResponse](/src/dopplersdk/models/README.md#integrationslistresponse) +Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.integrations.list() +results = sdk.workplace_roles.delete(role = 'role') pprint(vars(results)) ``` -### **get** -Retrieve +### **list_permissions** + +List Permissions + - HTTP Method: GET -- Endpoint: /v3/integrations/integration +- Endpoint: /v3/workplace/permissions **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| integration | str | Required | The integration slug | + +This method has no parameters. **Return Type** -[IntegrationsGetResponse](/src/dopplersdk/models/README.md#integrationsgetresponse) +[ListPermissionsResponse](/src/dopplersdk/models/README.md#listpermissionsresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.integrations.get(integration = 'integration') +results = sdk.workplace_roles.list_permissions() pprint(vars(results)) ``` -### **delete** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/integrations/integration +### **get** + +Retrieve + +- HTTP Method: GET +- Endpoint: /v3/projects/roles/role/{role} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| integration | str | Required | The slug of the integration to delete | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| role | str | Required | The role's unique identifier | **Return Type** -[IntegrationsDeleteResponse](/src/dopplersdk/models/README.md#integrationsdeleteresponse) +[ProjectRolesGetResponse](/src/dopplersdk/models/README.md#projectrolesgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.integrations.delete(integration = 'integration') +results = sdk.project_roles.get(role = 'role') pprint(vars(results)) ``` ### **update** + Update -- HTTP Method: PUT -- Endpoint: /v3/integrations/integration + +- HTTP Method: PATCH +- Endpoint: /v3/projects/roles/role/{role} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| integration | str | Required | The slug of the integration to update | -| request_input | [IntegrationsUpdateRequest](/src/dopplersdk/models/README.md#integrationsupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| role | str | Required | The role's unique identifier | +| request_input | [ProjectRolesUpdateRequest](/src/dopplersdk/models/README.md#projectrolesupdaterequest) | Optional | Request body. | **Return Type** -[IntegrationsUpdateResponse](/src/dopplersdk/models/README.md#integrationsupdateresponse) +[ProjectRolesUpdateResponse](/src/dopplersdk/models/README.md#projectrolesupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'data': 'data', - 'name': 'name' + 'name': 'name', + 'permissions': ["eiusmod tempor laboris id","dolore proident"] } -results = sdk.integrations.update( +results = sdk.project_roles.update( request_input = request_body, - integration = 'integration' + role = 'role' ) pprint(vars(results)) ``` +### **delete** -### **create** -Create -- HTTP Method: POST -- Endpoint: /v3/configs/config/syncs +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/projects/roles/role/{role} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project slug | -| config | str | Required | The config slug | -| request_input | [SyncsCreateRequest](/src/dopplersdk/models/README.md#syncscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| role | str | Required | The role's unique identifier | **Return Type** -[SyncsCreateResponse](/src/dopplersdk/models/README.md#syncscreateresponse) +Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'data': {}, - 'import_option': 'none', - 'integration': 'integration' -} -results = sdk.syncs.create( - request_input = request_body, - project = 'project', - config = 'config' -) +results = sdk.project_roles.delete(role = 'role') pprint(vars(results)) ``` -### **get** -Retrieve -- HTTP Method: GET -- Endpoint: /v3/configs/config/syncs/sync +### **create** + +Create + +- HTTP Method: POST +- Endpoint: /v3/projects/roles **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project slug | -| config | str | Required | The config slug | -| sync | str | Required | The sync slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ProjectRolesCreateRequest](/src/dopplersdk/models/README.md#projectrolescreaterequest) | Optional | Request body. | **Return Type** -[SyncsGetResponse](/src/dopplersdk/models/README.md#syncsgetresponse) +[ProjectRolesCreateResponse](/src/dopplersdk/models/README.md#projectrolescreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.syncs.get( - project = 'project', - config = 'config', - sync = 'sync' -) +request_body = { + 'name': 'name', + 'permissions': ["velit reprehenderit ipsum","incididunt elit sint qui"] +} +results = sdk.project_roles.create(request_input = request_body) pprint(vars(results)) ``` -### **delete** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/configs/config/syncs/sync +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/projects/roles **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | The project slug | -| config | str | Required | The config slug | -| sync | str | Required | The sync slug | -| delete_from_target | bool | Required | Whether or not to delete the synced data from the target integration | + +This method has no parameters. **Return Type** -[SyncsDeleteResponse](/src/dopplersdk/models/README.md#syncsdeleteresponse) +[ProjectRolesListResponse](/src/dopplersdk/models/README.md#projectroleslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.syncs.delete( - project = 'project', - config = 'config', - sync = 'sync', - delete_from_target = True -) +results = sdk.project_roles.list() pprint(vars(results)) ``` +### **list_permissions** -### **create** -Create -- HTTP Method: POST -- Endpoint: /v3/workplace/roles +List Permissions + +- HTTP Method: GET +- Endpoint: /v3/projects/permissions **Parameters** @@ -1905,579 +2422,680 @@ This method has no parameters. **Return Type** -[WorkplaceRolesCreateResponse](/src/dopplersdk/models/README.md#workplacerolescreateresponse) +[ProjectRolesListPermissionsResponse](/src/dopplersdk/models/README.md#projectroleslistpermissionsresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace_roles.create() +results = sdk.project_roles.list_permissions() pprint(vars(results)) ``` -### **list** -List -- HTTP Method: GET -- Endpoint: /v3/workplace/roles +### **add** -**Parameters** +Add -This method has no parameters. +- HTTP Method: POST +- Endpoint: /v3/projects/project/members + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Project slug | +| request_input | [AddRequest](/src/dopplersdk/models/README.md#addrequest) | Optional | Request body. | **Return Type** -[WorkplaceRolesListResponse](/src/dopplersdk/models/README.md#workplaceroleslistresponse) +[AddResponse](/src/dopplersdk/models/README.md#addresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace_roles.list() +request_body = { + 'environments': ["Excepteur mollit","magna eiusmod sunt enim"], + 'role': 'role', + 'slug': 'slug', + 'type_': 'service_account' +} +results = sdk.project_members.add( + request_input = request_body, + project = 'project' +) pprint(vars(results)) -``` +``` + +### **list** + +List -### **list_permissions** -List Permissions - HTTP Method: GET -- Endpoint: /v3/workplace/permissions +- Endpoint: /v3/projects/project/members **Parameters** - -This method has no parameters. +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Project slug | +| page | int | Optional | | +| per_page | int | Optional | | **Return Type** -[ListPermissionsResponse](/src/dopplersdk/models/README.md#listpermissionsresponse) +[ProjectMembersListResponse](/src/dopplersdk/models/README.md#projectmemberslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace_roles.list_permissions() +results = sdk.project_members.list( + project = 'project', + page = 1, + per_page = 20 +) pprint(vars(results)) ``` ### **get** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/workplace/roles/role/{role} +- Endpoint: /v3/projects/project/members/member/{type}/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| role | str | Required | The role's unique identifier | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Required | Project slug | +| type\_ | [Type](/src/dopplersdk/models/README.md#type) | Required | | +| slug | str | Required | Member's slug | **Return Type** -[WorkplaceRolesGetResponse](/src/dopplersdk/models/README.md#workplacerolesgetresponse) +[ProjectMembersGetResponse](/src/dopplersdk/models/README.md#projectmembersgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace_roles.get(role = 'role') +results = sdk.project_members.get( + project = 'project', + type_ = 'workplace_user', + slug = 'slug' +) pprint(vars(results)) ``` ### **update** + Update + - HTTP Method: PATCH -- Endpoint: /v3/workplace/roles/role/{role} +- Endpoint: /v3/projects/project/members/member/{type}/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| role | str | Required | The role's unique identifier | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| type\_ | [Type](/src/dopplersdk/models/README.md#type) | Required | | +| slug | str | Required | Member's slug | +| project | str | Required | Project slug | +| request_input | [ProjectMembersUpdateRequest](/src/dopplersdk/models/README.md#projectmembersupdaterequest) | Optional | Request body. | **Return Type** -[WorkplaceRolesUpdateResponse](/src/dopplersdk/models/README.md#workplacerolesupdateresponse) +[ProjectMembersUpdateResponse](/src/dopplersdk/models/README.md#projectmembersupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace_roles.update(role = 'role') +request_body = { + 'environments': ["culpa","ut aliquip officia"], + 'role': 'role' +} +results = sdk.project_members.update( + request_input = request_body, + type_ = 'group', + slug = 'slug', + project = 'project' +) pprint(vars(results)) ``` ### **delete** + Delete + - HTTP Method: DELETE -- Endpoint: /v3/workplace/roles/role/{role} +- Endpoint: /v3/projects/project/members/member/{type}/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| role | str | Required | The role's unique identifier | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| type\_ | [Type](/src/dopplersdk/models/README.md#type) | Required | | +| slug | str | Required | Member's slug | +| project | str | Required | Project slug | **Return Type** Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.workplace_roles.delete(role = 'role') +results = sdk.project_members.delete( + type_ = 'service_account', + slug = 'slug', + project = 'project' +) pprint(vars(results)) ``` +### **list** -### **create** -Create -- HTTP Method: POST -- Endpoint: /v3/projects/roles +List -**Parameters** +- HTTP Method: GET +- Endpoint: /v3/workplace/invites -This method has no parameters. +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| page | int | Optional | | +| per_page | int | Optional | | **Return Type** -[ProjectRolesCreateResponse](/src/dopplersdk/models/README.md#projectrolescreateresponse) +[InvitesListResponse](/src/dopplersdk/models/README.md#inviteslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_roles.create() +results = sdk.invites.list( + page = 1, + per_page = 20 +) pprint(vars(results)) ``` -### **list** -List +### **get** + +Retrieve + - HTTP Method: GET -- Endpoint: /v3/projects/roles +- Endpoint: /v3/workplace/service_accounts/service_account/{slug} **Parameters** - -This method has no parameters. +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | Slug of the service account | **Return Type** -[ProjectRolesListResponse](/src/dopplersdk/models/README.md#projectroleslistresponse) +[ServiceAccountsGetResponse](/src/dopplersdk/models/README.md#serviceaccountsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_roles.list() +results = sdk.service_accounts.get(slug = 'slug') pprint(vars(results)) ``` -### **get** -Retrieve -- HTTP Method: GET -- Endpoint: /v3/projects/roles/role/{role} +### **update** + +Update + +- HTTP Method: PATCH +- Endpoint: /v3/workplace/service_accounts/service_account/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| role | str | Required | The role's unique identifier | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | Slug of the service account | +| request_input | [ServiceAccountsUpdateRequest](/src/dopplersdk/models/README.md#serviceaccountsupdaterequest) | Optional | Request body. | **Return Type** -[ProjectRolesGetResponse](/src/dopplersdk/models/README.md#projectrolesgetresponse) +[ServiceAccountsUpdateResponse](/src/dopplersdk/models/README.md#serviceaccountsupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_roles.get(role = 'role') +request_body = { + 'name': 'name', + 'workplace_role': {"identifier":"identifier","permissions":["nulla","dolore"]} +} +results = sdk.service_accounts.update( + request_input = request_body, + slug = 'slug' +) pprint(vars(results)) ``` -### **update** -Update -- HTTP Method: PATCH -- Endpoint: /v3/projects/roles/role/{role} +### **delete** + +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/workplace/service_accounts/service_account/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| role | str | Required | The role's unique identifier | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | Slug of the service account | **Return Type** -[ProjectRolesUpdateResponse](/src/dopplersdk/models/README.md#projectrolesupdateresponse) +Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_roles.update(role = 'role') +results = sdk.service_accounts.delete(slug = 'slug') pprint(vars(results)) ``` -### **delete** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/projects/roles/role/{role} +### **create** + +Create + +- HTTP Method: POST +- Endpoint: /v3/workplace/service_accounts **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| role | str | Required | The role's unique identifier | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [ServiceAccountsCreateRequest](/src/dopplersdk/models/README.md#serviceaccountscreaterequest) | Optional | Request body. | **Return Type** -Returns a dict object. +[ServiceAccountsCreateResponse](/src/dopplersdk/models/README.md#serviceaccountscreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_roles.delete(role = 'role') +request_body = { + 'name': 'name', + 'workplace_role': {"identifier":"identifier","permissions":["consectetur voluptate","ipsum cupidatat est qui"]} +} +results = sdk.service_accounts.create(request_input = request_body) pprint(vars(results)) ``` -### **list_permissions** -List Permissions +### **list** + +List + - HTTP Method: GET -- Endpoint: /v3/projects/permissions +- Endpoint: /v3/workplace/service_accounts **Parameters** - -This method has no parameters. +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| page | int | Optional | | +| per_page | int | Optional | | **Return Type** -[ProjectRolesListPermissionsResponse](/src/dopplersdk/models/README.md#projectroleslistpermissionsresponse) +[ServiceAccountsListResponse](/src/dopplersdk/models/README.md#serviceaccountslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_roles.list_permissions() +results = sdk.service_accounts.list( + page = 1, + per_page = 20 +) pprint(vars(results)) ``` +### **get** -### **add** -Add -- HTTP Method: POST -- Endpoint: /v3/projects/project/members +Retrieve + +- HTTP Method: GET +- Endpoint: /v3/workplace/groups/group/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Project slug | -| request_input | [AddRequest](/src/dopplersdk/models/README.md#addrequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | The group's slug | **Return Type** -[AddResponse](/src/dopplersdk/models/README.md#addresponse) +[GroupsGetResponse](/src/dopplersdk/models/README.md#groupsgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'environments': ["ad","Lorem do sit in"], - 'role': 'role', - 'slug': 'slug', - 'type_': 'group' -} -results = sdk.project_members.add( - request_input = request_body, - project = 'project' -) +results = sdk.groups.get(slug = 'slug') pprint(vars(results)) ``` -### **list** -List -- HTTP Method: GET -- Endpoint: /v3/projects/project/members +### **update** + +Update + +- HTTP Method: PATCH +- Endpoint: /v3/workplace/groups/group/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Project slug | -| page | int | Optional | | -| per_page | int | Optional | | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | The group's slug | +| request_input | [GroupsUpdateRequest](/src/dopplersdk/models/README.md#groupsupdaterequest) | Optional | Request body. | **Return Type** -[ProjectMembersListResponse](/src/dopplersdk/models/README.md#projectmemberslistresponse) +[GroupsUpdateResponse](/src/dopplersdk/models/README.md#groupsupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_members.list( - project = 'project', - page = 1, - per_page = 20 +request_body = { + 'default_project_role': 'default_project_role', + 'name': 'name' +} +results = sdk.groups.update( + request_input = request_body, + slug = 'slug' ) pprint(vars(results)) ``` -### **get** -Retrieve -- HTTP Method: GET -- Endpoint: /v3/projects/project/members/member/{type}/{slug} +### **delete** + +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/workplace/groups/group/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| project | str | Required | Project slug | -| type | [Type](/src/dopplersdk/models/README.md#type) | Required | | -| slug | str | Required | Member's slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | The group's slug | **Return Type** -[ProjectMembersGetResponse](/src/dopplersdk/models/README.md#projectmembersgetresponse) +Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_members.get( - project = 'project', - type = 'service_account', - slug = 'slug' -) +results = sdk.groups.delete(slug = 'slug') pprint(vars(results)) ``` -### **update** -Update -- HTTP Method: PATCH -- Endpoint: /v3/projects/project/members/member/{type}/{slug} +### **create** + +Create + +- HTTP Method: POST +- Endpoint: /v3/workplace/groups **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| type | [Type](/src/dopplersdk/models/README.md#type) | Required | | -| slug | str | Required | Member's slug | -| project | str | Required | Project slug | -| request_input | [ProjectMembersUpdateRequest](/src/dopplersdk/models/README.md#projectmembersupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| request_input | [GroupsCreateRequest](/src/dopplersdk/models/README.md#groupscreaterequest) | Optional | Request body. | **Return Type** -[ProjectMembersUpdateResponse](/src/dopplersdk/models/README.md#projectmembersupdateresponse) +[GroupsCreateResponse](/src/dopplersdk/models/README.md#groupscreateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'environments': ["cillum ut exercitation","Excepteur incididunt"], - 'role': 'role' + 'default_project_role': 'default_project_role', + 'name': 'name' } -results = sdk.project_members.update( - request_input = request_body, - type = 'group', - slug = 'slug', - project = 'project' -) +results = sdk.groups.create(request_input = request_body) pprint(vars(results)) ``` -### **delete** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/projects/project/members/member/{type}/{slug} +### **list** + +List + +- HTTP Method: GET +- Endpoint: /v3/workplace/groups **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| type | [Type](/src/dopplersdk/models/README.md#type) | Required | | -| slug | str | Required | Member's slug | -| project | str | Required | Project slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| page | int | Optional | | +| per_page | int | Optional | | **Return Type** -Returns a dict object. +[GroupsListResponse](/src/dopplersdk/models/README.md#groupslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.project_members.delete( - type = 'workplace_user', - slug = 'slug', - project = 'project' +results = sdk.groups.list( + page = 1, + per_page = 20 ) pprint(vars(results)) ``` +### **delete_member** -### **list** -List -- HTTP Method: GET -- Endpoint: /v3/workplace/invites +Delete Member + +- HTTP Method: DELETE +- Endpoint: /v3/workplace/groups/group/{slug}/members/{type}/{member_slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| page | int | Optional | | -| per_page | int | Optional | | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | The group's slug | +| type\_ | [GroupsType](/src/dopplersdk/models/README.md#groupstype) | Required | | +| member_slug | str | Required | The member's slug | **Return Type** -[InvitesListResponse](/src/dopplersdk/models/README.md#inviteslistresponse) +Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.invites.list( - page = 1, - per_page = 20 +results = sdk.groups.delete_member( + slug = 'slug', + type_ = 'workplace_user', + member_slug = 'member_slug' ) pprint(vars(results)) ``` +### **add_member** + +Add Member -### **create** -Create - HTTP Method: POST -- Endpoint: /v3/workplace/service_accounts +- Endpoint: /v3/workplace/groups/group/{slug}/members **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [ServiceAccountsCreateRequest](/src/dopplersdk/models/README.md#serviceaccountscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | The group's slug | +| request_input | [AddMemberRequest](/src/dopplersdk/models/README.md#addmemberrequest) | Optional | Request body. | **Return Type** -[ServiceAccountsCreateResponse](/src/dopplersdk/models/README.md#serviceaccountscreateresponse) +Returns a dict object. **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) request_body = { - 'name': 'name', - 'workplace_role': {"identifier":"identifier","permissions":["Excepteur dolore nisi tempor","tempor aliquip"]} + 'slug': 'slug', + 'type_': 'workplace_user' } -results = sdk.service_accounts.create(request_input = request_body) +results = sdk.groups.add_member( + request_input = request_body, + slug = 'slug' +) pprint(vars(results)) ``` ### **list** + List + - HTTP Method: GET -- Endpoint: /v3/workplace/service_accounts +- Endpoint: /v3/workplace/users **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| page | int | Optional | | -| per_page | int | Optional | | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| page | int | Optional | The page of users to fetch | +| email | str | Optional | Filter results to only include the user with the provided email address | **Return Type** -[ServiceAccountsListResponse](/src/dopplersdk/models/README.md#serviceaccountslistresponse) +[UsersListResponse](/src/dopplersdk/models/README.md#userslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.service_accounts.list( +results = sdk.users.list( page = 1, - per_page = 20 + email = 'email' ) pprint(vars(results)) @@ -2485,213 +3103,231 @@ pprint(vars(results)) ``` ### **get** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/workplace/service_accounts/service_account/{slug} +- Endpoint: /v3/workplace/users/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | Slug of the service account | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | The slug of the workplace user | **Return Type** -[ServiceAccountsGetResponse](/src/dopplersdk/models/README.md#serviceaccountsgetresponse) +[UsersGetResponse](/src/dopplersdk/models/README.md#usersgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.service_accounts.get(slug = 'slug') +results = sdk.users.get(slug = 'slug') pprint(vars(results)) ``` -### **update** -Update -- HTTP Method: PATCH -- Endpoint: /v3/workplace/service_accounts/service_account/{slug} +### **options** + +Get Options + +- HTTP Method: GET +- Endpoint: /v3/integrations/integration/options **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | Slug of the service account | -| request_input | [ServiceAccountsUpdateRequest](/src/dopplersdk/models/README.md#serviceaccountsupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| integration | str | Required | The integration slug | **Return Type** -[ServiceAccountsUpdateResponse](/src/dopplersdk/models/README.md#serviceaccountsupdateresponse) +[OptionsResponse](/src/dopplersdk/models/README.md#optionsresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'name': 'name', - 'workplace_role': {"identifier":"identifier","permissions":["ipsum id reprehenderit ut","sint anim Excepteur eu sit"]} -} -results = sdk.service_accounts.update( - request_input = request_body, - slug = 'slug' -) +results = sdk.get.options(integration = 'integration') pprint(vars(results)) ``` -### **delete** -Delete -- HTTP Method: DELETE -- Endpoint: /v3/workplace/service_accounts/service_account/{slug} +### **member** + +Retrieve Member + +- HTTP Method: GET +- Endpoint: /v3/workplace/groups/group/{group_slug}/members/{member_type}/{member_slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | Slug of the service account | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| group_slug | str | Required | The group's slug | +| member_type | [MemberType](/src/dopplersdk/models/README.md#membertype) | Required | | +| member_slug | str | Required | The member's slug | **Return Type** -Returns a dict object. +[MemberResponse](/src/dopplersdk/models/README.md#memberresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.service_accounts.delete(slug = 'slug') +results = sdk.retrieve.member( + group_slug = 'group_slug', + member_type = 'workplace_user', + member_slug = 'member_slug' +) pprint(vars(results)) ``` +### **add** + +Add -### **create** -Create - HTTP Method: POST -- Endpoint: /v3/workplace/groups +- Endpoint: /v3/webhooks **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| request_input | [GroupsCreateRequest](/src/dopplersdk/models/README.md#groupscreaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Optional | The project's name | +| request_input | [WebhooksAddRequest](/src/dopplersdk/models/README.md#webhooksaddrequest) | Optional | Request body. | **Return Type** -[GroupsCreateResponse](/src/dopplersdk/models/README.md#groupscreateresponse) +[WebhooksAddResponse](/src/dopplersdk/models/README.md#webhooksaddresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'default_project_role': 'default_project_role', - 'name': 'name' -} -results = sdk.groups.create(request_input = request_body) +request_body = {} +results = sdk.webhooks.add( + request_input = request_body, + project = 'project' +) pprint(vars(results)) ``` ### **list** + List + - HTTP Method: GET -- Endpoint: /v3/workplace/groups +- Endpoint: /v3/webhooks **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| page | int | Optional | | -| per_page | int | Optional | | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Optional | The project's name | **Return Type** -[GroupsListResponse](/src/dopplersdk/models/README.md#groupslistresponse) +[WebhooksListResponse](/src/dopplersdk/models/README.md#webhookslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.groups.list( - page = 1, - per_page = 20 -) +results = sdk.webhooks.list(project = 'project') pprint(vars(results)) ``` ### **get** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/workplace/groups/group/{slug} +- Endpoint: /v3/webhooks/webhook/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | The group's slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| slug | str | Required | Webhook's slug | +| project | str | Optional | The project's name | **Return Type** -[GroupsGetResponse](/src/dopplersdk/models/README.md#groupsgetresponse) +[WebhooksGetResponse](/src/dopplersdk/models/README.md#webhooksgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.groups.get(slug = 'slug') +results = sdk.webhooks.get( + slug = 'slug', + project = 'project' +) pprint(vars(results)) ``` ### **update** + Update + - HTTP Method: PATCH -- Endpoint: /v3/workplace/groups/group/{slug} +- Endpoint: /v3/webhooks/webhook/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | The group's slug | -| request_input | [GroupsUpdateRequest](/src/dopplersdk/models/README.md#groupsupdaterequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Optional | The project's name | +| slug | str | Required | Webhook's slug | +| request_input | [WebhooksUpdateRequest](/src/dopplersdk/models/README.md#webhooksupdaterequest) | Optional | Request body. | **Return Type** -[GroupsUpdateResponse](/src/dopplersdk/models/README.md#groupsupdateresponse) +[WebhooksUpdateResponse](/src/dopplersdk/models/README.md#webhooksupdateresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'default_project_role': 'default_project_role', - 'name': 'name' -} -results = sdk.groups.update( +request_body = {} +results = sdk.webhooks.update( request_input = request_body, - slug = 'slug' + slug = 'slug', + project = 'project' ) pprint(vars(results)) @@ -2699,155 +3335,245 @@ pprint(vars(results)) ``` ### **delete** + Delete + - HTTP Method: DELETE -- Endpoint: /v3/workplace/groups/group/{slug} +- Endpoint: /v3/webhooks/webhook/{slug} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | The group's slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Optional | The project's name | +| slug | str | Required | Webhook's slug | **Return Type** -Returns a dict object. +[WebhooksDeleteResponse](/src/dopplersdk/models/README.md#webhooksdeleteresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.groups.delete(slug = 'slug') +results = sdk.webhooks.delete( + slug = 'slug', + project = 'project' +) pprint(vars(results)) ``` -### **add_member** -Add Member +### **enable** + +Enable + - HTTP Method: POST -- Endpoint: /v3/workplace/groups/group/{slug}/members +- Endpoint: /v3/webhooks/webhook/{slug}/enable **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | The group's slug | -| request_input | [AddMemberRequest](/src/dopplersdk/models/README.md#addmemberrequest) | Optional | Request body. | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Optional | The project's name | +| slug | str | Required | Webhook's slug | **Return Type** -Returns a dict object. +[EnableResponse](/src/dopplersdk/models/README.md#enableresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -request_body = { - 'slug': 'slug', - 'type_': 'workplace_user' -} -results = sdk.groups.add_member( - request_input = request_body, - slug = 'slug' +results = sdk.webhooks.enable( + slug = 'slug', + project = 'project' ) pprint(vars(results)) ``` -### **delete_member** -Delete Member -- HTTP Method: DELETE -- Endpoint: /v3/workplace/groups/group/{slug}/members/{type}/{member_slug} +### **disable** + +Disable + +- HTTP Method: POST +- Endpoint: /v3/webhooks/webhook/{slug}/disable **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | The group's slug | -| type | [GroupsType](/src/dopplersdk/models/README.md#groupstype) | Required | | -| member_slug | str | Required | The member's slug | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| project | str | Optional | The project's name | +| slug | str | Required | Webhook's slug | **Return Type** -Returns a dict object. +[DisableResponse](/src/dopplersdk/models/README.md#disableresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.groups.delete_member( +results = sdk.webhooks.disable( slug = 'slug', - type = 'workplace_user', - member_slug = 'member_slug' + project = 'project' ) pprint(vars(results)) ``` +### **create** + +Create + +- HTTP Method: POST +- Endpoint: /v3/workplace/service_accounts/service_account/{service_account}/tokens + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| service_account | str | Required | Slug of the service account | +| request_input | [ServiceAccountTokensCreateRequest](/src/dopplersdk/models/README.md#serviceaccounttokenscreaterequest) | Optional | Request body. | + +**Return Type** + +[ServiceAccountTokensCreateResponse](/src/dopplersdk/models/README.md#serviceaccounttokenscreateresponse) + +**Example Usage Code Snippet** + +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +request_body = { + 'expires_at': '1920-11-18T08:18:44.0Z', + 'name': 'name' +} +results = sdk.service_account_tokens.create( + request_input = request_body, + service_account = 'service_account' +) + +pprint(vars(results)) + +``` ### **list** + List + - HTTP Method: GET -- Endpoint: /v3/workplace/users +- Endpoint: /v3/workplace/service_accounts/service_account/{service_account}/tokens **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| page | int | Optional | The page of users to fetch | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| page | int | Optional | | +| per_page | int | Optional | | +| service_account | str | Required | Slug of the service account | **Return Type** -[UsersListResponse](/src/dopplersdk/models/README.md#userslistresponse) +[ServiceAccountTokensListResponse](/src/dopplersdk/models/README.md#serviceaccounttokenslistresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.users.list(page = 1) +results = sdk.service_account_tokens.list( + service_account = 'service_account', + page = 1, + per_page = 20 +) pprint(vars(results)) ``` ### **get** + Retrieve + - HTTP Method: GET -- Endpoint: /v3/workplace/users/{slug} +- Endpoint: /v3/workplace/service_accounts/service_account/{service_account}/tokens/token/{api_token} **Parameters** -| Name | Type| Required | Description | -| :-------- | :----------| :----------| :----------| -| slug | str | Required | The slug of the workplace user | +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| service_account | str | Required | Slug of the service account | +| api_token | str | Required | Slug of the API token | **Return Type** -[UsersGetResponse](/src/dopplersdk/models/README.md#usersgetresponse) +[ServiceAccountTokensGetResponse](/src/dopplersdk/models/README.md#serviceaccounttokensgetresponse) **Example Usage Code Snippet** + ```Python from pprint import pprint from dopplersdk import DopplerSDK -DOPPLERSDK_ACCESS_TOKEN = '' +DOPPLERSDK_ACCESS_TOKEN = '' sdk = DopplerSDK() sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) -results = sdk.users.get(slug = 'slug') +results = sdk.service_account_tokens.get( + service_account = 'service_account', + api_token = 'api_token' +) pprint(vars(results)) ``` +### **delete** + +Delete + +- HTTP Method: DELETE +- Endpoint: /v3/workplace/service_accounts/service_account/{service_account}/tokens/token/{api_token} + +**Parameters** +| Name | Type| Required | Description | +| :-------- | :----------| :----------| :----------| +| service_account | str | Required | Slug of the service account | +| api_token | str | Required | Slug of the API token | + +**Return Type** + +Returns a dict object. + +**Example Usage Code Snippet** +```Python +from pprint import pprint +from dopplersdk import DopplerSDK +DOPPLERSDK_ACCESS_TOKEN = '' +sdk = DopplerSDK() +sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN) +results = sdk.service_account_tokens.delete( + service_account = 'service_account', + api_token = 'api_token' +) +pprint(vars(results)) +``` diff --git a/src/dopplersdk/services/activity_logs.py b/src/dopplersdk/services/activity_logs.py index 0362222..d3ac697 100644 --- a/src/dopplersdk/services/activity_logs.py +++ b/src/dopplersdk/services/activity_logs.py @@ -1,35 +1,13 @@ from urllib.parse import quote from ..net import query_serializer from .base import BaseService -from ..models.RetrieveResponse import RetrieveResponse as RetrieveResponseModel from ..models.ActivityLogsListResponse import ( ActivityLogsListResponse as ActivityLogsListResponseModel, ) +from ..models.RetrieveResponse import RetrieveResponse as RetrieveResponseModel class ActivityLogs(BaseService): - def retrieve(self, log: str) -> RetrieveResponseModel: - """ - Retrieve - Parameters: - ---------- - log: str - Unique identifier for the log object. - """ - - url_endpoint = "/v3/logs/log" - headers = {} - query_params = [] - self._add_required_headers(headers) - if not log: - raise ValueError("Parameter log is required, cannot be empty or blank.") - query_params.append(query_serializer.serialize_query("form", False, "log", log)) - final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) - res = self._http.get(final_url, headers, True) - if res and isinstance(res, dict): - return RetrieveResponseModel(**res) - return res - def list( self, page: str = None, per_page: int = None ) -> ActivityLogsListResponseModel: @@ -62,3 +40,25 @@ def list( if res and isinstance(res, dict): return ActivityLogsListResponseModel(**res) return res + + def retrieve(self, log: str) -> RetrieveResponseModel: + """ + Retrieve + Parameters: + ---------- + log: str + Unique identifier for the log object. + """ + + url_endpoint = "/v3/logs/log" + headers = {} + query_params = [] + self._add_required_headers(headers) + if not log: + raise ValueError("Parameter log is required, cannot be empty or blank.") + query_params.append(query_serializer.serialize_query("form", False, "log", log)) + final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return RetrieveResponseModel(**res) + return res diff --git a/src/dopplersdk/services/auth.py b/src/dopplersdk/services/auth.py index af301a2..bd613c4 100644 --- a/src/dopplersdk/services/auth.py +++ b/src/dopplersdk/services/auth.py @@ -12,7 +12,7 @@ def revoke(self, request_input: RevokeRequestModel = None): """ url_endpoint = "/v3/auth/revoke" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint diff --git a/src/dopplersdk/services/base.py b/src/dopplersdk/services/base.py index ae21686..bc9f562 100644 --- a/src/dopplersdk/services/base.py +++ b/src/dopplersdk/services/base.py @@ -5,6 +5,8 @@ Class: BaseService """ + +import platform from typing import List, Union from enum import Enum import re @@ -93,6 +95,6 @@ def _add_required_headers(self, headers: dict): headers: dict Headers dict to add auth headers to """ - headers["User-Agent"] = "liblab/0.1.20 DopplerSDK/1.2.1 python/2.7" + headers["User-Agent"] = f"DopplerSDK/1.3.0 Python/{platform.python_version()}" headers["Authorization"] = f"Bearer {self._access_token}" return headers diff --git a/src/dopplersdk/services/config_logs.py b/src/dopplersdk/services/config_logs.py index 03ff4b8..fa20869 100644 --- a/src/dopplersdk/services/config_logs.py +++ b/src/dopplersdk/services/config_logs.py @@ -1,32 +1,30 @@ from urllib.parse import quote from ..net import query_serializer from .base import BaseService +from ..models.ConfigLogsGetResponse import ( + ConfigLogsGetResponse as ConfigLogsGetResponseModel, +) from ..models.ConfigLogsListResponse import ( ConfigLogsListResponse as ConfigLogsListResponseModel, ) -from ..models.GetResponse import GetResponse as GetResponseModel from ..models.RollbackResponse import RollbackResponse as RollbackResponseModel class ConfigLogs(BaseService): - def list( - self, config: str, project: str, page: int = None, per_page: int = None - ) -> ConfigLogsListResponseModel: + def get(self, log: str, config: str, project: str) -> ConfigLogsGetResponseModel: """ - List + Retrieve Parameters: ---------- project: str Unique identifier for the project object. config: str Name of the config object. - page: int - Page number - per_page: int - Items per page + log: str + Unique identifier for the log object. """ - url_endpoint = "/v3/configs/config/logs" + url_endpoint = "/v3/configs/config/logs/log" headers = {} query_params = [] self._add_required_headers(headers) @@ -40,34 +38,33 @@ def list( query_params.append( query_serializer.serialize_query("form", False, "config", config) ) - if page: - query_params.append( - query_serializer.serialize_query("form", False, "page", page) - ) - if per_page: - query_params.append( - query_serializer.serialize_query("form", False, "per_page", per_page) - ) + if not log: + raise ValueError("Parameter log is required, cannot be empty or blank.") + query_params.append(query_serializer.serialize_query("form", False, "log", log)) final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) res = self._http.get(final_url, headers, True) if res and isinstance(res, dict): - return ConfigLogsListResponseModel(**res) + return ConfigLogsGetResponseModel(**res) return res - def get(self, log: str, config: str, project: str) -> GetResponseModel: + def list( + self, config: str, project: str, page: int = None, per_page: int = None + ) -> ConfigLogsListResponseModel: """ - Retrieve + List Parameters: ---------- project: str Unique identifier for the project object. config: str Name of the config object. - log: str - Unique identifier for the log object. + page: int + Page number + per_page: int + Items per page """ - url_endpoint = "/v3/configs/config/logs/log" + url_endpoint = "/v3/configs/config/logs" headers = {} query_params = [] self._add_required_headers(headers) @@ -81,13 +78,18 @@ def get(self, log: str, config: str, project: str) -> GetResponseModel: query_params.append( query_serializer.serialize_query("form", False, "config", config) ) - if not log: - raise ValueError("Parameter log is required, cannot be empty or blank.") - query_params.append(query_serializer.serialize_query("form", False, "log", log)) + if page: + query_params.append( + query_serializer.serialize_query("form", False, "page", page) + ) + if per_page: + query_params.append( + query_serializer.serialize_query("form", False, "per_page", per_page) + ) final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) res = self._http.get(final_url, headers, True) if res and isinstance(res, dict): - return GetResponseModel(**res) + return ConfigLogsListResponseModel(**res) return res def rollback(self, log: str, config: str, project: str) -> RollbackResponseModel: diff --git a/src/dopplersdk/services/configs.py b/src/dopplersdk/services/configs.py index ab7913a..c7de9d4 100644 --- a/src/dopplersdk/services/configs.py +++ b/src/dopplersdk/services/configs.py @@ -1,13 +1,6 @@ from urllib.parse import quote from ..net import query_serializer from .base import BaseService -from ..models.ConfigsListResponse import ConfigsListResponse as ConfigsListResponseModel -from ..models.ConfigsCreateRequest import ( - ConfigsCreateRequest as ConfigsCreateRequestModel, -) -from ..models.ConfigsCreateResponse import ( - ConfigsCreateResponse as ConfigsCreateResponseModel, -) from ..models.ConfigsGetResponse import ConfigsGetResponse as ConfigsGetResponseModel from ..models.ConfigsUpdateRequest import ( ConfigsUpdateRequest as ConfigsUpdateRequestModel, @@ -19,12 +12,19 @@ ConfigsDeleteRequest as ConfigsDeleteRequestModel, ) from ..models.DeleteResponse import DeleteResponse as DeleteResponseModel +from ..models.ConfigsListResponse import ConfigsListResponse as ConfigsListResponseModel +from ..models.ConfigsCreateRequest import ( + ConfigsCreateRequest as ConfigsCreateRequestModel, +) +from ..models.ConfigsCreateResponse import ( + ConfigsCreateResponse as ConfigsCreateResponseModel, +) +from ..models.UnlockRequest import UnlockRequest as UnlockRequestModel +from ..models.UnlockResponse import UnlockResponse as UnlockResponseModel from ..models.CloneRequest import CloneRequest as CloneRequestModel from ..models.CloneResponse import CloneResponse as CloneResponseModel from ..models.LockRequest import LockRequest as LockRequestModel from ..models.LockResponse import LockResponse as LockResponseModel -from ..models.UnlockRequest import UnlockRequest as UnlockRequestModel -from ..models.UnlockResponse import UnlockResponse as UnlockResponseModel from ..models.ListTrustedIpsResponse import ( ListTrustedIpsResponse as ListTrustedIpsResponseModel, ) @@ -38,6 +38,71 @@ class Configs(BaseService): + def get(self, config: str, project: str) -> ConfigsGetResponseModel: + """ + Retrieve + Parameters: + ---------- + project: str + Unique identifier for the project object. + config: str + Name of the config object. + """ + + url_endpoint = "/v3/configs/config" + headers = {} + query_params = [] + self._add_required_headers(headers) + if not project: + raise ValueError("Parameter project is required, cannot be empty or blank.") + query_params.append( + query_serializer.serialize_query("form", False, "project", project) + ) + if not config: + raise ValueError("Parameter config is required, cannot be empty or blank.") + query_params.append( + query_serializer.serialize_query("form", False, "config", config) + ) + final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return ConfigsGetResponseModel(**res) + return res + + def update( + self, request_input: ConfigsUpdateRequestModel = None + ) -> ConfigsUpdateResponseModel: + """ + Update + """ + + url_endpoint = "/v3/configs/config" + headers = {"Content-Type": "application/json"} + self._add_required_headers(headers) + + final_url = self._url_prefix + url_endpoint + res = self._http.post(final_url, headers, request_input, True) + if res and isinstance(res, dict): + return ConfigsUpdateResponseModel(**res) + return res + + def delete( + self, request_input: ConfigsDeleteRequestModel = None + ) -> DeleteResponseModel: + """ + Delete + """ + + url_endpoint = "/v3/configs/config" + headers = {"Content-Type": "application/json"} + self._add_required_headers(headers) + + final_url = self._url_prefix + url_endpoint + res = self._http.delete(final_url, headers, True) + if res and isinstance(res, dict): + return DeleteResponseModel(**res) + return res + def list( self, project: str, @@ -96,7 +161,7 @@ def create( """ url_endpoint = "/v3/configs" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint @@ -105,69 +170,19 @@ def create( return ConfigsCreateResponseModel(**res) return res - def get(self, config: str, project: str) -> ConfigsGetResponseModel: - """ - Retrieve - Parameters: - ---------- - project: str - Unique identifier for the project object. - config: str - Name of the config object. - """ - - url_endpoint = "/v3/configs/config" - headers = {} - query_params = [] - self._add_required_headers(headers) - if not project: - raise ValueError("Parameter project is required, cannot be empty or blank.") - query_params.append( - query_serializer.serialize_query("form", False, "project", project) - ) - if not config: - raise ValueError("Parameter config is required, cannot be empty or blank.") - query_params.append( - query_serializer.serialize_query("form", False, "config", config) - ) - final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) - res = self._http.get(final_url, headers, True) - if res and isinstance(res, dict): - return ConfigsGetResponseModel(**res) - return res - - def update( - self, request_input: ConfigsUpdateRequestModel = None - ) -> ConfigsUpdateResponseModel: + def unlock(self, request_input: UnlockRequestModel = None) -> UnlockResponseModel: """ - Update + Unlock """ - url_endpoint = "/v3/configs/config" - headers = {"Content-type": "application/json"} + url_endpoint = "/v3/configs/config/unlock" + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint res = self._http.post(final_url, headers, request_input, True) if res and isinstance(res, dict): - return ConfigsUpdateResponseModel(**res) - return res - - def delete( - self, request_input: ConfigsDeleteRequestModel = None - ) -> DeleteResponseModel: - """ - Delete - """ - - url_endpoint = "/v3/configs/config" - headers = {"Content-type": "application/json"} - self._add_required_headers(headers) - - final_url = self._url_prefix + url_endpoint - res = self._http.delete(final_url, headers, True) - if res and isinstance(res, dict): - return DeleteResponseModel(**res) + return UnlockResponseModel(**res) return res def clone(self, request_input: CloneRequestModel = None) -> CloneResponseModel: @@ -176,7 +191,7 @@ def clone(self, request_input: CloneRequestModel = None) -> CloneResponseModel: """ url_endpoint = "/v3/configs/config/clone" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint @@ -191,7 +206,7 @@ def lock(self, request_input: LockRequestModel = None) -> LockResponseModel: """ url_endpoint = "/v3/configs/config/lock" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint @@ -200,21 +215,6 @@ def lock(self, request_input: LockRequestModel = None) -> LockResponseModel: return LockResponseModel(**res) return res - def unlock(self, request_input: UnlockRequestModel = None) -> UnlockResponseModel: - """ - Unlock - """ - - url_endpoint = "/v3/configs/config/unlock" - headers = {"Content-type": "application/json"} - self._add_required_headers(headers) - - final_url = self._url_prefix + url_endpoint - res = self._http.post(final_url, headers, request_input, True) - if res and isinstance(res, dict): - return UnlockResponseModel(**res) - return res - def list_trusted_ips( self, config: str, project: str ) -> ListTrustedIpsResponseModel: @@ -258,7 +258,7 @@ def add_trusted_ip( """ url_endpoint = "/v3/configs/config/trusted_ips" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} query_params = [] self._add_required_headers(headers) if not project: @@ -292,7 +292,7 @@ def delete_trusted_ip( """ url_endpoint = "/v3/configs/config/trusted_ips" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} query_params = [] self._add_required_headers(headers) if not project: diff --git a/src/dopplersdk/services/dynamic_secrets.py b/src/dopplersdk/services/dynamic_secrets.py index 2fb5e6e..029336e 100644 --- a/src/dopplersdk/services/dynamic_secrets.py +++ b/src/dopplersdk/services/dynamic_secrets.py @@ -1,43 +1,43 @@ from urllib.parse import quote from .base import BaseService -from ..models.IssueLeaseRequest import IssueLeaseRequest as IssueLeaseRequestModel -from ..models.IssueLeaseResponse import IssueLeaseResponse as IssueLeaseResponseModel from ..models.RevokeLeaseRequest import RevokeLeaseRequest as RevokeLeaseRequestModel from ..models.RevokeLeaseResponse import RevokeLeaseResponse as RevokeLeaseResponseModel +from ..models.IssueLeaseRequest import IssueLeaseRequest as IssueLeaseRequestModel +from ..models.IssueLeaseResponse import IssueLeaseResponse as IssueLeaseResponseModel class DynamicSecrets(BaseService): - def issue_lease( - self, request_input: IssueLeaseRequestModel = None - ) -> IssueLeaseResponseModel: + def revoke_lease( + self, request_input: RevokeLeaseRequestModel = None + ) -> RevokeLeaseResponseModel: """ - Issue Lease + Revoke Lease """ - url_endpoint = "/v3/configs/config/dynamic_secrets/dynamic_secret/leases" - headers = {"Content-type": "application/json"} + url_endpoint = "/v3/configs/config/dynamic_secrets/dynamic_secret/leases/lease" + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint - res = self._http.post(final_url, headers, request_input, True) + res = self._http.delete(final_url, headers, True) if res and isinstance(res, dict): - return IssueLeaseResponseModel(**res) + return RevokeLeaseResponseModel(**res) return res - def revoke_lease( - self, request_input: RevokeLeaseRequestModel = None - ) -> RevokeLeaseResponseModel: + def issue_lease( + self, request_input: IssueLeaseRequestModel = None + ) -> IssueLeaseResponseModel: """ - Revoke Lease + Issue Lease """ - url_endpoint = "/v3/configs/config/dynamic_secrets/dynamic_secret/leases/lease" - headers = {"Content-type": "application/json"} + url_endpoint = "/v3/configs/config/dynamic_secrets/dynamic_secret/leases" + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint - res = self._http.delete(final_url, headers, True) + res = self._http.post(final_url, headers, request_input, True) if res and isinstance(res, dict): - return RevokeLeaseResponseModel(**res) + return IssueLeaseResponseModel(**res) return res diff --git a/src/dopplersdk/services/environments.py b/src/dopplersdk/services/environments.py index 83b91ab..f71bc67 100644 --- a/src/dopplersdk/services/environments.py +++ b/src/dopplersdk/services/environments.py @@ -1,11 +1,6 @@ from urllib.parse import quote from ..net import query_serializer from .base import BaseService -from ..models.EnvironmentsGetResponse import ( - EnvironmentsGetResponse as EnvironmentsGetResponseModel, -) -from ..models.RenameRequest import RenameRequest as RenameRequestModel -from ..models.RenameResponse import RenameResponse as RenameResponseModel from ..models.EnvironmentsListResponse import ( EnvironmentsListResponse as EnvironmentsListResponseModel, ) @@ -15,21 +10,24 @@ from ..models.EnvironmentsCreateResponse import ( EnvironmentsCreateResponse as EnvironmentsCreateResponseModel, ) +from ..models.EnvironmentsGetResponse import ( + EnvironmentsGetResponse as EnvironmentsGetResponseModel, +) +from ..models.RenameRequest import RenameRequest as RenameRequestModel +from ..models.RenameResponse import RenameResponse as RenameResponseModel class Environments(BaseService): - def get(self, environment: str, project: str) -> EnvironmentsGetResponseModel: + def list(self, project: str) -> EnvironmentsListResponseModel: """ - Retrieve + List Parameters: ---------- project: str The project's name - environment: str - The environment's slug """ - url_endpoint = "/v3/environments/environment" + url_endpoint = "/v3/environments" headers = {} query_params = [] self._add_required_headers(headers) @@ -38,34 +36,25 @@ def get(self, environment: str, project: str) -> EnvironmentsGetResponseModel: query_params.append( query_serializer.serialize_query("form", False, "project", project) ) - if not environment: - raise ValueError( - "Parameter environment is required, cannot be empty or blank." - ) - query_params.append( - query_serializer.serialize_query("form", False, "environment", environment) - ) final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) res = self._http.get(final_url, headers, True) if res and isinstance(res, dict): - return EnvironmentsGetResponseModel(**res) + return EnvironmentsListResponseModel(**res) return res - def rename( - self, environment: str, project: str, request_input: RenameRequestModel = None - ) -> RenameResponseModel: + def create( + self, project: str, request_input: EnvironmentsCreateRequestModel = None + ) -> EnvironmentsCreateResponseModel: """ - Rename + Create Parameters: ---------- project: str The project's name - environment: str - The environment's slug """ - url_endpoint = "/v3/environments/environment" - headers = {"Content-type": "application/json"} + url_endpoint = "/v3/environments" + headers = {"Content-Type": "application/json"} query_params = [] self._add_required_headers(headers) if not project: @@ -73,22 +62,15 @@ def rename( query_params.append( query_serializer.serialize_query("form", False, "project", project) ) - if not environment: - raise ValueError( - "Parameter environment is required, cannot be empty or blank." - ) - query_params.append( - query_serializer.serialize_query("form", False, "environment", environment) - ) final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) - res = self._http.put(final_url, headers, request_input, True) + res = self._http.post(final_url, headers, request_input, True) if res and isinstance(res, dict): - return RenameResponseModel(**res) + return EnvironmentsCreateResponseModel(**res) return res - def delete(self, environment: str, project: str): + def get(self, environment: str, project: str) -> EnvironmentsGetResponseModel: """ - Delete + Retrieve Parameters: ---------- project: str @@ -114,20 +96,26 @@ def delete(self, environment: str, project: str): query_serializer.serialize_query("form", False, "environment", environment) ) final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) - res = self._http.delete(final_url, headers, True) + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return EnvironmentsGetResponseModel(**res) return res - def list(self, project: str) -> EnvironmentsListResponseModel: + def rename( + self, environment: str, project: str, request_input: RenameRequestModel = None + ) -> RenameResponseModel: """ - List + Rename Parameters: ---------- project: str The project's name + environment: str + The environment's slug """ - url_endpoint = "/v3/environments" - headers = {} + url_endpoint = "/v3/environments/environment" + headers = {"Content-Type": "application/json"} query_params = [] self._add_required_headers(headers) if not project: @@ -135,25 +123,32 @@ def list(self, project: str) -> EnvironmentsListResponseModel: query_params.append( query_serializer.serialize_query("form", False, "project", project) ) + if not environment: + raise ValueError( + "Parameter environment is required, cannot be empty or blank." + ) + query_params.append( + query_serializer.serialize_query("form", False, "environment", environment) + ) final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) - res = self._http.get(final_url, headers, True) + res = self._http.put(final_url, headers, request_input, True) if res and isinstance(res, dict): - return EnvironmentsListResponseModel(**res) + return RenameResponseModel(**res) return res - def create( - self, project: str, request_input: EnvironmentsCreateRequestModel = None - ) -> EnvironmentsCreateResponseModel: + def delete(self, environment: str, project: str): """ - Create + Delete Parameters: ---------- project: str The project's name + environment: str + The environment's slug """ - url_endpoint = "/v3/environments" - headers = {"Content-type": "application/json"} + url_endpoint = "/v3/environments/environment" + headers = {} query_params = [] self._add_required_headers(headers) if not project: @@ -161,8 +156,13 @@ def create( query_params.append( query_serializer.serialize_query("form", False, "project", project) ) + if not environment: + raise ValueError( + "Parameter environment is required, cannot be empty or blank." + ) + query_params.append( + query_serializer.serialize_query("form", False, "environment", environment) + ) final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) - res = self._http.post(final_url, headers, request_input, True) - if res and isinstance(res, dict): - return EnvironmentsCreateResponseModel(**res) + res = self._http.delete(final_url, headers, True) return res diff --git a/src/dopplersdk/services/get.py b/src/dopplersdk/services/get.py new file mode 100644 index 0000000..9b18b36 --- /dev/null +++ b/src/dopplersdk/services/get.py @@ -0,0 +1,32 @@ +from urllib.parse import quote +from ..net import query_serializer +from .base import BaseService +from ..models.OptionsResponse import OptionsResponse as OptionsResponseModel + + +class Get(BaseService): + def options(self, integration: str) -> OptionsResponseModel: + """ + Get Options + Parameters: + ---------- + integration: str + The integration slug + """ + + url_endpoint = "/v3/integrations/integration/options" + headers = {} + query_params = [] + self._add_required_headers(headers) + if not integration: + raise ValueError( + "Parameter integration is required, cannot be empty or blank." + ) + query_params.append( + query_serializer.serialize_query("form", False, "integration", integration) + ) + final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return OptionsResponseModel(**res) + return res diff --git a/src/dopplersdk/services/groups.py b/src/dopplersdk/services/groups.py index 6849226..1824f1d 100644 --- a/src/dopplersdk/services/groups.py +++ b/src/dopplersdk/services/groups.py @@ -1,67 +1,21 @@ from urllib.parse import quote from ..net import query_serializer from .base import BaseService -from ..models.GroupsListResponse import GroupsListResponse as GroupsListResponseModel -from ..models.GroupsCreateRequest import GroupsCreateRequest as GroupsCreateRequestModel -from ..models.GroupsCreateResponse import ( - GroupsCreateResponse as GroupsCreateResponseModel, -) from ..models.GroupsGetResponse import GroupsGetResponse as GroupsGetResponseModel from ..models.GroupsUpdateRequest import GroupsUpdateRequest as GroupsUpdateRequestModel from ..models.GroupsUpdateResponse import ( GroupsUpdateResponse as GroupsUpdateResponseModel, ) -from ..models.AddMemberRequest import AddMemberRequest as AddMemberRequestModel +from ..models.GroupsListResponse import GroupsListResponse as GroupsListResponseModel +from ..models.GroupsCreateRequest import GroupsCreateRequest as GroupsCreateRequestModel +from ..models.GroupsCreateResponse import ( + GroupsCreateResponse as GroupsCreateResponseModel, +) from ..models.GroupsType import GroupsType as GroupsTypeModel +from ..models.AddMemberRequest import AddMemberRequest as AddMemberRequestModel class Groups(BaseService): - def list(self, page: int = None, per_page: int = None) -> GroupsListResponseModel: - """ - List - Parameters: - ---------- - page: int - per_page: int - """ - - url_endpoint = "/v3/workplace/groups" - headers = {} - query_params = [] - self._add_required_headers(headers) - if page: - query_params.append( - query_serializer.serialize_query("form", False, "page", page) - ) - if per_page: - query_params.append( - query_serializer.serialize_query("form", False, "per_page", per_page) - ) - final_url = self._url_prefix + url_endpoint - if len(query_params) > 0: - final_url += "?" + "&".join(query_params) - res = self._http.get(final_url, headers, True) - if res and isinstance(res, dict): - return GroupsListResponseModel(**res) - return res - - def create( - self, request_input: GroupsCreateRequestModel = None - ) -> GroupsCreateResponseModel: - """ - Create - """ - - url_endpoint = "/v3/workplace/groups" - headers = {"Content-type": "application/json"} - self._add_required_headers(headers) - - final_url = self._url_prefix + url_endpoint - res = self._http.post(final_url, headers, request_input, True) - if res and isinstance(res, dict): - return GroupsCreateResponseModel(**res) - return res - def get(self, slug: str) -> GroupsGetResponseModel: """ Retrieve @@ -98,7 +52,7 @@ def update( """ url_endpoint = "/v3/workplace/groups/group/{slug}" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) if not slug: raise ValueError("Parameter slug is required, cannot be empty or blank.") @@ -134,26 +88,50 @@ def delete(self, slug: str): res = self._http.delete(final_url, headers, True) return res - def add_member(self, slug: str, request_input: AddMemberRequestModel = None): + def list(self, page: int = None, per_page: int = None) -> GroupsListResponseModel: """ - Add Member + List Parameters: ---------- - slug: str - The group's slug + page: int + per_page: int """ - url_endpoint = "/v3/workplace/groups/group/{slug}/members" - headers = {"Content-type": "application/json"} + url_endpoint = "/v3/workplace/groups" + headers = {} + query_params = [] self._add_required_headers(headers) - if not slug: - raise ValueError("Parameter slug is required, cannot be empty or blank.") - url_endpoint = url_endpoint.replace( - "{slug}", - quote(str(query_serializer.serialize_path("simple", False, slug, None))), - ) + if page: + query_params.append( + query_serializer.serialize_query("form", False, "page", page) + ) + if per_page: + query_params.append( + query_serializer.serialize_query("form", False, "per_page", per_page) + ) + final_url = self._url_prefix + url_endpoint + if len(query_params) > 0: + final_url += "?" + "&".join(query_params) + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return GroupsListResponseModel(**res) + return res + + def create( + self, request_input: GroupsCreateRequestModel = None + ) -> GroupsCreateResponseModel: + """ + Create + """ + + url_endpoint = "/v3/workplace/groups" + headers = {"Content-Type": "application/json"} + self._add_required_headers(headers) + final_url = self._url_prefix + url_endpoint res = self._http.post(final_url, headers, request_input, True) + if res and isinstance(res, dict): + return GroupsCreateResponseModel(**res) return res def delete_member(self, member_slug: str, type_: GroupsTypeModel, slug: str): @@ -163,7 +141,7 @@ def delete_member(self, member_slug: str, type_: GroupsTypeModel, slug: str): ---------- slug: str The group's slug - type: GroupsType + type_: GroupsType member_slug: str The member's slug """ @@ -203,3 +181,25 @@ def delete_member(self, member_slug: str, type_: GroupsTypeModel, slug: str): final_url = self._url_prefix + url_endpoint res = self._http.delete(final_url, headers, True) return res + + def add_member(self, slug: str, request_input: AddMemberRequestModel = None): + """ + Add Member + Parameters: + ---------- + slug: str + The group's slug + """ + + url_endpoint = "/v3/workplace/groups/group/{slug}/members" + headers = {"Content-Type": "application/json"} + self._add_required_headers(headers) + if not slug: + raise ValueError("Parameter slug is required, cannot be empty or blank.") + url_endpoint = url_endpoint.replace( + "{slug}", + quote(str(query_serializer.serialize_path("simple", False, slug, None))), + ) + final_url = self._url_prefix + url_endpoint + res = self._http.post(final_url, headers, request_input, True) + return res diff --git a/src/dopplersdk/services/integrations.py b/src/dopplersdk/services/integrations.py index e33bca5..731bf54 100644 --- a/src/dopplersdk/services/integrations.py +++ b/src/dopplersdk/services/integrations.py @@ -1,15 +1,6 @@ from urllib.parse import quote from ..net import query_serializer from .base import BaseService -from ..models.IntegrationsListResponse import ( - IntegrationsListResponse as IntegrationsListResponseModel, -) -from ..models.IntegrationsCreateRequest import ( - IntegrationsCreateRequest as IntegrationsCreateRequestModel, -) -from ..models.IntegrationsCreateResponse import ( - IntegrationsCreateResponse as IntegrationsCreateResponseModel, -) from ..models.IntegrationsGetResponse import ( IntegrationsGetResponse as IntegrationsGetResponseModel, ) @@ -22,41 +13,18 @@ from ..models.IntegrationsDeleteResponse import ( IntegrationsDeleteResponse as IntegrationsDeleteResponseModel, ) +from ..models.IntegrationsListResponse import ( + IntegrationsListResponse as IntegrationsListResponseModel, +) +from ..models.IntegrationsCreateRequest import ( + IntegrationsCreateRequest as IntegrationsCreateRequestModel, +) +from ..models.IntegrationsCreateResponse import ( + IntegrationsCreateResponse as IntegrationsCreateResponseModel, +) class Integrations(BaseService): - def list(self) -> IntegrationsListResponseModel: - """ - List - """ - - url_endpoint = "/v3/integrations" - headers = {} - self._add_required_headers(headers) - - final_url = self._url_prefix + url_endpoint - res = self._http.get(final_url, headers, True) - if res and isinstance(res, dict): - return IntegrationsListResponseModel(**res) - return res - - def create( - self, request_input: IntegrationsCreateRequestModel = None - ) -> IntegrationsCreateResponseModel: - """ - Create - """ - - url_endpoint = "/v3/integrations" - headers = {"Content-type": "application/json"} - self._add_required_headers(headers) - - final_url = self._url_prefix + url_endpoint - res = self._http.post(final_url, headers, request_input, True) - if res and isinstance(res, dict): - return IntegrationsCreateResponseModel(**res) - return res - def get(self, integration: str) -> IntegrationsGetResponseModel: """ Retrieve @@ -95,7 +63,7 @@ def update( """ url_endpoint = "/v3/integrations/integration" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} query_params = [] self._add_required_headers(headers) if not integration: @@ -136,3 +104,35 @@ def delete(self, integration: str) -> IntegrationsDeleteResponseModel: if res and isinstance(res, dict): return IntegrationsDeleteResponseModel(**res) return res + + def list(self) -> IntegrationsListResponseModel: + """ + List + """ + + url_endpoint = "/v3/integrations" + headers = {} + self._add_required_headers(headers) + + final_url = self._url_prefix + url_endpoint + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return IntegrationsListResponseModel(**res) + return res + + def create( + self, request_input: IntegrationsCreateRequestModel = None + ) -> IntegrationsCreateResponseModel: + """ + Create + """ + + url_endpoint = "/v3/integrations" + headers = {"Content-Type": "application/json"} + self._add_required_headers(headers) + + final_url = self._url_prefix + url_endpoint + res = self._http.post(final_url, headers, request_input, True) + if res and isinstance(res, dict): + return IntegrationsCreateResponseModel(**res) + return res diff --git a/src/dopplersdk/services/project_members.py b/src/dopplersdk/services/project_members.py index 8c69546..da314b2 100644 --- a/src/dopplersdk/services/project_members.py +++ b/src/dopplersdk/services/project_members.py @@ -67,7 +67,7 @@ def add( """ url_endpoint = "/v3/projects/project/members" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} query_params = [] self._add_required_headers(headers) if not project: @@ -90,7 +90,7 @@ def get( ---------- project: str Project slug - type: Type + type_: Type slug: str Member's slug """ @@ -140,7 +140,7 @@ def update( Update Parameters: ---------- - type: Type + type_: Type slug: str Member's slug project: str @@ -148,7 +148,7 @@ def update( """ url_endpoint = "/v3/projects/project/members/member/{type_}/{slug}" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} query_params = [] self._add_required_headers(headers) if not type_: @@ -186,7 +186,7 @@ def delete(self, project: str, slug: str, type_: TypeModel): Delete Parameters: ---------- - type: Type + type_: Type slug: str Member's slug project: str diff --git a/src/dopplersdk/services/project_roles.py b/src/dopplersdk/services/project_roles.py index 77b0bc6..f8b9b3b 100644 --- a/src/dopplersdk/services/project_roles.py +++ b/src/dopplersdk/services/project_roles.py @@ -1,54 +1,30 @@ from urllib.parse import quote from ..net import query_serializer from .base import BaseService -from ..models.ProjectRolesListResponse import ( - ProjectRolesListResponse as ProjectRolesListResponseModel, -) -from ..models.ProjectRolesCreateResponse import ( - ProjectRolesCreateResponse as ProjectRolesCreateResponseModel, -) from ..models.ProjectRolesGetResponse import ( ProjectRolesGetResponse as ProjectRolesGetResponseModel, ) +from ..models.ProjectRolesUpdateRequest import ( + ProjectRolesUpdateRequest as ProjectRolesUpdateRequestModel, +) from ..models.ProjectRolesUpdateResponse import ( ProjectRolesUpdateResponse as ProjectRolesUpdateResponseModel, ) +from ..models.ProjectRolesListResponse import ( + ProjectRolesListResponse as ProjectRolesListResponseModel, +) +from ..models.ProjectRolesCreateRequest import ( + ProjectRolesCreateRequest as ProjectRolesCreateRequestModel, +) +from ..models.ProjectRolesCreateResponse import ( + ProjectRolesCreateResponse as ProjectRolesCreateResponseModel, +) from ..models.ProjectRolesListPermissionsResponse import ( ProjectRolesListPermissionsResponse as ProjectRolesListPermissionsResponseModel, ) class ProjectRoles(BaseService): - def list(self) -> ProjectRolesListResponseModel: - """ - List - """ - - url_endpoint = "/v3/projects/roles" - headers = {} - self._add_required_headers(headers) - - final_url = self._url_prefix + url_endpoint - res = self._http.get(final_url, headers, True) - if res and isinstance(res, dict): - return ProjectRolesListResponseModel(**res) - return res - - def create(self) -> ProjectRolesCreateResponseModel: - """ - Create - """ - - url_endpoint = "/v3/projects/roles" - headers = {} - self._add_required_headers(headers) - - final_url = self._url_prefix + url_endpoint - res = self._http.post(final_url, headers, {}, True) - if res and isinstance(res, dict): - return ProjectRolesCreateResponseModel(**res) - return res - def get(self, role: str) -> ProjectRolesGetResponseModel: """ Retrieve @@ -73,7 +49,9 @@ def get(self, role: str) -> ProjectRolesGetResponseModel: return ProjectRolesGetResponseModel(**res) return res - def update(self, role: str) -> ProjectRolesUpdateResponseModel: + def update( + self, role: str, request_input: ProjectRolesUpdateRequestModel = None + ) -> ProjectRolesUpdateResponseModel: """ Update Parameters: @@ -83,7 +61,7 @@ def update(self, role: str) -> ProjectRolesUpdateResponseModel: """ url_endpoint = "/v3/projects/roles/role/{role}" - headers = {} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) if not role: raise ValueError("Parameter role is required, cannot be empty or blank.") @@ -92,7 +70,7 @@ def update(self, role: str) -> ProjectRolesUpdateResponseModel: quote(str(query_serializer.serialize_path("simple", False, role, None))), ) final_url = self._url_prefix + url_endpoint - res = self._http.patch(final_url, headers, {}, True) + res = self._http.patch(final_url, headers, request_input, True) if res and isinstance(res, dict): return ProjectRolesUpdateResponseModel(**res) return res @@ -119,6 +97,38 @@ def delete(self, role: str): res = self._http.delete(final_url, headers, True) return res + def list(self) -> ProjectRolesListResponseModel: + """ + List + """ + + url_endpoint = "/v3/projects/roles" + headers = {} + self._add_required_headers(headers) + + final_url = self._url_prefix + url_endpoint + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return ProjectRolesListResponseModel(**res) + return res + + def create( + self, request_input: ProjectRolesCreateRequestModel = None + ) -> ProjectRolesCreateResponseModel: + """ + Create + """ + + url_endpoint = "/v3/projects/roles" + headers = {"Content-Type": "application/json"} + self._add_required_headers(headers) + + final_url = self._url_prefix + url_endpoint + res = self._http.post(final_url, headers, request_input, True) + if res and isinstance(res, dict): + return ProjectRolesCreateResponseModel(**res) + return res + def list_permissions(self) -> ProjectRolesListPermissionsResponseModel: """ List Permissions diff --git a/src/dopplersdk/services/projects.py b/src/dopplersdk/services/projects.py index 4253b89..eb2e6a4 100644 --- a/src/dopplersdk/services/projects.py +++ b/src/dopplersdk/services/projects.py @@ -4,13 +4,9 @@ from ..models.ListResponse import ListResponse as ListResponseModel from ..models.CreateRequest import CreateRequest as CreateRequestModel from ..models.CreateResponse import CreateResponse as CreateResponseModel -from ..models.ProjectsGetResponse import ProjectsGetResponse as ProjectsGetResponseModel -from ..models.ProjectsUpdateRequest import ( - ProjectsUpdateRequest as ProjectsUpdateRequestModel, -) -from ..models.ProjectsUpdateResponse import ( - ProjectsUpdateResponse as ProjectsUpdateResponseModel, -) +from ..models.GetResponse import GetResponse as GetResponseModel +from ..models.UpdateRequest import UpdateRequest as UpdateRequestModel +from ..models.UpdateResponse import UpdateResponse as UpdateResponseModel from ..models.DeleteRequest import DeleteRequest as DeleteRequestModel @@ -52,7 +48,7 @@ def create(self, request_input: CreateRequestModel = None) -> CreateResponseMode """ url_endpoint = "/v3/projects" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint @@ -61,7 +57,7 @@ def create(self, request_input: CreateRequestModel = None) -> CreateResponseMode return CreateResponseModel(**res) return res - def get(self, project: str) -> ProjectsGetResponseModel: + def get(self, project: str) -> GetResponseModel: """ Retrieve Parameters: @@ -82,24 +78,22 @@ def get(self, project: str) -> ProjectsGetResponseModel: final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) res = self._http.get(final_url, headers, True) if res and isinstance(res, dict): - return ProjectsGetResponseModel(**res) + return GetResponseModel(**res) return res - def update( - self, request_input: ProjectsUpdateRequestModel = None - ) -> ProjectsUpdateResponseModel: + def update(self, request_input: UpdateRequestModel = None) -> UpdateResponseModel: """ Update """ url_endpoint = "/v3/projects/project" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint res = self._http.post(final_url, headers, request_input, True) if res and isinstance(res, dict): - return ProjectsUpdateResponseModel(**res) + return UpdateResponseModel(**res) return res def delete(self, request_input: DeleteRequestModel = None): @@ -108,7 +102,7 @@ def delete(self, request_input: DeleteRequestModel = None): """ url_endpoint = "/v3/projects/project" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint diff --git a/src/dopplersdk/services/retrieve.py b/src/dopplersdk/services/retrieve.py new file mode 100644 index 0000000..e10f8f0 --- /dev/null +++ b/src/dopplersdk/services/retrieve.py @@ -0,0 +1,67 @@ +from urllib.parse import quote +from ..net import query_serializer +from .base import BaseService +from ..models.MemberType import MemberType as MemberTypeModel +from ..models.MemberResponse import MemberResponse as MemberResponseModel + + +class Retrieve(BaseService): + def member( + self, member_slug: str, member_type: MemberTypeModel, group_slug: str + ) -> MemberResponseModel: + """ + Retrieve Member + Parameters: + ---------- + group_slug: str + The group's slug + member_type: MemberType + member_slug: str + The member's slug + """ + + url_endpoint = "/v3/workplace/groups/group/{group_slug}/members/{member_type}/{member_slug}" + headers = {} + self._add_required_headers(headers) + if not group_slug: + raise ValueError( + "Parameter group_slug is required, cannot be empty or blank." + ) + url_endpoint = url_endpoint.replace( + "{group_slug}", + quote( + str(query_serializer.serialize_path("simple", False, group_slug, None)) + ), + ) + if not member_type: + raise ValueError( + "Parameter member_type is required, cannot be empty or blank." + ) + validated_member_type = self._enum_matching( + member_type, MemberTypeModel.list(), "member_type" + ) + url_endpoint = url_endpoint.replace( + "{member_type}", + quote( + str( + query_serializer.serialize_path( + "simple", False, validated_member_type, None + ) + ) + ), + ) + if not member_slug: + raise ValueError( + "Parameter member_slug is required, cannot be empty or blank." + ) + url_endpoint = url_endpoint.replace( + "{member_slug}", + quote( + str(query_serializer.serialize_path("simple", False, member_slug, None)) + ), + ) + final_url = self._url_prefix + url_endpoint + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return MemberResponseModel(**res) + return res diff --git a/src/dopplersdk/services/secrets.py b/src/dopplersdk/services/secrets.py index 6bd0a9d..9cc44bc 100644 --- a/src/dopplersdk/services/secrets.py +++ b/src/dopplersdk/services/secrets.py @@ -2,15 +2,19 @@ from ..net import query_serializer from .base import BaseService from ..models.SecretsListResponse import SecretsListResponse as SecretsListResponseModel -from ..models.UpdateRequest import UpdateRequest as UpdateRequestModel -from ..models.UpdateResponse import UpdateResponse as UpdateResponseModel +from ..models.SecretsUpdateRequest import ( + SecretsUpdateRequest as SecretsUpdateRequestModel, +) +from ..models.SecretsUpdateResponse import ( + SecretsUpdateResponse as SecretsUpdateResponseModel, +) from ..models.SecretsGetResponse import SecretsGetResponse as SecretsGetResponseModel from ..models.Format import Format as FormatModel from ..models.NameTransformer import NameTransformer as NameTransformerModel from ..models.DownloadResponse import DownloadResponse as DownloadResponseModel -from ..models.NamesResponse import NamesResponse as NamesResponseModel from ..models.UpdateNoteRequest import UpdateNoteRequest as UpdateNoteRequestModel from ..models.UpdateNoteResponse import UpdateNoteResponse as UpdateNoteResponseModel +from ..models.NamesResponse import NamesResponse as NamesResponseModel class Secrets(BaseService): @@ -87,19 +91,21 @@ def list( return SecretsListResponseModel(**res) return res - def update(self, request_input: UpdateRequestModel = None) -> UpdateResponseModel: + def update( + self, request_input: SecretsUpdateRequestModel = None + ) -> SecretsUpdateResponseModel: """ Update """ url_endpoint = "/v3/configs/config/secrets" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint res = self._http.post(final_url, headers, request_input, True) if res and isinstance(res, dict): - return UpdateResponseModel(**res) + return SecretsUpdateResponseModel(**res) return res def get(self, name: str, config: str, project: str) -> SecretsGetResponseModel: @@ -184,6 +190,7 @@ def download( name_transformer: NameTransformerModel = None, include_dynamic_secrets: bool = None, dynamic_secrets_ttl_sec: int = None, + secrets: str = None, ) -> DownloadResponseModel: """ Download @@ -200,6 +207,8 @@ def download( Whether or not to issue leases and include dynamic secret values for the config dynamic_secrets_ttl_sec: int The number of seconds until dynamic leases expire. Must be used with `include_dynamic_secrets`. Defaults to 1800 (30 minutes). + secrets: str + Comma-delimited list of secrets to include in the download. Defaults to all secrets if left unspecified. """ url_endpoint = "/v3/configs/config/secrets/download" @@ -244,12 +253,33 @@ def download( "form", False, "dynamic_secrets_ttl_sec", dynamic_secrets_ttl_sec ) ) + if secrets: + query_params.append( + query_serializer.serialize_query("form", False, "secrets", secrets) + ) final_url = self._url_prefix + url_endpoint + "?" + "&".join(query_params) res = self._http.get(final_url, headers, True) if res and isinstance(res, dict): return DownloadResponseModel(**res) return res + def update_note( + self, request_input: UpdateNoteRequestModel = None + ) -> UpdateNoteResponseModel: + """ + Update Note + """ + + url_endpoint = "/v3/configs/config/secrets/note" + headers = {"Content-Type": "application/json"} + self._add_required_headers(headers) + + final_url = self._url_prefix + url_endpoint + res = self._http.post(final_url, headers, request_input, True) + if res and isinstance(res, dict): + return UpdateNoteResponseModel(**res) + return res + def names( self, config: str, @@ -302,20 +332,3 @@ def names( if res and isinstance(res, dict): return NamesResponseModel(**res) return res - - def update_note( - self, request_input: UpdateNoteRequestModel = None - ) -> UpdateNoteResponseModel: - """ - Update Note - """ - - url_endpoint = "/v3/configs/config/secrets/note" - headers = {"Content-type": "application/json"} - self._add_required_headers(headers) - - final_url = self._url_prefix + url_endpoint - res = self._http.post(final_url, headers, request_input, True) - if res and isinstance(res, dict): - return UpdateNoteResponseModel(**res) - return res diff --git a/src/dopplersdk/services/service_account_tokens.py b/src/dopplersdk/services/service_account_tokens.py new file mode 100644 index 0000000..a97c08a --- /dev/null +++ b/src/dopplersdk/services/service_account_tokens.py @@ -0,0 +1,192 @@ +from urllib.parse import quote +from ..net import query_serializer +from .base import BaseService +from ..models.ServiceAccountTokensListResponse import ( + ServiceAccountTokensListResponse as ServiceAccountTokensListResponseModel, +) +from ..models.ServiceAccountTokensCreateRequest import ( + ServiceAccountTokensCreateRequest as ServiceAccountTokensCreateRequestModel, +) +from ..models.ServiceAccountTokensCreateResponse import ( + ServiceAccountTokensCreateResponse as ServiceAccountTokensCreateResponseModel, +) +from ..models.ServiceAccountTokensGetResponse import ( + ServiceAccountTokensGetResponse as ServiceAccountTokensGetResponseModel, +) + + +class ServiceAccountTokens(BaseService): + def list( + self, service_account: str, page: int = None, per_page: int = None + ) -> ServiceAccountTokensListResponseModel: + """ + List + Parameters: + ---------- + page: int + per_page: int + service_account: str + Slug of the service account + """ + + url_endpoint = ( + "/v3/workplace/service_accounts/service_account/{service_account}/tokens" + ) + headers = {} + query_params = [] + self._add_required_headers(headers) + if page: + query_params.append( + query_serializer.serialize_query("form", False, "page", page) + ) + if per_page: + query_params.append( + query_serializer.serialize_query("form", False, "per_page", per_page) + ) + if not service_account: + raise ValueError( + "Parameter service_account is required, cannot be empty or blank." + ) + url_endpoint = url_endpoint.replace( + "{service_account}", + quote( + str( + query_serializer.serialize_path( + "simple", False, service_account, None + ) + ) + ), + ) + final_url = self._url_prefix + url_endpoint + if len(query_params) > 0: + final_url += "?" + "&".join(query_params) + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return ServiceAccountTokensListResponseModel(**res) + return res + + def create( + self, + service_account: str, + request_input: ServiceAccountTokensCreateRequestModel = None, + ) -> ServiceAccountTokensCreateResponseModel: + """ + Create + Parameters: + ---------- + service_account: str + Slug of the service account + """ + + url_endpoint = ( + "/v3/workplace/service_accounts/service_account/{service_account}/tokens" + ) + headers = {"Content-Type": "application/json"} + self._add_required_headers(headers) + if not service_account: + raise ValueError( + "Parameter service_account is required, cannot be empty or blank." + ) + url_endpoint = url_endpoint.replace( + "{service_account}", + quote( + str( + query_serializer.serialize_path( + "simple", False, service_account, None + ) + ) + ), + ) + final_url = self._url_prefix + url_endpoint + res = self._http.post(final_url, headers, request_input, True) + if res and isinstance(res, dict): + return ServiceAccountTokensCreateResponseModel(**res) + return res + + def get( + self, api_token: str, service_account: str + ) -> ServiceAccountTokensGetResponseModel: + """ + Retrieve + Parameters: + ---------- + service_account: str + Slug of the service account + api_token: str + Slug of the API token + """ + + url_endpoint = "/v3/workplace/service_accounts/service_account/{service_account}/tokens/token/{api_token}" + headers = {} + self._add_required_headers(headers) + if not service_account: + raise ValueError( + "Parameter service_account is required, cannot be empty or blank." + ) + url_endpoint = url_endpoint.replace( + "{service_account}", + quote( + str( + query_serializer.serialize_path( + "simple", False, service_account, None + ) + ) + ), + ) + if not api_token: + raise ValueError( + "Parameter api_token is required, cannot be empty or blank." + ) + url_endpoint = url_endpoint.replace( + "{api_token}", + quote( + str(query_serializer.serialize_path("simple", False, api_token, None)) + ), + ) + final_url = self._url_prefix + url_endpoint + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return ServiceAccountTokensGetResponseModel(**res) + return res + + def delete(self, api_token: str, service_account: str): + """ + Delete + Parameters: + ---------- + service_account: str + Slug of the service account + api_token: str + Slug of the API token + """ + + url_endpoint = "/v3/workplace/service_accounts/service_account/{service_account}/tokens/token/{api_token}" + headers = {} + self._add_required_headers(headers) + if not service_account: + raise ValueError( + "Parameter service_account is required, cannot be empty or blank." + ) + url_endpoint = url_endpoint.replace( + "{service_account}", + quote( + str( + query_serializer.serialize_path( + "simple", False, service_account, None + ) + ) + ), + ) + if not api_token: + raise ValueError( + "Parameter api_token is required, cannot be empty or blank." + ) + url_endpoint = url_endpoint.replace( + "{api_token}", + quote( + str(query_serializer.serialize_path("simple", False, api_token, None)) + ), + ) + final_url = self._url_prefix + url_endpoint + res = self._http.delete(final_url, headers, True) + return res diff --git a/src/dopplersdk/services/service_accounts.py b/src/dopplersdk/services/service_accounts.py index fcb2789..c4910ad 100644 --- a/src/dopplersdk/services/service_accounts.py +++ b/src/dopplersdk/services/service_accounts.py @@ -1,15 +1,6 @@ from urllib.parse import quote from ..net import query_serializer from .base import BaseService -from ..models.ServiceAccountsListResponse import ( - ServiceAccountsListResponse as ServiceAccountsListResponseModel, -) -from ..models.ServiceAccountsCreateRequest import ( - ServiceAccountsCreateRequest as ServiceAccountsCreateRequestModel, -) -from ..models.ServiceAccountsCreateResponse import ( - ServiceAccountsCreateResponse as ServiceAccountsCreateResponseModel, -) from ..models.ServiceAccountsGetResponse import ( ServiceAccountsGetResponse as ServiceAccountsGetResponseModel, ) @@ -19,57 +10,18 @@ from ..models.ServiceAccountsUpdateResponse import ( ServiceAccountsUpdateResponse as ServiceAccountsUpdateResponseModel, ) +from ..models.ServiceAccountsListResponse import ( + ServiceAccountsListResponse as ServiceAccountsListResponseModel, +) +from ..models.ServiceAccountsCreateRequest import ( + ServiceAccountsCreateRequest as ServiceAccountsCreateRequestModel, +) +from ..models.ServiceAccountsCreateResponse import ( + ServiceAccountsCreateResponse as ServiceAccountsCreateResponseModel, +) class ServiceAccounts(BaseService): - def list( - self, page: int = None, per_page: int = None - ) -> ServiceAccountsListResponseModel: - """ - List - Parameters: - ---------- - page: int - per_page: int - """ - - url_endpoint = "/v3/workplace/service_accounts" - headers = {} - query_params = [] - self._add_required_headers(headers) - if page: - query_params.append( - query_serializer.serialize_query("form", False, "page", page) - ) - if per_page: - query_params.append( - query_serializer.serialize_query("form", False, "per_page", per_page) - ) - final_url = self._url_prefix + url_endpoint - if len(query_params) > 0: - final_url += "?" + "&".join(query_params) - res = self._http.get(final_url, headers, True) - if res and isinstance(res, dict): - return ServiceAccountsListResponseModel(**res) - return res - - def create( - self, request_input: ServiceAccountsCreateRequestModel = None - ) -> ServiceAccountsCreateResponseModel: - """ - Create - """ - - url_endpoint = "/v3/workplace/service_accounts" - headers = {"Content-type": "application/json"} - self._add_required_headers(headers) - - final_url = self._url_prefix + url_endpoint - res = self._http.post(final_url, headers, request_input, True) - if res and isinstance(res, dict): - return ServiceAccountsCreateResponseModel(**res) - return res - def get(self, slug: str) -> ServiceAccountsGetResponseModel: """ Retrieve @@ -106,7 +58,7 @@ def update( """ url_endpoint = "/v3/workplace/service_accounts/service_account/{slug}" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) if not slug: raise ValueError("Parameter slug is required, cannot be empty or blank.") @@ -141,3 +93,51 @@ def delete(self, slug: str): final_url = self._url_prefix + url_endpoint res = self._http.delete(final_url, headers, True) return res + + def list( + self, page: int = None, per_page: int = None + ) -> ServiceAccountsListResponseModel: + """ + List + Parameters: + ---------- + page: int + per_page: int + """ + + url_endpoint = "/v3/workplace/service_accounts" + headers = {} + query_params = [] + self._add_required_headers(headers) + if page: + query_params.append( + query_serializer.serialize_query("form", False, "page", page) + ) + if per_page: + query_params.append( + query_serializer.serialize_query("form", False, "per_page", per_page) + ) + final_url = self._url_prefix + url_endpoint + if len(query_params) > 0: + final_url += "?" + "&".join(query_params) + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return ServiceAccountsListResponseModel(**res) + return res + + def create( + self, request_input: ServiceAccountsCreateRequestModel = None + ) -> ServiceAccountsCreateResponseModel: + """ + Create + """ + + url_endpoint = "/v3/workplace/service_accounts" + headers = {"Content-Type": "application/json"} + self._add_required_headers(headers) + + final_url = self._url_prefix + url_endpoint + res = self._http.post(final_url, headers, request_input, True) + if res and isinstance(res, dict): + return ServiceAccountsCreateResponseModel(**res) + return res diff --git a/src/dopplersdk/services/service_tokens.py b/src/dopplersdk/services/service_tokens.py index 295dc6a..46adf04 100644 --- a/src/dopplersdk/services/service_tokens.py +++ b/src/dopplersdk/services/service_tokens.py @@ -1,6 +1,10 @@ from urllib.parse import quote from ..net import query_serializer from .base import BaseService +from ..models.ServiceTokensDeleteRequest import ( + ServiceTokensDeleteRequest as ServiceTokensDeleteRequestModel, +) +from ..models.DeleteResponse import DeleteResponse as DeleteResponseModel from ..models.ServiceTokensListResponse import ( ServiceTokensListResponse as ServiceTokensListResponseModel, ) @@ -10,13 +14,26 @@ from ..models.ServiceTokensCreateResponse import ( ServiceTokensCreateResponse as ServiceTokensCreateResponseModel, ) -from ..models.ServiceTokensDeleteRequest import ( - ServiceTokensDeleteRequest as ServiceTokensDeleteRequestModel, -) -from ..models.DeleteResponse import DeleteResponse as DeleteResponseModel class ServiceTokens(BaseService): + def delete( + self, request_input: ServiceTokensDeleteRequestModel = None + ) -> DeleteResponseModel: + """ + Delete + """ + + url_endpoint = "/v3/configs/config/tokens/token" + headers = {"Content-Type": "application/json"} + self._add_required_headers(headers) + + final_url = self._url_prefix + url_endpoint + res = self._http.delete(final_url, headers, True) + if res and isinstance(res, dict): + return DeleteResponseModel(**res) + return res + def list(self, config: str, project: str) -> ServiceTokensListResponseModel: """ List @@ -56,7 +73,7 @@ def create( """ url_endpoint = "/v3/configs/config/tokens" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint @@ -64,20 +81,3 @@ def create( if res and isinstance(res, dict): return ServiceTokensCreateResponseModel(**res) return res - - def delete( - self, request_input: ServiceTokensDeleteRequestModel = None - ) -> DeleteResponseModel: - """ - Delete - """ - - url_endpoint = "/v3/configs/config/tokens/token" - headers = {"Content-type": "application/json"} - self._add_required_headers(headers) - - final_url = self._url_prefix + url_endpoint - res = self._http.delete(final_url, headers, True) - if res and isinstance(res, dict): - return DeleteResponseModel(**res) - return res diff --git a/src/dopplersdk/services/syncs.py b/src/dopplersdk/services/syncs.py index cedfc84..348a818 100644 --- a/src/dopplersdk/services/syncs.py +++ b/src/dopplersdk/services/syncs.py @@ -22,7 +22,7 @@ def create( """ url_endpoint = "/v3/configs/config/syncs" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} query_params = [] self._add_required_headers(headers) if not project: diff --git a/src/dopplersdk/services/users.py b/src/dopplersdk/services/users.py index f6261a1..35878e8 100644 --- a/src/dopplersdk/services/users.py +++ b/src/dopplersdk/services/users.py @@ -6,13 +6,15 @@ class Users(BaseService): - def list(self, page: int = None) -> UsersListResponseModel: + def list(self, page: int = None, email: str = None) -> UsersListResponseModel: """ List Parameters: ---------- page: int The page of users to fetch + email: str + Filter results to only include the user with the provided email address """ url_endpoint = "/v3/workplace/users" @@ -23,6 +25,10 @@ def list(self, page: int = None) -> UsersListResponseModel: query_params.append( query_serializer.serialize_query("form", False, "page", page) ) + if email: + query_params.append( + query_serializer.serialize_query("form", False, "email", email) + ) final_url = self._url_prefix + url_endpoint if len(query_params) > 0: final_url += "?" + "&".join(query_params) diff --git a/src/dopplersdk/services/webhooks.py b/src/dopplersdk/services/webhooks.py new file mode 100644 index 0000000..0521720 --- /dev/null +++ b/src/dopplersdk/services/webhooks.py @@ -0,0 +1,244 @@ +from urllib.parse import quote +from ..net import query_serializer +from .base import BaseService +from ..models.WebhooksListResponse import ( + WebhooksListResponse as WebhooksListResponseModel, +) +from ..models.WebhooksAddRequest import WebhooksAddRequest as WebhooksAddRequestModel +from ..models.WebhooksAddResponse import WebhooksAddResponse as WebhooksAddResponseModel +from ..models.WebhooksGetResponse import WebhooksGetResponse as WebhooksGetResponseModel +from ..models.WebhooksUpdateRequest import ( + WebhooksUpdateRequest as WebhooksUpdateRequestModel, +) +from ..models.WebhooksUpdateResponse import ( + WebhooksUpdateResponse as WebhooksUpdateResponseModel, +) +from ..models.WebhooksDeleteResponse import ( + WebhooksDeleteResponse as WebhooksDeleteResponseModel, +) +from ..models.EnableResponse import EnableResponse as EnableResponseModel +from ..models.DisableResponse import DisableResponse as DisableResponseModel + + +class Webhooks(BaseService): + def list(self, project: str = None) -> WebhooksListResponseModel: + """ + List + Parameters: + ---------- + project: str + The project's name + """ + + url_endpoint = "/v3/webhooks" + headers = {} + query_params = [] + self._add_required_headers(headers) + if project: + query_params.append( + query_serializer.serialize_query("form", False, "project", project) + ) + final_url = self._url_prefix + url_endpoint + if len(query_params) > 0: + final_url += "?" + "&".join(query_params) + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return WebhooksListResponseModel(**res) + return res + + def add( + self, project: str = None, request_input: WebhooksAddRequestModel = None + ) -> WebhooksAddResponseModel: + """ + Add + Parameters: + ---------- + project: str + The project's name + """ + + url_endpoint = "/v3/webhooks" + headers = {"Content-Type": "application/json"} + query_params = [] + self._add_required_headers(headers) + if project: + query_params.append( + query_serializer.serialize_query("form", False, "project", project) + ) + final_url = self._url_prefix + url_endpoint + if len(query_params) > 0: + final_url += "?" + "&".join(query_params) + res = self._http.post(final_url, headers, request_input, True) + if res and isinstance(res, dict): + return WebhooksAddResponseModel(**res) + return res + + def get(self, slug: str, project: str = None) -> WebhooksGetResponseModel: + """ + Retrieve + Parameters: + ---------- + slug: str + Webhook's slug + project: str + The project's name + """ + + url_endpoint = "/v3/webhooks/webhook/{slug}" + headers = {} + query_params = [] + self._add_required_headers(headers) + if not slug: + raise ValueError("Parameter slug is required, cannot be empty or blank.") + url_endpoint = url_endpoint.replace( + "{slug}", + quote(str(query_serializer.serialize_path("simple", False, slug, None))), + ) + if project: + query_params.append( + query_serializer.serialize_query("form", False, "project", project) + ) + final_url = self._url_prefix + url_endpoint + if len(query_params) > 0: + final_url += "?" + "&".join(query_params) + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return WebhooksGetResponseModel(**res) + return res + + def update( + self, + slug: str, + project: str = None, + request_input: WebhooksUpdateRequestModel = None, + ) -> WebhooksUpdateResponseModel: + """ + Update + Parameters: + ---------- + project: str + The project's name + slug: str + Webhook's slug + """ + + url_endpoint = "/v3/webhooks/webhook/{slug}" + headers = {"Content-Type": "application/json"} + query_params = [] + self._add_required_headers(headers) + if project: + query_params.append( + query_serializer.serialize_query("form", False, "project", project) + ) + if not slug: + raise ValueError("Parameter slug is required, cannot be empty or blank.") + url_endpoint = url_endpoint.replace( + "{slug}", + quote(str(query_serializer.serialize_path("simple", False, slug, None))), + ) + final_url = self._url_prefix + url_endpoint + if len(query_params) > 0: + final_url += "?" + "&".join(query_params) + res = self._http.patch(final_url, headers, request_input, True) + if res and isinstance(res, dict): + return WebhooksUpdateResponseModel(**res) + return res + + def delete(self, slug: str, project: str = None) -> WebhooksDeleteResponseModel: + """ + Delete + Parameters: + ---------- + project: str + The project's name + slug: str + Webhook's slug + """ + + url_endpoint = "/v3/webhooks/webhook/{slug}" + headers = {} + query_params = [] + self._add_required_headers(headers) + if project: + query_params.append( + query_serializer.serialize_query("form", False, "project", project) + ) + if not slug: + raise ValueError("Parameter slug is required, cannot be empty or blank.") + url_endpoint = url_endpoint.replace( + "{slug}", + quote(str(query_serializer.serialize_path("simple", False, slug, None))), + ) + final_url = self._url_prefix + url_endpoint + if len(query_params) > 0: + final_url += "?" + "&".join(query_params) + res = self._http.delete(final_url, headers, True) + if res and isinstance(res, dict): + return WebhooksDeleteResponseModel(**res) + return res + + def enable(self, slug: str, project: str = None) -> EnableResponseModel: + """ + Enable + Parameters: + ---------- + project: str + The project's name + slug: str + Webhook's slug + """ + + url_endpoint = "/v3/webhooks/webhook/{slug}/enable" + headers = {} + query_params = [] + self._add_required_headers(headers) + if project: + query_params.append( + query_serializer.serialize_query("form", False, "project", project) + ) + if not slug: + raise ValueError("Parameter slug is required, cannot be empty or blank.") + url_endpoint = url_endpoint.replace( + "{slug}", + quote(str(query_serializer.serialize_path("simple", False, slug, None))), + ) + final_url = self._url_prefix + url_endpoint + if len(query_params) > 0: + final_url += "?" + "&".join(query_params) + res = self._http.post(final_url, headers, {}, True) + if res and isinstance(res, dict): + return EnableResponseModel(**res) + return res + + def disable(self, slug: str, project: str = None) -> DisableResponseModel: + """ + Disable + Parameters: + ---------- + project: str + The project's name + slug: str + Webhook's slug + """ + + url_endpoint = "/v3/webhooks/webhook/{slug}/disable" + headers = {} + query_params = [] + self._add_required_headers(headers) + if project: + query_params.append( + query_serializer.serialize_query("form", False, "project", project) + ) + if not slug: + raise ValueError("Parameter slug is required, cannot be empty or blank.") + url_endpoint = url_endpoint.replace( + "{slug}", + quote(str(query_serializer.serialize_path("simple", False, slug, None))), + ) + final_url = self._url_prefix + url_endpoint + if len(query_params) > 0: + final_url += "?" + "&".join(query_params) + res = self._http.post(final_url, headers, {}, True) + if res and isinstance(res, dict): + return DisableResponseModel(**res) + return res diff --git a/src/dopplersdk/services/workplace.py b/src/dopplersdk/services/workplace.py index 3cb278a..6357e6b 100644 --- a/src/dopplersdk/services/workplace.py +++ b/src/dopplersdk/services/workplace.py @@ -36,7 +36,7 @@ def update( """ url_endpoint = "/v3/workplace" - headers = {"Content-type": "application/json"} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint diff --git a/src/dopplersdk/services/workplace_roles.py b/src/dopplersdk/services/workplace_roles.py index bfa213a..375b60a 100644 --- a/src/dopplersdk/services/workplace_roles.py +++ b/src/dopplersdk/services/workplace_roles.py @@ -4,18 +4,24 @@ from ..models.WorkplaceRolesListResponse import ( WorkplaceRolesListResponse as WorkplaceRolesListResponseModel, ) +from ..models.WorkplaceRolesCreateRequest import ( + WorkplaceRolesCreateRequest as WorkplaceRolesCreateRequestModel, +) from ..models.WorkplaceRolesCreateResponse import ( WorkplaceRolesCreateResponse as WorkplaceRolesCreateResponseModel, ) -from ..models.ListPermissionsResponse import ( - ListPermissionsResponse as ListPermissionsResponseModel, -) from ..models.WorkplaceRolesGetResponse import ( WorkplaceRolesGetResponse as WorkplaceRolesGetResponseModel, ) +from ..models.WorkplaceRolesUpdateRequest import ( + WorkplaceRolesUpdateRequest as WorkplaceRolesUpdateRequestModel, +) from ..models.WorkplaceRolesUpdateResponse import ( WorkplaceRolesUpdateResponse as WorkplaceRolesUpdateResponseModel, ) +from ..models.ListPermissionsResponse import ( + ListPermissionsResponse as ListPermissionsResponseModel, +) class WorkplaceRoles(BaseService): @@ -34,36 +40,23 @@ def list(self) -> WorkplaceRolesListResponseModel: return WorkplaceRolesListResponseModel(**res) return res - def create(self) -> WorkplaceRolesCreateResponseModel: + def create( + self, request_input: WorkplaceRolesCreateRequestModel = None + ) -> WorkplaceRolesCreateResponseModel: """ Create """ url_endpoint = "/v3/workplace/roles" - headers = {} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) final_url = self._url_prefix + url_endpoint - res = self._http.post(final_url, headers, {}, True) + res = self._http.post(final_url, headers, request_input, True) if res and isinstance(res, dict): return WorkplaceRolesCreateResponseModel(**res) return res - def list_permissions(self) -> ListPermissionsResponseModel: - """ - List Permissions - """ - - url_endpoint = "/v3/workplace/permissions" - headers = {} - self._add_required_headers(headers) - - final_url = self._url_prefix + url_endpoint - res = self._http.get(final_url, headers, True) - if res and isinstance(res, dict): - return ListPermissionsResponseModel(**res) - return res - def get(self, role: str) -> WorkplaceRolesGetResponseModel: """ Retrieve @@ -88,17 +81,19 @@ def get(self, role: str) -> WorkplaceRolesGetResponseModel: return WorkplaceRolesGetResponseModel(**res) return res - def update(self, role: str) -> WorkplaceRolesUpdateResponseModel: + def update( + self, role: str, request_input: WorkplaceRolesUpdateRequestModel = None + ) -> WorkplaceRolesUpdateResponseModel: """ Update Parameters: ---------- role: str - The role's unique identifier + The role's unique identifier, which is the initial name the role was given """ url_endpoint = "/v3/workplace/roles/role/{role}" - headers = {} + headers = {"Content-Type": "application/json"} self._add_required_headers(headers) if not role: raise ValueError("Parameter role is required, cannot be empty or blank.") @@ -107,7 +102,7 @@ def update(self, role: str) -> WorkplaceRolesUpdateResponseModel: quote(str(query_serializer.serialize_path("simple", False, role, None))), ) final_url = self._url_prefix + url_endpoint - res = self._http.patch(final_url, headers, {}, True) + res = self._http.patch(final_url, headers, request_input, True) if res and isinstance(res, dict): return WorkplaceRolesUpdateResponseModel(**res) return res @@ -133,3 +128,18 @@ def delete(self, role: str): final_url = self._url_prefix + url_endpoint res = self._http.delete(final_url, headers, True) return res + + def list_permissions(self) -> ListPermissionsResponseModel: + """ + List Permissions + """ + + url_endpoint = "/v3/workplace/permissions" + headers = {} + self._add_required_headers(headers) + + final_url = self._url_prefix + url_endpoint + res = self._http.get(final_url, headers, True) + if res and isinstance(res, dict): + return ListPermissionsResponseModel(**res) + return res diff --git a/src/dopplersdk/setup.py b/src/dopplersdk/setup.py index ca46dcd..8e85911 100644 --- a/src/dopplersdk/setup.py +++ b/src/dopplersdk/setup.py @@ -2,7 +2,7 @@ setuptools.setup( name="DopplerSDK", - version="1.2.1", + version="1.3.0", license="MIT", packages=setuptools.find_packages(), ) diff --git a/test/models/test_activity_logs_list_response.py b/test/models/test_activity_logs_list_response.py index 3bea333..b71583d 100644 --- a/test/models/test_activity_logs_list_response.py +++ b/test/models/test_activity_logs_list_response.py @@ -8,9 +8,9 @@ def test_true(self): def test_activity_logs_list_response(self): # Create ActivityLogsListResponse class instance - test_model = ActivityLogsListResponse(page=4, logs=["illo", "eos"]) + test_model = ActivityLogsListResponse(page=4, logs=["molestiae", "at"]) self.assertEqual(test_model.page, 4) - self.assertEqual(test_model.logs, ["illo", "eos"]) + self.assertEqual(test_model.logs, ["molestiae", "at"]) if __name__ == "__main__": diff --git a/test/models/test_add_member_request.py b/test/models/test_add_member_request.py index 2ebe729..c594479 100644 --- a/test/models/test_add_member_request.py +++ b/test/models/test_add_member_request.py @@ -8,9 +8,9 @@ def test_true(self): def test_add_member_request(self): # Create AddMemberRequest class instance - test_model = AddMemberRequest(type_="workplace_user", slug="qui") + test_model = AddMemberRequest(type_="workplace_user", slug="quisquam") self.assertEqual(test_model.type_, "workplace_user") - self.assertEqual(test_model.slug, "qui") + self.assertEqual(test_model.slug, "quisquam") def test_add_member_request_required_fields_missing(self): # Assert AddMemberRequest class generation fails without required fields diff --git a/test/models/test_add_request.py b/test/models/test_add_request.py index ab542a3..aa7d3bb 100644 --- a/test/models/test_add_request.py +++ b/test/models/test_add_request.py @@ -10,14 +10,14 @@ def test_add_request(self): # Create AddRequest class instance test_model = AddRequest( type_="workplace_user", - slug="aperiam", - role="consequuntur", - environments=["natus", "eum"], + slug="officiis", + role="ipsum", + environments=["facere", "eum"], ) self.assertEqual(test_model.type_, "workplace_user") - self.assertEqual(test_model.slug, "aperiam") - self.assertEqual(test_model.role, "consequuntur") - self.assertEqual(test_model.environments, ["natus", "eum"]) + self.assertEqual(test_model.slug, "officiis") + self.assertEqual(test_model.role, "ipsum") + self.assertEqual(test_model.environments, ["facere", "eum"]) def test_add_request_required_fields_missing(self): # Assert AddRequest class generation fails without required fields diff --git a/test/models/test_add_response.py b/test/models/test_add_response.py index fd1bdac..4103004 100644 --- a/test/models/test_add_response.py +++ b/test/models/test_add_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_add_response(self): # Create AddResponse class instance - test_model = AddResponse(member={"aliquid": 6}) - self.assertEqual(test_model.member, {"aliquid": 6}) + test_model = AddResponse(member={"omnis": 5}) + self.assertEqual(test_model.member, {"omnis": 5}) if __name__ == "__main__": diff --git a/test/models/test_add_trusted_ip_request.py b/test/models/test_add_trusted_ip_request.py index d7fd812..bf6433c 100644 --- a/test/models/test_add_trusted_ip_request.py +++ b/test/models/test_add_trusted_ip_request.py @@ -8,8 +8,8 @@ def test_true(self): def test_add_trusted_ip_request(self): # Create AddTrustedIpRequest class instance - test_model = AddTrustedIpRequest(ip="nihil") - self.assertEqual(test_model.ip, "nihil") + test_model = AddTrustedIpRequest(ip="fugit") + self.assertEqual(test_model.ip, "fugit") def test_add_trusted_ip_request_required_fields_missing(self): # Assert AddTrustedIpRequest class generation fails without required fields diff --git a/test/models/test_add_trusted_ip_response.py b/test/models/test_add_trusted_ip_response.py index 978c2c8..a94c8e4 100644 --- a/test/models/test_add_trusted_ip_response.py +++ b/test/models/test_add_trusted_ip_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_add_trusted_ip_response(self): # Create AddTrustedIpResponse class instance - test_model = AddTrustedIpResponse(ip="explicabo") - self.assertEqual(test_model.ip, "explicabo") + test_model = AddTrustedIpResponse(ip="laboriosam") + self.assertEqual(test_model.ip, "laboriosam") if __name__ == "__main__": diff --git a/test/models/test_clone_request.py b/test/models/test_clone_request.py index f28630c..5bd11c6 100644 --- a/test/models/test_clone_request.py +++ b/test/models/test_clone_request.py @@ -8,12 +8,10 @@ def test_true(self): def test_clone_request(self): # Create CloneRequest class instance - test_model = CloneRequest( - name="voluptatibus", config="deserunt", project="odit" - ) - self.assertEqual(test_model.name, "voluptatibus") - self.assertEqual(test_model.config, "deserunt") - self.assertEqual(test_model.project, "odit") + test_model = CloneRequest(name="quidem", config="incidunt", project="beatae") + self.assertEqual(test_model.name, "quidem") + self.assertEqual(test_model.config, "incidunt") + self.assertEqual(test_model.project, "beatae") def test_clone_request_required_fields_missing(self): # Assert CloneRequest class generation fails without required fields diff --git a/test/models/test_clone_response.py b/test/models/test_clone_response.py index b924aae..9e8499d 100644 --- a/test/models/test_clone_response.py +++ b/test/models/test_clone_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_clone_response(self): # Create CloneResponse class instance - test_model = CloneResponse(config={"possimus": 4}) - self.assertEqual(test_model.config, {"possimus": 4}) + test_model = CloneResponse(config={"eos": 1}) + self.assertEqual(test_model.config, {"eos": 1}) if __name__ == "__main__": diff --git a/test/models/test_config_logs_get_response.py b/test/models/test_config_logs_get_response.py index 0512162..bbb7f54 100644 --- a/test/models/test_config_logs_get_response.py +++ b/test/models/test_config_logs_get_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_config_logs_get_response(self): # Create ConfigLogsGetResponse class instance - test_model = ConfigLogsGetResponse(log={"quae": 8}) - self.assertEqual(test_model.log, {"quae": 8}) + test_model = ConfigLogsGetResponse(log={"reiciendis": 4}) + self.assertEqual(test_model.log, {"reiciendis": 4}) if __name__ == "__main__": diff --git a/test/models/test_config_logs_list_response.py b/test/models/test_config_logs_list_response.py index 9e01f99..e947ada 100644 --- a/test/models/test_config_logs_list_response.py +++ b/test/models/test_config_logs_list_response.py @@ -8,9 +8,9 @@ def test_true(self): def test_config_logs_list_response(self): # Create ConfigLogsListResponse class instance - test_model = ConfigLogsListResponse(page=1, logs=["laborum", "ducimus"]) - self.assertEqual(test_model.page, 1) - self.assertEqual(test_model.logs, ["laborum", "ducimus"]) + test_model = ConfigLogsListResponse(page=2, logs=["aspernatur", "fuga"]) + self.assertEqual(test_model.page, 2) + self.assertEqual(test_model.logs, ["aspernatur", "fuga"]) if __name__ == "__main__": diff --git a/test/models/test_configs_create_request.py b/test/models/test_configs_create_request.py index a47c46c..2faa04d 100644 --- a/test/models/test_configs_create_request.py +++ b/test/models/test_configs_create_request.py @@ -9,11 +9,11 @@ def test_true(self): def test_configs_create_request(self): # Create ConfigsCreateRequest class instance test_model = ConfigsCreateRequest( - name="ratione", environment="delectus", project="iusto" + name="odio", environment="cum", project="laborum" ) - self.assertEqual(test_model.name, "ratione") - self.assertEqual(test_model.environment, "delectus") - self.assertEqual(test_model.project, "iusto") + self.assertEqual(test_model.name, "odio") + self.assertEqual(test_model.environment, "cum") + self.assertEqual(test_model.project, "laborum") def test_configs_create_request_required_fields_missing(self): # Assert ConfigsCreateRequest class generation fails without required fields diff --git a/test/models/test_configs_create_response.py b/test/models/test_configs_create_response.py index b27ec82..da061a5 100644 --- a/test/models/test_configs_create_response.py +++ b/test/models/test_configs_create_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_configs_create_response(self): # Create ConfigsCreateResponse class instance - test_model = ConfigsCreateResponse(config={"deserunt": 7}) - self.assertEqual(test_model.config, {"deserunt": 7}) + test_model = ConfigsCreateResponse(config={"culpa": 2}) + self.assertEqual(test_model.config, {"culpa": 2}) if __name__ == "__main__": diff --git a/test/models/test_configs_delete_request.py b/test/models/test_configs_delete_request.py index cd12037..a7b37f5 100644 --- a/test/models/test_configs_delete_request.py +++ b/test/models/test_configs_delete_request.py @@ -8,9 +8,9 @@ def test_true(self): def test_configs_delete_request(self): # Create ConfigsDeleteRequest class instance - test_model = ConfigsDeleteRequest(config="hic", project="quas") - self.assertEqual(test_model.config, "hic") - self.assertEqual(test_model.project, "quas") + test_model = ConfigsDeleteRequest(config="quis", project="nesciunt") + self.assertEqual(test_model.config, "quis") + self.assertEqual(test_model.project, "nesciunt") def test_configs_delete_request_required_fields_missing(self): # Assert ConfigsDeleteRequest class generation fails without required fields diff --git a/test/models/test_configs_get_response.py b/test/models/test_configs_get_response.py index 1272697..054469d 100644 --- a/test/models/test_configs_get_response.py +++ b/test/models/test_configs_get_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_configs_get_response(self): # Create ConfigsGetResponse class instance - test_model = ConfigsGetResponse(config={"libero": 4}) - self.assertEqual(test_model.config, {"libero": 4}) + test_model = ConfigsGetResponse(config={"dolorem": 3}) + self.assertEqual(test_model.config, {"dolorem": 3}) if __name__ == "__main__": diff --git a/test/models/test_configs_list_response.py b/test/models/test_configs_list_response.py index a95f656..38d12e7 100644 --- a/test/models/test_configs_list_response.py +++ b/test/models/test_configs_list_response.py @@ -8,9 +8,9 @@ def test_true(self): def test_configs_list_response(self): # Create ConfigsListResponse class instance - test_model = ConfigsListResponse(page=2, configs=["quo", "iusto"]) - self.assertEqual(test_model.page, 2) - self.assertEqual(test_model.configs, ["quo", "iusto"]) + test_model = ConfigsListResponse(page=1, configs=["perferendis", "magnam"]) + self.assertEqual(test_model.page, 1) + self.assertEqual(test_model.configs, ["perferendis", "magnam"]) if __name__ == "__main__": diff --git a/test/models/test_configs_update_request.py b/test/models/test_configs_update_request.py index f6668b5..9714b11 100644 --- a/test/models/test_configs_update_request.py +++ b/test/models/test_configs_update_request.py @@ -8,12 +8,10 @@ def test_true(self): def test_configs_update_request(self): # Create ConfigsUpdateRequest class instance - test_model = ConfigsUpdateRequest( - name="dolores", config="doloribus", project="repudiandae" - ) - self.assertEqual(test_model.name, "dolores") - self.assertEqual(test_model.config, "doloribus") - self.assertEqual(test_model.project, "repudiandae") + test_model = ConfigsUpdateRequest(name="magnam", config="tempore", project="ut") + self.assertEqual(test_model.name, "magnam") + self.assertEqual(test_model.config, "tempore") + self.assertEqual(test_model.project, "ut") def test_configs_update_request_required_fields_missing(self): # Assert ConfigsUpdateRequest class generation fails without required fields diff --git a/test/models/test_configs_update_response.py b/test/models/test_configs_update_response.py index 0d09d45..8f5d980 100644 --- a/test/models/test_configs_update_response.py +++ b/test/models/test_configs_update_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_configs_update_response(self): # Create ConfigsUpdateResponse class instance - test_model = ConfigsUpdateResponse(config={"neque": 9}) - self.assertEqual(test_model.config, {"neque": 9}) + test_model = ConfigsUpdateResponse(config={"eum": 7}) + self.assertEqual(test_model.config, {"eum": 7}) if __name__ == "__main__": diff --git a/test/models/test_create_request.py b/test/models/test_create_request.py index bd4bf80..1c594dc 100644 --- a/test/models/test_create_request.py +++ b/test/models/test_create_request.py @@ -8,9 +8,9 @@ def test_true(self): def test_create_request(self): # Create CreateRequest class instance - test_model = CreateRequest(name="corporis", description="animi") - self.assertEqual(test_model.name, "corporis") - self.assertEqual(test_model.description, "animi") + test_model = CreateRequest(name="sint", description="aspernatur") + self.assertEqual(test_model.name, "sint") + self.assertEqual(test_model.description, "aspernatur") def test_create_request_required_fields_missing(self): # Assert CreateRequest class generation fails without required fields diff --git a/test/models/test_create_response.py b/test/models/test_create_response.py index a9d76a4..825eb3e 100644 --- a/test/models/test_create_response.py +++ b/test/models/test_create_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_create_response(self): # Create CreateResponse class instance - test_model = CreateResponse(project={"necessitatibus": 5}) - self.assertEqual(test_model.project, {"necessitatibus": 5}) + test_model = CreateResponse(project={"veritatis": 9}) + self.assertEqual(test_model.project, {"veritatis": 9}) if __name__ == "__main__": diff --git a/test/models/test_delete_request.py b/test/models/test_delete_request.py index a5222ea..25ee3b3 100644 --- a/test/models/test_delete_request.py +++ b/test/models/test_delete_request.py @@ -8,8 +8,8 @@ def test_true(self): def test_delete_request(self): # Create DeleteRequest class instance - test_model = DeleteRequest(project="numquam") - self.assertEqual(test_model.project, "numquam") + test_model = DeleteRequest(project="esse") + self.assertEqual(test_model.project, "esse") def test_delete_request_required_fields_missing(self): # Assert DeleteRequest class generation fails without required fields diff --git a/test/models/test_delete_trusted_ip_request.py b/test/models/test_delete_trusted_ip_request.py index 0c3e6bc..52fc8e0 100644 --- a/test/models/test_delete_trusted_ip_request.py +++ b/test/models/test_delete_trusted_ip_request.py @@ -8,8 +8,8 @@ def test_true(self): def test_delete_trusted_ip_request(self): # Create DeleteTrustedIpRequest class instance - test_model = DeleteTrustedIpRequest(ip="illo") - self.assertEqual(test_model.ip, "illo") + test_model = DeleteTrustedIpRequest(ip="repellat") + self.assertEqual(test_model.ip, "repellat") def test_delete_trusted_ip_request_required_fields_missing(self): # Assert DeleteTrustedIpRequest class generation fails without required fields diff --git a/test/models/test_disable_response.py b/test/models/test_disable_response.py new file mode 100644 index 0000000..afc60d9 --- /dev/null +++ b/test/models/test_disable_response.py @@ -0,0 +1,15 @@ +import unittest +from src.dopplersdk.models.DisableResponse import DisableResponse + + +class TestDisableResponseModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_disable_response(self): + # Create DisableResponse class instance + test_model = DisableResponse() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_download_response.py b/test/models/test_download_response.py index 7da54c9..9aec0df 100644 --- a/test/models/test_download_response.py +++ b/test/models/test_download_response.py @@ -9,12 +9,12 @@ def test_true(self): def test_download_response(self): # Create DownloadResponse class instance test_model = DownloadResponse( - STRIPE="consequuntur", ALGOLIA="expedita", DATABASE="officia", USER="vel" + STRIPE="voluptatum", ALGOLIA="expedita", DATABASE="excepturi", USER="iste" ) - self.assertEqual(test_model.STRIPE, "consequuntur") + self.assertEqual(test_model.STRIPE, "voluptatum") self.assertEqual(test_model.ALGOLIA, "expedita") - self.assertEqual(test_model.DATABASE, "officia") - self.assertEqual(test_model.USER, "vel") + self.assertEqual(test_model.DATABASE, "excepturi") + self.assertEqual(test_model.USER, "iste") if __name__ == "__main__": diff --git a/test/models/test_enable_response.py b/test/models/test_enable_response.py new file mode 100644 index 0000000..7448fcb --- /dev/null +++ b/test/models/test_enable_response.py @@ -0,0 +1,15 @@ +import unittest +from src.dopplersdk.models.EnableResponse import EnableResponse + + +class TestEnableResponseModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_enable_response(self): + # Create EnableResponse class instance + test_model = EnableResponse() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_environments_create_request.py b/test/models/test_environments_create_request.py index 9c3a3aa..4574600 100644 --- a/test/models/test_environments_create_request.py +++ b/test/models/test_environments_create_request.py @@ -8,9 +8,9 @@ def test_true(self): def test_environments_create_request(self): # Create EnvironmentsCreateRequest class instance - test_model = EnvironmentsCreateRequest(slug="nisi", name="esse") - self.assertEqual(test_model.slug, "nisi") - self.assertEqual(test_model.name, "esse") + test_model = EnvironmentsCreateRequest(slug="at", name="dolorum") + self.assertEqual(test_model.slug, "at") + self.assertEqual(test_model.name, "dolorum") def test_environments_create_request_required_fields_missing(self): # Assert EnvironmentsCreateRequest class generation fails without required fields diff --git a/test/models/test_environments_create_response.py b/test/models/test_environments_create_response.py index 529a83c..ae55351 100644 --- a/test/models/test_environments_create_response.py +++ b/test/models/test_environments_create_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_environments_create_response(self): # Create EnvironmentsCreateResponse class instance - test_model = EnvironmentsCreateResponse(environment={"voluptas": 3}) - self.assertEqual(test_model.environment, {"voluptas": 3}) + test_model = EnvironmentsCreateResponse(environment={"dolores": 4}) + self.assertEqual(test_model.environment, {"dolores": 4}) if __name__ == "__main__": diff --git a/test/models/test_environments_get_response.py b/test/models/test_environments_get_response.py index 78b1f74..72dd342 100644 --- a/test/models/test_environments_get_response.py +++ b/test/models/test_environments_get_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_environments_get_response(self): # Create EnvironmentsGetResponse class instance - test_model = EnvironmentsGetResponse(environment={"delectus": 2}) - self.assertEqual(test_model.environment, {"delectus": 2}) + test_model = EnvironmentsGetResponse(environment={"numquam": 5}) + self.assertEqual(test_model.environment, {"numquam": 5}) if __name__ == "__main__": diff --git a/test/models/test_environments_list_response.py b/test/models/test_environments_list_response.py index 4008843..6712598 100644 --- a/test/models/test_environments_list_response.py +++ b/test/models/test_environments_list_response.py @@ -8,9 +8,9 @@ def test_true(self): def test_environments_list_response(self): # Create EnvironmentsListResponse class instance - test_model = EnvironmentsListResponse(environments=["ipsa", "veniam"], page=5) - self.assertEqual(test_model.environments, ["ipsa", "veniam"]) - self.assertEqual(test_model.page, 5) + test_model = EnvironmentsListResponse(environments=["sunt", "itaque"], page=4) + self.assertEqual(test_model.environments, ["sunt", "itaque"]) + self.assertEqual(test_model.page, 4) if __name__ == "__main__": diff --git a/test/models/test_get_response.py b/test/models/test_get_response.py index cc2bef2..ccf2bbf 100644 --- a/test/models/test_get_response.py +++ b/test/models/test_get_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_get_response(self): # Create GetResponse class instance - test_model = GetResponse(log={"dolor": 6}) - self.assertEqual(test_model.log, {"dolor": 6}) + test_model = GetResponse(project={"quia": 4}) + self.assertEqual(test_model.project, {"quia": 4}) if __name__ == "__main__": diff --git a/test/models/test_get_user_response.py b/test/models/test_get_user_response.py index 877aa31..01f7a74 100644 --- a/test/models/test_get_user_response.py +++ b/test/models/test_get_user_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_get_user_response(self): # Create GetUserResponse class instance - test_model = GetUserResponse(workplace_user={"culpa": 9}, success=True) - self.assertEqual(test_model.workplace_user, {"culpa": 9}) + test_model = GetUserResponse(workplace_user={"quisquam": 4}, success=True) + self.assertEqual(test_model.workplace_user, {"quisquam": 4}) self.assertEqual(test_model.success, True) diff --git a/test/models/test_groups_create_request.py b/test/models/test_groups_create_request.py index 7eb11f1..5c6f782 100644 --- a/test/models/test_groups_create_request.py +++ b/test/models/test_groups_create_request.py @@ -8,9 +8,11 @@ def test_true(self): def test_groups_create_request(self): # Create GroupsCreateRequest class instance - test_model = GroupsCreateRequest(name="ipsum", default_project_role="corporis") - self.assertEqual(test_model.name, "ipsum") - self.assertEqual(test_model.default_project_role, "corporis") + test_model = GroupsCreateRequest( + name="accusamus", default_project_role="fugiat" + ) + self.assertEqual(test_model.name, "accusamus") + self.assertEqual(test_model.default_project_role, "fugiat") def test_groups_create_request_required_fields_missing(self): # Assert GroupsCreateRequest class generation fails without required fields diff --git a/test/models/test_groups_create_response.py b/test/models/test_groups_create_response.py index 02df04b..2911043 100644 --- a/test/models/test_groups_create_response.py +++ b/test/models/test_groups_create_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_groups_create_response(self): # Create GroupsCreateResponse class instance - test_model = GroupsCreateResponse(group={"repudiandae": 5}) - self.assertEqual(test_model.group, {"repudiandae": 5}) + test_model = GroupsCreateResponse(group={"est": 1}) + self.assertEqual(test_model.group, {"est": 1}) if __name__ == "__main__": diff --git a/test/models/test_groups_get_response.py b/test/models/test_groups_get_response.py index 0e3d1d1..be7b851 100644 --- a/test/models/test_groups_get_response.py +++ b/test/models/test_groups_get_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_groups_get_response(self): # Create GroupsGetResponse class instance - test_model = GroupsGetResponse(group={"optio": 9}) - self.assertEqual(test_model.group, {"optio": 9}) + test_model = GroupsGetResponse(group={"voluptates": 5}) + self.assertEqual(test_model.group, {"voluptates": 5}) if __name__ == "__main__": diff --git a/test/models/test_groups_list_response.py b/test/models/test_groups_list_response.py index 3b670f3..8401691 100644 --- a/test/models/test_groups_list_response.py +++ b/test/models/test_groups_list_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_groups_list_response(self): # Create GroupsListResponse class instance - test_model = GroupsListResponse(groups=["quod", "earum"]) - self.assertEqual(test_model.groups, ["quod", "earum"]) + test_model = GroupsListResponse(groups=["recusandae", "dicta"]) + self.assertEqual(test_model.groups, ["recusandae", "dicta"]) if __name__ == "__main__": diff --git a/test/models/test_groups_update_request.py b/test/models/test_groups_update_request.py index b920347..b7c691a 100644 --- a/test/models/test_groups_update_request.py +++ b/test/models/test_groups_update_request.py @@ -8,9 +8,9 @@ def test_true(self): def test_groups_update_request(self): # Create GroupsUpdateRequest class instance - test_model = GroupsUpdateRequest(name="enim", default_project_role="nemo") + test_model = GroupsUpdateRequest(name="enim", default_project_role="laudantium") self.assertEqual(test_model.name, "enim") - self.assertEqual(test_model.default_project_role, "nemo") + self.assertEqual(test_model.default_project_role, "laudantium") if __name__ == "__main__": diff --git a/test/models/test_groups_update_response.py b/test/models/test_groups_update_response.py index 83ece07..0a785e5 100644 --- a/test/models/test_groups_update_response.py +++ b/test/models/test_groups_update_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_groups_update_response(self): # Create GroupsUpdateResponse class instance - test_model = GroupsUpdateResponse(group={"doloremque": 8}) - self.assertEqual(test_model.group, {"doloremque": 8}) + test_model = GroupsUpdateResponse(group={"quo": 4}) + self.assertEqual(test_model.group, {"quo": 4}) if __name__ == "__main__": diff --git a/test/models/test_integrations_create_request.py b/test/models/test_integrations_create_request.py index 814e272..2d98490 100644 --- a/test/models/test_integrations_create_request.py +++ b/test/models/test_integrations_create_request.py @@ -9,11 +9,11 @@ def test_true(self): def test_integrations_create_request(self): # Create IntegrationsCreateRequest class instance test_model = IntegrationsCreateRequest( - type_="deserunt", name="repellat", data={"sed": 7} + type_="dolorum", name="distinctio", data={"consequuntur": 5} ) - self.assertEqual(test_model.type_, "deserunt") - self.assertEqual(test_model.name, "repellat") - self.assertEqual(test_model.data, {"sed": 7}) + self.assertEqual(test_model.type_, "dolorum") + self.assertEqual(test_model.name, "distinctio") + self.assertEqual(test_model.data, {"consequuntur": 5}) def test_integrations_create_request_required_fields_missing(self): # Assert IntegrationsCreateRequest class generation fails without required fields diff --git a/test/models/test_integrations_create_response.py b/test/models/test_integrations_create_response.py index 82e2102..598f3b4 100644 --- a/test/models/test_integrations_create_response.py +++ b/test/models/test_integrations_create_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_integrations_create_response(self): # Create IntegrationsCreateResponse class instance - test_model = IntegrationsCreateResponse(integration={"hic": 9}) - self.assertEqual(test_model.integration, {"hic": 9}) + test_model = IntegrationsCreateResponse(integration={"est": 5}) + self.assertEqual(test_model.integration, {"est": 5}) if __name__ == "__main__": diff --git a/test/models/test_integrations_get_response.py b/test/models/test_integrations_get_response.py index 0f6d6f5..9ef9fa8 100644 --- a/test/models/test_integrations_get_response.py +++ b/test/models/test_integrations_get_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_integrations_get_response(self): # Create IntegrationsGetResponse class instance - test_model = IntegrationsGetResponse(integration={"voluptas": 2}) - self.assertEqual(test_model.integration, {"voluptas": 2}) + test_model = IntegrationsGetResponse(integration={"accusantium": 8}) + self.assertEqual(test_model.integration, {"accusantium": 8}) if __name__ == "__main__": diff --git a/test/models/test_integrations_list_response.py b/test/models/test_integrations_list_response.py index 2297df3..c08c554 100644 --- a/test/models/test_integrations_list_response.py +++ b/test/models/test_integrations_list_response.py @@ -9,9 +9,9 @@ def test_true(self): def test_integrations_list_response(self): # Create IntegrationsListResponse class instance test_model = IntegrationsListResponse( - integrations=["reprehenderit", "reiciendis"], success=True + integrations=["iste", "enim"], success=True ) - self.assertEqual(test_model.integrations, ["reprehenderit", "reiciendis"]) + self.assertEqual(test_model.integrations, ["iste", "enim"]) self.assertEqual(test_model.success, True) diff --git a/test/models/test_integrations_update_request.py b/test/models/test_integrations_update_request.py index c399d49..62e198d 100644 --- a/test/models/test_integrations_update_request.py +++ b/test/models/test_integrations_update_request.py @@ -8,9 +8,9 @@ def test_true(self): def test_integrations_update_request(self): # Create IntegrationsUpdateRequest class instance - test_model = IntegrationsUpdateRequest(name="corrupti", data="voluptatem") - self.assertEqual(test_model.name, "corrupti") - self.assertEqual(test_model.data, "voluptatem") + test_model = IntegrationsUpdateRequest(name="modi", data="deleniti") + self.assertEqual(test_model.name, "modi") + self.assertEqual(test_model.data, "deleniti") if __name__ == "__main__": diff --git a/test/models/test_invites_list_response.py b/test/models/test_invites_list_response.py index ff211b9..d15a903 100644 --- a/test/models/test_invites_list_response.py +++ b/test/models/test_invites_list_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_invites_list_response(self): # Create InvitesListResponse class instance - test_model = InvitesListResponse(invites=["blanditiis", "assumenda"]) - self.assertEqual(test_model.invites, ["blanditiis", "assumenda"]) + test_model = InvitesListResponse(invites=["mollitia", "ex"]) + self.assertEqual(test_model.invites, ["mollitia", "ex"]) if __name__ == "__main__": diff --git a/test/models/test_issue_lease_request.py b/test/models/test_issue_lease_request.py index 13f3cf3..c9f3f65 100644 --- a/test/models/test_issue_lease_request.py +++ b/test/models/test_issue_lease_request.py @@ -9,12 +9,12 @@ def test_true(self): def test_issue_lease_request(self): # Create IssueLeaseRequest class instance test_model = IssueLeaseRequest( - ttl_sec=3, dynamic_secret="cumque", config="debitis", project="molestiae" + ttl_sec=6, dynamic_secret="provident", config="rerum", project="tempore" ) - self.assertEqual(test_model.ttl_sec, 3) - self.assertEqual(test_model.dynamic_secret, "cumque") - self.assertEqual(test_model.config, "debitis") - self.assertEqual(test_model.project, "molestiae") + self.assertEqual(test_model.ttl_sec, 6) + self.assertEqual(test_model.dynamic_secret, "provident") + self.assertEqual(test_model.config, "rerum") + self.assertEqual(test_model.project, "tempore") def test_issue_lease_request_required_fields_missing(self): # Assert IssueLeaseRequest class generation fails without required fields diff --git a/test/models/test_issue_lease_response.py b/test/models/test_issue_lease_response.py index 8a0293b..86d82b1 100644 --- a/test/models/test_issue_lease_response.py +++ b/test/models/test_issue_lease_response.py @@ -9,12 +9,12 @@ def test_true(self): def test_issue_lease_response(self): # Create IssueLeaseResponse class instance test_model = IssueLeaseResponse( - success=True, id="harum", expires_at="molestiae", value={"deserunt": 4} + success=True, id="quidem", expires_at="repellat", value={"distinctio": 4} ) self.assertEqual(test_model.success, True) - self.assertEqual(test_model.id, "harum") - self.assertEqual(test_model.expires_at, "molestiae") - self.assertEqual(test_model.value, {"deserunt": 4}) + self.assertEqual(test_model.id, "quidem") + self.assertEqual(test_model.expires_at, "repellat") + self.assertEqual(test_model.value, {"distinctio": 4}) if __name__ == "__main__": diff --git a/test/models/test_list_permissions_response.py b/test/models/test_list_permissions_response.py index 5d2288e..67cb197 100644 --- a/test/models/test_list_permissions_response.py +++ b/test/models/test_list_permissions_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_list_permissions_response(self): # Create ListPermissionsResponse class instance - test_model = ListPermissionsResponse(permissions=["qui", "laudantium"]) - self.assertEqual(test_model.permissions, ["qui", "laudantium"]) + test_model = ListPermissionsResponse(permissions=["consequuntur", "pariatur"]) + self.assertEqual(test_model.permissions, ["consequuntur", "pariatur"]) if __name__ == "__main__": diff --git a/test/models/test_list_response.py b/test/models/test_list_response.py index e03c432..524a781 100644 --- a/test/models/test_list_response.py +++ b/test/models/test_list_response.py @@ -8,9 +8,9 @@ def test_true(self): def test_list_response(self): # Create ListResponse class instance - test_model = ListResponse(page=7, projects=["corporis", "eaque"]) - self.assertEqual(test_model.page, 7) - self.assertEqual(test_model.projects, ["corporis", "eaque"]) + test_model = ListResponse(page=9, projects=["facilis", "dolorum"]) + self.assertEqual(test_model.page, 9) + self.assertEqual(test_model.projects, ["facilis", "dolorum"]) if __name__ == "__main__": diff --git a/test/models/test_list_trusted_ips_response.py b/test/models/test_list_trusted_ips_response.py index 2b133a6..ac35f7c 100644 --- a/test/models/test_list_trusted_ips_response.py +++ b/test/models/test_list_trusted_ips_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_list_trusted_ips_response(self): # Create ListTrustedIpsResponse class instance - test_model = ListTrustedIpsResponse(ips=["tempora", "delectus"]) - self.assertEqual(test_model.ips, ["tempora", "delectus"]) + test_model = ListTrustedIpsResponse(ips=["magnam", "exercitationem"]) + self.assertEqual(test_model.ips, ["magnam", "exercitationem"]) if __name__ == "__main__": diff --git a/test/models/test_lock_request.py b/test/models/test_lock_request.py index 706ed2e..6eba8fa 100644 --- a/test/models/test_lock_request.py +++ b/test/models/test_lock_request.py @@ -8,9 +8,9 @@ def test_true(self): def test_lock_request(self): # Create LockRequest class instance - test_model = LockRequest(config="fuga", project="sint") - self.assertEqual(test_model.config, "fuga") - self.assertEqual(test_model.project, "sint") + test_model = LockRequest(config="aliquam", project="voluptates") + self.assertEqual(test_model.config, "aliquam") + self.assertEqual(test_model.project, "voluptates") def test_lock_request_required_fields_missing(self): # Assert LockRequest class generation fails without required fields diff --git a/test/models/test_lock_response.py b/test/models/test_lock_response.py index 80a08d9..597a778 100644 --- a/test/models/test_lock_response.py +++ b/test/models/test_lock_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_lock_response(self): # Create LockResponse class instance - test_model = LockResponse(config={"hic": 8}) - self.assertEqual(test_model.config, {"hic": 8}) + test_model = LockResponse(config={"dolorem": 1}) + self.assertEqual(test_model.config, {"dolorem": 1}) if __name__ == "__main__": diff --git a/test/models/test_me_response.py b/test/models/test_me_response.py index 883c019..1ce9148 100644 --- a/test/models/test_me_response.py +++ b/test/models/test_me_response.py @@ -9,21 +9,21 @@ def test_true(self): def test_me_response(self): # Create MeResponse class instance test_model = MeResponse( - slug="tempore", - name="rem", - created_at="nobis", - last_seen_at="nemo", - token_preview="iste", - workplace={"at": 9}, - type_="alias", + slug="ex", + name="dignissimos", + created_at="veritatis", + last_seen_at="temporibus", + token_preview="commodi", + workplace={"ipsam": 1}, + type_="veniam", ) - self.assertEqual(test_model.slug, "tempore") - self.assertEqual(test_model.name, "rem") - self.assertEqual(test_model.created_at, "nobis") - self.assertEqual(test_model.last_seen_at, "nemo") - self.assertEqual(test_model.token_preview, "iste") - self.assertEqual(test_model.workplace, {"at": 9}) - self.assertEqual(test_model.type_, "alias") + self.assertEqual(test_model.slug, "ex") + self.assertEqual(test_model.name, "dignissimos") + self.assertEqual(test_model.created_at, "veritatis") + self.assertEqual(test_model.last_seen_at, "temporibus") + self.assertEqual(test_model.token_preview, "commodi") + self.assertEqual(test_model.workplace, {"ipsam": 1}) + self.assertEqual(test_model.type_, "veniam") if __name__ == "__main__": diff --git a/test/models/test_member_response.py b/test/models/test_member_response.py new file mode 100644 index 0000000..9d40ef1 --- /dev/null +++ b/test/models/test_member_response.py @@ -0,0 +1,16 @@ +import unittest +from src.dopplersdk.models.MemberResponse import MemberResponse + + +class TestMemberResponseModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_member_response(self): + # Create MemberResponse class instance + test_model = MemberResponse(group={"ad": 9}) + self.assertEqual(test_model.group, {"ad": 9}) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_names_response.py b/test/models/test_names_response.py index a0ff481..7446d67 100644 --- a/test/models/test_names_response.py +++ b/test/models/test_names_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_names_response(self): # Create NamesResponse class instance - test_model = NamesResponse(names=["similique", "architecto"]) - self.assertEqual(test_model.names, ["similique", "architecto"]) + test_model = NamesResponse(names=["numquam", "doloremque"]) + self.assertEqual(test_model.names, ["numquam", "doloremque"]) if __name__ == "__main__": diff --git a/test/models/test_options_response.py b/test/models/test_options_response.py new file mode 100644 index 0000000..30c6ec5 --- /dev/null +++ b/test/models/test_options_response.py @@ -0,0 +1,15 @@ +import unittest +from src.dopplersdk.models.OptionsResponse import OptionsResponse + + +class TestOptionsResponseModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_options_response(self): + # Create OptionsResponse class instance + test_model = OptionsResponse() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_project_members_get_response.py b/test/models/test_project_members_get_response.py index 0f7f6c5..64a3413 100644 --- a/test/models/test_project_members_get_response.py +++ b/test/models/test_project_members_get_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_project_members_get_response(self): # Create ProjectMembersGetResponse class instance - test_model = ProjectMembersGetResponse(member={"suscipit": 7}) - self.assertEqual(test_model.member, {"suscipit": 7}) + test_model = ProjectMembersGetResponse(member={"iste": 5}) + self.assertEqual(test_model.member, {"iste": 5}) if __name__ == "__main__": diff --git a/test/models/test_project_members_list_response.py b/test/models/test_project_members_list_response.py index d3722ab..11ee92c 100644 --- a/test/models/test_project_members_list_response.py +++ b/test/models/test_project_members_list_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_project_members_list_response(self): # Create ProjectMembersListResponse class instance - test_model = ProjectMembersListResponse(members=["aut", "cupiditate"]) - self.assertEqual(test_model.members, ["aut", "cupiditate"]) + test_model = ProjectMembersListResponse(members=["nostrum", "vel"]) + self.assertEqual(test_model.members, ["nostrum", "vel"]) if __name__ == "__main__": diff --git a/test/models/test_project_members_update_request.py b/test/models/test_project_members_update_request.py index df58e28..91e5d24 100644 --- a/test/models/test_project_members_update_request.py +++ b/test/models/test_project_members_update_request.py @@ -11,10 +11,10 @@ def test_true(self): def test_project_members_update_request(self): # Create ProjectMembersUpdateRequest class instance test_model = ProjectMembersUpdateRequest( - role="inventore", environments=["dignissimos", "maxime"] + role="distinctio", environments=["sint", "accusantium"] ) - self.assertEqual(test_model.role, "inventore") - self.assertEqual(test_model.environments, ["dignissimos", "maxime"]) + self.assertEqual(test_model.role, "distinctio") + self.assertEqual(test_model.environments, ["sint", "accusantium"]) if __name__ == "__main__": diff --git a/test/models/test_project_members_update_response.py b/test/models/test_project_members_update_response.py index ef5bc73..6d1c048 100644 --- a/test/models/test_project_members_update_response.py +++ b/test/models/test_project_members_update_response.py @@ -10,8 +10,8 @@ def test_true(self): def test_project_members_update_response(self): # Create ProjectMembersUpdateResponse class instance - test_model = ProjectMembersUpdateResponse(member={"voluptatum": 4}) - self.assertEqual(test_model.member, {"voluptatum": 4}) + test_model = ProjectMembersUpdateResponse(member={"at": 4}) + self.assertEqual(test_model.member, {"at": 4}) if __name__ == "__main__": diff --git a/test/models/test_project_roles_create_request.py b/test/models/test_project_roles_create_request.py new file mode 100644 index 0000000..1880302 --- /dev/null +++ b/test/models/test_project_roles_create_request.py @@ -0,0 +1,24 @@ +import unittest +from src.dopplersdk.models.ProjectRolesCreateRequest import ProjectRolesCreateRequest + + +class TestProjectRolesCreateRequestModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_project_roles_create_request(self): + # Create ProjectRolesCreateRequest class instance + test_model = ProjectRolesCreateRequest( + permissions=["architecto", "omnis"], name="cum" + ) + self.assertEqual(test_model.permissions, ["architecto", "omnis"]) + self.assertEqual(test_model.name, "cum") + + def test_project_roles_create_request_required_fields_missing(self): + # Assert ProjectRolesCreateRequest class generation fails without required fields + with self.assertRaises(TypeError): + test_model = ProjectRolesCreateRequest() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_project_roles_create_response.py b/test/models/test_project_roles_create_response.py index 7f8a598..0442757 100644 --- a/test/models/test_project_roles_create_response.py +++ b/test/models/test_project_roles_create_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_project_roles_create_response(self): # Create ProjectRolesCreateResponse class instance - test_model = ProjectRolesCreateResponse(role={"voluptates": 4}) - self.assertEqual(test_model.role, {"voluptates": 4}) + test_model = ProjectRolesCreateResponse(role={"illum": 2}) + self.assertEqual(test_model.role, {"illum": 2}) if __name__ == "__main__": diff --git a/test/models/test_project_roles_get_response.py b/test/models/test_project_roles_get_response.py index c158a53..752739b 100644 --- a/test/models/test_project_roles_get_response.py +++ b/test/models/test_project_roles_get_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_project_roles_get_response(self): # Create ProjectRolesGetResponse class instance - test_model = ProjectRolesGetResponse(role={"doloremque": 9}) - self.assertEqual(test_model.role, {"doloremque": 9}) + test_model = ProjectRolesGetResponse(role={"repellat": 4}) + self.assertEqual(test_model.role, {"repellat": 4}) if __name__ == "__main__": diff --git a/test/models/test_project_roles_list_permissions_response.py b/test/models/test_project_roles_list_permissions_response.py index f3e3df9..f9a4956 100644 --- a/test/models/test_project_roles_list_permissions_response.py +++ b/test/models/test_project_roles_list_permissions_response.py @@ -10,8 +10,10 @@ def test_true(self): def test_project_roles_list_permissions_response(self): # Create ProjectRolesListPermissionsResponse class instance - test_model = ProjectRolesListPermissionsResponse(permissions=["ipsum", "hic"]) - self.assertEqual(test_model.permissions, ["ipsum", "hic"]) + test_model = ProjectRolesListPermissionsResponse( + permissions=["soluta", "iusto"] + ) + self.assertEqual(test_model.permissions, ["soluta", "iusto"]) if __name__ == "__main__": diff --git a/test/models/test_project_roles_list_response.py b/test/models/test_project_roles_list_response.py index ef4c27a..d389cff 100644 --- a/test/models/test_project_roles_list_response.py +++ b/test/models/test_project_roles_list_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_project_roles_list_response(self): # Create ProjectRolesListResponse class instance - test_model = ProjectRolesListResponse(roles=["asperiores", "ullam"]) - self.assertEqual(test_model.roles, ["asperiores", "ullam"]) + test_model = ProjectRolesListResponse(roles=["quae", "explicabo"]) + self.assertEqual(test_model.roles, ["quae", "explicabo"]) if __name__ == "__main__": diff --git a/test/models/test_project_roles_update_request.py b/test/models/test_project_roles_update_request.py new file mode 100644 index 0000000..f32a302 --- /dev/null +++ b/test/models/test_project_roles_update_request.py @@ -0,0 +1,19 @@ +import unittest +from src.dopplersdk.models.ProjectRolesUpdateRequest import ProjectRolesUpdateRequest + + +class TestProjectRolesUpdateRequestModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_project_roles_update_request(self): + # Create ProjectRolesUpdateRequest class instance + test_model = ProjectRolesUpdateRequest( + name="odio", permissions=["voluptatibus", "quia"] + ) + self.assertEqual(test_model.name, "odio") + self.assertEqual(test_model.permissions, ["voluptatibus", "quia"]) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_project_roles_update_response.py b/test/models/test_project_roles_update_response.py index 3d1334f..e634e8d 100644 --- a/test/models/test_project_roles_update_response.py +++ b/test/models/test_project_roles_update_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_project_roles_update_response(self): # Create ProjectRolesUpdateResponse class instance - test_model = ProjectRolesUpdateResponse(role={"unde": 7}) - self.assertEqual(test_model.role, {"unde": 7}) + test_model = ProjectRolesUpdateResponse(role={"alias": 7}) + self.assertEqual(test_model.role, {"alias": 7}) if __name__ == "__main__": diff --git a/test/models/test_rename_request.py b/test/models/test_rename_request.py index 23556fb..d29a626 100644 --- a/test/models/test_rename_request.py +++ b/test/models/test_rename_request.py @@ -8,9 +8,9 @@ def test_true(self): def test_rename_request(self): # Create RenameRequest class instance - test_model = RenameRequest(name="totam", slug="eaque") - self.assertEqual(test_model.name, "totam") - self.assertEqual(test_model.slug, "eaque") + test_model = RenameRequest(name="odio", slug="maxime") + self.assertEqual(test_model.name, "odio") + self.assertEqual(test_model.slug, "maxime") if __name__ == "__main__": diff --git a/test/models/test_rename_response.py b/test/models/test_rename_response.py index 1599079..2638b82 100644 --- a/test/models/test_rename_response.py +++ b/test/models/test_rename_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_rename_response(self): # Create RenameResponse class instance - test_model = RenameResponse(environment={"ipsum": 4}) - self.assertEqual(test_model.environment, {"ipsum": 4}) + test_model = RenameResponse(environment={"soluta": 7}) + self.assertEqual(test_model.environment, {"soluta": 7}) if __name__ == "__main__": diff --git a/test/models/test_retrieve_response.py b/test/models/test_retrieve_response.py index 661e931..f7a0b6a 100644 --- a/test/models/test_retrieve_response.py +++ b/test/models/test_retrieve_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_retrieve_response(self): # Create RetrieveResponse class instance - test_model = RetrieveResponse(log={"esse": 8}) - self.assertEqual(test_model.log, {"esse": 8}) + test_model = RetrieveResponse(log={"cupiditate": 7}) + self.assertEqual(test_model.log, {"cupiditate": 7}) if __name__ == "__main__": diff --git a/test/models/test_revoke_lease_request.py b/test/models/test_revoke_lease_request.py index 41cb43b..728d982 100644 --- a/test/models/test_revoke_lease_request.py +++ b/test/models/test_revoke_lease_request.py @@ -9,12 +9,15 @@ def test_true(self): def test_revoke_lease_request(self): # Create RevokeLeaseRequest class instance test_model = RevokeLeaseRequest( - slug="autem", dynamic_secret="animi", config="quis", project="non" + slug="iusto", + dynamic_secret="praesentium", + config="quis", + project="eligendi", ) - self.assertEqual(test_model.slug, "autem") - self.assertEqual(test_model.dynamic_secret, "animi") + self.assertEqual(test_model.slug, "iusto") + self.assertEqual(test_model.dynamic_secret, "praesentium") self.assertEqual(test_model.config, "quis") - self.assertEqual(test_model.project, "non") + self.assertEqual(test_model.project, "eligendi") def test_revoke_lease_request_required_fields_missing(self): # Assert RevokeLeaseRequest class generation fails without required fields diff --git a/test/models/test_revoke_request.py b/test/models/test_revoke_request.py index 5ff8439..8ecbcf5 100644 --- a/test/models/test_revoke_request.py +++ b/test/models/test_revoke_request.py @@ -8,8 +8,8 @@ def test_true(self): def test_revoke_request(self): # Create RevokeRequest class instance - test_model = RevokeRequest(token="veniam") - self.assertEqual(test_model.token, "veniam") + test_model = RevokeRequest(token="delectus") + self.assertEqual(test_model.token, "delectus") def test_revoke_request_required_fields_missing(self): # Assert RevokeRequest class generation fails without required fields diff --git a/test/models/test_rollback_response.py b/test/models/test_rollback_response.py index 434ddac..1096d45 100644 --- a/test/models/test_rollback_response.py +++ b/test/models/test_rollback_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_rollback_response(self): # Create RollbackResponse class instance - test_model = RollbackResponse(log={"placeat": 8}) - self.assertEqual(test_model.log, {"placeat": 8}) + test_model = RollbackResponse(log={"quaerat": 6}) + self.assertEqual(test_model.log, {"quaerat": 6}) if __name__ == "__main__": diff --git a/test/models/test_secrets_get_response.py b/test/models/test_secrets_get_response.py index 6976044..cd3995d 100644 --- a/test/models/test_secrets_get_response.py +++ b/test/models/test_secrets_get_response.py @@ -8,9 +8,9 @@ def test_true(self): def test_secrets_get_response(self): # Create SecretsGetResponse class instance - test_model = SecretsGetResponse(name="aut", value={"natus": 8}) - self.assertEqual(test_model.name, "aut") - self.assertEqual(test_model.value, {"natus": 8}) + test_model = SecretsGetResponse(name="aliquid", value={"dolorum": 4}) + self.assertEqual(test_model.name, "aliquid") + self.assertEqual(test_model.value, {"dolorum": 4}) if __name__ == "__main__": diff --git a/test/models/test_secrets_list_response.py b/test/models/test_secrets_list_response.py index aba4366..9cfac19 100644 --- a/test/models/test_secrets_list_response.py +++ b/test/models/test_secrets_list_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_secrets_list_response(self): # Create SecretsListResponse class instance - test_model = SecretsListResponse(secrets={"voluptates": 1}) - self.assertEqual(test_model.secrets, {"voluptates": 1}) + test_model = SecretsListResponse(secrets={"harum": 5}) + self.assertEqual(test_model.secrets, {"harum": 5}) if __name__ == "__main__": diff --git a/test/models/test_secrets_update_request.py b/test/models/test_secrets_update_request.py index 4cd09ab..299b02a 100644 --- a/test/models/test_secrets_update_request.py +++ b/test/models/test_secrets_update_request.py @@ -9,11 +9,15 @@ def test_true(self): def test_secrets_update_request(self): # Create SecretsUpdateRequest class instance test_model = SecretsUpdateRequest( - secrets={"eligendi": 8}, config="similique", project="eius" + config="perspiciatis", + project="id", + secrets={"quod": 4}, + change_requests=["sit", "error"], ) - self.assertEqual(test_model.secrets, {"eligendi": 8}) - self.assertEqual(test_model.config, "similique") - self.assertEqual(test_model.project, "eius") + self.assertEqual(test_model.config, "perspiciatis") + self.assertEqual(test_model.project, "id") + self.assertEqual(test_model.secrets, {"quod": 4}) + self.assertEqual(test_model.change_requests, ["sit", "error"]) def test_secrets_update_request_required_fields_missing(self): # Assert SecretsUpdateRequest class generation fails without required fields diff --git a/test/models/test_secrets_update_response.py b/test/models/test_secrets_update_response.py index 19ae896..189ac2d 100644 --- a/test/models/test_secrets_update_response.py +++ b/test/models/test_secrets_update_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_secrets_update_response(self): # Create SecretsUpdateResponse class instance - test_model = SecretsUpdateResponse(secrets={"odio": 2}) - self.assertEqual(test_model.secrets, {"odio": 2}) + test_model = SecretsUpdateResponse(secrets={"dolorum": 2}) + self.assertEqual(test_model.secrets, {"dolorum": 2}) if __name__ == "__main__": diff --git a/test/models/test_service_account_tokens_create_request.py b/test/models/test_service_account_tokens_create_request.py new file mode 100644 index 0000000..8cbb15c --- /dev/null +++ b/test/models/test_service_account_tokens_create_request.py @@ -0,0 +1,21 @@ +import unittest +from src.dopplersdk.models.ServiceAccountTokensCreateRequest import ( + ServiceAccountTokensCreateRequest, +) + + +class TestServiceAccountTokensCreateRequestModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_service_account_tokens_create_request(self): + # Create ServiceAccountTokensCreateRequest class instance + test_model = ServiceAccountTokensCreateRequest( + name="quam", expires_at="dolorem" + ) + self.assertEqual(test_model.name, "quam") + self.assertEqual(test_model.expires_at, "dolorem") + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_service_account_tokens_create_response.py b/test/models/test_service_account_tokens_create_response.py new file mode 100644 index 0000000..f971a0c --- /dev/null +++ b/test/models/test_service_account_tokens_create_response.py @@ -0,0 +1,22 @@ +import unittest +from src.dopplersdk.models.ServiceAccountTokensCreateResponse import ( + ServiceAccountTokensCreateResponse, +) + + +class TestServiceAccountTokensCreateResponseModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_service_account_tokens_create_response(self): + # Create ServiceAccountTokensCreateResponse class instance + test_model = ServiceAccountTokensCreateResponse( + api_token={"nulla": 4}, api_key="quas", success=True + ) + self.assertEqual(test_model.api_token, {"nulla": 4}) + self.assertEqual(test_model.api_key, "quas") + self.assertEqual(test_model.success, True) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_service_account_tokens_get_response.py b/test/models/test_service_account_tokens_get_response.py new file mode 100644 index 0000000..9646bda --- /dev/null +++ b/test/models/test_service_account_tokens_get_response.py @@ -0,0 +1,21 @@ +import unittest +from src.dopplersdk.models.ServiceAccountTokensGetResponse import ( + ServiceAccountTokensGetResponse, +) + + +class TestServiceAccountTokensGetResponseModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_service_account_tokens_get_response(self): + # Create ServiceAccountTokensGetResponse class instance + test_model = ServiceAccountTokensGetResponse( + api_token={"beatae": 7}, success=True + ) + self.assertEqual(test_model.api_token, {"beatae": 7}) + self.assertEqual(test_model.success, True) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_service_account_tokens_list_response.py b/test/models/test_service_account_tokens_list_response.py new file mode 100644 index 0000000..e461a4c --- /dev/null +++ b/test/models/test_service_account_tokens_list_response.py @@ -0,0 +1,21 @@ +import unittest +from src.dopplersdk.models.ServiceAccountTokensListResponse import ( + ServiceAccountTokensListResponse, +) + + +class TestServiceAccountTokensListResponseModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_service_account_tokens_list_response(self): + # Create ServiceAccountTokensListResponse class instance + test_model = ServiceAccountTokensListResponse( + api_tokens=["doloribus", "corporis"], success=True + ) + self.assertEqual(test_model.api_tokens, ["doloribus", "corporis"]) + self.assertEqual(test_model.success, True) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_service_accounts_create_request.py b/test/models/test_service_accounts_create_request.py index 8333c19..369f004 100644 --- a/test/models/test_service_accounts_create_request.py +++ b/test/models/test_service_accounts_create_request.py @@ -11,10 +11,10 @@ def test_true(self): def test_service_accounts_create_request(self): # Create ServiceAccountsCreateRequest class instance test_model = ServiceAccountsCreateRequest( - name="autem", workplace_role={"asperiores": 8} + name="harum", workplace_role={"laboriosam": 5} ) - self.assertEqual(test_model.name, "autem") - self.assertEqual(test_model.workplace_role, {"asperiores": 8}) + self.assertEqual(test_model.name, "harum") + self.assertEqual(test_model.workplace_role, {"laboriosam": 5}) if __name__ == "__main__": diff --git a/test/models/test_service_accounts_create_response.py b/test/models/test_service_accounts_create_response.py index 62ffb41..20bfc93 100644 --- a/test/models/test_service_accounts_create_response.py +++ b/test/models/test_service_accounts_create_response.py @@ -10,8 +10,8 @@ def test_true(self): def test_service_accounts_create_response(self): # Create ServiceAccountsCreateResponse class instance - test_model = ServiceAccountsCreateResponse(service_account={"accusamus": 1}) - self.assertEqual(test_model.service_account, {"accusamus": 1}) + test_model = ServiceAccountsCreateResponse(service_account={"quidem": 7}) + self.assertEqual(test_model.service_account, {"quidem": 7}) if __name__ == "__main__": diff --git a/test/models/test_service_accounts_get_response.py b/test/models/test_service_accounts_get_response.py index c5f9beb..fd595b6 100644 --- a/test/models/test_service_accounts_get_response.py +++ b/test/models/test_service_accounts_get_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_service_accounts_get_response(self): # Create ServiceAccountsGetResponse class instance - test_model = ServiceAccountsGetResponse(service_account={"sit": 8}) - self.assertEqual(test_model.service_account, {"sit": 8}) + test_model = ServiceAccountsGetResponse(service_account={"nobis": 3}) + self.assertEqual(test_model.service_account, {"nobis": 3}) if __name__ == "__main__": diff --git a/test/models/test_service_accounts_list_response.py b/test/models/test_service_accounts_list_response.py index 63b2af4..43a09d9 100644 --- a/test/models/test_service_accounts_list_response.py +++ b/test/models/test_service_accounts_list_response.py @@ -10,10 +10,8 @@ def test_true(self): def test_service_accounts_list_response(self): # Create ServiceAccountsListResponse class instance - test_model = ServiceAccountsListResponse( - service_accounts=["inventore", "ducimus"] - ) - self.assertEqual(test_model.service_accounts, ["inventore", "ducimus"]) + test_model = ServiceAccountsListResponse(service_accounts=["omnis", "fugit"]) + self.assertEqual(test_model.service_accounts, ["omnis", "fugit"]) if __name__ == "__main__": diff --git a/test/models/test_service_accounts_update_request.py b/test/models/test_service_accounts_update_request.py index 84f1acc..1c3bf4a 100644 --- a/test/models/test_service_accounts_update_request.py +++ b/test/models/test_service_accounts_update_request.py @@ -11,10 +11,10 @@ def test_true(self): def test_service_accounts_update_request(self): # Create ServiceAccountsUpdateRequest class instance test_model = ServiceAccountsUpdateRequest( - name="rerum", workplace_role={"voluptate": 7} + name="deserunt", workplace_role={"mollitia": 5} ) - self.assertEqual(test_model.name, "rerum") - self.assertEqual(test_model.workplace_role, {"voluptate": 7}) + self.assertEqual(test_model.name, "deserunt") + self.assertEqual(test_model.workplace_role, {"mollitia": 5}) if __name__ == "__main__": diff --git a/test/models/test_service_accounts_update_response.py b/test/models/test_service_accounts_update_response.py index 16e5c9d..1122ee8 100644 --- a/test/models/test_service_accounts_update_response.py +++ b/test/models/test_service_accounts_update_response.py @@ -10,8 +10,8 @@ def test_true(self): def test_service_accounts_update_response(self): # Create ServiceAccountsUpdateResponse class instance - test_model = ServiceAccountsUpdateResponse(service_account={"fugiat": 7}) - self.assertEqual(test_model.service_account, {"fugiat": 7}) + test_model = ServiceAccountsUpdateResponse(service_account={"laborum": 8}) + self.assertEqual(test_model.service_account, {"laborum": 8}) if __name__ == "__main__": diff --git a/test/models/test_service_tokens_create_request.py b/test/models/test_service_tokens_create_request.py index 2c790af..a5776cd 100644 --- a/test/models/test_service_tokens_create_request.py +++ b/test/models/test_service_tokens_create_request.py @@ -9,16 +9,16 @@ def test_true(self): def test_service_tokens_create_request(self): # Create ServiceTokensCreateRequest class instance test_model = ServiceTokensCreateRequest( - name="tenetur", - config="minus", - project="necessitatibus", - expire_at="debitis", + name="mollitia", + config="nam", + project="excepturi", + expire_at="veritatis", access="read", ) - self.assertEqual(test_model.name, "tenetur") - self.assertEqual(test_model.config, "minus") - self.assertEqual(test_model.project, "necessitatibus") - self.assertEqual(test_model.expire_at, "debitis") + self.assertEqual(test_model.name, "mollitia") + self.assertEqual(test_model.config, "nam") + self.assertEqual(test_model.project, "excepturi") + self.assertEqual(test_model.expire_at, "veritatis") self.assertEqual(test_model.access, "read") def test_service_tokens_create_request_required_fields_missing(self): diff --git a/test/models/test_service_tokens_create_response.py b/test/models/test_service_tokens_create_response.py index 7c40513..48eaa77 100644 --- a/test/models/test_service_tokens_create_response.py +++ b/test/models/test_service_tokens_create_response.py @@ -11,25 +11,25 @@ def test_true(self): def test_service_tokens_create_response(self): # Create ServiceTokensCreateResponse class instance test_model = ServiceTokensCreateResponse( - name="vitae", - slug="minima", - created_at="eum", - key="explicabo", - config="provident", - environment="vitae", - project="dignissimos", + name="nobis", + slug="consequuntur", + created_at="similique", + key="architecto", + config="nobis", + environment="nesciunt", + project="voluptatem", expires_at="foo", - access="voluptates", + access="accusantium", ) - self.assertEqual(test_model.name, "vitae") - self.assertEqual(test_model.slug, "minima") - self.assertEqual(test_model.created_at, "eum") - self.assertEqual(test_model.key, "explicabo") - self.assertEqual(test_model.config, "provident") - self.assertEqual(test_model.environment, "vitae") - self.assertEqual(test_model.project, "dignissimos") + self.assertEqual(test_model.name, "nobis") + self.assertEqual(test_model.slug, "consequuntur") + self.assertEqual(test_model.created_at, "similique") + self.assertEqual(test_model.key, "architecto") + self.assertEqual(test_model.config, "nobis") + self.assertEqual(test_model.environment, "nesciunt") + self.assertEqual(test_model.project, "voluptatem") self.assertEqual(test_model.expires_at, "foo") - self.assertEqual(test_model.access, "voluptates") + self.assertEqual(test_model.access, "accusantium") if __name__ == "__main__": diff --git a/test/models/test_service_tokens_delete_request.py b/test/models/test_service_tokens_delete_request.py index 4ce637f..572b813 100644 --- a/test/models/test_service_tokens_delete_request.py +++ b/test/models/test_service_tokens_delete_request.py @@ -9,15 +9,12 @@ def test_true(self): def test_service_tokens_delete_request(self): # Create ServiceTokensDeleteRequest class instance test_model = ServiceTokensDeleteRequest( - config="repudiandae", - project="voluptatibus", - slug="pariatur", - token="impedit", + config="sed", project="alias", slug="quidem", token="iusto" ) - self.assertEqual(test_model.config, "repudiandae") - self.assertEqual(test_model.project, "voluptatibus") - self.assertEqual(test_model.slug, "pariatur") - self.assertEqual(test_model.token, "impedit") + self.assertEqual(test_model.config, "sed") + self.assertEqual(test_model.project, "alias") + self.assertEqual(test_model.slug, "quidem") + self.assertEqual(test_model.token, "iusto") def test_service_tokens_delete_request_required_fields_missing(self): # Assert ServiceTokensDeleteRequest class generation fails without required fields diff --git a/test/models/test_service_tokens_list_response.py b/test/models/test_service_tokens_list_response.py index 210feb5..5474180 100644 --- a/test/models/test_service_tokens_list_response.py +++ b/test/models/test_service_tokens_list_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_service_tokens_list_response(self): # Create ServiceTokensListResponse class instance - test_model = ServiceTokensListResponse(tokens=["consequatur", "officia"]) - self.assertEqual(test_model.tokens, ["consequatur", "officia"]) + test_model = ServiceTokensListResponse(tokens=["at", "distinctio"]) + self.assertEqual(test_model.tokens, ["at", "distinctio"]) if __name__ == "__main__": diff --git a/test/models/test_syncs_create_request.py b/test/models/test_syncs_create_request.py index a5804a4..d9ce20b 100644 --- a/test/models/test_syncs_create_request.py +++ b/test/models/test_syncs_create_request.py @@ -9,11 +9,15 @@ def test_true(self): def test_syncs_create_request(self): # Create SyncsCreateRequest class instance test_model = SyncsCreateRequest( - data={"provident": 9}, integration="dignissimos", import_option="none" + data={"quasi": 5}, + integration="facilis", + import_option="none", + await_initial_sync=True, ) - self.assertEqual(test_model.data, {"provident": 9}) - self.assertEqual(test_model.integration, "dignissimos") + self.assertEqual(test_model.data, {"quasi": 5}) + self.assertEqual(test_model.integration, "facilis") self.assertEqual(test_model.import_option, "none") + self.assertEqual(test_model.await_initial_sync, True) def test_syncs_create_request_required_fields_missing(self): # Assert SyncsCreateRequest class generation fails without required fields diff --git a/test/models/test_syncs_create_response.py b/test/models/test_syncs_create_response.py index 28a18aa..3899cf0 100644 --- a/test/models/test_syncs_create_response.py +++ b/test/models/test_syncs_create_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_syncs_create_response(self): # Create SyncsCreateResponse class instance - test_model = SyncsCreateResponse(sync={"accusantium": 9}) - self.assertEqual(test_model.sync, {"accusantium": 9}) + test_model = SyncsCreateResponse(sync={"sunt": 5}) + self.assertEqual(test_model.sync, {"sunt": 5}) if __name__ == "__main__": diff --git a/test/models/test_syncs_get_response.py b/test/models/test_syncs_get_response.py index df1c3aa..26e054a 100644 --- a/test/models/test_syncs_get_response.py +++ b/test/models/test_syncs_get_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_syncs_get_response(self): # Create SyncsGetResponse class instance - test_model = SyncsGetResponse(sync={"qui": 4}) - self.assertEqual(test_model.sync, {"qui": 4}) + test_model = SyncsGetResponse(sync={"culpa": 1}) + self.assertEqual(test_model.sync, {"culpa": 1}) if __name__ == "__main__": diff --git a/test/models/test_unlock_request.py b/test/models/test_unlock_request.py index b504061..d8bdc2c 100644 --- a/test/models/test_unlock_request.py +++ b/test/models/test_unlock_request.py @@ -8,9 +8,9 @@ def test_true(self): def test_unlock_request(self): # Create UnlockRequest class instance - test_model = UnlockRequest(config="delectus", project="aperiam") - self.assertEqual(test_model.config, "delectus") - self.assertEqual(test_model.project, "aperiam") + test_model = UnlockRequest(config="nihil", project="quibusdam") + self.assertEqual(test_model.config, "nihil") + self.assertEqual(test_model.project, "quibusdam") def test_unlock_request_required_fields_missing(self): # Assert UnlockRequest class generation fails without required fields diff --git a/test/models/test_unlock_response.py b/test/models/test_unlock_response.py index dcbf39b..7dd6fe2 100644 --- a/test/models/test_unlock_response.py +++ b/test/models/test_unlock_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_unlock_response(self): # Create UnlockResponse class instance - test_model = UnlockResponse(config={"praesentium": 5}) - self.assertEqual(test_model.config, {"praesentium": 5}) + test_model = UnlockResponse(config={"voluptatibus": 5}) + self.assertEqual(test_model.config, {"voluptatibus": 5}) if __name__ == "__main__": diff --git a/test/models/test_update_note_request.py b/test/models/test_update_note_request.py index ecfe4fa..694f122 100644 --- a/test/models/test_update_note_request.py +++ b/test/models/test_update_note_request.py @@ -9,12 +9,12 @@ def test_true(self): def test_update_note_request(self): # Create UpdateNoteRequest class instance test_model = UpdateNoteRequest( - note="expedita", secret="expedita", config="iusto", project="iste" + note="quisquam", secret="ut", project="commodi", config="ea" ) - self.assertEqual(test_model.note, "expedita") - self.assertEqual(test_model.secret, "expedita") - self.assertEqual(test_model.config, "iusto") - self.assertEqual(test_model.project, "iste") + self.assertEqual(test_model.note, "quisquam") + self.assertEqual(test_model.secret, "ut") + self.assertEqual(test_model.project, "commodi") + self.assertEqual(test_model.config, "ea") def test_update_note_request_required_fields_missing(self): # Assert UpdateNoteRequest class generation fails without required fields diff --git a/test/models/test_update_note_response.py b/test/models/test_update_note_response.py index 17745cc..92ef9bf 100644 --- a/test/models/test_update_note_response.py +++ b/test/models/test_update_note_response.py @@ -8,9 +8,9 @@ def test_true(self): def test_update_note_response(self): # Create UpdateNoteResponse class instance - test_model = UpdateNoteResponse(secret="asperiores", note="a") - self.assertEqual(test_model.secret, "asperiores") - self.assertEqual(test_model.note, "a") + test_model = UpdateNoteResponse(secret="laborum", note="maxime") + self.assertEqual(test_model.secret, "laborum") + self.assertEqual(test_model.note, "maxime") if __name__ == "__main__": diff --git a/test/models/test_update_request.py b/test/models/test_update_request.py index 6e2da58..7b0d88e 100644 --- a/test/models/test_update_request.py +++ b/test/models/test_update_request.py @@ -9,11 +9,11 @@ def test_true(self): def test_update_request(self): # Create UpdateRequest class instance test_model = UpdateRequest( - secrets={"ipsam": 3}, config="deleniti", project="placeat" + name="autem", project="incidunt", description="similique" ) - self.assertEqual(test_model.secrets, {"ipsam": 3}) - self.assertEqual(test_model.config, "deleniti") - self.assertEqual(test_model.project, "placeat") + self.assertEqual(test_model.name, "autem") + self.assertEqual(test_model.project, "incidunt") + self.assertEqual(test_model.description, "similique") def test_update_request_required_fields_missing(self): # Assert UpdateRequest class generation fails without required fields diff --git a/test/models/test_update_response.py b/test/models/test_update_response.py index 12435ab..9cab128 100644 --- a/test/models/test_update_response.py +++ b/test/models/test_update_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_update_response(self): # Create UpdateResponse class instance - test_model = UpdateResponse(secrets={"ipsam": 2}) - self.assertEqual(test_model.secrets, {"ipsam": 2}) + test_model = UpdateResponse(project={"neque": 4}) + self.assertEqual(test_model.project, {"neque": 4}) if __name__ == "__main__": diff --git a/test/models/test_users_get_response.py b/test/models/test_users_get_response.py index b78c3eb..e000468 100644 --- a/test/models/test_users_get_response.py +++ b/test/models/test_users_get_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_users_get_response(self): # Create UsersGetResponse class instance - test_model = UsersGetResponse(workplace_user={"repudiandae": 3}, success=True) - self.assertEqual(test_model.workplace_user, {"repudiandae": 3}) + test_model = UsersGetResponse(workplace_user={"perspiciatis": 5}, success=True) + self.assertEqual(test_model.workplace_user, {"perspiciatis": 5}) self.assertEqual(test_model.success, True) diff --git a/test/models/test_users_list_response.py b/test/models/test_users_list_response.py index a498bb1..9002351 100644 --- a/test/models/test_users_list_response.py +++ b/test/models/test_users_list_response.py @@ -9,10 +9,10 @@ def test_true(self): def test_users_list_response(self): # Create UsersListResponse class instance test_model = UsersListResponse( - workplace_users=["saepe", "dolorem"], page=9, success=True + workplace_users=["enim", "neque"], page=3, success=True ) - self.assertEqual(test_model.workplace_users, ["saepe", "dolorem"]) - self.assertEqual(test_model.page, 9) + self.assertEqual(test_model.workplace_users, ["enim", "neque"]) + self.assertEqual(test_model.page, 3) self.assertEqual(test_model.success, True) diff --git a/test/models/test_webhooks_add_request.py b/test/models/test_webhooks_add_request.py new file mode 100644 index 0000000..4faf483 --- /dev/null +++ b/test/models/test_webhooks_add_request.py @@ -0,0 +1,31 @@ +import unittest +from src.dopplersdk.models.WebhooksAddRequest import WebhooksAddRequest + + +class TestWebhooksAddRequestModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_webhooks_add_request(self): + # Create WebhooksAddRequest class instance + test_model = WebhooksAddRequest( + url="voluptatibus", + secret="voluptate", + authentication={"dolores": 5}, + payload="ea", + enableConfigs=["atque", "accusamus"], + ) + self.assertEqual(test_model.url, "voluptatibus") + self.assertEqual(test_model.secret, "voluptate") + self.assertEqual(test_model.authentication, {"dolores": 5}) + self.assertEqual(test_model.payload, "ea") + self.assertEqual(test_model.enableConfigs, ["atque", "accusamus"]) + + def test_webhooks_add_request_required_fields_missing(self): + # Assert WebhooksAddRequest class generation fails without required fields + with self.assertRaises(TypeError): + test_model = WebhooksAddRequest() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_webhooks_add_response.py b/test/models/test_webhooks_add_response.py new file mode 100644 index 0000000..bda76b1 --- /dev/null +++ b/test/models/test_webhooks_add_response.py @@ -0,0 +1,15 @@ +import unittest +from src.dopplersdk.models.WebhooksAddResponse import WebhooksAddResponse + + +class TestWebhooksAddResponseModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_webhooks_add_response(self): + # Create WebhooksAddResponse class instance + test_model = WebhooksAddResponse() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_webhooks_delete_response.py b/test/models/test_webhooks_delete_response.py new file mode 100644 index 0000000..f437c43 --- /dev/null +++ b/test/models/test_webhooks_delete_response.py @@ -0,0 +1,15 @@ +import unittest +from src.dopplersdk.models.WebhooksDeleteResponse import WebhooksDeleteResponse + + +class TestWebhooksDeleteResponseModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_webhooks_delete_response(self): + # Create WebhooksDeleteResponse class instance + test_model = WebhooksDeleteResponse() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_webhooks_get_response.py b/test/models/test_webhooks_get_response.py new file mode 100644 index 0000000..24c31e9 --- /dev/null +++ b/test/models/test_webhooks_get_response.py @@ -0,0 +1,15 @@ +import unittest +from src.dopplersdk.models.WebhooksGetResponse import WebhooksGetResponse + + +class TestWebhooksGetResponseModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_webhooks_get_response(self): + # Create WebhooksGetResponse class instance + test_model = WebhooksGetResponse() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_webhooks_list_response.py b/test/models/test_webhooks_list_response.py new file mode 100644 index 0000000..7276269 --- /dev/null +++ b/test/models/test_webhooks_list_response.py @@ -0,0 +1,15 @@ +import unittest +from src.dopplersdk.models.WebhooksListResponse import WebhooksListResponse + + +class TestWebhooksListResponseModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_webhooks_list_response(self): + # Create WebhooksListResponse class instance + test_model = WebhooksListResponse() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_webhooks_update_request.py b/test/models/test_webhooks_update_request.py new file mode 100644 index 0000000..7d5e908 --- /dev/null +++ b/test/models/test_webhooks_update_request.py @@ -0,0 +1,28 @@ +import unittest +from src.dopplersdk.models.WebhooksUpdateRequest import WebhooksUpdateRequest + + +class TestWebhooksUpdateRequestModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_webhooks_update_request(self): + # Create WebhooksUpdateRequest class instance + test_model = WebhooksUpdateRequest( + url="debitis", + secret="culpa", + authentication={"animi": 5}, + payload="porro", + enableConfigs=["neque", "similique"], + disableConfigs=["ducimus", "pariatur"], + ) + self.assertEqual(test_model.url, "debitis") + self.assertEqual(test_model.secret, "culpa") + self.assertEqual(test_model.authentication, {"animi": 5}) + self.assertEqual(test_model.payload, "porro") + self.assertEqual(test_model.enableConfigs, ["neque", "similique"]) + self.assertEqual(test_model.disableConfigs, ["ducimus", "pariatur"]) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_webhooks_update_response.py b/test/models/test_webhooks_update_response.py new file mode 100644 index 0000000..a14905c --- /dev/null +++ b/test/models/test_webhooks_update_response.py @@ -0,0 +1,15 @@ +import unittest +from src.dopplersdk.models.WebhooksUpdateResponse import WebhooksUpdateResponse + + +class TestWebhooksUpdateResponseModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_webhooks_update_response(self): + # Create WebhooksUpdateResponse class instance + test_model = WebhooksUpdateResponse() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_workplace_get_response.py b/test/models/test_workplace_get_response.py index 05c5275..8abd4ad 100644 --- a/test/models/test_workplace_get_response.py +++ b/test/models/test_workplace_get_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_workplace_get_response(self): # Create WorkplaceGetResponse class instance - test_model = WorkplaceGetResponse(workplace={"delectus": 5}) - self.assertEqual(test_model.workplace, {"delectus": 5}) + test_model = WorkplaceGetResponse(workplace={"eius": 7}) + self.assertEqual(test_model.workplace, {"eius": 7}) if __name__ == "__main__": diff --git a/test/models/test_workplace_roles_create_request.py b/test/models/test_workplace_roles_create_request.py new file mode 100644 index 0000000..9f63212 --- /dev/null +++ b/test/models/test_workplace_roles_create_request.py @@ -0,0 +1,26 @@ +import unittest +from src.dopplersdk.models.WorkplaceRolesCreateRequest import ( + WorkplaceRolesCreateRequest, +) + + +class TestWorkplaceRolesCreateRequestModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_workplace_roles_create_request(self): + # Create WorkplaceRolesCreateRequest class instance + test_model = WorkplaceRolesCreateRequest( + permissions=["tempora", "saepe"], name="assumenda" + ) + self.assertEqual(test_model.permissions, ["tempora", "saepe"]) + self.assertEqual(test_model.name, "assumenda") + + def test_workplace_roles_create_request_required_fields_missing(self): + # Assert WorkplaceRolesCreateRequest class generation fails without required fields + with self.assertRaises(TypeError): + test_model = WorkplaceRolesCreateRequest() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_workplace_roles_create_response.py b/test/models/test_workplace_roles_create_response.py index 05965d7..d79606b 100644 --- a/test/models/test_workplace_roles_create_response.py +++ b/test/models/test_workplace_roles_create_response.py @@ -10,8 +10,8 @@ def test_true(self): def test_workplace_roles_create_response(self): # Create WorkplaceRolesCreateResponse class instance - test_model = WorkplaceRolesCreateResponse(role={"blanditiis": 9}) - self.assertEqual(test_model.role, {"blanditiis": 9}) + test_model = WorkplaceRolesCreateResponse(role={"rem": 7}) + self.assertEqual(test_model.role, {"rem": 7}) if __name__ == "__main__": diff --git a/test/models/test_workplace_roles_get_response.py b/test/models/test_workplace_roles_get_response.py index b0695e2..10791b9 100644 --- a/test/models/test_workplace_roles_get_response.py +++ b/test/models/test_workplace_roles_get_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_workplace_roles_get_response(self): # Create WorkplaceRolesGetResponse class instance - test_model = WorkplaceRolesGetResponse(role={"nulla": 6}) - self.assertEqual(test_model.role, {"nulla": 6}) + test_model = WorkplaceRolesGetResponse(role={"eum": 7}) + self.assertEqual(test_model.role, {"eum": 7}) if __name__ == "__main__": diff --git a/test/models/test_workplace_roles_list_response.py b/test/models/test_workplace_roles_list_response.py index 1fc032f..2f9cf56 100644 --- a/test/models/test_workplace_roles_list_response.py +++ b/test/models/test_workplace_roles_list_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_workplace_roles_list_response(self): # Create WorkplaceRolesListResponse class instance - test_model = WorkplaceRolesListResponse(roles=["beatae", "omnis"]) - self.assertEqual(test_model.roles, ["beatae", "omnis"]) + test_model = WorkplaceRolesListResponse(roles=["atque", "hic"]) + self.assertEqual(test_model.roles, ["atque", "hic"]) if __name__ == "__main__": diff --git a/test/models/test_workplace_roles_update_request.py b/test/models/test_workplace_roles_update_request.py new file mode 100644 index 0000000..a7236e0 --- /dev/null +++ b/test/models/test_workplace_roles_update_request.py @@ -0,0 +1,21 @@ +import unittest +from src.dopplersdk.models.WorkplaceRolesUpdateRequest import ( + WorkplaceRolesUpdateRequest, +) + + +class TestWorkplaceRolesUpdateRequestModel(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + def test_workplace_roles_update_request(self): + # Create WorkplaceRolesUpdateRequest class instance + test_model = WorkplaceRolesUpdateRequest( + name="inventore", permissions=["qui", "iusto"] + ) + self.assertEqual(test_model.name, "inventore") + self.assertEqual(test_model.permissions, ["qui", "iusto"]) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/models/test_workplace_roles_update_response.py b/test/models/test_workplace_roles_update_response.py index 954b924..d468087 100644 --- a/test/models/test_workplace_roles_update_response.py +++ b/test/models/test_workplace_roles_update_response.py @@ -10,8 +10,8 @@ def test_true(self): def test_workplace_roles_update_response(self): # Create WorkplaceRolesUpdateResponse class instance - test_model = WorkplaceRolesUpdateResponse(role={"eum": 4}) - self.assertEqual(test_model.role, {"eum": 4}) + test_model = WorkplaceRolesUpdateResponse(role={"sunt": 5}) + self.assertEqual(test_model.role, {"sunt": 5}) if __name__ == "__main__": diff --git a/test/models/test_workplace_update_request.py b/test/models/test_workplace_update_request.py index e7f1c49..af11b39 100644 --- a/test/models/test_workplace_update_request.py +++ b/test/models/test_workplace_update_request.py @@ -9,11 +9,11 @@ def test_true(self): def test_workplace_update_request(self): # Create WorkplaceUpdateRequest class instance test_model = WorkplaceUpdateRequest( - name="minus", billing_email="rerum", security_email="error" + name="eum", billing_email="saepe", security_email="placeat" ) - self.assertEqual(test_model.name, "minus") - self.assertEqual(test_model.billing_email, "rerum") - self.assertEqual(test_model.security_email, "error") + self.assertEqual(test_model.name, "eum") + self.assertEqual(test_model.billing_email, "saepe") + self.assertEqual(test_model.security_email, "placeat") if __name__ == "__main__": diff --git a/test/models/test_workplace_update_response.py b/test/models/test_workplace_update_response.py index c969a5a..726438d 100644 --- a/test/models/test_workplace_update_response.py +++ b/test/models/test_workplace_update_response.py @@ -8,8 +8,8 @@ def test_true(self): def test_workplace_update_response(self): # Create WorkplaceUpdateResponse class instance - test_model = WorkplaceUpdateResponse(workplace={"impedit": 3}) - self.assertEqual(test_model.workplace, {"impedit": 3}) + test_model = WorkplaceUpdateResponse(workplace={"minus": 8}) + self.assertEqual(test_model.workplace, {"minus": 8}) if __name__ == "__main__": diff --git a/test/services/test_activity_logs.py b/test/services/test_activity_logs.py index f0b8fdf..4d0d174 100644 --- a/test/services/test_activity_logs.py +++ b/test/services/test_activity_logs.py @@ -10,50 +10,50 @@ def test_true(self): self.assertTrue(True) @responses.activate - def test_retrieve(self): + def test_list(self): # Mock the API response - responses.get("https://api.doppler.com/v3/logs/log", json={}, status=200) + responses.get("https://api.doppler.com/v3/logs", json={}, status=200) # call the method to test test_service = ActivityLogs("testkey") - response = test_service.retrieve("cupiditate") + response = test_service.list("aspernatur", 2) self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_retrieve_required_fields_missing(self): - # Mock the API response - responses.get("https://api.doppler.com/v3/logs/log", json={}, status=202) - with self.assertRaises(TypeError): - test_service = ActivityLogs("testkey") - test_service.retrieve() - responses.reset(), - - @responses.activate - def test_retrieve_error_on_non_200(self): + def test_list_error_on_non_200(self): # Mock the API response - responses.get("https://api.doppler.com/v3/logs/log", json={}, status=404) + responses.get("https://api.doppler.com/v3/logs", json={}, status=404) with self.assertRaises(ClientException): test_service = ActivityLogs("testkey") - test_service.retrieve("occaecati") + test_service.list("libero", 5) responses.reset() @responses.activate - def test_list(self): + def test_retrieve(self): # Mock the API response - responses.get("https://api.doppler.com/v3/logs", json={}, status=200) + responses.get("https://api.doppler.com/v3/logs/log", json={}, status=200) # call the method to test test_service = ActivityLogs("testkey") - response = test_service.list("perferendis", 8) + response = test_service.retrieve("odit") self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_list_error_on_non_200(self): + def test_retrieve_required_fields_missing(self): # Mock the API response - responses.get("https://api.doppler.com/v3/logs", json={}, status=404) + responses.get("https://api.doppler.com/v3/logs/log", json={}, status=202) + with self.assertRaises(TypeError): + test_service = ActivityLogs("testkey") + test_service.retrieve() + responses.reset(), + + @responses.activate + def test_retrieve_error_on_non_200(self): + # Mock the API response + responses.get("https://api.doppler.com/v3/logs/log", json={}, status=404) with self.assertRaises(ClientException): test_service = ActivityLogs("testkey") - test_service.list("maiores", 7) + test_service.retrieve("doloribus") responses.reset() diff --git a/test/services/test_audit.py b/test/services/test_audit.py index b58f16a..0e6d965 100644 --- a/test/services/test_audit.py +++ b/test/services/test_audit.py @@ -13,11 +13,11 @@ def test_true(self): def test_get_user(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/users/7564717263", json={}, status=200 + "https://api.doppler.com/v3/workplace/users/7029489251", json={}, status=200 ) # call the method to test test_service = Audit("testkey") - response = test_service.get_user("7564717263", True) + response = test_service.get_user("7029489251", True) self.assertEqual(response, {}) responses.reset(), @@ -25,7 +25,7 @@ def test_get_user(self): def test_get_user_required_fields_missing(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/users/6983682484", json={}, status=202 + "https://api.doppler.com/v3/workplace/users/4559693898", json={}, status=202 ) with self.assertRaises(TypeError): test_service = Audit("testkey") @@ -36,11 +36,11 @@ def test_get_user_required_fields_missing(self): def test_get_user_error_on_non_200(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/users/8410495771", json={}, status=404 + "https://api.doppler.com/v3/workplace/users/5289739951", json={}, status=404 ) with self.assertRaises(ClientException): test_service = Audit("testkey") - test_service.get_user("8410495771", True) + test_service.get_user("5289739951", True) responses.reset() diff --git a/test/services/test_config_logs.py b/test/services/test_config_logs.py index 82a24d0..feff2fe 100644 --- a/test/services/test_config_logs.py +++ b/test/services/test_config_logs.py @@ -10,71 +10,71 @@ def test_true(self): self.assertTrue(True) @responses.activate - def test_list(self): + def test_get(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/configs/config/logs", json={}, status=200 + "https://api.doppler.com/v3/configs/config/logs/log", json={}, status=200 ) # call the method to test test_service = ConfigLogs("testkey") - response = test_service.list("accusamus", "sapiente", 1, 6) + response = test_service.get("earum", "adipisci", "recusandae") self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_list_required_fields_missing(self): + def test_get_required_fields_missing(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/configs/config/logs", json={}, status=202 + "https://api.doppler.com/v3/configs/config/logs/log", json={}, status=202 ) with self.assertRaises(TypeError): test_service = ConfigLogs("testkey") - test_service.list() + test_service.get() responses.reset(), @responses.activate - def test_list_error_on_non_200(self): + def test_get_error_on_non_200(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/configs/config/logs", json={}, status=404 + "https://api.doppler.com/v3/configs/config/logs/log", json={}, status=404 ) with self.assertRaises(ClientException): test_service = ConfigLogs("testkey") - test_service.list("eligendi", "esse", 6, 6) + test_service.get("veniam", "doloremque", "rerum") responses.reset() @responses.activate - def test_get(self): + def test_list(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/configs/config/logs/log", json={}, status=200 + "https://api.doppler.com/v3/configs/config/logs", json={}, status=200 ) # call the method to test test_service = ConfigLogs("testkey") - response = test_service.get("voluptas", "fuga", "deleniti") + response = test_service.list("animi", "quasi", 6, 4) self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_get_required_fields_missing(self): + def test_list_required_fields_missing(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/configs/config/logs/log", json={}, status=202 + "https://api.doppler.com/v3/configs/config/logs", json={}, status=202 ) with self.assertRaises(TypeError): test_service = ConfigLogs("testkey") - test_service.get() + test_service.list() responses.reset(), @responses.activate - def test_get_error_on_non_200(self): + def test_list_error_on_non_200(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/configs/config/logs/log", json={}, status=404 + "https://api.doppler.com/v3/configs/config/logs", json={}, status=404 ) with self.assertRaises(ClientException): test_service = ConfigLogs("testkey") - test_service.get("mollitia", "dignissimos", "eos") + test_service.list("aut", "fugit", 3, 8) responses.reset() @responses.activate @@ -87,7 +87,7 @@ def test_rollback(self): ) # call the method to test test_service = ConfigLogs("testkey") - response = test_service.rollback("odio", "delectus", "repellendus") + response = test_service.rollback("laudantium", "dolore", "quam") self.assertEqual(response, {}) responses.reset(), @@ -114,7 +114,7 @@ def test_rollback_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = ConfigLogs("testkey") - test_service.rollback("nisi", "error", "atque") + test_service.rollback("libero", "placeat", "molestiae") responses.reset() diff --git a/test/services/test_configs.py b/test/services/test_configs.py index 7261445..57ca273 100644 --- a/test/services/test_configs.py +++ b/test/services/test_configs.py @@ -10,120 +10,143 @@ def test_true(self): self.assertTrue(True) @responses.activate - def test_list(self): + def test_get(self): # Mock the API response - responses.get("https://api.doppler.com/v3/configs", json={}, status=200) + responses.get("https://api.doppler.com/v3/configs/config", json={}, status=200) # call the method to test test_service = Configs("testkey") - response = test_service.list("quae", "facere", 8, 4) + response = test_service.get("hic", "quam") self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_list_required_fields_missing(self): + def test_get_required_fields_missing(self): # Mock the API response - responses.get("https://api.doppler.com/v3/configs", json={}, status=202) + responses.get("https://api.doppler.com/v3/configs/config", json={}, status=202) with self.assertRaises(TypeError): test_service = Configs("testkey") - test_service.list() + test_service.get() responses.reset(), @responses.activate - def test_list_error_on_non_200(self): + def test_get_error_on_non_200(self): # Mock the API response - responses.get("https://api.doppler.com/v3/configs", json={}, status=404) + responses.get("https://api.doppler.com/v3/configs/config", json={}, status=404) with self.assertRaises(ClientException): test_service = Configs("testkey") - test_service.list("officiis", "quae", 2, 4) + test_service.get("et", "nemo") responses.reset() @responses.activate - def test_create(self): + def test_update(self): # Mock the API response - responses.post("https://api.doppler.com/v3/configs", json={}, status=200) + responses.post("https://api.doppler.com/v3/configs/config", json={}, status=200) # call the method to test test_service = Configs("testkey") - response = test_service.create({}) + response = test_service.update({}) self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_create_error_on_non_200(self): + def test_update_error_on_non_200(self): # Mock the API response - responses.post("https://api.doppler.com/v3/configs", json={}, status=404) + responses.post("https://api.doppler.com/v3/configs/config", json={}, status=404) with self.assertRaises(ClientException): test_service = Configs("testkey") - test_service.create({}) + test_service.update({}) responses.reset() @responses.activate - def test_get(self): + def test_delete(self): # Mock the API response - responses.get("https://api.doppler.com/v3/configs/config", json={}, status=200) + responses.delete( + "https://api.doppler.com/v3/configs/config", json={}, status=200 + ) # call the method to test test_service = Configs("testkey") - response = test_service.get("adipisci", "fuga") + response = test_service.delete({}) self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_get_required_fields_missing(self): + def test_delete_error_on_non_200(self): # Mock the API response - responses.get("https://api.doppler.com/v3/configs/config", json={}, status=202) + responses.delete( + "https://api.doppler.com/v3/configs/config", json={}, status=404 + ) + with self.assertRaises(ClientException): + test_service = Configs("testkey") + test_service.delete({}) + responses.reset() + + @responses.activate + def test_list(self): + # Mock the API response + responses.get("https://api.doppler.com/v3/configs", json={}, status=200) + # call the method to test + test_service = Configs("testkey") + response = test_service.list("error", "distinctio", 4, 5) + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_list_required_fields_missing(self): + # Mock the API response + responses.get("https://api.doppler.com/v3/configs", json={}, status=202) with self.assertRaises(TypeError): test_service = Configs("testkey") - test_service.get() + test_service.list() responses.reset(), @responses.activate - def test_get_error_on_non_200(self): + def test_list_error_on_non_200(self): # Mock the API response - responses.get("https://api.doppler.com/v3/configs/config", json={}, status=404) + responses.get("https://api.doppler.com/v3/configs", json={}, status=404) with self.assertRaises(ClientException): test_service = Configs("testkey") - test_service.get("asperiores", "molestiae") + test_service.list("similique", "impedit", 7, 7) responses.reset() @responses.activate - def test_update(self): + def test_create(self): # Mock the API response - responses.post("https://api.doppler.com/v3/configs/config", json={}, status=200) + responses.post("https://api.doppler.com/v3/configs", json={}, status=200) # call the method to test test_service = Configs("testkey") - response = test_service.update({}) + response = test_service.create({}) self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_update_error_on_non_200(self): + def test_create_error_on_non_200(self): # Mock the API response - responses.post("https://api.doppler.com/v3/configs/config", json={}, status=404) + responses.post("https://api.doppler.com/v3/configs", json={}, status=404) with self.assertRaises(ClientException): test_service = Configs("testkey") - test_service.update({}) + test_service.create({}) responses.reset() @responses.activate - def test_delete(self): + def test_unlock(self): # Mock the API response - responses.delete( - "https://api.doppler.com/v3/configs/config", json={}, status=200 + responses.post( + "https://api.doppler.com/v3/configs/config/unlock", json={}, status=200 ) # call the method to test test_service = Configs("testkey") - response = test_service.delete({}) + response = test_service.unlock({}) self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_delete_error_on_non_200(self): + def test_unlock_error_on_non_200(self): # Mock the API response - responses.delete( - "https://api.doppler.com/v3/configs/config", json={}, status=404 + responses.post( + "https://api.doppler.com/v3/configs/config/unlock", json={}, status=404 ) with self.assertRaises(ClientException): test_service = Configs("testkey") - test_service.delete({}) + test_service.unlock({}) responses.reset() @responses.activate @@ -172,29 +195,6 @@ def test_lock_error_on_non_200(self): test_service.lock({}) responses.reset() - @responses.activate - def test_unlock(self): - # Mock the API response - responses.post( - "https://api.doppler.com/v3/configs/config/unlock", json={}, status=200 - ) - # call the method to test - test_service = Configs("testkey") - response = test_service.unlock({}) - self.assertEqual(response, {}) - responses.reset(), - - @responses.activate - def test_unlock_error_on_non_200(self): - # Mock the API response - responses.post( - "https://api.doppler.com/v3/configs/config/unlock", json={}, status=404 - ) - with self.assertRaises(ClientException): - test_service = Configs("testkey") - test_service.unlock({}) - responses.reset() - @responses.activate def test_list_trusted_ips(self): # Mock the API response @@ -203,7 +203,7 @@ def test_list_trusted_ips(self): ) # call the method to test test_service = Configs("testkey") - response = test_service.list_trusted_ips("eius", "perspiciatis") + response = test_service.list_trusted_ips("a", "cupiditate") self.assertEqual(response, {}) responses.reset(), @@ -226,7 +226,7 @@ def test_list_trusted_ips_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Configs("testkey") - test_service.list_trusted_ips("nisi", "distinctio") + test_service.list_trusted_ips("ullam", "asperiores") responses.reset() @responses.activate @@ -237,7 +237,7 @@ def test_add_trusted_ip(self): ) # call the method to test test_service = Configs("testkey") - response = test_service.add_trusted_ip("laboriosam", "deserunt", {}) + response = test_service.add_trusted_ip("illum", "temporibus", {}) self.assertEqual(response, {}) responses.reset(), @@ -260,7 +260,7 @@ def test_add_trusted_ip_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Configs("testkey") - test_service.add_trusted_ip("hic", "reprehenderit", {}) + test_service.add_trusted_ip("porro", "id", {}) responses.reset() @responses.activate @@ -271,7 +271,7 @@ def test_delete_trusted_ip(self): ) # call the method to test test_service = Configs("testkey") - response = test_service.delete_trusted_ip("fuga", "temporibus", {}) + response = test_service.delete_trusted_ip("quae", "sint", {}) self.assertEqual(response, {}) responses.reset(), @@ -294,7 +294,7 @@ def test_delete_trusted_ip_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Configs("testkey") - test_service.delete_trusted_ip("eligendi", "libero", {}) + test_service.delete_trusted_ip("voluptatum", "deleniti", {}) responses.reset() diff --git a/test/services/test_dynamic_secrets.py b/test/services/test_dynamic_secrets.py index 84df82c..74c5002 100644 --- a/test/services/test_dynamic_secrets.py +++ b/test/services/test_dynamic_secrets.py @@ -10,57 +10,57 @@ def test_true(self): self.assertTrue(True) @responses.activate - def test_issue_lease(self): + def test_revoke_lease(self): # Mock the API response - responses.post( - "https://api.doppler.com/v3/configs/config/dynamic_secrets/dynamic_secret/leases", + responses.delete( + "https://api.doppler.com/v3/configs/config/dynamic_secrets/dynamic_secret/leases/lease", json={}, status=200, ) # call the method to test test_service = DynamicSecrets("testkey") - response = test_service.issue_lease({}) + response = test_service.revoke_lease({}) self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_issue_lease_error_on_non_200(self): + def test_revoke_lease_error_on_non_200(self): # Mock the API response - responses.post( - "https://api.doppler.com/v3/configs/config/dynamic_secrets/dynamic_secret/leases", + responses.delete( + "https://api.doppler.com/v3/configs/config/dynamic_secrets/dynamic_secret/leases/lease", json={}, status=404, ) with self.assertRaises(ClientException): test_service = DynamicSecrets("testkey") - test_service.issue_lease({}) + test_service.revoke_lease({}) responses.reset() @responses.activate - def test_revoke_lease(self): + def test_issue_lease(self): # Mock the API response - responses.delete( - "https://api.doppler.com/v3/configs/config/dynamic_secrets/dynamic_secret/leases/lease", + responses.post( + "https://api.doppler.com/v3/configs/config/dynamic_secrets/dynamic_secret/leases", json={}, status=200, ) # call the method to test test_service = DynamicSecrets("testkey") - response = test_service.revoke_lease({}) + response = test_service.issue_lease({}) self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_revoke_lease_error_on_non_200(self): + def test_issue_lease_error_on_non_200(self): # Mock the API response - responses.delete( - "https://api.doppler.com/v3/configs/config/dynamic_secrets/dynamic_secret/leases/lease", + responses.post( + "https://api.doppler.com/v3/configs/config/dynamic_secrets/dynamic_secret/leases", json={}, status=404, ) with self.assertRaises(ClientException): test_service = DynamicSecrets("testkey") - test_service.revoke_lease({}) + test_service.issue_lease({}) responses.reset() diff --git a/test/services/test_environments.py b/test/services/test_environments.py index e346514..37f130b 100644 --- a/test/services/test_environments.py +++ b/test/services/test_environments.py @@ -10,161 +10,161 @@ def test_true(self): self.assertTrue(True) @responses.activate - def test_get(self): + def test_list(self): # Mock the API response - responses.get( - "https://api.doppler.com/v3/environments/environment", json={}, status=200 - ) + responses.get("https://api.doppler.com/v3/environments", json={}, status=200) # call the method to test test_service = Environments("testkey") - response = test_service.get("consequatur", "quia") + response = test_service.list("ducimus") self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_get_required_fields_missing(self): + def test_list_required_fields_missing(self): # Mock the API response - responses.get( - "https://api.doppler.com/v3/environments/environment", json={}, status=202 - ) + responses.get("https://api.doppler.com/v3/environments", json={}, status=202) with self.assertRaises(TypeError): test_service = Environments("testkey") - test_service.get() + test_service.list() responses.reset(), @responses.activate - def test_get_error_on_non_200(self): + def test_list_error_on_non_200(self): # Mock the API response - responses.get( - "https://api.doppler.com/v3/environments/environment", json={}, status=404 - ) + responses.get("https://api.doppler.com/v3/environments", json={}, status=404) with self.assertRaises(ClientException): test_service = Environments("testkey") - test_service.get("soluta", "officiis") + test_service.list("autem") responses.reset() @responses.activate - def test_rename(self): + def test_create(self): # Mock the API response - responses.put( - "https://api.doppler.com/v3/environments/environment", json={}, status=200 - ) + responses.post("https://api.doppler.com/v3/environments", json={}, status=200) # call the method to test test_service = Environments("testkey") - response = test_service.rename("quaerat", "sapiente", {}) + response = test_service.create("commodi", {}) self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_rename_required_fields_missing(self): + def test_create_required_fields_missing(self): # Mock the API response - responses.put( - "https://api.doppler.com/v3/environments/environment", json={}, status=202 - ) + responses.post("https://api.doppler.com/v3/environments", json={}, status=202) with self.assertRaises(TypeError): test_service = Environments("testkey") - test_service.rename() + test_service.create() responses.reset(), @responses.activate - def test_rename_error_on_non_200(self): + def test_create_error_on_non_200(self): # Mock the API response - responses.put( - "https://api.doppler.com/v3/environments/environment", json={}, status=404 - ) + responses.post("https://api.doppler.com/v3/environments", json={}, status=404) with self.assertRaises(ClientException): test_service = Environments("testkey") - test_service.rename("deleniti", "dolores", {}) + test_service.create("blanditiis", {}) responses.reset() @responses.activate - def test_delete(self): + def test_get(self): # Mock the API response - responses.delete( + responses.get( "https://api.doppler.com/v3/environments/environment", json={}, status=200 ) # call the method to test test_service = Environments("testkey") - response = test_service.delete("fugit", "enim") + response = test_service.get("quam", "tempora") self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_delete_required_fields_missing(self): + def test_get_required_fields_missing(self): # Mock the API response - responses.delete( + responses.get( "https://api.doppler.com/v3/environments/environment", json={}, status=202 ) with self.assertRaises(TypeError): test_service = Environments("testkey") - test_service.delete() + test_service.get() responses.reset(), @responses.activate - def test_delete_error_on_non_200(self): + def test_get_error_on_non_200(self): # Mock the API response - responses.delete( + responses.get( "https://api.doppler.com/v3/environments/environment", json={}, status=404 ) with self.assertRaises(ClientException): test_service = Environments("testkey") - test_service.delete("voluptatem", "a") + test_service.get("voluptatem", "repellendus") responses.reset() @responses.activate - def test_list(self): + def test_rename(self): # Mock the API response - responses.get("https://api.doppler.com/v3/environments", json={}, status=200) + responses.put( + "https://api.doppler.com/v3/environments/environment", json={}, status=200 + ) # call the method to test test_service = Environments("testkey") - response = test_service.list("recusandae") + response = test_service.rename("asperiores", "veritatis", {}) self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_list_required_fields_missing(self): + def test_rename_required_fields_missing(self): # Mock the API response - responses.get("https://api.doppler.com/v3/environments", json={}, status=202) + responses.put( + "https://api.doppler.com/v3/environments/environment", json={}, status=202 + ) with self.assertRaises(TypeError): test_service = Environments("testkey") - test_service.list() + test_service.rename() responses.reset(), @responses.activate - def test_list_error_on_non_200(self): + def test_rename_error_on_non_200(self): # Mock the API response - responses.get("https://api.doppler.com/v3/environments", json={}, status=404) + responses.put( + "https://api.doppler.com/v3/environments/environment", json={}, status=404 + ) with self.assertRaises(ClientException): test_service = Environments("testkey") - test_service.list("deleniti") + test_service.rename("fugit", "magnam", {}) responses.reset() @responses.activate - def test_create(self): + def test_delete(self): # Mock the API response - responses.post("https://api.doppler.com/v3/environments", json={}, status=200) + responses.delete( + "https://api.doppler.com/v3/environments/environment", json={}, status=200 + ) # call the method to test test_service = Environments("testkey") - response = test_service.create("veritatis", {}) + response = test_service.delete("dolorem", "labore") self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_create_required_fields_missing(self): + def test_delete_required_fields_missing(self): # Mock the API response - responses.post("https://api.doppler.com/v3/environments", json={}, status=202) + responses.delete( + "https://api.doppler.com/v3/environments/environment", json={}, status=202 + ) with self.assertRaises(TypeError): test_service = Environments("testkey") - test_service.create() + test_service.delete() responses.reset(), @responses.activate - def test_create_error_on_non_200(self): + def test_delete_error_on_non_200(self): # Mock the API response - responses.post("https://api.doppler.com/v3/environments", json={}, status=404) + responses.delete( + "https://api.doppler.com/v3/environments/environment", json={}, status=404 + ) with self.assertRaises(ClientException): test_service = Environments("testkey") - test_service.create("quod", {}) + test_service.delete("laboriosam", "consequatur") responses.reset() diff --git a/test/services/test_get.py b/test/services/test_get.py new file mode 100644 index 0000000..460da7f --- /dev/null +++ b/test/services/test_get.py @@ -0,0 +1,54 @@ +import unittest +import responses +from src.dopplersdk.net.http_client import HTTPClient +from http_exceptions import ClientException +from src.dopplersdk.services.get import Get + + +class TestGet_(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + @responses.activate + def test_options(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/integrations/integration/options", + json={}, + status=200, + ) + # call the method to test + test_service = Get("testkey") + response = test_service.options("atque") + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_options_required_fields_missing(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/integrations/integration/options", + json={}, + status=202, + ) + with self.assertRaises(TypeError): + test_service = Get("testkey") + test_service.options() + responses.reset(), + + @responses.activate + def test_options_error_on_non_200(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/integrations/integration/options", + json={}, + status=404, + ) + with self.assertRaises(ClientException): + test_service = Get("testkey") + test_service.options("mollitia") + responses.reset() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/services/test_groups.py b/test/services/test_groups.py index 315ba2c..01ed42c 100644 --- a/test/services/test_groups.py +++ b/test/services/test_groups.py @@ -9,63 +9,17 @@ class TestGroups_(unittest.TestCase): def test_true(self): self.assertTrue(True) - @responses.activate - def test_list(self): - # Mock the API response - responses.get( - "https://api.doppler.com/v3/workplace/groups", json={}, status=200 - ) - # call the method to test - test_service = Groups("testkey") - response = test_service.list(4, 7) - self.assertEqual(response, {}) - responses.reset(), - - @responses.activate - def test_list_error_on_non_200(self): - # Mock the API response - responses.get( - "https://api.doppler.com/v3/workplace/groups", json={}, status=404 - ) - with self.assertRaises(ClientException): - test_service = Groups("testkey") - test_service.list(6, 9) - responses.reset() - - @responses.activate - def test_create(self): - # Mock the API response - responses.post( - "https://api.doppler.com/v3/workplace/groups", json={}, status=200 - ) - # call the method to test - test_service = Groups("testkey") - response = test_service.create({}) - self.assertEqual(response, {}) - responses.reset(), - - @responses.activate - def test_create_error_on_non_200(self): - # Mock the API response - responses.post( - "https://api.doppler.com/v3/workplace/groups", json={}, status=404 - ) - with self.assertRaises(ClientException): - test_service = Groups("testkey") - test_service.create({}) - responses.reset() - @responses.activate def test_get(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/groups/group/laudantium", + "https://api.doppler.com/v3/workplace/groups/group/expedita", json={}, status=200, ) # call the method to test test_service = Groups("testkey") - response = test_service.get("laudantium") + response = test_service.get("expedita") self.assertEqual(response, {}) responses.reset(), @@ -73,9 +27,7 @@ def test_get(self): def test_get_required_fields_missing(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/groups/group/doloribus", - json={}, - status=202, + "https://api.doppler.com/v3/workplace/groups/group/ex", json={}, status=202 ) with self.assertRaises(TypeError): test_service = Groups("testkey") @@ -86,26 +38,26 @@ def test_get_required_fields_missing(self): def test_get_error_on_non_200(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/groups/group/optio", + "https://api.doppler.com/v3/workplace/groups/group/ratione", json={}, status=404, ) with self.assertRaises(ClientException): test_service = Groups("testkey") - test_service.get("optio") + test_service.get("ratione") responses.reset() @responses.activate def test_update(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/workplace/groups/group/molestias", + "https://api.doppler.com/v3/workplace/groups/group/consequuntur", json={}, status=200, ) # call the method to test test_service = Groups("testkey") - response = test_service.update("molestias", {}) + response = test_service.update("consequuntur", {}) self.assertEqual(response, {}) responses.reset(), @@ -113,7 +65,7 @@ def test_update(self): def test_update_required_fields_missing(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/workplace/groups/group/debitis", + "https://api.doppler.com/v3/workplace/groups/group/occaecati", json={}, status=202, ) @@ -126,26 +78,22 @@ def test_update_required_fields_missing(self): def test_update_error_on_non_200(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/workplace/groups/group/consequatur", - json={}, - status=404, + "https://api.doppler.com/v3/workplace/groups/group/ad", json={}, status=404 ) with self.assertRaises(ClientException): test_service = Groups("testkey") - test_service.update("consequatur", {}) + test_service.update("ad", {}) responses.reset() @responses.activate def test_delete(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/workplace/groups/group/soluta", - json={}, - status=200, + "https://api.doppler.com/v3/workplace/groups/group/et", json={}, status=200 ) # call the method to test test_service = Groups("testkey") - response = test_service.delete("soluta") + response = test_service.delete("et") self.assertEqual(response, {}) responses.reset(), @@ -153,7 +101,7 @@ def test_delete(self): def test_delete_required_fields_missing(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/workplace/groups/group/accusantium", + "https://api.doppler.com/v3/workplace/groups/group/amet", json={}, status=202, ) @@ -166,68 +114,70 @@ def test_delete_required_fields_missing(self): def test_delete_error_on_non_200(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/workplace/groups/group/alias", - json={}, - status=404, + "https://api.doppler.com/v3/workplace/groups/group/a", json={}, status=404 ) with self.assertRaises(ClientException): test_service = Groups("testkey") - test_service.delete("alias") + test_service.delete("a") responses.reset() @responses.activate - def test_add_member(self): + def test_list(self): # Mock the API response - responses.post( - "https://api.doppler.com/v3/workplace/groups/group/officiis/members", - json={}, - status=200, + responses.get( + "https://api.doppler.com/v3/workplace/groups", json={}, status=200 ) # call the method to test test_service = Groups("testkey") - response = test_service.add_member("officiis", {}) + response = test_service.list(3, 1) self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_add_member_required_fields_missing(self): + def test_list_error_on_non_200(self): # Mock the API response - responses.post( - "https://api.doppler.com/v3/workplace/groups/group/ut/members", - json={}, - status=202, + responses.get( + "https://api.doppler.com/v3/workplace/groups", json={}, status=404 ) - with self.assertRaises(TypeError): + with self.assertRaises(ClientException): test_service = Groups("testkey") - test_service.add_member() + test_service.list(6, 2) + responses.reset() + + @responses.activate + def test_create(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/workplace/groups", json={}, status=200 + ) + # call the method to test + test_service = Groups("testkey") + response = test_service.create({}) + self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_add_member_error_on_non_200(self): + def test_create_error_on_non_200(self): # Mock the API response responses.post( - "https://api.doppler.com/v3/workplace/groups/group/asperiores/members", - json={}, - status=404, + "https://api.doppler.com/v3/workplace/groups", json={}, status=404 ) with self.assertRaises(ClientException): test_service = Groups("testkey") - test_service.add_member("asperiores", {}) + test_service.create({}) responses.reset() @responses.activate def test_delete_member(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/workplace/groups/group/exercitationem/members/workplace_user/numquam", + "https://api.doppler.com/v3/workplace/groups/group/quidem/members/workplace_user/voluptas", json={}, status=200, ) # call the method to test test_service = Groups("testkey") - response = test_service.delete_member( - "numquam", "workplace_user", "exercitationem" - ) + response = test_service.delete_member("voluptas", "workplace_user", "quidem") self.assertEqual(response, {}) responses.reset(), @@ -235,7 +185,7 @@ def test_delete_member(self): def test_delete_member_required_fields_missing(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/workplace/groups/group/eveniet/members/workplace_user/reprehenderit", + "https://api.doppler.com/v3/workplace/groups/group/temporibus/members/workplace_user/eum", json={}, status=202, ) @@ -248,13 +198,53 @@ def test_delete_member_required_fields_missing(self): def test_delete_member_error_on_non_200(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/workplace/groups/group/nisi/members/workplace_user/rerum", + "https://api.doppler.com/v3/workplace/groups/group/et/members/workplace_user/natus", + json={}, + status=404, + ) + with self.assertRaises(ClientException): + test_service = Groups("testkey") + test_service.delete_member("natus", "workplace_user", "et") + responses.reset() + + @responses.activate + def test_add_member(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/workplace/groups/group/dicta/members", + json={}, + status=200, + ) + # call the method to test + test_service = Groups("testkey") + response = test_service.add_member("dicta", {}) + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_add_member_required_fields_missing(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/workplace/groups/group/velit/members", + json={}, + status=202, + ) + with self.assertRaises(TypeError): + test_service = Groups("testkey") + test_service.add_member() + responses.reset(), + + @responses.activate + def test_add_member_error_on_non_200(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/workplace/groups/group/sequi/members", json={}, status=404, ) with self.assertRaises(ClientException): test_service = Groups("testkey") - test_service.delete_member("rerum", "workplace_user", "nisi") + test_service.add_member("sequi", {}) responses.reset() diff --git a/test/services/test_integrations.py b/test/services/test_integrations.py index 43562fb..1478f68 100644 --- a/test/services/test_integrations.py +++ b/test/services/test_integrations.py @@ -9,44 +9,6 @@ class TestIntegrations_(unittest.TestCase): def test_true(self): self.assertTrue(True) - @responses.activate - def test_list(self): - # Mock the API response - responses.get("https://api.doppler.com/v3/integrations", json={}, status=200) - # call the method to test - test_service = Integrations("testkey") - response = test_service.list() - self.assertEqual(response, {}) - responses.reset(), - - @responses.activate - def test_list_error_on_non_200(self): - # Mock the API response - responses.get("https://api.doppler.com/v3/integrations", json={}, status=404) - with self.assertRaises(ClientException): - test_service = Integrations("testkey") - test_service.list() - responses.reset() - - @responses.activate - def test_create(self): - # Mock the API response - responses.post("https://api.doppler.com/v3/integrations", json={}, status=200) - # call the method to test - test_service = Integrations("testkey") - response = test_service.create({}) - self.assertEqual(response, {}) - responses.reset(), - - @responses.activate - def test_create_error_on_non_200(self): - # Mock the API response - responses.post("https://api.doppler.com/v3/integrations", json={}, status=404) - with self.assertRaises(ClientException): - test_service = Integrations("testkey") - test_service.create({}) - responses.reset() - @responses.activate def test_get(self): # Mock the API response @@ -55,7 +17,7 @@ def test_get(self): ) # call the method to test test_service = Integrations("testkey") - response = test_service.get("deleniti") + response = test_service.get("veniam") self.assertEqual(response, {}) responses.reset(), @@ -78,7 +40,7 @@ def test_get_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Integrations("testkey") - test_service.get("aspernatur") + test_service.get("animi") responses.reset() @responses.activate @@ -89,7 +51,7 @@ def test_update(self): ) # call the method to test test_service = Integrations("testkey") - response = test_service.update("repellendus", {}) + response = test_service.update("maiores", {}) self.assertEqual(response, {}) responses.reset(), @@ -112,7 +74,7 @@ def test_update_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Integrations("testkey") - test_service.update("accusantium", {}) + test_service.update("explicabo", {}) responses.reset() @responses.activate @@ -123,7 +85,7 @@ def test_delete(self): ) # call the method to test test_service = Integrations("testkey") - response = test_service.delete("nemo") + response = test_service.delete("optio") self.assertEqual(response, {}) responses.reset(), @@ -146,7 +108,45 @@ def test_delete_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Integrations("testkey") - test_service.delete("quod") + test_service.delete("tenetur") + responses.reset() + + @responses.activate + def test_list(self): + # Mock the API response + responses.get("https://api.doppler.com/v3/integrations", json={}, status=200) + # call the method to test + test_service = Integrations("testkey") + response = test_service.list() + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_list_error_on_non_200(self): + # Mock the API response + responses.get("https://api.doppler.com/v3/integrations", json={}, status=404) + with self.assertRaises(ClientException): + test_service = Integrations("testkey") + test_service.list() + responses.reset() + + @responses.activate + def test_create(self): + # Mock the API response + responses.post("https://api.doppler.com/v3/integrations", json={}, status=200) + # call the method to test + test_service = Integrations("testkey") + response = test_service.create({}) + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_create_error_on_non_200(self): + # Mock the API response + responses.post("https://api.doppler.com/v3/integrations", json={}, status=404) + with self.assertRaises(ClientException): + test_service = Integrations("testkey") + test_service.create({}) responses.reset() diff --git a/test/services/test_invites.py b/test/services/test_invites.py index 65a349a..2542bf2 100644 --- a/test/services/test_invites.py +++ b/test/services/test_invites.py @@ -17,7 +17,7 @@ def test_list(self): ) # call the method to test test_service = Invites("testkey") - response = test_service.list(1, 2) + response = test_service.list(7, 9) self.assertEqual(response, {}) responses.reset(), @@ -29,7 +29,7 @@ def test_list_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Invites("testkey") - test_service.list(3, 4) + test_service.list(7, 2) responses.reset() diff --git a/test/services/test_project_members.py b/test/services/test_project_members.py index be3afe0..bb97cd1 100644 --- a/test/services/test_project_members.py +++ b/test/services/test_project_members.py @@ -17,7 +17,7 @@ def test_list(self): ) # call the method to test test_service = ProjectMembers("testkey") - response = test_service.list("aut", 6, 2) + response = test_service.list("error", 6, 6) self.assertEqual(response, {}) responses.reset(), @@ -40,7 +40,7 @@ def test_list_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = ProjectMembers("testkey") - test_service.list("molestiae", 4, 5) + test_service.list("exercitationem", 8, 9) responses.reset() @responses.activate @@ -51,7 +51,7 @@ def test_add(self): ) # call the method to test test_service = ProjectMembers("testkey") - response = test_service.add("beatae", {}) + response = test_service.add("aut", {}) self.assertEqual(response, {}) responses.reset(), @@ -74,20 +74,20 @@ def test_add_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = ProjectMembers("testkey") - test_service.add("aliquam", {}) + test_service.add("provident", {}) responses.reset() @responses.activate def test_get(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/projects/project/members/member/workplace_user/a", + "https://api.doppler.com/v3/projects/project/members/member/workplace_user/tempore", json={}, status=200, ) # call the method to test test_service = ProjectMembers("testkey") - response = test_service.get("a", "workplace_user", "et") + response = test_service.get("tempore", "workplace_user", "eius") self.assertEqual(response, {}) responses.reset(), @@ -95,7 +95,7 @@ def test_get(self): def test_get_required_fields_missing(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/projects/project/members/member/workplace_user/aliquam", + "https://api.doppler.com/v3/projects/project/members/member/workplace_user/ab", json={}, status=202, ) @@ -108,26 +108,26 @@ def test_get_required_fields_missing(self): def test_get_error_on_non_200(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/projects/project/members/member/workplace_user/magni", + "https://api.doppler.com/v3/projects/project/members/member/workplace_user/voluptatibus", json={}, status=404, ) with self.assertRaises(ClientException): test_service = ProjectMembers("testkey") - test_service.get("magni", "workplace_user", "saepe") + test_service.get("voluptatibus", "workplace_user", "provident") responses.reset() @responses.activate def test_update(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/projects/project/members/member/workplace_user/ipsum", + "https://api.doppler.com/v3/projects/project/members/member/workplace_user/occaecati", json={}, status=200, ) # call the method to test test_service = ProjectMembers("testkey") - response = test_service.update("recusandae", "ipsum", "workplace_user", {}) + response = test_service.update("beatae", "occaecati", "workplace_user", {}) self.assertEqual(response, {}) responses.reset(), @@ -135,7 +135,7 @@ def test_update(self): def test_update_required_fields_missing(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/projects/project/members/member/workplace_user/sit", + "https://api.doppler.com/v3/projects/project/members/member/workplace_user/vel", json={}, status=202, ) @@ -148,26 +148,26 @@ def test_update_required_fields_missing(self): def test_update_error_on_non_200(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/projects/project/members/member/workplace_user/reprehenderit", + "https://api.doppler.com/v3/projects/project/members/member/workplace_user/quo", json={}, status=404, ) with self.assertRaises(ClientException): test_service = ProjectMembers("testkey") - test_service.update("odit", "reprehenderit", "workplace_user", {}) + test_service.update("eos", "quo", "workplace_user", {}) responses.reset() @responses.activate def test_delete(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/projects/project/members/member/workplace_user/iure", + "https://api.doppler.com/v3/projects/project/members/member/workplace_user/qui", json={}, status=200, ) # call the method to test test_service = ProjectMembers("testkey") - response = test_service.delete("hic", "iure", "workplace_user") + response = test_service.delete("earum", "qui", "workplace_user") self.assertEqual(response, {}) responses.reset(), @@ -175,7 +175,7 @@ def test_delete(self): def test_delete_required_fields_missing(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/projects/project/members/member/workplace_user/provident", + "https://api.doppler.com/v3/projects/project/members/member/workplace_user/labore", json={}, status=202, ) @@ -188,13 +188,13 @@ def test_delete_required_fields_missing(self): def test_delete_error_on_non_200(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/projects/project/members/member/workplace_user/sequi", + "https://api.doppler.com/v3/projects/project/members/member/workplace_user/ea", json={}, status=404, ) with self.assertRaises(ClientException): test_service = ProjectMembers("testkey") - test_service.delete("ab", "sequi", "workplace_user") + test_service.delete("sequi", "ea", "workplace_user") responses.reset() diff --git a/test/services/test_project_roles.py b/test/services/test_project_roles.py index ae24b43..6e2f1c8 100644 --- a/test/services/test_project_roles.py +++ b/test/services/test_project_roles.py @@ -9,55 +9,17 @@ class TestProjectRoles_(unittest.TestCase): def test_true(self): self.assertTrue(True) - @responses.activate - def test_list(self): - # Mock the API response - responses.get("https://api.doppler.com/v3/projects/roles", json={}, status=200) - # call the method to test - test_service = ProjectRoles("testkey") - response = test_service.list() - self.assertEqual(response, {}) - responses.reset(), - - @responses.activate - def test_list_error_on_non_200(self): - # Mock the API response - responses.get("https://api.doppler.com/v3/projects/roles", json={}, status=404) - with self.assertRaises(ClientException): - test_service = ProjectRoles("testkey") - test_service.list() - responses.reset() - - @responses.activate - def test_create(self): - # Mock the API response - responses.post("https://api.doppler.com/v3/projects/roles", json={}, status=200) - # call the method to test - test_service = ProjectRoles("testkey") - response = test_service.create() - self.assertEqual(response, {}) - responses.reset(), - - @responses.activate - def test_create_error_on_non_200(self): - # Mock the API response - responses.post("https://api.doppler.com/v3/projects/roles", json={}, status=404) - with self.assertRaises(ClientException): - test_service = ProjectRoles("testkey") - test_service.create() - responses.reset() - @responses.activate def test_get(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/projects/roles/role/doloremque", + "https://api.doppler.com/v3/projects/roles/role/deserunt", json={}, status=200, ) # call the method to test test_service = ProjectRoles("testkey") - response = test_service.get("doloremque") + response = test_service.get("deserunt") self.assertEqual(response, {}) responses.reset(), @@ -65,7 +27,9 @@ def test_get(self): def test_get_required_fields_missing(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/projects/roles/role/id", json={}, status=202 + "https://api.doppler.com/v3/projects/roles/role/ratione", + json={}, + status=202, ) with self.assertRaises(TypeError): test_service = ProjectRoles("testkey") @@ -76,24 +40,26 @@ def test_get_required_fields_missing(self): def test_get_error_on_non_200(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/projects/roles/role/magni", json={}, status=404 + "https://api.doppler.com/v3/projects/roles/role/ratione", + json={}, + status=404, ) with self.assertRaises(ClientException): test_service = ProjectRoles("testkey") - test_service.get("magni") + test_service.get("ratione") responses.reset() @responses.activate def test_update(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/projects/roles/role/corrupti", + "https://api.doppler.com/v3/projects/roles/role/deleniti", json={}, status=200, ) # call the method to test test_service = ProjectRoles("testkey") - response = test_service.update("corrupti") + response = test_service.update("deleniti", {}) self.assertEqual(response, {}) responses.reset(), @@ -101,7 +67,9 @@ def test_update(self): def test_update_required_fields_missing(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/projects/roles/role/iste", json={}, status=202 + "https://api.doppler.com/v3/projects/roles/role/inventore", + json={}, + status=202, ) with self.assertRaises(TypeError): test_service = ProjectRoles("testkey") @@ -112,26 +80,24 @@ def test_update_required_fields_missing(self): def test_update_error_on_non_200(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/projects/roles/role/delectus", - json={}, - status=404, + "https://api.doppler.com/v3/projects/roles/role/ut", json={}, status=404 ) with self.assertRaises(ClientException): test_service = ProjectRoles("testkey") - test_service.update("delectus") + test_service.update("ut", {}) responses.reset() @responses.activate def test_delete(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/projects/roles/role/repellat", + "https://api.doppler.com/v3/projects/roles/role/molestias", json={}, status=200, ) # call the method to test test_service = ProjectRoles("testkey") - response = test_service.delete("repellat") + response = test_service.delete("molestias") self.assertEqual(response, {}) responses.reset(), @@ -139,9 +105,7 @@ def test_delete(self): def test_delete_required_fields_missing(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/projects/roles/role/inventore", - json={}, - status=202, + "https://api.doppler.com/v3/projects/roles/role/porro", json={}, status=202 ) with self.assertRaises(TypeError): test_service = ProjectRoles("testkey") @@ -152,13 +116,49 @@ def test_delete_required_fields_missing(self): def test_delete_error_on_non_200(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/projects/roles/role/veritatis", - json={}, - status=404, + "https://api.doppler.com/v3/projects/roles/role/beatae", json={}, status=404 ) with self.assertRaises(ClientException): test_service = ProjectRoles("testkey") - test_service.delete("veritatis") + test_service.delete("beatae") + responses.reset() + + @responses.activate + def test_list(self): + # Mock the API response + responses.get("https://api.doppler.com/v3/projects/roles", json={}, status=200) + # call the method to test + test_service = ProjectRoles("testkey") + response = test_service.list() + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_list_error_on_non_200(self): + # Mock the API response + responses.get("https://api.doppler.com/v3/projects/roles", json={}, status=404) + with self.assertRaises(ClientException): + test_service = ProjectRoles("testkey") + test_service.list() + responses.reset() + + @responses.activate + def test_create(self): + # Mock the API response + responses.post("https://api.doppler.com/v3/projects/roles", json={}, status=200) + # call the method to test + test_service = ProjectRoles("testkey") + response = test_service.create({}) + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_create_error_on_non_200(self): + # Mock the API response + responses.post("https://api.doppler.com/v3/projects/roles", json={}, status=404) + with self.assertRaises(ClientException): + test_service = ProjectRoles("testkey") + test_service.create({}) responses.reset() @responses.activate diff --git a/test/services/test_projects.py b/test/services/test_projects.py index 81cf81d..8e0df6e 100644 --- a/test/services/test_projects.py +++ b/test/services/test_projects.py @@ -15,7 +15,7 @@ def test_list(self): responses.get("https://api.doppler.com/v3/projects", json={}, status=200) # call the method to test test_service = Projects("testkey") - response = test_service.list(9, 5) + response = test_service.list(6, 5) self.assertEqual(response, {}) responses.reset(), @@ -25,7 +25,7 @@ def test_list_error_on_non_200(self): responses.get("https://api.doppler.com/v3/projects", json={}, status=404) with self.assertRaises(ClientException): test_service = Projects("testkey") - test_service.list(9, 6) + test_service.list(2, 5) responses.reset() @responses.activate @@ -55,7 +55,7 @@ def test_get(self): ) # call the method to test test_service = Projects("testkey") - response = test_service.get("qui") + response = test_service.get("doloribus") self.assertEqual(response, {}) responses.reset(), @@ -78,7 +78,7 @@ def test_get_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Projects("testkey") - test_service.get("ducimus") + test_service.get("rem") responses.reset() @responses.activate diff --git a/test/services/test_retrieve.py b/test/services/test_retrieve.py new file mode 100644 index 0000000..fe0d0f1 --- /dev/null +++ b/test/services/test_retrieve.py @@ -0,0 +1,54 @@ +import unittest +import responses +from src.dopplersdk.net.http_client import HTTPClient +from http_exceptions import ClientException +from src.dopplersdk.services.retrieve import Retrieve + + +class TestRetrieve_(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + @responses.activate + def test_member(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/workplace/groups/group/rerum/members/workplace_user/nam", + json={}, + status=200, + ) + # call the method to test + test_service = Retrieve("testkey") + response = test_service.member("nam", "workplace_user", "rerum") + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_member_required_fields_missing(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/workplace/groups/group/eaque/members/workplace_user/rerum", + json={}, + status=202, + ) + with self.assertRaises(TypeError): + test_service = Retrieve("testkey") + test_service.member() + responses.reset(), + + @responses.activate + def test_member_error_on_non_200(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/workplace/groups/group/cum/members/workplace_user/eum", + json={}, + status=404, + ) + with self.assertRaises(ClientException): + test_service = Retrieve("testkey") + test_service.member("eum", "workplace_user", "cum") + responses.reset() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/services/test_secrets.py b/test/services/test_secrets.py index 8fe66b4..c21ec79 100644 --- a/test/services/test_secrets.py +++ b/test/services/test_secrets.py @@ -17,9 +17,7 @@ def test_list(self): ) # call the method to test test_service = Secrets("testkey") - response = test_service.list( - "corporis", "pariatur", "numquam", True, 9, "dolores", True - ) + response = test_service.list("iure", "ab", "occaecati", True, 4, "cumque", True) self.assertEqual(response, {}) responses.reset(), @@ -42,7 +40,7 @@ def test_list_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Secrets("testkey") - test_service.list("aut", "repellendus", "autem", True, 9, "a", True) + test_service.list("commodi", "nulla", "facilis", True, 3, "impedit", True) responses.reset() @responses.activate @@ -76,7 +74,7 @@ def test_get(self): ) # call the method to test test_service = Secrets("testkey") - response = test_service.get("Ena", "laudantium", "ad") + response = test_service.get("Granville", "ut", "perferendis") self.assertEqual(response, {}) responses.reset(), @@ -99,7 +97,7 @@ def test_get_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Secrets("testkey") - test_service.get("Alex", "delectus", "reprehenderit") + test_service.get("Flo", "delectus", "dicta") responses.reset() @responses.activate @@ -110,7 +108,7 @@ def test_delete(self): ) # call the method to test test_service = Secrets("testkey") - response = test_service.delete("Gregory", "expedita", "eos") + response = test_service.delete("Ryley", "eos", "quae") self.assertEqual(response, {}) responses.reset(), @@ -133,7 +131,7 @@ def test_delete_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Secrets("testkey") - test_service.delete("Maye", "accusantium", "beatae") + test_service.delete("Alberta", "nobis", "quam") responses.reset() @responses.activate @@ -146,7 +144,9 @@ def test_download(self): ) # call the method to test test_service = Secrets("testkey") - response = test_service.download("consequuntur", "in", "json", "camel", True, 2) + response = test_service.download( + "dicta", "dolorem", "json", "camel", True, 1, "ad" + ) self.assertEqual(response, {}) responses.reset(), @@ -173,74 +173,76 @@ def test_download_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Secrets("testkey") - test_service.download("voluptates", "harum", "json", "camel", True, 5) + test_service.download( + "error", "delectus", "json", "camel", True, 3, "ipsam" + ) responses.reset() @responses.activate - def test_names(self): + def test_update_note(self): # Mock the API response - responses.get( - "https://api.doppler.com/v3/configs/config/secrets/names", + responses.post( + "https://api.doppler.com/v3/configs/config/secrets/note", json={}, status=200, ) # call the method to test test_service = Secrets("testkey") - response = test_service.names("fuga", "doloribus", True, True) + response = test_service.update_note({}) self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_names_required_fields_missing(self): - # Mock the API response - responses.get( - "https://api.doppler.com/v3/configs/config/secrets/names", - json={}, - status=202, - ) - with self.assertRaises(TypeError): - test_service = Secrets("testkey") - test_service.names() - responses.reset(), - - @responses.activate - def test_names_error_on_non_200(self): + def test_update_note_error_on_non_200(self): # Mock the API response - responses.get( - "https://api.doppler.com/v3/configs/config/secrets/names", + responses.post( + "https://api.doppler.com/v3/configs/config/secrets/note", json={}, status=404, ) with self.assertRaises(ClientException): test_service = Secrets("testkey") - test_service.names("neque", "quidem", True, True) + test_service.update_note({}) responses.reset() @responses.activate - def test_update_note(self): + def test_names(self): # Mock the API response - responses.post( - "https://api.doppler.com/v3/configs/config/secrets/note", + responses.get( + "https://api.doppler.com/v3/configs/config/secrets/names", json={}, status=200, ) # call the method to test test_service = Secrets("testkey") - response = test_service.update_note({}) + response = test_service.names("suscipit", "aspernatur", True, True) self.assertEqual(response, {}) responses.reset(), @responses.activate - def test_update_note_error_on_non_200(self): + def test_names_required_fields_missing(self): # Mock the API response - responses.post( - "https://api.doppler.com/v3/configs/config/secrets/note", + responses.get( + "https://api.doppler.com/v3/configs/config/secrets/names", + json={}, + status=202, + ) + with self.assertRaises(TypeError): + test_service = Secrets("testkey") + test_service.names() + responses.reset(), + + @responses.activate + def test_names_error_on_non_200(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/configs/config/secrets/names", json={}, status=404, ) with self.assertRaises(ClientException): test_service = Secrets("testkey") - test_service.update_note({}) + test_service.names("necessitatibus", "odit", True, True) responses.reset() diff --git a/test/services/test_service_account_tokens.py b/test/services/test_service_account_tokens.py new file mode 100644 index 0000000..7fe35ad --- /dev/null +++ b/test/services/test_service_account_tokens.py @@ -0,0 +1,174 @@ +import unittest +import responses +from src.dopplersdk.net.http_client import HTTPClient +from http_exceptions import ClientException +from src.dopplersdk.services.service_account_tokens import ServiceAccountTokens + + +class TestServiceAccountTokens_(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + @responses.activate + def test_list(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/workplace/service_accounts/service_account/atque/tokens", + json={}, + status=200, + ) + # call the method to test + test_service = ServiceAccountTokens("testkey") + response = test_service.list("atque", 4, 6) + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_list_required_fields_missing(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/workplace/service_accounts/service_account/accusamus/tokens", + json={}, + status=202, + ) + with self.assertRaises(TypeError): + test_service = ServiceAccountTokens("testkey") + test_service.list() + responses.reset(), + + @responses.activate + def test_list_error_on_non_200(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/workplace/service_accounts/service_account/itaque/tokens", + json={}, + status=404, + ) + with self.assertRaises(ClientException): + test_service = ServiceAccountTokens("testkey") + test_service.list("itaque", 8, 5) + responses.reset() + + @responses.activate + def test_create(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/workplace/service_accounts/service_account/quia/tokens", + json={}, + status=200, + ) + # call the method to test + test_service = ServiceAccountTokens("testkey") + response = test_service.create("quia", {}) + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_create_required_fields_missing(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/workplace/service_accounts/service_account/nostrum/tokens", + json={}, + status=202, + ) + with self.assertRaises(TypeError): + test_service = ServiceAccountTokens("testkey") + test_service.create() + responses.reset(), + + @responses.activate + def test_create_error_on_non_200(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/workplace/service_accounts/service_account/quas/tokens", + json={}, + status=404, + ) + with self.assertRaises(ClientException): + test_service = ServiceAccountTokens("testkey") + test_service.create("quas", {}) + responses.reset() + + @responses.activate + def test_get(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/workplace/service_accounts/service_account/amet/tokens/token/eaque", + json={}, + status=200, + ) + # call the method to test + test_service = ServiceAccountTokens("testkey") + response = test_service.get("eaque", "amet") + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_get_required_fields_missing(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/workplace/service_accounts/service_account/omnis/tokens/token/ullam", + json={}, + status=202, + ) + with self.assertRaises(TypeError): + test_service = ServiceAccountTokens("testkey") + test_service.get() + responses.reset(), + + @responses.activate + def test_get_error_on_non_200(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/workplace/service_accounts/service_account/perspiciatis/tokens/token/tempore", + json={}, + status=404, + ) + with self.assertRaises(ClientException): + test_service = ServiceAccountTokens("testkey") + test_service.get("tempore", "perspiciatis") + responses.reset() + + @responses.activate + def test_delete(self): + # Mock the API response + responses.delete( + "https://api.doppler.com/v3/workplace/service_accounts/service_account/quos/tokens/token/praesentium", + json={}, + status=200, + ) + # call the method to test + test_service = ServiceAccountTokens("testkey") + response = test_service.delete("praesentium", "quos") + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_delete_required_fields_missing(self): + # Mock the API response + responses.delete( + "https://api.doppler.com/v3/workplace/service_accounts/service_account/id/tokens/token/expedita", + json={}, + status=202, + ) + with self.assertRaises(TypeError): + test_service = ServiceAccountTokens("testkey") + test_service.delete() + responses.reset(), + + @responses.activate + def test_delete_error_on_non_200(self): + # Mock the API response + responses.delete( + "https://api.doppler.com/v3/workplace/service_accounts/service_account/minus/tokens/token/architecto", + json={}, + status=404, + ) + with self.assertRaises(ClientException): + test_service = ServiceAccountTokens("testkey") + test_service.delete("architecto", "minus") + responses.reset() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/services/test_service_accounts.py b/test/services/test_service_accounts.py index 883422b..1ca7b2e 100644 --- a/test/services/test_service_accounts.py +++ b/test/services/test_service_accounts.py @@ -9,63 +9,17 @@ class TestServiceAccounts_(unittest.TestCase): def test_true(self): self.assertTrue(True) - @responses.activate - def test_list(self): - # Mock the API response - responses.get( - "https://api.doppler.com/v3/workplace/service_accounts", json={}, status=200 - ) - # call the method to test - test_service = ServiceAccounts("testkey") - response = test_service.list(6, 5) - self.assertEqual(response, {}) - responses.reset(), - - @responses.activate - def test_list_error_on_non_200(self): - # Mock the API response - responses.get( - "https://api.doppler.com/v3/workplace/service_accounts", json={}, status=404 - ) - with self.assertRaises(ClientException): - test_service = ServiceAccounts("testkey") - test_service.list(2, 2) - responses.reset() - - @responses.activate - def test_create(self): - # Mock the API response - responses.post( - "https://api.doppler.com/v3/workplace/service_accounts", json={}, status=200 - ) - # call the method to test - test_service = ServiceAccounts("testkey") - response = test_service.create({}) - self.assertEqual(response, {}) - responses.reset(), - - @responses.activate - def test_create_error_on_non_200(self): - # Mock the API response - responses.post( - "https://api.doppler.com/v3/workplace/service_accounts", json={}, status=404 - ) - with self.assertRaises(ClientException): - test_service = ServiceAccounts("testkey") - test_service.create({}) - responses.reset() - @responses.activate def test_get(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/service_accounts/service_account/praesentium", + "https://api.doppler.com/v3/workplace/service_accounts/service_account/numquam", json={}, status=200, ) # call the method to test test_service = ServiceAccounts("testkey") - response = test_service.get("praesentium") + response = test_service.get("numquam") self.assertEqual(response, {}) responses.reset(), @@ -73,7 +27,7 @@ def test_get(self): def test_get_required_fields_missing(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/service_accounts/service_account/deserunt", + "https://api.doppler.com/v3/workplace/service_accounts/service_account/mollitia", json={}, status=202, ) @@ -86,26 +40,26 @@ def test_get_required_fields_missing(self): def test_get_error_on_non_200(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/service_accounts/service_account/quia", + "https://api.doppler.com/v3/workplace/service_accounts/service_account/eum", json={}, status=404, ) with self.assertRaises(ClientException): test_service = ServiceAccounts("testkey") - test_service.get("quia") + test_service.get("eum") responses.reset() @responses.activate def test_update(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/workplace/service_accounts/service_account/repellat", + "https://api.doppler.com/v3/workplace/service_accounts/service_account/soluta", json={}, status=200, ) # call the method to test test_service = ServiceAccounts("testkey") - response = test_service.update("repellat", {}) + response = test_service.update("soluta", {}) self.assertEqual(response, {}) responses.reset(), @@ -113,7 +67,7 @@ def test_update(self): def test_update_required_fields_missing(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/workplace/service_accounts/service_account/eaque", + "https://api.doppler.com/v3/workplace/service_accounts/service_account/quibusdam", json={}, status=202, ) @@ -126,26 +80,26 @@ def test_update_required_fields_missing(self): def test_update_error_on_non_200(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/workplace/service_accounts/service_account/vitae", + "https://api.doppler.com/v3/workplace/service_accounts/service_account/facilis", json={}, status=404, ) with self.assertRaises(ClientException): test_service = ServiceAccounts("testkey") - test_service.update("vitae", {}) + test_service.update("facilis", {}) responses.reset() @responses.activate def test_delete(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/workplace/service_accounts/service_account/porro", + "https://api.doppler.com/v3/workplace/service_accounts/service_account/ducimus", json={}, status=200, ) # call the method to test test_service = ServiceAccounts("testkey") - response = test_service.delete("porro") + response = test_service.delete("ducimus") self.assertEqual(response, {}) responses.reset(), @@ -153,7 +107,7 @@ def test_delete(self): def test_delete_required_fields_missing(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/workplace/service_accounts/service_account/iste", + "https://api.doppler.com/v3/workplace/service_accounts/service_account/quaerat", json={}, status=202, ) @@ -166,13 +120,59 @@ def test_delete_required_fields_missing(self): def test_delete_error_on_non_200(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/workplace/service_accounts/service_account/voluptatibus", + "https://api.doppler.com/v3/workplace/service_accounts/service_account/non", json={}, status=404, ) with self.assertRaises(ClientException): test_service = ServiceAccounts("testkey") - test_service.delete("voluptatibus") + test_service.delete("non") + responses.reset() + + @responses.activate + def test_list(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/workplace/service_accounts", json={}, status=200 + ) + # call the method to test + test_service = ServiceAccounts("testkey") + response = test_service.list(2, 7) + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_list_error_on_non_200(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/workplace/service_accounts", json={}, status=404 + ) + with self.assertRaises(ClientException): + test_service = ServiceAccounts("testkey") + test_service.list(1, 1) + responses.reset() + + @responses.activate + def test_create(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/workplace/service_accounts", json={}, status=200 + ) + # call the method to test + test_service = ServiceAccounts("testkey") + response = test_service.create({}) + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_create_error_on_non_200(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/workplace/service_accounts", json={}, status=404 + ) + with self.assertRaises(ClientException): + test_service = ServiceAccounts("testkey") + test_service.create({}) responses.reset() diff --git a/test/services/test_service_tokens.py b/test/services/test_service_tokens.py index 477caae..b666500 100644 --- a/test/services/test_service_tokens.py +++ b/test/services/test_service_tokens.py @@ -9,6 +9,33 @@ class TestServiceTokens_(unittest.TestCase): def test_true(self): self.assertTrue(True) + @responses.activate + def test_delete(self): + # Mock the API response + responses.delete( + "https://api.doppler.com/v3/configs/config/tokens/token", + json={}, + status=200, + ) + # call the method to test + test_service = ServiceTokens("testkey") + response = test_service.delete({}) + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_delete_error_on_non_200(self): + # Mock the API response + responses.delete( + "https://api.doppler.com/v3/configs/config/tokens/token", + json={}, + status=404, + ) + with self.assertRaises(ClientException): + test_service = ServiceTokens("testkey") + test_service.delete({}) + responses.reset() + @responses.activate def test_list(self): # Mock the API response @@ -17,7 +44,7 @@ def test_list(self): ) # call the method to test test_service = ServiceTokens("testkey") - response = test_service.list("aliquid", "esse") + response = test_service.list("ea", "similique") self.assertEqual(response, {}) responses.reset(), @@ -40,7 +67,7 @@ def test_list_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = ServiceTokens("testkey") - test_service.list("illo", "quod") + test_service.list("impedit", "ipsam") responses.reset() @responses.activate @@ -66,33 +93,6 @@ def test_create_error_on_non_200(self): test_service.create({}) responses.reset() - @responses.activate - def test_delete(self): - # Mock the API response - responses.delete( - "https://api.doppler.com/v3/configs/config/tokens/token", - json={}, - status=200, - ) - # call the method to test - test_service = ServiceTokens("testkey") - response = test_service.delete({}) - self.assertEqual(response, {}) - responses.reset(), - - @responses.activate - def test_delete_error_on_non_200(self): - # Mock the API response - responses.delete( - "https://api.doppler.com/v3/configs/config/tokens/token", - json={}, - status=404, - ) - with self.assertRaises(ClientException): - test_service = ServiceTokens("testkey") - test_service.delete({}) - responses.reset() - if __name__ == "__main__": unittest.main() diff --git a/test/services/test_syncs.py b/test/services/test_syncs.py index d33cc18..9962fa2 100644 --- a/test/services/test_syncs.py +++ b/test/services/test_syncs.py @@ -17,7 +17,7 @@ def test_create(self): ) # call the method to test test_service = Syncs("testkey") - response = test_service.create("sed", "praesentium", {}) + response = test_service.create("vero", "odio", {}) self.assertEqual(response, {}) responses.reset(), @@ -40,7 +40,7 @@ def test_create_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Syncs("testkey") - test_service.create("rem", "est", {}) + test_service.create("deserunt", "molestias", {}) responses.reset() @responses.activate @@ -51,7 +51,7 @@ def test_get(self): ) # call the method to test test_service = Syncs("testkey") - response = test_service.get("sit", "nobis", "consequuntur") + response = test_service.get("voluptatum", "sapiente", "ducimus") self.assertEqual(response, {}) responses.reset(), @@ -74,7 +74,7 @@ def test_get_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Syncs("testkey") - test_service.get("repellat", "a", "voluptates") + test_service.get("a", "perspiciatis", "consequatur") responses.reset() @responses.activate @@ -85,7 +85,7 @@ def test_delete(self): ) # call the method to test test_service = Syncs("testkey") - response = test_service.delete(True, "nemo", "ratione", "iure") + response = test_service.delete(True, "autem", "vitae", "occaecati") self.assertEqual(response, {}) responses.reset(), @@ -108,7 +108,7 @@ def test_delete_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = Syncs("testkey") - test_service.delete(True, "eos", "libero", "quae") + test_service.delete(True, "in", "ad", "voluptatum") responses.reset() diff --git a/test/services/test_users.py b/test/services/test_users.py index 1b41252..74414dd 100644 --- a/test/services/test_users.py +++ b/test/services/test_users.py @@ -15,7 +15,7 @@ def test_list(self): responses.get("https://api.doppler.com/v3/workplace/users", json={}, status=200) # call the method to test test_service = Users("testkey") - response = test_service.list(7) + response = test_service.list(2, "Rylan67@gmail.com") self.assertEqual(response, {}) responses.reset(), @@ -25,20 +25,20 @@ def test_list_error_on_non_200(self): responses.get("https://api.doppler.com/v3/workplace/users", json={}, status=404) with self.assertRaises(ClientException): test_service = Users("testkey") - test_service.list(5) + test_service.list(9, "Lauriane_Schimmel70@gmail.com") responses.reset() @responses.activate def test_get(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/users/praesentium", + "https://api.doppler.com/v3/workplace/users/consequatur", json={}, status=200, ) # call the method to test test_service = Users("testkey") - response = test_service.get("praesentium") + response = test_service.get("consequatur") self.assertEqual(response, {}) responses.reset(), @@ -46,7 +46,7 @@ def test_get(self): def test_get_required_fields_missing(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/users/reiciendis", json={}, status=202 + "https://api.doppler.com/v3/workplace/users/hic", json={}, status=202 ) with self.assertRaises(TypeError): test_service = Users("testkey") @@ -57,11 +57,11 @@ def test_get_required_fields_missing(self): def test_get_error_on_non_200(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/users/nihil", json={}, status=404 + "https://api.doppler.com/v3/workplace/users/ad", json={}, status=404 ) with self.assertRaises(ClientException): test_service = Users("testkey") - test_service.get("nihil") + test_service.get("ad") responses.reset() diff --git a/test/services/test_webhooks.py b/test/services/test_webhooks.py new file mode 100644 index 0000000..b014980 --- /dev/null +++ b/test/services/test_webhooks.py @@ -0,0 +1,232 @@ +import unittest +import responses +from src.dopplersdk.net.http_client import HTTPClient +from http_exceptions import ClientException +from src.dopplersdk.services.webhooks import Webhooks + + +class TestWebhooks_(unittest.TestCase): + def test_true(self): + self.assertTrue(True) + + @responses.activate + def test_list(self): + # Mock the API response + responses.get("https://api.doppler.com/v3/webhooks", json={}, status=200) + # call the method to test + test_service = Webhooks("testkey") + response = test_service.list("exercitationem") + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_list_error_on_non_200(self): + # Mock the API response + responses.get("https://api.doppler.com/v3/webhooks", json={}, status=404) + with self.assertRaises(ClientException): + test_service = Webhooks("testkey") + test_service.list("vel") + responses.reset() + + @responses.activate + def test_add(self): + # Mock the API response + responses.post("https://api.doppler.com/v3/webhooks", json={}, status=200) + # call the method to test + test_service = Webhooks("testkey") + response = test_service.add("perspiciatis", {}) + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_add_error_on_non_200(self): + # Mock the API response + responses.post("https://api.doppler.com/v3/webhooks", json={}, status=404) + with self.assertRaises(ClientException): + test_service = Webhooks("testkey") + test_service.add("error", {}) + responses.reset() + + @responses.activate + def test_get(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/webhooks/webhook/enim", json={}, status=200 + ) + # call the method to test + test_service = Webhooks("testkey") + response = test_service.get("enim", "temporibus") + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_get_required_fields_missing(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/webhooks/webhook/dolorem", json={}, status=202 + ) + with self.assertRaises(TypeError): + test_service = Webhooks("testkey") + test_service.get() + responses.reset(), + + @responses.activate + def test_get_error_on_non_200(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/webhooks/webhook/iusto", json={}, status=404 + ) + with self.assertRaises(ClientException): + test_service = Webhooks("testkey") + test_service.get("iusto", "sint") + responses.reset() + + @responses.activate + def test_update(self): + # Mock the API response + responses.patch( + "https://api.doppler.com/v3/webhooks/webhook/maiores", json={}, status=200 + ) + # call the method to test + test_service = Webhooks("testkey") + response = test_service.update("maiores", "consequatur", {}) + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_update_required_fields_missing(self): + # Mock the API response + responses.patch( + "https://api.doppler.com/v3/webhooks/webhook/provident", json={}, status=202 + ) + with self.assertRaises(TypeError): + test_service = Webhooks("testkey") + test_service.update() + responses.reset(), + + @responses.activate + def test_update_error_on_non_200(self): + # Mock the API response + responses.patch( + "https://api.doppler.com/v3/webhooks/webhook/minus", json={}, status=404 + ) + with self.assertRaises(ClientException): + test_service = Webhooks("testkey") + test_service.update("minus", "ab", {}) + responses.reset() + + @responses.activate + def test_delete(self): + # Mock the API response + responses.delete( + "https://api.doppler.com/v3/webhooks/webhook/amet", json={}, status=200 + ) + # call the method to test + test_service = Webhooks("testkey") + response = test_service.delete("amet", "vitae") + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_delete_required_fields_missing(self): + # Mock the API response + responses.delete( + "https://api.doppler.com/v3/webhooks/webhook/placeat", json={}, status=202 + ) + with self.assertRaises(TypeError): + test_service = Webhooks("testkey") + test_service.delete() + responses.reset(), + + @responses.activate + def test_delete_error_on_non_200(self): + # Mock the API response + responses.delete( + "https://api.doppler.com/v3/webhooks/webhook/unde", json={}, status=404 + ) + with self.assertRaises(ClientException): + test_service = Webhooks("testkey") + test_service.delete("unde", "deserunt") + responses.reset() + + @responses.activate + def test_enable(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/webhooks/webhook/in/enable", json={}, status=200 + ) + # call the method to test + test_service = Webhooks("testkey") + response = test_service.enable("in", "ad") + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_enable_required_fields_missing(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/webhooks/webhook/eaque/enable", + json={}, + status=202, + ) + with self.assertRaises(TypeError): + test_service = Webhooks("testkey") + test_service.enable() + responses.reset(), + + @responses.activate + def test_enable_error_on_non_200(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/webhooks/webhook/animi/enable", + json={}, + status=404, + ) + with self.assertRaises(ClientException): + test_service = Webhooks("testkey") + test_service.enable("animi", "soluta") + responses.reset() + + @responses.activate + def test_disable(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/webhooks/webhook/porro/disable", + json={}, + status=200, + ) + # call the method to test + test_service = Webhooks("testkey") + response = test_service.disable("porro", "quis") + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_disable_required_fields_missing(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/webhooks/webhook/cumque/disable", + json={}, + status=202, + ) + with self.assertRaises(TypeError): + test_service = Webhooks("testkey") + test_service.disable() + responses.reset(), + + @responses.activate + def test_disable_error_on_non_200(self): + # Mock the API response + responses.post( + "https://api.doppler.com/v3/webhooks/webhook/veniam/disable", + json={}, + status=404, + ) + with self.assertRaises(ClientException): + test_service = Webhooks("testkey") + test_service.disable("veniam", "consequuntur") + responses.reset() + + +if __name__ == "__main__": + unittest.main() diff --git a/test/services/test_workplace_roles.py b/test/services/test_workplace_roles.py index ad32e44..a429bd7 100644 --- a/test/services/test_workplace_roles.py +++ b/test/services/test_workplace_roles.py @@ -36,7 +36,7 @@ def test_create(self): ) # call the method to test test_service = WorkplaceRoles("testkey") - response = test_service.create() + response = test_service.create({}) self.assertEqual(response, {}) responses.reset(), @@ -48,43 +48,20 @@ def test_create_error_on_non_200(self): ) with self.assertRaises(ClientException): test_service = WorkplaceRoles("testkey") - test_service.create() - responses.reset() - - @responses.activate - def test_list_permissions(self): - # Mock the API response - responses.get( - "https://api.doppler.com/v3/workplace/permissions", json={}, status=200 - ) - # call the method to test - test_service = WorkplaceRoles("testkey") - response = test_service.list_permissions() - self.assertEqual(response, {}) - responses.reset(), - - @responses.activate - def test_list_permissions_error_on_non_200(self): - # Mock the API response - responses.get( - "https://api.doppler.com/v3/workplace/permissions", json={}, status=404 - ) - with self.assertRaises(ClientException): - test_service = WorkplaceRoles("testkey") - test_service.list_permissions() + test_service.create({}) responses.reset() @responses.activate def test_get(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/roles/role/minima", + "https://api.doppler.com/v3/workplace/roles/role/similique", json={}, status=200, ) # call the method to test test_service = WorkplaceRoles("testkey") - response = test_service.get("minima") + response = test_service.get("similique") self.assertEqual(response, {}) responses.reset(), @@ -92,7 +69,9 @@ def test_get(self): def test_get_required_fields_missing(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/roles/role/odit", json={}, status=202 + "https://api.doppler.com/v3/workplace/roles/role/quibusdam", + json={}, + status=202, ) with self.assertRaises(TypeError): test_service = WorkplaceRoles("testkey") @@ -103,24 +82,24 @@ def test_get_required_fields_missing(self): def test_get_error_on_non_200(self): # Mock the API response responses.get( - "https://api.doppler.com/v3/workplace/roles/role/doloribus", + "https://api.doppler.com/v3/workplace/roles/role/veritatis", json={}, status=404, ) with self.assertRaises(ClientException): test_service = WorkplaceRoles("testkey") - test_service.get("doloribus") + test_service.get("veritatis") responses.reset() @responses.activate def test_update(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/workplace/roles/role/error", json={}, status=200 + "https://api.doppler.com/v3/workplace/roles/role/qui", json={}, status=200 ) # call the method to test test_service = WorkplaceRoles("testkey") - response = test_service.update("error") + response = test_service.update("qui", {}) self.assertEqual(response, {}) responses.reset(), @@ -128,7 +107,7 @@ def test_update(self): def test_update_required_fields_missing(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/workplace/roles/role/laborum", + "https://api.doppler.com/v3/workplace/roles/role/veritatis", json={}, status=202, ) @@ -141,22 +120,26 @@ def test_update_required_fields_missing(self): def test_update_error_on_non_200(self): # Mock the API response responses.patch( - "https://api.doppler.com/v3/workplace/roles/role/quos", json={}, status=404 + "https://api.doppler.com/v3/workplace/roles/role/inventore", + json={}, + status=404, ) with self.assertRaises(ClientException): test_service = WorkplaceRoles("testkey") - test_service.update("quos") + test_service.update("inventore", {}) responses.reset() @responses.activate def test_delete(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/workplace/roles/role/culpa", json={}, status=200 + "https://api.doppler.com/v3/workplace/roles/role/similique", + json={}, + status=200, ) # call the method to test test_service = WorkplaceRoles("testkey") - response = test_service.delete("culpa") + response = test_service.delete("similique") self.assertEqual(response, {}) responses.reset(), @@ -164,9 +147,7 @@ def test_delete(self): def test_delete_required_fields_missing(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/workplace/roles/role/commodi", - json={}, - status=202, + "https://api.doppler.com/v3/workplace/roles/role/saepe", json={}, status=202 ) with self.assertRaises(TypeError): test_service = WorkplaceRoles("testkey") @@ -177,13 +158,34 @@ def test_delete_required_fields_missing(self): def test_delete_error_on_non_200(self): # Mock the API response responses.delete( - "https://api.doppler.com/v3/workplace/roles/role/dolorem", - json={}, - status=404, + "https://api.doppler.com/v3/workplace/roles/role/id", json={}, status=404 + ) + with self.assertRaises(ClientException): + test_service = WorkplaceRoles("testkey") + test_service.delete("id") + responses.reset() + + @responses.activate + def test_list_permissions(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/workplace/permissions", json={}, status=200 + ) + # call the method to test + test_service = WorkplaceRoles("testkey") + response = test_service.list_permissions() + self.assertEqual(response, {}) + responses.reset(), + + @responses.activate + def test_list_permissions_error_on_non_200(self): + # Mock the API response + responses.get( + "https://api.doppler.com/v3/workplace/permissions", json={}, status=404 ) with self.assertRaises(ClientException): test_service = WorkplaceRoles("testkey") - test_service.delete("dolorem") + test_service.list_permissions() responses.reset()