From a95005d5ba54de5ff8a18a414833a79372945dd1 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 10 Dec 2024 19:52:05 +0000 Subject: [PATCH] Regenerate client from commit 5da0cd35 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 279 +++-- .../CreateCIAppPipelineEvent.java | 34 +- .../CreateCIAppPipelineEvent_129899466.java | 8 +- .../CreateCIAppPipelineEvent_2341150096.java | 60 + .../CIAppPipelineEventFinishedPipeline.java | 867 ++++++++++++++ .../CIAppPipelineEventInProgressPipeline.java | 838 +++++++++++++ .../v2/model/CIAppPipelineEventPipeline.java | 1042 ++++------------- ...PipelineEventPipelineInProgressStatus.java | 62 + ...ipelines_events_returns_OK_response.freeze | 2 +- ..._pipelines_events_returns_OK_response.json | 2 +- ...ipelines_events_returns_OK_response.freeze | 2 +- ..._pipelines_events_returns_OK_response.json | 8 +- ...ipelines_events_returns_OK_response.freeze | 2 +- ..._pipelines_events_returns_OK_response.json | 2 +- ...st_accepted_for_processing_response.freeze | 2 +- ...uest_accepted_for_processing_response.json | 4 +- ...st_accepted_for_processing_response.freeze | 2 +- ...uest_accepted_for_processing_response.json | 4 +- ...st_accepted_for_processing_response.freeze | 1 + ...uest_accepted_for_processing_response.json | 32 + .../v2/api/ci_visibility_pipelines.feature | 13 +- 22 files changed, 2337 insertions(+), 937 deletions(-) create mode 100644 examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_2341150096.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventFinishedPipeline.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventInProgressPipeline.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventPipelineInProgressStatus.java create mode 100644 src/test/resources/cassettes/features/v2/Send_running_pipeline_event_returns_Request_accepted_for_processing_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Send_running_pipeline_event_returns_Request_accepted_for_processing_response.json diff --git a/.apigentools-info b/.apigentools-info index f9248e4eb99..8c1dbb00915 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-10 17:29:07.595482", - "spec_repo_commit": "f35e3502" + "regenerated": "2024-12-10 19:50:18.230257", + "spec_repo_commit": "5da0cd35" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-10 17:29:07.616601", - "spec_repo_commit": "f35e3502" + "regenerated": "2024-12-10 19:50:18.249357", + "spec_repo_commit": "5da0cd35" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index cb2fda6b018..a21342f7d18 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3259,6 +3259,183 @@ components: tags: $ref: '#/components/schemas/TagsEventAttribute' type: object + 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: + $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/CIAppPipelineEventPipelineStatus' + 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 + type: string + required: + - level + - unique_id + - name + - url + - start + - end + - status + - partial_retry + 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. properties: @@ -3407,97 +3584,17 @@ components: type: object CIAppPipelineEventPipeline: description: Details of the top level pipeline, build, or workflow of your CI. - 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: - $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/CIAppPipelineEventPipelineStatus' - 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 - type: string - required: - - level - - unique_id - - name - - url - - start - - end - - status - - partial_retry - type: object + oneOf: + - $ref: '#/components/schemas/CIAppPipelineEventFinishedPipeline' + - $ref: '#/components/schemas/CIAppPipelineEventInProgressPipeline' + CIAppPipelineEventPipelineInProgressStatus: + description: The in progress status of the pipeline. + enum: + - running + example: running + type: string + x-enum-varnames: + - RUNNING CIAppPipelineEventPipelineLevel: default: pipeline description: Used to distinguish between pipelines, stages, jobs, and steps. diff --git a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.java b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.java index af55d17fd1b..d208e112ab5 100644 --- a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.java +++ b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.java @@ -8,6 +8,7 @@ import com.datadog.api.client.v2.model.CIAppCreatePipelineEventRequestData; import com.datadog.api.client.v2.model.CIAppCreatePipelineEventRequestDataType; import com.datadog.api.client.v2.model.CIAppGitInfo; +import com.datadog.api.client.v2.model.CIAppPipelineEventFinishedPipeline; import com.datadog.api.client.v2.model.CIAppPipelineEventPipeline; import com.datadog.api.client.v2.model.CIAppPipelineEventPipelineLevel; import com.datadog.api.client.v2.model.CIAppPipelineEventPipelineStatus; @@ -26,22 +27,23 @@ public static void main(String[] args) { new CIAppCreatePipelineEventRequestAttributes() .resource( new CIAppCreatePipelineEventRequestAttributesResource( - new CIAppPipelineEventPipeline() - .end(OffsetDateTime.now().plusSeconds(-30)) - .level(CIAppPipelineEventPipelineLevel.PIPELINE) - .name("Deploy to AWS") - .partialRetry(false) - .start(OffsetDateTime.now().plusSeconds(-120)) - .status(CIAppPipelineEventPipelineStatus.SUCCESS) - .uniqueId("3eacb6f3-ff04-4e10-8a9c-46e6d054024a") - .url( - "https://my-ci-provider.example/pipelines/my-pipeline/run/1") - .git( - new CIAppGitInfo() - .repositoryUrl( - "https://github.com/DataDog/datadog-agent") - .sha("7f263865994b76066c4612fd1965215e7dcb4cd2") - .authorEmail("john.doe@email.com"))))) + new CIAppPipelineEventPipeline( + new CIAppPipelineEventFinishedPipeline() + .level(CIAppPipelineEventPipelineLevel.PIPELINE) + .uniqueId("3eacb6f3-ff04-4e10-8a9c-46e6d054024a") + .name("Deploy to AWS") + .url( + "https://my-ci-provider.example/pipelines/my-pipeline/run/1") + .start(OffsetDateTime.now().plusSeconds(-120)) + .end(OffsetDateTime.now().plusSeconds(-30)) + .status(CIAppPipelineEventPipelineStatus.SUCCESS) + .partialRetry(false) + .git( + new CIAppGitInfo() + .repositoryUrl( + "https://github.com/DataDog/datadog-agent") + .sha("7f263865994b76066c4612fd1965215e7dcb4cd2") + .authorEmail("john.doe@email.com")))))) .type(CIAppCreatePipelineEventRequestDataType.CIPIPELINE_RESOURCE_REQUEST)); try { diff --git a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.java b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.java index f7d7889aeeb..29c8ed928c8 100644 --- a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.java +++ b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.java @@ -26,14 +26,14 @@ public static void main(String[] args) { .resource( new CIAppCreatePipelineEventRequestAttributesResource( new CIAppPipelineEventJob() - .end(OffsetDateTime.now().plusSeconds(-30)) .level(CIAppPipelineEventJobLevel.JOB) - .name("Build image") - .start(OffsetDateTime.now().plusSeconds(-120)) - .status(CIAppPipelineEventJobStatus.ERROR) .id("cf9456de-8b9e-4c27-aa79-27b1e78c1a33") + .name("Build image") .pipelineUniqueId("3eacb6f3-ff04-4e10-8a9c-46e6d054024a") .pipelineName("Deploy to AWS") + .start(OffsetDateTime.now().plusSeconds(-120)) + .end(OffsetDateTime.now().plusSeconds(-30)) + .status(CIAppPipelineEventJobStatus.ERROR) .url("https://my-ci-provider.example/jobs/my-jobs/run/1")))) .type(CIAppCreatePipelineEventRequestDataType.CIPIPELINE_RESOURCE_REQUEST)); diff --git a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_2341150096.java b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_2341150096.java new file mode 100644 index 00000000000..f7423da2028 --- /dev/null +++ b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_2341150096.java @@ -0,0 +1,60 @@ +// Send running pipeline event returns "Request accepted for processing" response +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CiVisibilityPipelinesApi; +import com.datadog.api.client.v2.model.CIAppCreatePipelineEventRequest; +import com.datadog.api.client.v2.model.CIAppCreatePipelineEventRequestAttributes; +import com.datadog.api.client.v2.model.CIAppCreatePipelineEventRequestAttributesResource; +import com.datadog.api.client.v2.model.CIAppCreatePipelineEventRequestData; +import com.datadog.api.client.v2.model.CIAppCreatePipelineEventRequestDataType; +import com.datadog.api.client.v2.model.CIAppGitInfo; +import com.datadog.api.client.v2.model.CIAppPipelineEventInProgressPipeline; +import com.datadog.api.client.v2.model.CIAppPipelineEventPipeline; +import com.datadog.api.client.v2.model.CIAppPipelineEventPipelineInProgressStatus; +import com.datadog.api.client.v2.model.CIAppPipelineEventPipelineLevel; +import java.time.OffsetDateTime; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CiVisibilityPipelinesApi apiInstance = new CiVisibilityPipelinesApi(defaultClient); + + CIAppCreatePipelineEventRequest body = + new CIAppCreatePipelineEventRequest() + .data( + new CIAppCreatePipelineEventRequestData() + .attributes( + new CIAppCreatePipelineEventRequestAttributes() + .resource( + new CIAppCreatePipelineEventRequestAttributesResource( + new CIAppPipelineEventPipeline( + new CIAppPipelineEventInProgressPipeline() + .level(CIAppPipelineEventPipelineLevel.PIPELINE) + .uniqueId("3eacb6f3-ff04-4e10-8a9c-46e6d054024a") + .name("Deploy to AWS") + .url( + "https://my-ci-provider.example/pipelines/my-pipeline/run/1") + .start(OffsetDateTime.now().plusSeconds(-120)) + .status( + CIAppPipelineEventPipelineInProgressStatus.RUNNING) + .partialRetry(false) + .git( + new CIAppGitInfo() + .repositoryUrl( + "https://github.com/DataDog/datadog-agent") + .sha("7f263865994b76066c4612fd1965215e7dcb4cd2") + .authorEmail("john.doe@email.com")))))) + .type(CIAppCreatePipelineEventRequestDataType.CIPIPELINE_RESOURCE_REQUEST)); + + try { + apiInstance.createCIAppPipelineEvent(body); + } catch (ApiException e) { + System.err.println( + "Exception when calling CiVisibilityPipelinesApi#createCIAppPipelineEvent"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventFinishedPipeline.java b/src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventFinishedPipeline.java new file mode 100644 index 00000000000..746dff634c6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventFinishedPipeline.java @@ -0,0 +1,867 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Details of a finished pipeline. */ +@JsonPropertyOrder({ + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_END, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_ERROR, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_GIT, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_IS_MANUAL, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_IS_RESUMED, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_LEVEL, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_METRICS, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_NAME, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_NODE, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_PARAMETERS, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_PARENT_PIPELINE, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_PARTIAL_RETRY, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_PIPELINE_ID, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_PREVIOUS_ATTEMPT, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_QUEUE_TIME, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_START, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_STATUS, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_TAGS, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_UNIQUE_ID, + CIAppPipelineEventFinishedPipeline.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CIAppPipelineEventFinishedPipeline { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_END = "end"; + private OffsetDateTime end; + + public static final String JSON_PROPERTY_ERROR = "error"; + private JsonNullable error = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_GIT = "git"; + private JsonNullable git = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_MANUAL = "is_manual"; + private JsonNullable isManual = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_RESUMED = "is_resumed"; + private JsonNullable isResumed = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_LEVEL = "level"; + private CIAppPipelineEventPipelineLevel level = CIAppPipelineEventPipelineLevel.PIPELINE; + + public static final String JSON_PROPERTY_METRICS = "metrics"; + private JsonNullable> metrics = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_NODE = "node"; + private JsonNullable node = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PARAMETERS = "parameters"; + private JsonNullable> parameters = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_PARENT_PIPELINE = "parent_pipeline"; + private JsonNullable parentPipeline = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PARTIAL_RETRY = "partial_retry"; + private Boolean partialRetry; + + public static final String JSON_PROPERTY_PIPELINE_ID = "pipeline_id"; + private String pipelineId; + + public static final String JSON_PROPERTY_PREVIOUS_ATTEMPT = "previous_attempt"; + private JsonNullable previousAttempt = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_QUEUE_TIME = "queue_time"; + private JsonNullable queueTime = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_START = "start"; + private OffsetDateTime start; + + public static final String JSON_PROPERTY_STATUS = "status"; + private CIAppPipelineEventPipelineStatus status; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private JsonNullable> tags = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_UNIQUE_ID = "unique_id"; + private String uniqueId; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public CIAppPipelineEventFinishedPipeline() {} + + @JsonCreator + public CIAppPipelineEventFinishedPipeline( + @JsonProperty(required = true, value = JSON_PROPERTY_END) OffsetDateTime end, + @JsonProperty(required = true, value = JSON_PROPERTY_LEVEL) + CIAppPipelineEventPipelineLevel level, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_PARTIAL_RETRY) Boolean partialRetry, + @JsonProperty(required = true, value = JSON_PROPERTY_START) OffsetDateTime start, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) + CIAppPipelineEventPipelineStatus status, + @JsonProperty(required = true, value = JSON_PROPERTY_UNIQUE_ID) String uniqueId, + @JsonProperty(required = true, value = JSON_PROPERTY_URL) String url) { + this.end = end; + this.level = level; + this.unparsed |= !level.isValid(); + this.name = name; + this.partialRetry = partialRetry; + this.start = start; + this.status = status; + this.unparsed |= !status.isValid(); + this.uniqueId = uniqueId; + this.url = url; + } + + public CIAppPipelineEventFinishedPipeline end(OffsetDateTime end) { + this.end = end; + return this; + } + + /** + * 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. + * + * @return end + */ + @JsonProperty(JSON_PROPERTY_END) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getEnd() { + return end; + } + + public void setEnd(OffsetDateTime end) { + this.end = end; + } + + public CIAppPipelineEventFinishedPipeline error(CIAppCIError error) { + this.error = JsonNullable.of(error); + return this; + } + + /** + * Contains information of the CI error. + * + * @return error + */ + @jakarta.annotation.Nullable + @JsonIgnore + public CIAppCIError getError() { + return error.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getError_JsonNullable() { + return error; + } + + @JsonProperty(JSON_PROPERTY_ERROR) + public void setError_JsonNullable(JsonNullable error) { + this.error = error; + } + + public void setError(CIAppCIError error) { + this.error = JsonNullable.of(error); + } + + public CIAppPipelineEventFinishedPipeline git(CIAppGitInfo git) { + this.git = JsonNullable.of(git); + return this; + } + + /** + * 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. + * + * @return git + */ + @jakarta.annotation.Nullable + @JsonIgnore + public CIAppGitInfo getGit() { + return git.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_GIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getGit_JsonNullable() { + return git; + } + + @JsonProperty(JSON_PROPERTY_GIT) + public void setGit_JsonNullable(JsonNullable git) { + this.git = git; + } + + public void setGit(CIAppGitInfo git) { + this.git = JsonNullable.of(git); + } + + public CIAppPipelineEventFinishedPipeline isManual(Boolean isManual) { + this.isManual = JsonNullable.of(isManual); + return this; + } + + /** + * Whether or not the pipeline was triggered manually by the user. + * + * @return isManual + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsManual() { + return isManual.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_MANUAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsManual_JsonNullable() { + return isManual; + } + + @JsonProperty(JSON_PROPERTY_IS_MANUAL) + public void setIsManual_JsonNullable(JsonNullable isManual) { + this.isManual = isManual; + } + + public void setIsManual(Boolean isManual) { + this.isManual = JsonNullable.of(isManual); + } + + public CIAppPipelineEventFinishedPipeline isResumed(Boolean isResumed) { + this.isResumed = JsonNullable.of(isResumed); + return this; + } + + /** + * Whether or not the pipeline was resumed after being blocked. + * + * @return isResumed + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsResumed() { + return isResumed.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_RESUMED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsResumed_JsonNullable() { + return isResumed; + } + + @JsonProperty(JSON_PROPERTY_IS_RESUMED) + public void setIsResumed_JsonNullable(JsonNullable isResumed) { + this.isResumed = isResumed; + } + + public void setIsResumed(Boolean isResumed) { + this.isResumed = JsonNullable.of(isResumed); + } + + public CIAppPipelineEventFinishedPipeline level(CIAppPipelineEventPipelineLevel level) { + this.level = level; + this.unparsed |= !level.isValid(); + return this; + } + + /** + * Used to distinguish between pipelines, stages, jobs, and steps. + * + * @return level + */ + @JsonProperty(JSON_PROPERTY_LEVEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CIAppPipelineEventPipelineLevel getLevel() { + return level; + } + + public void setLevel(CIAppPipelineEventPipelineLevel level) { + if (!level.isValid()) { + this.unparsed = true; + } + this.level = level; + } + + public CIAppPipelineEventFinishedPipeline metrics(List metrics) { + this.metrics = JsonNullable.>of(metrics); + return this; + } + + public CIAppPipelineEventFinishedPipeline addMetricsItem(String metricsItem) { + if (this.metrics == null || !this.metrics.isPresent()) { + this.metrics = JsonNullable.>of(new ArrayList<>()); + } + try { + this.metrics.get().add(metricsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * A list of user-defined metrics. The metrics must follow the key:value pattern and + * the value must be numeric. + * + * @return metrics + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getMetrics() { + return metrics.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_METRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getMetrics_JsonNullable() { + return metrics; + } + + @JsonProperty(JSON_PROPERTY_METRICS) + public void setMetrics_JsonNullable(JsonNullable> metrics) { + this.metrics = metrics; + } + + public void setMetrics(List metrics) { + this.metrics = JsonNullable.>of(metrics); + } + + public CIAppPipelineEventFinishedPipeline name(String name) { + this.name = name; + return this; + } + + /** + * Name of the pipeline. All pipeline runs for the builds should have the same name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CIAppPipelineEventFinishedPipeline node(CIAppHostInfo node) { + this.node = JsonNullable.of(node); + return this; + } + + /** + * Contains information of the host running the pipeline, stage, job, or step. + * + * @return node + */ + @jakarta.annotation.Nullable + @JsonIgnore + public CIAppHostInfo getNode() { + return node.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNode_JsonNullable() { + return node; + } + + @JsonProperty(JSON_PROPERTY_NODE) + public void setNode_JsonNullable(JsonNullable node) { + this.node = node; + } + + public void setNode(CIAppHostInfo node) { + this.node = JsonNullable.of(node); + } + + public CIAppPipelineEventFinishedPipeline parameters(Map parameters) { + this.parameters = JsonNullable.>of(parameters); + return this; + } + + public CIAppPipelineEventFinishedPipeline putParametersItem(String key, String parametersItem) { + if (this.parameters == null || !this.parameters.isPresent()) { + this.parameters = JsonNullable.>of(new HashMap<>()); + } + try { + this.parameters.get().put(key, parametersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * A map of key-value parameters or environment variables that were defined for the pipeline. + * + * @return parameters + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Map getParameters() { + return parameters.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getParameters_JsonNullable() { + return parameters; + } + + @JsonProperty(JSON_PROPERTY_PARAMETERS) + public void setParameters_JsonNullable(JsonNullable> parameters) { + this.parameters = parameters; + } + + public void setParameters(Map parameters) { + this.parameters = JsonNullable.>of(parameters); + } + + public CIAppPipelineEventFinishedPipeline parentPipeline( + CIAppPipelineEventParentPipeline parentPipeline) { + this.parentPipeline = JsonNullable.of(parentPipeline); + return this; + } + + /** + * If the pipeline is triggered as child of another pipeline, this should contain the details of + * the parent pipeline. + * + * @return parentPipeline + */ + @jakarta.annotation.Nullable + @JsonIgnore + public CIAppPipelineEventParentPipeline getParentPipeline() { + return parentPipeline.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PARENT_PIPELINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getParentPipeline_JsonNullable() { + return parentPipeline; + } + + @JsonProperty(JSON_PROPERTY_PARENT_PIPELINE) + public void setParentPipeline_JsonNullable( + JsonNullable parentPipeline) { + this.parentPipeline = parentPipeline; + } + + public void setParentPipeline(CIAppPipelineEventParentPipeline parentPipeline) { + this.parentPipeline = JsonNullable.of(parentPipeline); + } + + public CIAppPipelineEventFinishedPipeline partialRetry(Boolean partialRetry) { + this.partialRetry = partialRetry; + return this; + } + + /** + * 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. + * + * @return partialRetry + */ + @JsonProperty(JSON_PROPERTY_PARTIAL_RETRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getPartialRetry() { + return partialRetry; + } + + public void setPartialRetry(Boolean partialRetry) { + this.partialRetry = partialRetry; + } + + public CIAppPipelineEventFinishedPipeline pipelineId(String pipelineId) { + this.pipelineId = pipelineId; + return this; + } + + /** + * 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. + * + * @return pipelineId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PIPELINE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPipelineId() { + return pipelineId; + } + + public void setPipelineId(String pipelineId) { + this.pipelineId = pipelineId; + } + + public CIAppPipelineEventFinishedPipeline previousAttempt( + CIAppPipelineEventPreviousPipeline previousAttempt) { + this.previousAttempt = JsonNullable.of(previousAttempt); + return this; + } + + /** + * If the pipeline is a retry, this should contain the details of the previous attempt. + * + * @return previousAttempt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public CIAppPipelineEventPreviousPipeline getPreviousAttempt() { + return previousAttempt.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREVIOUS_ATTEMPT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPreviousAttempt_JsonNullable() { + return previousAttempt; + } + + @JsonProperty(JSON_PROPERTY_PREVIOUS_ATTEMPT) + public void setPreviousAttempt_JsonNullable( + JsonNullable previousAttempt) { + this.previousAttempt = previousAttempt; + } + + public void setPreviousAttempt(CIAppPipelineEventPreviousPipeline previousAttempt) { + this.previousAttempt = JsonNullable.of(previousAttempt); + } + + public CIAppPipelineEventFinishedPipeline queueTime(Long queueTime) { + this.queueTime = JsonNullable.of(queueTime); + return this; + } + + /** + * The queue time in milliseconds, if applicable. minimum: 0 + * + * @return queueTime + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getQueueTime() { + return queueTime.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_QUEUE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getQueueTime_JsonNullable() { + return queueTime; + } + + @JsonProperty(JSON_PROPERTY_QUEUE_TIME) + public void setQueueTime_JsonNullable(JsonNullable queueTime) { + this.queueTime = queueTime; + } + + public void setQueueTime(Long queueTime) { + this.queueTime = JsonNullable.of(queueTime); + } + + public CIAppPipelineEventFinishedPipeline start(OffsetDateTime start) { + this.start = start; + return this; + } + + /** + * Time when the pipeline run started (it should not include any queue time). The time format must + * be RFC3339. + * + * @return start + */ + @JsonProperty(JSON_PROPERTY_START) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getStart() { + return start; + } + + public void setStart(OffsetDateTime start) { + this.start = start; + } + + public CIAppPipelineEventFinishedPipeline status(CIAppPipelineEventPipelineStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The final status of the pipeline. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CIAppPipelineEventPipelineStatus getStatus() { + return status; + } + + public void setStatus(CIAppPipelineEventPipelineStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public CIAppPipelineEventFinishedPipeline tags(List tags) { + this.tags = JsonNullable.>of(tags); + return this; + } + + public CIAppPipelineEventFinishedPipeline addTagsItem(String tagsItem) { + if (this.tags == null || !this.tags.isPresent()) { + this.tags = JsonNullable.>of(new ArrayList<>()); + } + try { + this.tags.get().add(tagsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * A list of user-defined tags. The tags must follow the key:value pattern. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getTags() { + return tags.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getTags_JsonNullable() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + public void setTags_JsonNullable(JsonNullable> tags) { + this.tags = tags; + } + + public void setTags(List tags) { + this.tags = JsonNullable.>of(tags); + } + + public CIAppPipelineEventFinishedPipeline uniqueId(String uniqueId) { + this.uniqueId = uniqueId; + return this; + } + + /** + * UUID of the pipeline run. The ID has to be unique across retries and pipelines, including + * partial retries. + * + * @return uniqueId + */ + @JsonProperty(JSON_PROPERTY_UNIQUE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUniqueId() { + return uniqueId; + } + + public void setUniqueId(String uniqueId) { + this.uniqueId = uniqueId; + } + + public CIAppPipelineEventFinishedPipeline url(String url) { + this.url = url; + return this; + } + + /** + * The URL to look at the pipeline in the CI provider UI. + * + * @return url + */ + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CIAppPipelineEventFinishedPipeline + */ + @JsonAnySetter + public CIAppPipelineEventFinishedPipeline putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CIAppPipelineEventFinishedPipeline object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CIAppPipelineEventFinishedPipeline ciAppPipelineEventFinishedPipeline = + (CIAppPipelineEventFinishedPipeline) o; + return Objects.equals(this.end, ciAppPipelineEventFinishedPipeline.end) + && Objects.equals(this.error, ciAppPipelineEventFinishedPipeline.error) + && Objects.equals(this.git, ciAppPipelineEventFinishedPipeline.git) + && Objects.equals(this.isManual, ciAppPipelineEventFinishedPipeline.isManual) + && Objects.equals(this.isResumed, ciAppPipelineEventFinishedPipeline.isResumed) + && Objects.equals(this.level, ciAppPipelineEventFinishedPipeline.level) + && Objects.equals(this.metrics, ciAppPipelineEventFinishedPipeline.metrics) + && Objects.equals(this.name, ciAppPipelineEventFinishedPipeline.name) + && Objects.equals(this.node, ciAppPipelineEventFinishedPipeline.node) + && Objects.equals(this.parameters, ciAppPipelineEventFinishedPipeline.parameters) + && Objects.equals(this.parentPipeline, ciAppPipelineEventFinishedPipeline.parentPipeline) + && Objects.equals(this.partialRetry, ciAppPipelineEventFinishedPipeline.partialRetry) + && Objects.equals(this.pipelineId, ciAppPipelineEventFinishedPipeline.pipelineId) + && Objects.equals(this.previousAttempt, ciAppPipelineEventFinishedPipeline.previousAttempt) + && Objects.equals(this.queueTime, ciAppPipelineEventFinishedPipeline.queueTime) + && Objects.equals(this.start, ciAppPipelineEventFinishedPipeline.start) + && Objects.equals(this.status, ciAppPipelineEventFinishedPipeline.status) + && Objects.equals(this.tags, ciAppPipelineEventFinishedPipeline.tags) + && Objects.equals(this.uniqueId, ciAppPipelineEventFinishedPipeline.uniqueId) + && Objects.equals(this.url, ciAppPipelineEventFinishedPipeline.url) + && Objects.equals( + this.additionalProperties, ciAppPipelineEventFinishedPipeline.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + end, + error, + git, + isManual, + isResumed, + level, + metrics, + name, + node, + parameters, + parentPipeline, + partialRetry, + pipelineId, + previousAttempt, + queueTime, + start, + status, + tags, + uniqueId, + url, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CIAppPipelineEventFinishedPipeline {\n"); + sb.append(" end: ").append(toIndentedString(end)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" git: ").append(toIndentedString(git)).append("\n"); + sb.append(" isManual: ").append(toIndentedString(isManual)).append("\n"); + sb.append(" isResumed: ").append(toIndentedString(isResumed)).append("\n"); + sb.append(" level: ").append(toIndentedString(level)).append("\n"); + sb.append(" metrics: ").append(toIndentedString(metrics)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" node: ").append(toIndentedString(node)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append(" parentPipeline: ").append(toIndentedString(parentPipeline)).append("\n"); + sb.append(" partialRetry: ").append(toIndentedString(partialRetry)).append("\n"); + sb.append(" pipelineId: ").append(toIndentedString(pipelineId)).append("\n"); + sb.append(" previousAttempt: ").append(toIndentedString(previousAttempt)).append("\n"); + sb.append(" queueTime: ").append(toIndentedString(queueTime)).append("\n"); + sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" uniqueId: ").append(toIndentedString(uniqueId)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventInProgressPipeline.java b/src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventInProgressPipeline.java new file mode 100644 index 00000000000..4876e408367 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventInProgressPipeline.java @@ -0,0 +1,838 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Details of a running pipeline. */ +@JsonPropertyOrder({ + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_ERROR, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_GIT, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_IS_MANUAL, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_IS_RESUMED, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_LEVEL, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_METRICS, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_NAME, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_NODE, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_PARAMETERS, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_PARENT_PIPELINE, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_PARTIAL_RETRY, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_PIPELINE_ID, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_PREVIOUS_ATTEMPT, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_QUEUE_TIME, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_START, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_STATUS, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_TAGS, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_UNIQUE_ID, + CIAppPipelineEventInProgressPipeline.JSON_PROPERTY_URL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CIAppPipelineEventInProgressPipeline { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERROR = "error"; + private JsonNullable error = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_GIT = "git"; + private JsonNullable git = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_MANUAL = "is_manual"; + private JsonNullable isManual = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_RESUMED = "is_resumed"; + private JsonNullable isResumed = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_LEVEL = "level"; + private CIAppPipelineEventPipelineLevel level = CIAppPipelineEventPipelineLevel.PIPELINE; + + public static final String JSON_PROPERTY_METRICS = "metrics"; + private JsonNullable> metrics = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_NODE = "node"; + private JsonNullable node = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PARAMETERS = "parameters"; + private JsonNullable> parameters = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_PARENT_PIPELINE = "parent_pipeline"; + private JsonNullable parentPipeline = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PARTIAL_RETRY = "partial_retry"; + private Boolean partialRetry; + + public static final String JSON_PROPERTY_PIPELINE_ID = "pipeline_id"; + private String pipelineId; + + public static final String JSON_PROPERTY_PREVIOUS_ATTEMPT = "previous_attempt"; + private JsonNullable previousAttempt = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_QUEUE_TIME = "queue_time"; + private JsonNullable queueTime = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_START = "start"; + private OffsetDateTime start; + + public static final String JSON_PROPERTY_STATUS = "status"; + private CIAppPipelineEventPipelineInProgressStatus status; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private JsonNullable> tags = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_UNIQUE_ID = "unique_id"; + private String uniqueId; + + public static final String JSON_PROPERTY_URL = "url"; + private String url; + + public CIAppPipelineEventInProgressPipeline() {} + + @JsonCreator + public CIAppPipelineEventInProgressPipeline( + @JsonProperty(required = true, value = JSON_PROPERTY_LEVEL) + CIAppPipelineEventPipelineLevel level, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_PARTIAL_RETRY) Boolean partialRetry, + @JsonProperty(required = true, value = JSON_PROPERTY_START) OffsetDateTime start, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) + CIAppPipelineEventPipelineInProgressStatus status, + @JsonProperty(required = true, value = JSON_PROPERTY_UNIQUE_ID) String uniqueId, + @JsonProperty(required = true, value = JSON_PROPERTY_URL) String url) { + this.level = level; + this.unparsed |= !level.isValid(); + this.name = name; + this.partialRetry = partialRetry; + this.start = start; + this.status = status; + this.unparsed |= !status.isValid(); + this.uniqueId = uniqueId; + this.url = url; + } + + public CIAppPipelineEventInProgressPipeline error(CIAppCIError error) { + this.error = JsonNullable.of(error); + return this; + } + + /** + * Contains information of the CI error. + * + * @return error + */ + @jakarta.annotation.Nullable + @JsonIgnore + public CIAppCIError getError() { + return error.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getError_JsonNullable() { + return error; + } + + @JsonProperty(JSON_PROPERTY_ERROR) + public void setError_JsonNullable(JsonNullable error) { + this.error = error; + } + + public void setError(CIAppCIError error) { + this.error = JsonNullable.of(error); + } + + public CIAppPipelineEventInProgressPipeline git(CIAppGitInfo git) { + this.git = JsonNullable.of(git); + return this; + } + + /** + * 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. + * + * @return git + */ + @jakarta.annotation.Nullable + @JsonIgnore + public CIAppGitInfo getGit() { + return git.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_GIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getGit_JsonNullable() { + return git; + } + + @JsonProperty(JSON_PROPERTY_GIT) + public void setGit_JsonNullable(JsonNullable git) { + this.git = git; + } + + public void setGit(CIAppGitInfo git) { + this.git = JsonNullable.of(git); + } + + public CIAppPipelineEventInProgressPipeline isManual(Boolean isManual) { + this.isManual = JsonNullable.of(isManual); + return this; + } + + /** + * Whether or not the pipeline was triggered manually by the user. + * + * @return isManual + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsManual() { + return isManual.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_MANUAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsManual_JsonNullable() { + return isManual; + } + + @JsonProperty(JSON_PROPERTY_IS_MANUAL) + public void setIsManual_JsonNullable(JsonNullable isManual) { + this.isManual = isManual; + } + + public void setIsManual(Boolean isManual) { + this.isManual = JsonNullable.of(isManual); + } + + public CIAppPipelineEventInProgressPipeline isResumed(Boolean isResumed) { + this.isResumed = JsonNullable.of(isResumed); + return this; + } + + /** + * Whether or not the pipeline was resumed after being blocked. + * + * @return isResumed + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsResumed() { + return isResumed.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_RESUMED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsResumed_JsonNullable() { + return isResumed; + } + + @JsonProperty(JSON_PROPERTY_IS_RESUMED) + public void setIsResumed_JsonNullable(JsonNullable isResumed) { + this.isResumed = isResumed; + } + + public void setIsResumed(Boolean isResumed) { + this.isResumed = JsonNullable.of(isResumed); + } + + public CIAppPipelineEventInProgressPipeline level(CIAppPipelineEventPipelineLevel level) { + this.level = level; + this.unparsed |= !level.isValid(); + return this; + } + + /** + * Used to distinguish between pipelines, stages, jobs, and steps. + * + * @return level + */ + @JsonProperty(JSON_PROPERTY_LEVEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CIAppPipelineEventPipelineLevel getLevel() { + return level; + } + + public void setLevel(CIAppPipelineEventPipelineLevel level) { + if (!level.isValid()) { + this.unparsed = true; + } + this.level = level; + } + + public CIAppPipelineEventInProgressPipeline metrics(List metrics) { + this.metrics = JsonNullable.>of(metrics); + return this; + } + + public CIAppPipelineEventInProgressPipeline addMetricsItem(String metricsItem) { + if (this.metrics == null || !this.metrics.isPresent()) { + this.metrics = JsonNullable.>of(new ArrayList<>()); + } + try { + this.metrics.get().add(metricsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * A list of user-defined metrics. The metrics must follow the key:value pattern and + * the value must be numeric. + * + * @return metrics + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getMetrics() { + return metrics.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_METRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getMetrics_JsonNullable() { + return metrics; + } + + @JsonProperty(JSON_PROPERTY_METRICS) + public void setMetrics_JsonNullable(JsonNullable> metrics) { + this.metrics = metrics; + } + + public void setMetrics(List metrics) { + this.metrics = JsonNullable.>of(metrics); + } + + public CIAppPipelineEventInProgressPipeline name(String name) { + this.name = name; + return this; + } + + /** + * Name of the pipeline. All pipeline runs for the builds should have the same name. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CIAppPipelineEventInProgressPipeline node(CIAppHostInfo node) { + this.node = JsonNullable.of(node); + return this; + } + + /** + * Contains information of the host running the pipeline, stage, job, or step. + * + * @return node + */ + @jakarta.annotation.Nullable + @JsonIgnore + public CIAppHostInfo getNode() { + return node.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNode_JsonNullable() { + return node; + } + + @JsonProperty(JSON_PROPERTY_NODE) + public void setNode_JsonNullable(JsonNullable node) { + this.node = node; + } + + public void setNode(CIAppHostInfo node) { + this.node = JsonNullable.of(node); + } + + public CIAppPipelineEventInProgressPipeline parameters(Map parameters) { + this.parameters = JsonNullable.>of(parameters); + return this; + } + + public CIAppPipelineEventInProgressPipeline putParametersItem(String key, String parametersItem) { + if (this.parameters == null || !this.parameters.isPresent()) { + this.parameters = JsonNullable.>of(new HashMap<>()); + } + try { + this.parameters.get().put(key, parametersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * A map of key-value parameters or environment variables that were defined for the pipeline. + * + * @return parameters + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Map getParameters() { + return parameters.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PARAMETERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getParameters_JsonNullable() { + return parameters; + } + + @JsonProperty(JSON_PROPERTY_PARAMETERS) + public void setParameters_JsonNullable(JsonNullable> parameters) { + this.parameters = parameters; + } + + public void setParameters(Map parameters) { + this.parameters = JsonNullable.>of(parameters); + } + + public CIAppPipelineEventInProgressPipeline parentPipeline( + CIAppPipelineEventParentPipeline parentPipeline) { + this.parentPipeline = JsonNullable.of(parentPipeline); + return this; + } + + /** + * If the pipeline is triggered as child of another pipeline, this should contain the details of + * the parent pipeline. + * + * @return parentPipeline + */ + @jakarta.annotation.Nullable + @JsonIgnore + public CIAppPipelineEventParentPipeline getParentPipeline() { + return parentPipeline.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PARENT_PIPELINE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getParentPipeline_JsonNullable() { + return parentPipeline; + } + + @JsonProperty(JSON_PROPERTY_PARENT_PIPELINE) + public void setParentPipeline_JsonNullable( + JsonNullable parentPipeline) { + this.parentPipeline = parentPipeline; + } + + public void setParentPipeline(CIAppPipelineEventParentPipeline parentPipeline) { + this.parentPipeline = JsonNullable.of(parentPipeline); + } + + public CIAppPipelineEventInProgressPipeline partialRetry(Boolean partialRetry) { + this.partialRetry = partialRetry; + return this; + } + + /** + * 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. + * + * @return partialRetry + */ + @JsonProperty(JSON_PROPERTY_PARTIAL_RETRY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getPartialRetry() { + return partialRetry; + } + + public void setPartialRetry(Boolean partialRetry) { + this.partialRetry = partialRetry; + } + + public CIAppPipelineEventInProgressPipeline pipelineId(String pipelineId) { + this.pipelineId = pipelineId; + return this; + } + + /** + * 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. + * + * @return pipelineId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PIPELINE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPipelineId() { + return pipelineId; + } + + public void setPipelineId(String pipelineId) { + this.pipelineId = pipelineId; + } + + public CIAppPipelineEventInProgressPipeline previousAttempt( + CIAppPipelineEventPreviousPipeline previousAttempt) { + this.previousAttempt = JsonNullable.of(previousAttempt); + return this; + } + + /** + * If the pipeline is a retry, this should contain the details of the previous attempt. + * + * @return previousAttempt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public CIAppPipelineEventPreviousPipeline getPreviousAttempt() { + return previousAttempt.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREVIOUS_ATTEMPT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPreviousAttempt_JsonNullable() { + return previousAttempt; + } + + @JsonProperty(JSON_PROPERTY_PREVIOUS_ATTEMPT) + public void setPreviousAttempt_JsonNullable( + JsonNullable previousAttempt) { + this.previousAttempt = previousAttempt; + } + + public void setPreviousAttempt(CIAppPipelineEventPreviousPipeline previousAttempt) { + this.previousAttempt = JsonNullable.of(previousAttempt); + } + + public CIAppPipelineEventInProgressPipeline queueTime(Long queueTime) { + this.queueTime = JsonNullable.of(queueTime); + return this; + } + + /** + * The queue time in milliseconds, if applicable. minimum: 0 + * + * @return queueTime + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getQueueTime() { + return queueTime.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_QUEUE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getQueueTime_JsonNullable() { + return queueTime; + } + + @JsonProperty(JSON_PROPERTY_QUEUE_TIME) + public void setQueueTime_JsonNullable(JsonNullable queueTime) { + this.queueTime = queueTime; + } + + public void setQueueTime(Long queueTime) { + this.queueTime = JsonNullable.of(queueTime); + } + + public CIAppPipelineEventInProgressPipeline start(OffsetDateTime start) { + this.start = start; + return this; + } + + /** + * Time when the pipeline run started (it should not include any queue time). The time format must + * be RFC3339. + * + * @return start + */ + @JsonProperty(JSON_PROPERTY_START) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getStart() { + return start; + } + + public void setStart(OffsetDateTime start) { + this.start = start; + } + + public CIAppPipelineEventInProgressPipeline status( + CIAppPipelineEventPipelineInProgressStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * The in progress status of the pipeline. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CIAppPipelineEventPipelineInProgressStatus getStatus() { + return status; + } + + public void setStatus(CIAppPipelineEventPipelineInProgressStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public CIAppPipelineEventInProgressPipeline tags(List tags) { + this.tags = JsonNullable.>of(tags); + return this; + } + + public CIAppPipelineEventInProgressPipeline addTagsItem(String tagsItem) { + if (this.tags == null || !this.tags.isPresent()) { + this.tags = JsonNullable.>of(new ArrayList<>()); + } + try { + this.tags.get().add(tagsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * A list of user-defined tags. The tags must follow the key:value pattern. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getTags() { + return tags.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getTags_JsonNullable() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + public void setTags_JsonNullable(JsonNullable> tags) { + this.tags = tags; + } + + public void setTags(List tags) { + this.tags = JsonNullable.>of(tags); + } + + public CIAppPipelineEventInProgressPipeline uniqueId(String uniqueId) { + this.uniqueId = uniqueId; + return this; + } + + /** + * UUID of the pipeline run. The ID has to be the same as the finished pipeline. + * + * @return uniqueId + */ + @JsonProperty(JSON_PROPERTY_UNIQUE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUniqueId() { + return uniqueId; + } + + public void setUniqueId(String uniqueId) { + this.uniqueId = uniqueId; + } + + public CIAppPipelineEventInProgressPipeline url(String url) { + this.url = url; + return this; + } + + /** + * The URL to look at the pipeline in the CI provider UI. + * + * @return url + */ + @JsonProperty(JSON_PROPERTY_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CIAppPipelineEventInProgressPipeline + */ + @JsonAnySetter + public CIAppPipelineEventInProgressPipeline putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CIAppPipelineEventInProgressPipeline object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CIAppPipelineEventInProgressPipeline ciAppPipelineEventInProgressPipeline = + (CIAppPipelineEventInProgressPipeline) o; + return Objects.equals(this.error, ciAppPipelineEventInProgressPipeline.error) + && Objects.equals(this.git, ciAppPipelineEventInProgressPipeline.git) + && Objects.equals(this.isManual, ciAppPipelineEventInProgressPipeline.isManual) + && Objects.equals(this.isResumed, ciAppPipelineEventInProgressPipeline.isResumed) + && Objects.equals(this.level, ciAppPipelineEventInProgressPipeline.level) + && Objects.equals(this.metrics, ciAppPipelineEventInProgressPipeline.metrics) + && Objects.equals(this.name, ciAppPipelineEventInProgressPipeline.name) + && Objects.equals(this.node, ciAppPipelineEventInProgressPipeline.node) + && Objects.equals(this.parameters, ciAppPipelineEventInProgressPipeline.parameters) + && Objects.equals(this.parentPipeline, ciAppPipelineEventInProgressPipeline.parentPipeline) + && Objects.equals(this.partialRetry, ciAppPipelineEventInProgressPipeline.partialRetry) + && Objects.equals(this.pipelineId, ciAppPipelineEventInProgressPipeline.pipelineId) + && Objects.equals( + this.previousAttempt, ciAppPipelineEventInProgressPipeline.previousAttempt) + && Objects.equals(this.queueTime, ciAppPipelineEventInProgressPipeline.queueTime) + && Objects.equals(this.start, ciAppPipelineEventInProgressPipeline.start) + && Objects.equals(this.status, ciAppPipelineEventInProgressPipeline.status) + && Objects.equals(this.tags, ciAppPipelineEventInProgressPipeline.tags) + && Objects.equals(this.uniqueId, ciAppPipelineEventInProgressPipeline.uniqueId) + && Objects.equals(this.url, ciAppPipelineEventInProgressPipeline.url) + && Objects.equals( + this.additionalProperties, ciAppPipelineEventInProgressPipeline.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + error, + git, + isManual, + isResumed, + level, + metrics, + name, + node, + parameters, + parentPipeline, + partialRetry, + pipelineId, + previousAttempt, + queueTime, + start, + status, + tags, + uniqueId, + url, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CIAppPipelineEventInProgressPipeline {\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" git: ").append(toIndentedString(git)).append("\n"); + sb.append(" isManual: ").append(toIndentedString(isManual)).append("\n"); + sb.append(" isResumed: ").append(toIndentedString(isResumed)).append("\n"); + sb.append(" level: ").append(toIndentedString(level)).append("\n"); + sb.append(" metrics: ").append(toIndentedString(metrics)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" node: ").append(toIndentedString(node)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append(" parentPipeline: ").append(toIndentedString(parentPipeline)).append("\n"); + sb.append(" partialRetry: ").append(toIndentedString(partialRetry)).append("\n"); + sb.append(" pipelineId: ").append(toIndentedString(pipelineId)).append("\n"); + sb.append(" previousAttempt: ").append(toIndentedString(previousAttempt)).append("\n"); + sb.append(" queueTime: ").append(toIndentedString(queueTime)).append("\n"); + sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" uniqueId: ").append(toIndentedString(uniqueId)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventPipeline.java b/src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventPipeline.java index 7fef7337466..8962b2e95e6 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventPipeline.java +++ b/src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventPipeline.java @@ -6,861 +6,295 @@ package com.datadog.api.client.v2.model; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.time.OffsetDateTime; -import java.util.ArrayList; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; import java.util.HashMap; -import java.util.List; +import java.util.HashSet; import java.util.Map; -import java.util.Objects; -import org.openapitools.jackson.nullable.JsonNullable; +import java.util.logging.Level; +import java.util.logging.Logger; -/** Details of the top level pipeline, build, or workflow of your CI. */ -@JsonPropertyOrder({ - CIAppPipelineEventPipeline.JSON_PROPERTY_END, - CIAppPipelineEventPipeline.JSON_PROPERTY_ERROR, - CIAppPipelineEventPipeline.JSON_PROPERTY_GIT, - CIAppPipelineEventPipeline.JSON_PROPERTY_IS_MANUAL, - CIAppPipelineEventPipeline.JSON_PROPERTY_IS_RESUMED, - CIAppPipelineEventPipeline.JSON_PROPERTY_LEVEL, - CIAppPipelineEventPipeline.JSON_PROPERTY_METRICS, - CIAppPipelineEventPipeline.JSON_PROPERTY_NAME, - CIAppPipelineEventPipeline.JSON_PROPERTY_NODE, - CIAppPipelineEventPipeline.JSON_PROPERTY_PARAMETERS, - CIAppPipelineEventPipeline.JSON_PROPERTY_PARENT_PIPELINE, - CIAppPipelineEventPipeline.JSON_PROPERTY_PARTIAL_RETRY, - CIAppPipelineEventPipeline.JSON_PROPERTY_PIPELINE_ID, - CIAppPipelineEventPipeline.JSON_PROPERTY_PREVIOUS_ATTEMPT, - CIAppPipelineEventPipeline.JSON_PROPERTY_QUEUE_TIME, - CIAppPipelineEventPipeline.JSON_PROPERTY_START, - CIAppPipelineEventPipeline.JSON_PROPERTY_STATUS, - CIAppPipelineEventPipeline.JSON_PROPERTY_TAGS, - CIAppPipelineEventPipeline.JSON_PROPERTY_UNIQUE_ID, - CIAppPipelineEventPipeline.JSON_PROPERTY_URL -}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class CIAppPipelineEventPipeline { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_END = "end"; - private OffsetDateTime end; - - public static final String JSON_PROPERTY_ERROR = "error"; - private JsonNullable error = JsonNullable.undefined(); - - public static final String JSON_PROPERTY_GIT = "git"; - private JsonNullable git = JsonNullable.undefined(); - - public static final String JSON_PROPERTY_IS_MANUAL = "is_manual"; - private JsonNullable isManual = JsonNullable.undefined(); - - public static final String JSON_PROPERTY_IS_RESUMED = "is_resumed"; - private JsonNullable isResumed = JsonNullable.undefined(); - - public static final String JSON_PROPERTY_LEVEL = "level"; - private CIAppPipelineEventPipelineLevel level = CIAppPipelineEventPipelineLevel.PIPELINE; - - public static final String JSON_PROPERTY_METRICS = "metrics"; - private JsonNullable> metrics = JsonNullable.>undefined(); - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public static final String JSON_PROPERTY_NODE = "node"; - private JsonNullable node = JsonNullable.undefined(); - - public static final String JSON_PROPERTY_PARAMETERS = "parameters"; - private JsonNullable> parameters = - JsonNullable.>undefined(); - - public static final String JSON_PROPERTY_PARENT_PIPELINE = "parent_pipeline"; - private JsonNullable parentPipeline = - JsonNullable.undefined(); - - public static final String JSON_PROPERTY_PARTIAL_RETRY = "partial_retry"; - private Boolean partialRetry; - - public static final String JSON_PROPERTY_PIPELINE_ID = "pipeline_id"; - private String pipelineId; - - public static final String JSON_PROPERTY_PREVIOUS_ATTEMPT = "previous_attempt"; - private JsonNullable previousAttempt = - JsonNullable.undefined(); - - public static final String JSON_PROPERTY_QUEUE_TIME = "queue_time"; - private JsonNullable queueTime = JsonNullable.undefined(); - - public static final String JSON_PROPERTY_START = "start"; - private OffsetDateTime start; - - public static final String JSON_PROPERTY_STATUS = "status"; - private CIAppPipelineEventPipelineStatus status; - - public static final String JSON_PROPERTY_TAGS = "tags"; - private JsonNullable> tags = JsonNullable.>undefined(); - - public static final String JSON_PROPERTY_UNIQUE_ID = "unique_id"; - private String uniqueId; - - public static final String JSON_PROPERTY_URL = "url"; - private String url; - - public CIAppPipelineEventPipeline() {} - - @JsonCreator - public CIAppPipelineEventPipeline( - @JsonProperty(required = true, value = JSON_PROPERTY_END) OffsetDateTime end, - @JsonProperty(required = true, value = JSON_PROPERTY_LEVEL) - CIAppPipelineEventPipelineLevel level, - @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, - @JsonProperty(required = true, value = JSON_PROPERTY_PARTIAL_RETRY) Boolean partialRetry, - @JsonProperty(required = true, value = JSON_PROPERTY_START) OffsetDateTime start, - @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) - CIAppPipelineEventPipelineStatus status, - @JsonProperty(required = true, value = JSON_PROPERTY_UNIQUE_ID) String uniqueId, - @JsonProperty(required = true, value = JSON_PROPERTY_URL) String url) { - this.end = end; - this.level = level; - this.unparsed |= !level.isValid(); - this.name = name; - this.partialRetry = partialRetry; - this.start = start; - this.status = status; - this.unparsed |= !status.isValid(); - this.uniqueId = uniqueId; - this.url = url; - } - - public CIAppPipelineEventPipeline end(OffsetDateTime end) { - this.end = end; - return this; - } - - /** - * 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. - * - * @return end - */ - @JsonProperty(JSON_PROPERTY_END) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OffsetDateTime getEnd() { - return end; - } - - public void setEnd(OffsetDateTime end) { - this.end = end; - } - - public CIAppPipelineEventPipeline error(CIAppCIError error) { - this.error = JsonNullable.of(error); - return this; - } - - /** - * Contains information of the CI error. - * - * @return error - */ - @jakarta.annotation.Nullable - @JsonIgnore - public CIAppCIError getError() { - return error.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_ERROR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable getError_JsonNullable() { - return error; - } - - @JsonProperty(JSON_PROPERTY_ERROR) - public void setError_JsonNullable(JsonNullable error) { - this.error = error; - } - - public void setError(CIAppCIError error) { - this.error = JsonNullable.of(error); - } - - public CIAppPipelineEventPipeline git(CIAppGitInfo git) { - this.git = JsonNullable.of(git); - return this; - } - - /** - * 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. - * - * @return git - */ - @jakarta.annotation.Nullable - @JsonIgnore - public CIAppGitInfo getGit() { - return git.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_GIT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable getGit_JsonNullable() { - return git; - } - - @JsonProperty(JSON_PROPERTY_GIT) - public void setGit_JsonNullable(JsonNullable git) { - this.git = git; - } - - public void setGit(CIAppGitInfo git) { - this.git = JsonNullable.of(git); - } - - public CIAppPipelineEventPipeline isManual(Boolean isManual) { - this.isManual = JsonNullable.of(isManual); - return this; - } - - /** - * Whether or not the pipeline was triggered manually by the user. - * - * @return isManual - */ - @jakarta.annotation.Nullable - @JsonIgnore - public Boolean getIsManual() { - return isManual.orElse(null); - } +@JsonDeserialize(using = CIAppPipelineEventPipeline.CIAppPipelineEventPipelineDeserializer.class) +@JsonSerialize(using = CIAppPipelineEventPipeline.CIAppPipelineEventPipelineSerializer.class) +public class CIAppPipelineEventPipeline extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(CIAppPipelineEventPipeline.class.getName()); - @JsonProperty(JSON_PROPERTY_IS_MANUAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable getIsManual_JsonNullable() { - return isManual; - } - - @JsonProperty(JSON_PROPERTY_IS_MANUAL) - public void setIsManual_JsonNullable(JsonNullable isManual) { - this.isManual = isManual; - } - - public void setIsManual(Boolean isManual) { - this.isManual = JsonNullable.of(isManual); - } - - public CIAppPipelineEventPipeline isResumed(Boolean isResumed) { - this.isResumed = JsonNullable.of(isResumed); - return this; - } - - /** - * Whether or not the pipeline was resumed after being blocked. - * - * @return isResumed - */ - @jakarta.annotation.Nullable - @JsonIgnore - public Boolean getIsResumed() { - return isResumed.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_IS_RESUMED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable getIsResumed_JsonNullable() { - return isResumed; - } - - @JsonProperty(JSON_PROPERTY_IS_RESUMED) - public void setIsResumed_JsonNullable(JsonNullable isResumed) { - this.isResumed = isResumed; - } - - public void setIsResumed(Boolean isResumed) { - this.isResumed = JsonNullable.of(isResumed); - } - - public CIAppPipelineEventPipeline level(CIAppPipelineEventPipelineLevel level) { - this.level = level; - this.unparsed |= !level.isValid(); - return this; - } - - /** - * Used to distinguish between pipelines, stages, jobs, and steps. - * - * @return level - */ - @JsonProperty(JSON_PROPERTY_LEVEL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public CIAppPipelineEventPipelineLevel getLevel() { - return level; - } + @JsonIgnore public boolean unparsed = false; - public void setLevel(CIAppPipelineEventPipelineLevel level) { - if (!level.isValid()) { - this.unparsed = true; + public static class CIAppPipelineEventPipelineSerializer + extends StdSerializer { + public CIAppPipelineEventPipelineSerializer(Class t) { + super(t); } - this.level = level; - } - - public CIAppPipelineEventPipeline metrics(List metrics) { - this.metrics = JsonNullable.>of(metrics); - return this; - } - public CIAppPipelineEventPipeline addMetricsItem(String metricsItem) { - if (this.metrics == null || !this.metrics.isPresent()) { - this.metrics = JsonNullable.>of(new ArrayList<>()); + public CIAppPipelineEventPipelineSerializer() { + this(null); } - try { - this.metrics.get().add(metricsItem); - } catch (java.util.NoSuchElementException e) { - // this can never happen, as we make sure above that the value is present - } - return this; - } - /** - * A list of user-defined metrics. The metrics must follow the key:value pattern and - * the value must be numeric. - * - * @return metrics - */ - @jakarta.annotation.Nullable - @JsonIgnore - public List getMetrics() { - return metrics.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_METRICS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable> getMetrics_JsonNullable() { - return metrics; - } - - @JsonProperty(JSON_PROPERTY_METRICS) - public void setMetrics_JsonNullable(JsonNullable> metrics) { - this.metrics = metrics; - } - - public void setMetrics(List metrics) { - this.metrics = JsonNullable.>of(metrics); - } - - public CIAppPipelineEventPipeline name(String name) { - this.name = name; - return this; - } - - /** - * Name of the pipeline. All pipeline runs for the builds should have the same name. - * - * @return name - */ - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public CIAppPipelineEventPipeline node(CIAppHostInfo node) { - this.node = JsonNullable.of(node); - return this; - } - - /** - * Contains information of the host running the pipeline, stage, job, or step. - * - * @return node - */ - @jakarta.annotation.Nullable - @JsonIgnore - public CIAppHostInfo getNode() { - return node.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_NODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable getNode_JsonNullable() { - return node; - } - - @JsonProperty(JSON_PROPERTY_NODE) - public void setNode_JsonNullable(JsonNullable node) { - this.node = node; - } - - public void setNode(CIAppHostInfo node) { - this.node = JsonNullable.of(node); - } - - public CIAppPipelineEventPipeline parameters(Map parameters) { - this.parameters = JsonNullable.>of(parameters); - return this; - } - - public CIAppPipelineEventPipeline putParametersItem(String key, String parametersItem) { - if (this.parameters == null || !this.parameters.isPresent()) { - this.parameters = JsonNullable.>of(new HashMap<>()); - } - try { - this.parameters.get().put(key, parametersItem); - } catch (java.util.NoSuchElementException e) { - // this can never happen, as we make sure above that the value is present + @Override + public void serialize( + CIAppPipelineEventPipeline value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); } - return this; - } - - /** - * A map of key-value parameters or environment variables that were defined for the pipeline. - * - * @return parameters - */ - @jakarta.annotation.Nullable - @JsonIgnore - public Map getParameters() { - return parameters.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_PARAMETERS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable> getParameters_JsonNullable() { - return parameters; - } - - @JsonProperty(JSON_PROPERTY_PARAMETERS) - public void setParameters_JsonNullable(JsonNullable> parameters) { - this.parameters = parameters; - } - - public void setParameters(Map parameters) { - this.parameters = JsonNullable.>of(parameters); - } - - public CIAppPipelineEventPipeline parentPipeline( - CIAppPipelineEventParentPipeline parentPipeline) { - this.parentPipeline = JsonNullable.of(parentPipeline); - return this; - } - - /** - * If the pipeline is triggered as child of another pipeline, this should contain the details of - * the parent pipeline. - * - * @return parentPipeline - */ - @jakarta.annotation.Nullable - @JsonIgnore - public CIAppPipelineEventParentPipeline getParentPipeline() { - return parentPipeline.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_PARENT_PIPELINE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable getParentPipeline_JsonNullable() { - return parentPipeline; - } - - @JsonProperty(JSON_PROPERTY_PARENT_PIPELINE) - public void setParentPipeline_JsonNullable( - JsonNullable parentPipeline) { - this.parentPipeline = parentPipeline; - } - - public void setParentPipeline(CIAppPipelineEventParentPipeline parentPipeline) { - this.parentPipeline = JsonNullable.of(parentPipeline); - } - - public CIAppPipelineEventPipeline partialRetry(Boolean partialRetry) { - this.partialRetry = partialRetry; - return this; - } - - /** - * 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. - * - * @return partialRetry - */ - @JsonProperty(JSON_PROPERTY_PARTIAL_RETRY) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getPartialRetry() { - return partialRetry; } - public void setPartialRetry(Boolean partialRetry) { - this.partialRetry = partialRetry; - } - - public CIAppPipelineEventPipeline pipelineId(String pipelineId) { - this.pipelineId = pipelineId; - return this; - } - - /** - * 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. - * - * @return pipelineId - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PIPELINE_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPipelineId() { - return pipelineId; - } - - public void setPipelineId(String pipelineId) { - this.pipelineId = pipelineId; - } - - public CIAppPipelineEventPipeline previousAttempt( - CIAppPipelineEventPreviousPipeline previousAttempt) { - this.previousAttempt = JsonNullable.of(previousAttempt); - return this; - } - - /** - * If the pipeline is a retry, this should contain the details of the previous attempt. - * - * @return previousAttempt - */ - @jakarta.annotation.Nullable - @JsonIgnore - public CIAppPipelineEventPreviousPipeline getPreviousAttempt() { - return previousAttempt.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_PREVIOUS_ATTEMPT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable getPreviousAttempt_JsonNullable() { - return previousAttempt; - } - - @JsonProperty(JSON_PROPERTY_PREVIOUS_ATTEMPT) - public void setPreviousAttempt_JsonNullable( - JsonNullable previousAttempt) { - this.previousAttempt = previousAttempt; - } - - public void setPreviousAttempt(CIAppPipelineEventPreviousPipeline previousAttempt) { - this.previousAttempt = JsonNullable.of(previousAttempt); - } - - public CIAppPipelineEventPipeline queueTime(Long queueTime) { - this.queueTime = JsonNullable.of(queueTime); - return this; - } - - /** - * The queue time in milliseconds, if applicable. minimum: 0 - * - * @return queueTime - */ - @jakarta.annotation.Nullable - @JsonIgnore - public Long getQueueTime() { - return queueTime.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_QUEUE_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable getQueueTime_JsonNullable() { - return queueTime; - } - - @JsonProperty(JSON_PROPERTY_QUEUE_TIME) - public void setQueueTime_JsonNullable(JsonNullable queueTime) { - this.queueTime = queueTime; - } - - public void setQueueTime(Long queueTime) { - this.queueTime = JsonNullable.of(queueTime); - } - - public CIAppPipelineEventPipeline start(OffsetDateTime start) { - this.start = start; - return this; - } - - /** - * Time when the pipeline run started (it should not include any queue time). The time format must - * be RFC3339. - * - * @return start - */ - @JsonProperty(JSON_PROPERTY_START) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OffsetDateTime getStart() { - return start; - } - - public void setStart(OffsetDateTime start) { - this.start = start; - } - - public CIAppPipelineEventPipeline status(CIAppPipelineEventPipelineStatus status) { - this.status = status; - this.unparsed |= !status.isValid(); - return this; - } - - /** - * The final status of the pipeline. - * - * @return status - */ - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public CIAppPipelineEventPipelineStatus getStatus() { - return status; - } - - public void setStatus(CIAppPipelineEventPipelineStatus status) { - if (!status.isValid()) { - this.unparsed = true; + public static class CIAppPipelineEventPipelineDeserializer + extends StdDeserializer { + public CIAppPipelineEventPipelineDeserializer() { + this(CIAppPipelineEventPipeline.class); } - this.status = status; - } - - public CIAppPipelineEventPipeline tags(List tags) { - this.tags = JsonNullable.>of(tags); - return this; - } - public CIAppPipelineEventPipeline addTagsItem(String tagsItem) { - if (this.tags == null || !this.tags.isPresent()) { - this.tags = JsonNullable.>of(new ArrayList<>()); + public CIAppPipelineEventPipelineDeserializer(Class vc) { + super(vc); } - try { - this.tags.get().add(tagsItem); - } catch (java.util.NoSuchElementException e) { - // this can never happen, as we make sure above that the value is present - } - return this; - } - /** - * A list of user-defined tags. The tags must follow the key:value pattern. - * - * @return tags - */ - @jakarta.annotation.Nullable - @JsonIgnore - public List getTags() { - return tags.orElse(null); - } + @Override + public CIAppPipelineEventPipeline deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize CIAppPipelineEventFinishedPipeline + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CIAppPipelineEventFinishedPipeline.class.equals(Integer.class) + || CIAppPipelineEventFinishedPipeline.class.equals(Long.class) + || CIAppPipelineEventFinishedPipeline.class.equals(Float.class) + || CIAppPipelineEventFinishedPipeline.class.equals(Double.class) + || CIAppPipelineEventFinishedPipeline.class.equals(Boolean.class) + || CIAppPipelineEventFinishedPipeline.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CIAppPipelineEventFinishedPipeline.class.equals(Integer.class) + || CIAppPipelineEventFinishedPipeline.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CIAppPipelineEventFinishedPipeline.class.equals(Float.class) + || CIAppPipelineEventFinishedPipeline.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CIAppPipelineEventFinishedPipeline.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CIAppPipelineEventFinishedPipeline.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(CIAppPipelineEventFinishedPipeline.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((CIAppPipelineEventFinishedPipeline) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'CIAppPipelineEventFinishedPipeline'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'CIAppPipelineEventFinishedPipeline'", + e); + } + + // deserialize CIAppPipelineEventInProgressPipeline + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CIAppPipelineEventInProgressPipeline.class.equals(Integer.class) + || CIAppPipelineEventInProgressPipeline.class.equals(Long.class) + || CIAppPipelineEventInProgressPipeline.class.equals(Float.class) + || CIAppPipelineEventInProgressPipeline.class.equals(Double.class) + || CIAppPipelineEventInProgressPipeline.class.equals(Boolean.class) + || CIAppPipelineEventInProgressPipeline.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CIAppPipelineEventInProgressPipeline.class.equals(Integer.class) + || CIAppPipelineEventInProgressPipeline.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CIAppPipelineEventInProgressPipeline.class.equals(Float.class) + || CIAppPipelineEventInProgressPipeline.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CIAppPipelineEventInProgressPipeline.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CIAppPipelineEventInProgressPipeline.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()).readValueAs(CIAppPipelineEventInProgressPipeline.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((CIAppPipelineEventInProgressPipeline) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'CIAppPipelineEventInProgressPipeline'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'CIAppPipelineEventInProgressPipeline'", + e); + } + + CIAppPipelineEventPipeline ret = new CIAppPipelineEventPipeline(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } - @JsonProperty(JSON_PROPERTY_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable> getTags_JsonNullable() { - return tags; + /** Handle deserialization of the 'null' value. */ + @Override + public CIAppPipelineEventPipeline getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "CIAppPipelineEventPipeline cannot be null"); + } } - @JsonProperty(JSON_PROPERTY_TAGS) - public void setTags_JsonNullable(JsonNullable> tags) { - this.tags = tags; - } + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); - public void setTags(List tags) { - this.tags = JsonNullable.>of(tags); + public CIAppPipelineEventPipeline() { + super("oneOf", Boolean.FALSE); } - public CIAppPipelineEventPipeline uniqueId(String uniqueId) { - this.uniqueId = uniqueId; - return this; + public CIAppPipelineEventPipeline(CIAppPipelineEventFinishedPipeline o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); } - /** - * UUID of the pipeline run. The ID has to be unique across retries and pipelines, including - * partial retries. - * - * @return uniqueId - */ - @JsonProperty(JSON_PROPERTY_UNIQUE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getUniqueId() { - return uniqueId; + public CIAppPipelineEventPipeline(CIAppPipelineEventInProgressPipeline o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); } - public void setUniqueId(String uniqueId) { - this.uniqueId = uniqueId; + static { + schemas.put( + "CIAppPipelineEventFinishedPipeline", + new GenericType() {}); + schemas.put( + "CIAppPipelineEventInProgressPipeline", + new GenericType() {}); + JSON.registerDescendants( + CIAppPipelineEventPipeline.class, Collections.unmodifiableMap(schemas)); } - public CIAppPipelineEventPipeline url(String url) { - this.url = url; - return this; + @Override + public Map getSchemas() { + return CIAppPipelineEventPipeline.schemas; } /** - * The URL to look at the pipeline in the CI provider UI. + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: CIAppPipelineEventFinishedPipeline, + * CIAppPipelineEventInProgressPipeline * - * @return url - */ - @JsonProperty(JSON_PROPERTY_URL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). */ - private Map additionalProperties; + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf( + CIAppPipelineEventFinishedPipeline.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + CIAppPipelineEventInProgressPipeline.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return CIAppPipelineEventPipeline - */ - @JsonAnySetter - public CIAppPipelineEventPipeline putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; } - this.additionalProperties.put(key, value); - return this; + throw new RuntimeException( + "Invalid instance type. Must be CIAppPipelineEventFinishedPipeline," + + " CIAppPipelineEventInProgressPipeline"); } /** - * Return the additional (undeclared) property. + * Get the actual instance, which can be the following: CIAppPipelineEventFinishedPipeline, + * CIAppPipelineEventInProgressPipeline * - * @return The additional properties + * @return The actual instance (CIAppPipelineEventFinishedPipeline, + * CIAppPipelineEventInProgressPipeline) */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; + @Override + public Object getActualInstance() { + return super.getActualInstance(); } /** - * Return the additional (undeclared) property with the specified name. + * Get the actual instance of `CIAppPipelineEventFinishedPipeline`. If the actual instance is not + * `CIAppPipelineEventFinishedPipeline`, the ClassCastException will be thrown. * - * @param key The arbitrary key to get - * @return The specific additional property for the given key + * @return The actual instance of `CIAppPipelineEventFinishedPipeline` + * @throws ClassCastException if the instance is not `CIAppPipelineEventFinishedPipeline` */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** Return true if this CIAppPipelineEventPipeline object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CIAppPipelineEventPipeline ciAppPipelineEventPipeline = (CIAppPipelineEventPipeline) o; - return Objects.equals(this.end, ciAppPipelineEventPipeline.end) - && Objects.equals(this.error, ciAppPipelineEventPipeline.error) - && Objects.equals(this.git, ciAppPipelineEventPipeline.git) - && Objects.equals(this.isManual, ciAppPipelineEventPipeline.isManual) - && Objects.equals(this.isResumed, ciAppPipelineEventPipeline.isResumed) - && Objects.equals(this.level, ciAppPipelineEventPipeline.level) - && Objects.equals(this.metrics, ciAppPipelineEventPipeline.metrics) - && Objects.equals(this.name, ciAppPipelineEventPipeline.name) - && Objects.equals(this.node, ciAppPipelineEventPipeline.node) - && Objects.equals(this.parameters, ciAppPipelineEventPipeline.parameters) - && Objects.equals(this.parentPipeline, ciAppPipelineEventPipeline.parentPipeline) - && Objects.equals(this.partialRetry, ciAppPipelineEventPipeline.partialRetry) - && Objects.equals(this.pipelineId, ciAppPipelineEventPipeline.pipelineId) - && Objects.equals(this.previousAttempt, ciAppPipelineEventPipeline.previousAttempt) - && Objects.equals(this.queueTime, ciAppPipelineEventPipeline.queueTime) - && Objects.equals(this.start, ciAppPipelineEventPipeline.start) - && Objects.equals(this.status, ciAppPipelineEventPipeline.status) - && Objects.equals(this.tags, ciAppPipelineEventPipeline.tags) - && Objects.equals(this.uniqueId, ciAppPipelineEventPipeline.uniqueId) - && Objects.equals(this.url, ciAppPipelineEventPipeline.url) - && Objects.equals( - this.additionalProperties, ciAppPipelineEventPipeline.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - end, - error, - git, - isManual, - isResumed, - level, - metrics, - name, - node, - parameters, - parentPipeline, - partialRetry, - pipelineId, - previousAttempt, - queueTime, - start, - status, - tags, - uniqueId, - url, - additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CIAppPipelineEventPipeline {\n"); - sb.append(" end: ").append(toIndentedString(end)).append("\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - sb.append(" git: ").append(toIndentedString(git)).append("\n"); - sb.append(" isManual: ").append(toIndentedString(isManual)).append("\n"); - sb.append(" isResumed: ").append(toIndentedString(isResumed)).append("\n"); - sb.append(" level: ").append(toIndentedString(level)).append("\n"); - sb.append(" metrics: ").append(toIndentedString(metrics)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" node: ").append(toIndentedString(node)).append("\n"); - sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); - sb.append(" parentPipeline: ").append(toIndentedString(parentPipeline)).append("\n"); - sb.append(" partialRetry: ").append(toIndentedString(partialRetry)).append("\n"); - sb.append(" pipelineId: ").append(toIndentedString(pipelineId)).append("\n"); - sb.append(" previousAttempt: ").append(toIndentedString(previousAttempt)).append("\n"); - sb.append(" queueTime: ").append(toIndentedString(queueTime)).append("\n"); - sb.append(" start: ").append(toIndentedString(start)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" uniqueId: ").append(toIndentedString(uniqueId)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); + public CIAppPipelineEventFinishedPipeline getCIAppPipelineEventFinishedPipeline() + throws ClassCastException { + return (CIAppPipelineEventFinishedPipeline) super.getActualInstance(); } /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). + * Get the actual instance of `CIAppPipelineEventInProgressPipeline`. If the actual instance is + * not `CIAppPipelineEventInProgressPipeline`, the ClassCastException will be thrown. + * + * @return The actual instance of `CIAppPipelineEventInProgressPipeline` + * @throws ClassCastException if the instance is not `CIAppPipelineEventInProgressPipeline` */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); + public CIAppPipelineEventInProgressPipeline getCIAppPipelineEventInProgressPipeline() + throws ClassCastException { + return (CIAppPipelineEventInProgressPipeline) super.getActualInstance(); } } diff --git a/src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventPipelineInProgressStatus.java b/src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventPipelineInProgressStatus.java new file mode 100644 index 00000000000..00b701d471d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CIAppPipelineEventPipelineInProgressStatus.java @@ -0,0 +1,62 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The in progress status of the pipeline. */ +@JsonSerialize( + using = + CIAppPipelineEventPipelineInProgressStatus + .CIAppPipelineEventPipelineInProgressStatusSerializer.class) +public class CIAppPipelineEventPipelineInProgressStatus extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("running")); + + public static final CIAppPipelineEventPipelineInProgressStatus RUNNING = + new CIAppPipelineEventPipelineInProgressStatus("running"); + + CIAppPipelineEventPipelineInProgressStatus(String value) { + super(value, allowedValues); + } + + public static class CIAppPipelineEventPipelineInProgressStatusSerializer + extends StdSerializer { + public CIAppPipelineEventPipelineInProgressStatusSerializer( + Class t) { + super(t); + } + + public CIAppPipelineEventPipelineInProgressStatusSerializer() { + this(null); + } + + @Override + public void serialize( + CIAppPipelineEventPipelineInProgressStatus value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CIAppPipelineEventPipelineInProgressStatus fromValue(String value) { + return new CIAppPipelineEventPipelineInProgressStatus(value); + } +} diff --git a/src/test/resources/cassettes/features/v2/Aggregate_pipelines_events_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Aggregate_pipelines_events_returns_OK_response.freeze index de1ba14a554..2f1c06d3bfe 100644 --- a/src/test/resources/cassettes/features/v2/Aggregate_pipelines_events_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Aggregate_pipelines_events_returns_OK_response.freeze @@ -1 +1 @@ -2022-11-28T11:57:44.730Z \ No newline at end of file +2024-11-25T20:08:40.375Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Aggregate_pipelines_events_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Aggregate_pipelines_events_returns_OK_response.json index b5f5b2516c5..9f07460e4e9 100644 --- a/src/test/resources/cassettes/features/v2/Aggregate_pipelines_events_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Aggregate_pipelines_events_returns_OK_response.json @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"meta\":{\"elapsed\":170,\"request_id\":\"pddv1ChYzYWhuN3VqLVR4ZTV4V0Q0LVFDYVB3IiwKHKG6G1xIn05fWwGRsD7MITrTmBASHDayL3wqgBcSDEOG5uEAxWRZVp8G4w\",\"status\":\"done\"},\"data\":{\"buckets\":[{\"computes\":{\"c0\":236880835985.0375},\"by\":{\"@ci.status\":\"error\"}},{\"computes\":{\"c0\":3026515237.0540113},\"by\":{\"@ci.status\":\"skipped\"}},{\"computes\":{\"c0\":146575581775.90088},\"by\":{\"@ci.status\":\"success\"}}]}}", + "body": "{\"meta\":{\"elapsed\":90,\"request_id\":\"pddv1ChZiVnBUVTltRVJocUlzSWlyYkdkRHFRIi0KHQLKXxzUXfzSm-D5KYypc61Y_NGGMKnRbrtODJpWEgwQ-7lds-czCpOBaB4\",\"status\":\"done\"},\"data\":{\"buckets\":[]}}\n", "headers": { "Content-Type": [ "application/json" diff --git a/src/test/resources/cassettes/features/v2/Get_a_list_of_pipelines_events_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_list_of_pipelines_events_returns_OK_response.freeze index db490a74c71..79cb47db835 100644 --- a/src/test/resources/cassettes/features/v2/Get_a_list_of_pipelines_events_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Get_a_list_of_pipelines_events_returns_OK_response.freeze @@ -1 +1 @@ -2022-11-28T11:57:44.947Z \ No newline at end of file +2024-11-25T20:08:40.699Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_list_of_pipelines_events_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_list_of_pipelines_events_returns_OK_response.json index 4295c97adc1..b9ef299239d 100644 --- a/src/test/resources/cassettes/features/v2/Get_a_list_of_pipelines_events_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_a_list_of_pipelines_events_returns_OK_response.json @@ -9,10 +9,10 @@ "@ci.provider.name:circleci" ], "filter[from]": [ - "2022-11-28T11:27:44.947Z" + "2024-11-25T19:38:40.699Z" ], "filter[to]": [ - "2022-11-28T11:57:44.947Z" + "2024-11-25T20:08:40.699Z" ], "page[limit]": [ "5" @@ -22,7 +22,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":[{\"id\":\"AgAAAYS-GYtIKjvAWQAAAAAAAAAYAAAAAEFZUy1HWXRJQUFDVGxWdU5hQ2MyOW5kYQAAACQAAAAAMDE4NGJlMWItODM2OC00YWNkLTg0ZGMtZTYzMDMzMjk5Mjgz\",\"type\":\"cipipeline\",\"attributes\":{\"attributes\":{\"duration\":176127000000,\"git\":{\"commit\":{\"committer\":{\"date\":\"2022-11-28T11:53:10Z\",\"name\":\"John Doe\",\"email\":\"john.doe@email.com\",\"date_timestamp\":1669636390000},\"author\":{\"date\":\"2022-11-28T11:53:10Z\",\"name\":\"John Doe\",\"email\":\"john.doe@email.com\",\"date_timestamp\":1669636390000},\"message\":\"Directly send SIGPROF signals to thread holding Global VM Lock\",\"sha\":\"e1d41e2ebc93f48d901d3baa6cbe84f71bdb500a\"},\"repository_url\":\"https://github.com/DataDog/repo\",\"repository\":{\"path\":\"/DataDog/repo\",\"scheme\":\"https\",\"name\":\"DataDog/repo\",\"host\":\"github.com\",\"id\":\"github.com/DataDog/repo\"},\"branch\":\"johndoe/directly-signal-gvl-thread\"},\"ci\":{\"pipeline\":{\"name\":\"build-and-test\",\"id\":\"e67854de-34d7-4782-a62a-2231977026a6\",\"url\":\"https://app.circleci.com/pipelines/workflows/e67804de-0000-4782-a62a-2231977026a6\"},\"provider\":{\"instance\":\"circleci\",\"name\":\"circleci\"},\"job\":{\"name\":\"test-3.0\",\"id\":\"b2fd7e9c-be84-4ad7-9cc5-3796b0cdbede\",\"url\":\"https://app.circleci.com/jobs/gh/DataDog/repo/301777\"},\"status\":\"success\"},\"circleci\":{\"result\":\"success\"},\"start\":1669636479817000000},\"ci_level\":\"job\",\"tags\":[\"source:apm\",\"source:apm\"]}},{\"id\":\"AgAAAYS-GWnbVbAEgQAAAAAAAAAYAAAAAEFZUy1HV25iQUFDWG5zSTV2dWM3dzNkYQAAACQAAAAAMDE4NGJlMWItODM2OC00YWNkLTg0ZGMtZTYzMDMzMjk5Mjgz\",\"type\":\"cipipeline\",\"attributes\":{\"attributes\":{\"duration\":226593000000,\"git\":{\"commit\":{\"committer\":{\"date\":\"2022-11-28T11:53:10Z\",\"name\":\"John Doe\",\"email\":\"john.doe@email.com\",\"date_timestamp\":1669636390000},\"author\":{\"date\":\"2022-11-28T11:53:10Z\",\"name\":\"John Doe\",\"email\":\"john.doe@email.com\",\"date_timestamp\":1669636390000},\"message\":\"Directly send SIGPROF signals to thread holding Global VM Lock\",\"sha\":\"e1d41e2ebc93f48d901d3baa6cbe84f71bdb500a\"},\"repository_url\":\"https://github.com/DataDog/repo\",\"repository\":{\"path\":\"/DataDog/drepo\",\"scheme\":\"https\",\"name\":\"DataDog/repo\",\"host\":\"github.com\",\"id\":\"github.com/DataDog/repo\"},\"branch\":\"johndoe/directly-signal-gvl-thread\"},\"ci\":{\"pipeline\":{\"name\":\"build-and-test\",\"id\":\"e67854de-0000-4782-a62a-2231977026a6\",\"url\":\"https://app.circleci.com/pipelines/workflows/e67854de-0000-4782-a62a-2231977026a6\"},\"provider\":{\"instance\":\"circleci\",\"name\":\"circleci\"},\"job\":{\"name\":\"build-jruby-9.3-latest-1\",\"id\":\"55c12323-bb52-48ad-8f66-42a65d50bad5\",\"url\":\"https://app.circleci.com/jobs/gh/DataDog/repo/301773\"},\"status\":\"success\"},\"circleci\":{\"result\":\"success\"},\"start\":1669636420794000000},\"ci_level\":\"job\",\"tags\":[\"source:apm\",\"source:apm\"]}},{\"id\":\"AgAAAYS-GUIqP9PNOgAAAAAAAAAYAAAAAEFZUy1HVUlxQUFDekFXOHlOUHZTVVhkYQAAACQAAAAAMDE4NGJlMWItODM2OC00YWNkLTg0ZGMtZTYzMDMzMjk5Mjgz\",\"type\":\"cipipeline\",\"attributes\":{\"attributes\":{\"duration\":217224000000,\"git\":{\"commit\":{\"committer\":{\"date\":\"2022-11-28T11:53:10Z\",\"name\":\"John Doe\",\"email\":\"john.doe@email.com\",\"date_timestamp\":1669636390000},\"author\":{\"date\":\"2022-11-28T11:53:10Z\",\"name\":\"John Doe\",\"email\":\"john.doe@email.com\",\"date_timestamp\":1669636390000},\"message\":\"Directly send SIGPROF signals to thread holding Global VM Lock\",\"sha\":\"e1d41e2ebc93f48d901d3baa6cbe84f71bdb500a\"},\"repository_url\":\"https://github.com/DataDog/repo\",\"repository\":{\"path\":\"DataDog/repo\",\"scheme\":\"https\",\"name\":\"DataDog/repo\",\"host\":\"github.com\",\"id\":\"github.com/DataDog/repo\"},\"branch\":\"johndoe/directly-signal-gvl-thread\"},\"ci\":{\"pipeline\":{\"name\":\"build-and-test\",\"id\":\"e67854de-34d7-4782-a62a-2231977026a6\",\"url\":\"https://app.circleci.com/pipelines/workflows/e67854de-0000-4782-a62a-2231977026a6\"},\"provider\":{\"instance\":\"circleci\",\"name\":\"circleci\"},\"job\":{\"name\":\"build_and_test_integration-2.4\",\"id\":\"dfb0036b-f9b7-414b-a147-1991e4bf7611\",\"url\":\"https://app.circleci.com/jobs/gh/DataDog/repo/301772\"},\"status\":\"success\"},\"circleci\":{\"result\":\"success\"},\"start\":1669636420002000000},\"ci_level\":\"job\",\"tags\":[\"source:apm\",\"source:apm\"]}},{\"id\":\"AgAAAYS-GPpigabGUAAAAAAAAAAYAAAAAEFZUy1HUHBpQUFBTEMyS0MwclNtTjNkYQAAACQAAAAAMDE4NGJlMWItODM2OC00YWNkLTg0ZGMtZTYzMDMzMjk5Mjgz\",\"type\":\"cipipeline\",\"attributes\":{\"attributes\":{\"duration\":200658000000,\"git\":{\"commit\":{\"committer\":{\"date\":\"2022-11-28T11:53:10Z\",\"name\":\"John Doe\",\"email\":\"john.doe@email.com\",\"date_timestamp\":1669636390000},\"author\":{\"date\":\"2022-11-28T11:53:10Z\",\"name\":\"John Doe\",\"email\":\"john.doe@email.com\",\"date_timestamp\":1669636390000},\"message\":\"Directly send SIGPROF signals to thread holding Global VM Lock\",\"sha\":\"e1d41e2ebc93f48d901d3baa6cbe84f71bdb500a\"},\"repository_url\":\"https://github.com/DataDog/repo\",\"repository\":{\"path\":\"/DataDog/repo\",\"scheme\":\"https\",\"name\":\"DataDog/repo\",\"host\":\"github.com\",\"id\":\"github.com/DataDog/repo\"},\"branch\":\"johndoe/directly-signal-gvl-thread\"},\"ci\":{\"pipeline\":{\"name\":\"build-and-test\",\"id\":\"e67854de-34d7-4782-a62a-2231977026a6\",\"url\":\"https://app.circleci.com/pipelines/workflows/e67854de-0000-4782-a62a-2231977026a6\"},\"provider\":{\"instance\":\"circleci\",\"name\":\"circleci\"},\"job\":{\"name\":\"build-jruby-9.2-latest-1\",\"id\":\"09df7769-9b36-40cd-af1c-e97a00e233a5\",\"url\":\"https://app.circleci.com/jobs/gh/DataDog/repo/301760\"},\"status\":\"success\"},\"circleci\":{\"result\":\"success\"},\"start\":1669636418192000000},\"ci_level\":\"job\",\"tags\":[\"source:apm\",\"source:apm\"]}},{\"id\":\"AgAAAYS-GOd-VzPNOgAAAAAAAAAYAAAAAEFZUy1HT2QtQUFEUzFMbWdMNW4wTFhkYQAAACQAAAAAMDE4NGJlMWItODM2OC00YWNkLTg0ZGMtZTYzMDMzMjk5Mjgz\",\"type\":\"cipipeline\",\"attributes\":{\"attributes\":{\"duration\":195791000000,\"git\":{\"commit\":{\"committer\":{\"date\":\"2022-11-28T11:53:10Z\",\"name\":\"John Doe\",\"email\":\"john.doe@email.com\",\"date_timestamp\":1669636390000},\"author\":{\"date\":\"2022-11-28T11:53:10Z\",\"name\":\"John Doe\",\"email\":\"john.doe@email.com\",\"date_timestamp\":1669636390000},\"message\":\"Directly send SIGPROF signals to thread holding Global VM Lock\",\"sha\":\"e1d41e2ebc93f48d901d3baa6cbe84f71bdb500a\"},\"repository_url\":\"https://github.com/DataDog/dd-trace-rb\",\"repository\":{\"path\":\"/DataDog/repo\",\"scheme\":\"https\",\"name\":\"DataDog/repo\",\"host\":\"github.com\",\"id\":\"github.com/DataDog/repo\"},\"branch\":\"johndoe/directly-signal-gvl-thread\"},\"ci\":{\"pipeline\":{\"name\":\"build-and-test\",\"id\":\"e67854de-34d7-4782-a62a-2231977026a6\",\"url\":\"https://app.circleci.com/pipelines/workflows/e67854de-0000-4782-a62a-2231977026a6\"},\"provider\":{\"instance\":\"circleci\",\"name\":\"circleci\"},\"job\":{\"name\":\"build_and_test_integration-2.3\",\"id\":\"64006f66-267a-47b7-8823-94833268546a\",\"url\":\"https://app.circleci.com/jobs/gh/DataDog/repo/301761\"},\"status\":\"success\"},\"circleci\":{\"result\":\"success\"},\"start\":1669636418223000000},\"ci_level\":\"job\",\"tags\":[\"source:apm\",\"source:apm\"]}}],\"meta\":{\"page\":{\"after\":\"eyJhZnRlciI6IkFnQUFBWVMtR09kLVZ6UE5PZ0FBQUFBQUFBQVlBQUFBQUVGWlV5MUhUMlF0UVVGRVV6Rk1iV2RNTlc0d1RGaGtZUUFBQUNRQUFBQUFNREU0TkdKbE1XSXRPRE0yT0MwMFlXTmtMVGcwWkdNdFpUWXpNRE16TWprNU1qZ3oifQ\"}},\"links\":{\"next\":\"https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bfrom%5D=2022-11-28T11%3A27%3A44.947Z&filter%5Bquery%5D=%40ci.provider.name%3Acircleci&filter%5Bto%5D=2022-11-28T11%3A57%3A44.947Z&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWVMtR09kLVZ6UE5PZ0FBQUFBQUFBQVlBQUFBQUVGWlV5MUhUMlF0UVVGRVV6Rk1iV2RNTlc0d1RGaGtZUUFBQUNRQUFBQUFNREU0TkdKbE1XSXRPRE0yT0MwMFlXTmtMVGcwWkdNdFpUWXpNRE16TWprNU1qZ3oifQ&page%5Blimit%5D=5\"}}", + "body": "{\"data\":[],\"meta\":{\"elapsed\":24,\"request_id\":\"pddv1ChZWQVB6eTZTZlNqbUZVNm52YmpoX3ZnIi0KHc-jI3NiRHtRq6GL8JBczM6emoOFupT0-5U_puB2EgwHRoVgx7kIsJDWMYA\",\"status\":\"done\"}}\n", "headers": { "Content-Type": [ "application/json" @@ -37,6 +37,6 @@ "timeToLive": { "unlimited": true }, - "id": "0db7c48f-c7ac-8d13-15a3-ff15267e47ff" + "id": "5e92fe9d-5508-8eb2-7c57-35228696c2ce" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Search_pipelines_events_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Search_pipelines_events_returns_OK_response.freeze index 7fa75869614..934c9992ff3 100644 --- a/src/test/resources/cassettes/features/v2/Search_pipelines_events_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Search_pipelines_events_returns_OK_response.freeze @@ -1 +1 @@ -2022-10-21T09:09:41.747Z \ No newline at end of file +2024-11-25T20:08:40.877Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Search_pipelines_events_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Search_pipelines_events_returns_OK_response.json index ad4ed20d89b..1b4e9fd8827 100644 --- a/src/test/resources/cassettes/features/v2/Search_pipelines_events_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Search_pipelines_events_returns_OK_response.json @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":[{\"id\":\"AgAAAYP5wIfA7N1YyAAAAAAAAAAYAAAAAEFZUDV3SWZBQUFBZGs5R2kyd25pbjdNMQAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx\",\"type\":\"cipipeline\",\"attributes\":{\"attributes\":{\"duration\":0,\"github\":{\"conclusion\":\"failure\",\"node_group\":\"\",\"html_url\":\"https://github.com/DataDog/repo\",\"run_attempt\":\"1\",\"app_id\":\"128890\"},\"git\":{\"commit\":{\"sha\":\"95094daa15b4281c41780073ab8b77bc7c8d63d6\"},\"default_branch\":\"prod\",\"repository_url\":\"https://github.com/DataDog/repo.git\",\"repository\":{\"path\":\"/DataDog/repo.git\",\"scheme\":\"https\",\"name\":\"DataDog/repo\",\"host\":\"github.com\",\"id\":\"github.com/DataDog/repo\"},\"branch\":\"erkang.zhang/SYM-390/cache-test-spec\"},\"ci\":{\"pipeline\":{\"name\":\"Request Schema diff\",\"id\":\"3296065344-1\"},\"node\":{\"labels\":[]},\"provider\":{\"instance\":\"github-actions\",\"name\":\"github\"},\"job\":{\"name\":\"Annotate PR\",\"id\":\"9025881221\",\"url\":\"https://github.com/DataDog/repo/runs/9025881221\"},\"status\":\"error\"},\"start\":1666342488000000000},\"ci_level\":\"job\",\"tags\":[\"source:apm\",\"source:apm\"]}},{\"id\":\"AgAAAYP5wZVIw5--1wAAAAAAAAAYAAAAAEFZUDV3WlZJQUFCakl1V1FZUE1TdHlxYgAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx\",\"type\":\"cipipeline\",\"attributes\":{\"attributes\":{\"duration\":247000000000,\"github\":{\"conclusion\":\"failure\",\"node_group\":\"GitHub Actions\",\"html_url\":\"https://github.com/DataDog/repo\",\"run_attempt\":\"1\",\"app_id\":\"128890\"},\"git\":{\"commit\":{\"sha\":\"51aec3962c7b3be87b2d656b22042ee5e2c89a3f\"},\"repository_url\":\"https://github.com/DataDog/repo.git\",\"repository\":{\"path\":\"/DataDog/repo.git\",\"scheme\":\"https\",\"name\":\"DataDog/repo\",\"host\":\"github.com\",\"id\":\"github.com/DataDog/repo\"},\"branch\":\"master\"},\"ci\":{\"pipeline\":{\"name\":\"Staging Build Deploy and Test\",\"id\":\"3296065853-1\"},\"provider\":{\"instance\":\"github-actions\",\"name\":\"github\"},\"step\":{\"name\":\"Run Datadog Synthetic test\"},\"job\":{\"name\":\"test-checkouts\",\"id\":\"9025825907\"},\"status\":\"error\"},\"start\":1666342310000000000},\"ci_level\":\"step\",\"tags\":[\"source:apm\",\"source:apm\"]}},{\"id\":\"AgAAAYP5wZkww5--2gAAAAAAAAAYAAAAAEFZUDV3Wmt3QUFBN1R2bTVRRkxzaENxYgAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx\",\"type\":\"cipipeline\",\"attributes\":{\"attributes\":{\"duration\":251000000000,\"github\":{\"conclusion\":\"failure\",\"node_group\":\"GitHub Actions\",\"html_url\":\"https://github.com/DataDog/repo\",\"run_attempt\":\"1\",\"app_id\":\"128890\"},\"git\":{\"commit\":{\"sha\":\"51aec3962c7b3be87b2d656b22042ee5e2c89a3f\"},\"default_branch\":\"master\",\"repository_url\":\"https://github.com/DataDog/repo.git\",\"repository\":{\"path\":\"/DataDog/repo.git\",\"scheme\":\"https\",\"name\":\"DataDog/repo\",\"host\":\"github.com\",\"id\":\"github.com/DataDog/repo\"},\"branch\":\"master\"},\"ci\":{\"pipeline\":{\"name\":\"Staging Build Deploy and Test\",\"id\":\"3296065853-1\"},\"node\":{\"labels\":[\"ubuntu-latest\"]},\"provider\":{\"instance\":\"github-actions\",\"name\":\"github\"},\"job\":{\"name\":\"test-checkouts\",\"id\":\"9025825907\",\"url\":\"https://github.com/DataDog/repo/actions/runs/3296065853/jobs/5435334930\"},\"status\":\"error\"},\"start\":1666342307000000000},\"ci_level\":\"job\",\"tags\":[\"source:apm\",\"source:apm\"]}},{\"id\":\"AgAAAYP5wmg4dbfjZwAAAAAAAAAYAAAAAEFZUDV3bWc0QUFBX0RBNlJkS1RqWkNLSAAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx\",\"type\":\"cipipeline\",\"attributes\":{\"attributes\":{\"duration\":29000000000,\"github\":{\"conclusion\":\"failure\",\"node_group\":\"GitHub Actions\",\"html_url\":\"https://github.com/DataDog/repo\",\"run_attempt\":\"1\",\"app_id\":\"128890\"},\"git\":{\"commit\":{\"sha\":\"62bd7b957a4db5b6926ca570b087b3cfdb9f05a7\"},\"repository_url\":\"https://github.com/DataDog/repo.git\",\"repository\":{\"path\":\"/DataDog/repo.git\",\"scheme\":\"https\",\"name\":\"DataDog/repo\",\"host\":\"github.com\",\"id\":\"github.com/DataDog/repo\"},\"branch\":\"juanjux/APPSEC-6399-only-report-actorip-on-attack-part2\"},\"ci\":{\"pipeline\":{\"name\":\"Framework tests\",\"id\":\"3296098174-1\"},\"provider\":{\"instance\":\"github-actions\",\"name\":\"github\"},\"step\":{\"name\":\"Run tests\"},\"job\":{\"name\":\"starlette-testsuite-0_17_1\",\"id\":\"9025869107\"},\"status\":\"error\"},\"start\":1666342582000000000},\"ci_level\":\"step\",\"tags\":[\"source:apm\",\"source:apm\"]}},{\"id\":\"AgAAAYP5wnAIdbfjbAAAAAAAAAAYAAAAAEFZUDV3bkFJQUFENkpheXhlTXJfS3lLSAAAACQAAAAAMDE4M2Y5YzUtYWUwZi00MzFhLWI0MWItOGU2MDg1NDM3MzAx\",\"type\":\"cipipeline\",\"attributes\":{\"attributes\":{\"duration\":164000000000,\"github\":{\"conclusion\":\"failure\",\"node_group\":\"GitHub Actions\",\"html_url\":\"https://github.com/DataDog/repo\",\"run_attempt\":\"1\",\"app_id\":\"128890\"},\"git\":{\"commit\":{\"sha\":\"62bd7b957a4db5b6926ca570b087b3cfdb9f05a7\"},\"default_branch\":\"1.x\",\"repository_url\":\"https://github.com/DataDog/repo.git\",\"repository\":{\"path\":\"/DataDog/repo.git\",\"scheme\":\"https\",\"name\":\"DataDog/repo\",\"host\":\"github.com\",\"id\":\"github.com/DataDog/repo\"},\"branch\":\"juanjux/APPSEC-6399-only-report-actorip-on-attack-part2\"},\"ci\":{\"pipeline\":{\"name\":\"Framework tests\",\"id\":\"3296098174-1\"},\"node\":{\"labels\":[\"ubuntu-latest\"]},\"provider\":{\"instance\":\"github-actions\",\"name\":\"github\"},\"job\":{\"name\":\"starlette-testsuite-0_17_1\",\"id\":\"9025869107\",\"url\":\"https://github.com/DataDog/repo/actions/runs/3296098174/jobs/5435368427\"},\"status\":\"error\"},\"start\":1666342449000000000},\"ci_level\":\"job\",\"tags\":[\"source:apm\",\"source:apm\"]}}],\"meta\":{\"page\":{\"after\":\"eyJhZnRlciI6IkFnQUFBWVA1d25BSWRiZmpiQUFBQUFBQUFBQVlBQUFBQUVGWlVEVjNia0ZKUVVGRU5rcGhlWGhsVFhKZlMzbExTQUFBQUNRQUFBQUFNREU0TTJZNVl6VXRZV1V3WmkwME16RmhMV0kwTVdJdE9HVTJNRGcxTkRNM016QXgifQ\"}},\"links\":{\"next\":\"https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bfrom%5D=now-15m&filter%5Bquery%5D=%40ci.provider.name%3Agithub+AND+%40ci.status%3Aerror&filter%5Bto%5D=now&page%5Bcursor%5D=eyJhZnRlciI6IkFnQUFBWVA1d25BSWRiZmpiQUFBQUFBQUFBQVlBQUFBQUVGWlVEVjNia0ZKUVVGRU5rcGhlWGhsVFhKZlMzbExTQUFBQUNRQUFBQUFNREU0TTJZNVl6VXRZV1V3WmkwME16RmhMV0kwTVdJdE9HVTJNRGcxTkRNM016QXgifQ&page%5Blimit%5D=5&sort=timestamp\"}}\n", + "body": "{\"data\":[],\"meta\":{\"elapsed\":20,\"request_id\":\"pddv1ChZSTVpjd2Q0MlI2LVVBNjVTYlhFUThBIi0KHQuJgBOuQyr2rULJokHKzwf2zKDYmaOmEm5TrJuvEgyvH4LB-7WWiTQznlw\",\"status\":\"done\"}}\n", "headers": { "Content-Type": [ "application/json" diff --git a/src/test/resources/cassettes/features/v2/Send_pipeline_event_returns_Request_accepted_for_processing_response.freeze b/src/test/resources/cassettes/features/v2/Send_pipeline_event_returns_Request_accepted_for_processing_response.freeze index f80fdc73b8c..9ea3b8ed04d 100644 --- a/src/test/resources/cassettes/features/v2/Send_pipeline_event_returns_Request_accepted_for_processing_response.freeze +++ b/src/test/resources/cassettes/features/v2/Send_pipeline_event_returns_Request_accepted_for_processing_response.freeze @@ -1 +1 @@ -2023-06-22T08:08:28.046Z \ No newline at end of file +2024-11-25T20:08:41.018Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Send_pipeline_event_returns_Request_accepted_for_processing_response.json b/src/test/resources/cassettes/features/v2/Send_pipeline_event_returns_Request_accepted_for_processing_response.json index 5d6c1a1d1d5..89a4e2e53d2 100644 --- a/src/test/resources/cassettes/features/v2/Send_pipeline_event_returns_Request_accepted_for_processing_response.json +++ b/src/test/resources/cassettes/features/v2/Send_pipeline_event_returns_Request_accepted_for_processing_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"resource\":{\"end\":\"2023-06-22T08:07:58.046Z\",\"git\":{\"author_email\":\"john.doe@email.com\",\"repository_url\":\"https://github.com/DataDog/datadog-agent\",\"sha\":\"7f263865994b76066c4612fd1965215e7dcb4cd2\"},\"level\":\"pipeline\",\"name\":\"Deploy to AWS\",\"partial_retry\":false,\"start\":\"2023-06-22T08:06:28.046Z\",\"status\":\"success\",\"unique_id\":\"3eacb6f3-ff04-4e10-8a9c-46e6d054024a\",\"url\":\"https://my-ci-provider.example/pipelines/my-pipeline/run/1\"}},\"type\":\"cipipeline_resource_request\"}}" + "json": "{\"data\":{\"attributes\":{\"resource\":{\"end\":\"2024-11-25T20:08:11.018Z\",\"git\":{\"author_email\":\"john.doe@email.com\",\"repository_url\":\"https://github.com/DataDog/datadog-agent\",\"sha\":\"7f263865994b76066c4612fd1965215e7dcb4cd2\"},\"level\":\"pipeline\",\"name\":\"Deploy to AWS\",\"partial_retry\":false,\"start\":\"2024-11-25T20:06:41.018Z\",\"status\":\"success\",\"unique_id\":\"3eacb6f3-ff04-4e10-8a9c-46e6d054024a\",\"url\":\"https://my-ci-provider.example/pipelines/my-pipeline/run/1\"}},\"type\":\"cipipeline_resource_request\"}}" }, "headers": {}, "method": "POST", @@ -27,6 +27,6 @@ "timeToLive": { "unlimited": true }, - "id": "3b46d59c-4e6a-40b3-46d7-33a1ffe84dbb" + "id": "e9a912da-9eef-062c-4598-9230a89d8753" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Send_pipeline_job_event_returns_Request_accepted_for_processing_response.freeze b/src/test/resources/cassettes/features/v2/Send_pipeline_job_event_returns_Request_accepted_for_processing_response.freeze index bdbb925c5b2..ad34df9881f 100644 --- a/src/test/resources/cassettes/features/v2/Send_pipeline_job_event_returns_Request_accepted_for_processing_response.freeze +++ b/src/test/resources/cassettes/features/v2/Send_pipeline_job_event_returns_Request_accepted_for_processing_response.freeze @@ -1 +1 @@ -2023-09-27T09:29:38.798Z \ No newline at end of file +2024-11-25T20:08:41.167Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Send_pipeline_job_event_returns_Request_accepted_for_processing_response.json b/src/test/resources/cassettes/features/v2/Send_pipeline_job_event_returns_Request_accepted_for_processing_response.json index 6fbe0a45ab0..dc6b54b9415 100644 --- a/src/test/resources/cassettes/features/v2/Send_pipeline_job_event_returns_Request_accepted_for_processing_response.json +++ b/src/test/resources/cassettes/features/v2/Send_pipeline_job_event_returns_Request_accepted_for_processing_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"resource\":{\"end\":\"2023-09-27T09:29:08.798Z\",\"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\":\"2023-09-27T09:27:38.798Z\",\"status\":\"error\",\"url\":\"https://my-ci-provider.example/jobs/my-jobs/run/1\"}},\"type\":\"cipipeline_resource_request\"}}" + "json": "{\"data\":{\"attributes\":{\"resource\":{\"end\":\"2024-11-25T20:08:11.167Z\",\"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\":\"2024-11-25T20:06:41.167Z\",\"status\":\"error\",\"url\":\"https://my-ci-provider.example/jobs/my-jobs/run/1\"}},\"type\":\"cipipeline_resource_request\"}}" }, "headers": {}, "method": "POST", @@ -27,6 +27,6 @@ "timeToLive": { "unlimited": true }, - "id": "eb91f6e7-b811-9412-f2e4-c9fd150d805c" + "id": "996ace5d-8ad8-94c8-0c8e-9144253410d8" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Send_running_pipeline_event_returns_Request_accepted_for_processing_response.freeze b/src/test/resources/cassettes/features/v2/Send_running_pipeline_event_returns_Request_accepted_for_processing_response.freeze new file mode 100644 index 00000000000..229caddd7a6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Send_running_pipeline_event_returns_Request_accepted_for_processing_response.freeze @@ -0,0 +1 @@ +2024-11-25T20:08:41.317Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Send_running_pipeline_event_returns_Request_accepted_for_processing_response.json b/src/test/resources/cassettes/features/v2/Send_running_pipeline_event_returns_Request_accepted_for_processing_response.json new file mode 100644 index 00000000000..cc9eb04c4f9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Send_running_pipeline_event_returns_Request_accepted_for_processing_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"resource\":{\"git\":{\"author_email\":\"john.doe@email.com\",\"repository_url\":\"https://github.com/DataDog/datadog-agent\",\"sha\":\"7f263865994b76066c4612fd1965215e7dcb4cd2\"},\"level\":\"pipeline\",\"name\":\"Deploy to AWS\",\"partial_retry\":false,\"start\":\"2024-11-25T20:06:41.317Z\",\"status\":\"running\",\"unique_id\":\"3eacb6f3-ff04-4e10-8a9c-46e6d054024a\",\"url\":\"https://my-ci-provider.example/pipelines/my-pipeline/run/1\"}},\"type\":\"cipipeline_resource_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/ci/pipeline", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":null}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 202, + "reasonPhrase": "Accepted" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ea4ab73a-5157-c838-c0d3-6b188955cbce" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/ci_visibility_pipelines.feature b/src/test/resources/com/datadog/api/client/v2/api/ci_visibility_pipelines.feature index 71dcea8c15a..7f707950723 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/ci_visibility_pipelines.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/ci_visibility_pipelines.feature @@ -104,13 +104,20 @@ Feature: CI Visibility Pipelines @team:Datadog/ci-app-backend Scenario: Send pipeline event returns "Request accepted for processing" response Given new "CreateCIAppPipelineEvent" request - And body with value {"data": {"attributes": {"resource": {"end": "{{ timeISO('now - 30s') }}", "level": "pipeline", "name": "Deploy to AWS", "partial_retry": false, "start": "{{ timeISO('now - 120s') }}", "status": "success", "unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", "url": "https://my-ci-provider.example/pipelines/my-pipeline/run/1","git":{"repository_url":"https://github.com/DataDog/datadog-agent","sha":"7f263865994b76066c4612fd1965215e7dcb4cd2","author_email":"john.doe@email.com"}}}, "type": "cipipeline_resource_request"}} + And body with value {"data": {"attributes": {"resource": {"level": "pipeline","unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a","name": "Deploy to AWS","url": "https://my-ci-provider.example/pipelines/my-pipeline/run/1","start": "{{ timeISO('now - 120s') }}","end": "{{ timeISO('now - 30s') }}","status": "success","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "7f263865994b76066c4612fd1965215e7dcb4cd2","author_email": "john.doe@email.com"}}},"type": "cipipeline_resource_request"}} When the request is sent Then the response status is 202 Request accepted for processing - @team:Datadog/ci-app-backend + @skip @team:Datadog/ci-app-backend Scenario: Send pipeline job event returns "Request accepted for processing" response Given new "CreateCIAppPipelineEvent" request - And body with value {"data": {"attributes": {"resource": {"end": "{{ timeISO('now - 30s') }}", "level": "job", "name": "Build image", "start": "{{ timeISO('now - 120s') }}", "status": "error", "id": "cf9456de-8b9e-4c27-aa79-27b1e78c1a33", "pipeline_unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", "pipeline_name": "Deploy to AWS", "url": "https://my-ci-provider.example/jobs/my-jobs/run/1"}}, "type": "cipipeline_resource_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') }}", "end": "{{ timeISO('now - 30s') }}", "status": "error", "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 + + @team:Datadog/ci-app-backend + Scenario: Send running pipeline event returns "Request accepted for processing" response + Given new "CreateCIAppPipelineEvent" request + And body with value {"data": {"attributes": {"resource": {"level": "pipeline","unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a","name": "Deploy to AWS","url": "https://my-ci-provider.example/pipelines/my-pipeline/run/1","start": "{{ timeISO('now - 120s') }}","status": "running","partial_retry": false,"git": {"repository_url": "https://github.com/DataDog/datadog-agent","sha": "7f263865994b76066c4612fd1965215e7dcb4cd2","author_email": "john.doe@email.com"}}},"type": "cipipeline_resource_request"}} When the request is sent Then the response status is 202 Request accepted for processing