diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index fb8574b175ea..0930cfd613f1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -14717,9 +14717,9 @@ components: type: number type: array CustomAttributeMultiStringValue: - description: Value of multi TEXT/URL/SELECT custom attribute + description: Value of multi TEXT/URL/NUMBER/SELECT custom attribute items: - description: TEXT/URL/SELECT Value + description: TEXT/URL/NUMBER/SELECT Value type: string type: array CustomAttributeNumberValue: @@ -14727,7 +14727,7 @@ components: format: double type: number CustomAttributeStringValue: - description: Value of TEXT/URL/SELECT custom attribute + description: Value of TEXT/URL/NUMBER/SELECT custom attribute type: string CustomAttributeType: description: Custom attributes type @@ -15885,6 +15885,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: @@ -15975,18 +16047,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. @@ -16090,11 +16197,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. @@ -16107,6 +16248,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: @@ -16126,32 +16343,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 @@ -16174,9 +16390,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 @@ -16199,32 +16417,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 @@ -16247,54 +16464,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: @@ -67827,7 +68004,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DORAListResponse' + $ref: '#/components/schemas/DORADeploymentsListResponse' description: OK '400': content: @@ -67865,26 +68042,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: @@ -68001,66 +68160,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: @@ -68098,28 +68199,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/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 022391df7878..94cccd52c2b2 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1985,21 +1985,27 @@ def overrides "v2.domain_allowlist_response_data" => "DomainAllowlistResponseData", "v2.domain_allowlist_response_data_attributes" => "DomainAllowlistResponseDataAttributes", "v2.domain_allowlist_type" => "DomainAllowlistType", + "v2.dora_deployment_fetch_response" => "DORADeploymentFetchResponse", + "v2.dora_deployment_object" => "DORADeploymentObject", + "v2.dora_deployment_object_attributes" => "DORADeploymentObjectAttributes", "v2.dora_deployment_request" => "DORADeploymentRequest", "v2.dora_deployment_request_attributes" => "DORADeploymentRequestAttributes", "v2.dora_deployment_request_data" => "DORADeploymentRequestData", "v2.dora_deployment_response" => "DORADeploymentResponse", "v2.dora_deployment_response_data" => "DORADeploymentResponseData", + "v2.dora_deployments_list_response" => "DORADeploymentsListResponse", "v2.dora_deployment_type" => "DORADeploymentType", - "v2.dora_event" => "DORAEvent", + "v2.dora_failure_fetch_response" => "DORAFailureFetchResponse", "v2.dora_failure_request" => "DORAFailureRequest", "v2.dora_failure_request_attributes" => "DORAFailureRequestAttributes", "v2.dora_failure_request_data" => "DORAFailureRequestData", "v2.dora_failure_response" => "DORAFailureResponse", "v2.dora_failure_response_data" => "DORAFailureResponseData", + "v2.dora_failures_list_response" => "DORAFailuresListResponse", "v2.dora_failure_type" => "DORAFailureType", - "v2.dora_fetch_response" => "DORAFetchResponse", "v2.dora_git_info" => "DORAGitInfo", + "v2.dora_incident_object" => "DORAIncidentObject", + "v2.dora_incident_object_attributes" => "DORAIncidentObjectAttributes", "v2.dora_list_deployments_request" => "DORAListDeploymentsRequest", "v2.dora_list_deployments_request_attributes" => "DORAListDeploymentsRequestAttributes", "v2.dora_list_deployments_request_data" => "DORAListDeploymentsRequestData", @@ -2008,7 +2014,6 @@ def overrides "v2.dora_list_failures_request_attributes" => "DORAListFailuresRequestAttributes", "v2.dora_list_failures_request_data" => "DORAListFailuresRequestData", "v2.dora_list_failures_request_data_type" => "DORAListFailuresRequestDataType", - "v2.dora_list_response" => "DORAListResponse", "v2.downtime_create_request" => "DowntimeCreateRequest", "v2.downtime_create_request_attributes" => "DowntimeCreateRequestAttributes", "v2.downtime_create_request_data" => "DowntimeCreateRequestData", diff --git a/lib/datadog_api_client/v2/api/dora_metrics_api.rb b/lib/datadog_api_client/v2/api/dora_metrics_api.rb index 6f96bce600cb..7ca71f17eae0 100644 --- a/lib/datadog_api_client/v2/api/dora_metrics_api.rb +++ b/lib/datadog_api_client/v2/api/dora_metrics_api.rb @@ -386,7 +386,7 @@ def get_dora_deployment(deployment_id, opts = {}) # # @param deployment_id [String] The ID of the deployment event. # @param opts [Hash] the optional parameters - # @return [Array<(DORAFetchResponse, Integer, Hash)>] DORAFetchResponse data, response status code and response headers + # @return [Array<(DORADeploymentFetchResponse, Integer, Hash)>] DORADeploymentFetchResponse data, response status code and response headers def get_dora_deployment_with_http_info(deployment_id, opts = {}) if @api_client.config.debugging @@ -414,7 +414,7 @@ def get_dora_deployment_with_http_info(deployment_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'DORAFetchResponse' + return_type = opts[:debug_return_type] || 'DORADeploymentFetchResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] @@ -451,7 +451,7 @@ def get_dora_failure(failure_id, opts = {}) # # @param failure_id [String] The ID of the failure event. # @param opts [Hash] the optional parameters - # @return [Array<(DORAFetchResponse, Integer, Hash)>] DORAFetchResponse data, response status code and response headers + # @return [Array<(DORAFailureFetchResponse, Integer, Hash)>] DORAFailureFetchResponse data, response status code and response headers def get_dora_failure_with_http_info(failure_id, opts = {}) if @api_client.config.debugging @@ -479,7 +479,7 @@ def get_dora_failure_with_http_info(failure_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'DORAFetchResponse' + return_type = opts[:debug_return_type] || 'DORAFailureFetchResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] @@ -516,7 +516,7 @@ def list_dora_deployments(body, opts = {}) # # @param body [DORAListDeploymentsRequest] # @param opts [Hash] the optional parameters - # @return [Array<(DORAListResponse, Integer, Hash)>] DORAListResponse data, response status code and response headers + # @return [Array<(DORADeploymentsListResponse, Integer, Hash)>] DORADeploymentsListResponse data, response status code and response headers def list_dora_deployments_with_http_info(body, opts = {}) if @api_client.config.debugging @@ -546,7 +546,7 @@ def list_dora_deployments_with_http_info(body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'DORAListResponse' + return_type = opts[:debug_return_type] || 'DORADeploymentsListResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] @@ -583,7 +583,7 @@ def list_dora_failures(body, opts = {}) # # @param body [DORAListFailuresRequest] # @param opts [Hash] the optional parameters - # @return [Array<(DORAListResponse, Integer, Hash)>] DORAListResponse data, response status code and response headers + # @return [Array<(DORAFailuresListResponse, Integer, Hash)>] DORAFailuresListResponse data, response status code and response headers def list_dora_failures_with_http_info(body, opts = {}) if @api_client.config.debugging @@ -613,7 +613,7 @@ def list_dora_failures_with_http_info(body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'DORAListResponse' + return_type = opts[:debug_return_type] || 'DORAFailuresListResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] diff --git a/lib/datadog_api_client/v2/models/dora_deployment_fetch_response.rb b/lib/datadog_api_client/v2/models/dora_deployment_fetch_response.rb new file mode 100644 index 000000000000..ed9c4746fa13 --- /dev/null +++ b/lib/datadog_api_client/v2/models/dora_deployment_fetch_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for fetching a single deployment event. + class DORADeploymentFetchResponse + include BaseGenericModel + + # A DORA deployment event. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'DORADeploymentObject' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DORADeploymentFetchResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dora_deployment_object.rb b/lib/datadog_api_client/v2/models/dora_deployment_object.rb new file mode 100644 index 000000000000..1cd916ae4ec5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/dora_deployment_object.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A DORA deployment event. + class DORADeploymentObject + include BaseGenericModel + + # The attributes of the deployment event. + attr_accessor :attributes + + # The ID of the deployment event. + attr_accessor :id + + # JSON:API type for DORA deployment events. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'DORADeploymentObjectAttributes', + :'id' => :'String', + :'type' => :'DORADeploymentType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DORADeploymentObject` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end 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 new file mode 100644 index 000000000000..4f9e8f9d2e34 --- /dev/null +++ b/lib/datadog_api_client/v2/models/dora_deployment_object_attributes.rb @@ -0,0 +1,225 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of the deployment event. + class DORADeploymentObjectAttributes + include BaseGenericModel + + # A list of user-defined tags. The tags must follow the `key:value` pattern. Up to 100 may be added per event. + attr_accessor :custom_tags + + # Environment name to where the service was deployed. + attr_accessor :env + + # Unix timestamp when the deployment finished. + attr_reader :finished_at + + # Git info for DORA Metrics events. + attr_accessor :git + + # Service name. + attr_reader :service + + # Unix timestamp when the deployment started. + attr_reader :started_at + + # Name of the team owning the deployed service. + attr_accessor :team + + # Version to correlate with APM Deployment Tracking. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'custom_tags' => :'custom_tags', + :'env' => :'env', + :'finished_at' => :'finished_at', + :'git' => :'git', + :'service' => :'service', + :'started_at' => :'started_at', + :'team' => :'team', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_tags' => :'Array', + :'env' => :'String', + :'finished_at' => :'Integer', + :'git' => :'DORAGitInfo', + :'service' => :'String', + :'started_at' => :'Integer', + :'team' => :'String', + :'version' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'custom_tags', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DORADeploymentObjectAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'custom_tags') + if (value = attributes[:'custom_tags']).is_a?(Array) + self.custom_tags = value + end + end + + if attributes.key?(:'env') + self.env = attributes[:'env'] + end + + if attributes.key?(:'finished_at') + self.finished_at = attributes[:'finished_at'] + end + + if attributes.key?(:'git') + self.git = attributes[:'git'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'started_at') + self.started_at = attributes[:'started_at'] + end + + if attributes.key?(:'team') + self.team = attributes[:'team'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + 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 @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 + def service=(service) + if service.nil? + fail ArgumentError, 'invalid value for "service", service cannot be nil.' + end + @service = service + 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 + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + custom_tags == o.custom_tags && + env == o.env && + finished_at == o.finished_at && + git == o.git && + service == o.service && + started_at == o.started_at && + team == o.team && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [custom_tags, env, finished_at, git, service, started_at, team, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dora_deployments_list_response.rb b/lib/datadog_api_client/v2/models/dora_deployments_list_response.rb new file mode 100644 index 000000000000..785902c3d546 --- /dev/null +++ b/lib/datadog_api_client/v2/models/dora_deployments_list_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for the list deployments endpoint. + class DORADeploymentsListResponse + include BaseGenericModel + + # The list of DORA deployment events. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DORADeploymentsListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dora_fetch_response.rb b/lib/datadog_api_client/v2/models/dora_failure_fetch_response.rb similarity index 92% rename from lib/datadog_api_client/v2/models/dora_fetch_response.rb rename to lib/datadog_api_client/v2/models/dora_failure_fetch_response.rb index 72f97bd00e9f..5fb7e9a1693c 100644 --- a/lib/datadog_api_client/v2/models/dora_fetch_response.rb +++ b/lib/datadog_api_client/v2/models/dora_failure_fetch_response.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Response for the DORA fetch endpoints. - class DORAFetchResponse + # Response for fetching a single failure event. + class DORAFailureFetchResponse include BaseGenericModel - # A DORA event. + # A DORA incident event. attr_accessor :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'DORAEvent' + :'data' => :'DORAIncidentObject' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DORAFetchResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DORAFailureFetchResponse` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/dora_list_response.rb b/lib/datadog_api_client/v2/models/dora_failures_list_response.rb similarity index 91% rename from lib/datadog_api_client/v2/models/dora_list_response.rb rename to lib/datadog_api_client/v2/models/dora_failures_list_response.rb index e4ae63e25eda..dba0b4db3ca0 100644 --- a/lib/datadog_api_client/v2/models/dora_list_response.rb +++ b/lib/datadog_api_client/v2/models/dora_failures_list_response.rb @@ -17,11 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Response for the DORA list endpoints. - class DORAListResponse + # Response for the list failures endpoint. + class DORAFailuresListResponse include BaseGenericModel - # The list of DORA events. + # The list of DORA incident events. attr_accessor :data attr_accessor :additional_properties @@ -38,7 +38,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'data' => :'Array' + :'data' => :'Array' } end @@ -47,7 +47,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DORAListResponse` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DORAFailuresListResponse` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/dora_event.rb b/lib/datadog_api_client/v2/models/dora_incident_object.rb similarity index 90% rename from lib/datadog_api_client/v2/models/dora_event.rb rename to lib/datadog_api_client/v2/models/dora_incident_object.rb index aa3b5d53c047..a3ab762d30c2 100644 --- a/lib/datadog_api_client/v2/models/dora_event.rb +++ b/lib/datadog_api_client/v2/models/dora_incident_object.rb @@ -17,17 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # A DORA event. - class DORAEvent + # A DORA incident event. + class DORAIncidentObject include BaseGenericModel - # The attributes of the event. + # The attributes of the incident event. attr_accessor :attributes - # The ID of the event. + # The ID of the incident event. attr_accessor :id - # The type of the event. + # JSON:API type for DORA failure events. attr_accessor :type attr_accessor :additional_properties @@ -46,9 +46,9 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'attributes' => :'Object', + :'attributes' => :'DORAIncidentObjectAttributes', :'id' => :'String', - :'type' => :'String' + :'type' => :'DORAFailureType' } end @@ -57,7 +57,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DORAEvent` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DORAIncidentObject` initialize method" end self.additional_properties = {} 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 new file mode 100644 index 000000000000..9a3294c34d22 --- /dev/null +++ b/lib/datadog_api_client/v2/models/dora_incident_object_attributes.rb @@ -0,0 +1,225 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of the incident event. + class DORAIncidentObjectAttributes + include BaseGenericModel + + # A list of user-defined tags. The tags must follow the `key:value` pattern. Up to 100 may be added per event. + attr_accessor :custom_tags + + # Environment name that was impacted by the incident. + attr_accessor :env + + # Unix timestamp when the incident finished. + attr_accessor :finished_at + + # Git info for DORA Metrics events. + attr_accessor :git + + # Incident name. + attr_accessor :name + + # Service names impacted by the incident. + attr_accessor :services + + # Incident severity. + attr_accessor :severity + + # Unix timestamp when the incident started. + attr_reader :started_at + + # Name of the team owning the services impacted. + attr_accessor :team + + # Version to correlate with APM Deployment Tracking. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_tags' => :'Array', + :'env' => :'String', + :'finished_at' => :'Integer', + :'git' => :'DORAGitInfo', + :'name' => :'String', + :'services' => :'Array', + :'severity' => :'String', + :'started_at' => :'Integer', + :'team' => :'String', + :'version' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'custom_tags', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DORAIncidentObjectAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'custom_tags') + if (value = attributes[:'custom_tags']).is_a?(Array) + self.custom_tags = value + end + end + + if attributes.key?(:'env') + self.env = attributes[:'env'] + end + + if attributes.key?(:'finished_at') + self.finished_at = attributes[:'finished_at'] + end + + if attributes.key?(:'git') + self.git = attributes[:'git'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'services') + if (value = attributes[:'services']).is_a?(Array) + self.services = value + end + end + + if attributes.key?(:'severity') + self.severity = attributes[:'severity'] + end + + if attributes.key?(:'started_at') + self.started_at = attributes[:'started_at'] + end + + if attributes.key?(:'team') + self.team = attributes[:'team'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + 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 + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + custom_tags == o.custom_tags && + env == o.env && + finished_at == o.finished_at && + git == o.git && + name == o.name && + services == o.services && + severity == o.severity && + started_at == o.started_at && + team == o.team && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [custom_tags, env, finished_at, git, name, services, severity, started_at, team, version, additional_properties].hash + end + end +end