diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 99b25f0ac87f..1779c0ae0914 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -13851,11 +13851,19 @@ components: tags: $ref: "#/components/schemas/TagsEventAttribute" type: object - CIAppPipelineEventFinishedPipeline: - description: Details of a finished pipeline. + CIAppPipelineEventFinishedJob: + description: Details of a finished CI job. properties: + dependencies: + description: A list of job IDs that this job depends on. + example: ["f7e6a006-a029-46c3-b0cc-742c9d7d363b", "c8a69849-3c3b-4721-8b33-3e8ec2df1ebe"] + items: + description: A list of job IDs. + type: string + nullable: true + type: array end: - description: Time when the pipeline run finished. It cannot be older than 18 hours in the past from the current time. The time format must be RFC3339. + description: Time when the job run finished. The time format must be RFC3339. example: "2023-05-31T15:30:00Z" format: date-time type: string @@ -13863,44 +13871,30 @@ components: $ref: "#/components/schemas/CIAppCIError" git: $ref: "#/components/schemas/CIAppGitInfo" - is_manual: - description: Whether or not the pipeline was triggered manually by the user. - example: false - nullable: true - type: boolean - is_resumed: - description: Whether or not the pipeline was resumed after being blocked. - example: false - nullable: true - type: boolean + id: + description: The UUID for the job. It has to be unique within each pipeline execution. + example: c865bad4-de82-44b8-ade7-2c987528eb54 + type: string level: - $ref: "#/components/schemas/CIAppPipelineEventPipelineLevel" + $ref: "#/components/schemas/CIAppPipelineEventJobLevel" metrics: $ref: "#/components/schemas/CIAppPipelineEventMetrics" name: - description: Name of the pipeline. All pipeline runs for the builds should have the same name. - example: Deploy to AWS + description: The name for the job. + example: test type: string node: $ref: "#/components/schemas/CIAppHostInfo" parameters: $ref: "#/components/schemas/CIAppPipelineEventParameters" - parent_pipeline: - $ref: "#/components/schemas/CIAppPipelineEventParentPipeline" - partial_retry: - description: |- - Whether or not the pipeline was a partial retry of a previous attempt. A partial retry is one - which only runs a subset of the original jobs. - example: false - type: boolean - pipeline_id: - description: |- - Any ID used in the provider to identify the pipeline run even if it is not unique across retries. - If the `pipeline_id` is unique, then both `unique_id` and `pipeline_id` can be set to the same value. - example: "#023" + pipeline_name: + description: The parent pipeline name. + example: Build + type: string + pipeline_unique_id: + description: The parent pipeline UUID. + example: "76b572af-a078-42b2-a08a-cc28f98b944f" type: string - previous_attempt: - $ref: "#/components/schemas/CIAppPipelineEventPreviousPipeline" queue_time: description: The queue time in milliseconds, if applicable. example: 1004 @@ -13908,38 +13902,48 @@ components: minimum: 0 nullable: true type: integer + stage_id: + description: The parent stage UUID (if applicable). + nullable: true + type: string + stage_name: + description: The parent stage name (if applicable). + nullable: true + type: string start: - description: Time when the pipeline run started (it should not include any queue time). The time format must be RFC3339. + description: |- + Time when the job run instance started (it should not include any queue time). + The time format must be RFC3339. example: "2023-05-31T15:30:00Z" format: date-time type: string status: - $ref: "#/components/schemas/CIAppPipelineEventPipelineStatus" + $ref: "#/components/schemas/CIAppPipelineEventJobStatus" tags: $ref: "#/components/schemas/CIAppPipelineEventTags" - unique_id: - description: |- - UUID of the pipeline run. The ID has to be unique across retries and pipelines, - including partial retries. - example: "3eacb6f3-ff04-4e10-8a9c-46e6d054024a" - type: string url: - description: The URL to look at the pipeline in the CI provider UI. - example: https://my-ci-provider.example/pipelines/my-pipeline/run/1 + description: The URL to look at the job in the CI provider UI. + example: https://ci-platform.com/job/your-job-name/build/123 type: string required: - level - - unique_id + - id - name - - url + - pipeline_unique_id + - pipeline_name - start - end - status - - partial_retry + - url type: object - CIAppPipelineEventInProgressPipeline: - description: Details of a running pipeline. + CIAppPipelineEventFinishedPipeline: + description: Details of a finished pipeline. properties: + end: + description: Time when the pipeline run finished. It cannot be older than 18 hours in the past from the current time. The time format must be RFC3339. + example: "2023-05-31T15:30:00Z" + format: date-time + type: string error: $ref: "#/components/schemas/CIAppCIError" git: @@ -13995,12 +13999,13 @@ components: format: date-time type: string status: - $ref: "#/components/schemas/CIAppPipelineEventPipelineInProgressStatus" + $ref: "#/components/schemas/CIAppPipelineEventPipelineStatus" tags: $ref: "#/components/schemas/CIAppPipelineEventTags" unique_id: description: |- - UUID of the pipeline run. The ID has to be the same as the finished pipeline. + UUID of the pipeline run. The ID has to be unique across retries and pipelines, + including partial retries. example: "3eacb6f3-ff04-4e10-8a9c-46e6d054024a" type: string url: @@ -14013,11 +14018,12 @@ components: - name - url - start + - end - status - partial_retry type: object - CIAppPipelineEventJob: - description: Details of a CI job. + CIAppPipelineEventInProgressJob: + description: Details of a running CI job. properties: dependencies: description: A list of job IDs that this job depends on. @@ -14027,17 +14033,12 @@ components: type: string nullable: true type: array - end: - description: Time when the job run finished. The time format must be RFC3339. - example: "2023-05-31T15:30:00Z" - format: date-time - type: string error: $ref: "#/components/schemas/CIAppCIError" git: $ref: "#/components/schemas/CIAppGitInfo" id: - description: The UUID for the job. It has to be unique within each pipeline execution. + description: The UUID for the job. It must match the ID of the corresponding finished job. example: c865bad4-de82-44b8-ade7-2c987528eb54 type: string level: @@ -14076,12 +14077,14 @@ components: nullable: true type: string start: - description: Time when the job run instance started (it should not include any queue time). The time format must be RFC3339. + description: |- + Time when the job run instance started (it should not include any queue time). + The time format must be RFC3339. example: "2023-05-31T15:30:00Z" format: date-time type: string status: - $ref: "#/components/schemas/CIAppPipelineEventJobStatus" + $ref: "#/components/schemas/CIAppPipelineEventJobInProgressStatus" tags: $ref: "#/components/schemas/CIAppPipelineEventTags" url: @@ -14095,10 +14098,99 @@ components: - pipeline_unique_id - pipeline_name - start - - end - status - url type: object + CIAppPipelineEventInProgressPipeline: + description: Details of a running pipeline. + properties: + error: + $ref: "#/components/schemas/CIAppCIError" + git: + $ref: "#/components/schemas/CIAppGitInfo" + is_manual: + description: Whether or not the pipeline was triggered manually by the user. + example: false + nullable: true + type: boolean + is_resumed: + description: Whether or not the pipeline was resumed after being blocked. + example: false + nullable: true + type: boolean + level: + $ref: "#/components/schemas/CIAppPipelineEventPipelineLevel" + metrics: + $ref: "#/components/schemas/CIAppPipelineEventMetrics" + name: + description: Name of the pipeline. All pipeline runs for the builds should have the same name. + example: Deploy to AWS + type: string + node: + $ref: "#/components/schemas/CIAppHostInfo" + parameters: + $ref: "#/components/schemas/CIAppPipelineEventParameters" + parent_pipeline: + $ref: "#/components/schemas/CIAppPipelineEventParentPipeline" + partial_retry: + description: |- + Whether or not the pipeline was a partial retry of a previous attempt. A partial retry is one + which only runs a subset of the original jobs. + example: false + type: boolean + pipeline_id: + description: |- + Any ID used in the provider to identify the pipeline run even if it is not unique across retries. + If the `pipeline_id` is unique, then both `unique_id` and `pipeline_id` can be set to the same value. + example: "#023" + type: string + previous_attempt: + $ref: "#/components/schemas/CIAppPipelineEventPreviousPipeline" + queue_time: + description: The queue time in milliseconds, if applicable. + example: 1004 + format: int64 + minimum: 0 + nullable: true + type: integer + start: + description: Time when the pipeline run started (it should not include any queue time). The time format must be RFC3339. + example: "2023-05-31T15:30:00Z" + format: date-time + type: string + status: + $ref: "#/components/schemas/CIAppPipelineEventPipelineInProgressStatus" + tags: + $ref: "#/components/schemas/CIAppPipelineEventTags" + unique_id: + description: |- + UUID of the pipeline run. The ID has to be the same as the finished pipeline. + example: "3eacb6f3-ff04-4e10-8a9c-46e6d054024a" + type: string + url: + description: The URL to look at the pipeline in the CI provider UI. + example: https://my-ci-provider.example/pipelines/my-pipeline/run/1 + type: string + required: + - level + - unique_id + - name + - url + - start + - status + - partial_retry + type: object + CIAppPipelineEventJob: + description: Details of a CI job. + oneOf: + - $ref: "#/components/schemas/CIAppPipelineEventFinishedJob" + - $ref: "#/components/schemas/CIAppPipelineEventInProgressJob" + CIAppPipelineEventJobInProgressStatus: + description: The in-progress status of the job. + enum: ["running"] + example: running + type: string + x-enum-varnames: ["RUNNING"] CIAppPipelineEventJobLevel: default: job description: Used to distinguish between pipelines, stages, jobs, and steps. diff --git a/cassettes/features/v2/ci_visibility_pipelines/Send-running-job-event-returns-Request-accepted-for-processing-response.frozen b/cassettes/features/v2/ci_visibility_pipelines/Send-running-job-event-returns-Request-accepted-for-processing-response.frozen new file mode 100644 index 000000000000..450ad249ce0d --- /dev/null +++ b/cassettes/features/v2/ci_visibility_pipelines/Send-running-job-event-returns-Request-accepted-for-processing-response.frozen @@ -0,0 +1 @@ +2026-06-23T12:16:50.217Z \ No newline at end of file diff --git a/cassettes/features/v2/ci_visibility_pipelines/Send-running-job-event-returns-Request-accepted-for-processing-response.yml b/cassettes/features/v2/ci_visibility_pipelines/Send-running-job-event-returns-Request-accepted-for-processing-response.yml new file mode 100644 index 000000000000..d20b5dfbae25 --- /dev/null +++ b/cassettes/features/v2/ci_visibility_pipelines/Send-running-job-event-returns-Request-accepted-for-processing-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 23 Jun 2026 12:16:50 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"resource":{"id":"cf9456de-8b9e-4c27-aa79-27b1e78c1a33","level":"job","name":"Build + image","pipeline_name":"Deploy to AWS","pipeline_unique_id":"3eacb6f3-ff04-4e10-8a9c-46e6d054024a","start":"2026-06-23T12:14:50.217Z","status":"running","url":"https://my-ci-provider.example/jobs/my-jobs/run/1"}},"type":"cipipeline_resource_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/ci/pipeline + response: + body: + encoding: UTF-8 + string: '{"data":null}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 202 + message: Accepted +recorded_with: VCR 6.0.0 diff --git a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.rb b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.rb index c079a135968a..d3b9b590f326 100644 --- a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.rb +++ b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.rb @@ -6,7 +6,7 @@ body = DatadogAPIClient::V2::CIAppCreatePipelineEventRequest.new({ data: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestData.new({ attributes: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestAttributes.new({ - resource: DatadogAPIClient::V2::CIAppPipelineEventJob.new({ + resource: DatadogAPIClient::V2::CIAppPipelineEventFinishedJob.new({ level: DatadogAPIClient::V2::CIAppPipelineEventJobLevel::JOB, id: "cf9456de-8b9e-4c27-aa79-27b1e78c1a33", name: "Build image", diff --git a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_4007074677.rb b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_4007074677.rb new file mode 100644 index 000000000000..3f4d139fc978 --- /dev/null +++ b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_4007074677.rb @@ -0,0 +1,23 @@ +# Send running job event returns "Request accepted for processing" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CIVisibilityPipelinesAPI.new + +body = DatadogAPIClient::V2::CIAppCreatePipelineEventRequest.new({ + data: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestData.new({ + attributes: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestAttributes.new({ + resource: DatadogAPIClient::V2::CIAppPipelineEventInProgressJob.new({ + level: DatadogAPIClient::V2::CIAppPipelineEventJobLevel::JOB, + id: "cf9456de-8b9e-4c27-aa79-27b1e78c1a33", + name: "Build image", + pipeline_unique_id: "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", + pipeline_name: "Deploy to AWS", + start: (Time.now + -120), + status: DatadogAPIClient::V2::CIAppPipelineEventJobInProgressStatus::RUNNING, + url: "https://my-ci-provider.example/jobs/my-jobs/run/1", + }), + }), + type: DatadogAPIClient::V2::CIAppCreatePipelineEventRequestDataType::CIPIPELINE_RESOURCE_REQUEST, + }), +}) +p api_instance.create_ci_app_pipeline_event(body) diff --git a/features/v2/ci_visibility_pipelines.feature b/features/v2/ci_visibility_pipelines.feature index 3c52a30f4b70..c81cb9ec82e8 100644 --- a/features/v2/ci_visibility_pipelines.feature +++ b/features/v2/ci_visibility_pipelines.feature @@ -122,6 +122,13 @@ Feature: CI Visibility Pipelines When the request is sent Then the response status is 202 Request accepted for processing + @skip-java @skip-python @skip-typescript @team:DataDog/ci-app-backend + Scenario: Send running job event returns "Request accepted for processing" response + Given new "CreateCIAppPipelineEvent" request + And body with value {"data": {"attributes": {"resource": {"level": "job", "id": "cf9456de-8b9e-4c27-aa79-27b1e78c1a33", "name": "Build image", "pipeline_unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", "pipeline_name": "Deploy to AWS", "start": "{{ timeISO('now - 120s') }}", "status": "running", "url": "https://my-ci-provider.example/jobs/my-jobs/run/1"}}, "type": "cipipeline_resource_request"}} + When the request is sent + Then the response status is 202 Request accepted for processing + @skip-java @skip-python @skip-typescript @team:DataDog/ci-app-backend Scenario: Send running pipeline event returns "Request accepted for processing" response Given new "CreateCIAppPipelineEvent" request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 1912c3a1f419..41e898e7aa74 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2009,9 +2009,12 @@ def overrides "v2.ci_app_host_info" => "CIAppHostInfo", "v2.ci_app_pipeline_event" => "CIAppPipelineEvent", "v2.ci_app_pipeline_event_attributes" => "CIAppPipelineEventAttributes", + "v2.ci_app_pipeline_event_finished_job" => "CIAppPipelineEventFinishedJob", "v2.ci_app_pipeline_event_finished_pipeline" => "CIAppPipelineEventFinishedPipeline", + "v2.ci_app_pipeline_event_in_progress_job" => "CIAppPipelineEventInProgressJob", "v2.ci_app_pipeline_event_in_progress_pipeline" => "CIAppPipelineEventInProgressPipeline", "v2.ci_app_pipeline_event_job" => "CIAppPipelineEventJob", + "v2.ci_app_pipeline_event_job_in_progress_status" => "CIAppPipelineEventJobInProgressStatus", "v2.ci_app_pipeline_event_job_level" => "CIAppPipelineEventJobLevel", "v2.ci_app_pipeline_event_job_status" => "CIAppPipelineEventJobStatus", "v2.ci_app_pipeline_event_parent_pipeline" => "CIAppPipelineEventParentPipeline", diff --git a/lib/datadog_api_client/v2/models/ci_app_pipeline_event_finished_job.rb b/lib/datadog_api_client/v2/models/ci_app_pipeline_event_finished_job.rb new file mode 100644 index 000000000000..cbd9fd9bcbfc --- /dev/null +++ b/lib/datadog_api_client/v2/models/ci_app_pipeline_event_finished_job.rb @@ -0,0 +1,427 @@ +=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 + # Details of a finished CI job. + class CIAppPipelineEventFinishedJob + include BaseGenericModel + + # A list of job IDs that this job depends on. + attr_accessor :dependencies + + # Time when the job run finished. The time format must be RFC3339. + attr_reader :_end + + # Contains information of the CI error. + attr_accessor :error + + # If pipelines are triggered due to actions to a Git repository, then all payloads must contain this. + # Note that either `tag` or `branch` has to be provided, but not both. + attr_accessor :git + + # The UUID for the job. It has to be unique within each pipeline execution. + attr_reader :id + + # Used to distinguish between pipelines, stages, jobs, and steps. + attr_reader :level + + # A list of user-defined metrics. The metrics must follow the `key:value` pattern and the value must be numeric. + attr_accessor :metrics + + # The name for the job. + attr_reader :name + + # Contains information of the host running the pipeline, stage, job, or step. + attr_accessor :node + + # A map of key-value parameters or environment variables that were defined for the pipeline. + attr_accessor :parameters + + # The parent pipeline name. + attr_reader :pipeline_name + + # The parent pipeline UUID. + attr_reader :pipeline_unique_id + + # The queue time in milliseconds, if applicable. + attr_reader :queue_time + + # The parent stage UUID (if applicable). + attr_accessor :stage_id + + # The parent stage name (if applicable). + attr_accessor :stage_name + + # Time when the job run instance started (it should not include any queue time). + # The time format must be RFC3339. + attr_reader :start + + # The final status of the job. + attr_reader :status + + # A list of user-defined tags. The tags must follow the `key:value` pattern. + attr_accessor :tags + + # The URL to look at the job in the CI provider UI. + attr_reader :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dependencies' => :'dependencies', + :'_end' => :'end', + :'error' => :'error', + :'git' => :'git', + :'id' => :'id', + :'level' => :'level', + :'metrics' => :'metrics', + :'name' => :'name', + :'node' => :'node', + :'parameters' => :'parameters', + :'pipeline_name' => :'pipeline_name', + :'pipeline_unique_id' => :'pipeline_unique_id', + :'queue_time' => :'queue_time', + :'stage_id' => :'stage_id', + :'stage_name' => :'stage_name', + :'start' => :'start', + :'status' => :'status', + :'tags' => :'tags', + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dependencies' => :'Array', + :'_end' => :'Time', + :'error' => :'CIAppCIError', + :'git' => :'CIAppGitInfo', + :'id' => :'String', + :'level' => :'CIAppPipelineEventJobLevel', + :'metrics' => :'Array', + :'name' => :'String', + :'node' => :'CIAppHostInfo', + :'parameters' => :'Hash', + :'pipeline_name' => :'String', + :'pipeline_unique_id' => :'String', + :'queue_time' => :'Integer', + :'stage_id' => :'String', + :'stage_name' => :'String', + :'start' => :'Time', + :'status' => :'CIAppPipelineEventJobStatus', + :'tags' => :'Array', + :'url' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'dependencies', + :'error', + :'git', + :'metrics', + :'node', + :'parameters', + :'queue_time', + :'stage_id', + :'stage_name', + :'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::CIAppPipelineEventFinishedJob` 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?(:'dependencies') + if (value = attributes[:'dependencies']).is_a?(Array) + self.dependencies = value + end + end + + if attributes.key?(:'_end') + self._end = attributes[:'_end'] + end + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'git') + self.git = attributes[:'git'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'level') + self.level = attributes[:'level'] + end + + if attributes.key?(:'metrics') + if (value = attributes[:'metrics']).is_a?(Array) + self.metrics = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'node') + self.node = attributes[:'node'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + + if attributes.key?(:'pipeline_name') + self.pipeline_name = attributes[:'pipeline_name'] + end + + if attributes.key?(:'pipeline_unique_id') + self.pipeline_unique_id = attributes[:'pipeline_unique_id'] + end + + if attributes.key?(:'queue_time') + self.queue_time = attributes[:'queue_time'] + end + + if attributes.key?(:'stage_id') + self.stage_id = attributes[:'stage_id'] + end + + if attributes.key?(:'stage_name') + self.stage_name = attributes[:'stage_name'] + end + + if attributes.key?(:'start') + self.start = attributes[:'start'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + 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 @_end.nil? + return false if @id.nil? + return false if @level.nil? + return false if @name.nil? + return false if @pipeline_name.nil? + return false if @pipeline_unique_id.nil? + return false if !@queue_time.nil? && @queue_time < 0 + return false if @start.nil? + return false if @status.nil? + return false if @url.nil? + true + end + + # Custom attribute writer method with validation + # @param _end [Object] Object to be assigned + # @!visibility private + def _end=(_end) + if _end.nil? + fail ArgumentError, 'invalid value for "_end", _end cannot be nil.' + end + @_end = _end + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param level [Object] Object to be assigned + # @!visibility private + def level=(level) + if level.nil? + fail ArgumentError, 'invalid value for "level", level cannot be nil.' + end + @level = level + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param pipeline_name [Object] Object to be assigned + # @!visibility private + def pipeline_name=(pipeline_name) + if pipeline_name.nil? + fail ArgumentError, 'invalid value for "pipeline_name", pipeline_name cannot be nil.' + end + @pipeline_name = pipeline_name + end + + # Custom attribute writer method with validation + # @param pipeline_unique_id [Object] Object to be assigned + # @!visibility private + def pipeline_unique_id=(pipeline_unique_id) + if pipeline_unique_id.nil? + fail ArgumentError, 'invalid value for "pipeline_unique_id", pipeline_unique_id cannot be nil.' + end + @pipeline_unique_id = pipeline_unique_id + end + + # Custom attribute writer method with validation + # @param queue_time [Object] Object to be assigned + # @!visibility private + def queue_time=(queue_time) + if !queue_time.nil? && queue_time < 0 + fail ArgumentError, 'invalid value for "queue_time", must be greater than or equal to 0.' + end + @queue_time = queue_time + end + + # Custom attribute writer method with validation + # @param start [Object] Object to be assigned + # @!visibility private + def start=(start) + if start.nil? + fail ArgumentError, 'invalid value for "start", start cannot be nil.' + end + @start = start + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param url [Object] Object to be assigned + # @!visibility private + def url=(url) + if url.nil? + fail ArgumentError, 'invalid value for "url", url cannot be nil.' + end + @url = url + 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 && + dependencies == o.dependencies && + _end == o._end && + error == o.error && + git == o.git && + id == o.id && + level == o.level && + metrics == o.metrics && + name == o.name && + node == o.node && + parameters == o.parameters && + pipeline_name == o.pipeline_name && + pipeline_unique_id == o.pipeline_unique_id && + queue_time == o.queue_time && + stage_id == o.stage_id && + stage_name == o.stage_name && + start == o.start && + status == o.status && + tags == o.tags && + url == o.url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dependencies, _end, error, git, id, level, metrics, name, node, parameters, pipeline_name, pipeline_unique_id, queue_time, stage_id, stage_name, start, status, tags, url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ci_app_pipeline_event_in_progress_job.rb b/lib/datadog_api_client/v2/models/ci_app_pipeline_event_in_progress_job.rb new file mode 100644 index 000000000000..3ac4b2f4ace4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ci_app_pipeline_event_in_progress_job.rb @@ -0,0 +1,406 @@ +=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 + # Details of a running CI job. + class CIAppPipelineEventInProgressJob + include BaseGenericModel + + # A list of job IDs that this job depends on. + attr_accessor :dependencies + + # Contains information of the CI error. + attr_accessor :error + + # If pipelines are triggered due to actions to a Git repository, then all payloads must contain this. + # Note that either `tag` or `branch` has to be provided, but not both. + attr_accessor :git + + # The UUID for the job. It must match the ID of the corresponding finished job. + attr_reader :id + + # Used to distinguish between pipelines, stages, jobs, and steps. + attr_reader :level + + # A list of user-defined metrics. The metrics must follow the `key:value` pattern and the value must be numeric. + attr_accessor :metrics + + # The name for the job. + attr_reader :name + + # Contains information of the host running the pipeline, stage, job, or step. + attr_accessor :node + + # A map of key-value parameters or environment variables that were defined for the pipeline. + attr_accessor :parameters + + # The parent pipeline name. + attr_reader :pipeline_name + + # The parent pipeline UUID. + attr_reader :pipeline_unique_id + + # The queue time in milliseconds, if applicable. + attr_reader :queue_time + + # The parent stage UUID (if applicable). + attr_accessor :stage_id + + # The parent stage name (if applicable). + attr_accessor :stage_name + + # Time when the job run instance started (it should not include any queue time). + # The time format must be RFC3339. + attr_reader :start + + # The in-progress status of the job. + attr_reader :status + + # A list of user-defined tags. The tags must follow the `key:value` pattern. + attr_accessor :tags + + # The URL to look at the job in the CI provider UI. + attr_reader :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dependencies' => :'dependencies', + :'error' => :'error', + :'git' => :'git', + :'id' => :'id', + :'level' => :'level', + :'metrics' => :'metrics', + :'name' => :'name', + :'node' => :'node', + :'parameters' => :'parameters', + :'pipeline_name' => :'pipeline_name', + :'pipeline_unique_id' => :'pipeline_unique_id', + :'queue_time' => :'queue_time', + :'stage_id' => :'stage_id', + :'stage_name' => :'stage_name', + :'start' => :'start', + :'status' => :'status', + :'tags' => :'tags', + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dependencies' => :'Array', + :'error' => :'CIAppCIError', + :'git' => :'CIAppGitInfo', + :'id' => :'String', + :'level' => :'CIAppPipelineEventJobLevel', + :'metrics' => :'Array', + :'name' => :'String', + :'node' => :'CIAppHostInfo', + :'parameters' => :'Hash', + :'pipeline_name' => :'String', + :'pipeline_unique_id' => :'String', + :'queue_time' => :'Integer', + :'stage_id' => :'String', + :'stage_name' => :'String', + :'start' => :'Time', + :'status' => :'CIAppPipelineEventJobInProgressStatus', + :'tags' => :'Array', + :'url' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'dependencies', + :'error', + :'git', + :'metrics', + :'node', + :'parameters', + :'queue_time', + :'stage_id', + :'stage_name', + :'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::CIAppPipelineEventInProgressJob` 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?(:'dependencies') + if (value = attributes[:'dependencies']).is_a?(Array) + self.dependencies = value + end + end + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + + if attributes.key?(:'git') + self.git = attributes[:'git'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'level') + self.level = attributes[:'level'] + end + + if attributes.key?(:'metrics') + if (value = attributes[:'metrics']).is_a?(Array) + self.metrics = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'node') + self.node = attributes[:'node'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + + if attributes.key?(:'pipeline_name') + self.pipeline_name = attributes[:'pipeline_name'] + end + + if attributes.key?(:'pipeline_unique_id') + self.pipeline_unique_id = attributes[:'pipeline_unique_id'] + end + + if attributes.key?(:'queue_time') + self.queue_time = attributes[:'queue_time'] + end + + if attributes.key?(:'stage_id') + self.stage_id = attributes[:'stage_id'] + end + + if attributes.key?(:'stage_name') + self.stage_name = attributes[:'stage_name'] + end + + if attributes.key?(:'start') + self.start = attributes[:'start'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + 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 @id.nil? + return false if @level.nil? + return false if @name.nil? + return false if @pipeline_name.nil? + return false if @pipeline_unique_id.nil? + return false if !@queue_time.nil? && @queue_time < 0 + return false if @start.nil? + return false if @status.nil? + return false if @url.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param level [Object] Object to be assigned + # @!visibility private + def level=(level) + if level.nil? + fail ArgumentError, 'invalid value for "level", level cannot be nil.' + end + @level = level + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param pipeline_name [Object] Object to be assigned + # @!visibility private + def pipeline_name=(pipeline_name) + if pipeline_name.nil? + fail ArgumentError, 'invalid value for "pipeline_name", pipeline_name cannot be nil.' + end + @pipeline_name = pipeline_name + end + + # Custom attribute writer method with validation + # @param pipeline_unique_id [Object] Object to be assigned + # @!visibility private + def pipeline_unique_id=(pipeline_unique_id) + if pipeline_unique_id.nil? + fail ArgumentError, 'invalid value for "pipeline_unique_id", pipeline_unique_id cannot be nil.' + end + @pipeline_unique_id = pipeline_unique_id + end + + # Custom attribute writer method with validation + # @param queue_time [Object] Object to be assigned + # @!visibility private + def queue_time=(queue_time) + if !queue_time.nil? && queue_time < 0 + fail ArgumentError, 'invalid value for "queue_time", must be greater than or equal to 0.' + end + @queue_time = queue_time + end + + # Custom attribute writer method with validation + # @param start [Object] Object to be assigned + # @!visibility private + def start=(start) + if start.nil? + fail ArgumentError, 'invalid value for "start", start cannot be nil.' + end + @start = start + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param url [Object] Object to be assigned + # @!visibility private + def url=(url) + if url.nil? + fail ArgumentError, 'invalid value for "url", url cannot be nil.' + end + @url = url + 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 && + dependencies == o.dependencies && + error == o.error && + git == o.git && + id == o.id && + level == o.level && + metrics == o.metrics && + name == o.name && + node == o.node && + parameters == o.parameters && + pipeline_name == o.pipeline_name && + pipeline_unique_id == o.pipeline_unique_id && + queue_time == o.queue_time && + stage_id == o.stage_id && + stage_name == o.stage_name && + start == o.start && + status == o.status && + tags == o.tags && + url == o.url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dependencies, error, git, id, level, metrics, name, node, parameters, pipeline_name, pipeline_unique_id, queue_time, stage_id, stage_name, start, status, tags, url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ci_app_pipeline_event_job.rb b/lib/datadog_api_client/v2/models/ci_app_pipeline_event_job.rb index dbde68c66b2b..4024b40931fa 100644 --- a/lib/datadog_api_client/v2/models/ci_app_pipeline_event_job.rb +++ b/lib/datadog_api_client/v2/models/ci_app_pipeline_event_job.rb @@ -18,409 +18,46 @@ module DatadogAPIClient::V2 # Details of a CI job. - class CIAppPipelineEventJob - include BaseGenericModel - - # A list of job IDs that this job depends on. - attr_accessor :dependencies - - # Time when the job run finished. The time format must be RFC3339. - attr_reader :_end - - # Contains information of the CI error. - attr_accessor :error - - # If pipelines are triggered due to actions to a Git repository, then all payloads must contain this. - # Note that either `tag` or `branch` has to be provided, but not both. - attr_accessor :git - - # The UUID for the job. It has to be unique within each pipeline execution. - attr_reader :id - - # Used to distinguish between pipelines, stages, jobs, and steps. - attr_reader :level - - # A list of user-defined metrics. The metrics must follow the `key:value` pattern and the value must be numeric. - attr_accessor :metrics - - # The name for the job. - attr_reader :name - - # Contains information of the host running the pipeline, stage, job, or step. - attr_accessor :node - - # A map of key-value parameters or environment variables that were defined for the pipeline. - attr_accessor :parameters - - # The parent pipeline name. - attr_reader :pipeline_name - - # The parent pipeline UUID. - attr_reader :pipeline_unique_id - - # The queue time in milliseconds, if applicable. - attr_reader :queue_time - - # The parent stage UUID (if applicable). - attr_accessor :stage_id - - # The parent stage name (if applicable). - attr_accessor :stage_name - - # Time when the job run instance started (it should not include any queue time). The time format must be RFC3339. - attr_reader :start - - # The final status of the job. - attr_reader :status - - # A list of user-defined tags. The tags must follow the `key:value` pattern. - attr_accessor :tags - - # The URL to look at the job in the CI provider UI. - attr_reader :url - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'dependencies' => :'dependencies', - :'_end' => :'end', - :'error' => :'error', - :'git' => :'git', - :'id' => :'id', - :'level' => :'level', - :'metrics' => :'metrics', - :'name' => :'name', - :'node' => :'node', - :'parameters' => :'parameters', - :'pipeline_name' => :'pipeline_name', - :'pipeline_unique_id' => :'pipeline_unique_id', - :'queue_time' => :'queue_time', - :'stage_id' => :'stage_id', - :'stage_name' => :'stage_name', - :'start' => :'start', - :'status' => :'status', - :'tags' => :'tags', - :'url' => :'url' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'dependencies' => :'Array', - :'_end' => :'Time', - :'error' => :'CIAppCIError', - :'git' => :'CIAppGitInfo', - :'id' => :'String', - :'level' => :'CIAppPipelineEventJobLevel', - :'metrics' => :'Array', - :'name' => :'String', - :'node' => :'CIAppHostInfo', - :'parameters' => :'Hash', - :'pipeline_name' => :'String', - :'pipeline_unique_id' => :'String', - :'queue_time' => :'Integer', - :'stage_id' => :'String', - :'stage_name' => :'String', - :'start' => :'Time', - :'status' => :'CIAppPipelineEventJobStatus', - :'tags' => :'Array', - :'url' => :'String' - } - end - - # List of attributes with nullable: true - # @!visibility private - def self.openapi_nullable - Set.new([ - :'dependencies', - :'error', - :'git', - :'metrics', - :'node', - :'parameters', - :'queue_time', - :'stage_id', - :'stage_name', - :'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::CIAppPipelineEventJob` 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?(:'dependencies') - if (value = attributes[:'dependencies']).is_a?(Array) - self.dependencies = value - end - end - - if attributes.key?(:'_end') - self._end = attributes[:'_end'] - end - - if attributes.key?(:'error') - self.error = attributes[:'error'] - end - - if attributes.key?(:'git') - self.git = attributes[:'git'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'level') - self.level = attributes[:'level'] - end - - if attributes.key?(:'metrics') - if (value = attributes[:'metrics']).is_a?(Array) - self.metrics = value + module CIAppPipelineEventJob + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'CIAppPipelineEventFinishedJob', + :'CIAppPipelineEventInProgressJob' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end end - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'node') - self.node = attributes[:'node'] - end - - if attributes.key?(:'parameters') - self.parameters = attributes[:'parameters'] - end - - if attributes.key?(:'pipeline_name') - self.pipeline_name = attributes[:'pipeline_name'] - end - - if attributes.key?(:'pipeline_unique_id') - self.pipeline_unique_id = attributes[:'pipeline_unique_id'] - end - if attributes.key?(:'queue_time') - self.queue_time = attributes[:'queue_time'] - end - - if attributes.key?(:'stage_id') - self.stage_id = attributes[:'stage_id'] - end - - if attributes.key?(:'stage_name') - self.stage_name = attributes[:'stage_name'] - end - - if attributes.key?(:'start') - self.start = attributes[:'start'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'tags') - if (value = attributes[:'tags']).is_a?(Array) - self.tags = value - end - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - 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 @_end.nil? - return false if @id.nil? - return false if @level.nil? - return false if @name.nil? - return false if @pipeline_name.nil? - return false if @pipeline_unique_id.nil? - return false if !@queue_time.nil? && @queue_time < 0 - return false if @start.nil? - return false if @status.nil? - return false if @url.nil? - true - end - - # Custom attribute writer method with validation - # @param _end [Object] Object to be assigned - # @!visibility private - def _end=(_end) - if _end.nil? - fail ArgumentError, 'invalid value for "_end", _end cannot be nil.' - end - @_end = _end - end - - # Custom attribute writer method with validation - # @param id [Object] Object to be assigned - # @!visibility private - def id=(id) - if id.nil? - fail ArgumentError, 'invalid value for "id", id cannot be nil.' - end - @id = id - end - - # Custom attribute writer method with validation - # @param level [Object] Object to be assigned - # @!visibility private - def level=(level) - if level.nil? - fail ArgumentError, 'invalid value for "level", level cannot be nil.' - end - @level = level - end - - # Custom attribute writer method with validation - # @param name [Object] Object to be assigned - # @!visibility private - def name=(name) - if name.nil? - fail ArgumentError, 'invalid value for "name", name cannot be nil.' - end - @name = name - end - - # Custom attribute writer method with validation - # @param pipeline_name [Object] Object to be assigned - # @!visibility private - def pipeline_name=(pipeline_name) - if pipeline_name.nil? - fail ArgumentError, 'invalid value for "pipeline_name", pipeline_name cannot be nil.' - end - @pipeline_name = pipeline_name - end - - # Custom attribute writer method with validation - # @param pipeline_unique_id [Object] Object to be assigned - # @!visibility private - def pipeline_unique_id=(pipeline_unique_id) - if pipeline_unique_id.nil? - fail ArgumentError, 'invalid value for "pipeline_unique_id", pipeline_unique_id cannot be nil.' - end - @pipeline_unique_id = pipeline_unique_id - end - - # Custom attribute writer method with validation - # @param queue_time [Object] Object to be assigned - # @!visibility private - def queue_time=(queue_time) - if !queue_time.nil? && queue_time < 0 - fail ArgumentError, 'invalid value for "queue_time", must be greater than or equal to 0.' - end - @queue_time = queue_time - end - - # Custom attribute writer method with validation - # @param start [Object] Object to be assigned - # @!visibility private - def start=(start) - if start.nil? - fail ArgumentError, 'invalid value for "start", start cannot be nil.' - end - @start = start - end - - # Custom attribute writer method with validation - # @param status [Object] Object to be assigned - # @!visibility private - def status=(status) - if status.nil? - fail ArgumentError, 'invalid value for "status", status cannot be nil.' - end - @status = status - end - - # Custom attribute writer method with validation - # @param url [Object] Object to be assigned - # @!visibility private - def url=(url) - if url.nil? - fail ArgumentError, 'invalid value for "url", url cannot be nil.' - end - @url = url - 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}")) + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) 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 && - dependencies == o.dependencies && - _end == o._end && - error == o.error && - git == o.git && - id == o.id && - level == o.level && - metrics == o.metrics && - name == o.name && - node == o.node && - parameters == o.parameters && - pipeline_name == o.pipeline_name && - pipeline_unique_id == o.pipeline_unique_id && - queue_time == o.queue_time && - stage_id == o.stage_id && - stage_name == o.stage_name && - start == o.start && - status == o.status && - tags == o.tags && - url == o.url && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [dependencies, _end, error, git, id, level, metrics, name, node, parameters, pipeline_name, pipeline_unique_id, queue_time, stage_id, stage_name, start, status, tags, url, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/ci_app_pipeline_event_job_in_progress_status.rb b/lib/datadog_api_client/v2/models/ci_app_pipeline_event_job_in_progress_status.rb new file mode 100644 index 000000000000..2b20c83115a5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ci_app_pipeline_event_job_in_progress_status.rb @@ -0,0 +1,26 @@ +=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 in-progress status of the job. + class CIAppPipelineEventJobInProgressStatus + include BaseEnumModel + + RUNNING = "running".freeze + end +end