From f582c46a864e82d9091380b19c3e49e1c7eb3233 Mon Sep 17 00:00:00 2001 From: Adrian Pasqualini Date: Thu, 26 May 2022 14:17:41 -0700 Subject: [PATCH] [OPAL-2815] Public BulkUpdate + Tagging API SDK --- .openapi-generator/FILES | 88 +- .openapi-generator/VERSION | 2 +- README.md | 52 +- api/openapi.yaml | 1531 ++++++++++++++++- docs/EntityTypeEnum.md | 12 + docs/EventsApi.md | 4 +- docs/Group.md | 23 + docs/GroupFunctionEnum.md | 12 + docs/GroupTypeEnum.md | 12 + docs/GroupsApi.md | 753 ++++++++ docs/MessageChannel.md | 18 + docs/MessageChannelIDList.md | 13 + docs/MessageChannelList.md | 12 + docs/MessageChannelProviderEnum.md | 12 + docs/MessageChannelTypeEnum.md | 12 + docs/NewAdminIDList.md | 12 + docs/PaginatedGroupsList.md | 14 + docs/PaginatedResourcesList.md | 14 + docs/Resource.md | 22 + docs/ResourceTypeEnum.md | 12 + docs/ResourcesApi.md | 653 ++++++- docs/ReviewerIDList.md | 13 + docs/Tag.md | 19 + docs/TagsApi.md | 630 +++++++ docs/TagsList.md | 12 + docs/UpdateGroupInfo.md | 21 + docs/UpdateGroupInfoList.md | 12 + docs/UpdateResourceInfo.md | 21 + docs/UpdateResourceInfoList.md | 12 + docs/UsersApi.md | 77 + docs/VisibilityEnum.md | 12 + opal/api/events_api.py | 19 +- opal/api/groups_api.py | 1274 ++++++++++++++ opal/api/resources_api.py | 1239 ++++++++++++- opal/api/sessions_api.py | 12 + opal/api/tags_api.py | 1149 +++++++++++++ opal/api/users_api.py | 142 ++ opal/api_client.py | 42 +- opal/apis/__init__.py | 2 + opal/configuration.py | 3 + opal/model/entity_type_enum.py | 284 +++ opal/model/event.py | 2 +- opal/model/group.py | 312 ++++ opal/model/group_function_enum.py | 285 +++ opal/model/group_type_enum.py | 288 ++++ opal/model/message_channel.py | 290 ++++ opal/model/message_channel_id_list.py | 262 +++ opal/model/message_channel_list.py | 268 +++ opal/model/message_channel_provider_enum.py | 274 +++ opal/model/message_channel_type_enum.py | 284 +++ opal/model/new_admin_id_list.py | 256 +++ opal/model/paginated_event_list.py | 2 +- opal/model/paginated_groups_list.py | 276 +++ opal/model/paginated_resource_user_list.py | 2 +- opal/model/paginated_resources_list.py | 276 +++ opal/model/resource.py | 306 ++++ opal/model/resource_access_level.py | 2 +- opal/model/resource_type_enum.py | 308 ++++ opal/model/resource_user.py | 2 +- opal/model/resource_user_access_status.py | 2 +- .../model/resource_user_access_status_enum.py | 2 +- opal/model/reviewer_id_list.py | 262 +++ opal/model/session.py | 2 +- opal/model/sessions_list.py | 2 +- opal/model/tag.py | 286 +++ opal/model/tags_list.py | 268 +++ opal/model/update_group_info.py | 300 ++++ opal/model/update_group_info_list.py | 268 +++ opal/model/update_resource_info.py | 300 ++++ opal/model/update_resource_info_list.py | 268 +++ opal/model/user.py | 2 +- opal/model/users_list.py | 2 +- opal/model/visibility_enum.py | 283 +++ opal/model_utils.py | 10 +- opal/models/__init__.py | 22 + opal/rest.py | 58 +- test/test_entity_type_enum.py | 36 + test/test_group.py | 42 + test/test_group_function_enum.py | 36 + test/test_group_type_enum.py | 36 + test/test_groups_api.py | 83 + test/test_message_channel.py | 40 + test/test_message_channel_id_list.py | 36 + test/test_message_channel_list.py | 38 + test/test_message_channel_provider_enum.py | 36 + test/test_message_channel_type_enum.py | 36 + test/test_new_admin_id_list.py | 36 + test/test_paginated_groups_list.py | 38 + test/test_paginated_resources_list.py | 38 + test/test_resource.py | 40 + test/test_resource_type_enum.py | 36 + test/test_reviewer_id_list.py | 36 + test/test_tag.py | 36 + test/test_tags_api.py | 77 + test/test_tags_list.py | 38 + test/test_update_group_info.py | 38 + test/test_update_group_info_list.py | 38 + test/test_update_resource_info.py | 38 + test/test_update_resource_info_list.py | 38 + test/test_visibility_enum.py | 36 + 100 files changed, 15136 insertions(+), 156 deletions(-) create mode 100644 docs/EntityTypeEnum.md create mode 100644 docs/Group.md create mode 100644 docs/GroupFunctionEnum.md create mode 100644 docs/GroupTypeEnum.md create mode 100644 docs/GroupsApi.md create mode 100644 docs/MessageChannel.md create mode 100644 docs/MessageChannelIDList.md create mode 100644 docs/MessageChannelList.md create mode 100644 docs/MessageChannelProviderEnum.md create mode 100644 docs/MessageChannelTypeEnum.md create mode 100644 docs/NewAdminIDList.md create mode 100644 docs/PaginatedGroupsList.md create mode 100644 docs/PaginatedResourcesList.md create mode 100644 docs/Resource.md create mode 100644 docs/ResourceTypeEnum.md create mode 100644 docs/ReviewerIDList.md create mode 100644 docs/Tag.md create mode 100644 docs/TagsApi.md create mode 100644 docs/TagsList.md create mode 100644 docs/UpdateGroupInfo.md create mode 100644 docs/UpdateGroupInfoList.md create mode 100644 docs/UpdateResourceInfo.md create mode 100644 docs/UpdateResourceInfoList.md create mode 100644 docs/VisibilityEnum.md create mode 100644 opal/api/groups_api.py create mode 100644 opal/api/tags_api.py create mode 100644 opal/model/entity_type_enum.py create mode 100644 opal/model/group.py create mode 100644 opal/model/group_function_enum.py create mode 100644 opal/model/group_type_enum.py create mode 100644 opal/model/message_channel.py create mode 100644 opal/model/message_channel_id_list.py create mode 100644 opal/model/message_channel_list.py create mode 100644 opal/model/message_channel_provider_enum.py create mode 100644 opal/model/message_channel_type_enum.py create mode 100644 opal/model/new_admin_id_list.py create mode 100644 opal/model/paginated_groups_list.py create mode 100644 opal/model/paginated_resources_list.py create mode 100644 opal/model/resource.py create mode 100644 opal/model/resource_type_enum.py create mode 100644 opal/model/reviewer_id_list.py create mode 100644 opal/model/tag.py create mode 100644 opal/model/tags_list.py create mode 100644 opal/model/update_group_info.py create mode 100644 opal/model/update_group_info_list.py create mode 100644 opal/model/update_resource_info.py create mode 100644 opal/model/update_resource_info_list.py create mode 100644 opal/model/visibility_enum.py create mode 100644 test/test_entity_type_enum.py create mode 100644 test/test_group.py create mode 100644 test/test_group_function_enum.py create mode 100644 test/test_group_type_enum.py create mode 100644 test/test_groups_api.py create mode 100644 test/test_message_channel.py create mode 100644 test/test_message_channel_id_list.py create mode 100644 test/test_message_channel_list.py create mode 100644 test/test_message_channel_provider_enum.py create mode 100644 test/test_message_channel_type_enum.py create mode 100644 test/test_new_admin_id_list.py create mode 100644 test/test_paginated_groups_list.py create mode 100644 test/test_paginated_resources_list.py create mode 100644 test/test_resource.py create mode 100644 test/test_resource_type_enum.py create mode 100644 test/test_reviewer_id_list.py create mode 100644 test/test_tag.py create mode 100644 test/test_tags_api.py create mode 100644 test/test_tags_list.py create mode 100644 test/test_update_group_info.py create mode 100644 test/test_update_group_info_list.py create mode 100644 test/test_update_resource_info.py create mode 100644 test/test_update_resource_info_list.py create mode 100644 test/test_visibility_enum.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index c22f9fb..172513a 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,46 +1,93 @@ .gitignore .gitlab-ci.yml -.openapi-generator-ignore .travis.yml README.md +docs/EntityTypeEnum.md docs/Event.md docs/EventsApi.md +docs/Group.md +docs/GroupFunctionEnum.md +docs/GroupTypeEnum.md +docs/GroupsApi.md +docs/MessageChannel.md +docs/MessageChannelIDList.md +docs/MessageChannelList.md +docs/MessageChannelProviderEnum.md +docs/MessageChannelTypeEnum.md +docs/NewAdminIDList.md docs/PaginatedEventList.md +docs/PaginatedGroupsList.md docs/PaginatedResourceUserList.md +docs/PaginatedResourcesList.md +docs/Resource.md docs/ResourceAccessLevel.md +docs/ResourceTypeEnum.md docs/ResourceUser.md docs/ResourceUserAccessStatus.md docs/ResourceUserAccessStatusEnum.md docs/ResourcesApi.md +docs/ReviewerIDList.md docs/Session.md docs/SessionsApi.md docs/SessionsList.md +docs/Tag.md +docs/TagsApi.md +docs/TagsList.md +docs/UpdateGroupInfo.md +docs/UpdateGroupInfoList.md +docs/UpdateResourceInfo.md +docs/UpdateResourceInfoList.md docs/User.md docs/UsersApi.md docs/UsersList.md +docs/VisibilityEnum.md git_push.sh opal/__init__.py opal/api/__init__.py opal/api/events_api.py +opal/api/groups_api.py opal/api/resources_api.py opal/api/sessions_api.py +opal/api/tags_api.py opal/api/users_api.py opal/api_client.py opal/apis/__init__.py opal/configuration.py opal/exceptions.py opal/model/__init__.py +opal/model/entity_type_enum.py opal/model/event.py +opal/model/group.py +opal/model/group_function_enum.py +opal/model/group_type_enum.py +opal/model/message_channel.py +opal/model/message_channel_id_list.py +opal/model/message_channel_list.py +opal/model/message_channel_provider_enum.py +opal/model/message_channel_type_enum.py +opal/model/new_admin_id_list.py opal/model/paginated_event_list.py +opal/model/paginated_groups_list.py opal/model/paginated_resource_user_list.py +opal/model/paginated_resources_list.py +opal/model/resource.py opal/model/resource_access_level.py +opal/model/resource_type_enum.py opal/model/resource_user.py opal/model/resource_user_access_status.py opal/model/resource_user_access_status_enum.py +opal/model/reviewer_id_list.py opal/model/session.py opal/model/sessions_list.py +opal/model/tag.py +opal/model/tags_list.py +opal/model/update_group_info.py +opal/model/update_group_info_list.py +opal/model/update_resource_info.py +opal/model/update_resource_info_list.py opal/model/user.py opal/model/users_list.py +opal/model/visibility_enum.py opal/model_utils.py opal/models/__init__.py opal/rest.py @@ -49,19 +96,28 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_event.py -test/test_events_api.py -test/test_paginated_event_list.py -test/test_paginated_resource_user_list.py -test/test_resource_access_level.py -test/test_resource_user.py -test/test_resource_user_access_status.py -test/test_resource_user_access_status_enum.py -test/test_resources_api.py -test/test_session.py -test/test_sessions_api.py -test/test_sessions_list.py -test/test_user.py -test/test_users_api.py -test/test_users_list.py +test/test_entity_type_enum.py +test/test_group.py +test/test_group_function_enum.py +test/test_group_type_enum.py +test/test_groups_api.py +test/test_message_channel.py +test/test_message_channel_id_list.py +test/test_message_channel_list.py +test/test_message_channel_provider_enum.py +test/test_message_channel_type_enum.py +test/test_new_admin_id_list.py +test/test_paginated_groups_list.py +test/test_paginated_resources_list.py +test/test_resource.py +test/test_resource_type_enum.py +test/test_reviewer_id_list.py +test/test_tag.py +test/test_tags_api.py +test/test_tags_list.py +test/test_update_group_info.py +test/test_update_group_info_list.py +test/test_update_resource_info.py +test/test_update_resource_info_list.py +test/test_visibility_enum.py tox.ini diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index e230c83..1e20ec3 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.0 \ No newline at end of file +5.4.0 \ No newline at end of file diff --git a/README.md b/README.md index c52a984..79cb414 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ For more information, please visit [https://www.opal.dev/](https://www.opal.dev/ ## Requirements. -Python >= 3.6 +Python >=3.6 ## Installation & Usage ### pip install @@ -79,7 +79,7 @@ actor_filter = "29827fb8-f2dd-4e80-9576-28e31e9934ac" # str | An actor filter fo object_filter = "29827fb8-f2dd-4e80-9576-28e31e9934ac" # str | An object filter for the events. Supply the ID of the object. (optional) event_type_filter = "29827fb8-f2dd-4e80-9576-28e31e9934ac" # str | An event type filter for the events. (optional) cursor = "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw" # str | The pagination cursor value. (optional) -page_size = 200 # int | Number of results to return per page. (optional) +page_size = 200 # int | Number of results to return per page. Default is 200. (optional) try: api_response = api_instance.events(start_date_filter=start_date_filter, end_date_filter=end_date_filter, actor_filter=actor_filter, object_filter=object_filter, event_type_filter=event_type_filter, cursor=cursor, page_size=page_size) @@ -95,25 +95,73 @@ All URIs are relative to *https://api.opal.dev/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *EventsApi* | [**events**](docs/EventsApi.md#events) | **GET** /events | +*GroupsApi* | [**convert_group**](docs/GroupsApi.md#convert_group) | **PUT** /groups/{group_id}/convert | +*GroupsApi* | [**delete_group**](docs/GroupsApi.md#delete_group) | **DELETE** /groups/{group_id} | +*GroupsApi* | [**get_group_message_channels**](docs/GroupsApi.md#get_group_message_channels) | **GET** /groups/{group_id}/message-channels | +*GroupsApi* | [**get_group_reviewers**](docs/GroupsApi.md#get_group_reviewers) | **GET** /groups/{group_id}/reviewers | +*GroupsApi* | [**get_group_tags**](docs/GroupsApi.md#get_group_tags) | **GET** /groups/{group_id}/tags | +*GroupsApi* | [**get_groups**](docs/GroupsApi.md#get_groups) | **GET** /groups | +*GroupsApi* | [**set_group_message_channels**](docs/GroupsApi.md#set_group_message_channels) | **PUT** /groups/{group_id}/message-channels | +*GroupsApi* | [**set_group_reviewers**](docs/GroupsApi.md#set_group_reviewers) | **PUT** /groups/{group_id}/reviewers | +*GroupsApi* | [**update_groups**](docs/GroupsApi.md#update_groups) | **PUT** /groups | +*ResourcesApi* | [**delete_resource**](docs/ResourcesApi.md#delete_resource) | **DELETE** /resources/{resource_id} | +*ResourcesApi* | [**get_resource_message_channels**](docs/ResourcesApi.md#get_resource_message_channels) | **GET** /resources/{resource_id}/message-channels | +*ResourcesApi* | [**get_resource_reviewers**](docs/ResourcesApi.md#get_resource_reviewers) | **GET** /resources/{resource_id}/reviewers | +*ResourcesApi* | [**get_resource_tags**](docs/ResourcesApi.md#get_resource_tags) | **GET** /resources/{resource_id}/tags | +*ResourcesApi* | [**get_resources**](docs/ResourcesApi.md#get_resources) | **GET** /resources | *ResourcesApi* | [**resource_user_access_status_retrieve**](docs/ResourcesApi.md#resource_user_access_status_retrieve) | **GET** /resource-user-access-status/{resource_id}/{user_id} | *ResourcesApi* | [**resource_users**](docs/ResourcesApi.md#resource_users) | **GET** /resource-users | +*ResourcesApi* | [**set_resource_message_channels**](docs/ResourcesApi.md#set_resource_message_channels) | **PUT** /resources/{resource_id}/message-channels | +*ResourcesApi* | [**set_resource_reviewers**](docs/ResourcesApi.md#set_resource_reviewers) | **PUT** /resources/{resource_id}/reviewers | +*ResourcesApi* | [**update_resources**](docs/ResourcesApi.md#update_resources) | **PUT** /resources | *SessionsApi* | [**sessions**](docs/SessionsApi.md#sessions) | **GET** /sessions | +*TagsApi* | [**add_group_tag**](docs/TagsApi.md#add_group_tag) | **POST** /tags/{tag_id}/groups/{group_id} | +*TagsApi* | [**add_resource_tag**](docs/TagsApi.md#add_resource_tag) | **POST** /tags/{tag_id}/resources/{resource_id} | +*TagsApi* | [**add_user_tag**](docs/TagsApi.md#add_user_tag) | **POST** /tags/{tag_id}/users/{user_id} | +*TagsApi* | [**create_tag**](docs/TagsApi.md#create_tag) | **POST** /tag | +*TagsApi* | [**get_tag**](docs/TagsApi.md#get_tag) | **GET** /tag | +*TagsApi* | [**remove_group_tag**](docs/TagsApi.md#remove_group_tag) | **DELETE** /tags/{tag_id}/groups/{group_id} | +*TagsApi* | [**remove_resource_tag**](docs/TagsApi.md#remove_resource_tag) | **DELETE** /tags/{tag_id}/resources/{resource_id} | +*TagsApi* | [**remove_user_tag**](docs/TagsApi.md#remove_user_tag) | **DELETE** /tags/{tag_id}/users/{user_id} | +*UsersApi* | [**get_user_tags**](docs/UsersApi.md#get_user_tags) | **GET** /users/{user_id}/tags | *UsersApi* | [**user**](docs/UsersApi.md#user) | **GET** /user | ## Documentation For Models + - [EntityTypeEnum](docs/EntityTypeEnum.md) - [Event](docs/Event.md) + - [Group](docs/Group.md) + - [GroupFunctionEnum](docs/GroupFunctionEnum.md) + - [GroupTypeEnum](docs/GroupTypeEnum.md) + - [MessageChannel](docs/MessageChannel.md) + - [MessageChannelIDList](docs/MessageChannelIDList.md) + - [MessageChannelList](docs/MessageChannelList.md) + - [MessageChannelProviderEnum](docs/MessageChannelProviderEnum.md) + - [MessageChannelTypeEnum](docs/MessageChannelTypeEnum.md) + - [NewAdminIDList](docs/NewAdminIDList.md) - [PaginatedEventList](docs/PaginatedEventList.md) + - [PaginatedGroupsList](docs/PaginatedGroupsList.md) - [PaginatedResourceUserList](docs/PaginatedResourceUserList.md) + - [PaginatedResourcesList](docs/PaginatedResourcesList.md) + - [Resource](docs/Resource.md) - [ResourceAccessLevel](docs/ResourceAccessLevel.md) + - [ResourceTypeEnum](docs/ResourceTypeEnum.md) - [ResourceUser](docs/ResourceUser.md) - [ResourceUserAccessStatus](docs/ResourceUserAccessStatus.md) - [ResourceUserAccessStatusEnum](docs/ResourceUserAccessStatusEnum.md) + - [ReviewerIDList](docs/ReviewerIDList.md) - [Session](docs/Session.md) - [SessionsList](docs/SessionsList.md) + - [Tag](docs/Tag.md) + - [TagsList](docs/TagsList.md) + - [UpdateGroupInfo](docs/UpdateGroupInfo.md) + - [UpdateGroupInfoList](docs/UpdateGroupInfoList.md) + - [UpdateResourceInfo](docs/UpdateResourceInfo.md) + - [UpdateResourceInfoList](docs/UpdateResourceInfoList.md) - [User](docs/User.md) - [UsersList](docs/UsersList.md) + - [VisibilityEnum](docs/VisibilityEnum.md) ## Documentation For Authorization diff --git a/api/openapi.yaml b/api/openapi.yaml index 980452c..814f056 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -72,7 +72,7 @@ paths: schema: type: string style: form - - description: Number of results to return per page. + - description: Number of results to return per page. Default is 200. example: 200 explode: true in: query @@ -80,6 +80,7 @@ paths: required: false schema: type: integer + maximum: 1000 style: form responses: "200": @@ -92,6 +93,518 @@ paths: - BearerAuth: [] tags: - events + /groups: + get: + description: Returns a list of groups for your organization. + operationId: getGroups + parameters: + - description: The pagination cursor value. + example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + explode: true + in: query + name: cursor + required: false + schema: + type: string + style: form + - description: Number of results to return per page. Default is 200. + example: 200 + explode: true + in: query + name: page_size + required: false + schema: + type: integer + maximum: 1000 + style: form + - description: The group function to filter by. + example: REGULAR + explode: true + in: query + name: group_function_filter + required: false + schema: + $ref: "#/components/schemas/GroupFunctionEnum" + style: form + - description: The group type to filter by. + example: OPAL_GROUP + explode: true + in: query + name: group_type_filter + required: false + schema: + $ref: "#/components/schemas/GroupTypeEnum" + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PaginatedGroupsList" + description: One page worth groups associated with your organization. + security: + - BearerAuth: [] + tags: + - groups + put: + description: Bulk updates a list of groups. + operationId: updateGroups + requestBody: + description: Groups to be updated + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateGroupInfoList' + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateGroupInfoList" + description: The resulting updated group infos. + security: + - BearerAuth: [] + tags: + - groups + /groups/{group_id}: + delete: + description: Deletes a group. + operationId: delete_group + parameters: + - description: The ID of the group. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: group_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + description: The group was successfully deleted. + security: + - BearerAuth: [] + tags: + - groups + /groups/{group_id}/convert: + put: + description: Updates a groups function. + operationId: convert_group + parameters: + - description: The ID of the group. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: group_id + required: true + schema: + format: uuid + type: string + style: simple + - description: The group function to convert to. + example: TEAM + explode: false + in: query + name: group_function + required: true + schema: + $ref: "#/components/schemas/GroupFunctionEnum" + style: form + - description: The ID of the owning team of the group. Required when converting from Team to Group. + example: 7c86c85d-0651-43e2-a748-d69d658418e8 + explode: false + in: query + name: owner_team_id + required: false + schema: + format: uuid + type: string + style: form + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/NewAdminIDList" + responses: + "200": + description: The converted group. + content: + application/json: + schema: + $ref: "#/components/schemas/Group" + security: + - BearerAuth: [] + tags: + - groups + /groups/{group_id}/message-channels: + get: + description: Gets the list of message channels attached to a group. + operationId: get_group_message_channels + parameters: + - description: The ID of the group. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: group_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/MessageChannelList" + description: The message channels attached to the group. + security: + - BearerAuth: [] + tags: + - groups + put: + description: Sets the list of message channels attached to a group. + operationId: set_group_message_channels + parameters: + - description: The ID of the group. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: group_id + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/MessageChannelIDList" + responses: + "200": + content: + application/json: + schema: + items: + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + format: uuid + type: string + type: array + description: The updated message channel IDs for the group. + security: + - BearerAuth: [] + tags: + - groups + /groups/{group_id}/reviewers: + get: + description: Gets the list of team/user IDs of the reviewers for a group. + operationId: get_group_reviewers + parameters: + - description: The ID of the group. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: group_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + format: uuid + type: string + type: array + description: The IDs of teams/users that are reviewers for this group. + security: + - BearerAuth: [] + tags: + - groups + put: + description: Sets the list of reviewers for a group. + operationId: set_group_reviewers + parameters: + - description: The ID of the group. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: group_id + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ReviewerIDList" + responses: + "200": + content: + application/json: + schema: + items: + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + format: uuid + type: string + type: array + description: The updated IDs of teams/users that are reviewers for this group + security: + - BearerAuth: [] + tags: + - groups + /groups/{group_id}/tags: + get: + description: Returns all tags applied to the group. + operationId: get_group_tags + parameters: + - description: The ID of the group whose tags to return. + name: group_id + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/TagsList" + description: The tags applied to the group. + security: + - BearerAuth: [] + tags: + - groups + /resources: + get: + description: Returns a list of resources for your organization. + operationId: getResources + parameters: + - description: The pagination cursor value. + example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + explode: true + in: query + name: cursor + required: false + schema: + type: string + style: form + - description: Number of results to return per page. Default is 200. + example: 200 + explode: true + in: query + name: page_size + required: false + schema: + type: integer + maximum: 1000 + style: form + - description: The resource type to filter by. + example: AWS_IAM_ROLE + explode: true + in: query + name: resource_type_filter + required: false + schema: + $ref: "#/components/schemas/ResourceTypeEnum" + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PaginatedResourcesList" + description: One page worth resources associated with your organization. + security: + - BearerAuth: [] + tags: + - resources + put: + description: Bulk updates a list of resources. + operationId: updateResources + requestBody: + description: Resources to be updated + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateResourceInfoList' + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateResourceInfoList" + description: The resulting updated resource infos. + security: + - BearerAuth: [] + tags: + - resources + /resources/{resource_id}: + delete: + description: Deletes a resource. + operationId: delete_resource + parameters: + - description: The ID of the resource. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: resource_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + description: The resource was successfully deleted. + security: + - BearerAuth: [] + tags: + - resources + /resources/{resource_id}/message-channels: + get: + description: Gets the list of message channels attached to a resource. + operationId: get_resource_message_channels + parameters: + - description: The ID of the resource. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: resource_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/MessageChannelList" + description: The message channels attached to the resource. + security: + - BearerAuth: [] + tags: + - resources + put: + description: Sets the list of message channels attached to a resource. + operationId: set_resource_message_channels + parameters: + - description: The ID of the resource. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: resource_id + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/MessageChannelIDList" + responses: + "200": + content: + application/json: + schema: + items: + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + format: uuid + type: string + type: array + description: The updated message channel IDs for the resource. + security: + - BearerAuth: [] + tags: + - resources + /resources/{resource_id}/reviewers: + get: + description: Gets the list of team/user IDs of the reviewers for a resource. + operationId: get_resource_reviewers + parameters: + - description: The ID of the resource. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: resource_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + items: + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + format: uuid + type: string + type: array + description: The IDs of teams that are reviewers for this resource. + security: + - BearerAuth: [] + tags: + - resources + put: + description: Sets the list of reviewers for a resource. + operationId: set_resource_reviewers + parameters: + - description: The ID of the resource. + example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5 + explode: false + in: path + name: resource_id + required: true + schema: + format: uuid + type: string + style: simple + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/ReviewerIDList" + responses: + "200": + content: + application/json: + schema: + items: + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + format: uuid + type: string + type: array + description: The updated IDs of teams that are reviewers for this resource + security: + - BearerAuth: [] + tags: + - resources /resource-users: get: description: Returns a list of `ResourceUser` objects. @@ -125,7 +638,7 @@ paths: schema: type: string style: form - - description: Number of results to return per page. + - description: Number of results to return per page. Default is 200. example: 200 explode: true in: query @@ -133,6 +646,7 @@ paths: required: false schema: type: integer + maximum: 1000 style: form responses: "200": @@ -188,7 +702,7 @@ paths: schema: type: string style: form - - description: Number of results to return per page. + - description: Number of results to return per page. Default is 200. example: 200 explode: true in: query @@ -196,6 +710,7 @@ paths: required: false schema: type: integer + maximum: 1000 style: form responses: "200": @@ -208,6 +723,32 @@ paths: - BearerAuth: [] tags: - resources + /resources/{resource_id}/tags: + get: + description: Returns all tags applied to the resource. + operationId: get_resource_tags + parameters: + - description: The ID of the resource whose tags to return. + name: resource_id + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/TagsList" + description: The tags applied to the resource. + security: + - BearerAuth: [] + tags: + - resources /sessions: get: description: Returns a list of `Session` objects. @@ -231,55 +772,355 @@ paths: required: false schema: type: string - style: form + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SessionsList" + description: The sessions associated with a resource. + security: + - BearerAuth: [] + tags: + - sessions + /user: + get: + description: Returns a `User` object. + operationId: user + parameters: + - description: The user ID of the user. + example: 32acc112-21ff-4669-91c2-21e27683eaa1 + explode: true + in: query + name: user_id + required: false + schema: + format: uuid + type: string + style: form + - description: The email of the user. If both user ID and email are provided, user ID will take precedence. If neither are provided, an error will occur. + example: johndoe@domain.org + explode: true + in: query + name: email + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/User" + description: The user object associated with the passed-in email or ID. + security: + - BearerAuth: [] + tags: + - users + /users/{user_id}/tags: + get: + description: Returns all tags applied to the user. + operationId: get_user_tags + parameters: + - description: The ID of the user whose tags to return. + name: user_id + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/TagsList" + description: The tags applied to the user. + security: + - BearerAuth: [] + tags: + - users + /tag: + get: + description: Gets a tag with the given key and value. + operationId: get_tag + parameters: + - description: The key of the tag to get. + example: api-scope + explode: false + in: query + name: tag_key + required: true + schema: + type: string + style: form + - description: The value of the tag to get. + example: production + explode: false + in: query + name: tag_value + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Tag" + description: The tag requested. + security: + - BearerAuth: [] + tags: + - tags + post: + description: Creates a tag with the given key and value. + operationId: create_tag + parameters: + - description: The key of the tag to create. + example: api-scope + explode: false + in: query + name: tag_key + required: true + schema: + type: string + style: form + - description: The value of the tag to create. + example: production + explode: false + in: query + name: tag_value + required: true + schema: + type: string + style: form + - description: The ID of the team that owns the tag. + example: f92aa855-cea9-4814-b9d8-f2a60d3e4a06 + explode: false + in: query + name: tag_owner_team_id + required: true + schema: + format: uuid + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Tag" + description: The tag that was created. + security: + - BearerAuth: [] + tags: + - tags + /tags/{tag_id}/users/{user_id}: + post: + description: Applies a tag to a user. + operationId: add_user_tag + parameters: + - description: The ID of the tag to apply. + name: tag_id + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + required: true + schema: + format: uuid + type: string + style: simple + - description: The ID of the user to apply the tag to. + name: user_id + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + description: Tag applied to user successfully. + security: + - BearerAuth: [] + tags: + - tags + delete: + description: Removes a tag from a user. + operationId: remove_user_tag + parameters: + - description: The ID of the tag to remove. + name: tag_id + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + required: true + schema: + format: uuid + type: string + style: simple + - description: The ID of the user to remove the tag from. + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + name: user_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + description: Tag removed from user successfully. + security: + - BearerAuth: [] + tags: + - tags + /tags/{tag_id}/groups/{group_id}: + post: + description: Applies a tag to a group. + operationId: add_group_tag + parameters: + - description: The ID of the tag to apply. + name: tag_id + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + required: true + schema: + format: uuid + type: string + style: simple + - description: The ID of the group to apply the tag to. + name: group_id + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + description: Tag applied to group successfully. + security: + - BearerAuth: [] + tags: + - tags + delete: + description: Removes a tag from a group. + operationId: remove_group_tag + parameters: + - description: The ID of the tag to remove. + name: tag_id + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + required: true + schema: + format: uuid + type: string + style: simple + - description: The ID of the group to remove the tag from. + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + name: group_id + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + description: Tag removed from group successfully. + security: + - BearerAuth: [] + tags: + - tags + /tags/{tag_id}/resources/{resource_id}: + post: + description: Applies a tag to a resource. + operationId: add_resource_tag + parameters: + - description: The ID of the tag to apply. + name: tag_id + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + required: true + schema: + format: uuid + type: string + style: simple + - description: The ID of the resource to apply the tag to. + name: resource_id + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + required: true + schema: + format: uuid + type: string + style: simple responses: "200": - content: - application/json: - schema: - $ref: "#/components/schemas/SessionsList" - description: The sessions associated with a resource. + description: Tag applied to resource successfully. security: - BearerAuth: [] tags: - - sessions - /user: - get: - description: Returns a `User` object. - operationId: user + - tags + delete: + description: Removes a tag from a resource. + operationId: remove_resource_tag parameters: - - description: The user ID of the user. - example: 32acc112-21ff-4669-91c2-21e27683eaa1 - explode: true - in: query - name: user_id - required: false + - description: The ID of the tag to remove. + name: tag_id + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + required: true schema: format: uuid type: string - style: form - - description: The email of the user. If both user ID and email are provided, user ID will take precedence. If neither are provided, an error will occur. - example: johndoe@domain.org - explode: true - in: query - name: email - required: false + style: simple + - description: The ID of the resource to remove the tag from. + example: 1b978423-db0a-4037-a4cf-f79c60cb67b3 + explode: false + in: path + name: resource_id + required: true schema: + format: uuid type: string - style: form + style: simple responses: "200": - content: - application/json: - schema: - $ref: "#/components/schemas/User" - description: The user object associated with the passed-in email or ID. + description: Tag removed from resource successfully. security: - BearerAuth: [] tags: - - users + - tags components: schemas: + EntityTypeEnum: + description: The type of an entity. + enum: + - GROUP + - RESOURCE + - USER + example: GROUP + type: string Event: description: |- # Event Object @@ -646,6 +1487,628 @@ components: - team_id - position type: object + PaginatedGroupsList: + example: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - group_id: f454d283-ca87-4a8a-bdbb-df212eca5353 + description: This group represents Active Directory group "Payments Production Admin". We use this AD group to facilitate staging deployments and qualifying new releases. + owner_team_id: 7c86c85d-0651-43e2-a748-d69d658418e8 + visibility: Global + max_duration: 120 + require_manager_approval: False + require_support_ticket: False + - group_id: 99d0b81d-14be-4cf6-bd27-348b4af1d11b + description: Manages the Integrations Team on-call privileged resources. This group is automatically synced with the on-call rotation defined in PagerDuty. + owner_team_id: 4220bc12-ab8a-4b5d-be7b-f6bbcf9159f3 + visibility: Team + max_duration: 360 + require_manager_approval: False + require_support_ticket: True + properties: + next: + description: + The cursor with which to continue pagination if additional + result pages exist. + example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + nullable: true + type: string + previous: + description: The cursor used to obtain the current result page. + example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + nullable: true + type: string + results: + items: + $ref: "#/components/schemas/Group" + type: array + type: object + required: + - results + Group: + description: |- + # Group Object + ### Description + The `Group` object is used to represent a group. + + ### Usage Example + Update from the `UPDATE Groups` endpoint. + example: + group_id: f454d283-ca87-4a8a-bdbb-df212eca5353 + description: This group represents Active Directory group "Payments Production Admin". We use this AD group to facilitate staging deployments and qualifying new releases. + owner_team_id: 7c86c85d-0651-43e2-a748-d69d658418e8 + visibility: Global + max_duration: 120 + require_manager_approval: False + require_support_ticket: False + properties: + group_id: + description: The ID of the group. + example: f454d283-ca87-4a8a-bdbb-df212eca5353 + format: uuid + type: string + name: + description: The name of the group. + example: API Group + type: string + description: + description: A description of the group. + example: This group represents Active Directory group "Payments Production Admin". We use this AD group to facilitate staging deployments and qualifying new releases. + type: string + owner_team_id: + description: The ID of the owning team of the group. + example: 7c86c85d-0651-43e2-a748-d69d658418e8 + format: uuid + type: string + group_function: + $ref: "#/components/schemas/GroupFunctionEnum" + group_type: + $ref: "#/components/schemas/GroupTypeEnum" + visibility: + $ref: "#/components/schemas/VisibilityEnum" + max_duration: + description: The maximum duration access to the group can be requested for (in minutes). + type: integer + example: 120 + require_manager_approval: + description: A bool representing whether or not access requests to the group require manager approval. + example: False + type: boolean + require_support_ticket: + description: A bool representing whether or not access requests to the group require a support ticket. + example: False + type: boolean + folder_id: + description: The ID of the folder that the group is located in. + example: e27cb7b0-98e2-4555-9916-9e6d8ca6b079 + format: uuid + type: string + required: + - group_id + type: object + UpdateGroupInfoList: + example: + groups: + - group_id: f454d283-ca87-4a8a-bdbb-df212eca5353 + description: This group represents Active Directory group "Payments Production Admin". We use this AD group to facilitate staging deployments and qualifying new releases. + name: api-group + owner_team_id: 7c86c85d-0651-43e2-a748-d69d658418e8 + visibility: Global + max_duration: 120 + require_manager_approval: False + require_support_ticket: False + - group_id: 99d0b81d-14be-4cf6-bd27-348b4af1d11b + description: Manages the Integrations Team on-call privileged resources. This group is automatically synced with the on-call rotation defined in PagerDuty. + name: on-call-integrations + owner_team_id: 4220bc12-ab8a-4b5d-be7b-f6bbcf9159f3 + visibility: Team + max_duration: 360 + require_manager_approval: False + require_support_ticket: True + properties: + groups: + description: A list of groups with information to update. + items: + $ref: "#/components/schemas/UpdateGroupInfo" + type: array + type: object + required: + - groups + UpdateGroupInfo: + description: |- + # UpdateGroupInfo Object + ### Description + The `UpdateGroupInfo` object is used as an input to the UpdateGroup API. + example: + group_id: f454d283-ca87-4a8a-bdbb-df212eca5353 + description: This group represents Active Directory group "Payments Production Admin". We use this AD group to facilitate staging deployments and qualifying new releases. + name: api-group + owner_team_id: 7c86c85d-0651-43e2-a748-d69d658418e8 + visibility: Global + max_duration: 120 + require_manager_approval: False + require_support_ticket: False + properties: + group_id: + description: The ID of the group. + example: f454d283-ca87-4a8a-bdbb-df212eca5353 + format: uuid + type: string + name: + description: The name of the group. + example: api-group + type: string + description: + description: A description of the group. + example: This group represents Active Directory group "Payments Production Admin". We use this AD group to facilitate staging deployments and qualifying new releases. + type: string + owner_team_id: + description: The ID of the owning team of the group. Use empty string to remove owner. Required when converting from Team to Group. + example: 7c86c85d-0651-43e2-a748-d69d658418e8 + format: uuid + type: string + visibility: + $ref: "#/components/schemas/VisibilityEnum" + max_duration: + description: The maximum duration access to the group can be requested for (in minutes). Use 0 to set to indefinite. + type: integer + example: 120 + require_manager_approval: + description: A bool representing whether or not access requests to the group require manager approval. + example: False + type: boolean + require_support_ticket: + description: A bool representing whether or not access requests to the group require a support ticket. + example: False + type: boolean + folder_id: + description: The ID of the folder that the group is located in. + example: e27cb7b0-98e2-4555-9916-9e6d8ca6b079 + format: uuid + type: string + required: + - group_id + type: object + GroupTypeEnum: + description: The type of the group. + enum: + - ACTIVE_DIRECTORY_GROUP + - DUO_GROUP + - GIT_HUB_TEAM + - GOOGLE_GROUPS_GROUP + - LDAP_GROUP + - OKTA_GROUP + - OPAL_GROUP + example: OPAL_GROUP + type: string + GroupFunctionEnum: + description: The function type of the group. + enum: + - REGULAR + - ON_CALL + - TEAM + - UNKNOWN + example: REGULAR + type: string + ResourceTypeEnum: + description: The type of the resource. + enum: + - AWS_IAM_ROLE + - AWS_EC2_INSTANCE + - AWS_EKS_CLUSTER + - AWS_RDS_POSTGRES_INSTANCE + - AWS_RDS_MYSQL_INSTANCE + - CUSTOM + - GCP_BUCKET + - GCP_COMPUTE_INSTANCE + - GCP_FOLDER + - GCP_GKE_CLUSTER + - GCP_PROJECT + - GCP_CLOUD_SQL_POSTGRES_INSTANCE + - GCP_CLOUD_SQL_MYSQL_INSTANCE + - GIT_HUB_REPO + - GOOGLE_WORKSPACE_ROLE + - MONGO_INSTANCE + - MONGO_ATLAS_INSTANCE + - OKTA_APP + - OKTA_ROLE + - OPAL_ROLE + - PAGERDUTY_ROLE + - SALESFORCE_PERMISSION_SET + - SALESFORCE_PROFILE + - SALESFORCE_ROLE + - WORKDAY_ROLE + - MYSQL_INSTANCE + - MARIADB_INSTANCE + example: AWS_IAM_ROLE + type: string + VisibilityEnum: + description: The visibility level of the entity. + enum: + - GLOBAL + - TEAM + example: GLOBAL + type: string + MessageChannelList: + example: + channels: + - message_channel_id: 7870617d-e72a-47f5-a84c-693817ab4567 + third_party_provider: SLACK + remote_id: C03FJR97276 + name: api-team-audit-channel + message_channel_type: AUDIT + is_private: False + - message_channel_id: 1520617d-e72a-47f5-a84c-693817ab48ad2 + third_party_provider: SLACK + remote_id: A4FJR97365D + name: api-team-monitor-channel + message_channel_type: MONITOR + is_private: False + properties: + channels: + items: + $ref: "#/components/schemas/MessageChannel" + type: array + type: object + required: + - channels + MessageChannelIDList: + description: A list of message channel IDs. + example: + message_channel_ids: + - 7870617d-e72a-47f5-a84c-693817ab4567 + - 1520617d-e72a-47f5-a84c-693817ab48ad2 + properties: + message_channel_ids: + items: + type: string + format: uuid + type: array + type: object + required: + - message_channel_ids + ReviewerIDList: + description: A list of reviewer IDs. + example: + reviewer_ids: + - 7870617d-e72a-47f5-a84c-693817ab4567 + - 1520617d-e72a-47f5-a84c-693817ab48ad2 + properties: + reviewer_ids: + items: + type: string + format: uuid + type: array + type: object + required: + - reviewer_ids + NewAdminIDList: + example: + admin_ids: + - 7870617d-e72a-47f5-a84c-693817ab4567 + - 1520617d-e72a-47f5-a84c-693817ab48ad2 + properties: + admin_ids: + description: The IDs of admins to set for the group if converting to a team. Required when converting from Group to Team. + items: + type: string + format: uuid + type: array + type: object + MessageChannel: + description: |- + # MessageChannel Object + ### Description + The `MessageChannel` object is used to represent a message channel. + + ### Usage Example + Update a groups message channel from the `UPDATE Groups` endpoint. + example: + message_channel_id: 6670617d-e72a-47f5-a84c-693817ab4860 + third_party_provider: SLACK + remote_id: C03FJR97276 + name: api-team-audit-channel + message_channel_type: AUDIT + is_private: False + properties: + message_channel_id: + description: The ID of the message channel. + example: 6670617d-e72a-47f5-a84c-693817ab4860 + format: uuid + type: string + third_party_provider: + $ref: "#/components/schemas/MessageChannelProviderEnum" + remote_id: + description: The remote ID of the message channel + example: C03FJR97276 + type: string + name: + description: The name of the message channel. + example: api-team-audit-channel + type: string + message_channel_type: + $ref: "#/components/schemas/MessageChannelTypeEnum" + is_private: + description: A bool representing whether or not the message channel is private. + example: False + type: boolean + type: object + required: + - message_channel_id + MessageChannelTypeEnum: + description: The type of the message channel. + enum: + - AUDIT + - REVIEWER + - MONITOR + example: AUDIT + type: string + MessageChannelProviderEnum: + description: The third party provider of the message channel. + enum: + - SLACK + example: SLACK + type: string + PaginatedResourcesList: + example: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - resource_id: f454d283-ca67-4a8a-bdbb-df212eca5353 + description: This resource represents AWS IAM role "SupportUser". + owner_team_id: 7c86c85d-0651-43e2-a748-d69d658418e8 + visibility: Global + max_duration: 120 + require_manager_approval: False + require_support_ticket: False + - resource_id: 99d0b81d-14be-4cf6-bd27-348b4af1d11b + description: This resource represents GCP project "app-demo". + owner_team_id: 7c86c85d-0651-43e2-a748-d69d658418e8 + visibility: Team + max_duration: 360 + require_manager_approval: False + require_support_ticket: True + properties: + next: + description: + The cursor with which to continue pagination if additional + result pages exist. + example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + nullable: true + type: string + previous: + description: The cursor used to obtain the current result page. + example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + nullable: true + type: string + results: + items: + $ref: "#/components/schemas/Resource" + type: array + type: object + required: + - results + Resource: + description: |- + # Resource Object + ### Description + The `Resource` object is used to represent a resource. + + ### Usage Example + Update from the `UPDATE Resources` endpoint. + example: + resource_id: f454d283-ca87-4a8a-bdbb-df212eca5353 + description: This resource represents AWS IAM role "SupportUser". + owner_team_id: 7c86c85d-0651-43e2-a748-d69d658418e8 + visibility: Global + max_duration: 120 + require_manager_approval: False + require_support_ticket: False + properties: + resource_id: + description: The ID of the resource. + example: f454d283-ca87-4a8a-bdbb-df212eca5353 + format: uuid + type: string + name: + description: The name of the resource. + example: mongo-db-prod + type: string + description: + description: A description of the resource. + example: This resource represents AWS IAM role "SupportUser". + type: string + owner_team_id: + description: The ID of the owning team of the resource. + example: 7c86c85d-0651-43e2-a748-d69d658418e8 + format: uuid + type: string + visibility: + $ref: "#/components/schemas/VisibilityEnum" + resource_type: + $ref: "#/components/schemas/ResourceTypeEnum" + max_duration: + description: The maximum duration access to the resource can be requested for (in minutes). + type: integer + example: 120 + require_manager_approval: + description: A bool representing whether or not access requests to the resource require manager approval. + example: False + type: boolean + require_support_ticket: + description: A bool representing whether or not access requests to the resource require a support ticket. + example: False + type: boolean + folder_id: + description: The ID of the folder that the resource is located in. + example: e27cb7b0-98e2-4555-9916-9e6d8ca6b079 + format: uuid + type: string + required: + - resource_id + type: object + UpdateResourceInfoList: + example: + resources: + - resource_id: f454d283-ca87-4a8a-bdbb-df212eca5353 + name: my-mongo-db + description: This resource represents AWS IAM role "SupportUser". + owner_team_id: 7c86c85d-0651-43e2-a748-d69d658418e8 + visibility: Global + max_duration: 120 + require_manager_approval: False + require_support_ticket: False + - resource_id: 99d0b81d-14be-4cf6-bd27-348b4af1d11b + name: Admin Role + description: This resource represents GCP project "app-demo". + owner_team_id: 4220bc12-ab8a-4b5d-be7b-f6bbcf9159f3 + visibility: Team + max_duration: 360 + require_manager_approval: False + require_support_ticket: True + properties: + resources: + description: A list of resources with information to update. + items: + $ref: "#/components/schemas/UpdateResourceInfo" + type: array + type: object + required: + - resources + UpdateResourceInfo: + description: |- + # UpdateResourceInfo Object + ### Description + The `UpdateResourceInfo` object is used as an input to the UpdateResource API. + example: + resource_id: f454d283-ca87-4a8a-bdbb-df212eca5353 + name: my-mongo-db + description: This resource represents AWS IAM role "SupportUser". + owner_team_id: 7c86c85d-0651-43e2-a748-d69d658418e8 + visibility: Global + max_duration: 120 + require_manager_approval: False + require_support_ticket: False + properties: + resource_id: + description: The ID of the resource. + example: f454d283-ca87-4a8a-bdbb-df212eca5353 + format: uuid + type: string + name: + description: The name of the resource. + example: my-mongo-db + type: string + description: + description: A description of the resource. + example: This resource represents AWS IAM role "SupportUser". + type: string + owner_team_id: + description: The ID of the owning team of the resource. + example: 7c86c85d-0651-43e2-a748-d69d658418e8 + format: uuid + type: string + visibility: + $ref: "#/components/schemas/VisibilityEnum" + max_duration: + description: The maximum duration access to the resource can be requested for (in minutes). Use 0 to set to indefinite. + type: integer + example: 120 + require_manager_approval: + description: A bool representing whether or not access requests to the resource require manager approval. + example: False + type: boolean + require_support_ticket: + description: A bool representing whether or not access requests to the resource require a support ticket. + example: False + type: boolean + folder_id: + description: The ID of the folder that the resource is located in. + example: e27cb7b0-98e2-4555-9916-9e6d8ca6b079 + format: uuid + type: string + required: + - resource_id + type: object + TagsList: + example: + results: + - tag_id: f290a738-5f9f-43c2-ad67-fa31ff0eb946 + created_at: 2022-01-23T04:56:07Z + updated_at: 2022-02-23T01:34:07Z + user_creator_id: d4a7d928-783e-4599-8ec6-088d635a5bcc + owner_team_id: bfb518b1-3f5b-4e3b-8eb8-3b3fabd4ea2b + key: database-name + value: redis_db + - tag_id: 92f0a738-5f9f-43c2-ad67-fa31ff0eb052 + created_at: 2022-03-23T04:56:07Z + updated_at: 2022-04-23T01:34:07Z + user_creator_id: a4d7d928-783e-4599-8ec6-088d635af4ac + owner_team_id: gtg418b1-3f5b-4e3b-8eb8-3b3fabd4eaa1 + key: database-type + value: sql + properties: + tags: + items: + $ref: "#/components/schemas/Tag" + type: array + required: + - tags + type: object + Tag: + description: |- + # Tag Object + ### Description + The `Tag` object is used to represent a tag. + + ### Usage Example + Get tags from the `GET Tag` endpoint. + example: + tag_id: f290a738-5f9f-43c2-ad67-fa31ff0eb946 + created_at: 2022-01-23T04:56:07Z + updated_at: 2022-02-23T01:34:07Z + user_creator_id: d4a7d928-783e-4599-8ec6-088d635a5bcc + owner_team_id: bfb518b1-3f5b-4e3b-8eb8-3b3fabd4ea2b + key: database-name + value: redis_db + properties: + tag_id: + description: The ID of the tag. + example: f290a738-5f9f-43c2-ad67-fa31ff0eb946 + format: uuid + type: string + created_at: + description: The date the tag was created. + example: 2022-01-23T04:56:07Z + format: date-time + type: string + updated_at: + description: The date the tag was last updated. + example: 2022-02-23T01:34:07Z + format: date-time + type: string + user_creator_id: + description: The ID of the user that created the tag. + example: d4a7d928-783e-4599-8ec6-088d635a5bcc + format: uuid + type: string + owner_team_id: + description: The ID of the team that owns the tag. + example: bfb518b1-3f5b-4e3b-8eb8-3b3fabd4ea2b + format: uuid + type: string + key: + description: The key of the tag. + example: database-name + type: string + value: + description: The value of the tag. + example: redis_db + type: string + type: object + required: + - tag_id securitySchemes: BearerAuth: scheme: bearer diff --git a/docs/EntityTypeEnum.md b/docs/EntityTypeEnum.md new file mode 100644 index 0000000..63bba12 --- /dev/null +++ b/docs/EntityTypeEnum.md @@ -0,0 +1,12 @@ +# EntityTypeEnum + +The type of an entity. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | The type of an entity. | must be one of ["GROUP", "RESOURCE", "USER", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EventsApi.md b/docs/EventsApi.md index c67c602..67b22e6 100644 --- a/docs/EventsApi.md +++ b/docs/EventsApi.md @@ -50,7 +50,7 @@ with opal.ApiClient(configuration) as api_client: object_filter = "29827fb8-f2dd-4e80-9576-28e31e9934ac" # str | An object filter for the events. Supply the ID of the object. (optional) event_type_filter = "29827fb8-f2dd-4e80-9576-28e31e9934ac" # str | An event type filter for the events. (optional) cursor = "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw" # str | The pagination cursor value. (optional) - page_size = 200 # int | Number of results to return per page. (optional) + page_size = 200 # int | Number of results to return per page. Default is 200. (optional) # example passing only required values which don't have defaults set # and optional values @@ -72,7 +72,7 @@ Name | Type | Description | Notes **object_filter** | **str**| An object filter for the events. Supply the ID of the object. | [optional] **event_type_filter** | **str**| An event type filter for the events. | [optional] **cursor** | **str**| The pagination cursor value. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] + **page_size** | **int**| Number of results to return per page. Default is 200. | [optional] ### Return type diff --git a/docs/Group.md b/docs/Group.md new file mode 100644 index 0000000..76a3853 --- /dev/null +++ b/docs/Group.md @@ -0,0 +1,23 @@ +# Group + +# Group Object ### Description The `Group` object is used to represent a group. ### Usage Example Update from the `UPDATE Groups` endpoint. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group_id** | **str** | The ID of the group. | +**name** | **str** | The name of the group. | [optional] +**description** | **str** | A description of the group. | [optional] +**owner_team_id** | **str** | The ID of the owning team of the group. | [optional] +**group_function** | [**GroupFunctionEnum**](GroupFunctionEnum.md) | | [optional] +**group_type** | [**GroupTypeEnum**](GroupTypeEnum.md) | | [optional] +**visibility** | [**VisibilityEnum**](VisibilityEnum.md) | | [optional] +**max_duration** | **int** | The maximum duration access to the group can be requested for (in minutes). | [optional] +**require_manager_approval** | **bool** | A bool representing whether or not access requests to the group require manager approval. | [optional] +**require_support_ticket** | **bool** | A bool representing whether or not access requests to the group require a support ticket. | [optional] +**folder_id** | **str** | The ID of the folder that the group is located in. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GroupFunctionEnum.md b/docs/GroupFunctionEnum.md new file mode 100644 index 0000000..97548a1 --- /dev/null +++ b/docs/GroupFunctionEnum.md @@ -0,0 +1,12 @@ +# GroupFunctionEnum + +The function type of the group. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | The function type of the group. | must be one of ["REGULAR", "ON_CALL", "TEAM", "UNKNOWN", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GroupTypeEnum.md b/docs/GroupTypeEnum.md new file mode 100644 index 0000000..8ecd468 --- /dev/null +++ b/docs/GroupTypeEnum.md @@ -0,0 +1,12 @@ +# GroupTypeEnum + +The type of the group. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | The type of the group. | must be one of ["ACTIVE_DIRECTORY_GROUP", "DUO_GROUP", "GIT_HUB_TEAM", "GOOGLE_GROUPS_GROUP", "LDAP_GROUP", "OKTA_GROUP", "OPAL_GROUP", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GroupsApi.md b/docs/GroupsApi.md new file mode 100644 index 0000000..cdf5273 --- /dev/null +++ b/docs/GroupsApi.md @@ -0,0 +1,753 @@ +# opal.GroupsApi + +All URIs are relative to *https://api.opal.dev/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**convert_group**](GroupsApi.md#convert_group) | **PUT** /groups/{group_id}/convert | +[**delete_group**](GroupsApi.md#delete_group) | **DELETE** /groups/{group_id} | +[**get_group_message_channels**](GroupsApi.md#get_group_message_channels) | **GET** /groups/{group_id}/message-channels | +[**get_group_reviewers**](GroupsApi.md#get_group_reviewers) | **GET** /groups/{group_id}/reviewers | +[**get_group_tags**](GroupsApi.md#get_group_tags) | **GET** /groups/{group_id}/tags | +[**get_groups**](GroupsApi.md#get_groups) | **GET** /groups | +[**set_group_message_channels**](GroupsApi.md#set_group_message_channels) | **PUT** /groups/{group_id}/message-channels | +[**set_group_reviewers**](GroupsApi.md#set_group_reviewers) | **PUT** /groups/{group_id}/reviewers | +[**update_groups**](GroupsApi.md#update_groups) | **PUT** /groups | + + +# **convert_group** +> Group convert_group(group_id, group_function, new_admin_id_list) + + + +Updates a groups function. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import groups_api +from opal.model.group_function_enum import GroupFunctionEnum +from opal.model.group import Group +from opal.model.new_admin_id_list import NewAdminIDList +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = groups_api.GroupsApi(api_client) + group_id = "4baf8423-db0a-4037-a4cf-f79c60cb67a5" # str | The ID of the group. + group_function = GroupFunctionEnum("TEAM") # GroupFunctionEnum | The group function to convert to. + new_admin_id_list = NewAdminIDList( + admin_ids=[ + "admin_ids_example", + ], + ) # NewAdminIDList | + owner_team_id = "7c86c85d-0651-43e2-a748-d69d658418e8" # str | The ID of the owning team of the group. Required when converting from Team to Group. (optional) + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.convert_group(group_id, group_function, new_admin_id_list) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling GroupsApi->convert_group: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.convert_group(group_id, group_function, new_admin_id_list, owner_team_id=owner_team_id) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling GroupsApi->convert_group: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| The ID of the group. | + **group_function** | **GroupFunctionEnum**| The group function to convert to. | + **new_admin_id_list** | [**NewAdminIDList**](NewAdminIDList.md)| | + **owner_team_id** | **str**| The ID of the owning team of the group. Required when converting from Team to Group. | [optional] + +### Return type + +[**Group**](Group.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The converted group. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_group** +> delete_group(group_id) + + + +Deletes a group. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import groups_api +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = groups_api.GroupsApi(api_client) + group_id = "4baf8423-db0a-4037-a4cf-f79c60cb67a5" # str | The ID of the group. + + # example passing only required values which don't have defaults set + try: + api_instance.delete_group(group_id) + except opal.ApiException as e: + print("Exception when calling GroupsApi->delete_group: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| The ID of the group. | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The group was successfully deleted. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_group_message_channels** +> MessageChannelList get_group_message_channels(group_id) + + + +Gets the list of message channels attached to a group. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import groups_api +from opal.model.message_channel_list import MessageChannelList +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = groups_api.GroupsApi(api_client) + group_id = "4baf8423-db0a-4037-a4cf-f79c60cb67a5" # str | The ID of the group. + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.get_group_message_channels(group_id) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling GroupsApi->get_group_message_channels: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| The ID of the group. | + +### Return type + +[**MessageChannelList**](MessageChannelList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The message channels attached to the group. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_group_reviewers** +> [str] get_group_reviewers(group_id) + + + +Gets the list of team/user IDs of the reviewers for a group. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import groups_api +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = groups_api.GroupsApi(api_client) + group_id = "4baf8423-db0a-4037-a4cf-f79c60cb67a5" # str | The ID of the group. + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.get_group_reviewers(group_id) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling GroupsApi->get_group_reviewers: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| The ID of the group. | + +### Return type + +**[str]** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The IDs of teams/users that are reviewers for this group. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_group_tags** +> TagsList get_group_tags(group_id) + + + +Returns all tags applied to the group. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import groups_api +from opal.model.tags_list import TagsList +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = groups_api.GroupsApi(api_client) + group_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the group whose tags to return. + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.get_group_tags(group_id) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling GroupsApi->get_group_tags: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| The ID of the group whose tags to return. | + +### Return type + +[**TagsList**](TagsList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The tags applied to the group. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_groups** +> PaginatedGroupsList get_groups() + + + +Returns a list of groups for your organization. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import groups_api +from opal.model.group_function_enum import GroupFunctionEnum +from opal.model.paginated_groups_list import PaginatedGroupsList +from opal.model.group_type_enum import GroupTypeEnum +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = groups_api.GroupsApi(api_client) + cursor = "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw" # str | The pagination cursor value. (optional) + page_size = 200 # int | Number of results to return per page. Default is 200. (optional) + group_function_filter = GroupFunctionEnum("REGULAR") # GroupFunctionEnum | The group function to filter by. (optional) + group_type_filter = GroupTypeEnum("OPAL_GROUP") # GroupTypeEnum | The group type to filter by. (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.get_groups(cursor=cursor, page_size=page_size, group_function_filter=group_function_filter, group_type_filter=group_type_filter) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling GroupsApi->get_groups: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cursor** | **str**| The pagination cursor value. | [optional] + **page_size** | **int**| Number of results to return per page. Default is 200. | [optional] + **group_function_filter** | **GroupFunctionEnum**| The group function to filter by. | [optional] + **group_type_filter** | **GroupTypeEnum**| The group type to filter by. | [optional] + +### Return type + +[**PaginatedGroupsList**](PaginatedGroupsList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | One page worth groups associated with your organization. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **set_group_message_channels** +> [str] set_group_message_channels(group_id, message_channel_id_list) + + + +Sets the list of message channels attached to a group. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import groups_api +from opal.model.message_channel_id_list import MessageChannelIDList +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = groups_api.GroupsApi(api_client) + group_id = "4baf8423-db0a-4037-a4cf-f79c60cb67a5" # str | The ID of the group. + message_channel_id_list = MessageChannelIDList( + message_channel_ids=[ + "message_channel_ids_example", + ], + ) # MessageChannelIDList | + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.set_group_message_channels(group_id, message_channel_id_list) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling GroupsApi->set_group_message_channels: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| The ID of the group. | + **message_channel_id_list** | [**MessageChannelIDList**](MessageChannelIDList.md)| | + +### Return type + +**[str]** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The updated message channel IDs for the group. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **set_group_reviewers** +> [str] set_group_reviewers(group_id, reviewer_id_list) + + + +Sets the list of reviewers for a group. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import groups_api +from opal.model.reviewer_id_list import ReviewerIDList +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = groups_api.GroupsApi(api_client) + group_id = "4baf8423-db0a-4037-a4cf-f79c60cb67a5" # str | The ID of the group. + reviewer_id_list = ReviewerIDList( + reviewer_ids=[ + "reviewer_ids_example", + ], + ) # ReviewerIDList | + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.set_group_reviewers(group_id, reviewer_id_list) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling GroupsApi->set_group_reviewers: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_id** | **str**| The ID of the group. | + **reviewer_id_list** | [**ReviewerIDList**](ReviewerIDList.md)| | + +### Return type + +**[str]** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The updated IDs of teams/users that are reviewers for this group | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_groups** +> UpdateGroupInfoList update_groups(update_group_info_list) + + + +Bulk updates a list of groups. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import groups_api +from opal.model.update_group_info_list import UpdateGroupInfoList +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = groups_api.GroupsApi(api_client) + update_group_info_list = UpdateGroupInfoList( + groups=[ + UpdateGroupInfo( + group_id="f454d283-ca87-4a8a-bdbb-df212eca5353", + name="api-group", + description="This group represents Active Directory group "Payments Production Admin". We use this AD group to facilitate staging deployments and qualifying new releases.", + owner_team_id="7c86c85d-0651-43e2-a748-d69d658418e8", + visibility=VisibilityEnum("GLOBAL"), + max_duration=120, + require_manager_approval=False, + require_support_ticket=False, + folder_id="e27cb7b0-98e2-4555-9916-9e6d8ca6b079", + ), + ], + ) # UpdateGroupInfoList | Groups to be updated + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.update_groups(update_group_info_list) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling GroupsApi->update_groups: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_group_info_list** | [**UpdateGroupInfoList**](UpdateGroupInfoList.md)| Groups to be updated | + +### Return type + +[**UpdateGroupInfoList**](UpdateGroupInfoList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The resulting updated group infos. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/MessageChannel.md b/docs/MessageChannel.md new file mode 100644 index 0000000..ace8240 --- /dev/null +++ b/docs/MessageChannel.md @@ -0,0 +1,18 @@ +# MessageChannel + +# MessageChannel Object ### Description The `MessageChannel` object is used to represent a message channel. ### Usage Example Update a groups message channel from the `UPDATE Groups` endpoint. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message_channel_id** | **str** | The ID of the message channel. | +**third_party_provider** | [**MessageChannelProviderEnum**](MessageChannelProviderEnum.md) | | [optional] +**remote_id** | **str** | The remote ID of the message channel | [optional] +**name** | **str** | The name of the message channel. | [optional] +**message_channel_type** | [**MessageChannelTypeEnum**](MessageChannelTypeEnum.md) | | [optional] +**is_private** | **bool** | A bool representing whether or not the message channel is private. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MessageChannelIDList.md b/docs/MessageChannelIDList.md new file mode 100644 index 0000000..0d1a049 --- /dev/null +++ b/docs/MessageChannelIDList.md @@ -0,0 +1,13 @@ +# MessageChannelIDList + +A list of message channel IDs. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message_channel_ids** | **[str]** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MessageChannelList.md b/docs/MessageChannelList.md new file mode 100644 index 0000000..547dfa4 --- /dev/null +++ b/docs/MessageChannelList.md @@ -0,0 +1,12 @@ +# MessageChannelList + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channels** | [**[MessageChannel]**](MessageChannel.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MessageChannelProviderEnum.md b/docs/MessageChannelProviderEnum.md new file mode 100644 index 0000000..36b7e5a --- /dev/null +++ b/docs/MessageChannelProviderEnum.md @@ -0,0 +1,12 @@ +# MessageChannelProviderEnum + +The third party provider of the message channel. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | The third party provider of the message channel. | defaults to "SLACK", must be one of ["SLACK", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MessageChannelTypeEnum.md b/docs/MessageChannelTypeEnum.md new file mode 100644 index 0000000..0f7d0d8 --- /dev/null +++ b/docs/MessageChannelTypeEnum.md @@ -0,0 +1,12 @@ +# MessageChannelTypeEnum + +The type of the message channel. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | The type of the message channel. | must be one of ["AUDIT", "REVIEWER", "MONITOR", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/NewAdminIDList.md b/docs/NewAdminIDList.md new file mode 100644 index 0000000..d48a012 --- /dev/null +++ b/docs/NewAdminIDList.md @@ -0,0 +1,12 @@ +# NewAdminIDList + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**admin_ids** | **[str]** | The IDs of admins to set for the group if converting to a team. Required when converting from Group to Team. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PaginatedGroupsList.md b/docs/PaginatedGroupsList.md new file mode 100644 index 0000000..f4138bc --- /dev/null +++ b/docs/PaginatedGroupsList.md @@ -0,0 +1,14 @@ +# PaginatedGroupsList + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**[Group]**](Group.md) | | +**next** | **str, none_type** | The cursor with which to continue pagination if additional result pages exist. | [optional] +**previous** | **str, none_type** | The cursor used to obtain the current result page. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PaginatedResourcesList.md b/docs/PaginatedResourcesList.md new file mode 100644 index 0000000..35419ef --- /dev/null +++ b/docs/PaginatedResourcesList.md @@ -0,0 +1,14 @@ +# PaginatedResourcesList + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**[Resource]**](Resource.md) | | +**next** | **str, none_type** | The cursor with which to continue pagination if additional result pages exist. | [optional] +**previous** | **str, none_type** | The cursor used to obtain the current result page. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Resource.md b/docs/Resource.md new file mode 100644 index 0000000..324e95a --- /dev/null +++ b/docs/Resource.md @@ -0,0 +1,22 @@ +# Resource + +# Resource Object ### Description The `Resource` object is used to represent a resource. ### Usage Example Update from the `UPDATE Resources` endpoint. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_id** | **str** | The ID of the resource. | +**name** | **str** | The name of the resource. | [optional] +**description** | **str** | A description of the resource. | [optional] +**owner_team_id** | **str** | The ID of the owning team of the resource. | [optional] +**visibility** | [**VisibilityEnum**](VisibilityEnum.md) | | [optional] +**resource_type** | [**ResourceTypeEnum**](ResourceTypeEnum.md) | | [optional] +**max_duration** | **int** | The maximum duration access to the resource can be requested for (in minutes). | [optional] +**require_manager_approval** | **bool** | A bool representing whether or not access requests to the resource require manager approval. | [optional] +**require_support_ticket** | **bool** | A bool representing whether or not access requests to the resource require a support ticket. | [optional] +**folder_id** | **str** | The ID of the folder that the resource is located in. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ResourceTypeEnum.md b/docs/ResourceTypeEnum.md new file mode 100644 index 0000000..035c7b3 --- /dev/null +++ b/docs/ResourceTypeEnum.md @@ -0,0 +1,12 @@ +# ResourceTypeEnum + +The type of the resource. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | The type of the resource. | must be one of ["AWS_IAM_ROLE", "AWS_EC2_INSTANCE", "AWS_EKS_CLUSTER", "AWS_RDS_POSTGRES_INSTANCE", "AWS_RDS_MYSQL_INSTANCE", "CUSTOM", "GCP_BUCKET", "GCP_COMPUTE_INSTANCE", "GCP_FOLDER", "GCP_GKE_CLUSTER", "GCP_PROJECT", "GCP_CLOUD_SQL_POSTGRES_INSTANCE", "GCP_CLOUD_SQL_MYSQL_INSTANCE", "GIT_HUB_REPO", "GOOGLE_WORKSPACE_ROLE", "MONGO_INSTANCE", "MONGO_ATLAS_INSTANCE", "OKTA_APP", "OKTA_ROLE", "OPAL_ROLE", "PAGERDUTY_ROLE", "SALESFORCE_PERMISSION_SET", "SALESFORCE_PROFILE", "SALESFORCE_ROLE", "WORKDAY_ROLE", "MYSQL_INSTANCE", "MARIADB_INSTANCE", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ResourcesApi.md b/docs/ResourcesApi.md index 912c935..55cd1aa 100644 --- a/docs/ResourcesApi.md +++ b/docs/ResourcesApi.md @@ -4,10 +4,401 @@ All URIs are relative to *https://api.opal.dev/v1* Method | HTTP request | Description ------------- | ------------- | ------------- +[**delete_resource**](ResourcesApi.md#delete_resource) | **DELETE** /resources/{resource_id} | +[**get_resource_message_channels**](ResourcesApi.md#get_resource_message_channels) | **GET** /resources/{resource_id}/message-channels | +[**get_resource_reviewers**](ResourcesApi.md#get_resource_reviewers) | **GET** /resources/{resource_id}/reviewers | +[**get_resource_tags**](ResourcesApi.md#get_resource_tags) | **GET** /resources/{resource_id}/tags | +[**get_resources**](ResourcesApi.md#get_resources) | **GET** /resources | [**resource_user_access_status_retrieve**](ResourcesApi.md#resource_user_access_status_retrieve) | **GET** /resource-user-access-status/{resource_id}/{user_id} | [**resource_users**](ResourcesApi.md#resource_users) | **GET** /resource-users | +[**set_resource_message_channels**](ResourcesApi.md#set_resource_message_channels) | **PUT** /resources/{resource_id}/message-channels | +[**set_resource_reviewers**](ResourcesApi.md#set_resource_reviewers) | **PUT** /resources/{resource_id}/reviewers | +[**update_resources**](ResourcesApi.md#update_resources) | **PUT** /resources | +# **delete_resource** +> delete_resource(resource_id) + + + +Deletes a resource. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import resources_api +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = resources_api.ResourcesApi(api_client) + resource_id = "4baf8423-db0a-4037-a4cf-f79c60cb67a5" # str | The ID of the resource. + + # example passing only required values which don't have defaults set + try: + api_instance.delete_resource(resource_id) + except opal.ApiException as e: + print("Exception when calling ResourcesApi->delete_resource: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **resource_id** | **str**| The ID of the resource. | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The resource was successfully deleted. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_resource_message_channels** +> MessageChannelList get_resource_message_channels(resource_id) + + + +Gets the list of message channels attached to a resource. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import resources_api +from opal.model.message_channel_list import MessageChannelList +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = resources_api.ResourcesApi(api_client) + resource_id = "4baf8423-db0a-4037-a4cf-f79c60cb67a5" # str | The ID of the resource. + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.get_resource_message_channels(resource_id) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling ResourcesApi->get_resource_message_channels: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **resource_id** | **str**| The ID of the resource. | + +### Return type + +[**MessageChannelList**](MessageChannelList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The message channels attached to the resource. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_resource_reviewers** +> [str] get_resource_reviewers(resource_id) + + + +Gets the list of team/user IDs of the reviewers for a resource. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import resources_api +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = resources_api.ResourcesApi(api_client) + resource_id = "4baf8423-db0a-4037-a4cf-f79c60cb67a5" # str | The ID of the resource. + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.get_resource_reviewers(resource_id) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling ResourcesApi->get_resource_reviewers: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **resource_id** | **str**| The ID of the resource. | + +### Return type + +**[str]** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The IDs of teams that are reviewers for this resource. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_resource_tags** +> TagsList get_resource_tags(resource_id) + + + +Returns all tags applied to the resource. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import resources_api +from opal.model.tags_list import TagsList +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = resources_api.ResourcesApi(api_client) + resource_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the resource whose tags to return. + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.get_resource_tags(resource_id) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling ResourcesApi->get_resource_tags: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **resource_id** | **str**| The ID of the resource whose tags to return. | + +### Return type + +[**TagsList**](TagsList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The tags applied to the resource. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_resources** +> PaginatedResourcesList get_resources() + + + +Returns a list of resources for your organization. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import resources_api +from opal.model.resource_type_enum import ResourceTypeEnum +from opal.model.paginated_resources_list import PaginatedResourcesList +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = resources_api.ResourcesApi(api_client) + cursor = "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw" # str | The pagination cursor value. (optional) + page_size = 200 # int | Number of results to return per page. Default is 200. (optional) + resource_type_filter = ResourceTypeEnum("AWS_IAM_ROLE") # ResourceTypeEnum | The resource type to filter by. (optional) + + # example passing only required values which don't have defaults set + # and optional values + try: + api_response = api_instance.get_resources(cursor=cursor, page_size=page_size, resource_type_filter=resource_type_filter) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling ResourcesApi->get_resources: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cursor** | **str**| The pagination cursor value. | [optional] + **page_size** | **int**| Number of results to return per page. Default is 200. | [optional] + **resource_type_filter** | **ResourceTypeEnum**| The resource type to filter by. | [optional] + +### Return type + +[**PaginatedResourcesList**](PaginatedResourcesList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | One page worth resources associated with your organization. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **resource_user_access_status_retrieve** > ResourceUserAccessStatus resource_user_access_status_retrieve(resource_id, user_id) @@ -49,7 +440,7 @@ with opal.ApiClient(configuration) as api_client: user_id = "29827fb8-f2dd-4e80-9576-28e31e9934ac" # str | The ID of the user. access_level_remote_id = "arn:aws:iam::590304332660:role/AdministratorAccess" # str | The remote ID of the access level that you wish to query for the resource. If omitted, the default access level remote ID value (empty string) is used. (optional) cursor = "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw" # str | The pagination cursor value. (optional) - page_size = 200 # int | Number of results to return per page. (optional) + page_size = 200 # int | Number of results to return per page. Default is 200. (optional) # example passing only required values which don't have defaults set try: @@ -76,7 +467,7 @@ Name | Type | Description | Notes **user_id** | **str**| The ID of the user. | **access_level_remote_id** | **str**| The remote ID of the access level that you wish to query for the resource. If omitted, the default access level remote ID value (empty string) is used. | [optional] **cursor** | **str**| The pagination cursor value. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] + **page_size** | **int**| Number of results to return per page. Default is 200. | [optional] ### Return type @@ -140,7 +531,7 @@ with opal.ApiClient(configuration) as api_client: resource_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the resource. access_level_remote_id = "arn:aws:iam::590304332660:role/AdministratorAccess" # str | The remote ID of the access level that you wish to query for the resource. If omitted, the default access level remote ID value (empty string) is used. (optional) cursor = "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw" # str | The pagination cursor value. (optional) - page_size = 200 # int | Number of results to return per page. (optional) + page_size = 200 # int | Number of results to return per page. Default is 200. (optional) # example passing only required values which don't have defaults set try: @@ -166,7 +557,7 @@ Name | Type | Description | Notes **resource_id** | **str**| The ID of the resource. | **access_level_remote_id** | **str**| The remote ID of the access level that you wish to query for the resource. If omitted, the default access level remote ID value (empty string) is used. | [optional] **cursor** | **str**| The pagination cursor value. | [optional] - **page_size** | **int**| Number of results to return per page. | [optional] + **page_size** | **int**| Number of results to return per page. Default is 200. | [optional] ### Return type @@ -190,3 +581,257 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **set_resource_message_channels** +> [str] set_resource_message_channels(resource_id, message_channel_id_list) + + + +Sets the list of message channels attached to a resource. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import resources_api +from opal.model.message_channel_id_list import MessageChannelIDList +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = resources_api.ResourcesApi(api_client) + resource_id = "4baf8423-db0a-4037-a4cf-f79c60cb67a5" # str | The ID of the resource. + message_channel_id_list = MessageChannelIDList( + message_channel_ids=[ + "message_channel_ids_example", + ], + ) # MessageChannelIDList | + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.set_resource_message_channels(resource_id, message_channel_id_list) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling ResourcesApi->set_resource_message_channels: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **resource_id** | **str**| The ID of the resource. | + **message_channel_id_list** | [**MessageChannelIDList**](MessageChannelIDList.md)| | + +### Return type + +**[str]** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The updated message channel IDs for the resource. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **set_resource_reviewers** +> [str] set_resource_reviewers(resource_id, reviewer_id_list) + + + +Sets the list of reviewers for a resource. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import resources_api +from opal.model.reviewer_id_list import ReviewerIDList +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = resources_api.ResourcesApi(api_client) + resource_id = "4baf8423-db0a-4037-a4cf-f79c60cb67a5" # str | The ID of the resource. + reviewer_id_list = ReviewerIDList( + reviewer_ids=[ + "reviewer_ids_example", + ], + ) # ReviewerIDList | + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.set_resource_reviewers(resource_id, reviewer_id_list) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling ResourcesApi->set_resource_reviewers: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **resource_id** | **str**| The ID of the resource. | + **reviewer_id_list** | [**ReviewerIDList**](ReviewerIDList.md)| | + +### Return type + +**[str]** + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The updated IDs of teams that are reviewers for this resource | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_resources** +> UpdateResourceInfoList update_resources(update_resource_info_list) + + + +Bulk updates a list of resources. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import resources_api +from opal.model.update_resource_info_list import UpdateResourceInfoList +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = resources_api.ResourcesApi(api_client) + update_resource_info_list = UpdateResourceInfoList( + resources=[ + UpdateResourceInfo( + resource_id="f454d283-ca87-4a8a-bdbb-df212eca5353", + name="my-mongo-db", + description="This resource represents AWS IAM role "SupportUser".", + owner_team_id="7c86c85d-0651-43e2-a748-d69d658418e8", + visibility=VisibilityEnum("GLOBAL"), + max_duration=120, + require_manager_approval=False, + require_support_ticket=False, + folder_id="e27cb7b0-98e2-4555-9916-9e6d8ca6b079", + ), + ], + ) # UpdateResourceInfoList | Resources to be updated + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.update_resources(update_resource_info_list) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling ResourcesApi->update_resources: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **update_resource_info_list** | [**UpdateResourceInfoList**](UpdateResourceInfoList.md)| Resources to be updated | + +### Return type + +[**UpdateResourceInfoList**](UpdateResourceInfoList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The resulting updated resource infos. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/ReviewerIDList.md b/docs/ReviewerIDList.md new file mode 100644 index 0000000..4960830 --- /dev/null +++ b/docs/ReviewerIDList.md @@ -0,0 +1,13 @@ +# ReviewerIDList + +A list of reviewer IDs. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reviewer_ids** | **[str]** | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Tag.md b/docs/Tag.md new file mode 100644 index 0000000..b4c09c7 --- /dev/null +++ b/docs/Tag.md @@ -0,0 +1,19 @@ +# Tag + +# Tag Object ### Description The `Tag` object is used to represent a tag. ### Usage Example Get tags from the `GET Tag` endpoint. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tag_id** | **str** | The ID of the tag. | +**created_at** | **datetime** | The date the tag was created. | [optional] +**updated_at** | **datetime** | The date the tag was last updated. | [optional] +**user_creator_id** | **str** | The ID of the user that created the tag. | [optional] +**owner_team_id** | **str** | The ID of the team that owns the tag. | [optional] +**key** | **str** | The key of the tag. | [optional] +**value** | **str** | The value of the tag. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TagsApi.md b/docs/TagsApi.md new file mode 100644 index 0000000..c37b63d --- /dev/null +++ b/docs/TagsApi.md @@ -0,0 +1,630 @@ +# opal.TagsApi + +All URIs are relative to *https://api.opal.dev/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_group_tag**](TagsApi.md#add_group_tag) | **POST** /tags/{tag_id}/groups/{group_id} | +[**add_resource_tag**](TagsApi.md#add_resource_tag) | **POST** /tags/{tag_id}/resources/{resource_id} | +[**add_user_tag**](TagsApi.md#add_user_tag) | **POST** /tags/{tag_id}/users/{user_id} | +[**create_tag**](TagsApi.md#create_tag) | **POST** /tag | +[**get_tag**](TagsApi.md#get_tag) | **GET** /tag | +[**remove_group_tag**](TagsApi.md#remove_group_tag) | **DELETE** /tags/{tag_id}/groups/{group_id} | +[**remove_resource_tag**](TagsApi.md#remove_resource_tag) | **DELETE** /tags/{tag_id}/resources/{resource_id} | +[**remove_user_tag**](TagsApi.md#remove_user_tag) | **DELETE** /tags/{tag_id}/users/{user_id} | + + +# **add_group_tag** +> add_group_tag(tag_id, group_id) + + + +Applies a tag to a group. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import tags_api +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tags_api.TagsApi(api_client) + tag_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the tag to apply. + group_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the group to apply the tag to. + + # example passing only required values which don't have defaults set + try: + api_instance.add_group_tag(tag_id, group_id) + except opal.ApiException as e: + print("Exception when calling TagsApi->add_group_tag: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag_id** | **str**| The ID of the tag to apply. | + **group_id** | **str**| The ID of the group to apply the tag to. | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Tag applied to group successfully. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **add_resource_tag** +> add_resource_tag(tag_id, resource_id) + + + +Applies a tag to a resource. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import tags_api +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tags_api.TagsApi(api_client) + tag_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the tag to apply. + resource_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the resource to apply the tag to. + + # example passing only required values which don't have defaults set + try: + api_instance.add_resource_tag(tag_id, resource_id) + except opal.ApiException as e: + print("Exception when calling TagsApi->add_resource_tag: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag_id** | **str**| The ID of the tag to apply. | + **resource_id** | **str**| The ID of the resource to apply the tag to. | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Tag applied to resource successfully. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **add_user_tag** +> add_user_tag(tag_id, user_id) + + + +Applies a tag to a user. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import tags_api +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tags_api.TagsApi(api_client) + tag_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the tag to apply. + user_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the user to apply the tag to. + + # example passing only required values which don't have defaults set + try: + api_instance.add_user_tag(tag_id, user_id) + except opal.ApiException as e: + print("Exception when calling TagsApi->add_user_tag: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag_id** | **str**| The ID of the tag to apply. | + **user_id** | **str**| The ID of the user to apply the tag to. | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Tag applied to user successfully. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_tag** +> Tag create_tag(tag_key, tag_value, tag_owner_team_id) + + + +Creates a tag with the given key and value. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import tags_api +from opal.model.tag import Tag +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tags_api.TagsApi(api_client) + tag_key = "api-scope" # str | The key of the tag to create. + tag_value = "production" # str | The value of the tag to create. + tag_owner_team_id = "f92aa855-cea9-4814-b9d8-f2a60d3e4a06" # str | The ID of the team that owns the tag. + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.create_tag(tag_key, tag_value, tag_owner_team_id) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling TagsApi->create_tag: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag_key** | **str**| The key of the tag to create. | + **tag_value** | **str**| The value of the tag to create. | + **tag_owner_team_id** | **str**| The ID of the team that owns the tag. | + +### Return type + +[**Tag**](Tag.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The tag that was created. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_tag** +> Tag get_tag(tag_key, tag_value) + + + +Gets a tag with the given key and value. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import tags_api +from opal.model.tag import Tag +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tags_api.TagsApi(api_client) + tag_key = "api-scope" # str | The key of the tag to get. + tag_value = "production" # str | The value of the tag to get. + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.get_tag(tag_key, tag_value) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling TagsApi->get_tag: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag_key** | **str**| The key of the tag to get. | + **tag_value** | **str**| The value of the tag to get. | + +### Return type + +[**Tag**](Tag.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The tag requested. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **remove_group_tag** +> remove_group_tag(tag_id, group_id) + + + +Removes a tag from a group. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import tags_api +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tags_api.TagsApi(api_client) + tag_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the tag to remove. + group_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the group to remove the tag from. + + # example passing only required values which don't have defaults set + try: + api_instance.remove_group_tag(tag_id, group_id) + except opal.ApiException as e: + print("Exception when calling TagsApi->remove_group_tag: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag_id** | **str**| The ID of the tag to remove. | + **group_id** | **str**| The ID of the group to remove the tag from. | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Tag removed from group successfully. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **remove_resource_tag** +> remove_resource_tag(tag_id, resource_id) + + + +Removes a tag from a resource. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import tags_api +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tags_api.TagsApi(api_client) + tag_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the tag to remove. + resource_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the resource to remove the tag from. + + # example passing only required values which don't have defaults set + try: + api_instance.remove_resource_tag(tag_id, resource_id) + except opal.ApiException as e: + print("Exception when calling TagsApi->remove_resource_tag: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag_id** | **str**| The ID of the tag to remove. | + **resource_id** | **str**| The ID of the resource to remove the tag from. | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Tag removed from resource successfully. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **remove_user_tag** +> remove_user_tag(tag_id, user_id) + + + +Removes a tag from a user. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import tags_api +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = tags_api.TagsApi(api_client) + tag_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the tag to remove. + user_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the user to remove the tag from. + + # example passing only required values which don't have defaults set + try: + api_instance.remove_user_tag(tag_id, user_id) + except opal.ApiException as e: + print("Exception when calling TagsApi->remove_user_tag: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag_id** | **str**| The ID of the tag to remove. | + **user_id** | **str**| The ID of the user to remove the tag from. | + +### Return type + +void (empty response body) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Tag removed from user successfully. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/TagsList.md b/docs/TagsList.md new file mode 100644 index 0000000..7b21e00 --- /dev/null +++ b/docs/TagsList.md @@ -0,0 +1,12 @@ +# TagsList + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tags** | [**[Tag]**](Tag.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateGroupInfo.md b/docs/UpdateGroupInfo.md new file mode 100644 index 0000000..8705abf --- /dev/null +++ b/docs/UpdateGroupInfo.md @@ -0,0 +1,21 @@ +# UpdateGroupInfo + +# UpdateGroupInfo Object ### Description The `UpdateGroupInfo` object is used as an input to the UpdateGroup API. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group_id** | **str** | The ID of the group. | +**name** | **str** | The name of the group. | [optional] +**description** | **str** | A description of the group. | [optional] +**owner_team_id** | **str** | The ID of the owning team of the group. Use empty string to remove owner. Required when converting from Team to Group. | [optional] +**visibility** | [**VisibilityEnum**](VisibilityEnum.md) | | [optional] +**max_duration** | **int** | The maximum duration access to the group can be requested for (in minutes). Use 0 to set to indefinite. | [optional] +**require_manager_approval** | **bool** | A bool representing whether or not access requests to the group require manager approval. | [optional] +**require_support_ticket** | **bool** | A bool representing whether or not access requests to the group require a support ticket. | [optional] +**folder_id** | **str** | The ID of the folder that the group is located in. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateGroupInfoList.md b/docs/UpdateGroupInfoList.md new file mode 100644 index 0000000..ca7f54d --- /dev/null +++ b/docs/UpdateGroupInfoList.md @@ -0,0 +1,12 @@ +# UpdateGroupInfoList + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**groups** | [**[UpdateGroupInfo]**](UpdateGroupInfo.md) | A list of groups with information to update. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateResourceInfo.md b/docs/UpdateResourceInfo.md new file mode 100644 index 0000000..760dca5 --- /dev/null +++ b/docs/UpdateResourceInfo.md @@ -0,0 +1,21 @@ +# UpdateResourceInfo + +# UpdateResourceInfo Object ### Description The `UpdateResourceInfo` object is used as an input to the UpdateResource API. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_id** | **str** | The ID of the resource. | +**name** | **str** | The name of the resource. | [optional] +**description** | **str** | A description of the resource. | [optional] +**owner_team_id** | **str** | The ID of the owning team of the resource. | [optional] +**visibility** | [**VisibilityEnum**](VisibilityEnum.md) | | [optional] +**max_duration** | **int** | The maximum duration access to the resource can be requested for (in minutes). Use 0 to set to indefinite. | [optional] +**require_manager_approval** | **bool** | A bool representing whether or not access requests to the resource require manager approval. | [optional] +**require_support_ticket** | **bool** | A bool representing whether or not access requests to the resource require a support ticket. | [optional] +**folder_id** | **str** | The ID of the folder that the resource is located in. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateResourceInfoList.md b/docs/UpdateResourceInfoList.md new file mode 100644 index 0000000..72ef87f --- /dev/null +++ b/docs/UpdateResourceInfoList.md @@ -0,0 +1,12 @@ +# UpdateResourceInfoList + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resources** | [**[UpdateResourceInfo]**](UpdateResourceInfo.md) | A list of resources with information to update. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UsersApi.md b/docs/UsersApi.md index 70c5c3c..3645666 100644 --- a/docs/UsersApi.md +++ b/docs/UsersApi.md @@ -4,9 +4,86 @@ All URIs are relative to *https://api.opal.dev/v1* Method | HTTP request | Description ------------- | ------------- | ------------- +[**get_user_tags**](UsersApi.md#get_user_tags) | **GET** /users/{user_id}/tags | [**user**](UsersApi.md#user) | **GET** /user | +# **get_user_tags** +> TagsList get_user_tags(user_id) + + + +Returns all tags applied to the user. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import time +import opal +from opal.api import users_api +from opal.model.tags_list import TagsList +from pprint import pprint +# Defining the host is optional and defaults to https://api.opal.dev/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = opal.Configuration( + host = "https://api.opal.dev/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = opal.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with opal.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = users_api.UsersApi(api_client) + user_id = "1b978423-db0a-4037-a4cf-f79c60cb67b3" # str | The ID of the user whose tags to return. + + # example passing only required values which don't have defaults set + try: + api_response = api_instance.get_user_tags(user_id) + pprint(api_response) + except opal.ApiException as e: + print("Exception when calling UsersApi->get_user_tags: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_id** | **str**| The ID of the user whose tags to return. | + +### Return type + +[**TagsList**](TagsList.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The tags applied to the user. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **user** > User user() diff --git a/docs/VisibilityEnum.md b/docs/VisibilityEnum.md new file mode 100644 index 0000000..9cf14f7 --- /dev/null +++ b/docs/VisibilityEnum.md @@ -0,0 +1,12 @@ +# VisibilityEnum + +The visibility level of the entity. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | The visibility level of the entity. | must be one of ["GLOBAL", "TEAM", ] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/opal/api/events_api.py b/opal/api/events_api.py index e2ca17c..995ae65 100644 --- a/opal/api/events_api.py +++ b/opal/api/events_api.py @@ -63,10 +63,15 @@ def __init__(self, api_client=None): 'enum': [ ], 'validation': [ + 'page_size', ] }, root_map={ 'validations': { + ('page_size',): { + + 'inclusive_maximum': 1000, + }, }, 'allowed_values': { }, @@ -137,7 +142,7 @@ def events( object_filter (str): An object filter for the events. Supply the ID of the object.. [optional] event_type_filter (str): An event type filter for the events.. [optional] cursor (str): The pagination cursor value.. [optional] - page_size (int): Number of results to return per page.. [optional] + page_size (int): Number of results to return per page. Default is 200.. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -153,6 +158,13 @@ def events( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -181,6 +193,11 @@ def events( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.events_endpoint.call_with_http_info(**kwargs) diff --git a/opal/api/groups_api.py b/opal/api/groups_api.py new file mode 100644 index 0000000..5e3fca5 --- /dev/null +++ b/opal/api/groups_api.py @@ -0,0 +1,1274 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.api_client import ApiClient, Endpoint as _Endpoint +from opal.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from opal.model.group import Group +from opal.model.group_function_enum import GroupFunctionEnum +from opal.model.group_type_enum import GroupTypeEnum +from opal.model.message_channel_id_list import MessageChannelIDList +from opal.model.message_channel_list import MessageChannelList +from opal.model.new_admin_id_list import NewAdminIDList +from opal.model.paginated_groups_list import PaginatedGroupsList +from opal.model.reviewer_id_list import ReviewerIDList +from opal.model.tags_list import TagsList +from opal.model.update_group_info_list import UpdateGroupInfoList + + +class GroupsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.convert_group_endpoint = _Endpoint( + settings={ + 'response_type': (Group,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/groups/{group_id}/convert', + 'operation_id': 'convert_group', + 'http_method': 'PUT', + 'servers': None, + }, + params_map={ + 'all': [ + 'group_id', + 'group_function', + 'new_admin_id_list', + 'owner_team_id', + ], + 'required': [ + 'group_id', + 'group_function', + 'new_admin_id_list', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'group_id': + (str,), + 'group_function': + (GroupFunctionEnum,), + 'new_admin_id_list': + (NewAdminIDList,), + 'owner_team_id': + (str,), + }, + 'attribute_map': { + 'group_id': 'group_id', + 'group_function': 'group_function', + 'owner_team_id': 'owner_team_id', + }, + 'location_map': { + 'group_id': 'path', + 'group_function': 'query', + 'new_admin_id_list': 'body', + 'owner_team_id': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.delete_group_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/groups/{group_id}', + 'operation_id': 'delete_group', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'group_id', + ], + 'required': [ + 'group_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'group_id': + (str,), + }, + 'attribute_map': { + 'group_id': 'group_id', + }, + 'location_map': { + 'group_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client + ) + self.get_group_message_channels_endpoint = _Endpoint( + settings={ + 'response_type': (MessageChannelList,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/groups/{group_id}/message-channels', + 'operation_id': 'get_group_message_channels', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'group_id', + ], + 'required': [ + 'group_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'group_id': + (str,), + }, + 'attribute_map': { + 'group_id': 'group_id', + }, + 'location_map': { + 'group_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_group_reviewers_endpoint = _Endpoint( + settings={ + 'response_type': ([str],), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/groups/{group_id}/reviewers', + 'operation_id': 'get_group_reviewers', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'group_id', + ], + 'required': [ + 'group_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'group_id': + (str,), + }, + 'attribute_map': { + 'group_id': 'group_id', + }, + 'location_map': { + 'group_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_group_tags_endpoint = _Endpoint( + settings={ + 'response_type': (TagsList,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/groups/{group_id}/tags', + 'operation_id': 'get_group_tags', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'group_id', + ], + 'required': [ + 'group_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'group_id': + (str,), + }, + 'attribute_map': { + 'group_id': 'group_id', + }, + 'location_map': { + 'group_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_groups_endpoint = _Endpoint( + settings={ + 'response_type': (PaginatedGroupsList,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/groups', + 'operation_id': 'get_groups', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'cursor', + 'page_size', + 'group_function_filter', + 'group_type_filter', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'page_size', + ] + }, + root_map={ + 'validations': { + ('page_size',): { + + 'inclusive_maximum': 1000, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'cursor': + (str,), + 'page_size': + (int,), + 'group_function_filter': + (GroupFunctionEnum,), + 'group_type_filter': + (GroupTypeEnum,), + }, + 'attribute_map': { + 'cursor': 'cursor', + 'page_size': 'page_size', + 'group_function_filter': 'group_function_filter', + 'group_type_filter': 'group_type_filter', + }, + 'location_map': { + 'cursor': 'query', + 'page_size': 'query', + 'group_function_filter': 'query', + 'group_type_filter': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.set_group_message_channels_endpoint = _Endpoint( + settings={ + 'response_type': ([str],), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/groups/{group_id}/message-channels', + 'operation_id': 'set_group_message_channels', + 'http_method': 'PUT', + 'servers': None, + }, + params_map={ + 'all': [ + 'group_id', + 'message_channel_id_list', + ], + 'required': [ + 'group_id', + 'message_channel_id_list', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'group_id': + (str,), + 'message_channel_id_list': + (MessageChannelIDList,), + }, + 'attribute_map': { + 'group_id': 'group_id', + }, + 'location_map': { + 'group_id': 'path', + 'message_channel_id_list': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.set_group_reviewers_endpoint = _Endpoint( + settings={ + 'response_type': ([str],), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/groups/{group_id}/reviewers', + 'operation_id': 'set_group_reviewers', + 'http_method': 'PUT', + 'servers': None, + }, + params_map={ + 'all': [ + 'group_id', + 'reviewer_id_list', + ], + 'required': [ + 'group_id', + 'reviewer_id_list', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'group_id': + (str,), + 'reviewer_id_list': + (ReviewerIDList,), + }, + 'attribute_map': { + 'group_id': 'group_id', + }, + 'location_map': { + 'group_id': 'path', + 'reviewer_id_list': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.update_groups_endpoint = _Endpoint( + settings={ + 'response_type': (UpdateGroupInfoList,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/groups', + 'operation_id': 'update_groups', + 'http_method': 'PUT', + 'servers': None, + }, + params_map={ + 'all': [ + 'update_group_info_list', + ], + 'required': [ + 'update_group_info_list', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'update_group_info_list': + (UpdateGroupInfoList,), + }, + 'attribute_map': { + }, + 'location_map': { + 'update_group_info_list': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + + def convert_group( + self, + group_id, + group_function, + new_admin_id_list, + **kwargs + ): + """convert_group # noqa: E501 + + Updates a groups function. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.convert_group(group_id, group_function, new_admin_id_list, async_req=True) + >>> result = thread.get() + + Args: + group_id (str): The ID of the group. + group_function (GroupFunctionEnum): The group function to convert to. + new_admin_id_list (NewAdminIDList): + + Keyword Args: + owner_team_id (str): The ID of the owning team of the group. Required when converting from Team to Group.. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Group + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['group_id'] = \ + group_id + kwargs['group_function'] = \ + group_function + kwargs['new_admin_id_list'] = \ + new_admin_id_list + return self.convert_group_endpoint.call_with_http_info(**kwargs) + + def delete_group( + self, + group_id, + **kwargs + ): + """delete_group # noqa: E501 + + Deletes a group. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_group(group_id, async_req=True) + >>> result = thread.get() + + Args: + group_id (str): The ID of the group. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['group_id'] = \ + group_id + return self.delete_group_endpoint.call_with_http_info(**kwargs) + + def get_group_message_channels( + self, + group_id, + **kwargs + ): + """get_group_message_channels # noqa: E501 + + Gets the list of message channels attached to a group. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_group_message_channels(group_id, async_req=True) + >>> result = thread.get() + + Args: + group_id (str): The ID of the group. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + MessageChannelList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['group_id'] = \ + group_id + return self.get_group_message_channels_endpoint.call_with_http_info(**kwargs) + + def get_group_reviewers( + self, + group_id, + **kwargs + ): + """get_group_reviewers # noqa: E501 + + Gets the list of team/user IDs of the reviewers for a group. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_group_reviewers(group_id, async_req=True) + >>> result = thread.get() + + Args: + group_id (str): The ID of the group. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [str] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['group_id'] = \ + group_id + return self.get_group_reviewers_endpoint.call_with_http_info(**kwargs) + + def get_group_tags( + self, + group_id, + **kwargs + ): + """get_group_tags # noqa: E501 + + Returns all tags applied to the group. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_group_tags(group_id, async_req=True) + >>> result = thread.get() + + Args: + group_id (str): The ID of the group whose tags to return. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + TagsList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['group_id'] = \ + group_id + return self.get_group_tags_endpoint.call_with_http_info(**kwargs) + + def get_groups( + self, + **kwargs + ): + """get_groups # noqa: E501 + + Returns a list of groups for your organization. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_groups(async_req=True) + >>> result = thread.get() + + + Keyword Args: + cursor (str): The pagination cursor value.. [optional] + page_size (int): Number of results to return per page. Default is 200.. [optional] + group_function_filter (GroupFunctionEnum): The group function to filter by.. [optional] + group_type_filter (GroupTypeEnum): The group type to filter by.. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PaginatedGroupsList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + return self.get_groups_endpoint.call_with_http_info(**kwargs) + + def set_group_message_channels( + self, + group_id, + message_channel_id_list, + **kwargs + ): + """set_group_message_channels # noqa: E501 + + Sets the list of message channels attached to a group. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.set_group_message_channels(group_id, message_channel_id_list, async_req=True) + >>> result = thread.get() + + Args: + group_id (str): The ID of the group. + message_channel_id_list (MessageChannelIDList): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [str] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['group_id'] = \ + group_id + kwargs['message_channel_id_list'] = \ + message_channel_id_list + return self.set_group_message_channels_endpoint.call_with_http_info(**kwargs) + + def set_group_reviewers( + self, + group_id, + reviewer_id_list, + **kwargs + ): + """set_group_reviewers # noqa: E501 + + Sets the list of reviewers for a group. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.set_group_reviewers(group_id, reviewer_id_list, async_req=True) + >>> result = thread.get() + + Args: + group_id (str): The ID of the group. + reviewer_id_list (ReviewerIDList): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [str] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['group_id'] = \ + group_id + kwargs['reviewer_id_list'] = \ + reviewer_id_list + return self.set_group_reviewers_endpoint.call_with_http_info(**kwargs) + + def update_groups( + self, + update_group_info_list, + **kwargs + ): + """update_groups # noqa: E501 + + Bulk updates a list of groups. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_groups(update_group_info_list, async_req=True) + >>> result = thread.get() + + Args: + update_group_info_list (UpdateGroupInfoList): Groups to be updated + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + UpdateGroupInfoList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['update_group_info_list'] = \ + update_group_info_list + return self.update_groups_endpoint.call_with_http_info(**kwargs) + diff --git a/opal/api/resources_api.py b/opal/api/resources_api.py index 8d50883..663871e 100644 --- a/opal/api/resources_api.py +++ b/opal/api/resources_api.py @@ -22,8 +22,15 @@ none_type, validate_and_convert_types ) +from opal.model.message_channel_id_list import MessageChannelIDList +from opal.model.message_channel_list import MessageChannelList from opal.model.paginated_resource_user_list import PaginatedResourceUserList +from opal.model.paginated_resources_list import PaginatedResourcesList +from opal.model.resource_type_enum import ResourceTypeEnum from opal.model.resource_user_access_status import ResourceUserAccessStatus +from opal.model.reviewer_id_list import ReviewerIDList +from opal.model.tags_list import TagsList +from opal.model.update_resource_info_list import UpdateResourceInfoList class ResourcesApi(object): @@ -37,6 +44,272 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client + self.delete_resource_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/resources/{resource_id}', + 'operation_id': 'delete_resource', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'resource_id', + ], + 'required': [ + 'resource_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'resource_id': + (str,), + }, + 'attribute_map': { + 'resource_id': 'resource_id', + }, + 'location_map': { + 'resource_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client + ) + self.get_resource_message_channels_endpoint = _Endpoint( + settings={ + 'response_type': (MessageChannelList,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/resources/{resource_id}/message-channels', + 'operation_id': 'get_resource_message_channels', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'resource_id', + ], + 'required': [ + 'resource_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'resource_id': + (str,), + }, + 'attribute_map': { + 'resource_id': 'resource_id', + }, + 'location_map': { + 'resource_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_resource_reviewers_endpoint = _Endpoint( + settings={ + 'response_type': ([str],), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/resources/{resource_id}/reviewers', + 'operation_id': 'get_resource_reviewers', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'resource_id', + ], + 'required': [ + 'resource_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'resource_id': + (str,), + }, + 'attribute_map': { + 'resource_id': 'resource_id', + }, + 'location_map': { + 'resource_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_resource_tags_endpoint = _Endpoint( + settings={ + 'response_type': (TagsList,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/resources/{resource_id}/tags', + 'operation_id': 'get_resource_tags', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'resource_id', + ], + 'required': [ + 'resource_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'resource_id': + (str,), + }, + 'attribute_map': { + 'resource_id': 'resource_id', + }, + 'location_map': { + 'resource_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_resources_endpoint = _Endpoint( + settings={ + 'response_type': (PaginatedResourcesList,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/resources', + 'operation_id': 'get_resources', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'cursor', + 'page_size', + 'resource_type_filter', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'page_size', + ] + }, + root_map={ + 'validations': { + ('page_size',): { + + 'inclusive_maximum': 1000, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'cursor': + (str,), + 'page_size': + (int,), + 'resource_type_filter': + (ResourceTypeEnum,), + }, + 'attribute_map': { + 'cursor': 'cursor', + 'page_size': 'page_size', + 'resource_type_filter': 'resource_type_filter', + }, + 'location_map': { + 'cursor': 'query', + 'page_size': 'query', + 'resource_type_filter': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) self.resource_user_access_status_retrieve_endpoint = _Endpoint( settings={ 'response_type': (ResourceUserAccessStatus,), @@ -65,10 +338,15 @@ def __init__(self, api_client=None): 'enum': [ ], 'validation': [ + 'page_size', ] }, root_map={ 'validations': { + ('page_size',): { + + 'inclusive_maximum': 1000, + }, }, 'allowed_values': { }, @@ -109,72 +387,633 @@ def __init__(self, api_client=None): }, api_client=api_client ) - self.resource_users_endpoint = _Endpoint( - settings={ - 'response_type': (PaginatedResourceUserList,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/resource-users', - 'operation_id': 'resource_users', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - 'resource_id', - 'access_level_remote_id', - 'cursor', - 'page_size', - ], - 'required': [ - 'resource_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'resource_id': - (str,), - 'access_level_remote_id': - (str,), - 'cursor': - (str,), - 'page_size': - (int,), - }, - 'attribute_map': { - 'resource_id': 'resource_id', - 'access_level_remote_id': 'access_level_remote_id', - 'cursor': 'cursor', - 'page_size': 'page_size', - }, - 'location_map': { - 'resource_id': 'query', - 'access_level_remote_id': 'query', - 'cursor': 'query', - 'page_size': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, - api_client=api_client + self.resource_users_endpoint = _Endpoint( + settings={ + 'response_type': (PaginatedResourceUserList,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/resource-users', + 'operation_id': 'resource_users', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'resource_id', + 'access_level_remote_id', + 'cursor', + 'page_size', + ], + 'required': [ + 'resource_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'page_size', + ] + }, + root_map={ + 'validations': { + ('page_size',): { + + 'inclusive_maximum': 1000, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'resource_id': + (str,), + 'access_level_remote_id': + (str,), + 'cursor': + (str,), + 'page_size': + (int,), + }, + 'attribute_map': { + 'resource_id': 'resource_id', + 'access_level_remote_id': 'access_level_remote_id', + 'cursor': 'cursor', + 'page_size': 'page_size', + }, + 'location_map': { + 'resource_id': 'query', + 'access_level_remote_id': 'query', + 'cursor': 'query', + 'page_size': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.set_resource_message_channels_endpoint = _Endpoint( + settings={ + 'response_type': ([str],), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/resources/{resource_id}/message-channels', + 'operation_id': 'set_resource_message_channels', + 'http_method': 'PUT', + 'servers': None, + }, + params_map={ + 'all': [ + 'resource_id', + 'message_channel_id_list', + ], + 'required': [ + 'resource_id', + 'message_channel_id_list', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'resource_id': + (str,), + 'message_channel_id_list': + (MessageChannelIDList,), + }, + 'attribute_map': { + 'resource_id': 'resource_id', + }, + 'location_map': { + 'resource_id': 'path', + 'message_channel_id_list': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.set_resource_reviewers_endpoint = _Endpoint( + settings={ + 'response_type': ([str],), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/resources/{resource_id}/reviewers', + 'operation_id': 'set_resource_reviewers', + 'http_method': 'PUT', + 'servers': None, + }, + params_map={ + 'all': [ + 'resource_id', + 'reviewer_id_list', + ], + 'required': [ + 'resource_id', + 'reviewer_id_list', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'resource_id': + (str,), + 'reviewer_id_list': + (ReviewerIDList,), + }, + 'attribute_map': { + 'resource_id': 'resource_id', + }, + 'location_map': { + 'resource_id': 'path', + 'reviewer_id_list': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + self.update_resources_endpoint = _Endpoint( + settings={ + 'response_type': (UpdateResourceInfoList,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/resources', + 'operation_id': 'update_resources', + 'http_method': 'PUT', + 'servers': None, + }, + params_map={ + 'all': [ + 'update_resource_info_list', + ], + 'required': [ + 'update_resource_info_list', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'update_resource_info_list': + (UpdateResourceInfoList,), + }, + 'attribute_map': { + }, + 'location_map': { + 'update_resource_info_list': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + + def delete_resource( + self, + resource_id, + **kwargs + ): + """delete_resource # noqa: E501 + + Deletes a resource. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_resource(resource_id, async_req=True) + >>> result = thread.get() + + Args: + resource_id (str): The ID of the resource. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['resource_id'] = \ + resource_id + return self.delete_resource_endpoint.call_with_http_info(**kwargs) + + def get_resource_message_channels( + self, + resource_id, + **kwargs + ): + """get_resource_message_channels # noqa: E501 + + Gets the list of message channels attached to a resource. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_resource_message_channels(resource_id, async_req=True) + >>> result = thread.get() + + Args: + resource_id (str): The ID of the resource. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + MessageChannelList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['resource_id'] = \ + resource_id + return self.get_resource_message_channels_endpoint.call_with_http_info(**kwargs) + + def get_resource_reviewers( + self, + resource_id, + **kwargs + ): + """get_resource_reviewers # noqa: E501 + + Gets the list of team/user IDs of the reviewers for a resource. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_resource_reviewers(resource_id, async_req=True) + >>> result = thread.get() + + Args: + resource_id (str): The ID of the resource. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [str] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['resource_id'] = \ + resource_id + return self.get_resource_reviewers_endpoint.call_with_http_info(**kwargs) + + def get_resource_tags( + self, + resource_id, + **kwargs + ): + """get_resource_tags # noqa: E501 + + Returns all tags applied to the resource. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_resource_tags(resource_id, async_req=True) + >>> result = thread.get() + + Args: + resource_id (str): The ID of the resource whose tags to return. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + TagsList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['resource_id'] = \ + resource_id + return self.get_resource_tags_endpoint.call_with_http_info(**kwargs) + + def get_resources( + self, + **kwargs + ): + """get_resources # noqa: E501 + + Returns a list of resources for your organization. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_resources(async_req=True) + >>> result = thread.get() + + + Keyword Args: + cursor (str): The pagination cursor value.. [optional] + page_size (int): Number of results to return per page. Default is 200.. [optional] + resource_type_filter (ResourceTypeEnum): The resource type to filter by.. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PaginatedResourcesList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + return self.get_resources_endpoint.call_with_http_info(**kwargs) def resource_user_access_status_retrieve( self, @@ -198,7 +1037,7 @@ def resource_user_access_status_retrieve( Keyword Args: access_level_remote_id (str): The remote ID of the access level that you wish to query for the resource. If omitted, the default access level remote ID value (empty string) is used.. [optional] cursor (str): The pagination cursor value.. [optional] - page_size (int): Number of results to return per page.. [optional] + page_size (int): Number of results to return per page. Default is 200.. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -214,6 +1053,13 @@ def resource_user_access_status_retrieve( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -242,6 +1088,11 @@ def resource_user_access_status_retrieve( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['resource_id'] = \ resource_id @@ -269,7 +1120,7 @@ def resource_users( Keyword Args: access_level_remote_id (str): The remote ID of the access level that you wish to query for the resource. If omitted, the default access level remote ID value (empty string) is used.. [optional] cursor (str): The pagination cursor value.. [optional] - page_size (int): Number of results to return per page.. [optional] + page_size (int): Number of results to return per page. Default is 200.. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -285,6 +1136,13 @@ def resource_users( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -313,8 +1171,255 @@ def resource_users( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['resource_id'] = \ resource_id return self.resource_users_endpoint.call_with_http_info(**kwargs) + def set_resource_message_channels( + self, + resource_id, + message_channel_id_list, + **kwargs + ): + """set_resource_message_channels # noqa: E501 + + Sets the list of message channels attached to a resource. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.set_resource_message_channels(resource_id, message_channel_id_list, async_req=True) + >>> result = thread.get() + + Args: + resource_id (str): The ID of the resource. + message_channel_id_list (MessageChannelIDList): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [str] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['resource_id'] = \ + resource_id + kwargs['message_channel_id_list'] = \ + message_channel_id_list + return self.set_resource_message_channels_endpoint.call_with_http_info(**kwargs) + + def set_resource_reviewers( + self, + resource_id, + reviewer_id_list, + **kwargs + ): + """set_resource_reviewers # noqa: E501 + + Sets the list of reviewers for a resource. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.set_resource_reviewers(resource_id, reviewer_id_list, async_req=True) + >>> result = thread.get() + + Args: + resource_id (str): The ID of the resource. + reviewer_id_list (ReviewerIDList): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + [str] + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['resource_id'] = \ + resource_id + kwargs['reviewer_id_list'] = \ + reviewer_id_list + return self.set_resource_reviewers_endpoint.call_with_http_info(**kwargs) + + def update_resources( + self, + update_resource_info_list, + **kwargs + ): + """update_resources # noqa: E501 + + Bulk updates a list of resources. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_resources(update_resource_info_list, async_req=True) + >>> result = thread.get() + + Args: + update_resource_info_list (UpdateResourceInfoList): Resources to be updated + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + UpdateResourceInfoList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['update_resource_info_list'] = \ + update_resource_info_list + return self.update_resources_endpoint.call_with_http_info(**kwargs) + diff --git a/opal/api/sessions_api.py b/opal/api/sessions_api.py index 3871af7..5a59657 100644 --- a/opal/api/sessions_api.py +++ b/opal/api/sessions_api.py @@ -127,6 +127,13 @@ def sessions( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -155,6 +162,11 @@ def sessions( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['resource_id'] = \ resource_id diff --git a/opal/api/tags_api.py b/opal/api/tags_api.py new file mode 100644 index 0000000..df9033e --- /dev/null +++ b/opal/api/tags_api.py @@ -0,0 +1,1149 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.api_client import ApiClient, Endpoint as _Endpoint +from opal.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from opal.model.tag import Tag + + +class TagsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.add_group_tag_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/tags/{tag_id}/groups/{group_id}', + 'operation_id': 'add_group_tag', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'tag_id', + 'group_id', + ], + 'required': [ + 'tag_id', + 'group_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tag_id': + (str,), + 'group_id': + (str,), + }, + 'attribute_map': { + 'tag_id': 'tag_id', + 'group_id': 'group_id', + }, + 'location_map': { + 'tag_id': 'path', + 'group_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client + ) + self.add_resource_tag_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/tags/{tag_id}/resources/{resource_id}', + 'operation_id': 'add_resource_tag', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'tag_id', + 'resource_id', + ], + 'required': [ + 'tag_id', + 'resource_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tag_id': + (str,), + 'resource_id': + (str,), + }, + 'attribute_map': { + 'tag_id': 'tag_id', + 'resource_id': 'resource_id', + }, + 'location_map': { + 'tag_id': 'path', + 'resource_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client + ) + self.add_user_tag_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/tags/{tag_id}/users/{user_id}', + 'operation_id': 'add_user_tag', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'tag_id', + 'user_id', + ], + 'required': [ + 'tag_id', + 'user_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tag_id': + (str,), + 'user_id': + (str,), + }, + 'attribute_map': { + 'tag_id': 'tag_id', + 'user_id': 'user_id', + }, + 'location_map': { + 'tag_id': 'path', + 'user_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client + ) + self.create_tag_endpoint = _Endpoint( + settings={ + 'response_type': (Tag,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/tag', + 'operation_id': 'create_tag', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'tag_key', + 'tag_value', + 'tag_owner_team_id', + ], + 'required': [ + 'tag_key', + 'tag_value', + 'tag_owner_team_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tag_key': + (str,), + 'tag_value': + (str,), + 'tag_owner_team_id': + (str,), + }, + 'attribute_map': { + 'tag_key': 'tag_key', + 'tag_value': 'tag_value', + 'tag_owner_team_id': 'tag_owner_team_id', + }, + 'location_map': { + 'tag_key': 'query', + 'tag_value': 'query', + 'tag_owner_team_id': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.get_tag_endpoint = _Endpoint( + settings={ + 'response_type': (Tag,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/tag', + 'operation_id': 'get_tag', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'tag_key', + 'tag_value', + ], + 'required': [ + 'tag_key', + 'tag_value', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tag_key': + (str,), + 'tag_value': + (str,), + }, + 'attribute_map': { + 'tag_key': 'tag_key', + 'tag_value': 'tag_value', + }, + 'location_map': { + 'tag_key': 'query', + 'tag_value': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.remove_group_tag_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/tags/{tag_id}/groups/{group_id}', + 'operation_id': 'remove_group_tag', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'tag_id', + 'group_id', + ], + 'required': [ + 'tag_id', + 'group_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tag_id': + (str,), + 'group_id': + (str,), + }, + 'attribute_map': { + 'tag_id': 'tag_id', + 'group_id': 'group_id', + }, + 'location_map': { + 'tag_id': 'path', + 'group_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client + ) + self.remove_resource_tag_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/tags/{tag_id}/resources/{resource_id}', + 'operation_id': 'remove_resource_tag', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'tag_id', + 'resource_id', + ], + 'required': [ + 'tag_id', + 'resource_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tag_id': + (str,), + 'resource_id': + (str,), + }, + 'attribute_map': { + 'tag_id': 'tag_id', + 'resource_id': 'resource_id', + }, + 'location_map': { + 'tag_id': 'path', + 'resource_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client + ) + self.remove_user_tag_endpoint = _Endpoint( + settings={ + 'response_type': None, + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/tags/{tag_id}/users/{user_id}', + 'operation_id': 'remove_user_tag', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'tag_id', + 'user_id', + ], + 'required': [ + 'tag_id', + 'user_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'tag_id': + (str,), + 'user_id': + (str,), + }, + 'attribute_map': { + 'tag_id': 'tag_id', + 'user_id': 'user_id', + }, + 'location_map': { + 'tag_id': 'path', + 'user_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [], + 'content_type': [], + }, + api_client=api_client + ) + + def add_group_tag( + self, + tag_id, + group_id, + **kwargs + ): + """add_group_tag # noqa: E501 + + Applies a tag to a group. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.add_group_tag(tag_id, group_id, async_req=True) + >>> result = thread.get() + + Args: + tag_id (str): The ID of the tag to apply. + group_id (str): The ID of the group to apply the tag to. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tag_id'] = \ + tag_id + kwargs['group_id'] = \ + group_id + return self.add_group_tag_endpoint.call_with_http_info(**kwargs) + + def add_resource_tag( + self, + tag_id, + resource_id, + **kwargs + ): + """add_resource_tag # noqa: E501 + + Applies a tag to a resource. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.add_resource_tag(tag_id, resource_id, async_req=True) + >>> result = thread.get() + + Args: + tag_id (str): The ID of the tag to apply. + resource_id (str): The ID of the resource to apply the tag to. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tag_id'] = \ + tag_id + kwargs['resource_id'] = \ + resource_id + return self.add_resource_tag_endpoint.call_with_http_info(**kwargs) + + def add_user_tag( + self, + tag_id, + user_id, + **kwargs + ): + """add_user_tag # noqa: E501 + + Applies a tag to a user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.add_user_tag(tag_id, user_id, async_req=True) + >>> result = thread.get() + + Args: + tag_id (str): The ID of the tag to apply. + user_id (str): The ID of the user to apply the tag to. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tag_id'] = \ + tag_id + kwargs['user_id'] = \ + user_id + return self.add_user_tag_endpoint.call_with_http_info(**kwargs) + + def create_tag( + self, + tag_key, + tag_value, + tag_owner_team_id, + **kwargs + ): + """create_tag # noqa: E501 + + Creates a tag with the given key and value. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_tag(tag_key, tag_value, tag_owner_team_id, async_req=True) + >>> result = thread.get() + + Args: + tag_key (str): The key of the tag to create. + tag_value (str): The value of the tag to create. + tag_owner_team_id (str): The ID of the team that owns the tag. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Tag + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tag_key'] = \ + tag_key + kwargs['tag_value'] = \ + tag_value + kwargs['tag_owner_team_id'] = \ + tag_owner_team_id + return self.create_tag_endpoint.call_with_http_info(**kwargs) + + def get_tag( + self, + tag_key, + tag_value, + **kwargs + ): + """get_tag # noqa: E501 + + Gets a tag with the given key and value. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_tag(tag_key, tag_value, async_req=True) + >>> result = thread.get() + + Args: + tag_key (str): The key of the tag to get. + tag_value (str): The value of the tag to get. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Tag + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tag_key'] = \ + tag_key + kwargs['tag_value'] = \ + tag_value + return self.get_tag_endpoint.call_with_http_info(**kwargs) + + def remove_group_tag( + self, + tag_id, + group_id, + **kwargs + ): + """remove_group_tag # noqa: E501 + + Removes a tag from a group. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.remove_group_tag(tag_id, group_id, async_req=True) + >>> result = thread.get() + + Args: + tag_id (str): The ID of the tag to remove. + group_id (str): The ID of the group to remove the tag from. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tag_id'] = \ + tag_id + kwargs['group_id'] = \ + group_id + return self.remove_group_tag_endpoint.call_with_http_info(**kwargs) + + def remove_resource_tag( + self, + tag_id, + resource_id, + **kwargs + ): + """remove_resource_tag # noqa: E501 + + Removes a tag from a resource. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.remove_resource_tag(tag_id, resource_id, async_req=True) + >>> result = thread.get() + + Args: + tag_id (str): The ID of the tag to remove. + resource_id (str): The ID of the resource to remove the tag from. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tag_id'] = \ + tag_id + kwargs['resource_id'] = \ + resource_id + return self.remove_resource_tag_endpoint.call_with_http_info(**kwargs) + + def remove_user_tag( + self, + tag_id, + user_id, + **kwargs + ): + """remove_user_tag # noqa: E501 + + Removes a tag from a user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.remove_user_tag(tag_id, user_id, async_req=True) + >>> result = thread.get() + + Args: + tag_id (str): The ID of the tag to remove. + user_id (str): The ID of the user to remove the tag from. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['tag_id'] = \ + tag_id + kwargs['user_id'] = \ + user_id + return self.remove_user_tag_endpoint.call_with_http_info(**kwargs) + diff --git a/opal/api/users_api.py b/opal/api/users_api.py index 6904eb9..73b8290 100644 --- a/opal/api/users_api.py +++ b/opal/api/users_api.py @@ -22,6 +22,7 @@ none_type, validate_and_convert_types ) +from opal.model.tags_list import TagsList from opal.model.user import User @@ -36,6 +37,57 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client + self.get_user_tags_endpoint = _Endpoint( + settings={ + 'response_type': (TagsList,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/users/{user_id}/tags', + 'operation_id': 'get_user_tags', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'user_id', + ], + 'required': [ + 'user_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'user_id': + (str,), + }, + 'attribute_map': { + 'user_id': 'user_id', + }, + 'location_map': { + 'user_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) self.user_endpoint = _Endpoint( settings={ 'response_type': (User,), @@ -91,6 +143,84 @@ def __init__(self, api_client=None): api_client=api_client ) + def get_user_tags( + self, + user_id, + **kwargs + ): + """get_user_tags # noqa: E501 + + Returns all tags applied to the user. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_user_tags(user_id, async_req=True) + >>> result = thread.get() + + Args: + user_id (str): The ID of the user whose tags to return. + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + TagsList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['user_id'] = \ + user_id + return self.get_user_tags_endpoint.call_with_http_info(**kwargs) + def user( self, **kwargs @@ -123,6 +253,13 @@ def user( _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -151,6 +288,11 @@ def user( kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.user_endpoint.call_with_http_info(**kwargs) diff --git a/opal/api_client.py b/opal/api_client.py index b0f9227..7594e40 100644 --- a/opal/api_client.py +++ b/opal/api_client.py @@ -132,7 +132,8 @@ def __call_api( _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None ): config = self.configuration @@ -573,10 +574,12 @@ def select_header_accept(self, accepts): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -584,6 +587,11 @@ def select_header_content_type(self, content_types): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: @@ -665,7 +673,9 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_request_timeout', '_return_http_data_only', '_check_input_type', - '_check_return_type' + '_check_return_type', + '_content_type', + '_spec_property_naming' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -678,7 +688,9 @@ def __init__(self, settings=None, params_map=None, root_map=None, '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), - '_check_return_type': (bool,) + '_check_return_type': (bool,), + '_spec_property_naming': (bool,), + '_content_type': (none_type, str) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -714,7 +726,7 @@ def __validate_inputs(self, kwargs): value, self.openapi_types[key], [key], - False, + kwargs['_spec_property_naming'], kwargs['_check_input_type'], configuration=self.api_client.configuration ) @@ -742,11 +754,11 @@ def __gather_params(self, kwargs): base_name = self.attribute_map[param_name] if (param_location == 'form' and self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] + params['file'][base_name] = [param_value] elif (param_location == 'form' and self.openapi_types[param_name] == ([file_type],)): # param_value is already a list - params['file'][param_name] = param_value + params['file'][base_name] = param_value elif param_location in {'form', 'query'}: param_value_full = (base_name, param_value) params[param_location].append(param_value_full) @@ -825,12 +837,16 @@ def call_with_http_info(self, **kwargs): params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], diff --git a/opal/apis/__init__.py b/opal/apis/__init__.py index 73d2443..34d3569 100644 --- a/opal/apis/__init__.py +++ b/opal/apis/__init__.py @@ -15,6 +15,8 @@ # Import APIs into API package: from opal.api.events_api import EventsApi +from opal.api.groups_api import GroupsApi from opal.api.resources_api import ResourcesApi from opal.api.sessions_api import SessionsApi +from opal.api.tags_api import TagsApi from opal.api.users_api import UsersApi diff --git a/opal/configuration.py b/opal/configuration.py index ef6839e..6ccff20 100644 --- a/opal/configuration.py +++ b/opal/configuration.py @@ -181,6 +181,9 @@ def __init__(self, host=None, self.proxy = None """Proxy URL """ + self.no_proxy = None + """bypass proxy for host in the no_proxy list. + """ self.proxy_headers = None """Proxy headers """ diff --git a/opal/model/entity_type_enum.py b/opal/model/entity_type_enum.py new file mode 100644 index 0000000..4fdeedb --- /dev/null +++ b/opal/model/entity_type_enum.py @@ -0,0 +1,284 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + + +class EntityTypeEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'GROUP': "GROUP", + 'RESOURCE': "RESOURCE", + 'USER': "USER", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """EntityTypeEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of an entity.., must be one of ["GROUP", "RESOURCE", "USER", ] # noqa: E501 + + Keyword Args: + value (str): The type of an entity.., must be one of ["GROUP", "RESOURCE", "USER", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """EntityTypeEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of an entity.., must be one of ["GROUP", "RESOURCE", "USER", ] # noqa: E501 + + Keyword Args: + value (str): The type of an entity.., must be one of ["GROUP", "RESOURCE", "USER", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/opal/model/event.py b/opal/model/event.py index 79ad8ac..5ec8f0d 100644 --- a/opal/model/event.py +++ b/opal/model/event.py @@ -25,8 +25,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from opal.exceptions import ApiAttributeError diff --git a/opal/model/group.py b/opal/model/group.py new file mode 100644 index 0000000..65a77b9 --- /dev/null +++ b/opal/model/group.py @@ -0,0 +1,312 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + +def lazy_import(): + from opal.model.group_function_enum import GroupFunctionEnum + from opal.model.group_type_enum import GroupTypeEnum + from opal.model.visibility_enum import VisibilityEnum + globals()['GroupFunctionEnum'] = GroupFunctionEnum + globals()['GroupTypeEnum'] = GroupTypeEnum + globals()['VisibilityEnum'] = VisibilityEnum + + +class Group(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'group_id': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + 'owner_team_id': (str,), # noqa: E501 + 'group_function': (GroupFunctionEnum,), # noqa: E501 + 'group_type': (GroupTypeEnum,), # noqa: E501 + 'visibility': (VisibilityEnum,), # noqa: E501 + 'max_duration': (int,), # noqa: E501 + 'require_manager_approval': (bool,), # noqa: E501 + 'require_support_ticket': (bool,), # noqa: E501 + 'folder_id': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'group_id': 'group_id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'description': 'description', # noqa: E501 + 'owner_team_id': 'owner_team_id', # noqa: E501 + 'group_function': 'group_function', # noqa: E501 + 'group_type': 'group_type', # noqa: E501 + 'visibility': 'visibility', # noqa: E501 + 'max_duration': 'max_duration', # noqa: E501 + 'require_manager_approval': 'require_manager_approval', # noqa: E501 + 'require_support_ticket': 'require_support_ticket', # noqa: E501 + 'folder_id': 'folder_id', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, group_id, *args, **kwargs): # noqa: E501 + """Group - a model defined in OpenAPI + + Args: + group_id (str): The ID of the group. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name of the group.. [optional] # noqa: E501 + description (str): A description of the group.. [optional] # noqa: E501 + owner_team_id (str): The ID of the owning team of the group.. [optional] # noqa: E501 + group_function (GroupFunctionEnum): [optional] # noqa: E501 + group_type (GroupTypeEnum): [optional] # noqa: E501 + visibility (VisibilityEnum): [optional] # noqa: E501 + max_duration (int): The maximum duration access to the group can be requested for (in minutes).. [optional] # noqa: E501 + require_manager_approval (bool): A bool representing whether or not access requests to the group require manager approval.. [optional] # noqa: E501 + require_support_ticket (bool): A bool representing whether or not access requests to the group require a support ticket.. [optional] # noqa: E501 + folder_id (str): The ID of the folder that the group is located in.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.group_id = group_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, group_id, *args, **kwargs): # noqa: E501 + """Group - a model defined in OpenAPI + + Args: + group_id (str): The ID of the group. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name of the group.. [optional] # noqa: E501 + description (str): A description of the group.. [optional] # noqa: E501 + owner_team_id (str): The ID of the owning team of the group.. [optional] # noqa: E501 + group_function (GroupFunctionEnum): [optional] # noqa: E501 + group_type (GroupTypeEnum): [optional] # noqa: E501 + visibility (VisibilityEnum): [optional] # noqa: E501 + max_duration (int): The maximum duration access to the group can be requested for (in minutes).. [optional] # noqa: E501 + require_manager_approval (bool): A bool representing whether or not access requests to the group require manager approval.. [optional] # noqa: E501 + require_support_ticket (bool): A bool representing whether or not access requests to the group require a support ticket.. [optional] # noqa: E501 + folder_id (str): The ID of the folder that the group is located in.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.group_id = group_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/group_function_enum.py b/opal/model/group_function_enum.py new file mode 100644 index 0000000..b3d820d --- /dev/null +++ b/opal/model/group_function_enum.py @@ -0,0 +1,285 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + + +class GroupFunctionEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'REGULAR': "REGULAR", + 'ON_CALL': "ON_CALL", + 'TEAM': "TEAM", + 'UNKNOWN': "UNKNOWN", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """GroupFunctionEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The function type of the group.., must be one of ["REGULAR", "ON_CALL", "TEAM", "UNKNOWN", ] # noqa: E501 + + Keyword Args: + value (str): The function type of the group.., must be one of ["REGULAR", "ON_CALL", "TEAM", "UNKNOWN", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """GroupFunctionEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The function type of the group.., must be one of ["REGULAR", "ON_CALL", "TEAM", "UNKNOWN", ] # noqa: E501 + + Keyword Args: + value (str): The function type of the group.., must be one of ["REGULAR", "ON_CALL", "TEAM", "UNKNOWN", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/opal/model/group_type_enum.py b/opal/model/group_type_enum.py new file mode 100644 index 0000000..246d78d --- /dev/null +++ b/opal/model/group_type_enum.py @@ -0,0 +1,288 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + + +class GroupTypeEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'ACTIVE_DIRECTORY_GROUP': "ACTIVE_DIRECTORY_GROUP", + 'DUO_GROUP': "DUO_GROUP", + 'GIT_HUB_TEAM': "GIT_HUB_TEAM", + 'GOOGLE_GROUPS_GROUP': "GOOGLE_GROUPS_GROUP", + 'LDAP_GROUP': "LDAP_GROUP", + 'OKTA_GROUP': "OKTA_GROUP", + 'OPAL_GROUP': "OPAL_GROUP", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """GroupTypeEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of the group.., must be one of ["ACTIVE_DIRECTORY_GROUP", "DUO_GROUP", "GIT_HUB_TEAM", "GOOGLE_GROUPS_GROUP", "LDAP_GROUP", "OKTA_GROUP", "OPAL_GROUP", ] # noqa: E501 + + Keyword Args: + value (str): The type of the group.., must be one of ["ACTIVE_DIRECTORY_GROUP", "DUO_GROUP", "GIT_HUB_TEAM", "GOOGLE_GROUPS_GROUP", "LDAP_GROUP", "OKTA_GROUP", "OPAL_GROUP", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """GroupTypeEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of the group.., must be one of ["ACTIVE_DIRECTORY_GROUP", "DUO_GROUP", "GIT_HUB_TEAM", "GOOGLE_GROUPS_GROUP", "LDAP_GROUP", "OKTA_GROUP", "OPAL_GROUP", ] # noqa: E501 + + Keyword Args: + value (str): The type of the group.., must be one of ["ACTIVE_DIRECTORY_GROUP", "DUO_GROUP", "GIT_HUB_TEAM", "GOOGLE_GROUPS_GROUP", "LDAP_GROUP", "OKTA_GROUP", "OPAL_GROUP", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/opal/model/message_channel.py b/opal/model/message_channel.py new file mode 100644 index 0000000..8b31e23 --- /dev/null +++ b/opal/model/message_channel.py @@ -0,0 +1,290 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + +def lazy_import(): + from opal.model.message_channel_provider_enum import MessageChannelProviderEnum + from opal.model.message_channel_type_enum import MessageChannelTypeEnum + globals()['MessageChannelProviderEnum'] = MessageChannelProviderEnum + globals()['MessageChannelTypeEnum'] = MessageChannelTypeEnum + + +class MessageChannel(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'message_channel_id': (str,), # noqa: E501 + 'third_party_provider': (MessageChannelProviderEnum,), # noqa: E501 + 'remote_id': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'message_channel_type': (MessageChannelTypeEnum,), # noqa: E501 + 'is_private': (bool,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'message_channel_id': 'message_channel_id', # noqa: E501 + 'third_party_provider': 'third_party_provider', # noqa: E501 + 'remote_id': 'remote_id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'message_channel_type': 'message_channel_type', # noqa: E501 + 'is_private': 'is_private', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, message_channel_id, *args, **kwargs): # noqa: E501 + """MessageChannel - a model defined in OpenAPI + + Args: + message_channel_id (str): The ID of the message channel. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + third_party_provider (MessageChannelProviderEnum): [optional] # noqa: E501 + remote_id (str): The remote ID of the message channel. [optional] # noqa: E501 + name (str): The name of the message channel.. [optional] # noqa: E501 + message_channel_type (MessageChannelTypeEnum): [optional] # noqa: E501 + is_private (bool): A bool representing whether or not the message channel is private.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.message_channel_id = message_channel_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, message_channel_id, *args, **kwargs): # noqa: E501 + """MessageChannel - a model defined in OpenAPI + + Args: + message_channel_id (str): The ID of the message channel. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + third_party_provider (MessageChannelProviderEnum): [optional] # noqa: E501 + remote_id (str): The remote ID of the message channel. [optional] # noqa: E501 + name (str): The name of the message channel.. [optional] # noqa: E501 + message_channel_type (MessageChannelTypeEnum): [optional] # noqa: E501 + is_private (bool): A bool representing whether or not the message channel is private.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.message_channel_id = message_channel_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/message_channel_id_list.py b/opal/model/message_channel_id_list.py new file mode 100644 index 0000000..492d1f5 --- /dev/null +++ b/opal/model/message_channel_id_list.py @@ -0,0 +1,262 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + + +class MessageChannelIDList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'message_channel_ids': ([str],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'message_channel_ids': 'message_channel_ids', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, message_channel_ids, *args, **kwargs): # noqa: E501 + """MessageChannelIDList - a model defined in OpenAPI + + Args: + message_channel_ids ([str]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.message_channel_ids = message_channel_ids + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, message_channel_ids, *args, **kwargs): # noqa: E501 + """MessageChannelIDList - a model defined in OpenAPI + + Args: + message_channel_ids ([str]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.message_channel_ids = message_channel_ids + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/message_channel_list.py b/opal/model/message_channel_list.py new file mode 100644 index 0000000..8cce308 --- /dev/null +++ b/opal/model/message_channel_list.py @@ -0,0 +1,268 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + +def lazy_import(): + from opal.model.message_channel import MessageChannel + globals()['MessageChannel'] = MessageChannel + + +class MessageChannelList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'channels': ([MessageChannel],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'channels': 'channels', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, channels, *args, **kwargs): # noqa: E501 + """MessageChannelList - a model defined in OpenAPI + + Args: + channels ([MessageChannel]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channels = channels + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, channels, *args, **kwargs): # noqa: E501 + """MessageChannelList - a model defined in OpenAPI + + Args: + channels ([MessageChannel]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.channels = channels + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/message_channel_provider_enum.py b/opal/model/message_channel_provider_enum.py new file mode 100644 index 0000000..7a0bfab --- /dev/null +++ b/opal/model/message_channel_provider_enum.py @@ -0,0 +1,274 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + + +class MessageChannelProviderEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'SLACK': "SLACK", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """MessageChannelProviderEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The third party provider of the message channel.. if omitted defaults to "SLACK", must be one of ["SLACK", ] # noqa: E501 + + Keyword Args: + value (str): The third party provider of the message channel.. if omitted defaults to "SLACK", must be one of ["SLACK", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = "SLACK" + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """MessageChannelProviderEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The third party provider of the message channel.. if omitted defaults to "SLACK", must be one of ["SLACK", ] # noqa: E501 + + Keyword Args: + value (str): The third party provider of the message channel.. if omitted defaults to "SLACK", must be one of ["SLACK", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = "SLACK" + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/opal/model/message_channel_type_enum.py b/opal/model/message_channel_type_enum.py new file mode 100644 index 0000000..dc8a17a --- /dev/null +++ b/opal/model/message_channel_type_enum.py @@ -0,0 +1,284 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + + +class MessageChannelTypeEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'AUDIT': "AUDIT", + 'REVIEWER': "REVIEWER", + 'MONITOR': "MONITOR", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """MessageChannelTypeEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of the message channel.., must be one of ["AUDIT", "REVIEWER", "MONITOR", ] # noqa: E501 + + Keyword Args: + value (str): The type of the message channel.., must be one of ["AUDIT", "REVIEWER", "MONITOR", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """MessageChannelTypeEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of the message channel.., must be one of ["AUDIT", "REVIEWER", "MONITOR", ] # noqa: E501 + + Keyword Args: + value (str): The type of the message channel.., must be one of ["AUDIT", "REVIEWER", "MONITOR", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/opal/model/new_admin_id_list.py b/opal/model/new_admin_id_list.py new file mode 100644 index 0000000..4eee33b --- /dev/null +++ b/opal/model/new_admin_id_list.py @@ -0,0 +1,256 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + + +class NewAdminIDList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'admin_ids': ([str],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'admin_ids': 'admin_ids', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NewAdminIDList - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + admin_ids ([str]): The IDs of admins to set for the group if converting to a team. Required when converting from Group to Team.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """NewAdminIDList - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + admin_ids ([str]): The IDs of admins to set for the group if converting to a team. Required when converting from Group to Team.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/paginated_event_list.py b/opal/model/paginated_event_list.py index 6210865..6b8efa4 100644 --- a/opal/model/paginated_event_list.py +++ b/opal/model/paginated_event_list.py @@ -25,8 +25,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from opal.exceptions import ApiAttributeError diff --git a/opal/model/paginated_groups_list.py b/opal/model/paginated_groups_list.py new file mode 100644 index 0000000..4696af5 --- /dev/null +++ b/opal/model/paginated_groups_list.py @@ -0,0 +1,276 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + +def lazy_import(): + from opal.model.group import Group + globals()['Group'] = Group + + +class PaginatedGroupsList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'results': ([Group],), # noqa: E501 + 'next': (str, none_type,), # noqa: E501 + 'previous': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'results': 'results', # noqa: E501 + 'next': 'next', # noqa: E501 + 'previous': 'previous', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, results, *args, **kwargs): # noqa: E501 + """PaginatedGroupsList - a model defined in OpenAPI + + Args: + results ([Group]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + next (str, none_type): The cursor with which to continue pagination if additional result pages exist.. [optional] # noqa: E501 + previous (str, none_type): The cursor used to obtain the current result page.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.results = results + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, results, *args, **kwargs): # noqa: E501 + """PaginatedGroupsList - a model defined in OpenAPI + + Args: + results ([Group]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + next (str, none_type): The cursor with which to continue pagination if additional result pages exist.. [optional] # noqa: E501 + previous (str, none_type): The cursor used to obtain the current result page.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.results = results + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/paginated_resource_user_list.py b/opal/model/paginated_resource_user_list.py index 3e94f58..57caef8 100644 --- a/opal/model/paginated_resource_user_list.py +++ b/opal/model/paginated_resource_user_list.py @@ -25,8 +25,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from opal.exceptions import ApiAttributeError diff --git a/opal/model/paginated_resources_list.py b/opal/model/paginated_resources_list.py new file mode 100644 index 0000000..5cc1848 --- /dev/null +++ b/opal/model/paginated_resources_list.py @@ -0,0 +1,276 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + +def lazy_import(): + from opal.model.resource import Resource + globals()['Resource'] = Resource + + +class PaginatedResourcesList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'results': ([Resource],), # noqa: E501 + 'next': (str, none_type,), # noqa: E501 + 'previous': (str, none_type,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'results': 'results', # noqa: E501 + 'next': 'next', # noqa: E501 + 'previous': 'previous', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, results, *args, **kwargs): # noqa: E501 + """PaginatedResourcesList - a model defined in OpenAPI + + Args: + results ([Resource]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + next (str, none_type): The cursor with which to continue pagination if additional result pages exist.. [optional] # noqa: E501 + previous (str, none_type): The cursor used to obtain the current result page.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.results = results + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, results, *args, **kwargs): # noqa: E501 + """PaginatedResourcesList - a model defined in OpenAPI + + Args: + results ([Resource]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + next (str, none_type): The cursor with which to continue pagination if additional result pages exist.. [optional] # noqa: E501 + previous (str, none_type): The cursor used to obtain the current result page.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.results = results + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/resource.py b/opal/model/resource.py new file mode 100644 index 0000000..4d87c13 --- /dev/null +++ b/opal/model/resource.py @@ -0,0 +1,306 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + +def lazy_import(): + from opal.model.resource_type_enum import ResourceTypeEnum + from opal.model.visibility_enum import VisibilityEnum + globals()['ResourceTypeEnum'] = ResourceTypeEnum + globals()['VisibilityEnum'] = VisibilityEnum + + +class Resource(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'resource_id': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + 'owner_team_id': (str,), # noqa: E501 + 'visibility': (VisibilityEnum,), # noqa: E501 + 'resource_type': (ResourceTypeEnum,), # noqa: E501 + 'max_duration': (int,), # noqa: E501 + 'require_manager_approval': (bool,), # noqa: E501 + 'require_support_ticket': (bool,), # noqa: E501 + 'folder_id': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'resource_id': 'resource_id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'description': 'description', # noqa: E501 + 'owner_team_id': 'owner_team_id', # noqa: E501 + 'visibility': 'visibility', # noqa: E501 + 'resource_type': 'resource_type', # noqa: E501 + 'max_duration': 'max_duration', # noqa: E501 + 'require_manager_approval': 'require_manager_approval', # noqa: E501 + 'require_support_ticket': 'require_support_ticket', # noqa: E501 + 'folder_id': 'folder_id', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, resource_id, *args, **kwargs): # noqa: E501 + """Resource - a model defined in OpenAPI + + Args: + resource_id (str): The ID of the resource. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name of the resource.. [optional] # noqa: E501 + description (str): A description of the resource.. [optional] # noqa: E501 + owner_team_id (str): The ID of the owning team of the resource.. [optional] # noqa: E501 + visibility (VisibilityEnum): [optional] # noqa: E501 + resource_type (ResourceTypeEnum): [optional] # noqa: E501 + max_duration (int): The maximum duration access to the resource can be requested for (in minutes).. [optional] # noqa: E501 + require_manager_approval (bool): A bool representing whether or not access requests to the resource require manager approval.. [optional] # noqa: E501 + require_support_ticket (bool): A bool representing whether or not access requests to the resource require a support ticket.. [optional] # noqa: E501 + folder_id (str): The ID of the folder that the resource is located in.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.resource_id = resource_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, resource_id, *args, **kwargs): # noqa: E501 + """Resource - a model defined in OpenAPI + + Args: + resource_id (str): The ID of the resource. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name of the resource.. [optional] # noqa: E501 + description (str): A description of the resource.. [optional] # noqa: E501 + owner_team_id (str): The ID of the owning team of the resource.. [optional] # noqa: E501 + visibility (VisibilityEnum): [optional] # noqa: E501 + resource_type (ResourceTypeEnum): [optional] # noqa: E501 + max_duration (int): The maximum duration access to the resource can be requested for (in minutes).. [optional] # noqa: E501 + require_manager_approval (bool): A bool representing whether or not access requests to the resource require manager approval.. [optional] # noqa: E501 + require_support_ticket (bool): A bool representing whether or not access requests to the resource require a support ticket.. [optional] # noqa: E501 + folder_id (str): The ID of the folder that the resource is located in.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.resource_id = resource_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/resource_access_level.py b/opal/model/resource_access_level.py index ff886d1..3aab599 100644 --- a/opal/model/resource_access_level.py +++ b/opal/model/resource_access_level.py @@ -25,8 +25,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from opal.exceptions import ApiAttributeError diff --git a/opal/model/resource_type_enum.py b/opal/model/resource_type_enum.py new file mode 100644 index 0000000..1b0e49c --- /dev/null +++ b/opal/model/resource_type_enum.py @@ -0,0 +1,308 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + + +class ResourceTypeEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'AWS_IAM_ROLE': "AWS_IAM_ROLE", + 'AWS_EC2_INSTANCE': "AWS_EC2_INSTANCE", + 'AWS_EKS_CLUSTER': "AWS_EKS_CLUSTER", + 'AWS_RDS_POSTGRES_INSTANCE': "AWS_RDS_POSTGRES_INSTANCE", + 'AWS_RDS_MYSQL_INSTANCE': "AWS_RDS_MYSQL_INSTANCE", + 'CUSTOM': "CUSTOM", + 'GCP_BUCKET': "GCP_BUCKET", + 'GCP_COMPUTE_INSTANCE': "GCP_COMPUTE_INSTANCE", + 'GCP_FOLDER': "GCP_FOLDER", + 'GCP_GKE_CLUSTER': "GCP_GKE_CLUSTER", + 'GCP_PROJECT': "GCP_PROJECT", + 'GCP_CLOUD_SQL_POSTGRES_INSTANCE': "GCP_CLOUD_SQL_POSTGRES_INSTANCE", + 'GCP_CLOUD_SQL_MYSQL_INSTANCE': "GCP_CLOUD_SQL_MYSQL_INSTANCE", + 'GIT_HUB_REPO': "GIT_HUB_REPO", + 'GOOGLE_WORKSPACE_ROLE': "GOOGLE_WORKSPACE_ROLE", + 'MONGO_INSTANCE': "MONGO_INSTANCE", + 'MONGO_ATLAS_INSTANCE': "MONGO_ATLAS_INSTANCE", + 'OKTA_APP': "OKTA_APP", + 'OKTA_ROLE': "OKTA_ROLE", + 'OPAL_ROLE': "OPAL_ROLE", + 'PAGERDUTY_ROLE': "PAGERDUTY_ROLE", + 'SALESFORCE_PERMISSION_SET': "SALESFORCE_PERMISSION_SET", + 'SALESFORCE_PROFILE': "SALESFORCE_PROFILE", + 'SALESFORCE_ROLE': "SALESFORCE_ROLE", + 'WORKDAY_ROLE': "WORKDAY_ROLE", + 'MYSQL_INSTANCE': "MYSQL_INSTANCE", + 'MARIADB_INSTANCE': "MARIADB_INSTANCE", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """ResourceTypeEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of the resource.., must be one of ["AWS_IAM_ROLE", "AWS_EC2_INSTANCE", "AWS_EKS_CLUSTER", "AWS_RDS_POSTGRES_INSTANCE", "AWS_RDS_MYSQL_INSTANCE", "CUSTOM", "GCP_BUCKET", "GCP_COMPUTE_INSTANCE", "GCP_FOLDER", "GCP_GKE_CLUSTER", "GCP_PROJECT", "GCP_CLOUD_SQL_POSTGRES_INSTANCE", "GCP_CLOUD_SQL_MYSQL_INSTANCE", "GIT_HUB_REPO", "GOOGLE_WORKSPACE_ROLE", "MONGO_INSTANCE", "MONGO_ATLAS_INSTANCE", "OKTA_APP", "OKTA_ROLE", "OPAL_ROLE", "PAGERDUTY_ROLE", "SALESFORCE_PERMISSION_SET", "SALESFORCE_PROFILE", "SALESFORCE_ROLE", "WORKDAY_ROLE", "MYSQL_INSTANCE", "MARIADB_INSTANCE", ] # noqa: E501 + + Keyword Args: + value (str): The type of the resource.., must be one of ["AWS_IAM_ROLE", "AWS_EC2_INSTANCE", "AWS_EKS_CLUSTER", "AWS_RDS_POSTGRES_INSTANCE", "AWS_RDS_MYSQL_INSTANCE", "CUSTOM", "GCP_BUCKET", "GCP_COMPUTE_INSTANCE", "GCP_FOLDER", "GCP_GKE_CLUSTER", "GCP_PROJECT", "GCP_CLOUD_SQL_POSTGRES_INSTANCE", "GCP_CLOUD_SQL_MYSQL_INSTANCE", "GIT_HUB_REPO", "GOOGLE_WORKSPACE_ROLE", "MONGO_INSTANCE", "MONGO_ATLAS_INSTANCE", "OKTA_APP", "OKTA_ROLE", "OPAL_ROLE", "PAGERDUTY_ROLE", "SALESFORCE_PERMISSION_SET", "SALESFORCE_PROFILE", "SALESFORCE_ROLE", "WORKDAY_ROLE", "MYSQL_INSTANCE", "MARIADB_INSTANCE", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ResourceTypeEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of the resource.., must be one of ["AWS_IAM_ROLE", "AWS_EC2_INSTANCE", "AWS_EKS_CLUSTER", "AWS_RDS_POSTGRES_INSTANCE", "AWS_RDS_MYSQL_INSTANCE", "CUSTOM", "GCP_BUCKET", "GCP_COMPUTE_INSTANCE", "GCP_FOLDER", "GCP_GKE_CLUSTER", "GCP_PROJECT", "GCP_CLOUD_SQL_POSTGRES_INSTANCE", "GCP_CLOUD_SQL_MYSQL_INSTANCE", "GIT_HUB_REPO", "GOOGLE_WORKSPACE_ROLE", "MONGO_INSTANCE", "MONGO_ATLAS_INSTANCE", "OKTA_APP", "OKTA_ROLE", "OPAL_ROLE", "PAGERDUTY_ROLE", "SALESFORCE_PERMISSION_SET", "SALESFORCE_PROFILE", "SALESFORCE_ROLE", "WORKDAY_ROLE", "MYSQL_INSTANCE", "MARIADB_INSTANCE", ] # noqa: E501 + + Keyword Args: + value (str): The type of the resource.., must be one of ["AWS_IAM_ROLE", "AWS_EC2_INSTANCE", "AWS_EKS_CLUSTER", "AWS_RDS_POSTGRES_INSTANCE", "AWS_RDS_MYSQL_INSTANCE", "CUSTOM", "GCP_BUCKET", "GCP_COMPUTE_INSTANCE", "GCP_FOLDER", "GCP_GKE_CLUSTER", "GCP_PROJECT", "GCP_CLOUD_SQL_POSTGRES_INSTANCE", "GCP_CLOUD_SQL_MYSQL_INSTANCE", "GIT_HUB_REPO", "GOOGLE_WORKSPACE_ROLE", "MONGO_INSTANCE", "MONGO_ATLAS_INSTANCE", "OKTA_APP", "OKTA_ROLE", "OPAL_ROLE", "PAGERDUTY_ROLE", "SALESFORCE_PERMISSION_SET", "SALESFORCE_PROFILE", "SALESFORCE_ROLE", "WORKDAY_ROLE", "MYSQL_INSTANCE", "MARIADB_INSTANCE", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/opal/model/resource_user.py b/opal/model/resource_user.py index 1916fc1..dda59e8 100644 --- a/opal/model/resource_user.py +++ b/opal/model/resource_user.py @@ -25,8 +25,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from opal.exceptions import ApiAttributeError diff --git a/opal/model/resource_user_access_status.py b/opal/model/resource_user_access_status.py index c3d9f89..f734f35 100644 --- a/opal/model/resource_user_access_status.py +++ b/opal/model/resource_user_access_status.py @@ -25,8 +25,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from opal.exceptions import ApiAttributeError diff --git a/opal/model/resource_user_access_status_enum.py b/opal/model/resource_user_access_status_enum.py index 2ae3649..b0cd46c 100644 --- a/opal/model/resource_user_access_status_enum.py +++ b/opal/model/resource_user_access_status_enum.py @@ -25,8 +25,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from opal.exceptions import ApiAttributeError diff --git a/opal/model/reviewer_id_list.py b/opal/model/reviewer_id_list.py new file mode 100644 index 0000000..b0f21fe --- /dev/null +++ b/opal/model/reviewer_id_list.py @@ -0,0 +1,262 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + + +class ReviewerIDList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'reviewer_ids': ([str],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'reviewer_ids': 'reviewer_ids', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, reviewer_ids, *args, **kwargs): # noqa: E501 + """ReviewerIDList - a model defined in OpenAPI + + Args: + reviewer_ids ([str]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.reviewer_ids = reviewer_ids + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, reviewer_ids, *args, **kwargs): # noqa: E501 + """ReviewerIDList - a model defined in OpenAPI + + Args: + reviewer_ids ([str]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.reviewer_ids = reviewer_ids + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/session.py b/opal/model/session.py index 487a439..9f116d4 100644 --- a/opal/model/session.py +++ b/opal/model/session.py @@ -25,8 +25,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from opal.exceptions import ApiAttributeError diff --git a/opal/model/sessions_list.py b/opal/model/sessions_list.py index 31b363a..e4177d5 100644 --- a/opal/model/sessions_list.py +++ b/opal/model/sessions_list.py @@ -25,8 +25,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from opal.exceptions import ApiAttributeError diff --git a/opal/model/tag.py b/opal/model/tag.py new file mode 100644 index 0000000..c650b52 --- /dev/null +++ b/opal/model/tag.py @@ -0,0 +1,286 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + + +class Tag(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'tag_id': (str,), # noqa: E501 + 'created_at': (datetime,), # noqa: E501 + 'updated_at': (datetime,), # noqa: E501 + 'user_creator_id': (str,), # noqa: E501 + 'owner_team_id': (str,), # noqa: E501 + 'key': (str,), # noqa: E501 + 'value': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'tag_id': 'tag_id', # noqa: E501 + 'created_at': 'created_at', # noqa: E501 + 'updated_at': 'updated_at', # noqa: E501 + 'user_creator_id': 'user_creator_id', # noqa: E501 + 'owner_team_id': 'owner_team_id', # noqa: E501 + 'key': 'key', # noqa: E501 + 'value': 'value', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, tag_id, *args, **kwargs): # noqa: E501 + """Tag - a model defined in OpenAPI + + Args: + tag_id (str): The ID of the tag. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime): The date the tag was created.. [optional] # noqa: E501 + updated_at (datetime): The date the tag was last updated.. [optional] # noqa: E501 + user_creator_id (str): The ID of the user that created the tag.. [optional] # noqa: E501 + owner_team_id (str): The ID of the team that owns the tag.. [optional] # noqa: E501 + key (str): The key of the tag.. [optional] # noqa: E501 + value (str): The value of the tag.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.tag_id = tag_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, tag_id, *args, **kwargs): # noqa: E501 + """Tag - a model defined in OpenAPI + + Args: + tag_id (str): The ID of the tag. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime): The date the tag was created.. [optional] # noqa: E501 + updated_at (datetime): The date the tag was last updated.. [optional] # noqa: E501 + user_creator_id (str): The ID of the user that created the tag.. [optional] # noqa: E501 + owner_team_id (str): The ID of the team that owns the tag.. [optional] # noqa: E501 + key (str): The key of the tag.. [optional] # noqa: E501 + value (str): The value of the tag.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.tag_id = tag_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/tags_list.py b/opal/model/tags_list.py new file mode 100644 index 0000000..c36168e --- /dev/null +++ b/opal/model/tags_list.py @@ -0,0 +1,268 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + +def lazy_import(): + from opal.model.tag import Tag + globals()['Tag'] = Tag + + +class TagsList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'tags': ([Tag],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'tags': 'tags', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, tags, *args, **kwargs): # noqa: E501 + """TagsList - a model defined in OpenAPI + + Args: + tags ([Tag]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.tags = tags + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, tags, *args, **kwargs): # noqa: E501 + """TagsList - a model defined in OpenAPI + + Args: + tags ([Tag]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.tags = tags + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/update_group_info.py b/opal/model/update_group_info.py new file mode 100644 index 0000000..f062785 --- /dev/null +++ b/opal/model/update_group_info.py @@ -0,0 +1,300 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + +def lazy_import(): + from opal.model.visibility_enum import VisibilityEnum + globals()['VisibilityEnum'] = VisibilityEnum + + +class UpdateGroupInfo(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'group_id': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + 'owner_team_id': (str,), # noqa: E501 + 'visibility': (VisibilityEnum,), # noqa: E501 + 'max_duration': (int,), # noqa: E501 + 'require_manager_approval': (bool,), # noqa: E501 + 'require_support_ticket': (bool,), # noqa: E501 + 'folder_id': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'group_id': 'group_id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'description': 'description', # noqa: E501 + 'owner_team_id': 'owner_team_id', # noqa: E501 + 'visibility': 'visibility', # noqa: E501 + 'max_duration': 'max_duration', # noqa: E501 + 'require_manager_approval': 'require_manager_approval', # noqa: E501 + 'require_support_ticket': 'require_support_ticket', # noqa: E501 + 'folder_id': 'folder_id', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, group_id, *args, **kwargs): # noqa: E501 + """UpdateGroupInfo - a model defined in OpenAPI + + Args: + group_id (str): The ID of the group. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name of the group.. [optional] # noqa: E501 + description (str): A description of the group.. [optional] # noqa: E501 + owner_team_id (str): The ID of the owning team of the group. Use empty string to remove owner. Required when converting from Team to Group.. [optional] # noqa: E501 + visibility (VisibilityEnum): [optional] # noqa: E501 + max_duration (int): The maximum duration access to the group can be requested for (in minutes). Use 0 to set to indefinite.. [optional] # noqa: E501 + require_manager_approval (bool): A bool representing whether or not access requests to the group require manager approval.. [optional] # noqa: E501 + require_support_ticket (bool): A bool representing whether or not access requests to the group require a support ticket.. [optional] # noqa: E501 + folder_id (str): The ID of the folder that the group is located in.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.group_id = group_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, group_id, *args, **kwargs): # noqa: E501 + """UpdateGroupInfo - a model defined in OpenAPI + + Args: + group_id (str): The ID of the group. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name of the group.. [optional] # noqa: E501 + description (str): A description of the group.. [optional] # noqa: E501 + owner_team_id (str): The ID of the owning team of the group. Use empty string to remove owner. Required when converting from Team to Group.. [optional] # noqa: E501 + visibility (VisibilityEnum): [optional] # noqa: E501 + max_duration (int): The maximum duration access to the group can be requested for (in minutes). Use 0 to set to indefinite.. [optional] # noqa: E501 + require_manager_approval (bool): A bool representing whether or not access requests to the group require manager approval.. [optional] # noqa: E501 + require_support_ticket (bool): A bool representing whether or not access requests to the group require a support ticket.. [optional] # noqa: E501 + folder_id (str): The ID of the folder that the group is located in.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.group_id = group_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/update_group_info_list.py b/opal/model/update_group_info_list.py new file mode 100644 index 0000000..40471d7 --- /dev/null +++ b/opal/model/update_group_info_list.py @@ -0,0 +1,268 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + +def lazy_import(): + from opal.model.update_group_info import UpdateGroupInfo + globals()['UpdateGroupInfo'] = UpdateGroupInfo + + +class UpdateGroupInfoList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'groups': ([UpdateGroupInfo],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'groups': 'groups', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, groups, *args, **kwargs): # noqa: E501 + """UpdateGroupInfoList - a model defined in OpenAPI + + Args: + groups ([UpdateGroupInfo]): A list of groups with information to update. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.groups = groups + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, groups, *args, **kwargs): # noqa: E501 + """UpdateGroupInfoList - a model defined in OpenAPI + + Args: + groups ([UpdateGroupInfo]): A list of groups with information to update. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.groups = groups + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/update_resource_info.py b/opal/model/update_resource_info.py new file mode 100644 index 0000000..6fc76dd --- /dev/null +++ b/opal/model/update_resource_info.py @@ -0,0 +1,300 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + +def lazy_import(): + from opal.model.visibility_enum import VisibilityEnum + globals()['VisibilityEnum'] = VisibilityEnum + + +class UpdateResourceInfo(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'resource_id': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + 'owner_team_id': (str,), # noqa: E501 + 'visibility': (VisibilityEnum,), # noqa: E501 + 'max_duration': (int,), # noqa: E501 + 'require_manager_approval': (bool,), # noqa: E501 + 'require_support_ticket': (bool,), # noqa: E501 + 'folder_id': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'resource_id': 'resource_id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'description': 'description', # noqa: E501 + 'owner_team_id': 'owner_team_id', # noqa: E501 + 'visibility': 'visibility', # noqa: E501 + 'max_duration': 'max_duration', # noqa: E501 + 'require_manager_approval': 'require_manager_approval', # noqa: E501 + 'require_support_ticket': 'require_support_ticket', # noqa: E501 + 'folder_id': 'folder_id', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, resource_id, *args, **kwargs): # noqa: E501 + """UpdateResourceInfo - a model defined in OpenAPI + + Args: + resource_id (str): The ID of the resource. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name of the resource.. [optional] # noqa: E501 + description (str): A description of the resource.. [optional] # noqa: E501 + owner_team_id (str): The ID of the owning team of the resource.. [optional] # noqa: E501 + visibility (VisibilityEnum): [optional] # noqa: E501 + max_duration (int): The maximum duration access to the resource can be requested for (in minutes). Use 0 to set to indefinite.. [optional] # noqa: E501 + require_manager_approval (bool): A bool representing whether or not access requests to the resource require manager approval.. [optional] # noqa: E501 + require_support_ticket (bool): A bool representing whether or not access requests to the resource require a support ticket.. [optional] # noqa: E501 + folder_id (str): The ID of the folder that the resource is located in.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.resource_id = resource_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, resource_id, *args, **kwargs): # noqa: E501 + """UpdateResourceInfo - a model defined in OpenAPI + + Args: + resource_id (str): The ID of the resource. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name of the resource.. [optional] # noqa: E501 + description (str): A description of the resource.. [optional] # noqa: E501 + owner_team_id (str): The ID of the owning team of the resource.. [optional] # noqa: E501 + visibility (VisibilityEnum): [optional] # noqa: E501 + max_duration (int): The maximum duration access to the resource can be requested for (in minutes). Use 0 to set to indefinite.. [optional] # noqa: E501 + require_manager_approval (bool): A bool representing whether or not access requests to the resource require manager approval.. [optional] # noqa: E501 + require_support_ticket (bool): A bool representing whether or not access requests to the resource require a support ticket.. [optional] # noqa: E501 + folder_id (str): The ID of the folder that the resource is located in.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.resource_id = resource_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/update_resource_info_list.py b/opal/model/update_resource_info_list.py new file mode 100644 index 0000000..0c7d802 --- /dev/null +++ b/opal/model/update_resource_info_list.py @@ -0,0 +1,268 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + +def lazy_import(): + from opal.model.update_resource_info import UpdateResourceInfo + globals()['UpdateResourceInfo'] = UpdateResourceInfo + + +class UpdateResourceInfoList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'resources': ([UpdateResourceInfo],), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'resources': 'resources', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, resources, *args, **kwargs): # noqa: E501 + """UpdateResourceInfoList - a model defined in OpenAPI + + Args: + resources ([UpdateResourceInfo]): A list of resources with information to update. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.resources = resources + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, resources, *args, **kwargs): # noqa: E501 + """UpdateResourceInfoList - a model defined in OpenAPI + + Args: + resources ([UpdateResourceInfo]): A list of resources with information to update. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.resources = resources + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/opal/model/user.py b/opal/model/user.py index 2340605..36a4b51 100644 --- a/opal/model/user.py +++ b/opal/model/user.py @@ -25,8 +25,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from opal.exceptions import ApiAttributeError diff --git a/opal/model/users_list.py b/opal/model/users_list.py index 3d4b4eb..df76e4a 100644 --- a/opal/model/users_list.py +++ b/opal/model/users_list.py @@ -25,8 +25,8 @@ file_type, none_type, validate_get_composed_info, + OpenApiModel ) -from ..model_utils import OpenApiModel from opal.exceptions import ApiAttributeError diff --git a/opal/model/visibility_enum.py b/opal/model/visibility_enum.py new file mode 100644 index 0000000..7636d35 --- /dev/null +++ b/opal/model/visibility_enum.py @@ -0,0 +1,283 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from opal.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from opal.exceptions import ApiAttributeError + + + +class VisibilityEnum(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'GLOBAL': "GLOBAL", + 'TEAM': "TEAM", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """VisibilityEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The visibility level of the entity.., must be one of ["GLOBAL", "TEAM", ] # noqa: E501 + + Keyword Args: + value (str): The visibility level of the entity.., must be one of ["GLOBAL", "TEAM", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """VisibilityEnum - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The visibility level of the entity.., must be one of ["GLOBAL", "TEAM", ] # noqa: E501 + + Keyword Args: + value (str): The visibility level of the entity.., must be one of ["GLOBAL", "TEAM", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/opal/model_utils.py b/opal/model_utils.py index a76be6b..18588c3 100644 --- a/opal/model_utils.py +++ b/opal/model_utils.py @@ -1658,6 +1658,7 @@ def model_to_dict(model_instance, serialize=True): attribute_map """ result = {} + extract_item = lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], '_data_store') else item model_instances = [model_instance] if model_instance._composed_schemas: @@ -1687,14 +1688,17 @@ def model_to_dict(model_instance, serialize=True): res.append(v) elif isinstance(v, ModelSimple): res.append(v.value) + elif isinstance(v, dict): + res.append(dict(map( + extract_item, + v.items() + ))) else: res.append(model_to_dict(v, serialize=serialize)) result[attr] = res elif isinstance(value, dict): result[attr] = dict(map( - lambda item: (item[0], - model_to_dict(item[1], serialize=serialize)) - if hasattr(item[1], '_data_store') else item, + extract_item, value.items() )) elif isinstance(value, ModelSimple): diff --git a/opal/models/__init__.py b/opal/models/__init__.py index 7f1991b..4c21644 100644 --- a/opal/models/__init__.py +++ b/opal/models/__init__.py @@ -9,14 +9,36 @@ # import sys # sys.setrecursionlimit(n) +from opal.model.entity_type_enum import EntityTypeEnum from opal.model.event import Event +from opal.model.group import Group +from opal.model.group_function_enum import GroupFunctionEnum +from opal.model.group_type_enum import GroupTypeEnum +from opal.model.message_channel import MessageChannel +from opal.model.message_channel_id_list import MessageChannelIDList +from opal.model.message_channel_list import MessageChannelList +from opal.model.message_channel_provider_enum import MessageChannelProviderEnum +from opal.model.message_channel_type_enum import MessageChannelTypeEnum +from opal.model.new_admin_id_list import NewAdminIDList from opal.model.paginated_event_list import PaginatedEventList +from opal.model.paginated_groups_list import PaginatedGroupsList from opal.model.paginated_resource_user_list import PaginatedResourceUserList +from opal.model.paginated_resources_list import PaginatedResourcesList +from opal.model.resource import Resource from opal.model.resource_access_level import ResourceAccessLevel +from opal.model.resource_type_enum import ResourceTypeEnum from opal.model.resource_user import ResourceUser from opal.model.resource_user_access_status import ResourceUserAccessStatus from opal.model.resource_user_access_status_enum import ResourceUserAccessStatusEnum +from opal.model.reviewer_id_list import ReviewerIDList from opal.model.session import Session from opal.model.sessions_list import SessionsList +from opal.model.tag import Tag +from opal.model.tags_list import TagsList +from opal.model.update_group_info import UpdateGroupInfo +from opal.model.update_group_info_list import UpdateGroupInfoList +from opal.model.update_resource_info import UpdateResourceInfo +from opal.model.update_resource_info_list import UpdateResourceInfoList from opal.model.user import User from opal.model.users_list import UsersList +from opal.model.visibility_enum import VisibilityEnum diff --git a/opal/rest.py b/opal/rest.py index b88fcca..d73027a 100644 --- a/opal/rest.py +++ b/opal/rest.py @@ -15,8 +15,10 @@ import re import ssl from urllib.parse import urlencode - +from urllib.parse import urlparse +from urllib.request import proxy_bypass_environment import urllib3 +import ipaddress from opal.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError @@ -73,7 +75,7 @@ def __init__(self, configuration, pools_size=4, maxsize=None): maxsize = 4 # https pool manager - if configuration.proxy: + if configuration.proxy and not should_bypass_proxies(configuration.host, no_proxy=configuration.no_proxy or ''): self.pool_manager = urllib3.ProxyManager( num_pools=pools_size, maxsize=maxsize, @@ -291,3 +293,55 @@ def PATCH(self, url, headers=None, query_params=None, post_params=None, _preload_content=_preload_content, _request_timeout=_request_timeout, body=body) + +# end of class RESTClientObject +def is_ipv4(target): + """ Test if IPv4 address or not + """ + try: + chk = ipaddress.IPv4Address(target) + return True + except ipaddress.AddressValueError: + return False + +def in_ipv4net(target, net): + """ Test if target belongs to given IPv4 network + """ + try: + nw = ipaddress.IPv4Network(net) + ip = ipaddress.IPv4Address(target) + if ip in nw: + return True + return False + except ipaddress.AddressValueError: + return False + except ipaddress.NetmaskValueError: + return False + +def should_bypass_proxies(url, no_proxy=None): + """ Yet another requests.should_bypass_proxies + Test if proxies should not be used for a particular url. + """ + + parsed = urlparse(url) + + # special cases + if parsed.hostname in [None, '']: + return True + + # special cases + if no_proxy in [None , '']: + return False + if no_proxy == '*': + return True + + no_proxy = no_proxy.lower().replace(' ',''); + entries = ( + host for host in no_proxy.split(',') if host + ) + + if is_ipv4(parsed.hostname): + for item in entries: + if in_ipv4net(parsed.hostname, item): + return True + return proxy_bypass_environment(parsed.hostname, {'no': no_proxy} ) diff --git a/test/test_entity_type_enum.py b/test/test_entity_type_enum.py new file mode 100644 index 0000000..66caaed --- /dev/null +++ b/test/test_entity_type_enum.py @@ -0,0 +1,36 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.entity_type_enum import EntityTypeEnum + + +class TestEntityTypeEnum(unittest.TestCase): + """EntityTypeEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testEntityTypeEnum(self): + """Test EntityTypeEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = EntityTypeEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_group.py b/test/test_group.py new file mode 100644 index 0000000..bfd2ca9 --- /dev/null +++ b/test/test_group.py @@ -0,0 +1,42 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.group_function_enum import GroupFunctionEnum +from opal.model.group_type_enum import GroupTypeEnum +from opal.model.visibility_enum import VisibilityEnum +globals()['GroupFunctionEnum'] = GroupFunctionEnum +globals()['GroupTypeEnum'] = GroupTypeEnum +globals()['VisibilityEnum'] = VisibilityEnum +from opal.model.group import Group + + +class TestGroup(unittest.TestCase): + """Group unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGroup(self): + """Test Group""" + # FIXME: construct object with mandatory attributes with example values + # model = Group() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_group_function_enum.py b/test/test_group_function_enum.py new file mode 100644 index 0000000..1df9624 --- /dev/null +++ b/test/test_group_function_enum.py @@ -0,0 +1,36 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.group_function_enum import GroupFunctionEnum + + +class TestGroupFunctionEnum(unittest.TestCase): + """GroupFunctionEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGroupFunctionEnum(self): + """Test GroupFunctionEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = GroupFunctionEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_group_type_enum.py b/test/test_group_type_enum.py new file mode 100644 index 0000000..4d458a8 --- /dev/null +++ b/test/test_group_type_enum.py @@ -0,0 +1,36 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.group_type_enum import GroupTypeEnum + + +class TestGroupTypeEnum(unittest.TestCase): + """GroupTypeEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGroupTypeEnum(self): + """Test GroupTypeEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = GroupTypeEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_groups_api.py b/test/test_groups_api.py new file mode 100644 index 0000000..768b2b5 --- /dev/null +++ b/test/test_groups_api.py @@ -0,0 +1,83 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import unittest + +import opal +from opal.api.groups_api import GroupsApi # noqa: E501 + + +class TestGroupsApi(unittest.TestCase): + """GroupsApi unit test stubs""" + + def setUp(self): + self.api = GroupsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_convert_group(self): + """Test case for convert_group + + """ + pass + + def test_delete_group(self): + """Test case for delete_group + + """ + pass + + def test_get_group_message_channels(self): + """Test case for get_group_message_channels + + """ + pass + + def test_get_group_reviewers(self): + """Test case for get_group_reviewers + + """ + pass + + def test_get_group_tags(self): + """Test case for get_group_tags + + """ + pass + + def test_get_groups(self): + """Test case for get_groups + + """ + pass + + def test_set_group_message_channels(self): + """Test case for set_group_message_channels + + """ + pass + + def test_set_group_reviewers(self): + """Test case for set_group_reviewers + + """ + pass + + def test_update_groups(self): + """Test case for update_groups + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_channel.py b/test/test_message_channel.py new file mode 100644 index 0000000..0e11683 --- /dev/null +++ b/test/test_message_channel.py @@ -0,0 +1,40 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.message_channel_provider_enum import MessageChannelProviderEnum +from opal.model.message_channel_type_enum import MessageChannelTypeEnum +globals()['MessageChannelProviderEnum'] = MessageChannelProviderEnum +globals()['MessageChannelTypeEnum'] = MessageChannelTypeEnum +from opal.model.message_channel import MessageChannel + + +class TestMessageChannel(unittest.TestCase): + """MessageChannel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMessageChannel(self): + """Test MessageChannel""" + # FIXME: construct object with mandatory attributes with example values + # model = MessageChannel() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_channel_id_list.py b/test/test_message_channel_id_list.py new file mode 100644 index 0000000..fa7c428 --- /dev/null +++ b/test/test_message_channel_id_list.py @@ -0,0 +1,36 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.message_channel_id_list import MessageChannelIDList + + +class TestMessageChannelIDList(unittest.TestCase): + """MessageChannelIDList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMessageChannelIDList(self): + """Test MessageChannelIDList""" + # FIXME: construct object with mandatory attributes with example values + # model = MessageChannelIDList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_channel_list.py b/test/test_message_channel_list.py new file mode 100644 index 0000000..a3006e9 --- /dev/null +++ b/test/test_message_channel_list.py @@ -0,0 +1,38 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.message_channel import MessageChannel +globals()['MessageChannel'] = MessageChannel +from opal.model.message_channel_list import MessageChannelList + + +class TestMessageChannelList(unittest.TestCase): + """MessageChannelList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMessageChannelList(self): + """Test MessageChannelList""" + # FIXME: construct object with mandatory attributes with example values + # model = MessageChannelList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_channel_provider_enum.py b/test/test_message_channel_provider_enum.py new file mode 100644 index 0000000..9fc4084 --- /dev/null +++ b/test/test_message_channel_provider_enum.py @@ -0,0 +1,36 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.message_channel_provider_enum import MessageChannelProviderEnum + + +class TestMessageChannelProviderEnum(unittest.TestCase): + """MessageChannelProviderEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMessageChannelProviderEnum(self): + """Test MessageChannelProviderEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = MessageChannelProviderEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_channel_type_enum.py b/test/test_message_channel_type_enum.py new file mode 100644 index 0000000..805e220 --- /dev/null +++ b/test/test_message_channel_type_enum.py @@ -0,0 +1,36 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.message_channel_type_enum import MessageChannelTypeEnum + + +class TestMessageChannelTypeEnum(unittest.TestCase): + """MessageChannelTypeEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMessageChannelTypeEnum(self): + """Test MessageChannelTypeEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = MessageChannelTypeEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_new_admin_id_list.py b/test/test_new_admin_id_list.py new file mode 100644 index 0000000..06c9488 --- /dev/null +++ b/test/test_new_admin_id_list.py @@ -0,0 +1,36 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.new_admin_id_list import NewAdminIDList + + +class TestNewAdminIDList(unittest.TestCase): + """NewAdminIDList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNewAdminIDList(self): + """Test NewAdminIDList""" + # FIXME: construct object with mandatory attributes with example values + # model = NewAdminIDList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_paginated_groups_list.py b/test/test_paginated_groups_list.py new file mode 100644 index 0000000..c244275 --- /dev/null +++ b/test/test_paginated_groups_list.py @@ -0,0 +1,38 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.group import Group +globals()['Group'] = Group +from opal.model.paginated_groups_list import PaginatedGroupsList + + +class TestPaginatedGroupsList(unittest.TestCase): + """PaginatedGroupsList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaginatedGroupsList(self): + """Test PaginatedGroupsList""" + # FIXME: construct object with mandatory attributes with example values + # model = PaginatedGroupsList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_paginated_resources_list.py b/test/test_paginated_resources_list.py new file mode 100644 index 0000000..f941d0e --- /dev/null +++ b/test/test_paginated_resources_list.py @@ -0,0 +1,38 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.resource import Resource +globals()['Resource'] = Resource +from opal.model.paginated_resources_list import PaginatedResourcesList + + +class TestPaginatedResourcesList(unittest.TestCase): + """PaginatedResourcesList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPaginatedResourcesList(self): + """Test PaginatedResourcesList""" + # FIXME: construct object with mandatory attributes with example values + # model = PaginatedResourcesList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_resource.py b/test/test_resource.py new file mode 100644 index 0000000..f52e12c --- /dev/null +++ b/test/test_resource.py @@ -0,0 +1,40 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.resource_type_enum import ResourceTypeEnum +from opal.model.visibility_enum import VisibilityEnum +globals()['ResourceTypeEnum'] = ResourceTypeEnum +globals()['VisibilityEnum'] = VisibilityEnum +from opal.model.resource import Resource + + +class TestResource(unittest.TestCase): + """Resource unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testResource(self): + """Test Resource""" + # FIXME: construct object with mandatory attributes with example values + # model = Resource() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_resource_type_enum.py b/test/test_resource_type_enum.py new file mode 100644 index 0000000..c69069a --- /dev/null +++ b/test/test_resource_type_enum.py @@ -0,0 +1,36 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.resource_type_enum import ResourceTypeEnum + + +class TestResourceTypeEnum(unittest.TestCase): + """ResourceTypeEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testResourceTypeEnum(self): + """Test ResourceTypeEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = ResourceTypeEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_reviewer_id_list.py b/test/test_reviewer_id_list.py new file mode 100644 index 0000000..628680c --- /dev/null +++ b/test/test_reviewer_id_list.py @@ -0,0 +1,36 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.reviewer_id_list import ReviewerIDList + + +class TestReviewerIDList(unittest.TestCase): + """ReviewerIDList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testReviewerIDList(self): + """Test ReviewerIDList""" + # FIXME: construct object with mandatory attributes with example values + # model = ReviewerIDList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tag.py b/test/test_tag.py new file mode 100644 index 0000000..28d7dbe --- /dev/null +++ b/test/test_tag.py @@ -0,0 +1,36 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.tag import Tag + + +class TestTag(unittest.TestCase): + """Tag unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTag(self): + """Test Tag""" + # FIXME: construct object with mandatory attributes with example values + # model = Tag() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tags_api.py b/test/test_tags_api.py new file mode 100644 index 0000000..fede494 --- /dev/null +++ b/test/test_tags_api.py @@ -0,0 +1,77 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import unittest + +import opal +from opal.api.tags_api import TagsApi # noqa: E501 + + +class TestTagsApi(unittest.TestCase): + """TagsApi unit test stubs""" + + def setUp(self): + self.api = TagsApi() # noqa: E501 + + def tearDown(self): + pass + + def test_add_group_tag(self): + """Test case for add_group_tag + + """ + pass + + def test_add_resource_tag(self): + """Test case for add_resource_tag + + """ + pass + + def test_add_user_tag(self): + """Test case for add_user_tag + + """ + pass + + def test_create_tag(self): + """Test case for create_tag + + """ + pass + + def test_get_tag(self): + """Test case for get_tag + + """ + pass + + def test_remove_group_tag(self): + """Test case for remove_group_tag + + """ + pass + + def test_remove_resource_tag(self): + """Test case for remove_resource_tag + + """ + pass + + def test_remove_user_tag(self): + """Test case for remove_user_tag + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tags_list.py b/test/test_tags_list.py new file mode 100644 index 0000000..49a03ba --- /dev/null +++ b/test/test_tags_list.py @@ -0,0 +1,38 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.tag import Tag +globals()['Tag'] = Tag +from opal.model.tags_list import TagsList + + +class TestTagsList(unittest.TestCase): + """TagsList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTagsList(self): + """Test TagsList""" + # FIXME: construct object with mandatory attributes with example values + # model = TagsList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_group_info.py b/test/test_update_group_info.py new file mode 100644 index 0000000..5d79535 --- /dev/null +++ b/test/test_update_group_info.py @@ -0,0 +1,38 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.visibility_enum import VisibilityEnum +globals()['VisibilityEnum'] = VisibilityEnum +from opal.model.update_group_info import UpdateGroupInfo + + +class TestUpdateGroupInfo(unittest.TestCase): + """UpdateGroupInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateGroupInfo(self): + """Test UpdateGroupInfo""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateGroupInfo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_group_info_list.py b/test/test_update_group_info_list.py new file mode 100644 index 0000000..56e83b9 --- /dev/null +++ b/test/test_update_group_info_list.py @@ -0,0 +1,38 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.update_group_info import UpdateGroupInfo +globals()['UpdateGroupInfo'] = UpdateGroupInfo +from opal.model.update_group_info_list import UpdateGroupInfoList + + +class TestUpdateGroupInfoList(unittest.TestCase): + """UpdateGroupInfoList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateGroupInfoList(self): + """Test UpdateGroupInfoList""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateGroupInfoList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_resource_info.py b/test/test_update_resource_info.py new file mode 100644 index 0000000..0d5c4c2 --- /dev/null +++ b/test/test_update_resource_info.py @@ -0,0 +1,38 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.visibility_enum import VisibilityEnum +globals()['VisibilityEnum'] = VisibilityEnum +from opal.model.update_resource_info import UpdateResourceInfo + + +class TestUpdateResourceInfo(unittest.TestCase): + """UpdateResourceInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateResourceInfo(self): + """Test UpdateResourceInfo""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateResourceInfo() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_resource_info_list.py b/test/test_update_resource_info_list.py new file mode 100644 index 0000000..a6fb4de --- /dev/null +++ b/test/test_update_resource_info_list.py @@ -0,0 +1,38 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.update_resource_info import UpdateResourceInfo +globals()['UpdateResourceInfo'] = UpdateResourceInfo +from opal.model.update_resource_info_list import UpdateResourceInfoList + + +class TestUpdateResourceInfoList(unittest.TestCase): + """UpdateResourceInfoList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUpdateResourceInfoList(self): + """Test UpdateResourceInfoList""" + # FIXME: construct object with mandatory attributes with example values + # model = UpdateResourceInfoList() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_visibility_enum.py b/test/test_visibility_enum.py new file mode 100644 index 0000000..61271ed --- /dev/null +++ b/test/test_visibility_enum.py @@ -0,0 +1,36 @@ +""" + Opal API + + Your Home For Developer Resources. # noqa: E501 + + The version of the OpenAPI document: 1.0 + Contact: hello@opal.dev + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import opal +from opal.model.visibility_enum import VisibilityEnum + + +class TestVisibilityEnum(unittest.TestCase): + """VisibilityEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVisibilityEnum(self): + """Test VisibilityEnum""" + # FIXME: construct object with mandatory attributes with example values + # model = VisibilityEnum() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main()