diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e24a358f1b..43de804db3 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -29903,6 +29903,35 @@ components: type: string nullable: true type: array + DORADeploymentAveragedMetrics: + description: Averaged DORA and delivery metrics computed across the commits and pull requests included in the deployment. + properties: + change_lead_time: + description: The averaged change lead time, in seconds. + example: 166821 + format: int64 + type: integer + merge_time: + description: The averaged merge time, in seconds. + example: 5852 + format: int64 + type: integer + review_time: + description: The averaged review time, in seconds. + example: 140 + format: int64 + type: integer + time_to_deploy: + description: The averaged time to deploy, in seconds. + example: 164481 + format: int64 + type: integer + time_to_pr_ready: + description: The averaged time until the pull request was ready for review, in seconds. + example: 27 + format: int64 + type: integer + type: object DORADeploymentFetchResponse: description: Response for fetching a single deployment event. properties: @@ -29940,8 +29969,43 @@ components: DORADeploymentObjectAttributes: description: The attributes of the deployment event. properties: + ai: + additionalProperties: {} + description: AI-assisted development metrics aggregated across the commits and pull requests included in the deployment. + type: object + averaged_metrics: + $ref: "#/components/schemas/DORADeploymentAveragedMetrics" + change_failure: + description: Whether the deployment is flagged as a change failure. + example: false + type: boolean + commits: + description: The list of commits included in the deployment. + items: + additionalProperties: {} + type: object + type: array + created_at: + description: The time when the deployment event was recorded. + example: "2023-08-31T14:26:24Z" + format: date-time + type: string + custom: + additionalProperties: {} + description: A map of custom metadata associated with the deployment. + example: {"service": ["courier-cloud"]} + type: object custom_tags: $ref: "#/components/schemas/DORACustomTags" + deployment_type: + description: The type of the deployment. + example: standard + type: string + duration: + description: The duration of the deployment. + example: 0 + format: int64 + type: integer env: description: Environment name to where the service was deployed. example: production @@ -29953,10 +30017,37 @@ components: type: string git: $ref: "#/components/schemas/DORAGitInfoResponse" + number_of_commits: + description: The number of commits associated with the deployment. + example: 5 + format: int64 + type: integer + number_of_pull_requests: + description: The number of pull requests associated with the deployment. + example: 1 + format: int64 + type: integer + pull_requests: + description: The list of pull requests included in the deployment. + items: + additionalProperties: {} + type: object + type: array + recovery_time_sec: + description: The recovery time, in seconds, for a deployment flagged as a change failure. + example: 28230 + format: int64 + type: integer + remediation: + $ref: "#/components/schemas/DORADeploymentRemediation" service: description: Service name. example: shopist type: string + source: + description: The source of the deployment event. + example: apm_deployments + type: string started_at: description: The time when the deployment started. example: "2023-08-31T14:26:14Z" @@ -30148,6 +30239,18 @@ components: type: string x-enum-varnames: - DORA_DEPLOYMENT_PATCH_REQUEST + DORADeploymentRemediation: + description: Remediation details for a deployment that was flagged as a change failure. + properties: + id: + description: The ID of the remediation deployment. + example: eG42zNIkVjM + type: string + type: + description: The type of remediation, such as a rollback. + example: rollback + type: string + type: object DORADeploymentRequest: description: Request to create a DORA deployment event. properties: diff --git a/src/datadog_api_client/v2/model/dora_deployment_averaged_metrics.py b/src/datadog_api_client/v2/model/dora_deployment_averaged_metrics.py new file mode 100644 index 0000000000..8abf2793a7 --- /dev/null +++ b/src/datadog_api_client/v2/model/dora_deployment_averaged_metrics.py @@ -0,0 +1,72 @@ +# 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 DORADeploymentAveragedMetrics(ModelNormal): + @cached_property + def openapi_types(_): + return { + "change_lead_time": (int,), + "merge_time": (int,), + "review_time": (int,), + "time_to_deploy": (int,), + "time_to_pr_ready": (int,), + } + + attribute_map = { + "change_lead_time": "change_lead_time", + "merge_time": "merge_time", + "review_time": "review_time", + "time_to_deploy": "time_to_deploy", + "time_to_pr_ready": "time_to_pr_ready", + } + + def __init__( + self_, + change_lead_time: Union[int, UnsetType] = unset, + merge_time: Union[int, UnsetType] = unset, + review_time: Union[int, UnsetType] = unset, + time_to_deploy: Union[int, UnsetType] = unset, + time_to_pr_ready: Union[int, UnsetType] = unset, + **kwargs, + ): + """ + Averaged DORA and delivery metrics computed across the commits and pull requests included in the deployment. + + :param change_lead_time: The averaged change lead time, in seconds. + :type change_lead_time: int, optional + + :param merge_time: The averaged merge time, in seconds. + :type merge_time: int, optional + + :param review_time: The averaged review time, in seconds. + :type review_time: int, optional + + :param time_to_deploy: The averaged time to deploy, in seconds. + :type time_to_deploy: int, optional + + :param time_to_pr_ready: The averaged time until the pull request was ready for review, in seconds. + :type time_to_pr_ready: int, optional + """ + if change_lead_time is not unset: + kwargs["change_lead_time"] = change_lead_time + if merge_time is not unset: + kwargs["merge_time"] = merge_time + if review_time is not unset: + kwargs["review_time"] = review_time + if time_to_deploy is not unset: + kwargs["time_to_deploy"] = time_to_deploy + if time_to_pr_ready is not unset: + kwargs["time_to_pr_ready"] = time_to_pr_ready + 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 index 4afe9b1f60..f2f098865b 100644 --- a/src/datadog_api_client/v2/model/dora_deployment_object_attributes.py +++ b/src/datadog_api_client/v2/model/dora_deployment_object_attributes.py @@ -3,44 +3,142 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, Union, TYPE_CHECKING +from typing import Any, Dict, List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, cached_property, + date, datetime, none_type, unset, UnsetType, + UUID, ) if TYPE_CHECKING: + from datadog_api_client.v2.model.dora_deployment_averaged_metrics import DORADeploymentAveragedMetrics from datadog_api_client.v2.model.dora_git_info_response import DORAGitInfoResponse + from datadog_api_client.v2.model.dora_deployment_remediation import DORADeploymentRemediation class DORADeploymentObjectAttributes(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.dora_deployment_averaged_metrics import DORADeploymentAveragedMetrics from datadog_api_client.v2.model.dora_git_info_response import DORAGitInfoResponse + from datadog_api_client.v2.model.dora_deployment_remediation import DORADeploymentRemediation return { + "ai": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), + "averaged_metrics": (DORADeploymentAveragedMetrics,), + "change_failure": (bool,), + "commits": ( + [ + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + } + ], + ), + "created_at": (datetime,), + "custom": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), "custom_tags": ([str],), + "deployment_type": (str,), + "duration": (int,), "env": (str,), "finished_at": (datetime,), "git": (DORAGitInfoResponse,), + "number_of_commits": (int,), + "number_of_pull_requests": (int,), + "pull_requests": ( + [ + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + } + ], + ), + "recovery_time_sec": (int,), + "remediation": (DORADeploymentRemediation,), "service": (str,), + "source": (str,), "started_at": (datetime,), "team": (str,), "version": (str,), } attribute_map = { + "ai": "ai", + "averaged_metrics": "averaged_metrics", + "change_failure": "change_failure", + "commits": "commits", + "created_at": "created_at", + "custom": "custom", "custom_tags": "custom_tags", + "deployment_type": "deployment_type", + "duration": "duration", "env": "env", "finished_at": "finished_at", "git": "git", + "number_of_commits": "number_of_commits", + "number_of_pull_requests": "number_of_pull_requests", + "pull_requests": "pull_requests", + "recovery_time_sec": "recovery_time_sec", + "remediation": "remediation", "service": "service", + "source": "source", "started_at": "started_at", "team": "team", "version": "version", @@ -50,10 +148,24 @@ def __init__( self_, service: str, started_at: datetime, + ai: Union[Dict[str, Any], UnsetType] = unset, + averaged_metrics: Union[DORADeploymentAveragedMetrics, UnsetType] = unset, + change_failure: Union[bool, UnsetType] = unset, + commits: Union[List[Dict[str, Any]], UnsetType] = unset, + created_at: Union[datetime, UnsetType] = unset, + custom: Union[Dict[str, Any], UnsetType] = unset, custom_tags: Union[List[str], none_type, UnsetType] = unset, + deployment_type: Union[str, UnsetType] = unset, + duration: Union[int, UnsetType] = unset, env: Union[str, UnsetType] = unset, finished_at: Union[datetime, UnsetType] = unset, git: Union[DORAGitInfoResponse, UnsetType] = unset, + number_of_commits: Union[int, UnsetType] = unset, + number_of_pull_requests: Union[int, UnsetType] = unset, + pull_requests: Union[List[Dict[str, Any]], UnsetType] = unset, + recovery_time_sec: Union[int, UnsetType] = unset, + remediation: Union[DORADeploymentRemediation, UnsetType] = unset, + source: Union[str, UnsetType] = unset, team: Union[str, UnsetType] = unset, version: Union[str, UnsetType] = unset, **kwargs, @@ -61,9 +173,33 @@ def __init__( """ The attributes of the deployment event. + :param ai: AI-assisted development metrics aggregated across the commits and pull requests included in the deployment. + :type ai: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional + + :param averaged_metrics: Averaged DORA and delivery metrics computed across the commits and pull requests included in the deployment. + :type averaged_metrics: DORADeploymentAveragedMetrics, optional + + :param change_failure: Whether the deployment is flagged as a change failure. + :type change_failure: bool, optional + + :param commits: The list of commits included in the deployment. + :type commits: [{str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}], optional + + :param created_at: The time when the deployment event was recorded. + :type created_at: datetime, optional + + :param custom: A map of custom metadata associated with the deployment. + :type custom: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, optional + :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 deployment_type: The type of the deployment. + :type deployment_type: str, optional + + :param duration: The duration of the deployment. + :type duration: int, optional + :param env: Environment name to where the service was deployed. :type env: str, optional @@ -73,9 +209,27 @@ def __init__( :param git: Git info returned by DORA Metrics events. :type git: DORAGitInfoResponse, optional + :param number_of_commits: The number of commits associated with the deployment. + :type number_of_commits: int, optional + + :param number_of_pull_requests: The number of pull requests associated with the deployment. + :type number_of_pull_requests: int, optional + + :param pull_requests: The list of pull requests included in the deployment. + :type pull_requests: [{str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}], optional + + :param recovery_time_sec: The recovery time, in seconds, for a deployment flagged as a change failure. + :type recovery_time_sec: int, optional + + :param remediation: Remediation details for a deployment that was flagged as a change failure. + :type remediation: DORADeploymentRemediation, optional + :param service: Service name. :type service: str + :param source: The source of the deployment event. + :type source: str, optional + :param started_at: The time when the deployment started. :type started_at: datetime @@ -85,14 +239,42 @@ def __init__( :param version: Version to correlate with APM Deployment Tracking. :type version: str, optional """ + if ai is not unset: + kwargs["ai"] = ai + if averaged_metrics is not unset: + kwargs["averaged_metrics"] = averaged_metrics + if change_failure is not unset: + kwargs["change_failure"] = change_failure + if commits is not unset: + kwargs["commits"] = commits + if created_at is not unset: + kwargs["created_at"] = created_at + if custom is not unset: + kwargs["custom"] = custom if custom_tags is not unset: kwargs["custom_tags"] = custom_tags + if deployment_type is not unset: + kwargs["deployment_type"] = deployment_type + if duration is not unset: + kwargs["duration"] = duration 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 number_of_commits is not unset: + kwargs["number_of_commits"] = number_of_commits + if number_of_pull_requests is not unset: + kwargs["number_of_pull_requests"] = number_of_pull_requests + if pull_requests is not unset: + kwargs["pull_requests"] = pull_requests + if recovery_time_sec is not unset: + kwargs["recovery_time_sec"] = recovery_time_sec + if remediation is not unset: + kwargs["remediation"] = remediation + if source is not unset: + kwargs["source"] = source if team is not unset: kwargs["team"] = team if version is not unset: diff --git a/src/datadog_api_client/v2/model/dora_deployment_remediation.py b/src/datadog_api_client/v2/model/dora_deployment_remediation.py new file mode 100644 index 0000000000..a660cc2988 --- /dev/null +++ b/src/datadog_api_client/v2/model/dora_deployment_remediation.py @@ -0,0 +1,43 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class DORADeploymentRemediation(ModelNormal): + @cached_property + def openapi_types(_): + return { + "id": (str,), + "type": (str,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: Union[str, UnsetType] = unset, type: Union[str, UnsetType] = unset, **kwargs): + """ + Remediation details for a deployment that was flagged as a change failure. + + :param id: The ID of the remediation deployment. + :type id: str, optional + + :param type: The type of remediation, such as a rollback. + :type type: str, optional + """ + 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/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 6e3ebb076b..1fed251850 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2242,6 +2242,7 @@ from datadog_api_client.v2.model.cyclone_dx_vulnerability_rating import CycloneDXVulnerabilityRating from datadog_api_client.v2.model.cyclone_dx_vulnerability_reference import CycloneDXVulnerabilityReference from datadog_api_client.v2.model.cyclone_dx_vulnerability_reference_source import CycloneDXVulnerabilityReferenceSource +from datadog_api_client.v2.model.dora_deployment_averaged_metrics import DORADeploymentAveragedMetrics 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 @@ -2267,6 +2268,7 @@ from datadog_api_client.v2.model.dora_deployment_patch_request_attributes import DORADeploymentPatchRequestAttributes from datadog_api_client.v2.model.dora_deployment_patch_request_data import DORADeploymentPatchRequestData from datadog_api_client.v2.model.dora_deployment_patch_request_data_type import DORADeploymentPatchRequestDataType +from datadog_api_client.v2.model.dora_deployment_remediation import DORADeploymentRemediation 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 @@ -12839,6 +12841,7 @@ "CycloneDXVulnerabilityRating", "CycloneDXVulnerabilityReference", "CycloneDXVulnerabilityReferenceSource", + "DORADeploymentAveragedMetrics", "DORADeploymentFetchResponse", "DORADeploymentObject", "DORADeploymentObjectAttributes", @@ -12854,6 +12857,7 @@ "DORADeploymentPatchRequestAttributes", "DORADeploymentPatchRequestData", "DORADeploymentPatchRequestDataType", + "DORADeploymentRemediation", "DORADeploymentRequest", "DORADeploymentRequestAttributes", "DORADeploymentRequestData",