From 7e0e084520555db2dfa04bfee6ccf5c46913eb2a Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 7 Jul 2026 11:57:26 +0000 Subject: [PATCH] Regenerate client from commit dcda436 of spec repo --- .generator/schemas/v2/openapi.yaml | 71 +++++++++---------- ...ployments-with-date-time-timestamps.frozen | 1 + ...-deployments-with-date-time-timestamps.yml | 24 +++++++ .../ListDORADeployments_1654201709.rb | 15 ++++ features/v2/dora_metrics.feature | 12 ++++ .../dora_deployment_object_attributes.rb | 21 ++---- .../models/dora_incident_object_attributes.rb | 28 ++------ 7 files changed, 96 insertions(+), 76 deletions(-) create mode 100644 cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.frozen create mode 100644 cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.yml create mode 100644 examples/v2/dora-metrics/ListDORADeployments_1654201709.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index cc175b4553f8..28a5bdd897b6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -28815,12 +28815,12 @@ components: - "department:engineering" - "region:us-east-1" env: "production" - finished_at: 1693491984000000000 + finished_at: "2023-08-31T14:26:24Z" git: commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588" repository_id: "github.com/organization/example-repository" service: "shopist" - started_at: 1693491974000000000 + started_at: "2023-08-31T14:26:14Z" team: "backend" version: "v1.12.07" id: "4242fcdd31586083" @@ -28844,10 +28844,10 @@ components: example: production type: string finished_at: - description: Unix timestamp when the deployment finished. - example: 1693491984000000000 - format: int64 - type: integer + description: The time when the deployment finished. + example: "2023-08-31T14:26:24Z" + format: date-time + type: string git: $ref: "#/components/schemas/DORAGitInfoResponse" service: @@ -28855,10 +28855,10 @@ components: example: shopist type: string started_at: - description: Unix timestamp when the deployment started. - example: 1693491974000000000 - format: int64 - type: integer + description: The time when the deployment started. + example: "2023-08-31T14:26:14Z" + format: date-time + type: string team: description: Name of the team owning the deployed service. example: backend @@ -28870,7 +28870,6 @@ components: required: - service - started_at - - finished_at type: object DORADeploymentPatchRemediation: description: Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time. @@ -29048,12 +29047,12 @@ components: - "department:engineering" - "region:us-east-1" env: "production" - finished_at: 1693491984000000000 + finished_at: "2023-08-31T14:26:24Z" git: commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588" repository_id: "github.com/organization/example-repository" service: "shopist" - started_at: 1693491974000000000 + started_at: "2023-08-31T14:26:14Z" team: "backend" version: "v1.12.07" id: "4242fcdd31586083" @@ -29063,12 +29062,12 @@ components: - "language:go" - "department:platform" env: "production" - finished_at: 1693492084000000000 + finished_at: "2023-08-31T14:28:04Z" git: commit_sha: "77bdc9350f2cc9b250b69abddab733dd55e1a599" repository_id: "github.com/organization/api-service" service: "api-service" - started_at: 1693492074000000000 + started_at: "2023-08-31T14:27:54Z" team: "backend" version: "v2.1.0" id: "4242fcdd31586084" @@ -29190,12 +29189,12 @@ components: - "incident_type:database" - "department:engineering" env: "production" - finished_at: 1693492274000000000 + finished_at: "2023-08-31T14:31:14Z" name: "Database outage" services: - "shopist" severity: "SEV-1" - started_at: 1693492174000000000 + started_at: "2023-08-31T14:29:34Z" team: "backend" id: "4242fcdd31586085" type: "dora_incident" @@ -29204,13 +29203,13 @@ components: - "incident_type:service_down" - "department:platform" env: "production" - finished_at: 1693492474000000000 + finished_at: "2023-08-31T14:34:34Z" name: "API service outage" services: - "api-service" - "payment-service" severity: "SEV-2" - started_at: 1693492374000000000 + started_at: "2023-08-31T14:32:54Z" team: "backend" id: "4242fcdd31586086" type: "dora_incident" @@ -29251,7 +29250,7 @@ components: - "incident_type:database" - "department:engineering" env: "production" - finished_at: 1693492274000000000 + finished_at: "2023-08-31T14:31:14Z" git: commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588" repository_url: "https://github.com/organization/example-repository" @@ -29259,7 +29258,7 @@ components: services: - "shopist" severity: "SEV-1" - started_at: 1693492174000000000 + started_at: "2023-08-31T14:29:34Z" team: "backend" id: "4242fcdd31586085" type: "dora_incident" @@ -29282,10 +29281,10 @@ components: example: production type: string finished_at: - description: Unix timestamp when the incident finished. - example: 1693491984000000000 - format: int64 - type: integer + description: The time when the incident finished. + example: "2023-08-31T14:26:24Z" + format: date-time + type: string git: $ref: "#/components/schemas/DORAGitInfo" name: @@ -29304,10 +29303,10 @@ components: example: SEV-1 type: string started_at: - description: Unix timestamp when the incident started. - example: 1693491974000000000 - format: int64 - type: integer + description: The time when the incident started. + example: "2023-08-31T14:26:14Z" + format: date-time + type: string team: description: Name of the team owning the services impacted. example: backend @@ -29316,8 +29315,6 @@ components: 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. @@ -132589,9 +132586,9 @@ paths: data: - attributes: env: production - finished_at: 1693491984000000000 + finished_at: "2023-08-31T14:26:24Z" service: test-service - started_at: 1693491974000000000 + started_at: "2023-08-31T14:26:14Z" team: backend id: abc-123 type: dora_deployment @@ -132640,9 +132637,9 @@ paths: data: attributes: env: production - finished_at: 1693491984000000000 + finished_at: "2023-08-31T14:26:24Z" service: test-service - started_at: 1693491974000000000 + started_at: "2023-08-31T14:26:14Z" team: backend id: abc-123 type: dora_deployment @@ -132863,7 +132860,7 @@ paths: services: - test-service severity: SEV-1 - started_at: 1693492174000000000 + started_at: "2023-08-31T14:29:34Z" team: backend id: abc-123 type: dora_failure @@ -132916,7 +132913,7 @@ paths: services: - test-service severity: SEV-1 - started_at: 1693492174000000000 + started_at: "2023-08-31T14:29:34Z" team: backend id: abc-123 type: dora_failure diff --git a/cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.frozen b/cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.frozen new file mode 100644 index 000000000000..4f30c83806e6 --- /dev/null +++ b/cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.frozen @@ -0,0 +1 @@ +2023-08-31T14:26:14.000Z \ No newline at end of file diff --git a/cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.yml b/cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.yml new file mode 100644 index 000000000000..7c991a45596e --- /dev/null +++ b/cassettes/features/v2/dora_metrics/Get-a-list-of-deployment-events-returns-deployments-with-date-time-timestamps.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Thu, 31 Aug 2023 14:26:14 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"from":"2023-08-31T00:00:00Z","to":"2023-09-01T00:00:00Z"},"type":"dora_deployments_list_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/dora/deployments + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"abc-123","type":"dora_deployment","attributes":{"service":"shopist","started_at":"2023-08-31T14:26:14Z","finished_at":"2023-08-31T14:26:24Z","env":"production","team":"backend","version":"v1.12.07"}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/dora-metrics/ListDORADeployments_1654201709.rb b/examples/v2/dora-metrics/ListDORADeployments_1654201709.rb new file mode 100644 index 000000000000..6669697c7627 --- /dev/null +++ b/examples/v2/dora-metrics/ListDORADeployments_1654201709.rb @@ -0,0 +1,15 @@ +# Get a list of deployment events returns deployments with date-time timestamps + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::DORAMetricsAPI.new + +body = DatadogAPIClient::V2::DORAListDeploymentsRequest.new({ + data: DatadogAPIClient::V2::DORAListDeploymentsRequestData.new({ + attributes: DatadogAPIClient::V2::DORAListDeploymentsRequestAttributes.new({ + from: "2023-08-31T00:00:00Z", + to: "2023-09-01T00:00:00Z", + }), + type: DatadogAPIClient::V2::DORAListDeploymentsRequestDataType::DORA_DEPLOYMENTS_LIST_REQUEST, + }), +}) +p api_instance.list_dora_deployments(body) diff --git a/features/v2/dora_metrics.feature b/features/v2/dora_metrics.feature index 768442f37f5c..d0dc8943ad91 100644 --- a/features/v2/dora_metrics.feature +++ b/features/v2/dora_metrics.feature @@ -88,6 +88,18 @@ Feature: DORA Metrics When the request is sent Then the response status is 200 OK + @replay-only @team:DataDog/ci-app-backend + Scenario: Get a list of deployment events returns deployments with date-time timestamps + Given a valid "appKeyAuth" key in the system + And new "ListDORADeployments" request + And body with value {"data": {"attributes": {"from": "2023-08-31T00:00:00Z", "to": "2023-09-01T00:00:00Z"}, "type": "dora_deployments_list_request"}} + 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 "dora_deployment" + And the response "data[0].attributes" has field "started_at" + And the response "data[0].attributes" has field "finished_at" + @team:DataDog/ci-app-backend Scenario: Get a list of failure events returns "Bad Request" response Given a valid "appKeyAuth" key in the system diff --git a/lib/datadog_api_client/v2/models/dora_deployment_object_attributes.rb b/lib/datadog_api_client/v2/models/dora_deployment_object_attributes.rb index f86051e50df2..a66cefdbfb4f 100644 --- a/lib/datadog_api_client/v2/models/dora_deployment_object_attributes.rb +++ b/lib/datadog_api_client/v2/models/dora_deployment_object_attributes.rb @@ -27,8 +27,8 @@ class DORADeploymentObjectAttributes # Environment name to where the service was deployed. attr_accessor :env - # Unix timestamp when the deployment finished. - attr_reader :finished_at + # The time when the deployment finished. + attr_accessor :finished_at # Git info returned by DORA Metrics events. attr_accessor :git @@ -36,7 +36,7 @@ class DORADeploymentObjectAttributes # Service name. attr_reader :service - # Unix timestamp when the deployment started. + # The time when the deployment started. attr_reader :started_at # Name of the team owning the deployed service. @@ -68,10 +68,10 @@ def self.openapi_types { :'custom_tags' => :'Array', :'env' => :'String', - :'finished_at' => :'Integer', + :'finished_at' => :'Time', :'git' => :'DORAGitInfoResponse', :'service' => :'String', - :'started_at' => :'Integer', + :'started_at' => :'Time', :'team' => :'String', :'version' => :'String' } @@ -142,22 +142,11 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @finished_at.nil? return false if @service.nil? return false if @started_at.nil? true end - # Custom attribute writer method with validation - # @param finished_at [Object] Object to be assigned - # @!visibility private - def finished_at=(finished_at) - if finished_at.nil? - fail ArgumentError, 'invalid value for "finished_at", finished_at cannot be nil.' - end - @finished_at = finished_at - end - # Custom attribute writer method with validation # @param service [Object] Object to be assigned # @!visibility private diff --git a/lib/datadog_api_client/v2/models/dora_incident_object_attributes.rb b/lib/datadog_api_client/v2/models/dora_incident_object_attributes.rb index 9a3294c34d22..42a556e9ac52 100644 --- a/lib/datadog_api_client/v2/models/dora_incident_object_attributes.rb +++ b/lib/datadog_api_client/v2/models/dora_incident_object_attributes.rb @@ -27,7 +27,7 @@ class DORAIncidentObjectAttributes # Environment name that was impacted by the incident. attr_accessor :env - # Unix timestamp when the incident finished. + # The time when the incident finished. attr_accessor :finished_at # Git info for DORA Metrics events. @@ -42,8 +42,8 @@ class DORAIncidentObjectAttributes # Incident severity. attr_accessor :severity - # Unix timestamp when the incident started. - attr_reader :started_at + # The time when the incident started. + attr_accessor :started_at # Name of the team owning the services impacted. attr_accessor :team @@ -76,12 +76,12 @@ def self.openapi_types { :'custom_tags' => :'Array', :'env' => :'String', - :'finished_at' => :'Integer', + :'finished_at' => :'Time', :'git' => :'DORAGitInfo', :'name' => :'String', :'services' => :'Array', :'severity' => :'String', - :'started_at' => :'Integer', + :'started_at' => :'Time', :'team' => :'String', :'version' => :'String' } @@ -158,24 +158,6 @@ def initialize(attributes = {}) end end - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @started_at.nil? - true - end - - # Custom attribute writer method with validation - # @param started_at [Object] Object to be assigned - # @!visibility private - def started_at=(started_at) - if started_at.nil? - fail ArgumentError, 'invalid value for "started_at", started_at cannot be nil.' - end - @started_at = started_at - end - # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private