diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index cfbcb7286acb..5fbf15ba4f69 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/cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/frozen.json b/cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/frozen.json deleted file mode 100644 index bb8546a5ca92..000000000000 --- a/cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/frozen.json +++ /dev/null @@ -1 +0,0 @@ -"2024-11-04T19:02:17.223Z" diff --git a/cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/recording.har b/cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/recording.har deleted file mode 100644 index 8d211fa0a769..000000000000 --- a/cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/recording.har +++ /dev/null @@ -1,162 +0,0 @@ -{ - "log": { - "_recordingName": "Incidents/Create an incident attachment returns \"OK\" response", - "creator": { - "comment": "persister:fs", - "name": "Polly.JS", - "version": "6.0.5" - }, - "entries": [ - { - "_id": "dfccd09f3ff9e07be2af7fcf55f38a84", - "_order": 0, - "cache": {}, - "request": { - "bodySize": 146, - "cookies": [], - "headers": [ - { - "_fromType": "array", - "name": "accept", - "value": "application/json" - }, - { - "_fromType": "array", - "name": "content-type", - "value": "application/json" - } - ], - "headersSize": 558, - "httpVersion": "HTTP/1.1", - "method": "POST", - "postData": { - "mimeType": "application/json", - "params": [], - "text": "{\"data\":{\"attributes\":{\"customer_impacted\":false,\"title\":\"Test-Create_an_incident_attachment_returns_OK_response-1730746937\"},\"type\":\"incidents\"}}" - }, - "queryString": [], - "url": "https://api.datadoghq.com/api/v2/incidents" - }, - "response": { - "bodySize": 2741, - "content": { - "mimeType": "application/json", - "size": 2741, - "text": "{\"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\":[]}}}}\n" - }, - "cookies": [], - "headers": [ - { - "name": "content-type", - "value": "application/json" - } - ], - "headersSize": 662, - "httpVersion": "HTTP/1.1", - "redirectURL": "", - "status": 201, - "statusText": "Created" - }, - "startedDateTime": "2024-11-04T19:02:17.227Z", - "time": 398 - }, - { - "_id": "aef14cc6d409508a216c43485fb8c65b", - "_order": 0, - "cache": {}, - "request": { - "bodySize": 217, - "cookies": [], - "headers": [ - { - "_fromType": "array", - "name": "accept", - "value": "application/json" - }, - { - "_fromType": "array", - "name": "content-type", - "value": "application/json" - } - ], - "headersSize": 619, - "httpVersion": "HTTP/1.1", - "method": "PATCH", - "postData": { - "mimeType": "application/json", - "params": [], - "text": "{\"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\"}]}" - }, - "queryString": [], - "url": "https://api.datadoghq.com/api/v2/incidents/de4affc2-0412-5ed3-9d20-7f71b21ad305/attachments" - }, - "response": { - "bodySize": 420, - "content": { - "mimeType": "application/json", - "size": 420, - "text": "{\"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\"}}}}]}\n" - }, - "cookies": [], - "headers": [ - { - "name": "content-type", - "value": "application/json" - } - ], - "headersSize": 682, - "httpVersion": "HTTP/1.1", - "redirectURL": "", - "status": 200, - "statusText": "OK" - }, - "startedDateTime": "2024-11-04T19:02:17.636Z", - "time": 285 - }, - { - "_id": "a8aeb3d27606e74a5462ae9545953f54", - "_order": 0, - "cache": {}, - "request": { - "bodySize": 0, - "cookies": [], - "headers": [ - { - "_fromType": "array", - "name": "accept", - "value": "*/*" - } - ], - "headersSize": 531, - "httpVersion": "HTTP/1.1", - "method": "DELETE", - "queryString": [], - "url": "https://api.datadoghq.com/api/v2/incidents/de4affc2-0412-5ed3-9d20-7f71b21ad305" - }, - "response": { - "bodySize": 0, - "content": { - "mimeType": "text/html; charset=utf-8", - "size": 0 - }, - "cookies": [], - "headers": [ - { - "name": "content-type", - "value": "text/html; charset=utf-8" - } - ], - "headersSize": 648, - "httpVersion": "HTTP/1.1", - "redirectURL": "", - "status": 204, - "statusText": "No Content" - }, - "startedDateTime": "2024-11-04T19:02:17.928Z", - "time": 261 - } - ], - "pages": [], - "version": "1.2" - } -} diff --git a/cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/frozen.json b/cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/frozen.json deleted file mode 100644 index 29356c39929a..000000000000 --- a/cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/frozen.json +++ /dev/null @@ -1 +0,0 @@ -"2024-11-04T19:02:25.584Z" diff --git a/cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/recording.har b/cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/recording.har deleted file mode 100644 index f873cbfa6566..000000000000 --- a/cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/recording.har +++ /dev/null @@ -1,205 +0,0 @@ -{ - "log": { - "_recordingName": "Incidents/Get incident attachments returns \"OK\" response", - "creator": { - "comment": "persister:fs", - "name": "Polly.JS", - "version": "6.0.5" - }, - "entries": [ - { - "_id": "be8f640733360570f889c1583e162302", - "_order": 0, - "cache": {}, - "request": { - "bodySize": 141, - "cookies": [], - "headers": [ - { - "_fromType": "array", - "name": "accept", - "value": "application/json" - }, - { - "_fromType": "array", - "name": "content-type", - "value": "application/json" - } - ], - "headersSize": 558, - "httpVersion": "HTTP/1.1", - "method": "POST", - "postData": { - "mimeType": "application/json", - "params": [], - "text": "{\"data\":{\"attributes\":{\"customer_impacted\":false,\"title\":\"Test-Get_incident_attachments_returns_OK_response-1730746945\"},\"type\":\"incidents\"}}" - }, - "queryString": [], - "url": "https://api.datadoghq.com/api/v2/incidents" - }, - "response": { - "bodySize": 2736, - "content": { - "mimeType": "application/json", - "size": 2736, - "text": "{\"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\":[]}}}}\n" - }, - "cookies": [], - "headers": [ - { - "name": "content-type", - "value": "application/json" - } - ], - "headersSize": 662, - "httpVersion": "HTTP/1.1", - "redirectURL": "", - "status": 201, - "statusText": "Created" - }, - "startedDateTime": "2024-11-04T19:02:25.587Z", - "time": 340 - }, - { - "_id": "00a0474c4f07c4dd45abb0fa8ca2551a", - "_order": 0, - "cache": {}, - "request": { - "bodySize": 165, - "cookies": [], - "headers": [ - { - "_fromType": "array", - "name": "accept", - "value": "application/json" - }, - { - "_fromType": "array", - "name": "content-type", - "value": "application/json" - } - ], - "headersSize": 619, - "httpVersion": "HTTP/1.1", - "method": "PATCH", - "postData": { - "mimeType": "application/json", - "params": [], - "text": "{\"data\":[{\"attributes\":{\"attachment\":{\"documentUrl\":\"https://www.example.com/doc\",\"title\":\"Important Doc\"},\"attachment_type\":\"link\"},\"type\":\"incident_attachments\"}]}" - }, - "queryString": [], - "url": "https://api.datadoghq.com/api/v2/incidents/1512832c-c4e5-569d-a970-d4797f22745a/attachments" - }, - "response": { - "bodySize": 368, - "content": { - "mimeType": "application/json", - "size": 368, - "text": "{\"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\"}}}}]}\n" - }, - "cookies": [], - "headers": [ - { - "name": "content-type", - "value": "application/json" - } - ], - "headersSize": 682, - "httpVersion": "HTTP/1.1", - "redirectURL": "", - "status": 200, - "statusText": "OK" - }, - "startedDateTime": "2024-11-04T19:02:25.935Z", - "time": 311 - }, - { - "_id": "9a2f0a3f6f7f8ce7947c2bc0264c8ff8", - "_order": 0, - "cache": {}, - "request": { - "bodySize": 0, - "cookies": [], - "headers": [ - { - "_fromType": "array", - "name": "accept", - "value": "application/json" - } - ], - "headersSize": 562, - "httpVersion": "HTTP/1.1", - "method": "GET", - "queryString": [], - "url": "https://api.datadoghq.com/api/v2/incidents/1512832c-c4e5-569d-a970-d4797f22745a/attachments" - }, - "response": { - "bodySize": 368, - "content": { - "mimeType": "application/json", - "size": 368, - "text": "{\"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\"}}}}]}\n" - }, - "cookies": [], - "headers": [ - { - "name": "content-type", - "value": "application/json" - } - ], - "headersSize": 680, - "httpVersion": "HTTP/1.1", - "redirectURL": "", - "status": 200, - "statusText": "OK" - }, - "startedDateTime": "2024-11-04T19:02:26.253Z", - "time": 129 - }, - { - "_id": "3e5023a01b75523a5b17a8b3fa8855db", - "_order": 0, - "cache": {}, - "request": { - "bodySize": 0, - "cookies": [], - "headers": [ - { - "_fromType": "array", - "name": "accept", - "value": "*/*" - } - ], - "headersSize": 531, - "httpVersion": "HTTP/1.1", - "method": "DELETE", - "queryString": [], - "url": "https://api.datadoghq.com/api/v2/incidents/1512832c-c4e5-569d-a970-d4797f22745a" - }, - "response": { - "bodySize": 0, - "content": { - "mimeType": "text/html; charset=utf-8", - "size": 0 - }, - "cookies": [], - "headers": [ - { - "name": "content-type", - "value": "text/html; charset=utf-8" - } - ], - "headersSize": 648, - "httpVersion": "HTTP/1.1", - "redirectURL": "", - "status": 204, - "statusText": "No Content" - }, - "startedDateTime": "2024-11-04T19:02:26.388Z", - "time": 238 - } - ], - "pages": [], - "version": "1.2" - } -} diff --git a/examples/v2/incidents/CreateIncidentAttachment.ts b/examples/v2/incidents/CreateIncidentAttachment.ts new file mode 100644 index 000000000000..e41de78a5646 --- /dev/null +++ b/examples/v2/incidents/CreateIncidentAttachment.ts @@ -0,0 +1,36 @@ +/** + * Create incident attachment returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createIncidentAttachment"] = true; +const apiInstance = new v2.IncidentsApi(configuration); + +const params: v2.IncidentsApiCreateIncidentAttachmentRequest = { + body: { + data: { + attributes: { + attachment: { + documentUrl: + "https://app.datadoghq.com/notebook/123/Postmortem-IR-123", + title: "Postmortem-IR-123", + }, + attachmentType: "postmortem", + }, + id: "00000000-0000-0000-0000-000000000000", + type: "incident_attachments", + }, + }, + incidentId: "incident_id", +}; + +apiInstance + .createIncidentAttachment(params) + .then((data: v2.Attachment) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/incidents/DeleteIncidentAttachment.ts b/examples/v2/incidents/DeleteIncidentAttachment.ts new file mode 100644 index 000000000000..cf1653ee542e --- /dev/null +++ b/examples/v2/incidents/DeleteIncidentAttachment.ts @@ -0,0 +1,23 @@ +/** + * Delete incident attachment returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.deleteIncidentAttachment"] = true; +const apiInstance = new v2.IncidentsApi(configuration); + +const params: v2.IncidentsApiDeleteIncidentAttachmentRequest = { + incidentId: "incident_id", + attachmentId: "00000000-0000-0000-0000-000000000002", +}; + +apiInstance + .deleteIncidentAttachment(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/incidents/ListIncidentAttachments.ts b/examples/v2/incidents/ListIncidentAttachments.ts index 677570486855..ee9e961e838f 100644 --- a/examples/v2/incidents/ListIncidentAttachments.ts +++ b/examples/v2/incidents/ListIncidentAttachments.ts @@ -1,5 +1,5 @@ /** - * Get a list of attachments returns "OK" response + * List incident attachments returns "OK" response */ import { client, v2 } from "@datadog/datadog-api-client"; @@ -14,7 +14,7 @@ const params: v2.IncidentsApiListIncidentAttachmentsRequest = { apiInstance .listIncidentAttachments(params) - .then((data: v2.IncidentAttachmentsResponse) => { + .then((data: v2.AttachmentArray) => { console.log( "API called successfully. Returned data: " + JSON.stringify(data) ); diff --git a/examples/v2/incidents/ListIncidentAttachments_2457735435.ts b/examples/v2/incidents/ListIncidentAttachments_2457735435.ts deleted file mode 100644 index 8e728502881c..000000000000 --- a/examples/v2/incidents/ListIncidentAttachments_2457735435.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Get incident attachments returns "OK" response - */ - -import { client, v2 } from "@datadog/datadog-api-client"; - -const configuration = client.createConfiguration(); -configuration.unstableOperations["v2.listIncidentAttachments"] = true; -const apiInstance = new v2.IncidentsApi(configuration); - -// there is a valid "incident" in the system -const INCIDENT_DATA_ID = process.env.INCIDENT_DATA_ID as string; - -const params: v2.IncidentsApiListIncidentAttachmentsRequest = { - incidentId: INCIDENT_DATA_ID, -}; - -apiInstance - .listIncidentAttachments(params) - .then((data: v2.IncidentAttachmentsResponse) => { - console.log( - "API called successfully. Returned data: " + JSON.stringify(data) - ); - }) - .catch((error: any) => console.error(error)); diff --git a/examples/v2/incidents/UpdateIncidentAttachment.ts b/examples/v2/incidents/UpdateIncidentAttachment.ts new file mode 100644 index 000000000000..4039e0f3b419 --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentAttachment.ts @@ -0,0 +1,35 @@ +/** + * Update incident attachment returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.updateIncidentAttachment"] = true; +const apiInstance = new v2.IncidentsApi(configuration); + +const params: v2.IncidentsApiUpdateIncidentAttachmentRequest = { + body: { + data: { + attributes: { + attachment: { + documentUrl: + "https://app.datadoghq.com/notebook/124/Postmortem-IR-124", + title: "Postmortem-IR-124", + }, + }, + type: "incident_attachments", + }, + }, + incidentId: "incident_id", + attachmentId: "00000000-0000-0000-0000-000000000002", +}; + +apiInstance + .updateIncidentAttachment(params) + .then((data: v2.Attachment) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/incidents/UpdateIncidentAttachments.ts b/examples/v2/incidents/UpdateIncidentAttachments.ts deleted file mode 100644 index 00dc1964e9db..000000000000 --- a/examples/v2/incidents/UpdateIncidentAttachments.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Create, update, and delete incident attachments returns "OK" response - */ - -import { client, v2 } from "@datadog/datadog-api-client"; - -const configuration = client.createConfiguration(); -configuration.unstableOperations["v2.updateIncidentAttachments"] = true; -const apiInstance = new v2.IncidentsApi(configuration); - -const params: v2.IncidentsApiUpdateIncidentAttachmentsRequest = { - body: { - data: [ - { - attributes: { - attachment: { - documentUrl: "https://app.datadoghq.com/notebook/123", - title: "Postmortem IR-123", - }, - attachmentType: "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", - }, - attachmentType: "link", - }, - type: "incident_attachments", - }, - { - id: "00000000-abcd-0003-0000-000000000000", - type: "incident_attachments", - }, - ], - }, - incidentId: "incident_id", -}; - -apiInstance - .updateIncidentAttachments(params) - .then((data: v2.IncidentAttachmentUpdateResponse) => { - console.log( - "API called successfully. Returned data: " + JSON.stringify(data) - ); - }) - .catch((error: any) => console.error(error)); diff --git a/examples/v2/incidents/UpdateIncidentAttachments_3881702075.ts b/examples/v2/incidents/UpdateIncidentAttachments_3881702075.ts deleted file mode 100644 index 30f093c5c79d..000000000000 --- a/examples/v2/incidents/UpdateIncidentAttachments_3881702075.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Create an incident attachment returns "OK" response - */ - -import { client, v2 } from "@datadog/datadog-api-client"; - -const configuration = client.createConfiguration(); -configuration.unstableOperations["v2.updateIncidentAttachments"] = true; -const apiInstance = new v2.IncidentsApi(configuration); - -// there is a valid "incident" in the system -const INCIDENT_DATA_ID = process.env.INCIDENT_DATA_ID as string; - -const params: v2.IncidentsApiUpdateIncidentAttachmentsRequest = { - body: { - data: [ - { - type: "incident_attachments", - attributes: { - attachmentType: "link", - attachment: { - documentUrl: "https://www.example.com/doc", - title: "Example-Incident", - }, - }, - }, - ], - }, - incidentId: INCIDENT_DATA_ID, -}; - -apiInstance - .updateIncidentAttachments(params) - .then((data: v2.IncidentAttachmentUpdateResponse) => { - console.log( - "API called successfully. Returned data: " + JSON.stringify(data) - ); - }) - .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 58bddf5a680b..d28c818b9458 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -5977,30 +5977,60 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { "type": "string", "format": "", }, + "filterAttachmentType": { + "type": "string", + "format": "", + }, "include": { - "type": "Array", + "type": "string", "format": "", }, - "filterAttachmentType": { - "type": "Array", + "operationResponseType": "AttachmentArray", + }, + "v2.CreateIncidentAttachment": { + "incidentId": { + "type": "string", "format": "", }, - "operationResponseType": "IncidentAttachmentsResponse", + "include": { + "type": "string", + "format": "", + }, + "body": { + "type": "CreateAttachmentRequest", + "format": "", + }, + "operationResponseType": "Attachment", + }, + "v2.DeleteIncidentAttachment": { + "incidentId": { + "type": "string", + "format": "", + }, + "attachmentId": { + "type": "any", + "format": "", + }, + "operationResponseType": "{}", }, - "v2.UpdateIncidentAttachments": { + "v2.UpdateIncidentAttachment": { "incidentId": { "type": "string", "format": "", }, + "attachmentId": { + "type": "any", + "format": "", + }, "include": { - "type": "Array", + "type": "string", "format": "", }, "body": { - "type": "IncidentAttachmentUpdateRequest", + "type": "PatchAttachmentRequest", "format": "", }, - "operationResponseType": "IncidentAttachmentUpdateResponse", + "operationResponseType": "Attachment", }, "v2.ListIncidentImpacts": { "incidentId": { diff --git a/features/v2/given.json b/features/v2/given.json index 5e9aa4d3b5fe..1d3d16d80dfc 100644 --- a/features/v2/given.json +++ b/features/v2/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/features/v2/incidents.feature b/features/v2/incidents.feature index 12ab3e2f5ba5..a101f5f4af44 100644 --- a/features/v2/incidents.feature +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index e0f0b98d0c96..f59f66d6e82c 100644 --- a/features/v2/undo.json +++ b/features/v2/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" diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index b94887bb37de..ba452329d0d3 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -282,12 +282,14 @@ export function createConfiguration( "v2.updateDeploymentGate": false, "v2.updateDeploymentRule": false, "v2.createIncident": false, + "v2.createIncidentAttachment": false, "v2.createIncidentIntegration": false, "v2.createIncidentNotificationRule": false, "v2.createIncidentNotificationTemplate": false, "v2.createIncidentTodo": false, "v2.createIncidentType": false, "v2.deleteIncident": false, + "v2.deleteIncidentAttachment": false, "v2.deleteIncidentIntegration": false, "v2.deleteIncidentNotificationRule": false, "v2.deleteIncidentNotificationTemplate": false, @@ -308,7 +310,7 @@ export function createConfiguration( "v2.listIncidentTypes": false, "v2.searchIncidents": false, "v2.updateIncident": false, - "v2.updateIncidentAttachments": false, + "v2.updateIncidentAttachment": false, "v2.updateIncidentIntegration": false, "v2.updateIncidentNotificationRule": false, "v2.updateIncidentNotificationTemplate": false, diff --git a/packages/datadog-api-client-v2/apis/IncidentsApi.ts b/packages/datadog-api-client-v2/apis/IncidentsApi.ts index f9dc1300da02..39c60008aff1 100644 --- a/packages/datadog-api-client-v2/apis/IncidentsApi.ts +++ b/packages/datadog-api-client-v2/apis/IncidentsApi.ts @@ -17,13 +17,11 @@ import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; +import { Attachment } from "../models/Attachment"; +import { AttachmentArray } from "../models/AttachmentArray"; +import { CreateAttachmentRequest } from "../models/CreateAttachmentRequest"; import { CreateIncidentNotificationRuleRequest } from "../models/CreateIncidentNotificationRuleRequest"; import { CreateIncidentNotificationTemplateRequest } from "../models/CreateIncidentNotificationTemplateRequest"; -import { IncidentAttachmentAttachmentType } from "../models/IncidentAttachmentAttachmentType"; -import { IncidentAttachmentRelatedObject } from "../models/IncidentAttachmentRelatedObject"; -import { IncidentAttachmentsResponse } from "../models/IncidentAttachmentsResponse"; -import { IncidentAttachmentUpdateRequest } from "../models/IncidentAttachmentUpdateRequest"; -import { IncidentAttachmentUpdateResponse } from "../models/IncidentAttachmentUpdateResponse"; import { IncidentCreateRequest } from "../models/IncidentCreateRequest"; import { IncidentImpactCreateRequest } from "../models/IncidentImpactCreateRequest"; import { IncidentImpactRelatedObject } from "../models/IncidentImpactRelatedObject"; @@ -53,6 +51,7 @@ import { IncidentTypeListResponse } from "../models/IncidentTypeListResponse"; import { IncidentTypePatchRequest } from "../models/IncidentTypePatchRequest"; import { IncidentTypeResponse } from "../models/IncidentTypeResponse"; import { IncidentUpdateRequest } from "../models/IncidentUpdateRequest"; +import { PatchAttachmentRequest } from "../models/PatchAttachmentRequest"; import { PatchIncidentNotificationTemplateRequest } from "../models/PatchIncidentNotificationTemplateRequest"; import { PutIncidentNotificationRuleRequest } from "../models/PutIncidentNotificationRuleRequest"; @@ -104,6 +103,74 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async createIncidentAttachment( + incidentId: string, + body: CreateAttachmentRequest, + include?: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createIncidentAttachment'"); + if (!_config.unstableOperations["v2.createIncidentAttachment"]) { + throw new Error( + "Unstable operation 'createIncidentAttachment' is disabled" + ); + } + + // verify required parameter 'incidentId' is not null or undefined + if (incidentId === null || incidentId === undefined) { + throw new RequiredError("incidentId", "createIncidentAttachment"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createIncidentAttachment"); + } + + // Path Params + const localVarPath = "/api/v2/incidents/{incident_id}/attachments".replace( + "{incident_id}", + encodeURIComponent(String(incidentId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.IncidentsApi.createIncidentAttachment") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (include !== undefined) { + requestContext.setQueryParam( + "include", + ObjectSerializer.serialize(include, "string", ""), + "" + ); + } + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "CreateAttachmentRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async createIncidentImpact( incidentId: string, body: IncidentImpactCreateRequest, @@ -483,6 +550,53 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async deleteIncidentAttachment( + incidentId: string, + attachmentId: any, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'deleteIncidentAttachment'"); + if (!_config.unstableOperations["v2.deleteIncidentAttachment"]) { + throw new Error( + "Unstable operation 'deleteIncidentAttachment' is disabled" + ); + } + + // verify required parameter 'incidentId' is not null or undefined + if (incidentId === null || incidentId === undefined) { + throw new RequiredError("incidentId", "deleteIncidentAttachment"); + } + + // verify required parameter 'attachmentId' is not null or undefined + if (attachmentId === null || attachmentId === undefined) { + throw new RequiredError("attachmentId", "deleteIncidentAttachment"); + } + + // Path Params + const localVarPath = + "/api/v2/incidents/{incident_id}/attachments/{attachment_id}" + .replace("{incident_id}", encodeURIComponent(String(incidentId))) + .replace("{attachment_id}", encodeURIComponent(String(attachmentId))); + + // Make Request Context + const requestContext = _config + .getServer("v2.IncidentsApi.deleteIncidentAttachment") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async deleteIncidentImpact( incidentId: string, impactId: string, @@ -1059,8 +1173,8 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { public async listIncidentAttachments( incidentId: string, - include?: Array, - filterAttachmentType?: Array, + filterAttachmentType?: string, + include?: string, _options?: Configuration ): Promise { const _config = _options || this.configuration; @@ -1091,26 +1205,18 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { requestContext.setHttpConfig(_config.httpConfig); // Query Params - if (include !== undefined) { + if (filterAttachmentType !== undefined) { requestContext.setQueryParam( - "include", - ObjectSerializer.serialize( - include, - "Array", - "" - ), - "csv" + "filter[attachment_type]", + ObjectSerializer.serialize(filterAttachmentType, "string", ""), + "" ); } - if (filterAttachmentType !== undefined) { + if (include !== undefined) { requestContext.setQueryParam( - "filter[attachment_type]", - ObjectSerializer.serialize( - filterAttachmentType, - "Array", - "" - ), - "csv" + "include", + ObjectSerializer.serialize(include, "string", ""), + "" ); } @@ -1584,40 +1690,46 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } - public async updateIncidentAttachments( + public async updateIncidentAttachment( incidentId: string, - body: IncidentAttachmentUpdateRequest, - include?: Array, + attachmentId: any, + body: PatchAttachmentRequest, + include?: string, _options?: Configuration ): Promise { const _config = _options || this.configuration; - logger.warn("Using unstable operation 'updateIncidentAttachments'"); - if (!_config.unstableOperations["v2.updateIncidentAttachments"]) { + logger.warn("Using unstable operation 'updateIncidentAttachment'"); + if (!_config.unstableOperations["v2.updateIncidentAttachment"]) { throw new Error( - "Unstable operation 'updateIncidentAttachments' is disabled" + "Unstable operation 'updateIncidentAttachment' is disabled" ); } // verify required parameter 'incidentId' is not null or undefined if (incidentId === null || incidentId === undefined) { - throw new RequiredError("incidentId", "updateIncidentAttachments"); + throw new RequiredError("incidentId", "updateIncidentAttachment"); + } + + // verify required parameter 'attachmentId' is not null or undefined + if (attachmentId === null || attachmentId === undefined) { + throw new RequiredError("attachmentId", "updateIncidentAttachment"); } // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { - throw new RequiredError("body", "updateIncidentAttachments"); + throw new RequiredError("body", "updateIncidentAttachment"); } // Path Params - const localVarPath = "/api/v2/incidents/{incident_id}/attachments".replace( - "{incident_id}", - encodeURIComponent(String(incidentId)) - ); + const localVarPath = + "/api/v2/incidents/{incident_id}/attachments/{attachment_id}" + .replace("{incident_id}", encodeURIComponent(String(incidentId))) + .replace("{attachment_id}", encodeURIComponent(String(attachmentId))); // Make Request Context const requestContext = _config - .getServer("v2.IncidentsApi.updateIncidentAttachments") + .getServer("v2.IncidentsApi.updateIncidentAttachment") .makeRequestContext(localVarPath, HttpMethod.PATCH); requestContext.setHeaderParam("Accept", "application/json"); requestContext.setHttpConfig(_config.httpConfig); @@ -1626,12 +1738,8 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { if (include !== undefined) { requestContext.setQueryParam( "include", - ObjectSerializer.serialize( - include, - "Array", - "" - ), - "csv" + ObjectSerializer.serialize(include, "string", ""), + "" ); } @@ -1641,7 +1749,7 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( - ObjectSerializer.serialize(body, "IncidentAttachmentUpdateRequest", ""), + ObjectSerializer.serialize(body, "PatchAttachmentRequest", ""), contentType ); requestContext.setBody(serializedBody); @@ -1650,6 +1758,7 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { applySecurityAuthentication(_config, requestContext, [ "apiKeyAuth", "appKeyAuth", + "AuthZ", ]); return requestContext; @@ -2062,6 +2171,68 @@ export class IncidentsApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createIncidentAttachment + * @throws ApiException if the response code was not in [200, 299] + */ + public async createIncidentAttachment( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: Attachment = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Attachment" + ) as Attachment; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: Attachment = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Attachment", + "" + ) as Attachment; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -2501,6 +2672,60 @@ export class IncidentsApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteIncidentAttachment + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteIncidentAttachment( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -3219,24 +3444,18 @@ export class IncidentsApiResponseProcessor { */ public async listIncidentAttachments( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: IncidentAttachmentsResponse = ObjectSerializer.deserialize( + const body: AttachmentArray = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentAttachmentsResponse" - ) as IncidentAttachmentsResponse; + "AttachmentArray" + ) as AttachmentArray; return body; } - if ( - response.httpStatusCode === 400 || - response.httpStatusCode === 401 || - response.httpStatusCode === 403 || - response.httpStatusCode === 404 || - response.httpStatusCode === 429 - ) { + if (response.httpStatusCode === 400 || response.httpStatusCode === 429) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -3259,11 +3478,11 @@ export class IncidentsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: IncidentAttachmentsResponse = ObjectSerializer.deserialize( + const body: AttachmentArray = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentAttachmentsResponse", + "AttachmentArray", "" - ) as IncidentAttachmentsResponse; + ) as AttachmentArray; return body; } @@ -3857,26 +4076,24 @@ export class IncidentsApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to updateIncidentAttachments + * @params response Response returned by the server for a request to updateIncidentAttachment * @throws ApiException if the response code was not in [200, 299] */ - public async updateIncidentAttachments( + public async updateIncidentAttachment( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: IncidentAttachmentUpdateResponse = - ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentAttachmentUpdateResponse" - ) as IncidentAttachmentUpdateResponse; + const body: Attachment = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Attachment" + ) as Attachment; return body; } if ( response.httpStatusCode === 400 || - response.httpStatusCode === 401 || response.httpStatusCode === 403 || response.httpStatusCode === 404 || response.httpStatusCode === 429 @@ -3903,12 +4120,11 @@ export class IncidentsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: IncidentAttachmentUpdateResponse = - ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentAttachmentUpdateResponse", - "" - ) as IncidentAttachmentUpdateResponse; + const body: Attachment = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "Attachment", + "" + ) as Attachment; return body; } @@ -4250,6 +4466,23 @@ export interface IncidentsApiCreateIncidentRequest { body: IncidentCreateRequest; } +export interface IncidentsApiCreateIncidentAttachmentRequest { + /** + * The UUID of the incident. + * @type string + */ + incidentId: string; + /** + * @type CreateAttachmentRequest + */ + body: CreateAttachmentRequest; + /** + * Resource to include in the response. Supported value: `last_modified_by_user`. + * @type string + */ + include?: string; +} + export interface IncidentsApiCreateIncidentImpactRequest { /** * The UUID of the incident. @@ -4324,6 +4557,19 @@ export interface IncidentsApiDeleteIncidentRequest { incidentId: string; } +export interface IncidentsApiDeleteIncidentAttachmentRequest { + /** + * The UUID of the incident. + * @type string + */ + incidentId: string; + /** + * The ID of the attachment. + * @type any + */ + attachmentId: any; +} + export interface IncidentsApiDeleteIncidentImpactRequest { /** * The UUID of the incident. @@ -4477,15 +4723,15 @@ export interface IncidentsApiListIncidentAttachmentsRequest { */ incidentId: string; /** - * Specifies which types of related objects are included in the response. - * @type Array + * Filter attachments by type. Supported values are `1` (`postmortem`) and `2` (`link`). + * @type string */ - include?: Array; + filterAttachmentType?: string; /** - * Specifies which types of attachments are included in the response. - * @type Array + * Resource to include in the response. Supported value: `last_modified_by_user`. + * @type string */ - filterAttachmentType?: Array; + include?: string; } export interface IncidentsApiListIncidentImpactsRequest { @@ -4612,22 +4858,26 @@ export interface IncidentsApiUpdateIncidentRequest { include?: Array; } -export interface IncidentsApiUpdateIncidentAttachmentsRequest { +export interface IncidentsApiUpdateIncidentAttachmentRequest { /** * The UUID of the incident. * @type string */ incidentId: string; /** - * Incident Attachment Payload. - * @type IncidentAttachmentUpdateRequest + * The ID of the attachment. + * @type any */ - body: IncidentAttachmentUpdateRequest; + attachmentId: any; /** - * Specifies which types of related objects are included in the response. - * @type Array + * @type PatchAttachmentRequest + */ + body: PatchAttachmentRequest; + /** + * Resource to include in the response. Supported value: `last_modified_by_user`. + * @type string */ - include?: Array; + include?: string; } export interface IncidentsApiUpdateIncidentIntegrationRequest { @@ -4751,6 +5001,31 @@ export class IncidentsApi { }); } + /** + * Create an incident attachment. + * @param param The request object + */ + public createIncidentAttachment( + param: IncidentsApiCreateIncidentAttachmentRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createIncidentAttachment( + param.incidentId, + param.body, + param.include, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createIncidentAttachment( + responseContext + ); + }); + }); + } + /** * Create an impact for an incident. * @param param The request object @@ -4907,6 +5182,29 @@ export class IncidentsApi { }); } + /** + * @param param The request object + */ + public deleteIncidentAttachment( + param: IncidentsApiDeleteIncidentAttachmentRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.deleteIncidentAttachment( + param.incidentId, + param.attachmentId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteIncidentAttachment( + responseContext + ); + }); + }); + } + /** * Delete an incident impact. * @param param The request object @@ -5184,17 +5482,17 @@ export class IncidentsApi { } /** - * Get all attachments for a given incident. + * List incident attachments. * @param param The request object */ public listIncidentAttachments( param: IncidentsApiListIncidentAttachmentsRequest, options?: Configuration - ): Promise { + ): Promise { const requestContextPromise = this.requestFactory.listIncidentAttachments( param.incidentId, - param.include, param.filterAttachmentType, + param.include, options ); return requestContextPromise.then((requestContext) => { @@ -5513,15 +5811,15 @@ export class IncidentsApi { } /** - * The bulk update endpoint for creating, updating, and deleting attachments for a given incident. * @param param The request object */ - public updateIncidentAttachments( - param: IncidentsApiUpdateIncidentAttachmentsRequest, + public updateIncidentAttachment( + param: IncidentsApiUpdateIncidentAttachmentRequest, options?: Configuration - ): Promise { - const requestContextPromise = this.requestFactory.updateIncidentAttachments( + ): Promise { + const requestContextPromise = this.requestFactory.updateIncidentAttachment( param.incidentId, + param.attachmentId, param.body, param.include, options @@ -5530,7 +5828,7 @@ export class IncidentsApi { return this.configuration.httpApi .send(requestContext) .then((responseContext) => { - return this.responseProcessor.updateIncidentAttachments( + return this.responseProcessor.updateIncidentAttachment( responseContext ); }); diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 3242bff3dd33..1e696f47d397 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -403,6 +403,7 @@ export { export { IncidentsApiCreateIncidentRequest, + IncidentsApiCreateIncidentAttachmentRequest, IncidentsApiCreateIncidentImpactRequest, IncidentsApiCreateIncidentIntegrationRequest, IncidentsApiCreateIncidentNotificationRuleRequest, @@ -410,6 +411,7 @@ export { IncidentsApiCreateIncidentTodoRequest, IncidentsApiCreateIncidentTypeRequest, IncidentsApiDeleteIncidentRequest, + IncidentsApiDeleteIncidentAttachmentRequest, IncidentsApiDeleteIncidentImpactRequest, IncidentsApiDeleteIncidentIntegrationRequest, IncidentsApiDeleteIncidentNotificationRuleRequest, @@ -432,7 +434,7 @@ export { IncidentsApiListIncidentsRequest, IncidentsApiSearchIncidentsRequest, IncidentsApiUpdateIncidentRequest, - IncidentsApiUpdateIncidentAttachmentsRequest, + IncidentsApiUpdateIncidentAttachmentRequest, IncidentsApiUpdateIncidentIntegrationRequest, IncidentsApiUpdateIncidentNotificationRuleRequest, IncidentsApiUpdateIncidentNotificationTemplateRequest, @@ -1150,6 +1152,16 @@ export { AttachJiraIssueRequest } from "./models/AttachJiraIssueRequest"; export { AttachJiraIssueRequestData } from "./models/AttachJiraIssueRequestData"; export { AttachJiraIssueRequestDataAttributes } from "./models/AttachJiraIssueRequestDataAttributes"; export { AttachJiraIssueRequestDataRelationships } from "./models/AttachJiraIssueRequestDataRelationships"; +export { Attachment } from "./models/Attachment"; +export { AttachmentArray } from "./models/AttachmentArray"; +export { AttachmentData } from "./models/AttachmentData"; +export { AttachmentDataAttributes } from "./models/AttachmentDataAttributes"; +export { AttachmentDataAttributesAttachment } from "./models/AttachmentDataAttributesAttachment"; +export { AttachmentDataAttributesAttachmentType } from "./models/AttachmentDataAttributesAttachmentType"; +export { AttachmentDataRelationships } from "./models/AttachmentDataRelationships"; +export { AttachmentDataRelationshipsLastModifiedByUser } from "./models/AttachmentDataRelationshipsLastModifiedByUser"; +export { AttachmentDataRelationshipsLastModifiedByUserData } from "./models/AttachmentDataRelationshipsLastModifiedByUserData"; +export { AttachmentIncluded } from "./models/AttachmentIncluded"; export { AuditLogsEvent } from "./models/AuditLogsEvent"; export { AuditLogsEventAttributes } from "./models/AuditLogsEventAttributes"; export { AuditLogsEventsResponse } from "./models/AuditLogsEventsResponse"; @@ -1697,6 +1709,10 @@ export { CreateAppsDatastoreRequestDataAttributes } from "./models/CreateAppsDat export { CreateAppsDatastoreRequestDataAttributesOrgAccess } from "./models/CreateAppsDatastoreRequestDataAttributesOrgAccess"; export { CreateAppsDatastoreResponse } from "./models/CreateAppsDatastoreResponse"; export { CreateAppsDatastoreResponseData } from "./models/CreateAppsDatastoreResponseData"; +export { CreateAttachmentRequest } from "./models/CreateAttachmentRequest"; +export { CreateAttachmentRequestData } from "./models/CreateAttachmentRequestData"; +export { CreateAttachmentRequestDataAttributes } from "./models/CreateAttachmentRequestDataAttributes"; +export { CreateAttachmentRequestDataAttributesAttachment } from "./models/CreateAttachmentRequestDataAttributesAttachment"; export { CreateCaseRequestArray } from "./models/CreateCaseRequestArray"; export { CreateCaseRequestData } from "./models/CreateCaseRequestData"; export { CreateCaseRequestDataAttributes } from "./models/CreateCaseRequestDataAttributes"; @@ -2509,24 +2525,7 @@ export { HTTPTokenAuth } from "./models/HTTPTokenAuth"; export { HTTPTokenAuthType } from "./models/HTTPTokenAuthType"; export { HTTPTokenAuthUpdate } from "./models/HTTPTokenAuthUpdate"; export { HTTPTokenUpdate } from "./models/HTTPTokenUpdate"; -export { IncidentAttachmentAttachmentType } from "./models/IncidentAttachmentAttachmentType"; -export { IncidentAttachmentAttributes } from "./models/IncidentAttachmentAttributes"; -export { IncidentAttachmentData } from "./models/IncidentAttachmentData"; -export { IncidentAttachmentLinkAttachmentType } from "./models/IncidentAttachmentLinkAttachmentType"; -export { IncidentAttachmentLinkAttributes } from "./models/IncidentAttachmentLinkAttributes"; -export { IncidentAttachmentLinkAttributesAttachmentObject } from "./models/IncidentAttachmentLinkAttributesAttachmentObject"; -export { IncidentAttachmentPostmortemAttachmentType } from "./models/IncidentAttachmentPostmortemAttachmentType"; -export { IncidentAttachmentPostmortemAttributes } from "./models/IncidentAttachmentPostmortemAttributes"; -export { IncidentAttachmentRelatedObject } from "./models/IncidentAttachmentRelatedObject"; -export { IncidentAttachmentRelationships } from "./models/IncidentAttachmentRelationships"; -export { IncidentAttachmentsPostmortemAttributesAttachmentObject } from "./models/IncidentAttachmentsPostmortemAttributesAttachmentObject"; -export { IncidentAttachmentsResponse } from "./models/IncidentAttachmentsResponse"; -export { IncidentAttachmentsResponseIncludedItem } from "./models/IncidentAttachmentsResponseIncludedItem"; export { IncidentAttachmentType } from "./models/IncidentAttachmentType"; -export { IncidentAttachmentUpdateAttributes } from "./models/IncidentAttachmentUpdateAttributes"; -export { IncidentAttachmentUpdateData } from "./models/IncidentAttachmentUpdateData"; -export { IncidentAttachmentUpdateRequest } from "./models/IncidentAttachmentUpdateRequest"; -export { IncidentAttachmentUpdateResponse } from "./models/IncidentAttachmentUpdateResponse"; export { IncidentCreateAttributes } from "./models/IncidentCreateAttributes"; export { IncidentCreateData } from "./models/IncidentCreateData"; export { IncidentCreateRelationships } from "./models/IncidentCreateRelationships"; @@ -3469,6 +3468,10 @@ export { PartialAPIKeyAttributes } from "./models/PartialAPIKeyAttributes"; export { PartialApplicationKey } from "./models/PartialApplicationKey"; export { PartialApplicationKeyAttributes } from "./models/PartialApplicationKeyAttributes"; export { PartialApplicationKeyResponse } from "./models/PartialApplicationKeyResponse"; +export { PatchAttachmentRequest } from "./models/PatchAttachmentRequest"; +export { PatchAttachmentRequestData } from "./models/PatchAttachmentRequestData"; +export { PatchAttachmentRequestDataAttributes } from "./models/PatchAttachmentRequestDataAttributes"; +export { PatchAttachmentRequestDataAttributesAttachment } from "./models/PatchAttachmentRequestDataAttributesAttachment"; export { PatchIncidentNotificationTemplateRequest } from "./models/PatchIncidentNotificationTemplateRequest"; export { PatchNotificationRuleParameters } from "./models/PatchNotificationRuleParameters"; export { PatchNotificationRuleParametersData } from "./models/PatchNotificationRuleParametersData"; @@ -4550,6 +4553,7 @@ export { UsageObservabilityPipelinesResponse } from "./models/UsageObservability export { UsageTimeSeriesObject } from "./models/UsageTimeSeriesObject"; export { UsageTimeSeriesType } from "./models/UsageTimeSeriesType"; export { User } from "./models/User"; +export { User140420082644000 } from "./models/User140420082644000"; export { UserAttributes } from "./models/UserAttributes"; export { UserAttributesStatus } from "./models/UserAttributesStatus"; export { UserCreateAttributes } from "./models/UserCreateAttributes"; @@ -4591,6 +4595,7 @@ export { UserTeamType } from "./models/UserTeamType"; export { UserTeamUpdate } from "./models/UserTeamUpdate"; export { UserTeamUpdateRequest } from "./models/UserTeamUpdateRequest"; export { UserTeamUserType } from "./models/UserTeamUserType"; +export { UserType } from "./models/UserType"; export { UserUpdateAttributes } from "./models/UserUpdateAttributes"; export { UserUpdateData } from "./models/UserUpdateData"; export { UserUpdateRequest } from "./models/UserUpdateRequest"; diff --git a/packages/datadog-api-client-v2/models/Attachment.ts b/packages/datadog-api-client-v2/models/Attachment.ts new file mode 100644 index 000000000000..2279beaa0d88 --- /dev/null +++ b/packages/datadog-api-client-v2/models/Attachment.ts @@ -0,0 +1,53 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { AttachmentData } from "./AttachmentData"; +import { AttachmentIncluded } from "./AttachmentIncluded"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class Attachment { + "data"?: AttachmentData; + "included"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "AttachmentData", + }, + included: { + baseName: "included", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return Attachment.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentsResponse.ts b/packages/datadog-api-client-v2/models/AttachmentArray.ts similarity index 61% rename from packages/datadog-api-client-v2/models/IncidentAttachmentsResponse.ts rename to packages/datadog-api-client-v2/models/AttachmentArray.ts index 518e4285c770..28e40f397c92 100644 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentsResponse.ts +++ b/packages/datadog-api-client-v2/models/AttachmentArray.ts @@ -3,23 +3,14 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { IncidentAttachmentData } from "./IncidentAttachmentData"; -import { IncidentAttachmentsResponseIncludedItem } from "./IncidentAttachmentsResponseIncludedItem"; +import { AttachmentData } from "./AttachmentData"; +import { AttachmentIncluded } from "./AttachmentIncluded"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; -/** - * The response object containing an incident's attachments. - */ -export class IncidentAttachmentsResponse { - /** - * An array of incident attachments. - */ - "data": Array; - /** - * Included related resources that the user requested. - */ - "included"?: Array; +export class AttachmentArray { + "data": Array; + "included"?: Array; /** * A container for additional, undeclared properties. @@ -39,12 +30,12 @@ export class IncidentAttachmentsResponse { static readonly attributeTypeMap: AttributeTypeMap = { data: { baseName: "data", - type: "Array", + type: "Array", required: true, }, included: { baseName: "included", - type: "Array", + type: "Array", }, additionalProperties: { baseName: "additionalProperties", @@ -56,7 +47,7 @@ export class IncidentAttachmentsResponse { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return IncidentAttachmentsResponse.attributeTypeMap; + return AttachmentArray.attributeTypeMap; } public constructor() {} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentData.ts b/packages/datadog-api-client-v2/models/AttachmentData.ts similarity index 68% rename from packages/datadog-api-client-v2/models/IncidentAttachmentData.ts rename to packages/datadog-api-client-v2/models/AttachmentData.ts index 2657804dd043..c330ed5cf64c 100644 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentData.ts +++ b/packages/datadog-api-client-v2/models/AttachmentData.ts @@ -3,28 +3,16 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { IncidentAttachmentAttributes } from "./IncidentAttachmentAttributes"; -import { IncidentAttachmentRelationships } from "./IncidentAttachmentRelationships"; +import { AttachmentDataAttributes } from "./AttachmentDataAttributes"; +import { AttachmentDataRelationships } from "./AttachmentDataRelationships"; import { IncidentAttachmentType } from "./IncidentAttachmentType"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; -/** - * A single incident attachment. - */ -export class IncidentAttachmentData { - /** - * The attributes object for an attachment. - */ - "attributes": IncidentAttachmentAttributes; - /** - * A unique identifier that represents the incident attachment. - */ +export class AttachmentData { + "attributes": AttachmentDataAttributes; "id": string; - /** - * The incident attachment's relationships. - */ - "relationships": IncidentAttachmentRelationships; + "relationships": AttachmentDataRelationships; /** * The incident attachment resource type. */ @@ -48,7 +36,7 @@ export class IncidentAttachmentData { static readonly attributeTypeMap: AttributeTypeMap = { attributes: { baseName: "attributes", - type: "IncidentAttachmentAttributes", + type: "AttachmentDataAttributes", required: true, }, id: { @@ -58,7 +46,7 @@ export class IncidentAttachmentData { }, relationships: { baseName: "relationships", - type: "IncidentAttachmentRelationships", + type: "AttachmentDataRelationships", required: true, }, type: { @@ -76,7 +64,7 @@ export class IncidentAttachmentData { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return IncidentAttachmentData.attributeTypeMap; + return AttachmentData.attributeTypeMap; } public constructor() {} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributes.ts b/packages/datadog-api-client-v2/models/AttachmentDataAttributes.ts similarity index 58% rename from packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributes.ts rename to packages/datadog-api-client-v2/models/AttachmentDataAttributes.ts index a8dda8404d1b..89e3107c0ac8 100644 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributes.ts +++ b/packages/datadog-api-client-v2/models/AttachmentDataAttributes.ts @@ -3,26 +3,14 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { IncidentAttachmentLinkAttachmentType } from "./IncidentAttachmentLinkAttachmentType"; -import { IncidentAttachmentLinkAttributesAttachmentObject } from "./IncidentAttachmentLinkAttributesAttachmentObject"; +import { AttachmentDataAttributesAttachment } from "./AttachmentDataAttributesAttachment"; +import { AttachmentDataAttributesAttachmentType } from "./AttachmentDataAttributesAttachmentType"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; -/** - * The attributes object for a link attachment. - */ -export class IncidentAttachmentLinkAttributes { - /** - * The link attachment. - */ - "attachment": IncidentAttachmentLinkAttributesAttachmentObject; - /** - * The type of link attachment attributes. - */ - "attachmentType": IncidentAttachmentLinkAttachmentType; - /** - * Timestamp when the incident attachment link was last modified. - */ +export class AttachmentDataAttributes { + "attachment"?: AttachmentDataAttributesAttachment; + "attachmentType"?: AttachmentDataAttributesAttachmentType; "modified"?: Date; /** @@ -43,13 +31,11 @@ export class IncidentAttachmentLinkAttributes { static readonly attributeTypeMap: AttributeTypeMap = { attachment: { baseName: "attachment", - type: "IncidentAttachmentLinkAttributesAttachmentObject", - required: true, + type: "AttachmentDataAttributesAttachment", }, attachmentType: { baseName: "attachment_type", - type: "IncidentAttachmentLinkAttachmentType", - required: true, + type: "AttachmentDataAttributesAttachmentType", }, modified: { baseName: "modified", @@ -66,7 +52,7 @@ export class IncidentAttachmentLinkAttributes { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return IncidentAttachmentLinkAttributes.attributeTypeMap; + return AttachmentDataAttributes.attributeTypeMap; } public constructor() {} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributesAttachmentObject.ts b/packages/datadog-api-client-v2/models/AttachmentDataAttributesAttachment.ts similarity index 74% rename from packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributesAttachmentObject.ts rename to packages/datadog-api-client-v2/models/AttachmentDataAttributesAttachment.ts index cc57bf9c1a18..e4667d5d08a8 100644 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributesAttachmentObject.ts +++ b/packages/datadog-api-client-v2/models/AttachmentDataAttributesAttachment.ts @@ -6,18 +6,9 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; -/** - * The link attachment. - */ -export class IncidentAttachmentLinkAttributesAttachmentObject { - /** - * The URL of this link attachment. - */ - "documentUrl": string; - /** - * The title of this link attachment. - */ - "title": string; +export class AttachmentDataAttributesAttachment { + "documentUrl"?: string; + "title"?: string; /** * A container for additional, undeclared properties. @@ -38,12 +29,10 @@ export class IncidentAttachmentLinkAttributesAttachmentObject { documentUrl: { baseName: "documentUrl", type: "string", - required: true, }, title: { baseName: "title", type: "string", - required: true, }, additionalProperties: { baseName: "additionalProperties", @@ -55,7 +44,7 @@ export class IncidentAttachmentLinkAttributesAttachmentObject { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return IncidentAttachmentLinkAttributesAttachmentObject.attributeTypeMap; + return AttachmentDataAttributesAttachment.attributeTypeMap; } public constructor() {} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentAttachmentType.ts b/packages/datadog-api-client-v2/models/AttachmentDataAttributesAttachmentType.ts similarity index 80% rename from packages/datadog-api-client-v2/models/IncidentAttachmentAttachmentType.ts rename to packages/datadog-api-client-v2/models/AttachmentDataAttributesAttachmentType.ts index 9a9ad0530e91..ec26335611b1 100644 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentAttachmentType.ts +++ b/packages/datadog-api-client-v2/models/AttachmentDataAttributesAttachmentType.ts @@ -6,13 +6,9 @@ import { UnparsedObject } from "../../datadog-api-client-common/util"; -/** - * The type of the incident attachment attributes. - */ - -export type IncidentAttachmentAttachmentType = - | typeof LINK +export type AttachmentDataAttributesAttachmentType = | typeof POSTMORTEM + | typeof LINK | UnparsedObject; -export const LINK = "link"; export const POSTMORTEM = "postmortem"; +export const LINK = "link"; diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentRelationships.ts b/packages/datadog-api-client-v2/models/AttachmentDataRelationships.ts similarity index 74% rename from packages/datadog-api-client-v2/models/IncidentAttachmentRelationships.ts rename to packages/datadog-api-client-v2/models/AttachmentDataRelationships.ts index b42c8c593cc3..0406915572a4 100644 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentRelationships.ts +++ b/packages/datadog-api-client-v2/models/AttachmentDataRelationships.ts @@ -3,18 +3,12 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { RelationshipToUser } from "./RelationshipToUser"; +import { AttachmentDataRelationshipsLastModifiedByUser } from "./AttachmentDataRelationshipsLastModifiedByUser"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; -/** - * The incident attachment's relationships. - */ -export class IncidentAttachmentRelationships { - /** - * Relationship to user. - */ - "lastModifiedByUser"?: RelationshipToUser; +export class AttachmentDataRelationships { + "lastModifiedByUser"?: AttachmentDataRelationshipsLastModifiedByUser; /** * A container for additional, undeclared properties. @@ -34,7 +28,7 @@ export class IncidentAttachmentRelationships { static readonly attributeTypeMap: AttributeTypeMap = { lastModifiedByUser: { baseName: "last_modified_by_user", - type: "RelationshipToUser", + type: "AttachmentDataRelationshipsLastModifiedByUser", }, additionalProperties: { baseName: "additionalProperties", @@ -46,7 +40,7 @@ export class IncidentAttachmentRelationships { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return IncidentAttachmentRelationships.attributeTypeMap; + return AttachmentDataRelationships.attributeTypeMap; } public constructor() {} diff --git a/packages/datadog-api-client-v2/models/AttachmentDataRelationshipsLastModifiedByUser.ts b/packages/datadog-api-client-v2/models/AttachmentDataRelationshipsLastModifiedByUser.ts new file mode 100644 index 000000000000..d48757add87f --- /dev/null +++ b/packages/datadog-api-client-v2/models/AttachmentDataRelationshipsLastModifiedByUser.ts @@ -0,0 +1,48 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { AttachmentDataRelationshipsLastModifiedByUserData } from "./AttachmentDataRelationshipsLastModifiedByUserData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class AttachmentDataRelationshipsLastModifiedByUser { + "data": AttachmentDataRelationshipsLastModifiedByUserData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "AttachmentDataRelationshipsLastModifiedByUserData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AttachmentDataRelationshipsLastModifiedByUser.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AttachmentDataRelationshipsLastModifiedByUserData.ts b/packages/datadog-api-client-v2/models/AttachmentDataRelationshipsLastModifiedByUserData.ts new file mode 100644 index 000000000000..1adc3b853539 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AttachmentDataRelationshipsLastModifiedByUserData.ts @@ -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 2020-Present Datadog, Inc. + */ +import { UserType } from "./UserType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class AttachmentDataRelationshipsLastModifiedByUserData { + "id": string; + /** + * Users resource type. + */ + "type": UserType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "UserType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AttachmentDataRelationshipsLastModifiedByUserData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttachmentType.ts b/packages/datadog-api-client-v2/models/AttachmentIncluded.ts similarity index 66% rename from packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttachmentType.ts rename to packages/datadog-api-client-v2/models/AttachmentIncluded.ts index 5fd37839315b..47b81aeda491 100644 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttachmentType.ts +++ b/packages/datadog-api-client-v2/models/AttachmentIncluded.ts @@ -3,12 +3,8 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ +import { User140420082644000 } from "./User140420082644000"; import { UnparsedObject } from "../../datadog-api-client-common/util"; -/** - * The type of link attachment attributes. - */ - -export type IncidentAttachmentLinkAttachmentType = typeof LINK | UnparsedObject; -export const LINK = "link"; +export type AttachmentIncluded = User140420082644000 | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/CreateAttachmentRequest.ts b/packages/datadog-api-client-v2/models/CreateAttachmentRequest.ts new file mode 100644 index 000000000000..ff3e3c1dbc8d --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateAttachmentRequest.ts @@ -0,0 +1,47 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { CreateAttachmentRequestData } from "./CreateAttachmentRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class CreateAttachmentRequest { + "data"?: CreateAttachmentRequestData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "CreateAttachmentRequestData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateAttachmentRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateData.ts b/packages/datadog-api-client-v2/models/CreateAttachmentRequestData.ts similarity index 74% rename from packages/datadog-api-client-v2/models/IncidentAttachmentUpdateData.ts rename to packages/datadog-api-client-v2/models/CreateAttachmentRequestData.ts index 1061d658331a..68d7ffbb4ddf 100644 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateData.ts +++ b/packages/datadog-api-client-v2/models/CreateAttachmentRequestData.ts @@ -3,22 +3,13 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ +import { CreateAttachmentRequestDataAttributes } from "./CreateAttachmentRequestDataAttributes"; import { IncidentAttachmentType } from "./IncidentAttachmentType"; -import { IncidentAttachmentUpdateAttributes } from "./IncidentAttachmentUpdateAttributes"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; -/** - * A single incident attachment. - */ -export class IncidentAttachmentUpdateData { - /** - * Incident attachment attributes. - */ - "attributes"?: IncidentAttachmentUpdateAttributes; - /** - * A unique identifier that represents the incident attachment. - */ +export class CreateAttachmentRequestData { + "attributes"?: CreateAttachmentRequestDataAttributes; "id"?: string; /** * The incident attachment resource type. @@ -43,7 +34,7 @@ export class IncidentAttachmentUpdateData { static readonly attributeTypeMap: AttributeTypeMap = { attributes: { baseName: "attributes", - type: "IncidentAttachmentUpdateAttributes", + type: "CreateAttachmentRequestDataAttributes", }, id: { baseName: "id", @@ -64,7 +55,7 @@ export class IncidentAttachmentUpdateData { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return IncidentAttachmentUpdateData.attributeTypeMap; + return CreateAttachmentRequestData.attributeTypeMap; } public constructor() {} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttributes.ts b/packages/datadog-api-client-v2/models/CreateAttachmentRequestDataAttributes.ts similarity index 55% rename from packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttributes.ts rename to packages/datadog-api-client-v2/models/CreateAttachmentRequestDataAttributes.ts index 293122972457..4ddaa0848cff 100644 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttributes.ts +++ b/packages/datadog-api-client-v2/models/CreateAttachmentRequestDataAttributes.ts @@ -3,23 +3,14 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { IncidentAttachmentPostmortemAttachmentType } from "./IncidentAttachmentPostmortemAttachmentType"; -import { IncidentAttachmentsPostmortemAttributesAttachmentObject } from "./IncidentAttachmentsPostmortemAttributesAttachmentObject"; +import { AttachmentDataAttributesAttachmentType } from "./AttachmentDataAttributesAttachmentType"; +import { CreateAttachmentRequestDataAttributesAttachment } from "./CreateAttachmentRequestDataAttributesAttachment"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; -/** - * The attributes object for a postmortem attachment. - */ -export class IncidentAttachmentPostmortemAttributes { - /** - * The postmortem attachment. - */ - "attachment": IncidentAttachmentsPostmortemAttributesAttachmentObject; - /** - * The type of postmortem attachment attributes. - */ - "attachmentType": IncidentAttachmentPostmortemAttachmentType; +export class CreateAttachmentRequestDataAttributes { + "attachment"?: CreateAttachmentRequestDataAttributesAttachment; + "attachmentType"?: AttachmentDataAttributesAttachmentType; /** * A container for additional, undeclared properties. @@ -39,13 +30,11 @@ export class IncidentAttachmentPostmortemAttributes { static readonly attributeTypeMap: AttributeTypeMap = { attachment: { baseName: "attachment", - type: "IncidentAttachmentsPostmortemAttributesAttachmentObject", - required: true, + type: "CreateAttachmentRequestDataAttributesAttachment", }, attachmentType: { baseName: "attachment_type", - type: "IncidentAttachmentPostmortemAttachmentType", - required: true, + type: "AttachmentDataAttributesAttachmentType", }, additionalProperties: { baseName: "additionalProperties", @@ -57,7 +46,7 @@ export class IncidentAttachmentPostmortemAttributes { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return IncidentAttachmentPostmortemAttributes.attributeTypeMap; + return CreateAttachmentRequestDataAttributes.attributeTypeMap; } public constructor() {} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentsPostmortemAttributesAttachmentObject.ts b/packages/datadog-api-client-v2/models/CreateAttachmentRequestDataAttributesAttachment.ts similarity index 73% rename from packages/datadog-api-client-v2/models/IncidentAttachmentsPostmortemAttributesAttachmentObject.ts rename to packages/datadog-api-client-v2/models/CreateAttachmentRequestDataAttributesAttachment.ts index 27db83cf71c7..6ce164e6caff 100644 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentsPostmortemAttributesAttachmentObject.ts +++ b/packages/datadog-api-client-v2/models/CreateAttachmentRequestDataAttributesAttachment.ts @@ -6,18 +6,9 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; -/** - * The postmortem attachment. - */ -export class IncidentAttachmentsPostmortemAttributesAttachmentObject { - /** - * The URL of this notebook attachment. - */ - "documentUrl": string; - /** - * The title of this postmortem attachment. - */ - "title": string; +export class CreateAttachmentRequestDataAttributesAttachment { + "documentUrl"?: string; + "title"?: string; /** * A container for additional, undeclared properties. @@ -38,12 +29,10 @@ export class IncidentAttachmentsPostmortemAttributesAttachmentObject { documentUrl: { baseName: "documentUrl", type: "string", - required: true, }, title: { baseName: "title", type: "string", - required: true, }, additionalProperties: { baseName: "additionalProperties", @@ -55,7 +44,7 @@ export class IncidentAttachmentsPostmortemAttributesAttachmentObject { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return IncidentAttachmentsPostmortemAttributesAttachmentObject.attributeTypeMap; + return CreateAttachmentRequestDataAttributesAttachment.attributeTypeMap; } public constructor() {} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentAttributes.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentAttributes.ts deleted file mode 100644 index 8895c620e2fc..000000000000 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentAttributes.ts +++ /dev/null @@ -1,18 +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 2020-Present Datadog, Inc. - */ -import { IncidentAttachmentLinkAttributes } from "./IncidentAttachmentLinkAttributes"; -import { IncidentAttachmentPostmortemAttributes } from "./IncidentAttachmentPostmortemAttributes"; - -import { UnparsedObject } from "../../datadog-api-client-common/util"; - -/** - * The attributes object for an attachment. - */ - -export type IncidentAttachmentAttributes = - | IncidentAttachmentPostmortemAttributes - | IncidentAttachmentLinkAttributes - | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttachmentType.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttachmentType.ts deleted file mode 100644 index e3c2452d31af..000000000000 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttachmentType.ts +++ /dev/null @@ -1,16 +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 2020-Present Datadog, Inc. - */ - -import { UnparsedObject } from "../../datadog-api-client-common/util"; - -/** - * The type of postmortem attachment attributes. - */ - -export type IncidentAttachmentPostmortemAttachmentType = - | typeof POSTMORTEM - | UnparsedObject; -export const POSTMORTEM = "postmortem"; diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateAttributes.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateAttributes.ts deleted file mode 100644 index 1792ea143f52..000000000000 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateAttributes.ts +++ /dev/null @@ -1,18 +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 2020-Present Datadog, Inc. - */ -import { IncidentAttachmentLinkAttributes } from "./IncidentAttachmentLinkAttributes"; -import { IncidentAttachmentPostmortemAttributes } from "./IncidentAttachmentPostmortemAttributes"; - -import { UnparsedObject } from "../../datadog-api-client-common/util"; - -/** - * Incident attachment attributes. - */ - -export type IncidentAttachmentUpdateAttributes = - | IncidentAttachmentPostmortemAttributes - | IncidentAttachmentLinkAttributes - | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateRequest.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateRequest.ts deleted file mode 100644 index d8397b432f2f..000000000000 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateRequest.ts +++ /dev/null @@ -1,57 +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 2020-Present Datadog, Inc. - */ -import { IncidentAttachmentUpdateData } from "./IncidentAttachmentUpdateData"; - -import { AttributeTypeMap } from "../../datadog-api-client-common/util"; - -/** - * The update request for an incident's attachments. - */ -export class IncidentAttachmentUpdateRequest { - /** - * 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. - */ - "data": Array; - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - "additionalProperties"?: { [key: string]: any }; - - /** - * @ignore - */ - "_unparsed"?: boolean; - - /** - * @ignore - */ - static readonly attributeTypeMap: AttributeTypeMap = { - data: { - baseName: "data", - type: "Array", - required: true, - }, - additionalProperties: { - baseName: "additionalProperties", - type: "{ [key: string]: any; }", - }, - }; - - /** - * @ignore - */ - static getAttributeTypeMap(): AttributeTypeMap { - return IncidentAttachmentUpdateRequest.attributeTypeMap; - } - - public constructor() {} -} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateResponse.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateResponse.ts deleted file mode 100644 index d43d30a80b9d..000000000000 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateResponse.ts +++ /dev/null @@ -1,64 +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 2020-Present Datadog, Inc. - */ -import { IncidentAttachmentData } from "./IncidentAttachmentData"; -import { IncidentAttachmentsResponseIncludedItem } from "./IncidentAttachmentsResponseIncludedItem"; - -import { AttributeTypeMap } from "../../datadog-api-client-common/util"; - -/** - * The response object containing the created or updated incident attachments. - */ -export class IncidentAttachmentUpdateResponse { - /** - * An array of incident attachments. Only the attachments that were created or updated by the request are - * returned. - */ - "data": Array; - /** - * Included related resources that the user requested. - */ - "included"?: Array; - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - "additionalProperties"?: { [key: string]: any }; - - /** - * @ignore - */ - "_unparsed"?: boolean; - - /** - * @ignore - */ - static readonly attributeTypeMap: AttributeTypeMap = { - data: { - baseName: "data", - type: "Array", - required: true, - }, - included: { - baseName: "included", - type: "Array", - }, - additionalProperties: { - baseName: "additionalProperties", - type: "{ [key: string]: any; }", - }, - }; - - /** - * @ignore - */ - static getAttributeTypeMap(): AttributeTypeMap { - return IncidentAttachmentUpdateResponse.attributeTypeMap; - } - - public constructor() {} -} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentsResponseIncludedItem.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentsResponseIncludedItem.ts deleted file mode 100644 index a6969b091126..000000000000 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentsResponseIncludedItem.ts +++ /dev/null @@ -1,14 +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 2020-Present Datadog, Inc. - */ -import { User } from "./User"; - -import { UnparsedObject } from "../../datadog-api-client-common/util"; - -/** - * An object related to an attachment that is included in the response. - */ - -export type IncidentAttachmentsResponseIncludedItem = User | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/IncidentResponseIncludedItem.ts b/packages/datadog-api-client-v2/models/IncidentResponseIncludedItem.ts index 3dc4cef9615a..9647147c58c0 100644 --- a/packages/datadog-api-client-v2/models/IncidentResponseIncludedItem.ts +++ b/packages/datadog-api-client-v2/models/IncidentResponseIncludedItem.ts @@ -3,7 +3,7 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { IncidentAttachmentData } from "./IncidentAttachmentData"; +import { AttachmentData } from "./AttachmentData"; import { IncidentUserData } from "./IncidentUserData"; import { UnparsedObject } from "../../datadog-api-client-common/util"; @@ -14,5 +14,5 @@ import { UnparsedObject } from "../../datadog-api-client-common/util"; export type IncidentResponseIncludedItem = | IncidentUserData - | IncidentAttachmentData + | AttachmentData | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index a516b43547ef..bad042fde0ed 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -183,6 +183,14 @@ import { AttachJiraIssueRequest } from "./AttachJiraIssueRequest"; import { AttachJiraIssueRequestData } from "./AttachJiraIssueRequestData"; import { AttachJiraIssueRequestDataAttributes } from "./AttachJiraIssueRequestDataAttributes"; import { AttachJiraIssueRequestDataRelationships } from "./AttachJiraIssueRequestDataRelationships"; +import { Attachment } from "./Attachment"; +import { AttachmentArray } from "./AttachmentArray"; +import { AttachmentData } from "./AttachmentData"; +import { AttachmentDataAttributes } from "./AttachmentDataAttributes"; +import { AttachmentDataAttributesAttachment } from "./AttachmentDataAttributesAttachment"; +import { AttachmentDataRelationships } from "./AttachmentDataRelationships"; +import { AttachmentDataRelationshipsLastModifiedByUser } from "./AttachmentDataRelationshipsLastModifiedByUser"; +import { AttachmentDataRelationshipsLastModifiedByUserData } from "./AttachmentDataRelationshipsLastModifiedByUserData"; import { AuditLogsEvent } from "./AuditLogsEvent"; import { AuditLogsEventAttributes } from "./AuditLogsEventAttributes"; import { AuditLogsEventsResponse } from "./AuditLogsEventsResponse"; @@ -543,6 +551,10 @@ import { CreateAppsDatastoreRequestData } from "./CreateAppsDatastoreRequestData import { CreateAppsDatastoreRequestDataAttributes } from "./CreateAppsDatastoreRequestDataAttributes"; import { CreateAppsDatastoreResponse } from "./CreateAppsDatastoreResponse"; import { CreateAppsDatastoreResponseData } from "./CreateAppsDatastoreResponseData"; +import { CreateAttachmentRequest } from "./CreateAttachmentRequest"; +import { CreateAttachmentRequestData } from "./CreateAttachmentRequestData"; +import { CreateAttachmentRequestDataAttributes } from "./CreateAttachmentRequestDataAttributes"; +import { CreateAttachmentRequestDataAttributesAttachment } from "./CreateAttachmentRequestDataAttributesAttachment"; import { CreateCaseRequestArray } from "./CreateCaseRequestArray"; import { CreateCaseRequestData } from "./CreateCaseRequestData"; import { CreateCaseRequestDataAttributes } from "./CreateCaseRequestDataAttributes"; @@ -1183,16 +1195,6 @@ import { IPAllowlistEntryAttributes } from "./IPAllowlistEntryAttributes"; import { IPAllowlistEntryData } from "./IPAllowlistEntryData"; import { IPAllowlistResponse } from "./IPAllowlistResponse"; import { IPAllowlistUpdateRequest } from "./IPAllowlistUpdateRequest"; -import { IncidentAttachmentData } from "./IncidentAttachmentData"; -import { IncidentAttachmentLinkAttributes } from "./IncidentAttachmentLinkAttributes"; -import { IncidentAttachmentLinkAttributesAttachmentObject } from "./IncidentAttachmentLinkAttributesAttachmentObject"; -import { IncidentAttachmentPostmortemAttributes } from "./IncidentAttachmentPostmortemAttributes"; -import { IncidentAttachmentRelationships } from "./IncidentAttachmentRelationships"; -import { IncidentAttachmentUpdateData } from "./IncidentAttachmentUpdateData"; -import { IncidentAttachmentUpdateRequest } from "./IncidentAttachmentUpdateRequest"; -import { IncidentAttachmentUpdateResponse } from "./IncidentAttachmentUpdateResponse"; -import { IncidentAttachmentsPostmortemAttributesAttachmentObject } from "./IncidentAttachmentsPostmortemAttributesAttachmentObject"; -import { IncidentAttachmentsResponse } from "./IncidentAttachmentsResponse"; import { IncidentCreateAttributes } from "./IncidentCreateAttributes"; import { IncidentCreateData } from "./IncidentCreateData"; import { IncidentCreateRelationships } from "./IncidentCreateRelationships"; @@ -1849,6 +1851,10 @@ import { PartialAPIKeyAttributes } from "./PartialAPIKeyAttributes"; import { PartialApplicationKey } from "./PartialApplicationKey"; import { PartialApplicationKeyAttributes } from "./PartialApplicationKeyAttributes"; import { PartialApplicationKeyResponse } from "./PartialApplicationKeyResponse"; +import { PatchAttachmentRequest } from "./PatchAttachmentRequest"; +import { PatchAttachmentRequestData } from "./PatchAttachmentRequestData"; +import { PatchAttachmentRequestDataAttributes } from "./PatchAttachmentRequestDataAttributes"; +import { PatchAttachmentRequestDataAttributesAttachment } from "./PatchAttachmentRequestDataAttributesAttachment"; import { PatchIncidentNotificationTemplateRequest } from "./PatchIncidentNotificationTemplateRequest"; import { PatchNotificationRuleParameters } from "./PatchNotificationRuleParameters"; import { PatchNotificationRuleParametersData } from "./PatchNotificationRuleParametersData"; @@ -2685,6 +2691,7 @@ import { UsageLambdaTracedInvocationsResponse } from "./UsageLambdaTracedInvocat import { UsageObservabilityPipelinesResponse } from "./UsageObservabilityPipelinesResponse"; import { UsageTimeSeriesObject } from "./UsageTimeSeriesObject"; import { User } from "./User"; +import { User140420082644000 } from "./User140420082644000"; import { UserAttributes } from "./UserAttributes"; import { UserCreateAttributes } from "./UserCreateAttributes"; import { UserCreateData } from "./UserCreateData"; @@ -2930,6 +2937,7 @@ const enumsMap: { [key: string]: any[] } = { AsanaIntegrationType: ["Asana"], AssetEntityType: ["assets"], AssetType: ["Repository", "Service", "Host", "HostImage", "Image"], + AttachmentDataAttributesAttachmentType: ["postmortem", "link"], AuditLogsEventType: ["audit"], AuditLogsResponseStatus: ["done", "timeout"], AuditLogsSort: ["timestamp", "-timestamp"], @@ -3352,10 +3360,6 @@ const enumsMap: { [key: string]: any[] } = { ], IPAllowlistEntryType: ["ip_allowlist_entry"], IPAllowlistType: ["ip_allowlist"], - IncidentAttachmentAttachmentType: ["link", "postmortem"], - IncidentAttachmentLinkAttachmentType: ["link"], - IncidentAttachmentPostmortemAttachmentType: ["postmortem"], - IncidentAttachmentRelatedObject: ["users"], IncidentAttachmentType: ["incident_attachments"], IncidentFieldAttributesSingleValueType: ["dropdown", "textbox"], IncidentFieldAttributesValueType: [ @@ -4328,6 +4332,7 @@ const enumsMap: { [key: string]: any[] } = { UserTeamTeamType: ["team"], UserTeamType: ["team_memberships"], UserTeamUserType: ["users"], + UserType: ["users"], UsersType: ["users"], VersionHistoryUpdateType: ["create", "update", "delete"], VirusTotalAPIKeyType: ["VirusTotalAPIKey"], @@ -4678,6 +4683,16 @@ const typeMap: { [index: string]: any } = { AttachJiraIssueRequestDataAttributes: AttachJiraIssueRequestDataAttributes, AttachJiraIssueRequestDataRelationships: AttachJiraIssueRequestDataRelationships, + Attachment: Attachment, + AttachmentArray: AttachmentArray, + AttachmentData: AttachmentData, + AttachmentDataAttributes: AttachmentDataAttributes, + AttachmentDataAttributesAttachment: AttachmentDataAttributesAttachment, + AttachmentDataRelationships: AttachmentDataRelationships, + AttachmentDataRelationshipsLastModifiedByUser: + AttachmentDataRelationshipsLastModifiedByUser, + AttachmentDataRelationshipsLastModifiedByUserData: + AttachmentDataRelationshipsLastModifiedByUserData, AuditLogsEvent: AuditLogsEvent, AuditLogsEventAttributes: AuditLogsEventAttributes, AuditLogsEventsResponse: AuditLogsEventsResponse, @@ -5086,6 +5101,11 @@ const typeMap: { [index: string]: any } = { CreateAppsDatastoreRequestDataAttributes, CreateAppsDatastoreResponse: CreateAppsDatastoreResponse, CreateAppsDatastoreResponseData: CreateAppsDatastoreResponseData, + CreateAttachmentRequest: CreateAttachmentRequest, + CreateAttachmentRequestData: CreateAttachmentRequestData, + CreateAttachmentRequestDataAttributes: CreateAttachmentRequestDataAttributes, + CreateAttachmentRequestDataAttributesAttachment: + CreateAttachmentRequestDataAttributesAttachment, CreateCaseRequestArray: CreateCaseRequestArray, CreateCaseRequestData: CreateCaseRequestData, CreateCaseRequestDataAttributes: CreateCaseRequestDataAttributes, @@ -5830,19 +5850,6 @@ const typeMap: { [index: string]: any } = { IPAllowlistEntryData: IPAllowlistEntryData, IPAllowlistResponse: IPAllowlistResponse, IPAllowlistUpdateRequest: IPAllowlistUpdateRequest, - IncidentAttachmentData: IncidentAttachmentData, - IncidentAttachmentLinkAttributes: IncidentAttachmentLinkAttributes, - IncidentAttachmentLinkAttributesAttachmentObject: - IncidentAttachmentLinkAttributesAttachmentObject, - IncidentAttachmentPostmortemAttributes: - IncidentAttachmentPostmortemAttributes, - IncidentAttachmentRelationships: IncidentAttachmentRelationships, - IncidentAttachmentUpdateData: IncidentAttachmentUpdateData, - IncidentAttachmentUpdateRequest: IncidentAttachmentUpdateRequest, - IncidentAttachmentUpdateResponse: IncidentAttachmentUpdateResponse, - IncidentAttachmentsPostmortemAttributesAttachmentObject: - IncidentAttachmentsPostmortemAttributesAttachmentObject, - IncidentAttachmentsResponse: IncidentAttachmentsResponse, IncidentCreateAttributes: IncidentCreateAttributes, IncidentCreateData: IncidentCreateData, IncidentCreateRelationships: IncidentCreateRelationships, @@ -6643,6 +6650,11 @@ const typeMap: { [index: string]: any } = { PartialApplicationKey: PartialApplicationKey, PartialApplicationKeyAttributes: PartialApplicationKeyAttributes, PartialApplicationKeyResponse: PartialApplicationKeyResponse, + PatchAttachmentRequest: PatchAttachmentRequest, + PatchAttachmentRequestData: PatchAttachmentRequestData, + PatchAttachmentRequestDataAttributes: PatchAttachmentRequestDataAttributes, + PatchAttachmentRequestDataAttributesAttachment: + PatchAttachmentRequestDataAttributesAttachment, PatchIncidentNotificationTemplateRequest: PatchIncidentNotificationTemplateRequest, PatchNotificationRuleParameters: PatchNotificationRuleParameters, @@ -7627,6 +7639,7 @@ const typeMap: { [index: string]: any } = { UsageObservabilityPipelinesResponse: UsageObservabilityPipelinesResponse, UsageTimeSeriesObject: UsageTimeSeriesObject, User: User, + User140420082644000: User140420082644000, UserAttributes: UserAttributes, UserCreateAttributes: UserCreateAttributes, UserCreateData: UserCreateData, @@ -7784,6 +7797,7 @@ const oneOfMap: { [index: string]: string[] } = { ApplicationKeyResponseIncludedItem: ["User", "Role", "LeakedKey"], AsanaCredentials: ["AsanaAccessToken"], AsanaCredentialsUpdate: ["AsanaAccessTokenUpdate"], + AttachmentIncluded: ["User140420082644000"], AuthNMappingCreateRelationships: [ "AuthNMappingRelationshipToRole", "AuthNMappingRelationshipToTeam", @@ -7931,15 +7945,6 @@ const oneOfMap: { [index: string]: string[] } = { GreyNoiseCredentialsUpdate: ["GreyNoiseAPIKeyUpdate"], HTTPCredentials: ["HTTPTokenAuth"], HTTPCredentialsUpdate: ["HTTPTokenAuthUpdate"], - IncidentAttachmentAttributes: [ - "IncidentAttachmentPostmortemAttributes", - "IncidentAttachmentLinkAttributes", - ], - IncidentAttachmentUpdateAttributes: [ - "IncidentAttachmentPostmortemAttributes", - "IncidentAttachmentLinkAttributes", - ], - IncidentAttachmentsResponseIncludedItem: ["User"], IncidentFieldAttributes: [ "IncidentFieldAttributesSingleValue", "IncidentFieldAttributesMultipleValue", @@ -7956,7 +7961,7 @@ const oneOfMap: { [index: string]: string[] } = { "IncidentNotificationTemplateObject", ], IncidentNotificationTemplateIncludedItems: ["User", "IncidentTypeObject"], - IncidentResponseIncludedItem: ["IncidentUserData", "IncidentAttachmentData"], + IncidentResponseIncludedItem: ["IncidentUserData", "AttachmentData"], IncidentServiceIncludedItems: ["User"], IncidentTeamIncludedItems: ["User"], IncidentTimelineCellCreateAttributes: [ diff --git a/packages/datadog-api-client-v2/models/PatchAttachmentRequest.ts b/packages/datadog-api-client-v2/models/PatchAttachmentRequest.ts new file mode 100644 index 000000000000..1f69c9eeac7e --- /dev/null +++ b/packages/datadog-api-client-v2/models/PatchAttachmentRequest.ts @@ -0,0 +1,47 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { PatchAttachmentRequestData } from "./PatchAttachmentRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class PatchAttachmentRequest { + "data"?: PatchAttachmentRequestData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "PatchAttachmentRequestData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return PatchAttachmentRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/PatchAttachmentRequestData.ts b/packages/datadog-api-client-v2/models/PatchAttachmentRequestData.ts new file mode 100644 index 000000000000..e7204d222ea8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/PatchAttachmentRequestData.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { IncidentAttachmentType } from "./IncidentAttachmentType"; +import { PatchAttachmentRequestDataAttributes } from "./PatchAttachmentRequestDataAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class PatchAttachmentRequestData { + "attributes"?: PatchAttachmentRequestDataAttributes; + "id"?: string; + /** + * The incident attachment resource type. + */ + "type": IncidentAttachmentType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "PatchAttachmentRequestDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "IncidentAttachmentType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return PatchAttachmentRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/PatchAttachmentRequestDataAttributes.ts b/packages/datadog-api-client-v2/models/PatchAttachmentRequestDataAttributes.ts new file mode 100644 index 000000000000..e0b6a9fbfc83 --- /dev/null +++ b/packages/datadog-api-client-v2/models/PatchAttachmentRequestDataAttributes.ts @@ -0,0 +1,47 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { PatchAttachmentRequestDataAttributesAttachment } from "./PatchAttachmentRequestDataAttributesAttachment"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class PatchAttachmentRequestDataAttributes { + "attachment"?: PatchAttachmentRequestDataAttributesAttachment; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attachment: { + baseName: "attachment", + type: "PatchAttachmentRequestDataAttributesAttachment", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return PatchAttachmentRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/PatchAttachmentRequestDataAttributesAttachment.ts b/packages/datadog-api-client-v2/models/PatchAttachmentRequestDataAttributesAttachment.ts new file mode 100644 index 000000000000..e82ac3516859 --- /dev/null +++ b/packages/datadog-api-client-v2/models/PatchAttachmentRequestDataAttributesAttachment.ts @@ -0,0 +1,51 @@ +/** + * 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 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class PatchAttachmentRequestDataAttributesAttachment { + "documentUrl"?: string; + "title"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + documentUrl: { + baseName: "documentUrl", + type: "string", + }, + title: { + baseName: "title", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return PatchAttachmentRequestDataAttributesAttachment.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/User140420082644000.ts b/packages/datadog-api-client-v2/models/User140420082644000.ts new file mode 100644 index 000000000000..cbac5b4e88bc --- /dev/null +++ b/packages/datadog-api-client-v2/models/User140420082644000.ts @@ -0,0 +1,65 @@ +/** + * 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 2020-Present Datadog, Inc. + */ +import { UserAttributes } from "./UserAttributes"; +import { UserType } from "./UserType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class User140420082644000 { + /** + * Attributes of user object returned by the API. + */ + "attributes"?: UserAttributes; + "id"?: string; + /** + * Users resource type. + */ + "type": UserType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "UserAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "UserType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return User140420082644000.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentRelatedObject.ts b/packages/datadog-api-client-v2/models/UserType.ts similarity index 73% rename from packages/datadog-api-client-v2/models/IncidentAttachmentRelatedObject.ts rename to packages/datadog-api-client-v2/models/UserType.ts index f2dc786feafa..dd14517ed863 100644 --- a/packages/datadog-api-client-v2/models/IncidentAttachmentRelatedObject.ts +++ b/packages/datadog-api-client-v2/models/UserType.ts @@ -7,8 +7,8 @@ import { UnparsedObject } from "../../datadog-api-client-common/util"; /** - * The object related to an incident attachment. + * Users resource type. */ -export type IncidentAttachmentRelatedObject = typeof USERS | UnparsedObject; +export type UserType = typeof USERS | UnparsedObject; export const USERS = "users";