diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index cfbcb7286a..5fbf15ba4f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -178,6 +178,15 @@ components: required: true schema: type: string + AttachmentIncludeQueryParameter: + description: 'Resource to include in the response. Supported value: `last_modified_by_user`.' + explode: false + in: query + name: include + required: false + schema: + example: last_modified_by_user + type: string AuthNMappingID: description: The UUID of the AuthN Mapping. in: path @@ -458,26 +467,6 @@ components: items: $ref: '#/components/schemas/GetIssueIncludeQueryParameterItem' type: array - IncidentAttachmentFilterQueryParameter: - description: Specifies which types of attachments are included in the response. - explode: false - in: query - name: filter[attachment_type] - required: false - schema: - items: - $ref: '#/components/schemas/IncidentAttachmentAttachmentType' - type: array - IncidentAttachmentIncludeQueryParameter: - description: Specifies which types of related objects are included in the response. - explode: false - in: query - name: include - required: false - schema: - items: - $ref: '#/components/schemas/IncidentAttachmentRelatedObject' - type: array IncidentIDPathParameter: description: The UUID of the incident. in: path @@ -5358,6 +5347,124 @@ components: - findings - project type: object + Attachment: + properties: + data: + $ref: '#/components/schemas/AttachmentData' + included: + items: + $ref: '#/components/schemas/AttachmentIncluded' + type: array + type: object + AttachmentArray: + properties: + data: + example: + - attributes: + attachment: + documentUrl: https://app.datadoghq.com/notebook/123/Postmortem-IR-123 + title: Postmortem IR-123 + attachment_type: postmortem + modified: '2025-01-01T01:01:01.000000001Z' + id: 00000000-abcd-0002-0000-000000000000 + relationships: + last_modified_by_user: + data: + id: 00000000-0000-0000-cccc-000000000000 + type: users + type: incident_attachments + items: + $ref: '#/components/schemas/AttachmentData' + type: array + included: + items: + $ref: '#/components/schemas/AttachmentIncluded' + type: array + required: + - data + type: object + AttachmentData: + example: + attributes: + attachment: + documentUrl: https://app.datadoghq.com/notebook/123/Postmortem-IR-123 + title: Postmortem IR-123 + attachment_type: postmortem + modified: '2025-01-01T01:01:01.000000001Z' + id: 00000000-abcd-0002-0000-000000000000 + relationships: + last_modified_by_user: + data: + id: 00000000-0000-0000-cccc-000000000000 + type: users + type: incident_attachments + properties: + attributes: + $ref: '#/components/schemas/AttachmentDataAttributes' + id: + example: 00000000-abcd-0002-0000-000000000000 + type: string + relationships: + $ref: '#/components/schemas/AttachmentDataRelationships' + type: + $ref: '#/components/schemas/IncidentAttachmentType' + required: + - type + - attributes + - relationships + - id + type: object + AttachmentDataAttributes: + properties: + attachment: + $ref: '#/components/schemas/AttachmentDataAttributesAttachment' + attachment_type: + $ref: '#/components/schemas/AttachmentDataAttributesAttachmentType' + modified: + format: date-time + type: string + type: object + AttachmentDataAttributesAttachment: + properties: + documentUrl: + type: string + title: + type: string + type: object + AttachmentDataAttributesAttachmentType: + enum: + - postmortem + - link + type: string + x-enum-varnames: + - POSTMORTEM + - LINK + AttachmentDataRelationships: + properties: + last_modified_by_user: + $ref: '#/components/schemas/AttachmentDataRelationshipsLastModifiedByUser' + type: object + AttachmentDataRelationshipsLastModifiedByUser: + properties: + data: + $ref: '#/components/schemas/AttachmentDataRelationshipsLastModifiedByUserData' + required: + - data + type: object + AttachmentDataRelationshipsLastModifiedByUserData: + properties: + id: + example: '' + type: string + type: + $ref: '#/components/schemas/UserType' + required: + - type + - id + type: object + AttachmentIncluded: + oneOf: + - $ref: '#/components/schemas/User140420082644000' AuditLogsEvent: description: Object description of an Audit Logs event after it is processed and stored by Datadog. @@ -12894,6 +13001,45 @@ components: required: - type type: object + CreateAttachmentRequest: + example: + data: + attributes: + attachment: + documentUrl: https://app.datadoghq.com/notebook/123/Postmortem-IR-123 + title: Postmortem-IR-123 + attachment_type: postmortem + id: 00000000-0000-0000-0000-000000000000 + type: incident_attachments + properties: + data: + $ref: '#/components/schemas/CreateAttachmentRequestData' + type: object + CreateAttachmentRequestData: + properties: + attributes: + $ref: '#/components/schemas/CreateAttachmentRequestDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/IncidentAttachmentType' + required: + - type + type: object + CreateAttachmentRequestDataAttributes: + properties: + attachment: + $ref: '#/components/schemas/CreateAttachmentRequestDataAttributesAttachment' + attachment_type: + $ref: '#/components/schemas/AttachmentDataAttributesAttachmentType' + type: object + CreateAttachmentRequestDataAttributesAttachment: + properties: + documentUrl: + type: string + title: + type: string + type: object CreateCaseRequestArray: description: List of requests to create cases for security findings. properties: @@ -25665,126 +25811,6 @@ components: type: string x-mimetype: application/xml type: object - IncidentAttachmentAttachmentType: - description: The type of the incident attachment attributes. - enum: - - link - - postmortem - example: link - type: string - x-enum-varnames: - - LINK - - POSTMORTEM - IncidentAttachmentAttributes: - description: The attributes object for an attachment. - oneOf: - - $ref: '#/components/schemas/IncidentAttachmentPostmortemAttributes' - - $ref: '#/components/schemas/IncidentAttachmentLinkAttributes' - IncidentAttachmentData: - description: A single incident attachment. - example: - attributes: - attachment: - documentUrl: '' - title: Postmortem IR-123 - attachment_type: postmortem - id: 00000000-abcd-0002-0000-000000000000 - relationships: - last_modified_by_user: - data: - id: 00000000-0000-0000-cccc-000000000000 - type: users - type: incident_attachments - properties: - attributes: - $ref: '#/components/schemas/IncidentAttachmentAttributes' - id: - description: A unique identifier that represents the incident attachment. - example: 00000000-abcd-0001-0000-000000000000 - type: string - relationships: - $ref: '#/components/schemas/IncidentAttachmentRelationships' - type: - $ref: '#/components/schemas/IncidentAttachmentType' - required: - - type - - attributes - - id - - relationships - type: object - IncidentAttachmentLinkAttachmentType: - default: link - description: The type of link attachment attributes. - enum: - - link - example: link - type: string - x-enum-varnames: - - LINK - IncidentAttachmentLinkAttributes: - description: The attributes object for a link attachment. - properties: - attachment: - $ref: '#/components/schemas/IncidentAttachmentLinkAttributesAttachmentObject' - attachment_type: - $ref: '#/components/schemas/IncidentAttachmentLinkAttachmentType' - modified: - description: Timestamp when the incident attachment link was last modified. - format: date-time - readOnly: true - type: string - required: - - attachment_type - - attachment - type: object - IncidentAttachmentLinkAttributesAttachmentObject: - description: The link attachment. - properties: - documentUrl: - description: The URL of this link attachment. - example: https://www.example.com/webstore-failure-runbook - type: string - title: - description: The title of this link attachment. - example: Runbook for webstore service failures - type: string - required: - - documentUrl - - title - type: object - IncidentAttachmentPostmortemAttachmentType: - default: postmortem - description: The type of postmortem attachment attributes. - enum: - - postmortem - example: postmortem - type: string - x-enum-varnames: - - POSTMORTEM - IncidentAttachmentPostmortemAttributes: - description: The attributes object for a postmortem attachment. - properties: - attachment: - $ref: '#/components/schemas/IncidentAttachmentsPostmortemAttributesAttachmentObject' - attachment_type: - $ref: '#/components/schemas/IncidentAttachmentPostmortemAttachmentType' - required: - - attachment_type - - attachment - type: object - IncidentAttachmentRelatedObject: - description: The object related to an incident attachment. - enum: - - users - type: string - x-enum-varnames: - - USERS - IncidentAttachmentRelationships: - description: The incident attachment's relationships. - properties: - last_modified_by_user: - $ref: '#/components/schemas/RelationshipToUser' - type: object IncidentAttachmentType: default: incident_attachments description: The incident attachment resource type. @@ -25794,142 +25820,6 @@ components: type: string x-enum-varnames: - INCIDENT_ATTACHMENTS - IncidentAttachmentUpdateAttributes: - description: Incident attachment attributes. - oneOf: - - $ref: '#/components/schemas/IncidentAttachmentPostmortemAttributes' - - $ref: '#/components/schemas/IncidentAttachmentLinkAttributes' - IncidentAttachmentUpdateData: - description: A single incident attachment. - properties: - attributes: - $ref: '#/components/schemas/IncidentAttachmentUpdateAttributes' - id: - description: A unique identifier that represents the incident attachment. - example: 00000000-abcd-0001-0000-000000000000 - type: string - type: - $ref: '#/components/schemas/IncidentAttachmentType' - required: - - type - type: object - IncidentAttachmentUpdateRequest: - description: The update request for an incident's attachments. - properties: - data: - description: 'An array of incident attachments. An attachment object without - an "id" key indicates that you want to - - create that attachment. An attachment object without an "attributes" key - indicates that you want to - - delete that attachment. An attachment object with both the "id" key and - a populated "attributes" object - - indicates that you want to update that attachment.' - example: - - attributes: - attachment: - documentUrl: https://app.datadoghq.com/notebook/123 - title: Postmortem IR-123 - attachment_type: postmortem - id: 00000000-abcd-0002-0000-000000000000 - type: incident_attachments - - attributes: - attachment: - documentUrl: https://www.example.com/webstore-failure-runbook - title: Runbook for webstore service failures - attachment_type: link - type: incident_attachments - - id: 00000000-abcd-0003-0000-000000000000 - type: incident_attachments - items: - $ref: '#/components/schemas/IncidentAttachmentUpdateData' - type: array - required: - - data - type: object - IncidentAttachmentUpdateResponse: - description: The response object containing the created or updated incident - attachments. - properties: - data: - description: 'An array of incident attachments. Only the attachments that - were created or updated by the request are - - returned.' - example: - - attributes: - attachment: - documentUrl: '' - title: Postmortem IR-123 - attachment_type: postmortem - id: 00000000-abcd-0002-0000-000000000000 - relationships: - last_modified_by_user: - data: - id: 00000000-0000-0000-cccc-000000000000 - type: users - type: incident_attachments - items: - $ref: '#/components/schemas/IncidentAttachmentData' - type: array - included: - description: Included related resources that the user requested. - items: - $ref: '#/components/schemas/IncidentAttachmentsResponseIncludedItem' - type: array - required: - - data - type: object - IncidentAttachmentsPostmortemAttributesAttachmentObject: - description: The postmortem attachment. - properties: - documentUrl: - description: The URL of this notebook attachment. - example: https://app.datadoghq.com/notebook/123 - type: string - title: - description: The title of this postmortem attachment. - example: Postmortem IR-123 - type: string - required: - - documentUrl - - title - type: object - IncidentAttachmentsResponse: - description: The response object containing an incident's attachments. - properties: - data: - description: An array of incident attachments. - example: - - attributes: - attachment: - documentUrl: '' - title: Postmortem IR-123 - attachment_type: postmortem - id: 00000000-abcd-0002-0000-000000000000 - relationships: - last_modified_by_user: - data: - id: 00000000-0000-0000-cccc-000000000000 - type: users - type: incident_attachments - items: - $ref: '#/components/schemas/IncidentAttachmentData' - type: array - included: - description: Included related resources that the user requested. - items: - $ref: '#/components/schemas/IncidentAttachmentsResponseIncludedItem' - type: array - required: - - data - type: object - IncidentAttachmentsResponseIncludedItem: - description: An object related to an attachment that is included in the response. - oneOf: - - $ref: '#/components/schemas/User' IncidentCreateAttributes: description: The incident's attributes for a create request. properties: @@ -27200,7 +27090,7 @@ components: description: An object related to an incident that is included in the response. oneOf: - $ref: '#/components/schemas/IncidentUserData' - - $ref: '#/components/schemas/IncidentAttachmentData' + - $ref: '#/components/schemas/AttachmentData' IncidentResponseMeta: description: The metadata object containing pagination metadata. properties: @@ -40203,6 +40093,41 @@ components: $ref: '#/components/schemas/ApplicationKeyResponseIncludedItem' type: array type: object + PatchAttachmentRequest: + example: + data: + attributes: + attachment: + documentUrl: https://app.datadoghq.com/notebook/124/Postmortem-IR-124 + title: Postmortem-IR-124 + type: incident_attachments + properties: + data: + $ref: '#/components/schemas/PatchAttachmentRequestData' + type: object + PatchAttachmentRequestData: + properties: + attributes: + $ref: '#/components/schemas/PatchAttachmentRequestDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/IncidentAttachmentType' + required: + - type + type: object + PatchAttachmentRequestDataAttributes: + properties: + attachment: + $ref: '#/components/schemas/PatchAttachmentRequestDataAttributesAttachment' + type: object + PatchAttachmentRequestDataAttributesAttachment: + properties: + documentUrl: + type: string + title: + type: string + type: object PatchIncidentNotificationTemplateRequest: description: Update request for a notification template. properties: @@ -56984,6 +56909,17 @@ components: type: $ref: '#/components/schemas/UsersType' type: object + User140420082644000: + properties: + attributes: + $ref: '#/components/schemas/UserAttributes' + id: + type: string + type: + $ref: '#/components/schemas/UserType' + required: + - type + type: object UserAttributes: description: Attributes of user object returned by the API. properties: @@ -57434,6 +57370,15 @@ components: meta: $ref: '#/components/schemas/TeamsResponseMeta' type: object + UserType: + default: users + description: Users resource type. + enum: + - users + example: users + type: string + x-enum-varnames: + - USERS UserUpdateAttributes: description: Attributes of the edited user. properties: @@ -68712,8 +68657,7 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - incident_notification_settings_read + - AuthZ: [] summary: List incident notification rules tags: - Incidents @@ -68912,8 +68856,7 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - incident_settings_read + - AuthZ: [] summary: List incident notification templates tags: - Incidents @@ -69028,7 +68971,8 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: - - incident_settings_read + - incident_read + - incident_write summary: Get incident notification template tags: - Incidents @@ -69118,6 +69062,7 @@ paths: x-permission: operator: OR permissions: + - incident_settings_read - incident_read x-unstable: '**Note**: This endpoint is in public beta. @@ -69159,7 +69104,7 @@ paths: - Incidents x-codegen-request-body-name: body x-permission: - operator: OR + operator: AND permissions: - incident_settings_write x-unstable: '**Note**: This endpoint is in public beta. @@ -69449,80 +69394,166 @@ paths: If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/{incident_id}/attachments: get: - description: Get all attachments for a given incident. + description: List incident attachments. operationId: ListIncidentAttachments parameters: - $ref: '#/components/parameters/IncidentIDPathParameter' - - $ref: '#/components/parameters/IncidentAttachmentIncludeQueryParameter' - - $ref: '#/components/parameters/IncidentAttachmentFilterQueryParameter' + - description: Filter attachments by type. Supported values are `1` (`postmortem`) + and `2` (`link`). + in: query + name: filter[attachment_type] + schema: + example: '1' + type: string + - $ref: '#/components/parameters/AttachmentIncludeQueryParameter' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/IncidentAttachmentsResponse' + $ref: '#/components/schemas/AttachmentArray' description: OK '400': $ref: '#/components/responses/BadRequestResponse' - '401': - $ref: '#/components/responses/UnauthorizedResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List incident attachments + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_read + x-unstable: '**Note**: This endpoint is in Preview. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create an incident attachment. + operationId: CreateIncidentAttachment + parameters: + - $ref: '#/components/parameters/IncidentIDPathParameter' + - $ref: '#/components/parameters/AttachmentIncludeQueryParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAttachmentRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/Attachment' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Create incident attachment + tags: + - Incidents + x-permission: + operator: AND + permissions: + - incident_write + x-unstable: '**Note**: This endpoint is in Preview. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/{incident_id}/attachments/{attachment_id}: + delete: + operationId: DeleteIncidentAttachment + parameters: + - $ref: '#/components/parameters/IncidentIDPathParameter' + - description: The ID of the attachment. + in: path + name: attachment_id + required: true + schema: + example: 00000000-0000-0000-0000-000000000002 + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/BadRequestResponse' '403': $ref: '#/components/responses/ForbiddenResponse' '404': $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Get a list of attachments + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Delete incident attachment tags: - Incidents x-permission: - operator: OR + operator: AND permissions: - - incident_read - x-unstable: '**Note**: This endpoint is in public beta. + - incident_write + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' patch: - deprecated: true - description: The bulk update endpoint for creating, updating, and deleting attachments - for a given incident. - operationId: UpdateIncidentAttachments + operationId: UpdateIncidentAttachment parameters: - $ref: '#/components/parameters/IncidentIDPathParameter' - - $ref: '#/components/parameters/IncidentAttachmentIncludeQueryParameter' + - description: The ID of the attachment. + in: path + name: attachment_id + required: true + schema: + example: 00000000-0000-0000-0000-000000000002 + - $ref: '#/components/parameters/AttachmentIncludeQueryParameter' requestBody: content: application/json: schema: - $ref: '#/components/schemas/IncidentAttachmentUpdateRequest' - description: Incident Attachment Payload. + $ref: '#/components/schemas/PatchAttachmentRequest' required: true responses: '200': content: application/json: schema: - $ref: '#/components/schemas/IncidentAttachmentUpdateResponse' + $ref: '#/components/schemas/Attachment' description: OK '400': $ref: '#/components/responses/BadRequestResponse' - '401': - $ref: '#/components/responses/UnauthorizedResponse' '403': $ref: '#/components/responses/ForbiddenResponse' '404': $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - summary: Create, update, and delete incident attachments + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Update incident attachment tags: - Incidents - x-codegen-request-body-name: body x-permission: - operator: OR + operator: AND permissions: - incident_write - x-unstable: '**Note**: This endpoint is deprecated.' + x-unstable: '**Note**: This endpoint is in Preview. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/{incident_id}/impacts: get: description: Get all impacts for an incident. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 6220d558aa..623a3ec2d7 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -1271,6 +1271,76 @@ datadog\_api\_client.v2.model.attach\_jira\_issue\_request\_data\_relationships :members: :show-inheritance: +datadog\_api\_client.v2.model.attachment module +----------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attachment + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attachment\_array module +------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.attachment_array + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attachment\_data module +----------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attachment_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attachment\_data\_attributes module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attachment_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attachment\_data\_attributes\_attachment module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attachment_data_attributes_attachment + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attachment\_data\_attributes\_attachment\_type module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attachment_data_attributes_attachment_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attachment\_data\_relationships module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attachment_data_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attachment\_data\_relationships\_last\_modified\_by\_user module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attachment_data_relationships_last_modified_by_user + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attachment\_data\_relationships\_last\_modified\_by\_user\_data module +---------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attachment_data_relationships_last_modified_by_user_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.attachment\_included module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.attachment_included + :members: + :show-inheritance: + datadog\_api\_client.v2.model.audit\_logs\_event module ------------------------------------------------------- @@ -5128,6 +5198,34 @@ datadog\_api\_client.v2.model.create\_apps\_datastore\_response\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_attachment\_request module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_attachment_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_attachment\_request\_data module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_attachment_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_attachment\_request\_data\_attributes module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_attachment_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_attachment\_request\_data\_attributes\_attachment module +---------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_attachment_request_data_attributes_attachment + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_case\_request\_array module ----------------------------------------------------------------- @@ -10833,76 +10931,6 @@ datadog\_api\_client.v2.model.idp\_metadata\_form\_data module :members: :show-inheritance: -datadog\_api\_client.v2.model.incident\_attachment\_attachment\_type module ---------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachment_attachment_type - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachment\_attributes module ---------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachment_attributes - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachment\_data module ---------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachment_data - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachment\_link\_attachment\_type module ---------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachment_link_attachment_type - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachment\_link\_attributes module ---------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachment_link_attributes - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachment\_link\_attributes\_attachment\_object module ------------------------------------------------------------------------------------------------ - -.. automodule:: datadog_api_client.v2.model.incident_attachment_link_attributes_attachment_object - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachment\_postmortem\_attachment\_type module ---------------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachment_postmortem_attachment_type - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachment\_postmortem\_attributes module ---------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachment_postmortem_attributes - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachment\_related\_object module --------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachment_related_object - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachment\_relationships module ------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachment_relationships - :members: - :show-inheritance: - datadog\_api\_client.v2.model.incident\_attachment\_type module --------------------------------------------------------------- @@ -10910,55 +10938,6 @@ datadog\_api\_client.v2.model.incident\_attachment\_type module :members: :show-inheritance: -datadog\_api\_client.v2.model.incident\_attachment\_update\_attributes module ------------------------------------------------------------------------------ - -.. automodule:: datadog_api_client.v2.model.incident_attachment_update_attributes - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachment\_update\_data module ------------------------------------------------------------------------ - -.. automodule:: datadog_api_client.v2.model.incident_attachment_update_data - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachment\_update\_request module --------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachment_update_request - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachment\_update\_response module ---------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachment_update_response - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachments\_postmortem\_attributes\_attachment\_object module ------------------------------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachments_postmortem_attributes_attachment_object - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachments\_response module --------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachments_response - :members: - :show-inheritance: - -datadog\_api\_client.v2.model.incident\_attachments\_response\_included\_item module ------------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.incident_attachments_response_included_item - :members: - :show-inheritance: - datadog\_api\_client.v2.model.incident\_create\_attributes module ----------------------------------------------------------------- @@ -17602,6 +17581,34 @@ datadog\_api\_client.v2.model.partial\_application\_key\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.patch\_attachment\_request module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.patch_attachment_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.patch\_attachment\_request\_data module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.patch_attachment_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.patch\_attachment\_request\_data\_attributes module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.patch_attachment_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.patch\_attachment\_request\_data\_attributes\_attachment module +--------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.patch_attachment_request_data_attributes_attachment + :members: + :show-inheritance: + datadog\_api\_client.v2.model.patch\_incident\_notification\_template\_request module ------------------------------------------------------------------------------------- @@ -25225,6 +25232,13 @@ datadog\_api\_client.v2.model.user module :members: :show-inheritance: +datadog\_api\_client.v2.model.user140420082644000 module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user140420082644000 + :members: + :show-inheritance: + datadog\_api\_client.v2.model.user\_attributes module ----------------------------------------------------- @@ -25491,6 +25505,13 @@ datadog\_api\_client.v2.model.user\_teams\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.user\_type module +----------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.user_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.user\_update\_attributes module ------------------------------------------------------------- diff --git a/examples/v2/incidents/CreateIncidentAttachment.py b/examples/v2/incidents/CreateIncidentAttachment.py new file mode 100644 index 0000000000..30390926b9 --- /dev/null +++ b/examples/v2/incidents/CreateIncidentAttachment.py @@ -0,0 +1,38 @@ +""" +Create incident attachment 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.attachment_data_attributes_attachment_type import ( + AttachmentDataAttributesAttachmentType, +) +from datadog_api_client.v2.model.create_attachment_request import CreateAttachmentRequest +from datadog_api_client.v2.model.create_attachment_request_data import CreateAttachmentRequestData +from datadog_api_client.v2.model.create_attachment_request_data_attributes import CreateAttachmentRequestDataAttributes +from datadog_api_client.v2.model.create_attachment_request_data_attributes_attachment import ( + CreateAttachmentRequestDataAttributesAttachment, +) +from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType + +body = CreateAttachmentRequest( + data=CreateAttachmentRequestData( + attributes=CreateAttachmentRequestDataAttributes( + attachment=CreateAttachmentRequestDataAttributesAttachment( + document_url="https://app.datadoghq.com/notebook/123/Postmortem-IR-123", + title="Postmortem-IR-123", + ), + attachment_type=AttachmentDataAttributesAttachmentType.POSTMORTEM, + ), + id="00000000-0000-0000-0000-000000000000", + type=IncidentAttachmentType.INCIDENT_ATTACHMENTS, + ), +) + +configuration = Configuration() +configuration.unstable_operations["create_incident_attachment"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.create_incident_attachment(incident_id="incident_id", body=body) + + print(response) diff --git a/examples/v2/incidents/DeleteIncidentAttachment.py b/examples/v2/incidents/DeleteIncidentAttachment.py new file mode 100644 index 0000000000..9452951746 --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentAttachment.py @@ -0,0 +1,15 @@ +""" +Delete incident attachment returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.incidents_api import IncidentsApi + +configuration = Configuration() +configuration.unstable_operations["delete_incident_attachment"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + api_instance.delete_incident_attachment( + incident_id="incident_id", + attachment_id="00000000-0000-0000-0000-000000000002", + ) diff --git a/examples/v2/incidents/ListIncidentAttachments.py b/examples/v2/incidents/ListIncidentAttachments.py index 77844b0696..4fa04f6fa4 100644 --- a/examples/v2/incidents/ListIncidentAttachments.py +++ b/examples/v2/incidents/ListIncidentAttachments.py @@ -1,5 +1,5 @@ """ -Get a list of attachments returns "OK" response +List incident attachments returns "OK" response """ from datadog_api_client import ApiClient, Configuration diff --git a/examples/v2/incidents/ListIncidentAttachments_2457735435.py b/examples/v2/incidents/ListIncidentAttachments_2457735435.py deleted file mode 100644 index 27087370ff..0000000000 --- a/examples/v2/incidents/ListIncidentAttachments_2457735435.py +++ /dev/null @@ -1,20 +0,0 @@ -""" -Get incident attachments returns "OK" response -""" - -from os import environ -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.incidents_api import IncidentsApi - -# there is a valid "incident" in the system -INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"] - -configuration = Configuration() -configuration.unstable_operations["list_incident_attachments"] = True -with ApiClient(configuration) as api_client: - api_instance = IncidentsApi(api_client) - response = api_instance.list_incident_attachments( - incident_id=INCIDENT_DATA_ID, - ) - - print(response) diff --git a/examples/v2/incidents/UpdateIncidentAttachment.py b/examples/v2/incidents/UpdateIncidentAttachment.py new file mode 100644 index 0000000000..343e298d67 --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentAttachment.py @@ -0,0 +1,35 @@ +""" +Update incident attachment 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_attachment_type import IncidentAttachmentType +from datadog_api_client.v2.model.patch_attachment_request import PatchAttachmentRequest +from datadog_api_client.v2.model.patch_attachment_request_data import PatchAttachmentRequestData +from datadog_api_client.v2.model.patch_attachment_request_data_attributes import PatchAttachmentRequestDataAttributes +from datadog_api_client.v2.model.patch_attachment_request_data_attributes_attachment import ( + PatchAttachmentRequestDataAttributesAttachment, +) + +body = PatchAttachmentRequest( + data=PatchAttachmentRequestData( + attributes=PatchAttachmentRequestDataAttributes( + attachment=PatchAttachmentRequestDataAttributesAttachment( + document_url="https://app.datadoghq.com/notebook/124/Postmortem-IR-124", + title="Postmortem-IR-124", + ), + ), + type=IncidentAttachmentType.INCIDENT_ATTACHMENTS, + ), +) + +configuration = Configuration() +configuration.unstable_operations["update_incident_attachment"] = True +with ApiClient(configuration) as api_client: + api_instance = IncidentsApi(api_client) + response = api_instance.update_incident_attachment( + incident_id="incident_id", attachment_id="00000000-0000-0000-0000-000000000002", body=body + ) + + print(response) diff --git a/examples/v2/incidents/UpdateIncidentAttachments.py b/examples/v2/incidents/UpdateIncidentAttachments.py deleted file mode 100644 index 9fd54ab3eb..0000000000 --- a/examples/v2/incidents/UpdateIncidentAttachments.py +++ /dev/null @@ -1,59 +0,0 @@ -""" -Create, update, and delete incident attachments 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_attachment_link_attachment_type import IncidentAttachmentLinkAttachmentType -from datadog_api_client.v2.model.incident_attachment_link_attributes import IncidentAttachmentLinkAttributes -from datadog_api_client.v2.model.incident_attachment_link_attributes_attachment_object import ( - IncidentAttachmentLinkAttributesAttachmentObject, -) -from datadog_api_client.v2.model.incident_attachment_postmortem_attachment_type import ( - IncidentAttachmentPostmortemAttachmentType, -) -from datadog_api_client.v2.model.incident_attachment_postmortem_attributes import IncidentAttachmentPostmortemAttributes -from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType -from datadog_api_client.v2.model.incident_attachment_update_data import IncidentAttachmentUpdateData -from datadog_api_client.v2.model.incident_attachment_update_request import IncidentAttachmentUpdateRequest -from datadog_api_client.v2.model.incident_attachments_postmortem_attributes_attachment_object import ( - IncidentAttachmentsPostmortemAttributesAttachmentObject, -) - -body = IncidentAttachmentUpdateRequest( - data=[ - IncidentAttachmentUpdateData( - attributes=IncidentAttachmentPostmortemAttributes( - attachment=IncidentAttachmentsPostmortemAttributesAttachmentObject( - document_url="https://app.datadoghq.com/notebook/123", - title="Postmortem IR-123", - ), - attachment_type=IncidentAttachmentPostmortemAttachmentType.POSTMORTEM, - ), - id="00000000-abcd-0002-0000-000000000000", - type=IncidentAttachmentType.INCIDENT_ATTACHMENTS, - ), - IncidentAttachmentUpdateData( - attributes=IncidentAttachmentLinkAttributes( - attachment=IncidentAttachmentLinkAttributesAttachmentObject( - document_url="https://www.example.com/webstore-failure-runbook", - title="Runbook for webstore service failures", - ), - attachment_type=IncidentAttachmentLinkAttachmentType.LINK, - ), - type=IncidentAttachmentType.INCIDENT_ATTACHMENTS, - ), - IncidentAttachmentUpdateData( - id="00000000-abcd-0003-0000-000000000000", - type=IncidentAttachmentType.INCIDENT_ATTACHMENTS, - ), - ], -) - -configuration = Configuration() -configuration.unstable_operations["update_incident_attachments"] = True -with ApiClient(configuration) as api_client: - api_instance = IncidentsApi(api_client) - response = api_instance.update_incident_attachments(incident_id="incident_id", body=body) - - print(response) diff --git a/examples/v2/incidents/UpdateIncidentAttachments_3881702075.py b/examples/v2/incidents/UpdateIncidentAttachments_3881702075.py deleted file mode 100644 index dc21748bdc..0000000000 --- a/examples/v2/incidents/UpdateIncidentAttachments_3881702075.py +++ /dev/null @@ -1,41 +0,0 @@ -""" -Create an incident attachment returns "OK" response -""" - -from os import environ -from datadog_api_client import ApiClient, Configuration -from datadog_api_client.v2.api.incidents_api import IncidentsApi -from datadog_api_client.v2.model.incident_attachment_link_attachment_type import IncidentAttachmentLinkAttachmentType -from datadog_api_client.v2.model.incident_attachment_link_attributes import IncidentAttachmentLinkAttributes -from datadog_api_client.v2.model.incident_attachment_link_attributes_attachment_object import ( - IncidentAttachmentLinkAttributesAttachmentObject, -) -from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType -from datadog_api_client.v2.model.incident_attachment_update_data import IncidentAttachmentUpdateData -from datadog_api_client.v2.model.incident_attachment_update_request import IncidentAttachmentUpdateRequest - -# there is a valid "incident" in the system -INCIDENT_DATA_ID = environ["INCIDENT_DATA_ID"] - -body = IncidentAttachmentUpdateRequest( - data=[ - IncidentAttachmentUpdateData( - type=IncidentAttachmentType.INCIDENT_ATTACHMENTS, - attributes=IncidentAttachmentLinkAttributes( - attachment_type=IncidentAttachmentLinkAttachmentType.LINK, - attachment=IncidentAttachmentLinkAttributesAttachmentObject( - document_url="https://www.example.com/doc", - title="Example-Incident", - ), - ), - ), - ], -) - -configuration = Configuration() -configuration.unstable_operations["update_incident_attachments"] = True -with ApiClient(configuration) as api_client: - api_instance = IncidentsApi(api_client) - response = api_instance.update_incident_attachments(incident_id=INCIDENT_DATA_ID, body=body) - - print(response) diff --git a/src/datadog_api_client/configuration.py b/src/datadog_api_client/configuration.py index e119326653..5f29613298 100644 --- a/src/datadog_api_client/configuration.py +++ b/src/datadog_api_client/configuration.py @@ -307,12 +307,14 @@ def __init__( "v2.update_deployment_gate": False, "v2.update_deployment_rule": False, "v2.create_incident": False, + "v2.create_incident_attachment": False, "v2.create_incident_integration": False, "v2.create_incident_notification_rule": False, "v2.create_incident_notification_template": False, "v2.create_incident_todo": False, "v2.create_incident_type": False, "v2.delete_incident": False, + "v2.delete_incident_attachment": False, "v2.delete_incident_integration": False, "v2.delete_incident_notification_rule": False, "v2.delete_incident_notification_template": False, @@ -333,7 +335,7 @@ def __init__( "v2.list_incident_types": False, "v2.search_incidents": False, "v2.update_incident": False, - "v2.update_incident_attachments": False, + "v2.update_incident_attachment": False, "v2.update_incident_integration": False, "v2.update_incident_notification_rule": False, "v2.update_incident_notification_template": False, diff --git a/src/datadog_api_client/v2/api/incidents_api.py b/src/datadog_api_client/v2/api/incidents_api.py index bbb01474ab..d19d26b253 100644 --- a/src/datadog_api_client/v2/api/incidents_api.py +++ b/src/datadog_api_client/v2/api/incidents_api.py @@ -5,13 +5,15 @@ import collections from typing import Any, Dict, List, Union -import warnings from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration from datadog_api_client.model_utils import ( + date, + datetime, set_attribute_from_path, get_attribute_from_path, + none_type, UnsetType, unset, UUID, @@ -41,11 +43,10 @@ from datadog_api_client.v2.model.incident_search_sort_order import IncidentSearchSortOrder from datadog_api_client.v2.model.incident_search_response_incidents_data import IncidentSearchResponseIncidentsData from datadog_api_client.v2.model.incident_update_request import IncidentUpdateRequest -from datadog_api_client.v2.model.incident_attachments_response import IncidentAttachmentsResponse -from datadog_api_client.v2.model.incident_attachment_related_object import IncidentAttachmentRelatedObject -from datadog_api_client.v2.model.incident_attachment_attachment_type import IncidentAttachmentAttachmentType -from datadog_api_client.v2.model.incident_attachment_update_response import IncidentAttachmentUpdateResponse -from datadog_api_client.v2.model.incident_attachment_update_request import IncidentAttachmentUpdateRequest +from datadog_api_client.v2.model.attachment_array import AttachmentArray +from datadog_api_client.v2.model.attachment import Attachment +from datadog_api_client.v2.model.create_attachment_request import CreateAttachmentRequest +from datadog_api_client.v2.model.patch_attachment_request import PatchAttachmentRequest from datadog_api_client.v2.model.incident_impacts_response import IncidentImpactsResponse from datadog_api_client.v2.model.incident_impact_related_object import IncidentImpactRelatedObject from datadog_api_client.v2.model.incident_impact_response import IncidentImpactResponse @@ -96,6 +97,37 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._create_incident_attachment_endpoint = _Endpoint( + settings={ + "response_type": (Attachment,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/incidents/{incident_id}/attachments", + "operation_id": "create_incident_attachment", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "incident_id": { + "required": True, + "openapi_types": (str,), + "attribute": "incident_id", + "location": "path", + }, + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", + }, + "body": { + "required": True, + "openapi_types": (CreateAttachmentRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_incident_impact_endpoint = _Endpoint( settings={ "response_type": (IncidentImpactResponse,), @@ -263,6 +295,46 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_incident_attachment_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/incidents/{incident_id}/attachments/{attachment_id}", + "operation_id": "delete_incident_attachment", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "incident_id": { + "required": True, + "openapi_types": (str,), + "attribute": "incident_id", + "location": "path", + }, + "attachment_id": { + "required": True, + "openapi_types": ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ), + "attribute": "attachment_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._delete_incident_impact_endpoint = _Endpoint( settings={ "response_type": None, @@ -597,7 +669,7 @@ def __init__(self, api_client=None): self._list_incident_attachments_endpoint = _Endpoint( settings={ - "response_type": (IncidentAttachmentsResponse,), + "response_type": (AttachmentArray,), "auth": ["apiKeyAuth", "appKeyAuth"], "endpoint_path": "/api/v2/incidents/{incident_id}/attachments", "operation_id": "list_incident_attachments", @@ -611,17 +683,15 @@ def __init__(self, api_client=None): "attribute": "incident_id", "location": "path", }, - "include": { - "openapi_types": ([IncidentAttachmentRelatedObject],), - "attribute": "include", - "location": "query", - "collection_format": "csv", - }, "filter_attachment_type": { - "openapi_types": ([IncidentAttachmentAttachmentType],), + "openapi_types": (str,), "attribute": "filter[attachment_type]", "location": "query", - "collection_format": "csv", + }, + "include": { + "openapi_types": (str,), + "attribute": "include", + "location": "query", }, }, headers_map={ @@ -884,12 +954,12 @@ def __init__(self, api_client=None): api_client=api_client, ) - self._update_incident_attachments_endpoint = _Endpoint( + self._update_incident_attachment_endpoint = _Endpoint( settings={ - "response_type": (IncidentAttachmentUpdateResponse,), - "auth": ["apiKeyAuth", "appKeyAuth"], - "endpoint_path": "/api/v2/incidents/{incident_id}/attachments", - "operation_id": "update_incident_attachments", + "response_type": (Attachment,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/incidents/{incident_id}/attachments/{attachment_id}", + "operation_id": "update_incident_attachment", "http_method": "PATCH", "version": "v2", }, @@ -900,15 +970,31 @@ def __init__(self, api_client=None): "attribute": "incident_id", "location": "path", }, + "attachment_id": { + "required": True, + "openapi_types": ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ), + "attribute": "attachment_id", + "location": "path", + }, "include": { - "openapi_types": ([IncidentAttachmentRelatedObject],), + "openapi_types": (str,), "attribute": "include", "location": "query", - "collection_format": "csv", }, "body": { "required": True, - "openapi_types": (IncidentAttachmentUpdateRequest,), + "openapi_types": (PatchAttachmentRequest,), "location": "body", }, }, @@ -1085,6 +1171,34 @@ def create_incident( return self._create_incident_endpoint.call_with_http_info(**kwargs) + def create_incident_attachment( + self, + incident_id: str, + body: CreateAttachmentRequest, + *, + include: Union[str, UnsetType] = unset, + ) -> Attachment: + """Create incident attachment. + + Create an incident attachment. + + :param incident_id: The UUID of the incident. + :type incident_id: str + :type body: CreateAttachmentRequest + :param include: Resource to include in the response. Supported value: ``last_modified_by_user``. + :type include: str, optional + :rtype: Attachment + """ + kwargs: Dict[str, Any] = {} + kwargs["incident_id"] = incident_id + + if include is not unset: + kwargs["include"] = include + + kwargs["body"] = body + + return self._create_incident_attachment_endpoint.call_with_http_info(**kwargs) + def create_incident_impact( self, incident_id: str, @@ -1224,6 +1338,26 @@ def delete_incident( return self._delete_incident_endpoint.call_with_http_info(**kwargs) + def delete_incident_attachment( + self, + incident_id: str, + attachment_id: Any, + ) -> None: + """Delete incident attachment. + + :param incident_id: The UUID of the incident. + :type incident_id: str + :param attachment_id: The ID of the attachment. + :type attachment_id: bool, date, datetime, dict, float, int, list, str, UUID, none_type + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["incident_id"] = incident_id + + kwargs["attachment_id"] = attachment_id + + return self._delete_incident_attachment_endpoint.call_with_http_info(**kwargs) + def delete_incident_impact( self, incident_id: str, @@ -1492,30 +1626,30 @@ def list_incident_attachments( self, incident_id: str, *, - include: Union[List[IncidentAttachmentRelatedObject], UnsetType] = unset, - filter_attachment_type: Union[List[IncidentAttachmentAttachmentType], UnsetType] = unset, - ) -> IncidentAttachmentsResponse: - """Get a list of attachments. + filter_attachment_type: Union[str, UnsetType] = unset, + include: Union[str, UnsetType] = unset, + ) -> AttachmentArray: + """List incident attachments. - Get all attachments for a given incident. + List incident attachments. :param incident_id: The UUID of the incident. :type incident_id: str - :param include: Specifies which types of related objects are included in the response. - :type include: [IncidentAttachmentRelatedObject], optional - :param filter_attachment_type: Specifies which types of attachments are included in the response. - :type filter_attachment_type: [IncidentAttachmentAttachmentType], optional - :rtype: IncidentAttachmentsResponse + :param filter_attachment_type: Filter attachments by type. Supported values are ``1`` ( ``postmortem`` ) and ``2`` ( ``link`` ). + :type filter_attachment_type: str, optional + :param include: Resource to include in the response. Supported value: ``last_modified_by_user``. + :type include: str, optional + :rtype: AttachmentArray """ kwargs: Dict[str, Any] = {} kwargs["incident_id"] = incident_id - if include is not unset: - kwargs["include"] = include - if filter_attachment_type is not unset: kwargs["filter_attachment_type"] = filter_attachment_type + if include is not unset: + kwargs["include"] = include + return self._list_incident_attachments_endpoint.call_with_http_info(**kwargs) def list_incident_impacts( @@ -1842,35 +1976,36 @@ def update_incident( return self._update_incident_endpoint.call_with_http_info(**kwargs) - def update_incident_attachments( + def update_incident_attachment( self, incident_id: str, - body: IncidentAttachmentUpdateRequest, + attachment_id: Any, + body: PatchAttachmentRequest, *, - include: Union[List[IncidentAttachmentRelatedObject], UnsetType] = unset, - ) -> IncidentAttachmentUpdateResponse: - """Create, update, and delete incident attachments. **Deprecated**. - - The bulk update endpoint for creating, updating, and deleting attachments for a given incident. + include: Union[str, UnsetType] = unset, + ) -> Attachment: + """Update incident attachment. :param incident_id: The UUID of the incident. :type incident_id: str - :param body: Incident Attachment Payload. - :type body: IncidentAttachmentUpdateRequest - :param include: Specifies which types of related objects are included in the response. - :type include: [IncidentAttachmentRelatedObject], optional - :rtype: IncidentAttachmentUpdateResponse + :param attachment_id: The ID of the attachment. + :type attachment_id: bool, date, datetime, dict, float, int, list, str, UUID, none_type + :type body: PatchAttachmentRequest + :param include: Resource to include in the response. Supported value: ``last_modified_by_user``. + :type include: str, optional + :rtype: Attachment """ kwargs: Dict[str, Any] = {} kwargs["incident_id"] = incident_id + kwargs["attachment_id"] = attachment_id + if include is not unset: kwargs["include"] = include kwargs["body"] = body - warnings.warn("update_incident_attachments is deprecated", DeprecationWarning, stacklevel=2) - return self._update_incident_attachments_endpoint.call_with_http_info(**kwargs) + return self._update_incident_attachment_endpoint.call_with_http_info(**kwargs) def update_incident_integration( self, diff --git a/src/datadog_api_client/v2/model/attachment.py b/src/datadog_api_client/v2/model/attachment.py new file mode 100644 index 0000000000..b248f297cf --- /dev/null +++ b/src/datadog_api_client/v2/model/attachment.py @@ -0,0 +1,57 @@ +# 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.attachment_data import AttachmentData + from datadog_api_client.v2.model.attachment_included import AttachmentIncluded + from datadog_api_client.v2.model.user140420082644000 import User140420082644000 + + +class Attachment(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.attachment_data import AttachmentData + from datadog_api_client.v2.model.attachment_included import AttachmentIncluded + + return { + "data": (AttachmentData,), + "included": ([AttachmentIncluded],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: Union[AttachmentData, UnsetType] = unset, + included: Union[List[Union[AttachmentIncluded, User140420082644000]], UnsetType] = unset, + **kwargs, + ): + """ + + + :param data: + :type data: AttachmentData, optional + + :param included: + :type included: [AttachmentIncluded], optional + """ + if data is not unset: + kwargs["data"] = data + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/attachment_array.py b/src/datadog_api_client/v2/model/attachment_array.py new file mode 100644 index 0000000000..a5d86c0ba3 --- /dev/null +++ b/src/datadog_api_client/v2/model/attachment_array.py @@ -0,0 +1,57 @@ +# 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.attachment_data import AttachmentData + from datadog_api_client.v2.model.attachment_included import AttachmentIncluded + from datadog_api_client.v2.model.user140420082644000 import User140420082644000 + + +class AttachmentArray(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.attachment_data import AttachmentData + from datadog_api_client.v2.model.attachment_included import AttachmentIncluded + + return { + "data": ([AttachmentData],), + "included": ([AttachmentIncluded],), + } + + attribute_map = { + "data": "data", + "included": "included", + } + + def __init__( + self_, + data: List[AttachmentData], + included: Union[List[Union[AttachmentIncluded, User140420082644000]], UnsetType] = unset, + **kwargs, + ): + """ + + + :param data: + :type data: [AttachmentData] + + :param included: + :type included: [AttachmentIncluded], optional + """ + if included is not unset: + kwargs["included"] = included + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/attachment_data.py b/src/datadog_api_client/v2/model/attachment_data.py new file mode 100644 index 0000000000..1a583fe20b --- /dev/null +++ b/src/datadog_api_client/v2/model/attachment_data.py @@ -0,0 +1,69 @@ +# 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.attachment_data_attributes import AttachmentDataAttributes + from datadog_api_client.v2.model.attachment_data_relationships import AttachmentDataRelationships + from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType + + +class AttachmentData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.attachment_data_attributes import AttachmentDataAttributes + from datadog_api_client.v2.model.attachment_data_relationships import AttachmentDataRelationships + from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType + + return { + "attributes": (AttachmentDataAttributes,), + "id": (str,), + "relationships": (AttachmentDataRelationships,), + "type": (IncidentAttachmentType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: AttachmentDataAttributes, + id: str, + relationships: AttachmentDataRelationships, + type: IncidentAttachmentType, + **kwargs, + ): + """ + + + :param attributes: + :type attributes: AttachmentDataAttributes + + :param id: + :type id: str + + :param relationships: + :type relationships: AttachmentDataRelationships + + :param type: The incident attachment resource type. + :type type: IncidentAttachmentType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.relationships = relationships + self_.type = type diff --git a/src/datadog_api_client/v2/model/attachment_data_attributes.py b/src/datadog_api_client/v2/model/attachment_data_attributes.py new file mode 100644 index 0000000000..3e995c346b --- /dev/null +++ b/src/datadog_api_client/v2/model/attachment_data_attributes.py @@ -0,0 +1,69 @@ +# 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, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.attachment_data_attributes_attachment import AttachmentDataAttributesAttachment + from datadog_api_client.v2.model.attachment_data_attributes_attachment_type import ( + AttachmentDataAttributesAttachmentType, + ) + + +class AttachmentDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.attachment_data_attributes_attachment import AttachmentDataAttributesAttachment + from datadog_api_client.v2.model.attachment_data_attributes_attachment_type import ( + AttachmentDataAttributesAttachmentType, + ) + + return { + "attachment": (AttachmentDataAttributesAttachment,), + "attachment_type": (AttachmentDataAttributesAttachmentType,), + "modified": (datetime,), + } + + attribute_map = { + "attachment": "attachment", + "attachment_type": "attachment_type", + "modified": "modified", + } + + def __init__( + self_, + attachment: Union[AttachmentDataAttributesAttachment, UnsetType] = unset, + attachment_type: Union[AttachmentDataAttributesAttachmentType, UnsetType] = unset, + modified: Union[datetime, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attachment: + :type attachment: AttachmentDataAttributesAttachment, optional + + :param attachment_type: + :type attachment_type: AttachmentDataAttributesAttachmentType, optional + + :param modified: + :type modified: datetime, optional + """ + if attachment is not unset: + kwargs["attachment"] = attachment + if attachment_type is not unset: + kwargs["attachment_type"] = attachment_type + if modified is not unset: + kwargs["modified"] = modified + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_attachments_postmortem_attributes_attachment_object.py b/src/datadog_api_client/v2/model/attachment_data_attributes_attachment.py similarity index 56% rename from src/datadog_api_client/v2/model/incident_attachments_postmortem_attributes_attachment_object.py rename to src/datadog_api_client/v2/model/attachment_data_attributes_attachment.py index 014683fd42..0a219db83f 100644 --- a/src/datadog_api_client/v2/model/incident_attachments_postmortem_attributes_attachment_object.py +++ b/src/datadog_api_client/v2/model/attachment_data_attributes_attachment.py @@ -3,14 +3,17 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations +from typing import Union from datadog_api_client.model_utils import ( ModelNormal, cached_property, + unset, + UnsetType, ) -class IncidentAttachmentsPostmortemAttributesAttachmentObject(ModelNormal): +class AttachmentDataAttributesAttachment(ModelNormal): @cached_property def openapi_types(_): return { @@ -23,17 +26,18 @@ def openapi_types(_): "title": "title", } - def __init__(self_, document_url: str, title: str, **kwargs): + def __init__(self_, document_url: Union[str, UnsetType] = unset, title: Union[str, UnsetType] = unset, **kwargs): """ - The postmortem attachment. - :param document_url: The URL of this notebook attachment. - :type document_url: str - :param title: The title of this postmortem attachment. - :type title: str + :param document_url: + :type document_url: str, optional + + :param title: + :type title: str, optional """ + if document_url is not unset: + kwargs["document_url"] = document_url + if title is not unset: + kwargs["title"] = title super().__init__(kwargs) - - self_.document_url = document_url - self_.title = title diff --git a/src/datadog_api_client/v2/model/incident_attachment_attachment_type.py b/src/datadog_api_client/v2/model/attachment_data_attributes_attachment_type.py similarity index 56% rename from src/datadog_api_client/v2/model/incident_attachment_attachment_type.py rename to src/datadog_api_client/v2/model/attachment_data_attributes_attachment_type.py index e8d61187bf..6e17c64531 100644 --- a/src/datadog_api_client/v2/model/incident_attachment_attachment_type.py +++ b/src/datadog_api_client/v2/model/attachment_data_attributes_attachment_type.py @@ -12,20 +12,20 @@ from typing import ClassVar -class IncidentAttachmentAttachmentType(ModelSimple): +class AttachmentDataAttributesAttachmentType(ModelSimple): """ - The type of the incident attachment attributes. - :param value: Must be one of ["link", "postmortem"]. + + :param value: Must be one of ["postmortem", "link"]. :type value: str """ allowed_values = { - "link", "postmortem", + "link", } - LINK: ClassVar["IncidentAttachmentAttachmentType"] - POSTMORTEM: ClassVar["IncidentAttachmentAttachmentType"] + POSTMORTEM: ClassVar["AttachmentDataAttributesAttachmentType"] + LINK: ClassVar["AttachmentDataAttributesAttachmentType"] @cached_property def openapi_types(_): @@ -34,5 +34,5 @@ def openapi_types(_): } -IncidentAttachmentAttachmentType.LINK = IncidentAttachmentAttachmentType("link") -IncidentAttachmentAttachmentType.POSTMORTEM = IncidentAttachmentAttachmentType("postmortem") +AttachmentDataAttributesAttachmentType.POSTMORTEM = AttachmentDataAttributesAttachmentType("postmortem") +AttachmentDataAttributesAttachmentType.LINK = AttachmentDataAttributesAttachmentType("link") diff --git a/src/datadog_api_client/v2/model/incident_attachment_relationships.py b/src/datadog_api_client/v2/model/attachment_data_relationships.py similarity index 51% rename from src/datadog_api_client/v2/model/incident_attachment_relationships.py rename to src/datadog_api_client/v2/model/attachment_data_relationships.py index 06e4beba54..ff4c93bfa0 100644 --- a/src/datadog_api_client/v2/model/incident_attachment_relationships.py +++ b/src/datadog_api_client/v2/model/attachment_data_relationships.py @@ -14,28 +14,34 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser + from datadog_api_client.v2.model.attachment_data_relationships_last_modified_by_user import ( + AttachmentDataRelationshipsLastModifiedByUser, + ) -class IncidentAttachmentRelationships(ModelNormal): +class AttachmentDataRelationships(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser + from datadog_api_client.v2.model.attachment_data_relationships_last_modified_by_user import ( + AttachmentDataRelationshipsLastModifiedByUser, + ) return { - "last_modified_by_user": (RelationshipToUser,), + "last_modified_by_user": (AttachmentDataRelationshipsLastModifiedByUser,), } attribute_map = { "last_modified_by_user": "last_modified_by_user", } - def __init__(self_, last_modified_by_user: Union[RelationshipToUser, UnsetType] = unset, **kwargs): + def __init__( + self_, last_modified_by_user: Union[AttachmentDataRelationshipsLastModifiedByUser, UnsetType] = unset, **kwargs + ): """ - The incident attachment's relationships. - :param last_modified_by_user: Relationship to user. - :type last_modified_by_user: RelationshipToUser, optional + + :param last_modified_by_user: + :type last_modified_by_user: AttachmentDataRelationshipsLastModifiedByUser, optional """ if last_modified_by_user is not unset: kwargs["last_modified_by_user"] = last_modified_by_user diff --git a/src/datadog_api_client/v2/model/attachment_data_relationships_last_modified_by_user.py b/src/datadog_api_client/v2/model/attachment_data_relationships_last_modified_by_user.py new file mode 100644 index 0000000000..92021caa6f --- /dev/null +++ b/src/datadog_api_client/v2/model/attachment_data_relationships_last_modified_by_user.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.attachment_data_relationships_last_modified_by_user_data import ( + AttachmentDataRelationshipsLastModifiedByUserData, + ) + + +class AttachmentDataRelationshipsLastModifiedByUser(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.attachment_data_relationships_last_modified_by_user_data import ( + AttachmentDataRelationshipsLastModifiedByUserData, + ) + + return { + "data": (AttachmentDataRelationshipsLastModifiedByUserData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: AttachmentDataRelationshipsLastModifiedByUserData, **kwargs): + """ + + + :param data: + :type data: AttachmentDataRelationshipsLastModifiedByUserData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/attachment_data_relationships_last_modified_by_user_data.py b/src/datadog_api_client/v2/model/attachment_data_relationships_last_modified_by_user_data.py new file mode 100644 index 0000000000..c6c6eaf76c --- /dev/null +++ b/src/datadog_api_client/v2/model/attachment_data_relationships_last_modified_by_user_data.py @@ -0,0 +1,46 @@ +# 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.user_type import UserType + + +class AttachmentDataRelationshipsLastModifiedByUserData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_type import UserType + + return { + "id": (str,), + "type": (UserType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: UserType, **kwargs): + """ + + + :param id: + :type id: str + + :param type: Users resource type. + :type type: UserType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/incident_attachments_response_included_item.py b/src/datadog_api_client/v2/model/attachment_included.py similarity index 73% rename from src/datadog_api_client/v2/model/incident_attachments_response_included_item.py rename to src/datadog_api_client/v2/model/attachment_included.py index 43647c252b..ad6043416b 100644 --- a/src/datadog_api_client/v2/model/incident_attachments_response_included_item.py +++ b/src/datadog_api_client/v2/model/attachment_included.py @@ -10,22 +10,19 @@ ) -class IncidentAttachmentsResponseIncludedItem(ModelComposed): +class AttachmentIncluded(ModelComposed): def __init__(self, **kwargs): """ - An object related to an attachment that is included in the response. + :param attributes: Attributes of user object returned by the API. :type attributes: UserAttributes, optional - :param id: ID of the user. + :param id: :type id: str, optional - :param relationships: Relationships of the user object returned by the API. - :type relationships: UserResponseRelationships, optional - :param type: Users resource type. - :type type: UsersType, optional + :type type: UserType """ super().__init__(kwargs) @@ -38,10 +35,10 @@ def _composed_schemas(_): # 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.user import User + from datadog_api_client.v2.model.user140420082644000 import User140420082644000 return { "oneOf": [ - User, + User140420082644000, ], } diff --git a/src/datadog_api_client/v2/model/create_attachment_request.py b/src/datadog_api_client/v2/model/create_attachment_request.py new file mode 100644 index 0000000000..1e752d72af --- /dev/null +++ b/src/datadog_api_client/v2/model/create_attachment_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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_attachment_request_data import CreateAttachmentRequestData + + +class CreateAttachmentRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_attachment_request_data import CreateAttachmentRequestData + + return { + "data": (CreateAttachmentRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[CreateAttachmentRequestData, UnsetType] = unset, **kwargs): + """ + + + :param data: + :type data: CreateAttachmentRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_attachment_update_data.py b/src/datadog_api_client/v2/model/create_attachment_request_data.py similarity index 56% rename from src/datadog_api_client/v2/model/incident_attachment_update_data.py rename to src/datadog_api_client/v2/model/create_attachment_request_data.py index 2eb1a6f9fd..b573254b14 100644 --- a/src/datadog_api_client/v2/model/incident_attachment_update_data.py +++ b/src/datadog_api_client/v2/model/create_attachment_request_data.py @@ -14,22 +14,22 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.incident_attachment_update_attributes import IncidentAttachmentUpdateAttributes - from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType - from datadog_api_client.v2.model.incident_attachment_postmortem_attributes import ( - IncidentAttachmentPostmortemAttributes, + from datadog_api_client.v2.model.create_attachment_request_data_attributes import ( + CreateAttachmentRequestDataAttributes, ) - from datadog_api_client.v2.model.incident_attachment_link_attributes import IncidentAttachmentLinkAttributes + from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType -class IncidentAttachmentUpdateData(ModelNormal): +class CreateAttachmentRequestData(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.incident_attachment_update_attributes import IncidentAttachmentUpdateAttributes + from datadog_api_client.v2.model.create_attachment_request_data_attributes import ( + CreateAttachmentRequestDataAttributes, + ) from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType return { - "attributes": (IncidentAttachmentUpdateAttributes,), + "attributes": (CreateAttachmentRequestDataAttributes,), "id": (str,), "type": (IncidentAttachmentType,), } @@ -43,22 +43,17 @@ def openapi_types(_): def __init__( self_, type: IncidentAttachmentType, - attributes: Union[ - IncidentAttachmentUpdateAttributes, - IncidentAttachmentPostmortemAttributes, - IncidentAttachmentLinkAttributes, - UnsetType, - ] = unset, + attributes: Union[CreateAttachmentRequestDataAttributes, UnsetType] = unset, id: Union[str, UnsetType] = unset, **kwargs, ): """ - A single incident attachment. - :param attributes: Incident attachment attributes. - :type attributes: IncidentAttachmentUpdateAttributes, optional - :param id: A unique identifier that represents the incident attachment. + :param attributes: + :type attributes: CreateAttachmentRequestDataAttributes, optional + + :param id: :type id: str, optional :param type: The incident attachment resource type. diff --git a/src/datadog_api_client/v2/model/create_attachment_request_data_attributes.py b/src/datadog_api_client/v2/model/create_attachment_request_data_attributes.py new file mode 100644 index 0000000000..3fa35c5c4f --- /dev/null +++ b/src/datadog_api_client/v2/model/create_attachment_request_data_attributes.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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_attachment_request_data_attributes_attachment import ( + CreateAttachmentRequestDataAttributesAttachment, + ) + from datadog_api_client.v2.model.attachment_data_attributes_attachment_type import ( + AttachmentDataAttributesAttachmentType, + ) + + +class CreateAttachmentRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_attachment_request_data_attributes_attachment import ( + CreateAttachmentRequestDataAttributesAttachment, + ) + from datadog_api_client.v2.model.attachment_data_attributes_attachment_type import ( + AttachmentDataAttributesAttachmentType, + ) + + return { + "attachment": (CreateAttachmentRequestDataAttributesAttachment,), + "attachment_type": (AttachmentDataAttributesAttachmentType,), + } + + attribute_map = { + "attachment": "attachment", + "attachment_type": "attachment_type", + } + + def __init__( + self_, + attachment: Union[CreateAttachmentRequestDataAttributesAttachment, UnsetType] = unset, + attachment_type: Union[AttachmentDataAttributesAttachmentType, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attachment: + :type attachment: CreateAttachmentRequestDataAttributesAttachment, optional + + :param attachment_type: + :type attachment_type: AttachmentDataAttributesAttachmentType, optional + """ + if attachment is not unset: + kwargs["attachment"] = attachment + if attachment_type is not unset: + kwargs["attachment_type"] = attachment_type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/create_attachment_request_data_attributes_attachment.py b/src/datadog_api_client/v2/model/create_attachment_request_data_attributes_attachment.py new file mode 100644 index 0000000000..c770cbdcf7 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_attachment_request_data_attributes_attachment.py @@ -0,0 +1,43 @@ +# 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 + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class CreateAttachmentRequestDataAttributesAttachment(ModelNormal): + @cached_property + def openapi_types(_): + return { + "document_url": (str,), + "title": (str,), + } + + attribute_map = { + "document_url": "documentUrl", + "title": "title", + } + + def __init__(self_, document_url: Union[str, UnsetType] = unset, title: Union[str, UnsetType] = unset, **kwargs): + """ + + + :param document_url: + :type document_url: str, optional + + :param title: + :type title: str, optional + """ + if document_url is not unset: + kwargs["document_url"] = document_url + if title is not unset: + kwargs["title"] = title + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_attachment_attributes.py b/src/datadog_api_client/v2/model/incident_attachment_attributes.py deleted file mode 100644 index 72c8bdd6ba..0000000000 --- a/src/datadog_api_client/v2/model/incident_attachment_attributes.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 IncidentAttachmentAttributes(ModelComposed): - def __init__(self, **kwargs): - """ - The attributes object for an attachment. - - :param attachment: The postmortem attachment. - :type attachment: IncidentAttachmentsPostmortemAttributesAttachmentObject - - :param attachment_type: The type of postmortem attachment attributes. - :type attachment_type: IncidentAttachmentPostmortemAttachmentType - - :param modified: Timestamp when the incident attachment link was last modified. - :type modified: datetime, 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_attachment_postmortem_attributes import ( - IncidentAttachmentPostmortemAttributes, - ) - from datadog_api_client.v2.model.incident_attachment_link_attributes import IncidentAttachmentLinkAttributes - - return { - "oneOf": [ - IncidentAttachmentPostmortemAttributes, - IncidentAttachmentLinkAttributes, - ], - } diff --git a/src/datadog_api_client/v2/model/incident_attachment_data.py b/src/datadog_api_client/v2/model/incident_attachment_data.py deleted file mode 100644 index 05de54fb56..0000000000 --- a/src/datadog_api_client/v2/model/incident_attachment_data.py +++ /dev/null @@ -1,75 +0,0 @@ -# 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, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.incident_attachment_attributes import IncidentAttachmentAttributes - from datadog_api_client.v2.model.incident_attachment_relationships import IncidentAttachmentRelationships - from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType - from datadog_api_client.v2.model.incident_attachment_postmortem_attributes import ( - IncidentAttachmentPostmortemAttributes, - ) - from datadog_api_client.v2.model.incident_attachment_link_attributes import IncidentAttachmentLinkAttributes - - -class IncidentAttachmentData(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.incident_attachment_attributes import IncidentAttachmentAttributes - from datadog_api_client.v2.model.incident_attachment_relationships import IncidentAttachmentRelationships - from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType - - return { - "attributes": (IncidentAttachmentAttributes,), - "id": (str,), - "relationships": (IncidentAttachmentRelationships,), - "type": (IncidentAttachmentType,), - } - - attribute_map = { - "attributes": "attributes", - "id": "id", - "relationships": "relationships", - "type": "type", - } - - def __init__( - self_, - attributes: Union[ - IncidentAttachmentAttributes, IncidentAttachmentPostmortemAttributes, IncidentAttachmentLinkAttributes - ], - id: str, - relationships: IncidentAttachmentRelationships, - type: IncidentAttachmentType, - **kwargs, - ): - """ - A single incident attachment. - - :param attributes: The attributes object for an attachment. - :type attributes: IncidentAttachmentAttributes - - :param id: A unique identifier that represents the incident attachment. - :type id: str - - :param relationships: The incident attachment's relationships. - :type relationships: IncidentAttachmentRelationships - - :param type: The incident attachment resource type. - :type type: IncidentAttachmentType - """ - super().__init__(kwargs) - - self_.attributes = attributes - self_.id = id - self_.relationships = relationships - self_.type = type diff --git a/src/datadog_api_client/v2/model/incident_attachment_link_attachment_type.py b/src/datadog_api_client/v2/model/incident_attachment_link_attachment_type.py deleted file mode 100644 index 5b25244e21..0000000000 --- a/src/datadog_api_client/v2/model/incident_attachment_link_attachment_type.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 IncidentAttachmentLinkAttachmentType(ModelSimple): - """ - The type of link attachment attributes. - - :param value: If omitted defaults to "link". Must be one of ["link"]. - :type value: str - """ - - allowed_values = { - "link", - } - LINK: ClassVar["IncidentAttachmentLinkAttachmentType"] - - @cached_property - def openapi_types(_): - return { - "value": (str,), - } - - -IncidentAttachmentLinkAttachmentType.LINK = IncidentAttachmentLinkAttachmentType("link") diff --git a/src/datadog_api_client/v2/model/incident_attachment_link_attributes.py b/src/datadog_api_client/v2/model/incident_attachment_link_attributes.py deleted file mode 100644 index f1686b0878..0000000000 --- a/src/datadog_api_client/v2/model/incident_attachment_link_attributes.py +++ /dev/null @@ -1,75 +0,0 @@ -# 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, - unset, - UnsetType, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.incident_attachment_link_attributes_attachment_object import ( - IncidentAttachmentLinkAttributesAttachmentObject, - ) - from datadog_api_client.v2.model.incident_attachment_link_attachment_type import ( - IncidentAttachmentLinkAttachmentType, - ) - - -class IncidentAttachmentLinkAttributes(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.incident_attachment_link_attributes_attachment_object import ( - IncidentAttachmentLinkAttributesAttachmentObject, - ) - from datadog_api_client.v2.model.incident_attachment_link_attachment_type import ( - IncidentAttachmentLinkAttachmentType, - ) - - return { - "attachment": (IncidentAttachmentLinkAttributesAttachmentObject,), - "attachment_type": (IncidentAttachmentLinkAttachmentType,), - "modified": (datetime,), - } - - attribute_map = { - "attachment": "attachment", - "attachment_type": "attachment_type", - "modified": "modified", - } - read_only_vars = { - "modified", - } - - def __init__( - self_, - attachment: IncidentAttachmentLinkAttributesAttachmentObject, - attachment_type: IncidentAttachmentLinkAttachmentType, - modified: Union[datetime, UnsetType] = unset, - **kwargs, - ): - """ - The attributes object for a link attachment. - - :param attachment: The link attachment. - :type attachment: IncidentAttachmentLinkAttributesAttachmentObject - - :param attachment_type: The type of link attachment attributes. - :type attachment_type: IncidentAttachmentLinkAttachmentType - - :param modified: Timestamp when the incident attachment link was last modified. - :type modified: datetime, optional - """ - if modified is not unset: - kwargs["modified"] = modified - super().__init__(kwargs) - - self_.attachment = attachment - self_.attachment_type = attachment_type diff --git a/src/datadog_api_client/v2/model/incident_attachment_postmortem_attachment_type.py b/src/datadog_api_client/v2/model/incident_attachment_postmortem_attachment_type.py deleted file mode 100644 index 981a345a9d..0000000000 --- a/src/datadog_api_client/v2/model/incident_attachment_postmortem_attachment_type.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 IncidentAttachmentPostmortemAttachmentType(ModelSimple): - """ - The type of postmortem attachment attributes. - - :param value: If omitted defaults to "postmortem". Must be one of ["postmortem"]. - :type value: str - """ - - allowed_values = { - "postmortem", - } - POSTMORTEM: ClassVar["IncidentAttachmentPostmortemAttachmentType"] - - @cached_property - def openapi_types(_): - return { - "value": (str,), - } - - -IncidentAttachmentPostmortemAttachmentType.POSTMORTEM = IncidentAttachmentPostmortemAttachmentType("postmortem") diff --git a/src/datadog_api_client/v2/model/incident_attachment_postmortem_attributes.py b/src/datadog_api_client/v2/model/incident_attachment_postmortem_attributes.py deleted file mode 100644 index 7b1d593094..0000000000 --- a/src/datadog_api_client/v2/model/incident_attachment_postmortem_attributes.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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_attachments_postmortem_attributes_attachment_object import ( - IncidentAttachmentsPostmortemAttributesAttachmentObject, - ) - from datadog_api_client.v2.model.incident_attachment_postmortem_attachment_type import ( - IncidentAttachmentPostmortemAttachmentType, - ) - - -class IncidentAttachmentPostmortemAttributes(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.incident_attachments_postmortem_attributes_attachment_object import ( - IncidentAttachmentsPostmortemAttributesAttachmentObject, - ) - from datadog_api_client.v2.model.incident_attachment_postmortem_attachment_type import ( - IncidentAttachmentPostmortemAttachmentType, - ) - - return { - "attachment": (IncidentAttachmentsPostmortemAttributesAttachmentObject,), - "attachment_type": (IncidentAttachmentPostmortemAttachmentType,), - } - - attribute_map = { - "attachment": "attachment", - "attachment_type": "attachment_type", - } - - def __init__( - self_, - attachment: IncidentAttachmentsPostmortemAttributesAttachmentObject, - attachment_type: IncidentAttachmentPostmortemAttachmentType, - **kwargs, - ): - """ - The attributes object for a postmortem attachment. - - :param attachment: The postmortem attachment. - :type attachment: IncidentAttachmentsPostmortemAttributesAttachmentObject - - :param attachment_type: The type of postmortem attachment attributes. - :type attachment_type: IncidentAttachmentPostmortemAttachmentType - """ - super().__init__(kwargs) - - self_.attachment = attachment - self_.attachment_type = attachment_type diff --git a/src/datadog_api_client/v2/model/incident_attachment_update_attributes.py b/src/datadog_api_client/v2/model/incident_attachment_update_attributes.py deleted file mode 100644 index 1d94a5cca2..0000000000 --- a/src/datadog_api_client/v2/model/incident_attachment_update_attributes.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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 IncidentAttachmentUpdateAttributes(ModelComposed): - def __init__(self, **kwargs): - """ - Incident attachment attributes. - - :param attachment: The postmortem attachment. - :type attachment: IncidentAttachmentsPostmortemAttributesAttachmentObject - - :param attachment_type: The type of postmortem attachment attributes. - :type attachment_type: IncidentAttachmentPostmortemAttachmentType - - :param modified: Timestamp when the incident attachment link was last modified. - :type modified: datetime, 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_attachment_postmortem_attributes import ( - IncidentAttachmentPostmortemAttributes, - ) - from datadog_api_client.v2.model.incident_attachment_link_attributes import IncidentAttachmentLinkAttributes - - return { - "oneOf": [ - IncidentAttachmentPostmortemAttributes, - IncidentAttachmentLinkAttributes, - ], - } diff --git a/src/datadog_api_client/v2/model/incident_attachment_update_request.py b/src/datadog_api_client/v2/model/incident_attachment_update_request.py deleted file mode 100644 index 7a2af46a01..0000000000 --- a/src/datadog_api_client/v2/model/incident_attachment_update_request.py +++ /dev/null @@ -1,43 +0,0 @@ -# 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, TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.incident_attachment_update_data import IncidentAttachmentUpdateData - - -class IncidentAttachmentUpdateRequest(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.incident_attachment_update_data import IncidentAttachmentUpdateData - - return { - "data": ([IncidentAttachmentUpdateData],), - } - - attribute_map = { - "data": "data", - } - - def __init__(self_, data: List[IncidentAttachmentUpdateData], **kwargs): - """ - The update request for an incident's attachments. - - :param data: An array of incident attachments. An attachment object without an "id" key indicates that you want to - create that attachment. An attachment object without an "attributes" key indicates that you want to - delete that attachment. An attachment object with both the "id" key and a populated "attributes" object - indicates that you want to update that attachment. - :type data: [IncidentAttachmentUpdateData] - """ - super().__init__(kwargs) - - self_.data = data diff --git a/src/datadog_api_client/v2/model/incident_attachment_update_response.py b/src/datadog_api_client/v2/model/incident_attachment_update_response.py deleted file mode 100644 index cbad7fcf7e..0000000000 --- a/src/datadog_api_client/v2/model/incident_attachment_update_response.py +++ /dev/null @@ -1,62 +0,0 @@ -# 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_attachment_data import IncidentAttachmentData - from datadog_api_client.v2.model.incident_attachments_response_included_item import ( - IncidentAttachmentsResponseIncludedItem, - ) - from datadog_api_client.v2.model.user import User - - -class IncidentAttachmentUpdateResponse(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.incident_attachment_data import IncidentAttachmentData - from datadog_api_client.v2.model.incident_attachments_response_included_item import ( - IncidentAttachmentsResponseIncludedItem, - ) - - return { - "data": ([IncidentAttachmentData],), - "included": ([IncidentAttachmentsResponseIncludedItem],), - } - - attribute_map = { - "data": "data", - "included": "included", - } - - def __init__( - self_, - data: List[IncidentAttachmentData], - included: Union[List[Union[IncidentAttachmentsResponseIncludedItem, User]], UnsetType] = unset, - **kwargs, - ): - """ - The response object containing the created or updated incident attachments. - - :param data: An array of incident attachments. Only the attachments that were created or updated by the request are - returned. - :type data: [IncidentAttachmentData] - - :param included: Included related resources that the user requested. - :type included: [IncidentAttachmentsResponseIncludedItem], 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_attachments_response.py b/src/datadog_api_client/v2/model/incident_attachments_response.py deleted file mode 100644 index 080b1be662..0000000000 --- a/src/datadog_api_client/v2/model/incident_attachments_response.py +++ /dev/null @@ -1,61 +0,0 @@ -# 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_attachment_data import IncidentAttachmentData - from datadog_api_client.v2.model.incident_attachments_response_included_item import ( - IncidentAttachmentsResponseIncludedItem, - ) - from datadog_api_client.v2.model.user import User - - -class IncidentAttachmentsResponse(ModelNormal): - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.incident_attachment_data import IncidentAttachmentData - from datadog_api_client.v2.model.incident_attachments_response_included_item import ( - IncidentAttachmentsResponseIncludedItem, - ) - - return { - "data": ([IncidentAttachmentData],), - "included": ([IncidentAttachmentsResponseIncludedItem],), - } - - attribute_map = { - "data": "data", - "included": "included", - } - - def __init__( - self_, - data: List[IncidentAttachmentData], - included: Union[List[Union[IncidentAttachmentsResponseIncludedItem, User]], UnsetType] = unset, - **kwargs, - ): - """ - The response object containing an incident's attachments. - - :param data: An array of incident attachments. - :type data: [IncidentAttachmentData] - - :param included: Included related resources that the user requested. - :type included: [IncidentAttachmentsResponseIncludedItem], 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_response.py b/src/datadog_api_client/v2/model/incident_response.py index 5efd2ec719..34d9a9cad4 100644 --- a/src/datadog_api_client/v2/model/incident_response.py +++ b/src/datadog_api_client/v2/model/incident_response.py @@ -17,7 +17,7 @@ from datadog_api_client.v2.model.incident_response_data import IncidentResponseData from datadog_api_client.v2.model.incident_response_included_item import IncidentResponseIncludedItem from datadog_api_client.v2.model.incident_user_data import IncidentUserData - from datadog_api_client.v2.model.incident_attachment_data import IncidentAttachmentData + from datadog_api_client.v2.model.attachment_data import AttachmentData class IncidentResponse(ModelNormal): @@ -42,9 +42,7 @@ def openapi_types(_): def __init__( self_, data: IncidentResponseData, - included: Union[ - List[Union[IncidentResponseIncludedItem, IncidentUserData, IncidentAttachmentData]], UnsetType - ] = unset, + included: Union[List[Union[IncidentResponseIncludedItem, IncidentUserData, AttachmentData]], UnsetType] = unset, **kwargs, ): """ diff --git a/src/datadog_api_client/v2/model/incident_response_included_item.py b/src/datadog_api_client/v2/model/incident_response_included_item.py index 9afe8edee6..4bebf0d091 100644 --- a/src/datadog_api_client/v2/model/incident_response_included_item.py +++ b/src/datadog_api_client/v2/model/incident_response_included_item.py @@ -24,8 +24,8 @@ def __init__(self, **kwargs): :param type: Users resource type. :type type: UsersType, optional - :param relationships: The incident attachment's relationships. - :type relationships: IncidentAttachmentRelationships + :param relationships: + :type relationships: AttachmentDataRelationships """ super().__init__(kwargs) @@ -39,11 +39,11 @@ def _composed_schemas(_): # 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_attachment_data import IncidentAttachmentData + from datadog_api_client.v2.model.attachment_data import AttachmentData return { "oneOf": [ IncidentUserData, - IncidentAttachmentData, + AttachmentData, ], } diff --git a/src/datadog_api_client/v2/model/incident_search_response.py b/src/datadog_api_client/v2/model/incident_search_response.py index fc1550dd48..49731a038e 100644 --- a/src/datadog_api_client/v2/model/incident_search_response.py +++ b/src/datadog_api_client/v2/model/incident_search_response.py @@ -18,7 +18,7 @@ from datadog_api_client.v2.model.incident_response_included_item import IncidentResponseIncludedItem from datadog_api_client.v2.model.incident_search_response_meta import IncidentSearchResponseMeta from datadog_api_client.v2.model.incident_user_data import IncidentUserData - from datadog_api_client.v2.model.incident_attachment_data import IncidentAttachmentData + from datadog_api_client.v2.model.attachment_data import AttachmentData class IncidentSearchResponse(ModelNormal): @@ -47,9 +47,7 @@ def openapi_types(_): def __init__( self_, data: IncidentSearchResponseData, - included: Union[ - List[Union[IncidentResponseIncludedItem, IncidentUserData, IncidentAttachmentData]], UnsetType - ] = unset, + included: Union[List[Union[IncidentResponseIncludedItem, IncidentUserData, AttachmentData]], UnsetType] = unset, meta: Union[IncidentSearchResponseMeta, UnsetType] = unset, **kwargs, ): diff --git a/src/datadog_api_client/v2/model/incidents_response.py b/src/datadog_api_client/v2/model/incidents_response.py index 39a83e9a33..f429f14890 100644 --- a/src/datadog_api_client/v2/model/incidents_response.py +++ b/src/datadog_api_client/v2/model/incidents_response.py @@ -18,7 +18,7 @@ from datadog_api_client.v2.model.incident_response_included_item import IncidentResponseIncludedItem from datadog_api_client.v2.model.incident_response_meta import IncidentResponseMeta from datadog_api_client.v2.model.incident_user_data import IncidentUserData - from datadog_api_client.v2.model.incident_attachment_data import IncidentAttachmentData + from datadog_api_client.v2.model.attachment_data import AttachmentData class IncidentsResponse(ModelNormal): @@ -47,9 +47,7 @@ def openapi_types(_): def __init__( self_, data: List[IncidentResponseData], - included: Union[ - List[Union[IncidentResponseIncludedItem, IncidentUserData, IncidentAttachmentData]], UnsetType - ] = unset, + included: Union[List[Union[IncidentResponseIncludedItem, IncidentUserData, AttachmentData]], UnsetType] = unset, meta: Union[IncidentResponseMeta, UnsetType] = unset, **kwargs, ): diff --git a/src/datadog_api_client/v2/model/patch_attachment_request.py b/src/datadog_api_client/v2/model/patch_attachment_request.py new file mode 100644 index 0000000000..502c493643 --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_attachment_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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.patch_attachment_request_data import PatchAttachmentRequestData + + +class PatchAttachmentRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_attachment_request_data import PatchAttachmentRequestData + + return { + "data": (PatchAttachmentRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[PatchAttachmentRequestData, UnsetType] = unset, **kwargs): + """ + + + :param data: + :type data: PatchAttachmentRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/patch_attachment_request_data.py b/src/datadog_api_client/v2/model/patch_attachment_request_data.py new file mode 100644 index 0000000000..1d2669375a --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_attachment_request_data.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.patch_attachment_request_data_attributes import ( + PatchAttachmentRequestDataAttributes, + ) + from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType + + +class PatchAttachmentRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_attachment_request_data_attributes import ( + PatchAttachmentRequestDataAttributes, + ) + from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType + + return { + "attributes": (PatchAttachmentRequestDataAttributes,), + "id": (str,), + "type": (IncidentAttachmentType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: IncidentAttachmentType, + attributes: Union[PatchAttachmentRequestDataAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: + :type attributes: PatchAttachmentRequestDataAttributes, optional + + :param id: + :type id: str, optional + + :param type: The incident attachment resource type. + :type type: IncidentAttachmentType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/patch_attachment_request_data_attributes.py b/src/datadog_api_client/v2/model/patch_attachment_request_data_attributes.py new file mode 100644 index 0000000000..62e2449981 --- /dev/null +++ b/src/datadog_api_client/v2/model/patch_attachment_request_data_attributes.py @@ -0,0 +1,46 @@ +# 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.patch_attachment_request_data_attributes_attachment import ( + PatchAttachmentRequestDataAttributesAttachment, + ) + + +class PatchAttachmentRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.patch_attachment_request_data_attributes_attachment import ( + PatchAttachmentRequestDataAttributesAttachment, + ) + + return { + "attachment": (PatchAttachmentRequestDataAttributesAttachment,), + } + + attribute_map = { + "attachment": "attachment", + } + + def __init__(self_, attachment: Union[PatchAttachmentRequestDataAttributesAttachment, UnsetType] = unset, **kwargs): + """ + + + :param attachment: + :type attachment: PatchAttachmentRequestDataAttributesAttachment, optional + """ + if attachment is not unset: + kwargs["attachment"] = attachment + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_attachment_link_attributes_attachment_object.py b/src/datadog_api_client/v2/model/patch_attachment_request_data_attributes_attachment.py similarity index 55% rename from src/datadog_api_client/v2/model/incident_attachment_link_attributes_attachment_object.py rename to src/datadog_api_client/v2/model/patch_attachment_request_data_attributes_attachment.py index 068495586b..37d32bae40 100644 --- a/src/datadog_api_client/v2/model/incident_attachment_link_attributes_attachment_object.py +++ b/src/datadog_api_client/v2/model/patch_attachment_request_data_attributes_attachment.py @@ -3,14 +3,17 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations +from typing import Union from datadog_api_client.model_utils import ( ModelNormal, cached_property, + unset, + UnsetType, ) -class IncidentAttachmentLinkAttributesAttachmentObject(ModelNormal): +class PatchAttachmentRequestDataAttributesAttachment(ModelNormal): @cached_property def openapi_types(_): return { @@ -23,17 +26,18 @@ def openapi_types(_): "title": "title", } - def __init__(self_, document_url: str, title: str, **kwargs): + def __init__(self_, document_url: Union[str, UnsetType] = unset, title: Union[str, UnsetType] = unset, **kwargs): """ - The link attachment. - :param document_url: The URL of this link attachment. - :type document_url: str - :param title: The title of this link attachment. - :type title: str + :param document_url: + :type document_url: str, optional + + :param title: + :type title: str, optional """ + if document_url is not unset: + kwargs["document_url"] = document_url + if title is not unset: + kwargs["title"] = title super().__init__(kwargs) - - self_.document_url = document_url - self_.title = title diff --git a/src/datadog_api_client/v2/model/user140420082644000.py b/src/datadog_api_client/v2/model/user140420082644000.py new file mode 100644 index 0000000000..eb7b4bf258 --- /dev/null +++ b/src/datadog_api_client/v2/model/user140420082644000.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 Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.user_attributes import UserAttributes + from datadog_api_client.v2.model.user_type import UserType + + +class User140420082644000(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.user_attributes import UserAttributes + from datadog_api_client.v2.model.user_type import UserType + + return { + "attributes": (UserAttributes,), + "id": (str,), + "type": (UserType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + type: UserType, + attributes: Union[UserAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: Attributes of user object returned by the API. + :type attributes: UserAttributes, optional + + :param id: + :type id: str, optional + + :param type: Users resource type. + :type type: UserType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/incident_attachment_related_object.py b/src/datadog_api_client/v2/model/user_type.py similarity index 73% rename from src/datadog_api_client/v2/model/incident_attachment_related_object.py rename to src/datadog_api_client/v2/model/user_type.py index b35cab675d..e6d9613cdc 100644 --- a/src/datadog_api_client/v2/model/incident_attachment_related_object.py +++ b/src/datadog_api_client/v2/model/user_type.py @@ -12,9 +12,9 @@ from typing import ClassVar -class IncidentAttachmentRelatedObject(ModelSimple): +class UserType(ModelSimple): """ - The object related to an incident attachment. + Users resource type. :param value: If omitted defaults to "users". Must be one of ["users"]. :type value: str @@ -23,7 +23,7 @@ class IncidentAttachmentRelatedObject(ModelSimple): allowed_values = { "users", } - USERS: ClassVar["IncidentAttachmentRelatedObject"] + USERS: ClassVar["UserType"] @cached_property def openapi_types(_): @@ -32,4 +32,4 @@ def openapi_types(_): } -IncidentAttachmentRelatedObject.USERS = IncidentAttachmentRelatedObject("users") +UserType.USERS = UserType("users") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 8217f826ec..9a58280a4d 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -372,6 +372,22 @@ from datadog_api_client.v2.model.attach_jira_issue_request_data_relationships import ( AttachJiraIssueRequestDataRelationships, ) +from datadog_api_client.v2.model.attachment import Attachment +from datadog_api_client.v2.model.attachment_array import AttachmentArray +from datadog_api_client.v2.model.attachment_data import AttachmentData +from datadog_api_client.v2.model.attachment_data_attributes import AttachmentDataAttributes +from datadog_api_client.v2.model.attachment_data_attributes_attachment import AttachmentDataAttributesAttachment +from datadog_api_client.v2.model.attachment_data_attributes_attachment_type import ( + AttachmentDataAttributesAttachmentType, +) +from datadog_api_client.v2.model.attachment_data_relationships import AttachmentDataRelationships +from datadog_api_client.v2.model.attachment_data_relationships_last_modified_by_user import ( + AttachmentDataRelationshipsLastModifiedByUser, +) +from datadog_api_client.v2.model.attachment_data_relationships_last_modified_by_user_data import ( + AttachmentDataRelationshipsLastModifiedByUserData, +) +from datadog_api_client.v2.model.attachment_included import AttachmentIncluded from datadog_api_client.v2.model.audit_logs_event import AuditLogsEvent from datadog_api_client.v2.model.audit_logs_event_attributes import AuditLogsEventAttributes from datadog_api_client.v2.model.audit_logs_event_type import AuditLogsEventType @@ -973,6 +989,12 @@ ) from datadog_api_client.v2.model.create_apps_datastore_response import CreateAppsDatastoreResponse from datadog_api_client.v2.model.create_apps_datastore_response_data import CreateAppsDatastoreResponseData +from datadog_api_client.v2.model.create_attachment_request import CreateAttachmentRequest +from datadog_api_client.v2.model.create_attachment_request_data import CreateAttachmentRequestData +from datadog_api_client.v2.model.create_attachment_request_data_attributes import CreateAttachmentRequestDataAttributes +from datadog_api_client.v2.model.create_attachment_request_data_attributes_attachment import ( + CreateAttachmentRequestDataAttributesAttachment, +) from datadog_api_client.v2.model.create_case_request_array import CreateCaseRequestArray from datadog_api_client.v2.model.create_case_request_data import CreateCaseRequestData from datadog_api_client.v2.model.create_case_request_data_attributes import CreateCaseRequestDataAttributes @@ -2065,32 +2087,7 @@ from datadog_api_client.v2.model.ip_allowlist_type import IPAllowlistType from datadog_api_client.v2.model.ip_allowlist_update_request import IPAllowlistUpdateRequest from datadog_api_client.v2.model.idp_metadata_form_data import IdPMetadataFormData -from datadog_api_client.v2.model.incident_attachment_attachment_type import IncidentAttachmentAttachmentType -from datadog_api_client.v2.model.incident_attachment_attributes import IncidentAttachmentAttributes -from datadog_api_client.v2.model.incident_attachment_data import IncidentAttachmentData -from datadog_api_client.v2.model.incident_attachment_link_attachment_type import IncidentAttachmentLinkAttachmentType -from datadog_api_client.v2.model.incident_attachment_link_attributes import IncidentAttachmentLinkAttributes -from datadog_api_client.v2.model.incident_attachment_link_attributes_attachment_object import ( - IncidentAttachmentLinkAttributesAttachmentObject, -) -from datadog_api_client.v2.model.incident_attachment_postmortem_attachment_type import ( - IncidentAttachmentPostmortemAttachmentType, -) -from datadog_api_client.v2.model.incident_attachment_postmortem_attributes import IncidentAttachmentPostmortemAttributes -from datadog_api_client.v2.model.incident_attachment_related_object import IncidentAttachmentRelatedObject -from datadog_api_client.v2.model.incident_attachment_relationships import IncidentAttachmentRelationships from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType -from datadog_api_client.v2.model.incident_attachment_update_attributes import IncidentAttachmentUpdateAttributes -from datadog_api_client.v2.model.incident_attachment_update_data import IncidentAttachmentUpdateData -from datadog_api_client.v2.model.incident_attachment_update_request import IncidentAttachmentUpdateRequest -from datadog_api_client.v2.model.incident_attachment_update_response import IncidentAttachmentUpdateResponse -from datadog_api_client.v2.model.incident_attachments_postmortem_attributes_attachment_object import ( - IncidentAttachmentsPostmortemAttributesAttachmentObject, -) -from datadog_api_client.v2.model.incident_attachments_response import IncidentAttachmentsResponse -from datadog_api_client.v2.model.incident_attachments_response_included_item import ( - IncidentAttachmentsResponseIncludedItem, -) from datadog_api_client.v2.model.incident_create_attributes import IncidentCreateAttributes from datadog_api_client.v2.model.incident_create_data import IncidentCreateData from datadog_api_client.v2.model.incident_create_relationships import IncidentCreateRelationships @@ -3556,6 +3553,12 @@ from datadog_api_client.v2.model.partial_application_key import PartialApplicationKey from datadog_api_client.v2.model.partial_application_key_attributes import PartialApplicationKeyAttributes from datadog_api_client.v2.model.partial_application_key_response import PartialApplicationKeyResponse +from datadog_api_client.v2.model.patch_attachment_request import PatchAttachmentRequest +from datadog_api_client.v2.model.patch_attachment_request_data import PatchAttachmentRequestData +from datadog_api_client.v2.model.patch_attachment_request_data_attributes import PatchAttachmentRequestDataAttributes +from datadog_api_client.v2.model.patch_attachment_request_data_attributes_attachment import ( + PatchAttachmentRequestDataAttributesAttachment, +) from datadog_api_client.v2.model.patch_incident_notification_template_request import ( PatchIncidentNotificationTemplateRequest, ) @@ -5006,6 +5009,7 @@ from datadog_api_client.v2.model.usage_time_series_object import UsageTimeSeriesObject from datadog_api_client.v2.model.usage_time_series_type import UsageTimeSeriesType from datadog_api_client.v2.model.user import User +from datadog_api_client.v2.model.user140420082644000 import User140420082644000 from datadog_api_client.v2.model.user_attributes import UserAttributes from datadog_api_client.v2.model.user_attributes_status import UserAttributesStatus from datadog_api_client.v2.model.user_create_attributes import UserCreateAttributes @@ -5044,6 +5048,7 @@ from datadog_api_client.v2.model.user_team_update_request import UserTeamUpdateRequest from datadog_api_client.v2.model.user_team_user_type import UserTeamUserType from datadog_api_client.v2.model.user_teams_response import UserTeamsResponse +from datadog_api_client.v2.model.user_type import UserType from datadog_api_client.v2.model.user_update_attributes import UserUpdateAttributes from datadog_api_client.v2.model.user_update_data import UserUpdateData from datadog_api_client.v2.model.user_update_request import UserUpdateRequest @@ -5372,6 +5377,16 @@ "AttachJiraIssueRequestData", "AttachJiraIssueRequestDataAttributes", "AttachJiraIssueRequestDataRelationships", + "Attachment", + "AttachmentArray", + "AttachmentData", + "AttachmentDataAttributes", + "AttachmentDataAttributesAttachment", + "AttachmentDataAttributesAttachmentType", + "AttachmentDataRelationships", + "AttachmentDataRelationshipsLastModifiedByUser", + "AttachmentDataRelationshipsLastModifiedByUserData", + "AttachmentIncluded", "AuditLogsEvent", "AuditLogsEventAttributes", "AuditLogsEventType", @@ -5853,6 +5868,10 @@ "CreateAppsDatastoreRequestDataAttributesOrgAccess", "CreateAppsDatastoreResponse", "CreateAppsDatastoreResponseData", + "CreateAttachmentRequest", + "CreateAttachmentRequestData", + "CreateAttachmentRequestDataAttributes", + "CreateAttachmentRequestDataAttributesAttachment", "CreateCaseRequestArray", "CreateCaseRequestData", "CreateCaseRequestDataAttributes", @@ -6677,24 +6696,7 @@ "IPAllowlistType", "IPAllowlistUpdateRequest", "IdPMetadataFormData", - "IncidentAttachmentAttachmentType", - "IncidentAttachmentAttributes", - "IncidentAttachmentData", - "IncidentAttachmentLinkAttachmentType", - "IncidentAttachmentLinkAttributes", - "IncidentAttachmentLinkAttributesAttachmentObject", - "IncidentAttachmentPostmortemAttachmentType", - "IncidentAttachmentPostmortemAttributes", - "IncidentAttachmentRelatedObject", - "IncidentAttachmentRelationships", "IncidentAttachmentType", - "IncidentAttachmentUpdateAttributes", - "IncidentAttachmentUpdateData", - "IncidentAttachmentUpdateRequest", - "IncidentAttachmentUpdateResponse", - "IncidentAttachmentsPostmortemAttributesAttachmentObject", - "IncidentAttachmentsResponse", - "IncidentAttachmentsResponseIncludedItem", "IncidentCreateAttributes", "IncidentCreateData", "IncidentCreateRelationships", @@ -7636,6 +7638,10 @@ "PartialApplicationKey", "PartialApplicationKeyAttributes", "PartialApplicationKeyResponse", + "PatchAttachmentRequest", + "PatchAttachmentRequestData", + "PatchAttachmentRequestDataAttributes", + "PatchAttachmentRequestDataAttributesAttachment", "PatchIncidentNotificationTemplateRequest", "PatchNotificationRuleParameters", "PatchNotificationRuleParametersData", @@ -8730,6 +8736,7 @@ "UsageTimeSeriesObject", "UsageTimeSeriesType", "User", + "User140420082644000", "UserAttributes", "UserAttributesStatus", "UserCreateAttributes", @@ -8768,6 +8775,7 @@ "UserTeamUpdateRequest", "UserTeamUserType", "UserTeamsResponse", + "UserType", "UserUpdateAttributes", "UserUpdateData", "UserUpdateRequest", diff --git a/tests/v2/cassettes/test_scenarios/test_create_an_incident_attachment_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_an_incident_attachment_returns_ok_response.frozen deleted file mode 100644 index a19a831fa7..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_an_incident_attachment_returns_ok_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2024-11-04T19:02:17.223Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_an_incident_attachment_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_an_incident_attachment_returns_ok_response.yaml deleted file mode 100644 index f0b46e4759..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_create_an_incident_attachment_returns_ok_response.yaml +++ /dev/null @@ -1,58 +0,0 @@ -interactions: -- request: - body: '{"data":{"attributes":{"customer_impacted":false,"title":"Test-Create_an_incident_attachment_returns_OK_response-1730746937"},"type":"incidents"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/incidents - response: - body: - string: '{"data":{"type":"incidents","id":"de4affc2-0412-5ed3-9d20-7f71b21ad305","attributes":{"public_id":250835,"incident_type_uuid":"41d2e10b-4108-4736-92d7-791d00ea0702","title":"Test-Create_an_incident_attachment_returns_OK_response-1730746937","resolved":null,"customer_impact_scope":null,"customer_impact_start":null,"customer_impact_end":null,"customer_impacted":false,"notification_handles":null,"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}},"last_modified_by_uuid":null,"created":"2024-11-04T19:02:17.394588+00:00","modified":"2024-11-04T19:02:17.394588+00:00","commander":null,"detected":"2024-11-04T19:02:17.385480+00:00","created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}},"created_by_uuid":null,"creation_idempotency_key":null,"customer_impact_duration":0,"time_to_detect":0,"time_to_repair":0,"time_to_internal_response":0,"time_to_resolve":0,"archived":null,"fields":{"severity":{"type":"dropdown","value":"UNKNOWN"},"state":{"type":"dropdown","value":"active"},"detection_method":{"type":"dropdown","value":"unknown"},"root_cause":{"type":"textbox","value":null},"summary":{"type":"textbox","value":null},"services":{"type":"autocomplete","value":null},"teams":{"type":"autocomplete","value":null}},"field_analytics":null,"severity":"UNKNOWN","state":"active","non_datadog_creator":null,"visibility":"organization","case_id":null},"relationships":{"created_by_user":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"last_modified_by_user":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"commander_user":{"data":null},"user_defined_fields":{"data":[{"type":"user_defined_field","id":"33457d2a-570c-5567-b4af-979a2a8f1164"},{"type":"user_defined_field","id":"d003693c-bee9-5420-8d46-859269c20914"},{"type":"user_defined_field","id":"1ddff6f6-cb1f-51a0-9d81-dc18ef52cc9d"},{"type":"user_defined_field","id":"6bc9d32b-c2cd-591e-9b7a-74c886a5ddcf"},{"type":"user_defined_field","id":"95c53547-2ba3-5d8a-9c3b-cf245bc0c629"},{"type":"user_defined_field","id":"39044b03-cee4-555f-b1e0-3eb3aa759a86"},{"type":"user_defined_field","id":"3cbe9e60-d794-532c-acc0-73641f782813"}]},"integrations":{"data":[]},"attachments":{"data":[]},"responders":{"data":[]},"impacts":{"data":[]}}}} - - ' - headers: - content-type: - - application/json - status: - code: 201 - message: Created -- request: - body: '{"data":[{"attributes":{"attachment":{"documentUrl":"https://www.example.com/doc","title":"Test-Create_an_incident_attachment_returns_OK_response-1730746937"},"attachment_type":"link"},"type":"incident_attachments"}]}' - headers: - accept: - - application/json - content-type: - - application/json - method: PATCH - uri: https://api.datadoghq.com/api/v2/incidents/de4affc2-0412-5ed3-9d20-7f71b21ad305/attachments - response: - body: - string: '{"data":[{"type":"incident_attachments","id":"233c12d5-547a-5638-97e6-6c9d1c456cb7","attributes":{"modified":"2024-11-04T19:02:17.844501+00:00","attachment_type":"link","attachment":{"title":"Test-Create_an_incident_attachment_returns_OK_response-1730746937","documentUrl":"https://www.example.com/doc"}},"relationships":{"last_modified_by_user":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}]} - - ' - headers: - content-type: - - application/json - status: - code: 200 - message: OK -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/incidents/de4affc2-0412-5ed3-9d20-7f71b21ad305 - response: - body: - string: '' - headers: - content-type: - - text/html; charset=utf-8 - status: - code: 204 - message: No Content -version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_incident_attachments_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_incident_attachments_returns_ok_response.frozen deleted file mode 100644 index 65913c025d..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_get_incident_attachments_returns_ok_response.frozen +++ /dev/null @@ -1 +0,0 @@ -2024-11-04T19:02:25.584Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_incident_attachments_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_incident_attachments_returns_ok_response.yaml deleted file mode 100644 index 620c6a2f63..0000000000 --- a/tests/v2/cassettes/test_scenarios/test_get_incident_attachments_returns_ok_response.yaml +++ /dev/null @@ -1,79 +0,0 @@ -interactions: -- request: - body: '{"data":{"attributes":{"customer_impacted":false,"title":"Test-Get_incident_attachments_returns_OK_response-1730746945"},"type":"incidents"}}' - headers: - accept: - - application/json - content-type: - - application/json - method: POST - uri: https://api.datadoghq.com/api/v2/incidents - response: - body: - string: '{"data":{"type":"incidents","id":"1512832c-c4e5-569d-a970-d4797f22745a","attributes":{"public_id":250842,"incident_type_uuid":"41d2e10b-4108-4736-92d7-791d00ea0702","title":"Test-Get_incident_attachments_returns_OK_response-1730746945","resolved":null,"customer_impact_scope":null,"customer_impact_start":null,"customer_impact_end":null,"customer_impacted":false,"notification_handles":null,"last_modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}},"last_modified_by_uuid":null,"created":"2024-11-04T19:02:25.768523+00:00","modified":"2024-11-04T19:02:25.768523+00:00","commander":null,"detected":"2024-11-04T19:02:25.756116+00:00","created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0","attributes":{"uuid":"3ad549bf-eba0-11e9-a77a-0705486660d0","handle":"frog@datadoghq.com","email":"frog@datadoghq.com","name":null,"icon":"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro"}}},"created_by_uuid":null,"creation_idempotency_key":null,"customer_impact_duration":0,"time_to_detect":0,"time_to_repair":0,"time_to_internal_response":0,"time_to_resolve":0,"archived":null,"fields":{"severity":{"type":"dropdown","value":"UNKNOWN"},"state":{"type":"dropdown","value":"active"},"detection_method":{"type":"dropdown","value":"unknown"},"root_cause":{"type":"textbox","value":null},"summary":{"type":"textbox","value":null},"services":{"type":"autocomplete","value":null},"teams":{"type":"autocomplete","value":null}},"field_analytics":null,"severity":"UNKNOWN","state":"active","non_datadog_creator":null,"visibility":"organization","case_id":null},"relationships":{"created_by_user":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"last_modified_by_user":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"commander_user":{"data":null},"user_defined_fields":{"data":[{"type":"user_defined_field","id":"33457d2a-570c-5567-b4af-979a2a8f1164"},{"type":"user_defined_field","id":"d003693c-bee9-5420-8d46-859269c20914"},{"type":"user_defined_field","id":"1ddff6f6-cb1f-51a0-9d81-dc18ef52cc9d"},{"type":"user_defined_field","id":"6bc9d32b-c2cd-591e-9b7a-74c886a5ddcf"},{"type":"user_defined_field","id":"95c53547-2ba3-5d8a-9c3b-cf245bc0c629"},{"type":"user_defined_field","id":"39044b03-cee4-555f-b1e0-3eb3aa759a86"},{"type":"user_defined_field","id":"3cbe9e60-d794-532c-acc0-73641f782813"}]},"integrations":{"data":[]},"attachments":{"data":[]},"responders":{"data":[]},"impacts":{"data":[]}}}} - - ' - headers: - content-type: - - application/json - status: - code: 201 - message: Created -- request: - body: '{"data":[{"attributes":{"attachment":{"documentUrl":"https://www.example.com/doc","title":"Important - Doc"},"attachment_type":"link"},"type":"incident_attachments"}]}' - headers: - accept: - - application/json - content-type: - - application/json - method: PATCH - uri: https://api.datadoghq.com/api/v2/incidents/1512832c-c4e5-569d-a970-d4797f22745a/attachments - response: - body: - string: '{"data":[{"type":"incident_attachments","id":"ad6ccc2d-9653-5824-be41-729d3f49a153","attributes":{"modified":"2024-11-04T19:02:26.146487+00:00","attachment_type":"link","attachment":{"title":"Important - Doc","documentUrl":"https://www.example.com/doc"}},"relationships":{"last_modified_by_user":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}]} - - ' - headers: - content-type: - - application/json - status: - code: 200 - message: OK -- request: - body: null - headers: - accept: - - application/json - method: GET - uri: https://api.datadoghq.com/api/v2/incidents/1512832c-c4e5-569d-a970-d4797f22745a/attachments - response: - body: - string: '{"data":[{"type":"incident_attachments","id":"ad6ccc2d-9653-5824-be41-729d3f49a153","attributes":{"modified":"2024-11-04T19:02:26.146487+00:00","attachment_type":"link","attachment":{"title":"Important - Doc","documentUrl":"https://www.example.com/doc"}},"relationships":{"last_modified_by_user":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}}}}]} - - ' - headers: - content-type: - - application/json - status: - code: 200 - message: OK -- request: - body: null - headers: - accept: - - '*/*' - method: DELETE - uri: https://api.datadoghq.com/api/v2/incidents/1512832c-c4e5-569d-a970-d4797f22745a - response: - body: - string: '' - headers: - content-type: - - text/html; charset=utf-8 - status: - code: 204 - message: No Content -version: 1 diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 5e9aa4d3b5..1d3d16d80d 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -447,22 +447,6 @@ "tag": "Incidents", "operationId": "CreateIncidentType" }, - { - "parameters": [ - { - "name": "incident_id", - "source": "incident.data.id" - }, - { - "name": "body", - "value": "{\n \"data\": [\n {\n \"attributes\": {\n \"attachment_type\": \"link\",\n \"attachment\": {\n \"documentUrl\": \"https://www.example.com/doc\",\n \"title\": \"Important Doc\"\n }\n },\n \"type\": \"incident_attachments\"\n }\n ]\n}" - } - ], - "step": "the \"incident\" has an \"incident_attachment\"", - "key": "incident_attachment", - "tag": "Incidents", - "operationId": "UpdateIncidentAttachments" - }, { "operationId": "CreateIncidentImpact", "parameters": [ diff --git a/tests/v2/features/incidents.feature b/tests/v2/features/incidents.feature index 12ab3e2f5b..a101f5f4af 100644 --- a/tests/v2/features/incidents.feature +++ b/tests/v2/features/incidents.feature @@ -21,20 +21,6 @@ Feature: Incidents When the request is sent Then the response status is 200 OK - @team:DataDog/incident-app - Scenario: Create an incident attachment returns "OK" response - Given operation "UpdateIncidentAttachments" enabled - And there is a valid "incident" in the system - And new "UpdateIncidentAttachments" request - And request contains "incident_id" parameter from "incident.data.id" - And body with value {"data": [{"type": "incident_attachments", "attributes": {"attachment_type": "link", "attachment": {"documentUrl": "https://www.example.com/doc", "title": "{{unique}}"}}}]} - When the request is sent - Then the response status is 200 OK - And the response "data" has length 1 - And the response "data[0].type" is equal to "incident_attachments" - And the response "data[0].attributes.attachment_type" is equal to "link" - And the response "data[0].attributes.attachment.documentUrl" is equal to "https://www.example.com/doc" - @skip @team:DataDog/incident-app Scenario: Create an incident impact returns "Bad Request" response Given operation "CreateIncidentImpact" enabled @@ -200,6 +186,24 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app + Scenario: Create incident attachment returns "Bad Request" response + Given operation "CreateIncidentAttachment" enabled + And new "CreateIncidentAttachment" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"attachment": {"documentUrl": "https://app.datadoghq.com/notebook/123/Postmortem-IR-123", "title": "Postmortem-IR-123"}, "attachment_type": "postmortem"}, "id": "00000000-0000-0000-0000-000000000000", "type": "incident_attachments"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Create incident attachment returns "Created" response + Given operation "CreateIncidentAttachment" enabled + And new "CreateIncidentAttachment" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"attachment": {"documentUrl": "https://app.datadoghq.com/notebook/123/Postmortem-IR-123", "title": "Postmortem-IR-123"}, "attachment_type": "postmortem"}, "id": "00000000-0000-0000-0000-000000000000", "type": "incident_attachments"}} + When the request is sent + Then the response status is 201 Created + @team:Datadog/incident-app Scenario: Create incident notification rule returns "Bad Request" response Given operation "CreateIncidentNotificationRule" enabled @@ -249,33 +253,6 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/incident-app - Scenario: Create, update, and delete incident attachments returns "Bad Request" response - Given operation "UpdateIncidentAttachments" enabled - And new "UpdateIncidentAttachments" request - And request contains "incident_id" parameter from "REPLACE.ME" - And body with value {"data": [{"attributes": {"attachment": {"documentUrl": "https://app.datadoghq.com/notebook/123", "title": "Postmortem IR-123"}, "attachment_type": "postmortem"}, "id": "00000000-abcd-0002-0000-000000000000", "type": "incident_attachments"}, {"attributes": {"attachment": {"documentUrl": "https://www.example.com/webstore-failure-runbook", "title": "Runbook for webstore service failures"}, "attachment_type": "link"}, "type": "incident_attachments"}, {"id": "00000000-abcd-0003-0000-000000000000", "type": "incident_attachments"}]} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/incident-app - Scenario: Create, update, and delete incident attachments returns "Not Found" response - Given operation "UpdateIncidentAttachments" enabled - And new "UpdateIncidentAttachments" request - And request contains "incident_id" parameter from "REPLACE.ME" - And body with value {"data": [{"attributes": {"attachment": {"documentUrl": "https://app.datadoghq.com/notebook/123", "title": "Postmortem IR-123"}, "attachment_type": "postmortem"}, "id": "00000000-abcd-0002-0000-000000000000", "type": "incident_attachments"}, {"attributes": {"attachment": {"documentUrl": "https://www.example.com/webstore-failure-runbook", "title": "Runbook for webstore service failures"}, "attachment_type": "link"}, "type": "incident_attachments"}, {"id": "00000000-abcd-0003-0000-000000000000", "type": "incident_attachments"}]} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/incident-app - Scenario: Create, update, and delete incident attachments returns "OK" response - Given operation "UpdateIncidentAttachments" enabled - And new "UpdateIncidentAttachments" request - And request contains "incident_id" parameter from "REPLACE.ME" - And body with value {"data": [{"attributes": {"attachment": {"documentUrl": "https://app.datadoghq.com/notebook/123", "title": "Postmortem IR-123"}, "attachment_type": "postmortem"}, "id": "00000000-abcd-0002-0000-000000000000", "type": "incident_attachments"}, {"attributes": {"attachment": {"documentUrl": "https://www.example.com/webstore-failure-runbook", "title": "Runbook for webstore service failures"}, "attachment_type": "link"}, "type": "incident_attachments"}, {"id": "00000000-abcd-0003-0000-000000000000", "type": "incident_attachments"}]} - When the request is sent - Then the response status is 200 OK - @generated @skip @team:Datadog/incident-app Scenario: Delete a notification template returns "Bad Request" response Given operation "DeleteIncidentNotificationTemplate" enabled @@ -452,6 +429,33 @@ Feature: Incidents When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/incident-app + Scenario: Delete incident attachment returns "Bad Request" response + Given operation "DeleteIncidentAttachment" enabled + And new "DeleteIncidentAttachment" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "attachment_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 incident attachment returns "No Content" response + Given operation "DeleteIncidentAttachment" enabled + And new "DeleteIncidentAttachment" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "attachment_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 incident attachment returns "Not Found" response + Given operation "DeleteIncidentAttachment" enabled + And new "DeleteIncidentAttachment" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "attachment_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @team:Datadog/incident-app Scenario: Delete incident notification rule returns "No Content" response Given there is a valid "incident_type" in the system @@ -536,30 +540,6 @@ Feature: Incidents And the response "data[0].attributes.assignees" has length 2 And the response "data[0].attributes.content" is equal to "Follow up with customer about the impact they saw." - @generated @skip @team:DataDog/incident-app - Scenario: Get a list of attachments returns "Bad Request" response - Given operation "ListIncidentAttachments" enabled - And new "ListIncidentAttachments" request - And request contains "incident_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 a list of attachments returns "Not Found" response - Given operation "ListIncidentAttachments" enabled - And new "ListIncidentAttachments" request - And request contains "incident_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 a list of attachments returns "OK" response - Given operation "ListIncidentAttachments" enabled - And new "ListIncidentAttachments" request - And request contains "incident_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 a list of incident types returns "Bad Request" response Given operation "ListIncidentTypes" enabled @@ -630,20 +610,6 @@ Feature: Incidents When the request is sent Then the response status is 200 OK - @team:DataDog/incident-app - Scenario: Get incident attachments returns "OK" response - Given operation "ListIncidentAttachments" enabled - And there is a valid "incident" in the system - And the "incident" has an "incident_attachment" - And new "ListIncidentAttachments" request - And request contains "incident_id" parameter from "incident.data.id" - When the request is sent - Then the response status is 200 OK - And the response "data" has length 1 - And the response "data[0].type" is equal to "incident_attachments" - And the response "data[0].attributes.attachment_type" is equal to "link" - And the response "data[0].attributes.attachment.documentUrl" is equal to "https://www.example.com/doc" - @generated @skip @team:DataDog/incident-app Scenario: Get incident integration metadata details returns "Bad Request" response Given operation "GetIncidentIntegration" enabled @@ -827,6 +793,22 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: List incident attachments returns "Bad Request" response + Given operation "ListIncidentAttachments" enabled + And new "ListIncidentAttachments" request + And request contains "incident_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: List incident attachments returns "OK" response + Given operation "ListIncidentAttachments" enabled + And new "ListIncidentAttachments" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:Datadog/incident-app Scenario: List incident notification rules returns "Bad Request" response Given operation "ListIncidentNotificationRules" enabled @@ -1073,6 +1055,36 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Update incident attachment returns "Bad Request" response + Given operation "UpdateIncidentAttachment" enabled + And new "UpdateIncidentAttachment" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "attachment_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"attachment": {"documentUrl": "https://app.datadoghq.com/notebook/124/Postmortem-IR-124", "title": "Postmortem-IR-124"}}, "type": "incident_attachments"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Update incident attachment returns "Not Found" response + Given operation "UpdateIncidentAttachment" enabled + And new "UpdateIncidentAttachment" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "attachment_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"attachment": {"documentUrl": "https://app.datadoghq.com/notebook/124/Postmortem-IR-124", "title": "Postmortem-IR-124"}}, "type": "incident_attachments"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/incident-app + Scenario: Update incident attachment returns "OK" response + Given operation "UpdateIncidentAttachment" enabled + And new "UpdateIncidentAttachment" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "attachment_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"attachment": {"documentUrl": "https://app.datadoghq.com/notebook/124/Postmortem-IR-124", "title": "Postmortem-IR-124"}}, "type": "incident_attachments"}} + When the request is sent + Then the response status is 200 OK + @team:Datadog/incident-app Scenario: Update incident notification rule returns "Bad Request" response Given operation "UpdateIncidentNotificationRule" enabled diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index e0f0b98d0c..f59f66d6e8 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1717,7 +1717,30 @@ "type": "safe" } }, - "UpdateIncidentAttachments": { + "CreateIncidentAttachment": { + "tag": "Incidents", + "undo": { + "operationId": "DeleteIncidentAttachment", + "parameters": [ + { + "name": "incident_id", + "source": "" + }, + { + "name": "attachment_id", + "source": "" + } + ], + "type": "unsafe" + } + }, + "DeleteIncidentAttachment": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "UpdateIncidentAttachment": { "tag": "Incidents", "undo": { "type": "idempotent"