diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f3ca46bc04..d47fe5b190 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15878,6 +15878,78 @@ components: type: string nullable: true type: array + DORADeploymentFetchResponse: + description: Response for fetching a single deployment event. + properties: + data: + $ref: '#/components/schemas/DORADeploymentObject' + type: object + DORADeploymentObject: + description: A DORA deployment event. + example: + attributes: + custom_tags: + - language:java + - department:engineering + - region:us-east-1 + env: production + finished_at: 1693491984000000000 + git: + commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 + repository_url: https://github.com/organization/example-repository + service: shopist + started_at: 1693491974000000000 + team: backend + version: v1.12.07 + id: 4242fcdd31586083 + type: dora_deployment + properties: + attributes: + $ref: '#/components/schemas/DORADeploymentObjectAttributes' + id: + description: The ID of the deployment event. + type: string + type: + $ref: '#/components/schemas/DORADeploymentType' + type: object + DORADeploymentObjectAttributes: + description: The attributes of the deployment event. + properties: + custom_tags: + $ref: '#/components/schemas/DORACustomTags' + env: + description: Environment name to where the service was deployed. + example: production + type: string + finished_at: + description: Unix timestamp when the deployment finished. + example: 1693491984000000000 + format: int64 + type: integer + git: + $ref: '#/components/schemas/DORAGitInfo' + service: + description: Service name. + example: shopist + type: string + started_at: + description: Unix timestamp when the deployment started. + example: 1693491974000000000 + format: int64 + type: integer + team: + description: Name of the team owning the deployed service. + example: backend + type: string + version: + description: Version to correlate with APM Deployment Tracking. + example: v1.12.07 + type: string + required: + - service + - started_at + - finished_at + type: object DORADeploymentRequest: description: Request to create a DORA deployment event. properties: @@ -15968,18 +16040,53 @@ components: type: string x-enum-varnames: - DORA_DEPLOYMENT - DORAEvent: - description: A DORA event. + DORADeploymentsListResponse: + description: Response for the list deployments endpoint. + example: + data: + - attributes: + custom_tags: + - language:java + - department:engineering + - region:us-east-1 + env: production + finished_at: 1693491984000000000 + git: + commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 + repository_url: https://github.com/organization/example-repository + service: shopist + started_at: 1693491974000000000 + team: backend + version: v1.12.07 + id: 4242fcdd31586083 + type: dora_deployment + - attributes: + custom_tags: + - language:go + - department:platform + env: production + finished_at: 1693492084000000000 + git: + commit_sha: 77bdc9350f2cc9b250b69abddab733dd55e1a599 + repository_url: https://github.com/organization/api-service + service: api-service + started_at: 1693492074000000000 + team: backend + version: v2.1.0 + id: 4242fcdd31586084 + type: dora_deployment properties: - attributes: - description: The attributes of the event. - type: object - id: - description: The ID of the event. - type: string - type: - description: The type of the event. - type: string + data: + description: The list of DORA deployment events. + items: + $ref: '#/components/schemas/DORADeploymentObject' + type: array + type: object + DORAFailureFetchResponse: + description: Response for fetching a single failure event. + properties: + data: + $ref: '#/components/schemas/DORAIncidentObject' type: object DORAFailureRequest: description: Request to create a DORA failure event. @@ -16083,11 +16190,45 @@ components: type: string x-enum-varnames: - DORA_FAILURE - DORAFetchResponse: - description: Response for the DORA fetch endpoints. + DORAFailuresListResponse: + description: Response for the list failures endpoint. + example: + data: + - attributes: + custom_tags: + - incident_type:database + - department:engineering + env: production + finished_at: 1693492274000000000 + name: Database outage + services: + - shopist + severity: SEV-1 + started_at: 1693492174000000000 + team: backend + id: 4242fcdd31586085 + type: dora_incident + - attributes: + custom_tags: + - incident_type:service_down + - department:platform + env: production + finished_at: 1693492474000000000 + name: API service outage + services: + - api-service + - payment-service + severity: SEV-2 + started_at: 1693492374000000000 + team: backend + id: 4242fcdd31586086 + type: dora_incident properties: data: - $ref: '#/components/schemas/DORAEvent' + description: The list of DORA incident events. + items: + $ref: '#/components/schemas/DORAIncidentObject' + type: array type: object DORAGitInfo: description: Git info for DORA Metrics events. @@ -16100,6 +16241,82 @@ components: - repository_url - commit_sha type: object + DORAIncidentObject: + description: A DORA incident event. + example: + attributes: + custom_tags: + - incident_type:database + - department:engineering + env: production + finished_at: 1693492274000000000 + git: + commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 + repository_url: https://github.com/organization/example-repository + name: Database outage + services: + - shopist + severity: SEV-1 + started_at: 1693492174000000000 + team: backend + id: 4242fcdd31586085 + type: dora_incident + properties: + attributes: + $ref: '#/components/schemas/DORAIncidentObjectAttributes' + id: + description: The ID of the incident event. + type: string + type: + $ref: '#/components/schemas/DORAFailureType' + type: object + DORAIncidentObjectAttributes: + description: The attributes of the incident event. + properties: + custom_tags: + $ref: '#/components/schemas/DORACustomTags' + env: + description: Environment name that was impacted by the incident. + example: production + type: string + finished_at: + description: Unix timestamp when the incident finished. + example: 1693491984000000000 + format: int64 + type: integer + git: + $ref: '#/components/schemas/DORAGitInfo' + name: + description: Incident name. + example: Database outage + type: string + services: + description: Service names impacted by the incident. + example: + - shopist + items: + type: string + type: array + severity: + description: Incident severity. + example: SEV-1 + type: string + started_at: + description: Unix timestamp when the incident started. + example: 1693491974000000000 + format: int64 + type: integer + team: + description: Name of the team owning the services impacted. + example: backend + type: string + version: + description: Version to correlate with APM Deployment Tracking. + example: v1.12.07 + type: string + required: + - started_at + type: object DORAListDeploymentsRequest: description: Request to get a list of deployments. example: @@ -16119,32 +16336,31 @@ components: type: object DORAListDeploymentsRequestAttributes: description: Attributes to get a list of deployments. - example: - from: '2025-01-01T00:00:00Z' - limit: 500 - query: service:(shopist OR api-service OR payment-service) env:(production - OR staging) team:(backend OR platform) - sort: -started_at - to: '2025-01-31T23:59:59Z' properties: from: description: Minimum timestamp for requested events. + example: '2025-01-01T00:00:00Z' format: date-time type: string limit: default: 10 description: Maximum number of events in the response. + example: 500 format: int32 maximum: 1000 type: integer query: description: Search query with event platform syntax. + example: service:(shopist OR api-service OR payment-service) env:(production + OR staging) team:(backend OR platform) type: string sort: description: Sort order (prefixed with `-` for descending). + example: -started_at type: string to: description: Maximum timestamp for requested events. + example: '2025-01-31T23:59:59Z' format: date-time type: string type: object @@ -16167,9 +16383,11 @@ components: - attributes type: object DORAListDeploymentsRequestDataType: + default: dora_deployments_list_request description: The definition of `DORAListDeploymentsRequestDataType` object. enum: - dora_deployments_list_request + example: dora_deployments_list_request type: string x-enum-varnames: - DORA_DEPLOYMENTS_LIST_REQUEST @@ -16192,32 +16410,31 @@ components: type: object DORAListFailuresRequestAttributes: description: Attributes to get a list of failures. - example: - from: '2025-01-01T00:00:00Z' - limit: 500 - query: severity:(SEV-1 OR SEV-2) env:(production OR staging) service:(shopist - OR api-service OR payment-service) team:(backend OR platform OR payments) - sort: -started_at - to: '2025-01-31T23:59:59Z' properties: from: description: Minimum timestamp for requested events. + example: '2025-01-01T00:00:00Z' format: date-time type: string limit: default: 10 description: Maximum number of events in the response. + example: 500 format: int32 maximum: 1000 type: integer query: description: Search query with event platform syntax. + example: severity:(SEV-1 OR SEV-2) env:(production OR staging) service:(shopist + OR api-service OR payment-service) team:(backend OR platform OR payments) type: string sort: description: Sort order (prefixed with `-` for descending). + example: -started_at type: string to: description: Maximum timestamp for requested events. + example: '2025-01-31T23:59:59Z' format: date-time type: string type: object @@ -16240,54 +16457,14 @@ components: - attributes type: object DORAListFailuresRequestDataType: + default: dora_failures_list_request description: The definition of `DORAListFailuresRequestDataType` object. enum: - dora_failures_list_request + example: dora_failures_list_request type: string x-enum-varnames: - DORA_FAILURES_LIST_REQUEST - DORAListResponse: - description: Response for the DORA list endpoints. - example: - data: - - attributes: - custom_tags: - - language:java - - department:engineering - - region:us-east-1 - env: production - finished_at: 1693491984000000000 - git: - commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 - repository_url: https://github.com/organization/example-repository - service: shopist - started_at: 1693491974000000000 - team: backend - version: v1.12.07 - id: 4242fcdd31586083 - type: dora_deployment - - attributes: - custom_tags: - - language:go - - department:platform - env: production - finished_at: 1693492084000000000 - git: - commit_sha: 77bdc9350f2cc9b250b69abddab733dd55e1a599 - repository_url: https://github.com/organization/api-service - service: api-service - started_at: 1693492074000000000 - team: backend - version: v2.1.0 - id: 4242fcdd31586084 - type: dora_deployment - properties: - data: - description: The list of DORA events. - items: - $ref: '#/components/schemas/DORAEvent' - type: array - type: object DashboardListAddItemsRequest: description: Request containing a list of dashboards to add. properties: @@ -67683,7 +67860,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DORAListResponse' + $ref: '#/components/schemas/DORADeploymentsListResponse' description: OK '400': content: @@ -67721,26 +67898,8 @@ paths: '200': content: application/json: - example: - data: - attributes: - custom_tags: - - language:java - - department:engineering - - region:us-east-1 - env: staging - finished_at: 1693491984000000000 - git: - commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 - repository_url: https://github.com/organization/example-repository - service: shopist - started_at: 1693491974000000000 - team: backend - version: v1.12.07 - id: 4242fcdd31586083 - type: dora_deployment - schema: - $ref: '#/components/schemas/DORAFetchResponse' + schema: + $ref: '#/components/schemas/DORADeploymentFetchResponse' description: OK '400': content: @@ -67857,66 +68016,8 @@ paths: '200': content: application/json: - example: - data: - - attributes: - custom_tags: - - language:java - - department:engineering - - region:us-east-1 - env: production - finished_at: 1693491984000000000 - git: - commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 - repository_url: https://github.com/organization/example-repository - name: Web server is down; all requests are failing. - services: - - shopist - severity: SEV-1 - started_at: 1693491974000000000 - team: backend - id: 4242fcdd31586085 - type: dora_failure - - attributes: - custom_tags: - - language:go - - department:platform - env: production - finished_at: 1693492084000000000 - git: - commit_sha: 77bdc9350f2cc9b250b69abddab733dd55e1a599 - repository_url: https://github.com/organization/api-service - name: Database connection timeout - services: - - api-service - - payment-service - severity: SEV-1 - started_at: 1693492074000000000 - team: platform - version: v2.1.0 - id: 4242fcdd31586086 - type: dora_failure - - attributes: - custom_tags: - - language:python - - department:payments - - region:eu-west-1 - env: staging - finished_at: 1693492204000000000 - git: - commit_sha: 99edc9350f2cc9b250b69abddab733dd55e1a601 - repository_url: https://github.com/organization/payment-service - name: Payment gateway API rate limit exceeded - services: - - payment-service - severity: SEV-2 - started_at: 1693492174000000000 - team: payments - version: v1.8.3 - id: 4242fcdd31586087 - type: dora_failure - schema: - $ref: '#/components/schemas/DORAListResponse' + schema: + $ref: '#/components/schemas/DORAFailuresListResponse' description: OK '400': content: @@ -67954,28 +68055,8 @@ paths: '200': content: application/json: - example: - data: - attributes: - custom_tags: - - language:java - - department:engineering - - region:us-east-1 - env: staging - finished_at: 1693491984000000000 - git: - commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 - repository_url: https://github.com/organization/example-repository - name: Web server is down; all requests are failing. - services: - - shopist - severity: High - started_at: 1693491974000000000 - team: backend - id: 4242fcdd31586085 - type: dora_failure - schema: - $ref: '#/components/schemas/DORAFetchResponse' + schema: + $ref: '#/components/schemas/DORAFailureFetchResponse' description: OK '400': content: diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 84078e9c26..ad646c96a7 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -7214,6 +7214,27 @@ datadog\_api\_client.v2.model.domain\_allowlist\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.dora\_deployment\_fetch\_response module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.dora_deployment_fetch_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.dora\_deployment\_object module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.dora_deployment_object + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.dora\_deployment\_object\_attributes module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.dora_deployment_object_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.dora\_deployment\_request module -------------------------------------------------------------- @@ -7256,10 +7277,17 @@ datadog\_api\_client.v2.model.dora\_deployment\_type module :members: :show-inheritance: -datadog\_api\_client.v2.model.dora\_event module ------------------------------------------------- +datadog\_api\_client.v2.model.dora\_deployments\_list\_response module +---------------------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.dora_event +.. automodule:: datadog_api_client.v2.model.dora_deployments_list_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.dora\_failure\_fetch\_response module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.dora_failure_fetch_response :members: :show-inheritance: @@ -7305,10 +7333,10 @@ datadog\_api\_client.v2.model.dora\_failure\_type module :members: :show-inheritance: -datadog\_api\_client.v2.model.dora\_fetch\_response module ----------------------------------------------------------- +datadog\_api\_client.v2.model.dora\_failures\_list\_response module +------------------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.dora_fetch_response +.. automodule:: datadog_api_client.v2.model.dora_failures_list_response :members: :show-inheritance: @@ -7319,6 +7347,20 @@ datadog\_api\_client.v2.model.dora\_git\_info module :members: :show-inheritance: +datadog\_api\_client.v2.model.dora\_incident\_object module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.dora_incident_object + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.dora\_incident\_object\_attributes module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.dora_incident_object_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.dora\_list\_deployments\_request module --------------------------------------------------------------------- @@ -7375,13 +7417,6 @@ datadog\_api\_client.v2.model.dora\_list\_failures\_request\_data\_type module :members: :show-inheritance: -datadog\_api\_client.v2.model.dora\_list\_response module ---------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.dora_list_response - :members: - :show-inheritance: - datadog\_api\_client.v2.model.downtime\_create\_request module -------------------------------------------------------------- diff --git a/src/datadog_api_client/v2/api/dora_metrics_api.py b/src/datadog_api_client/v2/api/dora_metrics_api.py index 6a9b219cc8..31f81aa5b4 100644 --- a/src/datadog_api_client/v2/api/dora_metrics_api.py +++ b/src/datadog_api_client/v2/api/dora_metrics_api.py @@ -10,12 +10,14 @@ from datadog_api_client.configuration import Configuration from datadog_api_client.v2.model.dora_deployment_response import DORADeploymentResponse from datadog_api_client.v2.model.dora_deployment_request import DORADeploymentRequest -from datadog_api_client.v2.model.dora_list_response import DORAListResponse +from datadog_api_client.v2.model.dora_deployments_list_response import DORADeploymentsListResponse from datadog_api_client.v2.model.dora_list_deployments_request import DORAListDeploymentsRequest -from datadog_api_client.v2.model.dora_fetch_response import DORAFetchResponse +from datadog_api_client.v2.model.dora_deployment_fetch_response import DORADeploymentFetchResponse from datadog_api_client.v2.model.dora_failure_response import DORAFailureResponse from datadog_api_client.v2.model.dora_failure_request import DORAFailureRequest +from datadog_api_client.v2.model.dora_failures_list_response import DORAFailuresListResponse from datadog_api_client.v2.model.dora_list_failures_request import DORAListFailuresRequest +from datadog_api_client.v2.model.dora_failure_fetch_response import DORAFailureFetchResponse class DORAMetricsApi: @@ -138,7 +140,7 @@ def __init__(self, api_client=None): self._get_dora_deployment_endpoint = _Endpoint( settings={ - "response_type": (DORAFetchResponse,), + "response_type": (DORADeploymentFetchResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], "endpoint_path": "/api/v2/dora/deployments/{deployment_id}", "operation_id": "get_dora_deployment", @@ -161,7 +163,7 @@ def __init__(self, api_client=None): self._get_dora_failure_endpoint = _Endpoint( settings={ - "response_type": (DORAFetchResponse,), + "response_type": (DORAFailureFetchResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], "endpoint_path": "/api/v2/dora/failures/{failure_id}", "operation_id": "get_dora_failure", @@ -184,7 +186,7 @@ def __init__(self, api_client=None): self._list_dora_deployments_endpoint = _Endpoint( settings={ - "response_type": (DORAListResponse,), + "response_type": (DORADeploymentsListResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], "endpoint_path": "/api/v2/dora/deployments", "operation_id": "list_dora_deployments", @@ -204,7 +206,7 @@ def __init__(self, api_client=None): self._list_dora_failures_endpoint = _Endpoint( settings={ - "response_type": (DORAListResponse,), + "response_type": (DORAFailuresListResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], "endpoint_path": "/api/v2/dora/failures", "operation_id": "list_dora_failures", @@ -326,14 +328,14 @@ def delete_dora_failure( def get_dora_deployment( self, deployment_id: str, - ) -> DORAFetchResponse: + ) -> DORADeploymentFetchResponse: """Get a deployment event. Use this API endpoint to get a deployment event. :param deployment_id: The ID of the deployment event. :type deployment_id: str - :rtype: DORAFetchResponse + :rtype: DORADeploymentFetchResponse """ kwargs: Dict[str, Any] = {} kwargs["deployment_id"] = deployment_id @@ -343,14 +345,14 @@ def get_dora_deployment( def get_dora_failure( self, failure_id: str, - ) -> DORAFetchResponse: + ) -> DORAFailureFetchResponse: """Get a failure event. Use this API endpoint to get a failure event. :param failure_id: The ID of the failure event. :type failure_id: str - :rtype: DORAFetchResponse + :rtype: DORAFailureFetchResponse """ kwargs: Dict[str, Any] = {} kwargs["failure_id"] = failure_id @@ -360,13 +362,13 @@ def get_dora_failure( def list_dora_deployments( self, body: DORAListDeploymentsRequest, - ) -> DORAListResponse: + ) -> DORADeploymentsListResponse: """Get a list of deployment events. Use this API endpoint to get a list of deployment events. :type body: DORAListDeploymentsRequest - :rtype: DORAListResponse + :rtype: DORADeploymentsListResponse """ kwargs: Dict[str, Any] = {} kwargs["body"] = body @@ -376,13 +378,13 @@ def list_dora_deployments( def list_dora_failures( self, body: DORAListFailuresRequest, - ) -> DORAListResponse: + ) -> DORAFailuresListResponse: """Get a list of failure events. Use this API endpoint to get a list of failure events. :type body: DORAListFailuresRequest - :rtype: DORAListResponse + :rtype: DORAFailuresListResponse """ kwargs: Dict[str, Any] = {} kwargs["body"] = body diff --git a/src/datadog_api_client/v2/model/dora_deployment_fetch_response.py b/src/datadog_api_client/v2/model/dora_deployment_fetch_response.py new file mode 100644 index 0000000000..4ebb411025 --- /dev/null +++ b/src/datadog_api_client/v2/model/dora_deployment_fetch_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.dora_deployment_object import DORADeploymentObject + + +class DORADeploymentFetchResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.dora_deployment_object import DORADeploymentObject + + return { + "data": (DORADeploymentObject,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[DORADeploymentObject, UnsetType] = unset, **kwargs): + """ + Response for fetching a single deployment event. + + :param data: A DORA deployment event. + :type data: DORADeploymentObject, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/dora_deployment_object.py b/src/datadog_api_client/v2/model/dora_deployment_object.py new file mode 100644 index 0000000000..ba8734cf96 --- /dev/null +++ b/src/datadog_api_client/v2/model/dora_deployment_object.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.dora_deployment_object_attributes import DORADeploymentObjectAttributes + from datadog_api_client.v2.model.dora_deployment_type import DORADeploymentType + + +class DORADeploymentObject(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.dora_deployment_object_attributes import DORADeploymentObjectAttributes + from datadog_api_client.v2.model.dora_deployment_type import DORADeploymentType + + return { + "attributes": (DORADeploymentObjectAttributes,), + "id": (str,), + "type": (DORADeploymentType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: Union[DORADeploymentObjectAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + type: Union[DORADeploymentType, UnsetType] = unset, + **kwargs, + ): + """ + A DORA deployment event. + + :param attributes: The attributes of the deployment event. + :type attributes: DORADeploymentObjectAttributes, optional + + :param id: The ID of the deployment event. + :type id: str, optional + + :param type: JSON:API type for DORA deployment events. + :type type: DORADeploymentType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/dora_deployment_object_attributes.py b/src/datadog_api_client/v2/model/dora_deployment_object_attributes.py new file mode 100644 index 0000000000..3fa4b7eb07 --- /dev/null +++ b/src/datadog_api_client/v2/model/dora_deployment_object_attributes.py @@ -0,0 +1,101 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.dora_git_info import DORAGitInfo + + +class DORADeploymentObjectAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.dora_git_info import DORAGitInfo + + return { + "custom_tags": ([str],), + "env": (str,), + "finished_at": (int,), + "git": (DORAGitInfo,), + "service": (str,), + "started_at": (int,), + "team": (str,), + "version": (str,), + } + + attribute_map = { + "custom_tags": "custom_tags", + "env": "env", + "finished_at": "finished_at", + "git": "git", + "service": "service", + "started_at": "started_at", + "team": "team", + "version": "version", + } + + def __init__( + self_, + finished_at: int, + service: str, + started_at: int, + custom_tags: Union[List[str], none_type, UnsetType] = unset, + env: Union[str, UnsetType] = unset, + git: Union[DORAGitInfo, UnsetType] = unset, + team: Union[str, UnsetType] = unset, + version: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The attributes of the deployment event. + + :param custom_tags: A list of user-defined tags. The tags must follow the ``key:value`` pattern. Up to 100 may be added per event. + :type custom_tags: [str], none_type, optional + + :param env: Environment name to where the service was deployed. + :type env: str, optional + + :param finished_at: Unix timestamp when the deployment finished. + :type finished_at: int + + :param git: Git info for DORA Metrics events. + :type git: DORAGitInfo, optional + + :param service: Service name. + :type service: str + + :param started_at: Unix timestamp when the deployment started. + :type started_at: int + + :param team: Name of the team owning the deployed service. + :type team: str, optional + + :param version: Version to correlate with APM Deployment Tracking. + :type version: str, optional + """ + if custom_tags is not unset: + kwargs["custom_tags"] = custom_tags + if env is not unset: + kwargs["env"] = env + if git is not unset: + kwargs["git"] = git + if team is not unset: + kwargs["team"] = team + if version is not unset: + kwargs["version"] = version + super().__init__(kwargs) + + self_.finished_at = finished_at + self_.service = service + self_.started_at = started_at diff --git a/src/datadog_api_client/v2/model/dora_deployments_list_response.py b/src/datadog_api_client/v2/model/dora_deployments_list_response.py new file mode 100644 index 0000000000..d454fdecd0 --- /dev/null +++ b/src/datadog_api_client/v2/model/dora_deployments_list_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.dora_deployment_object import DORADeploymentObject + + +class DORADeploymentsListResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.dora_deployment_object import DORADeploymentObject + + return { + "data": ([DORADeploymentObject],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[DORADeploymentObject], UnsetType] = unset, **kwargs): + """ + Response for the list deployments endpoint. + + :param data: The list of DORA deployment events. + :type data: [DORADeploymentObject], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/dora_event.py b/src/datadog_api_client/v2/model/dora_event.py deleted file mode 100644 index 9f00b76800..0000000000 --- a/src/datadog_api_client/v2/model/dora_event.py +++ /dev/null @@ -1,56 +0,0 @@ -# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -# This product includes software developed at Datadog (https://www.datadoghq.com/). -# Copyright 2019-Present Datadog, Inc. -from __future__ import annotations - -from typing import Union - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - unset, - UnsetType, -) - - -class DORAEvent(ModelNormal): - @cached_property - def openapi_types(_): - return { - "attributes": (dict,), - "id": (str,), - "type": (str,), - } - - attribute_map = { - "attributes": "attributes", - "id": "id", - "type": "type", - } - - def __init__( - self_, - attributes: Union[dict, UnsetType] = unset, - id: Union[str, UnsetType] = unset, - type: Union[str, UnsetType] = unset, - **kwargs, - ): - """ - A DORA event. - - :param attributes: The attributes of the event. - :type attributes: dict, optional - - :param id: The ID of the event. - :type id: str, optional - - :param type: The type of the event. - :type type: str, optional - """ - if attributes is not unset: - kwargs["attributes"] = attributes - if id is not unset: - kwargs["id"] = id - if type is not unset: - kwargs["type"] = type - super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/dora_fetch_response.py b/src/datadog_api_client/v2/model/dora_failure_fetch_response.py similarity index 58% rename from src/datadog_api_client/v2/model/dora_fetch_response.py rename to src/datadog_api_client/v2/model/dora_failure_fetch_response.py index a0f42842d7..3d1e5369cd 100644 --- a/src/datadog_api_client/v2/model/dora_fetch_response.py +++ b/src/datadog_api_client/v2/model/dora_failure_fetch_response.py @@ -14,28 +14,28 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.dora_event import DORAEvent + from datadog_api_client.v2.model.dora_incident_object import DORAIncidentObject -class DORAFetchResponse(ModelNormal): +class DORAFailureFetchResponse(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.dora_event import DORAEvent + from datadog_api_client.v2.model.dora_incident_object import DORAIncidentObject return { - "data": (DORAEvent,), + "data": (DORAIncidentObject,), } attribute_map = { "data": "data", } - def __init__(self_, data: Union[DORAEvent, UnsetType] = unset, **kwargs): + def __init__(self_, data: Union[DORAIncidentObject, UnsetType] = unset, **kwargs): """ - Response for the DORA fetch endpoints. + Response for fetching a single failure event. - :param data: A DORA event. - :type data: DORAEvent, optional + :param data: A DORA incident event. + :type data: DORAIncidentObject, optional """ if data is not unset: kwargs["data"] = data diff --git a/src/datadog_api_client/v2/model/dora_list_response.py b/src/datadog_api_client/v2/model/dora_failures_list_response.py similarity index 57% rename from src/datadog_api_client/v2/model/dora_list_response.py rename to src/datadog_api_client/v2/model/dora_failures_list_response.py index d98199af21..2290435b71 100644 --- a/src/datadog_api_client/v2/model/dora_list_response.py +++ b/src/datadog_api_client/v2/model/dora_failures_list_response.py @@ -14,28 +14,28 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.dora_event import DORAEvent + from datadog_api_client.v2.model.dora_incident_object import DORAIncidentObject -class DORAListResponse(ModelNormal): +class DORAFailuresListResponse(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.dora_event import DORAEvent + from datadog_api_client.v2.model.dora_incident_object import DORAIncidentObject return { - "data": ([DORAEvent],), + "data": ([DORAIncidentObject],), } attribute_map = { "data": "data", } - def __init__(self_, data: Union[List[DORAEvent], UnsetType] = unset, **kwargs): + def __init__(self_, data: Union[List[DORAIncidentObject], UnsetType] = unset, **kwargs): """ - Response for the DORA list endpoints. + Response for the list failures endpoint. - :param data: The list of DORA events. - :type data: [DORAEvent], optional + :param data: The list of DORA incident events. + :type data: [DORAIncidentObject], optional """ if data is not unset: kwargs["data"] = data diff --git a/src/datadog_api_client/v2/model/dora_incident_object.py b/src/datadog_api_client/v2/model/dora_incident_object.py new file mode 100644 index 0000000000..db99b44d0e --- /dev/null +++ b/src/datadog_api_client/v2/model/dora_incident_object.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.dora_incident_object_attributes import DORAIncidentObjectAttributes + from datadog_api_client.v2.model.dora_failure_type import DORAFailureType + + +class DORAIncidentObject(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.dora_incident_object_attributes import DORAIncidentObjectAttributes + from datadog_api_client.v2.model.dora_failure_type import DORAFailureType + + return { + "attributes": (DORAIncidentObjectAttributes,), + "id": (str,), + "type": (DORAFailureType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + attributes: Union[DORAIncidentObjectAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + type: Union[DORAFailureType, UnsetType] = unset, + **kwargs, + ): + """ + A DORA incident event. + + :param attributes: The attributes of the incident event. + :type attributes: DORAIncidentObjectAttributes, optional + + :param id: The ID of the incident event. + :type id: str, optional + + :param type: JSON:API type for DORA failure events. + :type type: DORAFailureType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/dora_incident_object_attributes.py b/src/datadog_api_client/v2/model/dora_incident_object_attributes.py new file mode 100644 index 0000000000..1e302f6f5e --- /dev/null +++ b/src/datadog_api_client/v2/model/dora_incident_object_attributes.py @@ -0,0 +1,119 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.dora_git_info import DORAGitInfo + + +class DORAIncidentObjectAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.dora_git_info import DORAGitInfo + + return { + "custom_tags": ([str],), + "env": (str,), + "finished_at": (int,), + "git": (DORAGitInfo,), + "name": (str,), + "services": ([str],), + "severity": (str,), + "started_at": (int,), + "team": (str,), + "version": (str,), + } + + attribute_map = { + "custom_tags": "custom_tags", + "env": "env", + "finished_at": "finished_at", + "git": "git", + "name": "name", + "services": "services", + "severity": "severity", + "started_at": "started_at", + "team": "team", + "version": "version", + } + + def __init__( + self_, + started_at: int, + custom_tags: Union[List[str], none_type, UnsetType] = unset, + env: Union[str, UnsetType] = unset, + finished_at: Union[int, UnsetType] = unset, + git: Union[DORAGitInfo, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + services: Union[List[str], UnsetType] = unset, + severity: Union[str, UnsetType] = unset, + team: Union[str, UnsetType] = unset, + version: Union[str, UnsetType] = unset, + **kwargs, + ): + """ + The attributes of the incident event. + + :param custom_tags: A list of user-defined tags. The tags must follow the ``key:value`` pattern. Up to 100 may be added per event. + :type custom_tags: [str], none_type, optional + + :param env: Environment name that was impacted by the incident. + :type env: str, optional + + :param finished_at: Unix timestamp when the incident finished. + :type finished_at: int, optional + + :param git: Git info for DORA Metrics events. + :type git: DORAGitInfo, optional + + :param name: Incident name. + :type name: str, optional + + :param services: Service names impacted by the incident. + :type services: [str], optional + + :param severity: Incident severity. + :type severity: str, optional + + :param started_at: Unix timestamp when the incident started. + :type started_at: int + + :param team: Name of the team owning the services impacted. + :type team: str, optional + + :param version: Version to correlate with APM Deployment Tracking. + :type version: str, optional + """ + if custom_tags is not unset: + kwargs["custom_tags"] = custom_tags + if env is not unset: + kwargs["env"] = env + if finished_at is not unset: + kwargs["finished_at"] = finished_at + if git is not unset: + kwargs["git"] = git + if name is not unset: + kwargs["name"] = name + if services is not unset: + kwargs["services"] = services + if severity is not unset: + kwargs["severity"] = severity + if team is not unset: + kwargs["team"] = team + if version is not unset: + kwargs["version"] = version + super().__init__(kwargs) + + self_.started_at = started_at diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 91f6658a33..adcfa26e79 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1305,21 +1305,27 @@ from datadog_api_client.v2.model.custom_framework_requirement import CustomFrameworkRequirement from datadog_api_client.v2.model.custom_framework_type import CustomFrameworkType from datadog_api_client.v2.model.custom_framework_without_requirements import CustomFrameworkWithoutRequirements +from datadog_api_client.v2.model.dora_deployment_fetch_response import DORADeploymentFetchResponse +from datadog_api_client.v2.model.dora_deployment_object import DORADeploymentObject +from datadog_api_client.v2.model.dora_deployment_object_attributes import DORADeploymentObjectAttributes from datadog_api_client.v2.model.dora_deployment_request import DORADeploymentRequest from datadog_api_client.v2.model.dora_deployment_request_attributes import DORADeploymentRequestAttributes from datadog_api_client.v2.model.dora_deployment_request_data import DORADeploymentRequestData from datadog_api_client.v2.model.dora_deployment_response import DORADeploymentResponse from datadog_api_client.v2.model.dora_deployment_response_data import DORADeploymentResponseData from datadog_api_client.v2.model.dora_deployment_type import DORADeploymentType -from datadog_api_client.v2.model.dora_event import DORAEvent +from datadog_api_client.v2.model.dora_deployments_list_response import DORADeploymentsListResponse +from datadog_api_client.v2.model.dora_failure_fetch_response import DORAFailureFetchResponse from datadog_api_client.v2.model.dora_failure_request import DORAFailureRequest from datadog_api_client.v2.model.dora_failure_request_attributes import DORAFailureRequestAttributes from datadog_api_client.v2.model.dora_failure_request_data import DORAFailureRequestData from datadog_api_client.v2.model.dora_failure_response import DORAFailureResponse from datadog_api_client.v2.model.dora_failure_response_data import DORAFailureResponseData from datadog_api_client.v2.model.dora_failure_type import DORAFailureType -from datadog_api_client.v2.model.dora_fetch_response import DORAFetchResponse +from datadog_api_client.v2.model.dora_failures_list_response import DORAFailuresListResponse from datadog_api_client.v2.model.dora_git_info import DORAGitInfo +from datadog_api_client.v2.model.dora_incident_object import DORAIncidentObject +from datadog_api_client.v2.model.dora_incident_object_attributes import DORAIncidentObjectAttributes from datadog_api_client.v2.model.dora_list_deployments_request import DORAListDeploymentsRequest from datadog_api_client.v2.model.dora_list_deployments_request_attributes import DORAListDeploymentsRequestAttributes from datadog_api_client.v2.model.dora_list_deployments_request_data import DORAListDeploymentsRequestData @@ -1328,7 +1334,6 @@ from datadog_api_client.v2.model.dora_list_failures_request_attributes import DORAListFailuresRequestAttributes from datadog_api_client.v2.model.dora_list_failures_request_data import DORAListFailuresRequestData from datadog_api_client.v2.model.dora_list_failures_request_data_type import DORAListFailuresRequestDataType -from datadog_api_client.v2.model.dora_list_response import DORAListResponse from datadog_api_client.v2.model.dashboard_list_add_items_request import DashboardListAddItemsRequest from datadog_api_client.v2.model.dashboard_list_add_items_response import DashboardListAddItemsResponse from datadog_api_client.v2.model.dashboard_list_delete_items_request import DashboardListDeleteItemsRequest @@ -6081,21 +6086,27 @@ "CustomFrameworkRequirement", "CustomFrameworkType", "CustomFrameworkWithoutRequirements", + "DORADeploymentFetchResponse", + "DORADeploymentObject", + "DORADeploymentObjectAttributes", "DORADeploymentRequest", "DORADeploymentRequestAttributes", "DORADeploymentRequestData", "DORADeploymentResponse", "DORADeploymentResponseData", "DORADeploymentType", - "DORAEvent", + "DORADeploymentsListResponse", + "DORAFailureFetchResponse", "DORAFailureRequest", "DORAFailureRequestAttributes", "DORAFailureRequestData", "DORAFailureResponse", "DORAFailureResponseData", "DORAFailureType", - "DORAFetchResponse", + "DORAFailuresListResponse", "DORAGitInfo", + "DORAIncidentObject", + "DORAIncidentObjectAttributes", "DORAListDeploymentsRequest", "DORAListDeploymentsRequestAttributes", "DORAListDeploymentsRequestData", @@ -6104,7 +6115,6 @@ "DORAListFailuresRequestAttributes", "DORAListFailuresRequestData", "DORAListFailuresRequestDataType", - "DORAListResponse", "DashboardListAddItemsRequest", "DashboardListAddItemsResponse", "DashboardListDeleteItemsRequest", diff --git a/tests/v2/features/teams.feature b/tests/v2/features/teams.feature index 41b57b1474..9deac2e88a 100644 --- a/tests/v2/features/teams.feature +++ b/tests/v2/features/teams.feature @@ -112,11 +112,8 @@ Feature: Teams And the response "data.attributes.name" is equal to "test-name-{{ unique_hash }}" And the response "data.attributes.avatar" is equal to "🥑" And the response "data.attributes.banner" is equal to 7 - And the response "data.attributes.visible_modules" has length 2 - And the response "data.attributes.visible_modules" array contains value "m1" - And the response "data.attributes.visible_modules" array contains value "m2" - And the response "data.attributes.hidden_modules" has length 1 - And the response "data.attributes.hidden_modules" array contains value "m3" + And the response "data.attributes.visible_modules" is equal to ["m1","m2"] + And the response "data.attributes.hidden_modules" is equal to ["m3"] @skip @team:DataDog/aaa-omg Scenario: Create team connections returns "Bad Request" response