From ab2ee029dbc247a612ee0d9f1a532fe47d2f6483 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 14 Jul 2026 17:48:36 +0000 Subject: [PATCH] Regenerate client from commit 36c325e of spec repo --- .generator/schemas/v2/openapi.yaml | 529 ++++++++++++++++++ docs/datadog_api_client.v2.model.rst | 119 ++++ .../CreateIncidentUserDefinedRole.py | 52 ++ .../DeleteIncidentUserDefinedRole.py | 15 + .../incidents/GetIncidentUserDefinedRole.py | 17 + .../incidents/ListIncidentUserDefinedRoles.py | 14 + .../UpdateIncidentUserDefinedRole.py | 40 ++ src/datadog_api_client/configuration.py | 5 + .../v2/api/incidents_api.py | 255 +++++++++ ...er_defined_role_data_attributes_request.py | 62 ++ ...r_defined_role_data_attributes_response.py | 77 +++ ...incident_user_defined_role_data_request.py | 70 +++ ...ncident_user_defined_role_data_response.py | 81 +++ ...defined_role_incident_type_relationship.py | 44 ++ ...ed_role_incident_type_relationship_data.py | 40 ++ ...ncident_user_defined_role_included_item.py | 49 ++ ...ined_role_patch_data_attributes_request.py | 63 +++ ...nt_user_defined_role_patch_data_request.py | 68 +++ ...ncident_user_defined_role_patch_request.py | 44 ++ .../incident_user_defined_role_policy.py | 33 ++ ...user_defined_role_relationships_request.py | 44 ++ ...ser_defined_role_relationships_response.py | 68 +++ .../incident_user_defined_role_request.py | 42 ++ .../incident_user_defined_role_response.py | 64 +++ .../model/incident_user_defined_role_type.py | 35 ++ .../incident_user_defined_roles_response.py | 64 +++ src/datadog_api_client/v2/models/__init__.py | 50 ++ tests/v2/features/incidents.feature | 105 ++++ tests/v2/features/undo.json | 37 ++ 29 files changed, 2186 insertions(+) create mode 100644 examples/v2/incidents/CreateIncidentUserDefinedRole.py create mode 100644 examples/v2/incidents/DeleteIncidentUserDefinedRole.py create mode 100644 examples/v2/incidents/GetIncidentUserDefinedRole.py create mode 100644 examples/v2/incidents/ListIncidentUserDefinedRoles.py create mode 100644 examples/v2/incidents/UpdateIncidentUserDefinedRole.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_data_attributes_request.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_data_attributes_response.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_data_request.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_data_response.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_incident_type_relationship.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_incident_type_relationship_data.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_included_item.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_patch_data_attributes_request.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_patch_data_request.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_patch_request.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_policy.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_relationships_request.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_relationships_response.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_request.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_response.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_role_type.py create mode 100644 src/datadog_api_client/v2/model/incident_user_defined_roles_response.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index fa9ffba157..2d6b6c945a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -861,6 +861,15 @@ components: schema: example: "00000000-0000-0000-0000-000000000000" type: string + IncidentUserDefinedRoleIDPathParameter: + description: The UUID of the incident user-defined role. + in: path + name: role_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000002" + format: uuid + type: string Include: description: Include relationship data. explode: true @@ -47808,6 +47817,229 @@ components: - display_name - value type: object + IncidentUserDefinedRoleDataAttributesRequest: + description: Attributes for creating an incident user-defined role. + properties: + description: + description: A description of the user-defined role. + example: "The technical lead for the incident." + nullable: true + type: string + name: + description: The name of the user-defined role. + example: "Tech Lead" + type: string + policy: + $ref: "#/components/schemas/IncidentUserDefinedRolePolicy" + required: + - name + - policy + type: object + IncidentUserDefinedRoleDataAttributesResponse: + description: Attributes of an incident user-defined role. + properties: + created: + description: Timestamp when the role was created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + description: + description: A description of the user-defined role. + example: "The technical lead for the incident." + nullable: true + type: string + modified: + description: Timestamp when the role was last modified. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + name: + description: The name of the user-defined role. + example: "Tech Lead" + type: string + policy: + $ref: "#/components/schemas/IncidentUserDefinedRolePolicy" + required: + - name + - policy + - created + - modified + type: object + IncidentUserDefinedRoleDataRequest: + description: Data for creating an incident user-defined role. + properties: + attributes: + $ref: "#/components/schemas/IncidentUserDefinedRoleDataAttributesRequest" + relationships: + $ref: "#/components/schemas/IncidentUserDefinedRoleRelationshipsRequest" + type: + $ref: "#/components/schemas/IncidentUserDefinedRoleType" + required: + - type + - attributes + - relationships + type: object + IncidentUserDefinedRoleDataResponse: + description: Data for an incident user-defined role response. + properties: + attributes: + $ref: "#/components/schemas/IncidentUserDefinedRoleDataAttributesResponse" + id: + description: The ID of the user-defined role. + example: "00000000-0000-0000-0000-000000000002" + format: uuid + type: string + relationships: + $ref: "#/components/schemas/IncidentUserDefinedRoleRelationshipsResponse" + type: + $ref: "#/components/schemas/IncidentUserDefinedRoleType" + required: + - id + - type + - attributes + type: object + IncidentUserDefinedRoleIncidentTypeRelationship: + description: Relationship to an incident type for a user-defined role. + properties: + data: + $ref: "#/components/schemas/IncidentUserDefinedRoleIncidentTypeRelationshipData" + required: + - data + type: object + IncidentUserDefinedRoleIncidentTypeRelationshipData: + description: Data for the incident type relationship of a user-defined role. + properties: + id: + description: The ID of the incident type. + example: "00000000-0000-0000-0000-000000000001" + format: uuid + type: string + type: + description: The type of the resource. + example: "incident_types" + type: string + required: + - id + - type + type: object + IncidentUserDefinedRoleIncludedItem: + description: A single included resource in a user-defined role response. + oneOf: + - $ref: "#/components/schemas/IncidentUserData" + - $ref: "#/components/schemas/IncidentTypeObject" + IncidentUserDefinedRoleIncludedResponse: + description: Included resources for an incident user-defined role response. + items: + $ref: "#/components/schemas/IncidentUserDefinedRoleIncludedItem" + type: array + IncidentUserDefinedRolePatchDataAttributesRequest: + description: Attributes for updating an incident user-defined role. + properties: + description: + description: A description of the user-defined role. + example: "The technical lead for the incident." + nullable: true + type: string + name: + description: The name of the user-defined role. + example: "Tech Lead" + type: string + policy: + $ref: "#/components/schemas/IncidentUserDefinedRolePolicy" + type: object + IncidentUserDefinedRolePatchDataRequest: + description: Data for updating an incident user-defined role. + properties: + attributes: + $ref: "#/components/schemas/IncidentUserDefinedRolePatchDataAttributesRequest" + id: + description: The ID of the user-defined role to update. + example: "00000000-0000-0000-0000-000000000002" + format: uuid + type: string + type: + $ref: "#/components/schemas/IncidentUserDefinedRoleType" + required: + - id + - type + type: object + IncidentUserDefinedRolePatchRequest: + description: Request for updating an incident user-defined role. + properties: + data: + $ref: "#/components/schemas/IncidentUserDefinedRolePatchDataRequest" + required: + - data + type: object + IncidentUserDefinedRolePolicy: + description: Policy configuration for a user-defined role. + properties: + is_single: + description: Whether this role can only be assigned to one responder at a time. + example: true + type: boolean + required: + - is_single + type: object + IncidentUserDefinedRoleRelationshipsRequest: + description: Relationships for creating a user-defined role. + properties: + incident_type: + $ref: "#/components/schemas/IncidentUserDefinedRoleIncidentTypeRelationship" + required: + - incident_type + type: object + IncidentUserDefinedRoleRelationshipsResponse: + description: Relationships of a user-defined role response. + properties: + created_by_user: + $ref: "#/components/schemas/RelationshipToUser" + incident_type: + $ref: "#/components/schemas/IncidentUserDefinedRoleIncidentTypeRelationship" + last_modified_by_user: + $ref: "#/components/schemas/RelationshipToUser" + type: object + IncidentUserDefinedRoleRequest: + description: Request for creating an incident user-defined role. + properties: + data: + $ref: "#/components/schemas/IncidentUserDefinedRoleDataRequest" + required: + - data + type: object + IncidentUserDefinedRoleResponse: + description: Response with a single incident user-defined role. + properties: + data: + $ref: "#/components/schemas/IncidentUserDefinedRoleDataResponse" + included: + $ref: "#/components/schemas/IncidentUserDefinedRoleIncludedResponse" + required: + - data + type: object + IncidentUserDefinedRoleType: + description: Incident user-defined role resource type. + enum: + - incident_user_defined_roles + example: incident_user_defined_roles + type: string + x-enum-varnames: + - INCIDENT_USER_DEFINED_ROLES + IncidentUserDefinedRolesDataResponse: + description: List of incident user-defined role data objects. + items: + $ref: "#/components/schemas/IncidentUserDefinedRoleDataResponse" + type: array + IncidentUserDefinedRolesResponse: + description: Response with a list of incident user-defined roles. + properties: + data: + $ref: "#/components/schemas/IncidentUserDefinedRolesDataResponse" + included: + $ref: "#/components/schemas/IncidentUserDefinedRoleIncludedResponse" + required: + - data + type: object IncidentsResponse: description: Response with a list of incidents. properties: @@ -140592,6 +140824,303 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/user-defined-roles: + get: + description: List all user-defined roles for incidents. + operationId: ListIncidentUserDefinedRoles + parameters: + - description: Filter roles by incident type UUID. + in: query + name: filter[incident-type] + required: false + schema: + example: "00000000-0000-0000-0000-000000000001" + format: uuid + type: string + - description: Comma-separated list of related resources to include in the response. + in: query + name: include + required: false + schema: + example: "created_by_user,last_modified_by_user,incident_type" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created: "2024-01-01T00:00:00.000Z" + description: "The technical lead for the incident." + modified: "2024-01-01T00:00:00.000Z" + name: "Tech Lead" + policy: + is_single: true + id: "00000000-0000-0000-0000-000000000002" + type: incident_user_defined_roles + schema: + $ref: "#/components/schemas/IncidentUserDefinedRolesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_read + summary: List incident user-defined roles + tags: + - Incidents + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a new user-defined role for incidents. + operationId: CreateIncidentUserDefinedRole + parameters: + - description: Comma-separated list of related resources to include in the response. + in: query + name: include + required: false + schema: + example: "created_by_user,last_modified_by_user,incident_type" + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: "The technical lead for the incident." + name: "Tech Lead" + policy: + is_single: true + relationships: + incident_type: + data: + id: "00000000-0000-0000-0000-000000000001" + type: incident_types + type: incident_user_defined_roles + schema: + $ref: "#/components/schemas/IncidentUserDefinedRoleRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + created: "2024-01-01T00:00:00.000Z" + description: "The technical lead for the incident." + modified: "2024-01-01T00:00:00.000Z" + name: "Tech Lead" + policy: + is_single: true + id: "00000000-0000-0000-0000-000000000002" + type: incident_user_defined_roles + schema: + $ref: "#/components/schemas/IncidentUserDefinedRoleResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Create an incident user-defined role + tags: + - Incidents + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/user-defined-roles/{role_id}: + delete: + description: Delete an existing user-defined role for incidents. + operationId: DeleteIncidentUserDefinedRole + parameters: + - $ref: "#/components/parameters/IncidentUserDefinedRoleIDPathParameter" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Delete an incident user-defined role + tags: + - Incidents + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Retrieve a single user-defined role for incidents. + operationId: GetIncidentUserDefinedRole + parameters: + - $ref: "#/components/parameters/IncidentUserDefinedRoleIDPathParameter" + - description: Comma-separated list of related resources to include in the response. + in: query + name: include + required: false + schema: + example: "created_by_user,last_modified_by_user,incident_type" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created: "2024-01-01T00:00:00.000Z" + description: "The technical lead for the incident." + modified: "2024-01-01T00:00:00.000Z" + name: "Tech Lead" + policy: + is_single: true + id: "00000000-0000-0000-0000-000000000002" + type: incident_user_defined_roles + schema: + $ref: "#/components/schemas/IncidentUserDefinedRoleResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_read + summary: Get an incident user-defined role + tags: + - Incidents + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + patch: + description: Update an existing user-defined role for incidents. + operationId: UpdateIncidentUserDefinedRole + parameters: + - $ref: "#/components/parameters/IncidentUserDefinedRoleIDPathParameter" + - description: Comma-separated list of related resources to include in the response. + in: query + name: include + required: false + schema: + example: "created_by_user,last_modified_by_user,incident_type" + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: "Updated Tech Lead" + id: "00000000-0000-0000-0000-000000000002" + type: incident_user_defined_roles + schema: + $ref: "#/components/schemas/IncidentUserDefinedRolePatchRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created: "2024-01-01T00:00:00.000Z" + modified: "2024-01-02T00:00:00.000Z" + name: "Updated Tech Lead" + policy: + is_single: true + id: "00000000-0000-0000-0000-000000000002" + type: incident_user_defined_roles + schema: + $ref: "#/components/schemas/IncidentUserDefinedRoleResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Update an incident user-defined role + tags: + - Incidents + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/incidents/import: post: description: |- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index da5d6a5754..e4e029883b 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -19317,6 +19317,125 @@ datadog\_api\_client.v2.model.incident\_user\_defined\_field\_valid\_value modul :members: :show-inheritance: +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_data\_attributes\_request module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_data_attributes_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_data\_attributes\_response module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_data_attributes_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_data\_request module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_data_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_data\_response module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_data_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_incident\_type\_relationship module +------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_incident_type_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_incident\_type\_relationship\_data module +------------------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_incident_type_relationship_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_included\_item module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_included_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_patch\_data\_attributes\_request module +---------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_patch_data_attributes_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_patch\_data\_request module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_patch_data_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_patch\_request module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_patch_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_policy module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_policy + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_relationships\_request module +------------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_relationships_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_relationships\_response module +------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_relationships_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_request module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_response module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_role\_type module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_role_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.incident\_user\_defined\_roles\_response module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.incident_user_defined_roles_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.incidents\_response module -------------------------------------------------------- diff --git a/examples/v2/incidents/CreateIncidentUserDefinedRole.py b/examples/v2/incidents/CreateIncidentUserDefinedRole.py new file mode 100644 index 0000000000..1244ca98d4 --- /dev/null +++ b/examples/v2/incidents/CreateIncidentUserDefinedRole.py @@ -0,0 +1,52 @@ +""" +Create an incident user-defined role returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi +from datadog_api_client.v2.model.incident_user_defined_role_data_attributes_request import ( + IncidentUserDefinedRoleDataAttributesRequest, +) +from datadog_api_client.v2.model.incident_user_defined_role_data_request import IncidentUserDefinedRoleDataRequest +from datadog_api_client.v2.model.incident_user_defined_role_incident_type_relationship import ( + IncidentUserDefinedRoleIncidentTypeRelationship, +) +from datadog_api_client.v2.model.incident_user_defined_role_incident_type_relationship_data import ( + IncidentUserDefinedRoleIncidentTypeRelationshipData, +) +from datadog_api_client.v2.model.incident_user_defined_role_policy import IncidentUserDefinedRolePolicy +from datadog_api_client.v2.model.incident_user_defined_role_relationships_request import ( + IncidentUserDefinedRoleRelationshipsRequest, +) +from datadog_api_client.v2.model.incident_user_defined_role_request import IncidentUserDefinedRoleRequest +from datadog_api_client.v2.model.incident_user_defined_role_type import IncidentUserDefinedRoleType +from uuid import UUID + +body = IncidentUserDefinedRoleRequest( + data=IncidentUserDefinedRoleDataRequest( + attributes=IncidentUserDefinedRoleDataAttributesRequest( + description="The technical lead for the incident.", + name="Tech Lead", + policy=IncidentUserDefinedRolePolicy( + is_single=True, + ), + ), + relationships=IncidentUserDefinedRoleRelationshipsRequest( + incident_type=IncidentUserDefinedRoleIncidentTypeRelationship( + data=IncidentUserDefinedRoleIncidentTypeRelationshipData( + id=UUID("00000000-0000-0000-0000-000000000001"), + type="incident_types", + ), + ), + ), + type=IncidentUserDefinedRoleType.INCIDENT_USER_DEFINED_ROLES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_incident_user_defined_role"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.create_incident_user_defined_role(body=body) + + print(response) diff --git a/examples/v2/incidents/DeleteIncidentUserDefinedRole.py b/examples/v2/incidents/DeleteIncidentUserDefinedRole.py new file mode 100644 index 0000000000..bae3badb87 --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentUserDefinedRole.py @@ -0,0 +1,15 @@ +""" +Delete an incident user-defined role returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["delete_incident_user_defined_role"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + api_instance.delete_incident_user_defined_role( + role_id=UUID("00000000-0000-0000-0000-000000000002"), + ) diff --git a/examples/v2/incidents/GetIncidentUserDefinedRole.py b/examples/v2/incidents/GetIncidentUserDefinedRole.py new file mode 100644 index 0000000000..2f97d37f12 --- /dev/null +++ b/examples/v2/incidents/GetIncidentUserDefinedRole.py @@ -0,0 +1,17 @@ +""" +Get an incident user-defined role returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi +from uuid import UUID + +configuration = Configuration() +configuration.unstable_operations["get_incident_user_defined_role"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.get_incident_user_defined_role( + role_id=UUID("00000000-0000-0000-0000-000000000002"), + ) + + print(response) diff --git a/examples/v2/incidents/ListIncidentUserDefinedRoles.py b/examples/v2/incidents/ListIncidentUserDefinedRoles.py new file mode 100644 index 0000000000..baba2f70d8 --- /dev/null +++ b/examples/v2/incidents/ListIncidentUserDefinedRoles.py @@ -0,0 +1,14 @@ +""" +List incident user-defined roles returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi + +configuration = Configuration() +configuration.unstable_operations["list_incident_user_defined_roles"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.list_incident_user_defined_roles() + + print(response) diff --git a/examples/v2/incidents/UpdateIncidentUserDefinedRole.py b/examples/v2/incidents/UpdateIncidentUserDefinedRole.py new file mode 100644 index 0000000000..2f95063878 --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentUserDefinedRole.py @@ -0,0 +1,40 @@ +""" +Update an incident user-defined role returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi +from datadog_api_client.v2.model.incident_user_defined_role_patch_data_attributes_request import ( + IncidentUserDefinedRolePatchDataAttributesRequest, +) +from datadog_api_client.v2.model.incident_user_defined_role_patch_data_request import ( + IncidentUserDefinedRolePatchDataRequest, +) +from datadog_api_client.v2.model.incident_user_defined_role_patch_request import IncidentUserDefinedRolePatchRequest +from datadog_api_client.v2.model.incident_user_defined_role_policy import IncidentUserDefinedRolePolicy +from datadog_api_client.v2.model.incident_user_defined_role_type import IncidentUserDefinedRoleType +from uuid import UUID + +body = IncidentUserDefinedRolePatchRequest( + data=IncidentUserDefinedRolePatchDataRequest( + attributes=IncidentUserDefinedRolePatchDataAttributesRequest( + description="The technical lead for the incident.", + name="Tech Lead", + policy=IncidentUserDefinedRolePolicy( + is_single=True, + ), + ), + id=UUID("00000000-0000-0000-0000-000000000002"), + type=IncidentUserDefinedRoleType.INCIDENT_USER_DEFINED_ROLES, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_incident_user_defined_role"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.update_incident_user_defined_role( + role_id=UUID("00000000-0000-0000-0000-000000000002"), body=body + ) + + print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index 33003c7e07..f194a1e453 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -571,6 +571,7 @@ def __init__( "v2.create_incident_todo": False, "v2.create_incident_type": False, "v2.create_incident_user_defined_field": False, + "v2.create_incident_user_defined_role": False, "v2.delete_global_incident_handle": False, "v2.delete_incident": False, "v2.delete_incident_attachment": False, @@ -581,6 +582,7 @@ def __init__( "v2.delete_incident_todo": False, "v2.delete_incident_type": False, "v2.delete_incident_user_defined_field": False, + "v2.delete_incident_user_defined_role": False, "v2.get_global_incident_settings": False, "v2.get_incident": False, "v2.get_incident_integration": False, @@ -590,6 +592,7 @@ def __init__( "v2.get_incident_todo": False, "v2.get_incident_type": False, "v2.get_incident_user_defined_field": False, + "v2.get_incident_user_defined_role": False, "v2.import_incident": False, "v2.list_global_incident_handles": False, "v2.list_incident_attachments": False, @@ -601,6 +604,7 @@ def __init__( "v2.list_incident_todos": False, "v2.list_incident_types": False, "v2.list_incident_user_defined_fields": False, + "v2.list_incident_user_defined_roles": False, "v2.search_incidents": False, "v2.update_global_incident_handle": False, "v2.update_global_incident_settings": False, @@ -613,6 +617,7 @@ def __init__( "v2.update_incident_todo": False, "v2.update_incident_type": False, "v2.update_incident_user_defined_field": False, + "v2.update_incident_user_defined_role": False, "v2.create_aws_account_ccm_config": False, "v2.delete_aws_account_ccm_config": False, "v2.get_aws_account_ccm_config": False, diff --git a/src/datadog_api_client/v2/api/incidents_api.py b/src/datadog_api_client/v2/api/incidents_api.py index f4b97f5ad0..39a5d07560 100644 --- a/src/datadog_api_client/v2/api/incidents_api.py +++ b/src/datadog_api_client/v2/api/incidents_api.py @@ -48,6 +48,10 @@ from datadog_api_client.v2.model.incident_user_defined_field_response import IncidentUserDefinedFieldResponse from datadog_api_client.v2.model.incident_user_defined_field_create_request import IncidentUserDefinedFieldCreateRequest from datadog_api_client.v2.model.incident_user_defined_field_update_request import IncidentUserDefinedFieldUpdateRequest +from datadog_api_client.v2.model.incident_user_defined_roles_response import IncidentUserDefinedRolesResponse +from datadog_api_client.v2.model.incident_user_defined_role_response import IncidentUserDefinedRoleResponse +from datadog_api_client.v2.model.incident_user_defined_role_request import IncidentUserDefinedRoleRequest +from datadog_api_client.v2.model.incident_user_defined_role_patch_request import IncidentUserDefinedRolePatchRequest from datadog_api_client.v2.model.incident_import_response import IncidentImportResponse from datadog_api_client.v2.model.incident_import_related_object import IncidentImportRelatedObject from datadog_api_client.v2.model.incident_import_request import IncidentImportRequest @@ -381,6 +385,31 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_incident_user_defined_role_endpoint = _Endpoint( + settings={ + "response_type": (IncidentUserDefinedRoleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/incidents/config/user-defined-roles", + "operation_id": "create_incident_user_defined_role", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + "body": { + "required": True, + "openapi_types": (IncidentUserDefinedRoleRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._delete_global_incident_handle_endpoint = _Endpoint( settings={ "response_type": None, @@ -661,6 +690,29 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_incident_user_defined_role_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/incidents/config/user-defined-roles/{role_id}", + "operation_id": "delete_incident_user_defined_role", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "role_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "role_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._get_global_incident_settings_endpoint = _Endpoint( settings={ "response_type": (GlobalIncidentSettingsResponse,), @@ -894,6 +946,34 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_incident_user_defined_role_endpoint = _Endpoint( + settings={ + "response_type": (IncidentUserDefinedRoleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/incidents/config/user-defined-roles/{role_id}", + "operation_id": "get_incident_user_defined_role", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "role_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "role_id", + "location": "path", + }, + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._import_incident_endpoint = _Endpoint( settings={ "response_type": (IncidentImportResponse,), @@ -1219,6 +1299,33 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._list_incident_user_defined_roles_endpoint = _Endpoint( + settings={ + "response_type": (IncidentUserDefinedRolesResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/incidents/config/user-defined-roles", + "operation_id": "list_incident_user_defined_roles", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "filter_incident_type": { + "openapi_types": (UUID,), + "attribute": "filter[incident-type]", + "location": "query", + }, + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + self._search_incidents_endpoint = _Endpoint( settings={ "response_type": (IncidentSearchResponse,), @@ -1585,6 +1692,37 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._update_incident_user_defined_role_endpoint = _Endpoint( + settings={ + "response_type": (IncidentUserDefinedRoleResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/incidents/config/user-defined-roles/{role_id}", + "operation_id": "update_incident_user_defined_role", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "role_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "role_id", + "location": "path", + }, + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + "body": { + "required": True, + "openapi_types": (IncidentUserDefinedRolePatchRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + def create_global_incident_handle( self, body: IncidentHandleRequest, @@ -1840,6 +1978,29 @@ def create_incident_user_defined_field( return self._create_incident_user_defined_field_endpoint.call_with_http_info(**kwargs) + def create_incident_user_defined_role( + self, + body: IncidentUserDefinedRoleRequest, + *, + include: Union[str, UnsetType] = unset, + ) -> IncidentUserDefinedRoleResponse: + """Create an incident user-defined role. + + Create a new user-defined role for incidents. + + :type body: IncidentUserDefinedRoleRequest + :param include: Comma-separated list of related resources to include in the response. + :type include: str, optional + :rtype: IncidentUserDefinedRoleResponse + """ + kwargs: Dict[str, Any] = {} + if include is not unset: + kwargs["include"] = include + + kwargs["body"] = body + + return self._create_incident_user_defined_role_endpoint.call_with_http_info(**kwargs) + def delete_global_incident_handle( self, ) -> None: @@ -2054,6 +2215,23 @@ def delete_incident_user_defined_field( return self._delete_incident_user_defined_field_endpoint.call_with_http_info(**kwargs) + def delete_incident_user_defined_role( + self, + role_id: UUID, + ) -> None: + """Delete an incident user-defined role. + + Delete an existing user-defined role for incidents. + + :param role_id: The UUID of the incident user-defined role. + :type role_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["role_id"] = role_id + + return self._delete_incident_user_defined_role_endpoint.call_with_http_info(**kwargs) + def get_global_incident_settings( self, ) -> GlobalIncidentSettingsResponse: @@ -2240,6 +2418,30 @@ def get_incident_user_defined_field( return self._get_incident_user_defined_field_endpoint.call_with_http_info(**kwargs) + def get_incident_user_defined_role( + self, + role_id: UUID, + *, + include: Union[str, UnsetType] = unset, + ) -> IncidentUserDefinedRoleResponse: + """Get an incident user-defined role. + + Retrieve a single user-defined role for incidents. + + :param role_id: The UUID of the incident user-defined role. + :type role_id: UUID + :param include: Comma-separated list of related resources to include in the response. + :type include: str, optional + :rtype: IncidentUserDefinedRoleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["role_id"] = role_id + + if include is not unset: + kwargs["include"] = include + + return self._get_incident_user_defined_role_endpoint.call_with_http_info(**kwargs) + def import_incident( self, body: IncidentImportRequest, @@ -2565,6 +2767,31 @@ def list_incident_user_defined_fields( return self._list_incident_user_defined_fields_endpoint.call_with_http_info(**kwargs) + def list_incident_user_defined_roles( + self, + *, + filter_incident_type: Union[UUID, UnsetType] = unset, + include: Union[str, UnsetType] = unset, + ) -> IncidentUserDefinedRolesResponse: + """List incident user-defined roles. + + List all user-defined roles for incidents. + + :param filter_incident_type: Filter roles by incident type UUID. + :type filter_incident_type: UUID, optional + :param include: Comma-separated list of related resources to include in the response. + :type include: str, optional + :rtype: IncidentUserDefinedRolesResponse + """ + kwargs: Dict[str, Any] = {} + if filter_incident_type is not unset: + kwargs["filter_incident_type"] = filter_incident_type + + if include is not unset: + kwargs["include"] = include + + return self._list_incident_user_defined_roles_endpoint.call_with_http_info(**kwargs) + def search_incidents( self, query: str, @@ -2945,3 +3172,31 @@ def update_incident_user_defined_field( kwargs["body"] = body return self._update_incident_user_defined_field_endpoint.call_with_http_info(**kwargs) + + def update_incident_user_defined_role( + self, + role_id: UUID, + body: IncidentUserDefinedRolePatchRequest, + *, + include: Union[str, UnsetType] = unset, + ) -> IncidentUserDefinedRoleResponse: + """Update an incident user-defined role. + + Update an existing user-defined role for incidents. + + :param role_id: The UUID of the incident user-defined role. + :type role_id: UUID + :type body: IncidentUserDefinedRolePatchRequest + :param include: Comma-separated list of related resources to include in the response. + :type include: str, optional + :rtype: IncidentUserDefinedRoleResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["role_id"] = role_id + + if include is not unset: + kwargs["include"] = include + + kwargs["body"] = body + + return self._update_incident_user_defined_role_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_data_attributes_request.py b/src/datadog_api_client/v2/model/incident_user_defined_role_data_attributes_request.py new file mode 100644 index 0000000000..a952bfd2bb --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_data_attributes_request.py @@ -0,0 +1,62 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_user_defined_role_policy import IncidentUserDefinedRolePolicy + + +class IncidentUserDefinedRoleDataAttributesRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_user_defined_role_policy import IncidentUserDefinedRolePolicy + + return { + "description": (str, none_type), + "name": (str,), + "policy": (IncidentUserDefinedRolePolicy,), + } + + attribute_map = { + "description": "description", + "name": "name", + "policy": "policy", + } + + def __init__( + self_, + name: str, + policy: IncidentUserDefinedRolePolicy, + description: Union[str, none_type, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for creating an incident user-defined role. + + :param description: A description of the user-defined role. + :type description: str, none_type, optional + + :param name: The name of the user-defined role. + :type name: str + + :param policy: Policy configuration for a user-defined role. + :type policy: IncidentUserDefinedRolePolicy + """ + if description is not unset: + kwargs["description"] = description + super().__init__(kwargs) + + self_.name = name + self_.policy = policy diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_data_attributes_response.py b/src/datadog_api_client/v2/model/incident_user_defined_role_data_attributes_response.py new file mode 100644 index 0000000000..9e696879bf --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_data_attributes_response.py @@ -0,0 +1,77 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_user_defined_role_policy import IncidentUserDefinedRolePolicy + + +class IncidentUserDefinedRoleDataAttributesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_user_defined_role_policy import IncidentUserDefinedRolePolicy + + return { + "created": (datetime,), + "description": (str, none_type), + "modified": (datetime,), + "name": (str,), + "policy": (IncidentUserDefinedRolePolicy,), + } + + attribute_map = { + "created": "created", + "description": "description", + "modified": "modified", + "name": "name", + "policy": "policy", + } + + def __init__( + self_, + created: datetime, + modified: datetime, + name: str, + policy: IncidentUserDefinedRolePolicy, + description: Union[str, none_type, UnsetType] = unset, + **kwargs, + ): + """ + Attributes of an incident user-defined role. + + :param created: Timestamp when the role was created. + :type created: datetime + + :param description: A description of the user-defined role. + :type description: str, none_type, optional + + :param modified: Timestamp when the role was last modified. + :type modified: datetime + + :param name: The name of the user-defined role. + :type name: str + + :param policy: Policy configuration for a user-defined role. + :type policy: IncidentUserDefinedRolePolicy + """ + if description is not unset: + kwargs["description"] = description + super().__init__(kwargs) + + self_.created = created + self_.modified = modified + self_.name = name + self_.policy = policy diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_data_request.py b/src/datadog_api_client/v2/model/incident_user_defined_role_data_request.py new file mode 100644 index 0000000000..884f62e720 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_data_request.py @@ -0,0 +1,70 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_user_defined_role_data_attributes_request import ( + IncidentUserDefinedRoleDataAttributesRequest, + ) + from datadog_api_client.v2.model.incident_user_defined_role_relationships_request import ( + IncidentUserDefinedRoleRelationshipsRequest, + ) + from datadog_api_client.v2.model.incident_user_defined_role_type import IncidentUserDefinedRoleType + + +class IncidentUserDefinedRoleDataRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_user_defined_role_data_attributes_request import ( + IncidentUserDefinedRoleDataAttributesRequest, + ) + from datadog_api_client.v2.model.incident_user_defined_role_relationships_request import ( + IncidentUserDefinedRoleRelationshipsRequest, + ) + from datadog_api_client.v2.model.incident_user_defined_role_type import IncidentUserDefinedRoleType + + return { + "attributes": (IncidentUserDefinedRoleDataAttributesRequest,), + "relationships": (IncidentUserDefinedRoleRelationshipsRequest,), + "type": (IncidentUserDefinedRoleType,), + } + + attribute_map = { + "attributes": "attributes", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: IncidentUserDefinedRoleDataAttributesRequest, + relationships: IncidentUserDefinedRoleRelationshipsRequest, + type: IncidentUserDefinedRoleType, + **kwargs, + ): + """ + Data for creating an incident user-defined role. + + :param attributes: Attributes for creating an incident user-defined role. + :type attributes: IncidentUserDefinedRoleDataAttributesRequest + + :param relationships: Relationships for creating a user-defined role. + :type relationships: IncidentUserDefinedRoleRelationshipsRequest + + :param type: Incident user-defined role resource type. + :type type: IncidentUserDefinedRoleType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.relationships = relationships + self_.type = type diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_data_response.py b/src/datadog_api_client/v2/model/incident_user_defined_role_data_response.py new file mode 100644 index 0000000000..4a07070766 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_data_response.py @@ -0,0 +1,81 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_user_defined_role_data_attributes_response import ( + IncidentUserDefinedRoleDataAttributesResponse, + ) + from datadog_api_client.v2.model.incident_user_defined_role_relationships_response import ( + IncidentUserDefinedRoleRelationshipsResponse, + ) + from datadog_api_client.v2.model.incident_user_defined_role_type import IncidentUserDefinedRoleType + + +class IncidentUserDefinedRoleDataResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_user_defined_role_data_attributes_response import ( + IncidentUserDefinedRoleDataAttributesResponse, + ) + from datadog_api_client.v2.model.incident_user_defined_role_relationships_response import ( + IncidentUserDefinedRoleRelationshipsResponse, + ) + from datadog_api_client.v2.model.incident_user_defined_role_type import IncidentUserDefinedRoleType + + return { + "attributes": (IncidentUserDefinedRoleDataAttributesResponse,), + "id": (UUID,), + "relationships": (IncidentUserDefinedRoleRelationshipsResponse,), + "type": (IncidentUserDefinedRoleType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: IncidentUserDefinedRoleDataAttributesResponse, + id: UUID, + type: IncidentUserDefinedRoleType, + relationships: Union[IncidentUserDefinedRoleRelationshipsResponse, UnsetType] = unset, + **kwargs, + ): + """ + Data for an incident user-defined role response. + + :param attributes: Attributes of an incident user-defined role. + :type attributes: IncidentUserDefinedRoleDataAttributesResponse + + :param id: The ID of the user-defined role. + :type id: UUID + + :param relationships: Relationships of a user-defined role response. + :type relationships: IncidentUserDefinedRoleRelationshipsResponse, optional + + :param type: Incident user-defined role resource type. + :type type: IncidentUserDefinedRoleType + """ + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_incident_type_relationship.py b/src/datadog_api_client/v2/model/incident_user_defined_role_incident_type_relationship.py new file mode 100644 index 0000000000..375018ad6e --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_incident_type_relationship.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_user_defined_role_incident_type_relationship_data import ( + IncidentUserDefinedRoleIncidentTypeRelationshipData, + ) + + +class IncidentUserDefinedRoleIncidentTypeRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_user_defined_role_incident_type_relationship_data import ( + IncidentUserDefinedRoleIncidentTypeRelationshipData, + ) + + return { + "data": (IncidentUserDefinedRoleIncidentTypeRelationshipData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IncidentUserDefinedRoleIncidentTypeRelationshipData, **kwargs): + """ + Relationship to an incident type for a user-defined role. + + :param data: Data for the incident type relationship of a user-defined role. + :type data: IncidentUserDefinedRoleIncidentTypeRelationshipData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_incident_type_relationship_data.py b/src/datadog_api_client/v2/model/incident_user_defined_role_incident_type_relationship_data.py new file mode 100644 index 0000000000..0340f732ce --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_incident_type_relationship_data.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +class IncidentUserDefinedRoleIncidentTypeRelationshipData(ModelNormal): + @cached_property + def openapi_types(_): + return { + "id": (UUID,), + "type": (str,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: UUID, type: str, **kwargs): + """ + Data for the incident type relationship of a user-defined role. + + :param id: The ID of the incident type. + :type id: UUID + + :param type: The type of the resource. + :type type: str + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_included_item.py b/src/datadog_api_client/v2/model/incident_user_defined_role_included_item.py new file mode 100644 index 0000000000..dac2e95845 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_included_item.py @@ -0,0 +1,49 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class IncidentUserDefinedRoleIncludedItem(ModelComposed): + def __init__(self, **kwargs): + """ + A single included resource in a user-defined role response. + + :param attributes: Attributes of user object returned by the API. + :type attributes: IncidentUserAttributes, optional + + :param id: ID of the user. + :type id: str, optional + + :param type: Users resource type. + :type type: UsersType, optional + + :param relationships: The incident type's resource relationships. + :type relationships: IncidentTypeRelationships, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.incident_user_data import IncidentUserData + from datadog_api_client.v2.model.incident_type_object import IncidentTypeObject + + return { + "oneOf": [ + IncidentUserData, + IncidentTypeObject, + ], + } diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_patch_data_attributes_request.py b/src/datadog_api_client/v2/model/incident_user_defined_role_patch_data_attributes_request.py new file mode 100644 index 0000000000..9109a4aa7c --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_patch_data_attributes_request.py @@ -0,0 +1,63 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_user_defined_role_policy import IncidentUserDefinedRolePolicy + + +class IncidentUserDefinedRolePatchDataAttributesRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_user_defined_role_policy import IncidentUserDefinedRolePolicy + + return { + "description": (str, none_type), + "name": (str,), + "policy": (IncidentUserDefinedRolePolicy,), + } + + attribute_map = { + "description": "description", + "name": "name", + "policy": "policy", + } + + def __init__( + self_, + description: Union[str, none_type, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + policy: Union[IncidentUserDefinedRolePolicy, UnsetType] = unset, + **kwargs, + ): + """ + Attributes for updating an incident user-defined role. + + :param description: A description of the user-defined role. + :type description: str, none_type, optional + + :param name: The name of the user-defined role. + :type name: str, optional + + :param policy: Policy configuration for a user-defined role. + :type policy: IncidentUserDefinedRolePolicy, optional + """ + if description is not unset: + kwargs["description"] = description + if name is not unset: + kwargs["name"] = name + if policy is not unset: + kwargs["policy"] = policy + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_patch_data_request.py b/src/datadog_api_client/v2/model/incident_user_defined_role_patch_data_request.py new file mode 100644 index 0000000000..6f3b0a9483 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_patch_data_request.py @@ -0,0 +1,68 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_user_defined_role_patch_data_attributes_request import ( + IncidentUserDefinedRolePatchDataAttributesRequest, + ) + from datadog_api_client.v2.model.incident_user_defined_role_type import IncidentUserDefinedRoleType + + +class IncidentUserDefinedRolePatchDataRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_user_defined_role_patch_data_attributes_request import ( + IncidentUserDefinedRolePatchDataAttributesRequest, + ) + from datadog_api_client.v2.model.incident_user_defined_role_type import IncidentUserDefinedRoleType + + return { + "attributes": (IncidentUserDefinedRolePatchDataAttributesRequest,), + "id": (UUID,), + "type": (IncidentUserDefinedRoleType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + id: UUID, + type: IncidentUserDefinedRoleType, + attributes: Union[IncidentUserDefinedRolePatchDataAttributesRequest, UnsetType] = unset, + **kwargs, + ): + """ + Data for updating an incident user-defined role. + + :param attributes: Attributes for updating an incident user-defined role. + :type attributes: IncidentUserDefinedRolePatchDataAttributesRequest, optional + + :param id: The ID of the user-defined role to update. + :type id: UUID + + :param type: Incident user-defined role resource type. + :type type: IncidentUserDefinedRoleType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_patch_request.py b/src/datadog_api_client/v2/model/incident_user_defined_role_patch_request.py new file mode 100644 index 0000000000..54ff9b3ec2 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_patch_request.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_user_defined_role_patch_data_request import ( + IncidentUserDefinedRolePatchDataRequest, + ) + + +class IncidentUserDefinedRolePatchRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_user_defined_role_patch_data_request import ( + IncidentUserDefinedRolePatchDataRequest, + ) + + return { + "data": (IncidentUserDefinedRolePatchDataRequest,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IncidentUserDefinedRolePatchDataRequest, **kwargs): + """ + Request for updating an incident user-defined role. + + :param data: Data for updating an incident user-defined role. + :type data: IncidentUserDefinedRolePatchDataRequest + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_policy.py b/src/datadog_api_client/v2/model/incident_user_defined_role_policy.py new file mode 100644 index 0000000000..34ac1bd933 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_policy.py @@ -0,0 +1,33 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class IncidentUserDefinedRolePolicy(ModelNormal): + @cached_property + def openapi_types(_): + return { + "is_single": (bool,), + } + + attribute_map = { + "is_single": "is_single", + } + + def __init__(self_, is_single: bool, **kwargs): + """ + Policy configuration for a user-defined role. + + :param is_single: Whether this role can only be assigned to one responder at a time. + :type is_single: bool + """ + super().__init__(kwargs) + + self_.is_single = is_single diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_relationships_request.py b/src/datadog_api_client/v2/model/incident_user_defined_role_relationships_request.py new file mode 100644 index 0000000000..2b61cace72 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_relationships_request.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_user_defined_role_incident_type_relationship import ( + IncidentUserDefinedRoleIncidentTypeRelationship, + ) + + +class IncidentUserDefinedRoleRelationshipsRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_user_defined_role_incident_type_relationship import ( + IncidentUserDefinedRoleIncidentTypeRelationship, + ) + + return { + "incident_type": (IncidentUserDefinedRoleIncidentTypeRelationship,), + } + + attribute_map = { + "incident_type": "incident_type", + } + + def __init__(self_, incident_type: IncidentUserDefinedRoleIncidentTypeRelationship, **kwargs): + """ + Relationships for creating a user-defined role. + + :param incident_type: Relationship to an incident type for a user-defined role. + :type incident_type: IncidentUserDefinedRoleIncidentTypeRelationship + """ + super().__init__(kwargs) + + self_.incident_type = incident_type diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_relationships_response.py b/src/datadog_api_client/v2/model/incident_user_defined_role_relationships_response.py new file mode 100644 index 0000000000..04468b3268 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_relationships_response.py @@ -0,0 +1,68 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser + from datadog_api_client.v2.model.incident_user_defined_role_incident_type_relationship import ( + IncidentUserDefinedRoleIncidentTypeRelationship, + ) + + +class IncidentUserDefinedRoleRelationshipsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser + from datadog_api_client.v2.model.incident_user_defined_role_incident_type_relationship import ( + IncidentUserDefinedRoleIncidentTypeRelationship, + ) + + return { + "created_by_user": (RelationshipToUser,), + "incident_type": (IncidentUserDefinedRoleIncidentTypeRelationship,), + "last_modified_by_user": (RelationshipToUser,), + } + + attribute_map = { + "created_by_user": "created_by_user", + "incident_type": "incident_type", + "last_modified_by_user": "last_modified_by_user", + } + + def __init__( + self_, + created_by_user: Union[RelationshipToUser, UnsetType] = unset, + incident_type: Union[IncidentUserDefinedRoleIncidentTypeRelationship, UnsetType] = unset, + last_modified_by_user: Union[RelationshipToUser, UnsetType] = unset, + **kwargs, + ): + """ + Relationships of a user-defined role response. + + :param created_by_user: Relationship to user. + :type created_by_user: RelationshipToUser, optional + + :param incident_type: Relationship to an incident type for a user-defined role. + :type incident_type: IncidentUserDefinedRoleIncidentTypeRelationship, optional + + :param last_modified_by_user: Relationship to user. + :type last_modified_by_user: RelationshipToUser, optional + """ + if created_by_user is not unset: + kwargs["created_by_user"] = created_by_user + if incident_type is not unset: + kwargs["incident_type"] = incident_type + if last_modified_by_user is not unset: + kwargs["last_modified_by_user"] = last_modified_by_user + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_request.py b/src/datadog_api_client/v2/model/incident_user_defined_role_request.py new file mode 100644 index 0000000000..a27c5b2a19 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_request.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_user_defined_role_data_request import IncidentUserDefinedRoleDataRequest + + +class IncidentUserDefinedRoleRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_user_defined_role_data_request import ( + IncidentUserDefinedRoleDataRequest, + ) + + return { + "data": (IncidentUserDefinedRoleDataRequest,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: IncidentUserDefinedRoleDataRequest, **kwargs): + """ + Request for creating an incident user-defined role. + + :param data: Data for creating an incident user-defined role. + :type data: IncidentUserDefinedRoleDataRequest + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_response.py b/src/datadog_api_client/v2/model/incident_user_defined_role_response.py new file mode 100644 index 0000000000..4c7ad8d567 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_response.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_user_defined_role_data_response import IncidentUserDefinedRoleDataResponse + from datadog_api_client.v2.model.incident_user_defined_role_included_item import IncidentUserDefinedRoleIncludedItem + from datadog_api_client.v2.model.incident_user_data import IncidentUserData + from datadog_api_client.v2.model.incident_type_object import IncidentTypeObject + + +class IncidentUserDefinedRoleResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_user_defined_role_data_response import ( + IncidentUserDefinedRoleDataResponse, + ) + from datadog_api_client.v2.model.incident_user_defined_role_included_item import ( + IncidentUserDefinedRoleIncludedItem, + ) + + return { + "data": (IncidentUserDefinedRoleDataResponse,), + "included": ([IncidentUserDefinedRoleIncludedItem],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: IncidentUserDefinedRoleDataResponse, + included: Union[ + List[Union[IncidentUserDefinedRoleIncludedItem, IncidentUserData, IncidentTypeObject]], UnsetType + ] = unset, + **kwargs, + ): + """ + Response with a single incident user-defined role. + + :param data: Data for an incident user-defined role response. + :type data: IncidentUserDefinedRoleDataResponse + + :param included: Included resources for an incident user-defined role response. + :type included: [IncidentUserDefinedRoleIncludedItem], optional + """ + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/incident_user_defined_role_type.py b/src/datadog_api_client/v2/model/incident_user_defined_role_type.py new file mode 100644 index 0000000000..ee6fa6ca64 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_role_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class IncidentUserDefinedRoleType(ModelSimple): + """ + Incident user-defined role resource type. + + :param value: If omitted defaults to "incident_user_defined_roles". Must be one of ["incident_user_defined_roles"]. + :type value: str + """ + + allowed_values = { + "incident_user_defined_roles", + } + INCIDENT_USER_DEFINED_ROLES: ClassVar["IncidentUserDefinedRoleType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +IncidentUserDefinedRoleType.INCIDENT_USER_DEFINED_ROLES = IncidentUserDefinedRoleType("incident_user_defined_roles") diff --git a/src/datadog_api_client/v2/model/incident_user_defined_roles_response.py b/src/datadog_api_client/v2/model/incident_user_defined_roles_response.py new file mode 100644 index 0000000000..ec81cbae31 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_user_defined_roles_response.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_user_defined_role_data_response import IncidentUserDefinedRoleDataResponse + from datadog_api_client.v2.model.incident_user_defined_role_included_item import IncidentUserDefinedRoleIncludedItem + from datadog_api_client.v2.model.incident_user_data import IncidentUserData + from datadog_api_client.v2.model.incident_type_object import IncidentTypeObject + + +class IncidentUserDefinedRolesResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_user_defined_role_data_response import ( + IncidentUserDefinedRoleDataResponse, + ) + from datadog_api_client.v2.model.incident_user_defined_role_included_item import ( + IncidentUserDefinedRoleIncludedItem, + ) + + return { + "data": ([IncidentUserDefinedRoleDataResponse],), + "included": ([IncidentUserDefinedRoleIncludedItem],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: List[IncidentUserDefinedRoleDataResponse], + included: Union[ + List[Union[IncidentUserDefinedRoleIncludedItem, IncidentUserData, IncidentTypeObject]], UnsetType + ] = unset, + **kwargs, + ): + """ + Response with a list of incident user-defined roles. + + :param data: List of incident user-defined role data objects. + :type data: [IncidentUserDefinedRoleDataResponse] + + :param included: Included resources for an incident user-defined role response. + :type included: [IncidentUserDefinedRoleIncludedItem], optional + """ + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 9150ec9563..227c26f95d 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -3612,6 +3612,39 @@ from datadog_api_client.v2.model.incident_user_defined_field_update_data import IncidentUserDefinedFieldUpdateData from datadog_api_client.v2.model.incident_user_defined_field_update_request import IncidentUserDefinedFieldUpdateRequest from datadog_api_client.v2.model.incident_user_defined_field_valid_value import IncidentUserDefinedFieldValidValue +from datadog_api_client.v2.model.incident_user_defined_role_data_attributes_request import ( + IncidentUserDefinedRoleDataAttributesRequest, +) +from datadog_api_client.v2.model.incident_user_defined_role_data_attributes_response import ( + IncidentUserDefinedRoleDataAttributesResponse, +) +from datadog_api_client.v2.model.incident_user_defined_role_data_request import IncidentUserDefinedRoleDataRequest +from datadog_api_client.v2.model.incident_user_defined_role_data_response import IncidentUserDefinedRoleDataResponse +from datadog_api_client.v2.model.incident_user_defined_role_incident_type_relationship import ( + IncidentUserDefinedRoleIncidentTypeRelationship, +) +from datadog_api_client.v2.model.incident_user_defined_role_incident_type_relationship_data import ( + IncidentUserDefinedRoleIncidentTypeRelationshipData, +) +from datadog_api_client.v2.model.incident_user_defined_role_included_item import IncidentUserDefinedRoleIncludedItem +from datadog_api_client.v2.model.incident_user_defined_role_patch_data_attributes_request import ( + IncidentUserDefinedRolePatchDataAttributesRequest, +) +from datadog_api_client.v2.model.incident_user_defined_role_patch_data_request import ( + IncidentUserDefinedRolePatchDataRequest, +) +from datadog_api_client.v2.model.incident_user_defined_role_patch_request import IncidentUserDefinedRolePatchRequest +from datadog_api_client.v2.model.incident_user_defined_role_policy import IncidentUserDefinedRolePolicy +from datadog_api_client.v2.model.incident_user_defined_role_relationships_request import ( + IncidentUserDefinedRoleRelationshipsRequest, +) +from datadog_api_client.v2.model.incident_user_defined_role_relationships_response import ( + IncidentUserDefinedRoleRelationshipsResponse, +) +from datadog_api_client.v2.model.incident_user_defined_role_request import IncidentUserDefinedRoleRequest +from datadog_api_client.v2.model.incident_user_defined_role_response import IncidentUserDefinedRoleResponse +from datadog_api_client.v2.model.incident_user_defined_role_type import IncidentUserDefinedRoleType +from datadog_api_client.v2.model.incident_user_defined_roles_response import IncidentUserDefinedRolesResponse from datadog_api_client.v2.model.incidents_response import IncidentsResponse from datadog_api_client.v2.model.include_type import IncludeType from datadog_api_client.v2.model.input_schema import InputSchema @@ -12488,6 +12521,23 @@ "IncidentUserDefinedFieldUpdateData", "IncidentUserDefinedFieldUpdateRequest", "IncidentUserDefinedFieldValidValue", + "IncidentUserDefinedRoleDataAttributesRequest", + "IncidentUserDefinedRoleDataAttributesResponse", + "IncidentUserDefinedRoleDataRequest", + "IncidentUserDefinedRoleDataResponse", + "IncidentUserDefinedRoleIncidentTypeRelationship", + "IncidentUserDefinedRoleIncidentTypeRelationshipData", + "IncidentUserDefinedRoleIncludedItem", + "IncidentUserDefinedRolePatchDataAttributesRequest", + "IncidentUserDefinedRolePatchDataRequest", + "IncidentUserDefinedRolePatchRequest", + "IncidentUserDefinedRolePolicy", + "IncidentUserDefinedRoleRelationshipsRequest", + "IncidentUserDefinedRoleRelationshipsResponse", + "IncidentUserDefinedRoleRequest", + "IncidentUserDefinedRoleResponse", + "IncidentUserDefinedRoleType", + "IncidentUserDefinedRolesResponse", "IncidentsResponse", "IncludeType", "InputSchema", diff --git a/tests/v2/features/incidents.feature b/tests/v2/features/incidents.feature index 62c70d5c56..1b993a1ff2 100644 --- a/tests/v2/features/incidents.feature +++ b/tests/v2/features/incidents.feature @@ -210,6 +210,22 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app + Scenario: Create an incident user-defined role returns "Bad Request" response + Given operation "CreateIncidentUserDefinedRole" enabled + And new "CreateIncidentUserDefinedRole" request + And body with value {"data": {"attributes": {"description": "The technical lead for the incident.", "name": "Tech Lead", "policy": {"is_single": true}}, "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000001", "type": "incident_types"}}}, "type": "incident_user_defined_roles"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Create an incident user-defined role returns "Created" response + Given operation "CreateIncidentUserDefinedRole" enabled + And new "CreateIncidentUserDefinedRole" request + And body with value {"data": {"attributes": {"description": "The technical lead for the incident.", "name": "Tech Lead", "policy": {"is_single": true}}, "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000001", "type": "incident_types"}}}, "type": "incident_user_defined_roles"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:DataDog/incident-app Scenario: Create global incident handle returns "Bad Request" response Given operation "CreateGlobalIncidentHandle" enabled @@ -530,6 +546,30 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app + Scenario: Delete an incident user-defined role returns "Bad Request" response + Given operation "DeleteIncidentUserDefinedRole" enabled + And new "DeleteIncidentUserDefinedRole" request + And request contains "role_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Delete an incident user-defined role returns "No Content" response + Given operation "DeleteIncidentUserDefinedRole" enabled + And new "DeleteIncidentUserDefinedRole" request + And request contains "role_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/incident-app + Scenario: Delete an incident user-defined role returns "Not Found" response + Given operation "DeleteIncidentUserDefinedRole" enabled + And new "DeleteIncidentUserDefinedRole" request + And request contains "role_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app Scenario: Delete global incident handle returns "Bad Request" response Given operation "DeleteGlobalIncidentHandle" enabled @@ -781,6 +821,30 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Get an incident user-defined role returns "Bad Request" response + Given operation "GetIncidentUserDefinedRole" enabled + And new "GetIncidentUserDefinedRole" request + And request contains "role_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Get an incident user-defined role returns "Not Found" response + Given operation "GetIncidentUserDefinedRole" enabled + And new "GetIncidentUserDefinedRole" request + And request contains "role_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/incident-app + Scenario: Get an incident user-defined role returns "OK" response + Given operation "GetIncidentUserDefinedRole" enabled + And new "GetIncidentUserDefinedRole" request + And request contains "role_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Get global incident settings returns "Bad Request" response Given operation "GetGlobalIncidentSettings" enabled @@ -1108,6 +1172,20 @@ Feature: Incidents Then the response status is 200 OK And the response "data" has length 0 + @generated @skip @team:DataDog/incident-app + Scenario: List incident user-defined roles returns "Bad Request" response + Given operation "ListIncidentUserDefinedRoles" enabled + And new "ListIncidentUserDefinedRoles" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: List incident user-defined roles returns "OK" response + Given operation "ListIncidentUserDefinedRoles" enabled + And new "ListIncidentUserDefinedRoles" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: List postmortem templates returns "Bad Request" response Given operation "ListIncidentPostmortemTemplates" enabled @@ -1348,6 +1426,33 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Update an incident user-defined role returns "Bad Request" response + Given operation "UpdateIncidentUserDefinedRole" enabled + And new "UpdateIncidentUserDefinedRole" request + And request contains "role_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "The technical lead for the incident.", "name": "Tech Lead", "policy": {"is_single": true}}, "id": "00000000-0000-0000-0000-000000000002", "type": "incident_user_defined_roles"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Update an incident user-defined role returns "Not Found" response + Given operation "UpdateIncidentUserDefinedRole" enabled + And new "UpdateIncidentUserDefinedRole" request + And request contains "role_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "The technical lead for the incident.", "name": "Tech Lead", "policy": {"is_single": true}}, "id": "00000000-0000-0000-0000-000000000002", "type": "incident_user_defined_roles"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/incident-app + Scenario: Update an incident user-defined role returns "OK" response + Given operation "UpdateIncidentUserDefinedRole" enabled + And new "UpdateIncidentUserDefinedRole" request + And request contains "role_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "The technical lead for the incident.", "name": "Tech Lead", "policy": {"is_single": true}}, "id": "00000000-0000-0000-0000-000000000002", "type": "incident_user_defined_roles"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Update global incident handle returns "Bad Request" response Given operation "UpdateGlobalIncidentHandle" enabled diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index cbfa3f2078..0343899141 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -3115,6 +3115,43 @@ "type": "idempotent" } }, + "ListIncidentUserDefinedRoles": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "CreateIncidentUserDefinedRole": { + "tag": "Incidents", + "undo": { + "operationId": "DeleteIncidentUserDefinedRole", + "parameters": [ + { + "name": "role_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteIncidentUserDefinedRole": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "GetIncidentUserDefinedRole": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "UpdateIncidentUserDefinedRole": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, "ImportIncident": { "tag": "Incidents", "undo": {