diff --git a/.apigentools-info b/.apigentools-info index 4a89486485f..f14e1fdcec2 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.286101", - "spec_repo_commit": "f35e3502" + "regenerated": "2024-12-10 19:50:07.433364", + "spec_repo_commit": "5da0cd35" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-10 17:29:07.306202", - "spec_repo_commit": "f35e3502" + "regenerated": "2024-12-10 19:50:07.452430", + "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/api/datadogV2/model_ci_app_create_pipeline_event_request_attributes_resource.go b/api/datadogV2/model_ci_app_create_pipeline_event_request_attributes_resource.go index 188179e8a7a..08fd1363159 100644 --- a/api/datadogV2/model_ci_app_create_pipeline_event_request_attributes_resource.go +++ b/api/datadogV2/model_ci_app_create_pipeline_event_request_attributes_resource.go @@ -48,7 +48,7 @@ func (obj *CIAppCreatePipelineEventRequestAttributesResource) UnmarshalJSON(data if err == nil { if obj.CIAppPipelineEventPipeline != nil && obj.CIAppPipelineEventPipeline.UnparsedObject == nil { jsonCIAppPipelineEventPipeline, _ := datadog.Marshal(obj.CIAppPipelineEventPipeline) - if string(jsonCIAppPipelineEventPipeline) == "{}" { // empty struct + if string(jsonCIAppPipelineEventPipeline) == "{}" && string(data) != "{}" { // empty struct obj.CIAppPipelineEventPipeline = nil } else { match++ diff --git a/api/datadogV2/model_ci_app_pipeline_event_finished_pipeline.go b/api/datadogV2/model_ci_app_pipeline_event_finished_pipeline.go new file mode 100644 index 00000000000..f76551446e6 --- /dev/null +++ b/api/datadogV2/model_ci_app_pipeline_event_finished_pipeline.go @@ -0,0 +1,885 @@ +// 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 datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CIAppPipelineEventFinishedPipeline Details of a finished pipeline. +type CIAppPipelineEventFinishedPipeline struct { + // 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. + End time.Time `json:"end"` + // Contains information of the CI error. + Error NullableCIAppCIError `json:"error,omitempty"` + // 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. + Git NullableCIAppGitInfo `json:"git,omitempty"` + // Whether or not the pipeline was triggered manually by the user. + IsManual datadog.NullableBool `json:"is_manual,omitempty"` + // Whether or not the pipeline was resumed after being blocked. + IsResumed datadog.NullableBool `json:"is_resumed,omitempty"` + // Used to distinguish between pipelines, stages, jobs, and steps. + Level CIAppPipelineEventPipelineLevel `json:"level"` + // A list of user-defined metrics. The metrics must follow the `key:value` pattern and the value must be numeric. + Metrics datadog.NullableList[string] `json:"metrics,omitempty"` + // Name of the pipeline. All pipeline runs for the builds should have the same name. + Name string `json:"name"` + // Contains information of the host running the pipeline, stage, job, or step. + Node NullableCIAppHostInfo `json:"node,omitempty"` + // A map of key-value parameters or environment variables that were defined for the pipeline. + Parameters map[string]string `json:"parameters,omitempty"` + // If the pipeline is triggered as child of another pipeline, this should contain the details of the parent pipeline. + ParentPipeline NullableCIAppPipelineEventParentPipeline `json:"parent_pipeline,omitempty"` + // 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. + PartialRetry bool `json:"partial_retry"` + // 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. + PipelineId *string `json:"pipeline_id,omitempty"` + // If the pipeline is a retry, this should contain the details of the previous attempt. + PreviousAttempt NullableCIAppPipelineEventPreviousPipeline `json:"previous_attempt,omitempty"` + // The queue time in milliseconds, if applicable. + QueueTime datadog.NullableInt64 `json:"queue_time,omitempty"` + // Time when the pipeline run started (it should not include any queue time). The time format must be RFC3339. + Start time.Time `json:"start"` + // The final status of the pipeline. + Status CIAppPipelineEventPipelineStatus `json:"status"` + // A list of user-defined tags. The tags must follow the `key:value` pattern. + Tags datadog.NullableList[string] `json:"tags,omitempty"` + // UUID of the pipeline run. The ID has to be unique across retries and pipelines, + // including partial retries. + UniqueId string `json:"unique_id"` + // The URL to look at the pipeline in the CI provider UI. + Url string `json:"url"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCIAppPipelineEventFinishedPipeline instantiates a new CIAppPipelineEventFinishedPipeline object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppPipelineEventFinishedPipeline(end time.Time, level CIAppPipelineEventPipelineLevel, name string, partialRetry bool, start time.Time, status CIAppPipelineEventPipelineStatus, uniqueId string, url string) *CIAppPipelineEventFinishedPipeline { + this := CIAppPipelineEventFinishedPipeline{} + this.End = end + this.Level = level + this.Name = name + this.PartialRetry = partialRetry + this.Start = start + this.Status = status + this.UniqueId = uniqueId + this.Url = url + return &this +} + +// NewCIAppPipelineEventFinishedPipelineWithDefaults instantiates a new CIAppPipelineEventFinishedPipeline object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppPipelineEventFinishedPipelineWithDefaults() *CIAppPipelineEventFinishedPipeline { + this := CIAppPipelineEventFinishedPipeline{} + var level CIAppPipelineEventPipelineLevel = CIAPPPIPELINEEVENTPIPELINELEVEL_PIPELINE + this.Level = level + return &this +} + +// GetEnd returns the End field value. +func (o *CIAppPipelineEventFinishedPipeline) GetEnd() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.End +} + +// GetEndOk returns a tuple with the End field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventFinishedPipeline) GetEndOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.End, true +} + +// SetEnd sets field value. +func (o *CIAppPipelineEventFinishedPipeline) SetEnd(v time.Time) { + o.End = v +} + +// GetError returns the Error field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventFinishedPipeline) GetError() CIAppCIError { + if o == nil || o.Error.Get() == nil { + var ret CIAppCIError + return ret + } + return *o.Error.Get() +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventFinishedPipeline) GetErrorOk() (*CIAppCIError, bool) { + if o == nil { + return nil, false + } + return o.Error.Get(), o.Error.IsSet() +} + +// HasError returns a boolean if a field has been set. +func (o *CIAppPipelineEventFinishedPipeline) HasError() bool { + return o != nil && o.Error.IsSet() +} + +// SetError gets a reference to the given NullableCIAppCIError and assigns it to the Error field. +func (o *CIAppPipelineEventFinishedPipeline) SetError(v CIAppCIError) { + o.Error.Set(&v) +} + +// SetErrorNil sets the value for Error to be an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) SetErrorNil() { + o.Error.Set(nil) +} + +// UnsetError ensures that no value is present for Error, not even an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) UnsetError() { + o.Error.Unset() +} + +// GetGit returns the Git field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventFinishedPipeline) GetGit() CIAppGitInfo { + if o == nil || o.Git.Get() == nil { + var ret CIAppGitInfo + return ret + } + return *o.Git.Get() +} + +// GetGitOk returns a tuple with the Git field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventFinishedPipeline) GetGitOk() (*CIAppGitInfo, bool) { + if o == nil { + return nil, false + } + return o.Git.Get(), o.Git.IsSet() +} + +// HasGit returns a boolean if a field has been set. +func (o *CIAppPipelineEventFinishedPipeline) HasGit() bool { + return o != nil && o.Git.IsSet() +} + +// SetGit gets a reference to the given NullableCIAppGitInfo and assigns it to the Git field. +func (o *CIAppPipelineEventFinishedPipeline) SetGit(v CIAppGitInfo) { + o.Git.Set(&v) +} + +// SetGitNil sets the value for Git to be an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) SetGitNil() { + o.Git.Set(nil) +} + +// UnsetGit ensures that no value is present for Git, not even an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) UnsetGit() { + o.Git.Unset() +} + +// GetIsManual returns the IsManual field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventFinishedPipeline) GetIsManual() bool { + if o == nil || o.IsManual.Get() == nil { + var ret bool + return ret + } + return *o.IsManual.Get() +} + +// GetIsManualOk returns a tuple with the IsManual field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventFinishedPipeline) GetIsManualOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsManual.Get(), o.IsManual.IsSet() +} + +// HasIsManual returns a boolean if a field has been set. +func (o *CIAppPipelineEventFinishedPipeline) HasIsManual() bool { + return o != nil && o.IsManual.IsSet() +} + +// SetIsManual gets a reference to the given datadog.NullableBool and assigns it to the IsManual field. +func (o *CIAppPipelineEventFinishedPipeline) SetIsManual(v bool) { + o.IsManual.Set(&v) +} + +// SetIsManualNil sets the value for IsManual to be an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) SetIsManualNil() { + o.IsManual.Set(nil) +} + +// UnsetIsManual ensures that no value is present for IsManual, not even an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) UnsetIsManual() { + o.IsManual.Unset() +} + +// GetIsResumed returns the IsResumed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventFinishedPipeline) GetIsResumed() bool { + if o == nil || o.IsResumed.Get() == nil { + var ret bool + return ret + } + return *o.IsResumed.Get() +} + +// GetIsResumedOk returns a tuple with the IsResumed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventFinishedPipeline) GetIsResumedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsResumed.Get(), o.IsResumed.IsSet() +} + +// HasIsResumed returns a boolean if a field has been set. +func (o *CIAppPipelineEventFinishedPipeline) HasIsResumed() bool { + return o != nil && o.IsResumed.IsSet() +} + +// SetIsResumed gets a reference to the given datadog.NullableBool and assigns it to the IsResumed field. +func (o *CIAppPipelineEventFinishedPipeline) SetIsResumed(v bool) { + o.IsResumed.Set(&v) +} + +// SetIsResumedNil sets the value for IsResumed to be an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) SetIsResumedNil() { + o.IsResumed.Set(nil) +} + +// UnsetIsResumed ensures that no value is present for IsResumed, not even an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) UnsetIsResumed() { + o.IsResumed.Unset() +} + +// GetLevel returns the Level field value. +func (o *CIAppPipelineEventFinishedPipeline) GetLevel() CIAppPipelineEventPipelineLevel { + if o == nil { + var ret CIAppPipelineEventPipelineLevel + return ret + } + return o.Level +} + +// GetLevelOk returns a tuple with the Level field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventFinishedPipeline) GetLevelOk() (*CIAppPipelineEventPipelineLevel, bool) { + if o == nil { + return nil, false + } + return &o.Level, true +} + +// SetLevel sets field value. +func (o *CIAppPipelineEventFinishedPipeline) SetLevel(v CIAppPipelineEventPipelineLevel) { + o.Level = v +} + +// GetMetrics returns the Metrics field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventFinishedPipeline) GetMetrics() []string { + if o == nil || o.Metrics.Get() == nil { + var ret []string + return ret + } + return *o.Metrics.Get() +} + +// GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventFinishedPipeline) GetMetricsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return o.Metrics.Get(), o.Metrics.IsSet() +} + +// HasMetrics returns a boolean if a field has been set. +func (o *CIAppPipelineEventFinishedPipeline) HasMetrics() bool { + return o != nil && o.Metrics.IsSet() +} + +// SetMetrics gets a reference to the given datadog.NullableList[string] and assigns it to the Metrics field. +func (o *CIAppPipelineEventFinishedPipeline) SetMetrics(v []string) { + o.Metrics.Set(&v) +} + +// SetMetricsNil sets the value for Metrics to be an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) SetMetricsNil() { + o.Metrics.Set(nil) +} + +// UnsetMetrics ensures that no value is present for Metrics, not even an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) UnsetMetrics() { + o.Metrics.Unset() +} + +// GetName returns the Name field value. +func (o *CIAppPipelineEventFinishedPipeline) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventFinishedPipeline) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *CIAppPipelineEventFinishedPipeline) SetName(v string) { + o.Name = v +} + +// GetNode returns the Node field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventFinishedPipeline) GetNode() CIAppHostInfo { + if o == nil || o.Node.Get() == nil { + var ret CIAppHostInfo + return ret + } + return *o.Node.Get() +} + +// GetNodeOk returns a tuple with the Node field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventFinishedPipeline) GetNodeOk() (*CIAppHostInfo, bool) { + if o == nil { + return nil, false + } + return o.Node.Get(), o.Node.IsSet() +} + +// HasNode returns a boolean if a field has been set. +func (o *CIAppPipelineEventFinishedPipeline) HasNode() bool { + return o != nil && o.Node.IsSet() +} + +// SetNode gets a reference to the given NullableCIAppHostInfo and assigns it to the Node field. +func (o *CIAppPipelineEventFinishedPipeline) SetNode(v CIAppHostInfo) { + o.Node.Set(&v) +} + +// SetNodeNil sets the value for Node to be an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) SetNodeNil() { + o.Node.Set(nil) +} + +// UnsetNode ensures that no value is present for Node, not even an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) UnsetNode() { + o.Node.Unset() +} + +// GetParameters returns the Parameters field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventFinishedPipeline) GetParameters() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventFinishedPipeline) GetParametersOk() (*map[string]string, bool) { + if o == nil || o.Parameters == nil { + return nil, false + } + return &o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CIAppPipelineEventFinishedPipeline) HasParameters() bool { + return o != nil && o.Parameters != nil +} + +// SetParameters gets a reference to the given map[string]string and assigns it to the Parameters field. +func (o *CIAppPipelineEventFinishedPipeline) SetParameters(v map[string]string) { + o.Parameters = v +} + +// GetParentPipeline returns the ParentPipeline field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventFinishedPipeline) GetParentPipeline() CIAppPipelineEventParentPipeline { + if o == nil || o.ParentPipeline.Get() == nil { + var ret CIAppPipelineEventParentPipeline + return ret + } + return *o.ParentPipeline.Get() +} + +// GetParentPipelineOk returns a tuple with the ParentPipeline field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventFinishedPipeline) GetParentPipelineOk() (*CIAppPipelineEventParentPipeline, bool) { + if o == nil { + return nil, false + } + return o.ParentPipeline.Get(), o.ParentPipeline.IsSet() +} + +// HasParentPipeline returns a boolean if a field has been set. +func (o *CIAppPipelineEventFinishedPipeline) HasParentPipeline() bool { + return o != nil && o.ParentPipeline.IsSet() +} + +// SetParentPipeline gets a reference to the given NullableCIAppPipelineEventParentPipeline and assigns it to the ParentPipeline field. +func (o *CIAppPipelineEventFinishedPipeline) SetParentPipeline(v CIAppPipelineEventParentPipeline) { + o.ParentPipeline.Set(&v) +} + +// SetParentPipelineNil sets the value for ParentPipeline to be an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) SetParentPipelineNil() { + o.ParentPipeline.Set(nil) +} + +// UnsetParentPipeline ensures that no value is present for ParentPipeline, not even an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) UnsetParentPipeline() { + o.ParentPipeline.Unset() +} + +// GetPartialRetry returns the PartialRetry field value. +func (o *CIAppPipelineEventFinishedPipeline) GetPartialRetry() bool { + if o == nil { + var ret bool + return ret + } + return o.PartialRetry +} + +// GetPartialRetryOk returns a tuple with the PartialRetry field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventFinishedPipeline) GetPartialRetryOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.PartialRetry, true +} + +// SetPartialRetry sets field value. +func (o *CIAppPipelineEventFinishedPipeline) SetPartialRetry(v bool) { + o.PartialRetry = v +} + +// GetPipelineId returns the PipelineId field value if set, zero value otherwise. +func (o *CIAppPipelineEventFinishedPipeline) GetPipelineId() string { + if o == nil || o.PipelineId == nil { + var ret string + return ret + } + return *o.PipelineId +} + +// GetPipelineIdOk returns a tuple with the PipelineId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventFinishedPipeline) GetPipelineIdOk() (*string, bool) { + if o == nil || o.PipelineId == nil { + return nil, false + } + return o.PipelineId, true +} + +// HasPipelineId returns a boolean if a field has been set. +func (o *CIAppPipelineEventFinishedPipeline) HasPipelineId() bool { + return o != nil && o.PipelineId != nil +} + +// SetPipelineId gets a reference to the given string and assigns it to the PipelineId field. +func (o *CIAppPipelineEventFinishedPipeline) SetPipelineId(v string) { + o.PipelineId = &v +} + +// GetPreviousAttempt returns the PreviousAttempt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventFinishedPipeline) GetPreviousAttempt() CIAppPipelineEventPreviousPipeline { + if o == nil || o.PreviousAttempt.Get() == nil { + var ret CIAppPipelineEventPreviousPipeline + return ret + } + return *o.PreviousAttempt.Get() +} + +// GetPreviousAttemptOk returns a tuple with the PreviousAttempt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventFinishedPipeline) GetPreviousAttemptOk() (*CIAppPipelineEventPreviousPipeline, bool) { + if o == nil { + return nil, false + } + return o.PreviousAttempt.Get(), o.PreviousAttempt.IsSet() +} + +// HasPreviousAttempt returns a boolean if a field has been set. +func (o *CIAppPipelineEventFinishedPipeline) HasPreviousAttempt() bool { + return o != nil && o.PreviousAttempt.IsSet() +} + +// SetPreviousAttempt gets a reference to the given NullableCIAppPipelineEventPreviousPipeline and assigns it to the PreviousAttempt field. +func (o *CIAppPipelineEventFinishedPipeline) SetPreviousAttempt(v CIAppPipelineEventPreviousPipeline) { + o.PreviousAttempt.Set(&v) +} + +// SetPreviousAttemptNil sets the value for PreviousAttempt to be an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) SetPreviousAttemptNil() { + o.PreviousAttempt.Set(nil) +} + +// UnsetPreviousAttempt ensures that no value is present for PreviousAttempt, not even an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) UnsetPreviousAttempt() { + o.PreviousAttempt.Unset() +} + +// GetQueueTime returns the QueueTime field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventFinishedPipeline) GetQueueTime() int64 { + if o == nil || o.QueueTime.Get() == nil { + var ret int64 + return ret + } + return *o.QueueTime.Get() +} + +// GetQueueTimeOk returns a tuple with the QueueTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventFinishedPipeline) GetQueueTimeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.QueueTime.Get(), o.QueueTime.IsSet() +} + +// HasQueueTime returns a boolean if a field has been set. +func (o *CIAppPipelineEventFinishedPipeline) HasQueueTime() bool { + return o != nil && o.QueueTime.IsSet() +} + +// SetQueueTime gets a reference to the given datadog.NullableInt64 and assigns it to the QueueTime field. +func (o *CIAppPipelineEventFinishedPipeline) SetQueueTime(v int64) { + o.QueueTime.Set(&v) +} + +// SetQueueTimeNil sets the value for QueueTime to be an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) SetQueueTimeNil() { + o.QueueTime.Set(nil) +} + +// UnsetQueueTime ensures that no value is present for QueueTime, not even an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) UnsetQueueTime() { + o.QueueTime.Unset() +} + +// GetStart returns the Start field value. +func (o *CIAppPipelineEventFinishedPipeline) GetStart() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.Start +} + +// GetStartOk returns a tuple with the Start field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventFinishedPipeline) GetStartOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Start, true +} + +// SetStart sets field value. +func (o *CIAppPipelineEventFinishedPipeline) SetStart(v time.Time) { + o.Start = v +} + +// GetStatus returns the Status field value. +func (o *CIAppPipelineEventFinishedPipeline) GetStatus() CIAppPipelineEventPipelineStatus { + if o == nil { + var ret CIAppPipelineEventPipelineStatus + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventFinishedPipeline) GetStatusOk() (*CIAppPipelineEventPipelineStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value. +func (o *CIAppPipelineEventFinishedPipeline) SetStatus(v CIAppPipelineEventPipelineStatus) { + o.Status = v +} + +// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventFinishedPipeline) GetTags() []string { + if o == nil || o.Tags.Get() == nil { + var ret []string + return ret + } + return *o.Tags.Get() +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventFinishedPipeline) GetTagsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return o.Tags.Get(), o.Tags.IsSet() +} + +// HasTags returns a boolean if a field has been set. +func (o *CIAppPipelineEventFinishedPipeline) HasTags() bool { + return o != nil && o.Tags.IsSet() +} + +// SetTags gets a reference to the given datadog.NullableList[string] and assigns it to the Tags field. +func (o *CIAppPipelineEventFinishedPipeline) SetTags(v []string) { + o.Tags.Set(&v) +} + +// SetTagsNil sets the value for Tags to be an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) SetTagsNil() { + o.Tags.Set(nil) +} + +// UnsetTags ensures that no value is present for Tags, not even an explicit nil. +func (o *CIAppPipelineEventFinishedPipeline) UnsetTags() { + o.Tags.Unset() +} + +// GetUniqueId returns the UniqueId field value. +func (o *CIAppPipelineEventFinishedPipeline) GetUniqueId() string { + if o == nil { + var ret string + return ret + } + return o.UniqueId +} + +// GetUniqueIdOk returns a tuple with the UniqueId field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventFinishedPipeline) GetUniqueIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UniqueId, true +} + +// SetUniqueId sets field value. +func (o *CIAppPipelineEventFinishedPipeline) SetUniqueId(v string) { + o.UniqueId = v +} + +// GetUrl returns the Url field value. +func (o *CIAppPipelineEventFinishedPipeline) GetUrl() string { + if o == nil { + var ret string + return ret + } + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventFinishedPipeline) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value. +func (o *CIAppPipelineEventFinishedPipeline) SetUrl(v string) { + o.Url = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppPipelineEventFinishedPipeline) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.End.Nanosecond() == 0 { + toSerialize["end"] = o.End.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["end"] = o.End.Format("2006-01-02T15:04:05.000Z07:00") + } + if o.Error.IsSet() { + toSerialize["error"] = o.Error.Get() + } + if o.Git.IsSet() { + toSerialize["git"] = o.Git.Get() + } + if o.IsManual.IsSet() { + toSerialize["is_manual"] = o.IsManual.Get() + } + if o.IsResumed.IsSet() { + toSerialize["is_resumed"] = o.IsResumed.Get() + } + toSerialize["level"] = o.Level + if o.Metrics.IsSet() { + toSerialize["metrics"] = o.Metrics.Get() + } + toSerialize["name"] = o.Name + if o.Node.IsSet() { + toSerialize["node"] = o.Node.Get() + } + if o.Parameters != nil { + toSerialize["parameters"] = o.Parameters + } + if o.ParentPipeline.IsSet() { + toSerialize["parent_pipeline"] = o.ParentPipeline.Get() + } + toSerialize["partial_retry"] = o.PartialRetry + if o.PipelineId != nil { + toSerialize["pipeline_id"] = o.PipelineId + } + if o.PreviousAttempt.IsSet() { + toSerialize["previous_attempt"] = o.PreviousAttempt.Get() + } + if o.QueueTime.IsSet() { + toSerialize["queue_time"] = o.QueueTime.Get() + } + if o.Start.Nanosecond() == 0 { + toSerialize["start"] = o.Start.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["start"] = o.Start.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["status"] = o.Status + if o.Tags.IsSet() { + toSerialize["tags"] = o.Tags.Get() + } + toSerialize["unique_id"] = o.UniqueId + toSerialize["url"] = o.Url + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppPipelineEventFinishedPipeline) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + End *time.Time `json:"end"` + Error NullableCIAppCIError `json:"error,omitempty"` + Git NullableCIAppGitInfo `json:"git,omitempty"` + IsManual datadog.NullableBool `json:"is_manual,omitempty"` + IsResumed datadog.NullableBool `json:"is_resumed,omitempty"` + Level *CIAppPipelineEventPipelineLevel `json:"level"` + Metrics datadog.NullableList[string] `json:"metrics,omitempty"` + Name *string `json:"name"` + Node NullableCIAppHostInfo `json:"node,omitempty"` + Parameters map[string]string `json:"parameters,omitempty"` + ParentPipeline NullableCIAppPipelineEventParentPipeline `json:"parent_pipeline,omitempty"` + PartialRetry *bool `json:"partial_retry"` + PipelineId *string `json:"pipeline_id,omitempty"` + PreviousAttempt NullableCIAppPipelineEventPreviousPipeline `json:"previous_attempt,omitempty"` + QueueTime datadog.NullableInt64 `json:"queue_time,omitempty"` + Start *time.Time `json:"start"` + Status *CIAppPipelineEventPipelineStatus `json:"status"` + Tags datadog.NullableList[string] `json:"tags,omitempty"` + UniqueId *string `json:"unique_id"` + Url *string `json:"url"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.End == nil { + return fmt.Errorf("required field end missing") + } + if all.Level == nil { + return fmt.Errorf("required field level missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.PartialRetry == nil { + return fmt.Errorf("required field partial_retry missing") + } + if all.Start == nil { + return fmt.Errorf("required field start missing") + } + if all.Status == nil { + return fmt.Errorf("required field status missing") + } + if all.UniqueId == nil { + return fmt.Errorf("required field unique_id missing") + } + if all.Url == nil { + return fmt.Errorf("required field url missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"end", "error", "git", "is_manual", "is_resumed", "level", "metrics", "name", "node", "parameters", "parent_pipeline", "partial_retry", "pipeline_id", "previous_attempt", "queue_time", "start", "status", "tags", "unique_id", "url"}) + } else { + return err + } + + hasInvalidField := false + o.End = *all.End + o.Error = all.Error + o.Git = all.Git + o.IsManual = all.IsManual + o.IsResumed = all.IsResumed + if !all.Level.IsValid() { + hasInvalidField = true + } else { + o.Level = *all.Level + } + o.Metrics = all.Metrics + o.Name = *all.Name + o.Node = all.Node + o.Parameters = all.Parameters + o.ParentPipeline = all.ParentPipeline + o.PartialRetry = *all.PartialRetry + o.PipelineId = all.PipelineId + o.PreviousAttempt = all.PreviousAttempt + o.QueueTime = all.QueueTime + o.Start = *all.Start + if !all.Status.IsValid() { + hasInvalidField = true + } else { + o.Status = *all.Status + } + o.Tags = all.Tags + o.UniqueId = *all.UniqueId + o.Url = *all.Url + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_ci_app_pipeline_event_in_progress_pipeline.go b/api/datadogV2/model_ci_app_pipeline_event_in_progress_pipeline.go new file mode 100644 index 00000000000..c345630409b --- /dev/null +++ b/api/datadogV2/model_ci_app_pipeline_event_in_progress_pipeline.go @@ -0,0 +1,848 @@ +// 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 datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CIAppPipelineEventInProgressPipeline Details of a running pipeline. +type CIAppPipelineEventInProgressPipeline struct { + // Contains information of the CI error. + Error NullableCIAppCIError `json:"error,omitempty"` + // 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. + Git NullableCIAppGitInfo `json:"git,omitempty"` + // Whether or not the pipeline was triggered manually by the user. + IsManual datadog.NullableBool `json:"is_manual,omitempty"` + // Whether or not the pipeline was resumed after being blocked. + IsResumed datadog.NullableBool `json:"is_resumed,omitempty"` + // Used to distinguish between pipelines, stages, jobs, and steps. + Level CIAppPipelineEventPipelineLevel `json:"level"` + // A list of user-defined metrics. The metrics must follow the `key:value` pattern and the value must be numeric. + Metrics datadog.NullableList[string] `json:"metrics,omitempty"` + // Name of the pipeline. All pipeline runs for the builds should have the same name. + Name string `json:"name"` + // Contains information of the host running the pipeline, stage, job, or step. + Node NullableCIAppHostInfo `json:"node,omitempty"` + // A map of key-value parameters or environment variables that were defined for the pipeline. + Parameters map[string]string `json:"parameters,omitempty"` + // If the pipeline is triggered as child of another pipeline, this should contain the details of the parent pipeline. + ParentPipeline NullableCIAppPipelineEventParentPipeline `json:"parent_pipeline,omitempty"` + // 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. + PartialRetry bool `json:"partial_retry"` + // 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. + PipelineId *string `json:"pipeline_id,omitempty"` + // If the pipeline is a retry, this should contain the details of the previous attempt. + PreviousAttempt NullableCIAppPipelineEventPreviousPipeline `json:"previous_attempt,omitempty"` + // The queue time in milliseconds, if applicable. + QueueTime datadog.NullableInt64 `json:"queue_time,omitempty"` + // Time when the pipeline run started (it should not include any queue time). The time format must be RFC3339. + Start time.Time `json:"start"` + // The in progress status of the pipeline. + Status CIAppPipelineEventPipelineInProgressStatus `json:"status"` + // A list of user-defined tags. The tags must follow the `key:value` pattern. + Tags datadog.NullableList[string] `json:"tags,omitempty"` + // UUID of the pipeline run. The ID has to be the same as the finished pipeline. + UniqueId string `json:"unique_id"` + // The URL to look at the pipeline in the CI provider UI. + Url string `json:"url"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCIAppPipelineEventInProgressPipeline instantiates a new CIAppPipelineEventInProgressPipeline object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCIAppPipelineEventInProgressPipeline(level CIAppPipelineEventPipelineLevel, name string, partialRetry bool, start time.Time, status CIAppPipelineEventPipelineInProgressStatus, uniqueId string, url string) *CIAppPipelineEventInProgressPipeline { + this := CIAppPipelineEventInProgressPipeline{} + this.Level = level + this.Name = name + this.PartialRetry = partialRetry + this.Start = start + this.Status = status + this.UniqueId = uniqueId + this.Url = url + return &this +} + +// NewCIAppPipelineEventInProgressPipelineWithDefaults instantiates a new CIAppPipelineEventInProgressPipeline object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCIAppPipelineEventInProgressPipelineWithDefaults() *CIAppPipelineEventInProgressPipeline { + this := CIAppPipelineEventInProgressPipeline{} + var level CIAppPipelineEventPipelineLevel = CIAPPPIPELINEEVENTPIPELINELEVEL_PIPELINE + this.Level = level + return &this +} + +// GetError returns the Error field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventInProgressPipeline) GetError() CIAppCIError { + if o == nil || o.Error.Get() == nil { + var ret CIAppCIError + return ret + } + return *o.Error.Get() +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventInProgressPipeline) GetErrorOk() (*CIAppCIError, bool) { + if o == nil { + return nil, false + } + return o.Error.Get(), o.Error.IsSet() +} + +// HasError returns a boolean if a field has been set. +func (o *CIAppPipelineEventInProgressPipeline) HasError() bool { + return o != nil && o.Error.IsSet() +} + +// SetError gets a reference to the given NullableCIAppCIError and assigns it to the Error field. +func (o *CIAppPipelineEventInProgressPipeline) SetError(v CIAppCIError) { + o.Error.Set(&v) +} + +// SetErrorNil sets the value for Error to be an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) SetErrorNil() { + o.Error.Set(nil) +} + +// UnsetError ensures that no value is present for Error, not even an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) UnsetError() { + o.Error.Unset() +} + +// GetGit returns the Git field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventInProgressPipeline) GetGit() CIAppGitInfo { + if o == nil || o.Git.Get() == nil { + var ret CIAppGitInfo + return ret + } + return *o.Git.Get() +} + +// GetGitOk returns a tuple with the Git field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventInProgressPipeline) GetGitOk() (*CIAppGitInfo, bool) { + if o == nil { + return nil, false + } + return o.Git.Get(), o.Git.IsSet() +} + +// HasGit returns a boolean if a field has been set. +func (o *CIAppPipelineEventInProgressPipeline) HasGit() bool { + return o != nil && o.Git.IsSet() +} + +// SetGit gets a reference to the given NullableCIAppGitInfo and assigns it to the Git field. +func (o *CIAppPipelineEventInProgressPipeline) SetGit(v CIAppGitInfo) { + o.Git.Set(&v) +} + +// SetGitNil sets the value for Git to be an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) SetGitNil() { + o.Git.Set(nil) +} + +// UnsetGit ensures that no value is present for Git, not even an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) UnsetGit() { + o.Git.Unset() +} + +// GetIsManual returns the IsManual field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventInProgressPipeline) GetIsManual() bool { + if o == nil || o.IsManual.Get() == nil { + var ret bool + return ret + } + return *o.IsManual.Get() +} + +// GetIsManualOk returns a tuple with the IsManual field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventInProgressPipeline) GetIsManualOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsManual.Get(), o.IsManual.IsSet() +} + +// HasIsManual returns a boolean if a field has been set. +func (o *CIAppPipelineEventInProgressPipeline) HasIsManual() bool { + return o != nil && o.IsManual.IsSet() +} + +// SetIsManual gets a reference to the given datadog.NullableBool and assigns it to the IsManual field. +func (o *CIAppPipelineEventInProgressPipeline) SetIsManual(v bool) { + o.IsManual.Set(&v) +} + +// SetIsManualNil sets the value for IsManual to be an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) SetIsManualNil() { + o.IsManual.Set(nil) +} + +// UnsetIsManual ensures that no value is present for IsManual, not even an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) UnsetIsManual() { + o.IsManual.Unset() +} + +// GetIsResumed returns the IsResumed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventInProgressPipeline) GetIsResumed() bool { + if o == nil || o.IsResumed.Get() == nil { + var ret bool + return ret + } + return *o.IsResumed.Get() +} + +// GetIsResumedOk returns a tuple with the IsResumed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventInProgressPipeline) GetIsResumedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.IsResumed.Get(), o.IsResumed.IsSet() +} + +// HasIsResumed returns a boolean if a field has been set. +func (o *CIAppPipelineEventInProgressPipeline) HasIsResumed() bool { + return o != nil && o.IsResumed.IsSet() +} + +// SetIsResumed gets a reference to the given datadog.NullableBool and assigns it to the IsResumed field. +func (o *CIAppPipelineEventInProgressPipeline) SetIsResumed(v bool) { + o.IsResumed.Set(&v) +} + +// SetIsResumedNil sets the value for IsResumed to be an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) SetIsResumedNil() { + o.IsResumed.Set(nil) +} + +// UnsetIsResumed ensures that no value is present for IsResumed, not even an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) UnsetIsResumed() { + o.IsResumed.Unset() +} + +// GetLevel returns the Level field value. +func (o *CIAppPipelineEventInProgressPipeline) GetLevel() CIAppPipelineEventPipelineLevel { + if o == nil { + var ret CIAppPipelineEventPipelineLevel + return ret + } + return o.Level +} + +// GetLevelOk returns a tuple with the Level field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventInProgressPipeline) GetLevelOk() (*CIAppPipelineEventPipelineLevel, bool) { + if o == nil { + return nil, false + } + return &o.Level, true +} + +// SetLevel sets field value. +func (o *CIAppPipelineEventInProgressPipeline) SetLevel(v CIAppPipelineEventPipelineLevel) { + o.Level = v +} + +// GetMetrics returns the Metrics field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventInProgressPipeline) GetMetrics() []string { + if o == nil || o.Metrics.Get() == nil { + var ret []string + return ret + } + return *o.Metrics.Get() +} + +// GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventInProgressPipeline) GetMetricsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return o.Metrics.Get(), o.Metrics.IsSet() +} + +// HasMetrics returns a boolean if a field has been set. +func (o *CIAppPipelineEventInProgressPipeline) HasMetrics() bool { + return o != nil && o.Metrics.IsSet() +} + +// SetMetrics gets a reference to the given datadog.NullableList[string] and assigns it to the Metrics field. +func (o *CIAppPipelineEventInProgressPipeline) SetMetrics(v []string) { + o.Metrics.Set(&v) +} + +// SetMetricsNil sets the value for Metrics to be an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) SetMetricsNil() { + o.Metrics.Set(nil) +} + +// UnsetMetrics ensures that no value is present for Metrics, not even an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) UnsetMetrics() { + o.Metrics.Unset() +} + +// GetName returns the Name field value. +func (o *CIAppPipelineEventInProgressPipeline) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventInProgressPipeline) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *CIAppPipelineEventInProgressPipeline) SetName(v string) { + o.Name = v +} + +// GetNode returns the Node field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventInProgressPipeline) GetNode() CIAppHostInfo { + if o == nil || o.Node.Get() == nil { + var ret CIAppHostInfo + return ret + } + return *o.Node.Get() +} + +// GetNodeOk returns a tuple with the Node field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventInProgressPipeline) GetNodeOk() (*CIAppHostInfo, bool) { + if o == nil { + return nil, false + } + return o.Node.Get(), o.Node.IsSet() +} + +// HasNode returns a boolean if a field has been set. +func (o *CIAppPipelineEventInProgressPipeline) HasNode() bool { + return o != nil && o.Node.IsSet() +} + +// SetNode gets a reference to the given NullableCIAppHostInfo and assigns it to the Node field. +func (o *CIAppPipelineEventInProgressPipeline) SetNode(v CIAppHostInfo) { + o.Node.Set(&v) +} + +// SetNodeNil sets the value for Node to be an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) SetNodeNil() { + o.Node.Set(nil) +} + +// UnsetNode ensures that no value is present for Node, not even an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) UnsetNode() { + o.Node.Unset() +} + +// GetParameters returns the Parameters field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventInProgressPipeline) GetParameters() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventInProgressPipeline) GetParametersOk() (*map[string]string, bool) { + if o == nil || o.Parameters == nil { + return nil, false + } + return &o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *CIAppPipelineEventInProgressPipeline) HasParameters() bool { + return o != nil && o.Parameters != nil +} + +// SetParameters gets a reference to the given map[string]string and assigns it to the Parameters field. +func (o *CIAppPipelineEventInProgressPipeline) SetParameters(v map[string]string) { + o.Parameters = v +} + +// GetParentPipeline returns the ParentPipeline field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventInProgressPipeline) GetParentPipeline() CIAppPipelineEventParentPipeline { + if o == nil || o.ParentPipeline.Get() == nil { + var ret CIAppPipelineEventParentPipeline + return ret + } + return *o.ParentPipeline.Get() +} + +// GetParentPipelineOk returns a tuple with the ParentPipeline field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventInProgressPipeline) GetParentPipelineOk() (*CIAppPipelineEventParentPipeline, bool) { + if o == nil { + return nil, false + } + return o.ParentPipeline.Get(), o.ParentPipeline.IsSet() +} + +// HasParentPipeline returns a boolean if a field has been set. +func (o *CIAppPipelineEventInProgressPipeline) HasParentPipeline() bool { + return o != nil && o.ParentPipeline.IsSet() +} + +// SetParentPipeline gets a reference to the given NullableCIAppPipelineEventParentPipeline and assigns it to the ParentPipeline field. +func (o *CIAppPipelineEventInProgressPipeline) SetParentPipeline(v CIAppPipelineEventParentPipeline) { + o.ParentPipeline.Set(&v) +} + +// SetParentPipelineNil sets the value for ParentPipeline to be an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) SetParentPipelineNil() { + o.ParentPipeline.Set(nil) +} + +// UnsetParentPipeline ensures that no value is present for ParentPipeline, not even an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) UnsetParentPipeline() { + o.ParentPipeline.Unset() +} + +// GetPartialRetry returns the PartialRetry field value. +func (o *CIAppPipelineEventInProgressPipeline) GetPartialRetry() bool { + if o == nil { + var ret bool + return ret + } + return o.PartialRetry +} + +// GetPartialRetryOk returns a tuple with the PartialRetry field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventInProgressPipeline) GetPartialRetryOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.PartialRetry, true +} + +// SetPartialRetry sets field value. +func (o *CIAppPipelineEventInProgressPipeline) SetPartialRetry(v bool) { + o.PartialRetry = v +} + +// GetPipelineId returns the PipelineId field value if set, zero value otherwise. +func (o *CIAppPipelineEventInProgressPipeline) GetPipelineId() string { + if o == nil || o.PipelineId == nil { + var ret string + return ret + } + return *o.PipelineId +} + +// GetPipelineIdOk returns a tuple with the PipelineId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventInProgressPipeline) GetPipelineIdOk() (*string, bool) { + if o == nil || o.PipelineId == nil { + return nil, false + } + return o.PipelineId, true +} + +// HasPipelineId returns a boolean if a field has been set. +func (o *CIAppPipelineEventInProgressPipeline) HasPipelineId() bool { + return o != nil && o.PipelineId != nil +} + +// SetPipelineId gets a reference to the given string and assigns it to the PipelineId field. +func (o *CIAppPipelineEventInProgressPipeline) SetPipelineId(v string) { + o.PipelineId = &v +} + +// GetPreviousAttempt returns the PreviousAttempt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventInProgressPipeline) GetPreviousAttempt() CIAppPipelineEventPreviousPipeline { + if o == nil || o.PreviousAttempt.Get() == nil { + var ret CIAppPipelineEventPreviousPipeline + return ret + } + return *o.PreviousAttempt.Get() +} + +// GetPreviousAttemptOk returns a tuple with the PreviousAttempt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventInProgressPipeline) GetPreviousAttemptOk() (*CIAppPipelineEventPreviousPipeline, bool) { + if o == nil { + return nil, false + } + return o.PreviousAttempt.Get(), o.PreviousAttempt.IsSet() +} + +// HasPreviousAttempt returns a boolean if a field has been set. +func (o *CIAppPipelineEventInProgressPipeline) HasPreviousAttempt() bool { + return o != nil && o.PreviousAttempt.IsSet() +} + +// SetPreviousAttempt gets a reference to the given NullableCIAppPipelineEventPreviousPipeline and assigns it to the PreviousAttempt field. +func (o *CIAppPipelineEventInProgressPipeline) SetPreviousAttempt(v CIAppPipelineEventPreviousPipeline) { + o.PreviousAttempt.Set(&v) +} + +// SetPreviousAttemptNil sets the value for PreviousAttempt to be an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) SetPreviousAttemptNil() { + o.PreviousAttempt.Set(nil) +} + +// UnsetPreviousAttempt ensures that no value is present for PreviousAttempt, not even an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) UnsetPreviousAttempt() { + o.PreviousAttempt.Unset() +} + +// GetQueueTime returns the QueueTime field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventInProgressPipeline) GetQueueTime() int64 { + if o == nil || o.QueueTime.Get() == nil { + var ret int64 + return ret + } + return *o.QueueTime.Get() +} + +// GetQueueTimeOk returns a tuple with the QueueTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventInProgressPipeline) GetQueueTimeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.QueueTime.Get(), o.QueueTime.IsSet() +} + +// HasQueueTime returns a boolean if a field has been set. +func (o *CIAppPipelineEventInProgressPipeline) HasQueueTime() bool { + return o != nil && o.QueueTime.IsSet() +} + +// SetQueueTime gets a reference to the given datadog.NullableInt64 and assigns it to the QueueTime field. +func (o *CIAppPipelineEventInProgressPipeline) SetQueueTime(v int64) { + o.QueueTime.Set(&v) +} + +// SetQueueTimeNil sets the value for QueueTime to be an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) SetQueueTimeNil() { + o.QueueTime.Set(nil) +} + +// UnsetQueueTime ensures that no value is present for QueueTime, not even an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) UnsetQueueTime() { + o.QueueTime.Unset() +} + +// GetStart returns the Start field value. +func (o *CIAppPipelineEventInProgressPipeline) GetStart() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.Start +} + +// GetStartOk returns a tuple with the Start field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventInProgressPipeline) GetStartOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Start, true +} + +// SetStart sets field value. +func (o *CIAppPipelineEventInProgressPipeline) SetStart(v time.Time) { + o.Start = v +} + +// GetStatus returns the Status field value. +func (o *CIAppPipelineEventInProgressPipeline) GetStatus() CIAppPipelineEventPipelineInProgressStatus { + if o == nil { + var ret CIAppPipelineEventPipelineInProgressStatus + return ret + } + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventInProgressPipeline) GetStatusOk() (*CIAppPipelineEventPipelineInProgressStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value. +func (o *CIAppPipelineEventInProgressPipeline) SetStatus(v CIAppPipelineEventPipelineInProgressStatus) { + o.Status = v +} + +// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CIAppPipelineEventInProgressPipeline) GetTags() []string { + if o == nil || o.Tags.Get() == nil { + var ret []string + return ret + } + return *o.Tags.Get() +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CIAppPipelineEventInProgressPipeline) GetTagsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return o.Tags.Get(), o.Tags.IsSet() +} + +// HasTags returns a boolean if a field has been set. +func (o *CIAppPipelineEventInProgressPipeline) HasTags() bool { + return o != nil && o.Tags.IsSet() +} + +// SetTags gets a reference to the given datadog.NullableList[string] and assigns it to the Tags field. +func (o *CIAppPipelineEventInProgressPipeline) SetTags(v []string) { + o.Tags.Set(&v) +} + +// SetTagsNil sets the value for Tags to be an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) SetTagsNil() { + o.Tags.Set(nil) +} + +// UnsetTags ensures that no value is present for Tags, not even an explicit nil. +func (o *CIAppPipelineEventInProgressPipeline) UnsetTags() { + o.Tags.Unset() +} + +// GetUniqueId returns the UniqueId field value. +func (o *CIAppPipelineEventInProgressPipeline) GetUniqueId() string { + if o == nil { + var ret string + return ret + } + return o.UniqueId +} + +// GetUniqueIdOk returns a tuple with the UniqueId field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventInProgressPipeline) GetUniqueIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UniqueId, true +} + +// SetUniqueId sets field value. +func (o *CIAppPipelineEventInProgressPipeline) SetUniqueId(v string) { + o.UniqueId = v +} + +// GetUrl returns the Url field value. +func (o *CIAppPipelineEventInProgressPipeline) GetUrl() string { + if o == nil { + var ret string + return ret + } + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *CIAppPipelineEventInProgressPipeline) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value. +func (o *CIAppPipelineEventInProgressPipeline) SetUrl(v string) { + o.Url = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CIAppPipelineEventInProgressPipeline) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Error.IsSet() { + toSerialize["error"] = o.Error.Get() + } + if o.Git.IsSet() { + toSerialize["git"] = o.Git.Get() + } + if o.IsManual.IsSet() { + toSerialize["is_manual"] = o.IsManual.Get() + } + if o.IsResumed.IsSet() { + toSerialize["is_resumed"] = o.IsResumed.Get() + } + toSerialize["level"] = o.Level + if o.Metrics.IsSet() { + toSerialize["metrics"] = o.Metrics.Get() + } + toSerialize["name"] = o.Name + if o.Node.IsSet() { + toSerialize["node"] = o.Node.Get() + } + if o.Parameters != nil { + toSerialize["parameters"] = o.Parameters + } + if o.ParentPipeline.IsSet() { + toSerialize["parent_pipeline"] = o.ParentPipeline.Get() + } + toSerialize["partial_retry"] = o.PartialRetry + if o.PipelineId != nil { + toSerialize["pipeline_id"] = o.PipelineId + } + if o.PreviousAttempt.IsSet() { + toSerialize["previous_attempt"] = o.PreviousAttempt.Get() + } + if o.QueueTime.IsSet() { + toSerialize["queue_time"] = o.QueueTime.Get() + } + if o.Start.Nanosecond() == 0 { + toSerialize["start"] = o.Start.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["start"] = o.Start.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["status"] = o.Status + if o.Tags.IsSet() { + toSerialize["tags"] = o.Tags.Get() + } + toSerialize["unique_id"] = o.UniqueId + toSerialize["url"] = o.Url + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CIAppPipelineEventInProgressPipeline) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Error NullableCIAppCIError `json:"error,omitempty"` + Git NullableCIAppGitInfo `json:"git,omitempty"` + IsManual datadog.NullableBool `json:"is_manual,omitempty"` + IsResumed datadog.NullableBool `json:"is_resumed,omitempty"` + Level *CIAppPipelineEventPipelineLevel `json:"level"` + Metrics datadog.NullableList[string] `json:"metrics,omitempty"` + Name *string `json:"name"` + Node NullableCIAppHostInfo `json:"node,omitempty"` + Parameters map[string]string `json:"parameters,omitempty"` + ParentPipeline NullableCIAppPipelineEventParentPipeline `json:"parent_pipeline,omitempty"` + PartialRetry *bool `json:"partial_retry"` + PipelineId *string `json:"pipeline_id,omitempty"` + PreviousAttempt NullableCIAppPipelineEventPreviousPipeline `json:"previous_attempt,omitempty"` + QueueTime datadog.NullableInt64 `json:"queue_time,omitempty"` + Start *time.Time `json:"start"` + Status *CIAppPipelineEventPipelineInProgressStatus `json:"status"` + Tags datadog.NullableList[string] `json:"tags,omitempty"` + UniqueId *string `json:"unique_id"` + Url *string `json:"url"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Level == nil { + return fmt.Errorf("required field level missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.PartialRetry == nil { + return fmt.Errorf("required field partial_retry missing") + } + if all.Start == nil { + return fmt.Errorf("required field start missing") + } + if all.Status == nil { + return fmt.Errorf("required field status missing") + } + if all.UniqueId == nil { + return fmt.Errorf("required field unique_id missing") + } + if all.Url == nil { + return fmt.Errorf("required field url missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"error", "git", "is_manual", "is_resumed", "level", "metrics", "name", "node", "parameters", "parent_pipeline", "partial_retry", "pipeline_id", "previous_attempt", "queue_time", "start", "status", "tags", "unique_id", "url"}) + } else { + return err + } + + hasInvalidField := false + o.Error = all.Error + o.Git = all.Git + o.IsManual = all.IsManual + o.IsResumed = all.IsResumed + if !all.Level.IsValid() { + hasInvalidField = true + } else { + o.Level = *all.Level + } + o.Metrics = all.Metrics + o.Name = *all.Name + o.Node = all.Node + o.Parameters = all.Parameters + o.ParentPipeline = all.ParentPipeline + o.PartialRetry = *all.PartialRetry + o.PipelineId = all.PipelineId + o.PreviousAttempt = all.PreviousAttempt + o.QueueTime = all.QueueTime + o.Start = *all.Start + if !all.Status.IsValid() { + hasInvalidField = true + } else { + o.Status = *all.Status + } + o.Tags = all.Tags + o.UniqueId = *all.UniqueId + o.Url = *all.Url + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_ci_app_pipeline_event_pipeline.go b/api/datadogV2/model_ci_app_pipeline_event_pipeline.go index 12b01557f8f..b4996103e49 100644 --- a/api/datadogV2/model_ci_app_pipeline_event_pipeline.go +++ b/api/datadogV2/model_ci_app_pipeline_event_pipeline.go @@ -5,881 +5,101 @@ package datadogV2 import ( - "fmt" - "time" - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CIAppPipelineEventPipeline Details of the top level pipeline, build, or workflow of your CI. +// CIAppPipelineEventPipeline - Details of the top level pipeline, build, or workflow of your CI. type CIAppPipelineEventPipeline struct { - // 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. - End time.Time `json:"end"` - // Contains information of the CI error. - Error NullableCIAppCIError `json:"error,omitempty"` - // 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. - Git NullableCIAppGitInfo `json:"git,omitempty"` - // Whether or not the pipeline was triggered manually by the user. - IsManual datadog.NullableBool `json:"is_manual,omitempty"` - // Whether or not the pipeline was resumed after being blocked. - IsResumed datadog.NullableBool `json:"is_resumed,omitempty"` - // Used to distinguish between pipelines, stages, jobs, and steps. - Level CIAppPipelineEventPipelineLevel `json:"level"` - // A list of user-defined metrics. The metrics must follow the `key:value` pattern and the value must be numeric. - Metrics datadog.NullableList[string] `json:"metrics,omitempty"` - // Name of the pipeline. All pipeline runs for the builds should have the same name. - Name string `json:"name"` - // Contains information of the host running the pipeline, stage, job, or step. - Node NullableCIAppHostInfo `json:"node,omitempty"` - // A map of key-value parameters or environment variables that were defined for the pipeline. - Parameters map[string]string `json:"parameters,omitempty"` - // If the pipeline is triggered as child of another pipeline, this should contain the details of the parent pipeline. - ParentPipeline NullableCIAppPipelineEventParentPipeline `json:"parent_pipeline,omitempty"` - // 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. - PartialRetry bool `json:"partial_retry"` - // 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. - PipelineId *string `json:"pipeline_id,omitempty"` - // If the pipeline is a retry, this should contain the details of the previous attempt. - PreviousAttempt NullableCIAppPipelineEventPreviousPipeline `json:"previous_attempt,omitempty"` - // The queue time in milliseconds, if applicable. - QueueTime datadog.NullableInt64 `json:"queue_time,omitempty"` - // Time when the pipeline run started (it should not include any queue time). The time format must be RFC3339. - Start time.Time `json:"start"` - // The final status of the pipeline. - Status CIAppPipelineEventPipelineStatus `json:"status"` - // A list of user-defined tags. The tags must follow the `key:value` pattern. - Tags datadog.NullableList[string] `json:"tags,omitempty"` - // UUID of the pipeline run. The ID has to be unique across retries and pipelines, - // including partial retries. - UniqueId string `json:"unique_id"` - // The URL to look at the pipeline in the CI provider UI. - Url string `json:"url"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewCIAppPipelineEventPipeline instantiates a new CIAppPipelineEventPipeline object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewCIAppPipelineEventPipeline(end time.Time, level CIAppPipelineEventPipelineLevel, name string, partialRetry bool, start time.Time, status CIAppPipelineEventPipelineStatus, uniqueId string, url string) *CIAppPipelineEventPipeline { - this := CIAppPipelineEventPipeline{} - this.End = end - this.Level = level - this.Name = name - this.PartialRetry = partialRetry - this.Start = start - this.Status = status - this.UniqueId = uniqueId - this.Url = url - return &this -} - -// NewCIAppPipelineEventPipelineWithDefaults instantiates a new CIAppPipelineEventPipeline object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewCIAppPipelineEventPipelineWithDefaults() *CIAppPipelineEventPipeline { - this := CIAppPipelineEventPipeline{} - var level CIAppPipelineEventPipelineLevel = CIAPPPIPELINEEVENTPIPELINELEVEL_PIPELINE - this.Level = level - return &this -} - -// GetEnd returns the End field value. -func (o *CIAppPipelineEventPipeline) GetEnd() time.Time { - if o == nil { - var ret time.Time - return ret - } - return o.End -} - -// GetEndOk returns a tuple with the End field value -// and a boolean to check if the value has been set. -func (o *CIAppPipelineEventPipeline) GetEndOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.End, true -} - -// SetEnd sets field value. -func (o *CIAppPipelineEventPipeline) SetEnd(v time.Time) { - o.End = v -} - -// GetError returns the Error field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CIAppPipelineEventPipeline) GetError() CIAppCIError { - if o == nil || o.Error.Get() == nil { - var ret CIAppCIError - return ret - } - return *o.Error.Get() -} - -// GetErrorOk returns a tuple with the Error field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned. -func (o *CIAppPipelineEventPipeline) GetErrorOk() (*CIAppCIError, bool) { - if o == nil { - return nil, false - } - return o.Error.Get(), o.Error.IsSet() -} - -// HasError returns a boolean if a field has been set. -func (o *CIAppPipelineEventPipeline) HasError() bool { - return o != nil && o.Error.IsSet() -} - -// SetError gets a reference to the given NullableCIAppCIError and assigns it to the Error field. -func (o *CIAppPipelineEventPipeline) SetError(v CIAppCIError) { - o.Error.Set(&v) -} - -// SetErrorNil sets the value for Error to be an explicit nil. -func (o *CIAppPipelineEventPipeline) SetErrorNil() { - o.Error.Set(nil) -} - -// UnsetError ensures that no value is present for Error, not even an explicit nil. -func (o *CIAppPipelineEventPipeline) UnsetError() { - o.Error.Unset() -} - -// GetGit returns the Git field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CIAppPipelineEventPipeline) GetGit() CIAppGitInfo { - if o == nil || o.Git.Get() == nil { - var ret CIAppGitInfo - return ret - } - return *o.Git.Get() -} - -// GetGitOk returns a tuple with the Git field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned. -func (o *CIAppPipelineEventPipeline) GetGitOk() (*CIAppGitInfo, bool) { - if o == nil { - return nil, false - } - return o.Git.Get(), o.Git.IsSet() -} - -// HasGit returns a boolean if a field has been set. -func (o *CIAppPipelineEventPipeline) HasGit() bool { - return o != nil && o.Git.IsSet() -} - -// SetGit gets a reference to the given NullableCIAppGitInfo and assigns it to the Git field. -func (o *CIAppPipelineEventPipeline) SetGit(v CIAppGitInfo) { - o.Git.Set(&v) -} - -// SetGitNil sets the value for Git to be an explicit nil. -func (o *CIAppPipelineEventPipeline) SetGitNil() { - o.Git.Set(nil) -} - -// UnsetGit ensures that no value is present for Git, not even an explicit nil. -func (o *CIAppPipelineEventPipeline) UnsetGit() { - o.Git.Unset() -} - -// GetIsManual returns the IsManual field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CIAppPipelineEventPipeline) GetIsManual() bool { - if o == nil || o.IsManual.Get() == nil { - var ret bool - return ret - } - return *o.IsManual.Get() -} - -// GetIsManualOk returns a tuple with the IsManual field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned. -func (o *CIAppPipelineEventPipeline) GetIsManualOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsManual.Get(), o.IsManual.IsSet() -} - -// HasIsManual returns a boolean if a field has been set. -func (o *CIAppPipelineEventPipeline) HasIsManual() bool { - return o != nil && o.IsManual.IsSet() -} - -// SetIsManual gets a reference to the given datadog.NullableBool and assigns it to the IsManual field. -func (o *CIAppPipelineEventPipeline) SetIsManual(v bool) { - o.IsManual.Set(&v) -} - -// SetIsManualNil sets the value for IsManual to be an explicit nil. -func (o *CIAppPipelineEventPipeline) SetIsManualNil() { - o.IsManual.Set(nil) -} - -// UnsetIsManual ensures that no value is present for IsManual, not even an explicit nil. -func (o *CIAppPipelineEventPipeline) UnsetIsManual() { - o.IsManual.Unset() -} - -// GetIsResumed returns the IsResumed field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CIAppPipelineEventPipeline) GetIsResumed() bool { - if o == nil || o.IsResumed.Get() == nil { - var ret bool - return ret - } - return *o.IsResumed.Get() -} - -// GetIsResumedOk returns a tuple with the IsResumed field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned. -func (o *CIAppPipelineEventPipeline) GetIsResumedOk() (*bool, bool) { - if o == nil { - return nil, false - } - return o.IsResumed.Get(), o.IsResumed.IsSet() -} - -// HasIsResumed returns a boolean if a field has been set. -func (o *CIAppPipelineEventPipeline) HasIsResumed() bool { - return o != nil && o.IsResumed.IsSet() -} - -// SetIsResumed gets a reference to the given datadog.NullableBool and assigns it to the IsResumed field. -func (o *CIAppPipelineEventPipeline) SetIsResumed(v bool) { - o.IsResumed.Set(&v) -} - -// SetIsResumedNil sets the value for IsResumed to be an explicit nil. -func (o *CIAppPipelineEventPipeline) SetIsResumedNil() { - o.IsResumed.Set(nil) -} - -// UnsetIsResumed ensures that no value is present for IsResumed, not even an explicit nil. -func (o *CIAppPipelineEventPipeline) UnsetIsResumed() { - o.IsResumed.Unset() -} - -// GetLevel returns the Level field value. -func (o *CIAppPipelineEventPipeline) GetLevel() CIAppPipelineEventPipelineLevel { - if o == nil { - var ret CIAppPipelineEventPipelineLevel - return ret - } - return o.Level -} - -// GetLevelOk returns a tuple with the Level field value -// and a boolean to check if the value has been set. -func (o *CIAppPipelineEventPipeline) GetLevelOk() (*CIAppPipelineEventPipelineLevel, bool) { - if o == nil { - return nil, false - } - return &o.Level, true -} - -// SetLevel sets field value. -func (o *CIAppPipelineEventPipeline) SetLevel(v CIAppPipelineEventPipelineLevel) { - o.Level = v -} - -// GetMetrics returns the Metrics field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CIAppPipelineEventPipeline) GetMetrics() []string { - if o == nil || o.Metrics.Get() == nil { - var ret []string - return ret - } - return *o.Metrics.Get() -} - -// GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned. -func (o *CIAppPipelineEventPipeline) GetMetricsOk() (*[]string, bool) { - if o == nil { - return nil, false - } - return o.Metrics.Get(), o.Metrics.IsSet() -} - -// HasMetrics returns a boolean if a field has been set. -func (o *CIAppPipelineEventPipeline) HasMetrics() bool { - return o != nil && o.Metrics.IsSet() -} - -// SetMetrics gets a reference to the given datadog.NullableList[string] and assigns it to the Metrics field. -func (o *CIAppPipelineEventPipeline) SetMetrics(v []string) { - o.Metrics.Set(&v) -} - -// SetMetricsNil sets the value for Metrics to be an explicit nil. -func (o *CIAppPipelineEventPipeline) SetMetricsNil() { - o.Metrics.Set(nil) -} - -// UnsetMetrics ensures that no value is present for Metrics, not even an explicit nil. -func (o *CIAppPipelineEventPipeline) UnsetMetrics() { - o.Metrics.Unset() -} - -// GetName returns the Name field value. -func (o *CIAppPipelineEventPipeline) GetName() string { - if o == nil { - var ret string - return ret - } - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *CIAppPipelineEventPipeline) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value. -func (o *CIAppPipelineEventPipeline) SetName(v string) { - o.Name = v -} - -// GetNode returns the Node field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CIAppPipelineEventPipeline) GetNode() CIAppHostInfo { - if o == nil || o.Node.Get() == nil { - var ret CIAppHostInfo - return ret - } - return *o.Node.Get() -} - -// GetNodeOk returns a tuple with the Node field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned. -func (o *CIAppPipelineEventPipeline) GetNodeOk() (*CIAppHostInfo, bool) { - if o == nil { - return nil, false - } - return o.Node.Get(), o.Node.IsSet() -} - -// HasNode returns a boolean if a field has been set. -func (o *CIAppPipelineEventPipeline) HasNode() bool { - return o != nil && o.Node.IsSet() -} - -// SetNode gets a reference to the given NullableCIAppHostInfo and assigns it to the Node field. -func (o *CIAppPipelineEventPipeline) SetNode(v CIAppHostInfo) { - o.Node.Set(&v) -} - -// SetNodeNil sets the value for Node to be an explicit nil. -func (o *CIAppPipelineEventPipeline) SetNodeNil() { - o.Node.Set(nil) -} - -// UnsetNode ensures that no value is present for Node, not even an explicit nil. -func (o *CIAppPipelineEventPipeline) UnsetNode() { - o.Node.Unset() -} - -// GetParameters returns the Parameters field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CIAppPipelineEventPipeline) GetParameters() map[string]string { - if o == nil { - var ret map[string]string - return ret - } - return o.Parameters -} - -// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned. -func (o *CIAppPipelineEventPipeline) GetParametersOk() (*map[string]string, bool) { - if o == nil || o.Parameters == nil { - return nil, false - } - return &o.Parameters, true -} - -// HasParameters returns a boolean if a field has been set. -func (o *CIAppPipelineEventPipeline) HasParameters() bool { - return o != nil && o.Parameters != nil -} - -// SetParameters gets a reference to the given map[string]string and assigns it to the Parameters field. -func (o *CIAppPipelineEventPipeline) SetParameters(v map[string]string) { - o.Parameters = v -} - -// GetParentPipeline returns the ParentPipeline field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CIAppPipelineEventPipeline) GetParentPipeline() CIAppPipelineEventParentPipeline { - if o == nil || o.ParentPipeline.Get() == nil { - var ret CIAppPipelineEventParentPipeline - return ret - } - return *o.ParentPipeline.Get() -} - -// GetParentPipelineOk returns a tuple with the ParentPipeline field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned. -func (o *CIAppPipelineEventPipeline) GetParentPipelineOk() (*CIAppPipelineEventParentPipeline, bool) { - if o == nil { - return nil, false - } - return o.ParentPipeline.Get(), o.ParentPipeline.IsSet() -} - -// HasParentPipeline returns a boolean if a field has been set. -func (o *CIAppPipelineEventPipeline) HasParentPipeline() bool { - return o != nil && o.ParentPipeline.IsSet() -} - -// SetParentPipeline gets a reference to the given NullableCIAppPipelineEventParentPipeline and assigns it to the ParentPipeline field. -func (o *CIAppPipelineEventPipeline) SetParentPipeline(v CIAppPipelineEventParentPipeline) { - o.ParentPipeline.Set(&v) -} - -// SetParentPipelineNil sets the value for ParentPipeline to be an explicit nil. -func (o *CIAppPipelineEventPipeline) SetParentPipelineNil() { - o.ParentPipeline.Set(nil) -} - -// UnsetParentPipeline ensures that no value is present for ParentPipeline, not even an explicit nil. -func (o *CIAppPipelineEventPipeline) UnsetParentPipeline() { - o.ParentPipeline.Unset() -} - -// GetPartialRetry returns the PartialRetry field value. -func (o *CIAppPipelineEventPipeline) GetPartialRetry() bool { - if o == nil { - var ret bool - return ret - } - return o.PartialRetry -} - -// GetPartialRetryOk returns a tuple with the PartialRetry field value -// and a boolean to check if the value has been set. -func (o *CIAppPipelineEventPipeline) GetPartialRetryOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.PartialRetry, true -} - -// SetPartialRetry sets field value. -func (o *CIAppPipelineEventPipeline) SetPartialRetry(v bool) { - o.PartialRetry = v -} - -// GetPipelineId returns the PipelineId field value if set, zero value otherwise. -func (o *CIAppPipelineEventPipeline) GetPipelineId() string { - if o == nil || o.PipelineId == nil { - var ret string - return ret - } - return *o.PipelineId -} - -// GetPipelineIdOk returns a tuple with the PipelineId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *CIAppPipelineEventPipeline) GetPipelineIdOk() (*string, bool) { - if o == nil || o.PipelineId == nil { - return nil, false - } - return o.PipelineId, true -} - -// HasPipelineId returns a boolean if a field has been set. -func (o *CIAppPipelineEventPipeline) HasPipelineId() bool { - return o != nil && o.PipelineId != nil -} - -// SetPipelineId gets a reference to the given string and assigns it to the PipelineId field. -func (o *CIAppPipelineEventPipeline) SetPipelineId(v string) { - o.PipelineId = &v -} - -// GetPreviousAttempt returns the PreviousAttempt field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CIAppPipelineEventPipeline) GetPreviousAttempt() CIAppPipelineEventPreviousPipeline { - if o == nil || o.PreviousAttempt.Get() == nil { - var ret CIAppPipelineEventPreviousPipeline - return ret - } - return *o.PreviousAttempt.Get() -} - -// GetPreviousAttemptOk returns a tuple with the PreviousAttempt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned. -func (o *CIAppPipelineEventPipeline) GetPreviousAttemptOk() (*CIAppPipelineEventPreviousPipeline, bool) { - if o == nil { - return nil, false - } - return o.PreviousAttempt.Get(), o.PreviousAttempt.IsSet() -} - -// HasPreviousAttempt returns a boolean if a field has been set. -func (o *CIAppPipelineEventPipeline) HasPreviousAttempt() bool { - return o != nil && o.PreviousAttempt.IsSet() -} - -// SetPreviousAttempt gets a reference to the given NullableCIAppPipelineEventPreviousPipeline and assigns it to the PreviousAttempt field. -func (o *CIAppPipelineEventPipeline) SetPreviousAttempt(v CIAppPipelineEventPreviousPipeline) { - o.PreviousAttempt.Set(&v) -} - -// SetPreviousAttemptNil sets the value for PreviousAttempt to be an explicit nil. -func (o *CIAppPipelineEventPipeline) SetPreviousAttemptNil() { - o.PreviousAttempt.Set(nil) -} - -// UnsetPreviousAttempt ensures that no value is present for PreviousAttempt, not even an explicit nil. -func (o *CIAppPipelineEventPipeline) UnsetPreviousAttempt() { - o.PreviousAttempt.Unset() -} - -// GetQueueTime returns the QueueTime field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CIAppPipelineEventPipeline) GetQueueTime() int64 { - if o == nil || o.QueueTime.Get() == nil { - var ret int64 - return ret - } - return *o.QueueTime.Get() -} - -// GetQueueTimeOk returns a tuple with the QueueTime field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned. -func (o *CIAppPipelineEventPipeline) GetQueueTimeOk() (*int64, bool) { - if o == nil { - return nil, false - } - return o.QueueTime.Get(), o.QueueTime.IsSet() -} - -// HasQueueTime returns a boolean if a field has been set. -func (o *CIAppPipelineEventPipeline) HasQueueTime() bool { - return o != nil && o.QueueTime.IsSet() -} - -// SetQueueTime gets a reference to the given datadog.NullableInt64 and assigns it to the QueueTime field. -func (o *CIAppPipelineEventPipeline) SetQueueTime(v int64) { - o.QueueTime.Set(&v) -} - -// SetQueueTimeNil sets the value for QueueTime to be an explicit nil. -func (o *CIAppPipelineEventPipeline) SetQueueTimeNil() { - o.QueueTime.Set(nil) -} - -// UnsetQueueTime ensures that no value is present for QueueTime, not even an explicit nil. -func (o *CIAppPipelineEventPipeline) UnsetQueueTime() { - o.QueueTime.Unset() -} - -// GetStart returns the Start field value. -func (o *CIAppPipelineEventPipeline) GetStart() time.Time { - if o == nil { - var ret time.Time - return ret - } - return o.Start -} - -// GetStartOk returns a tuple with the Start field value -// and a boolean to check if the value has been set. -func (o *CIAppPipelineEventPipeline) GetStartOk() (*time.Time, bool) { - if o == nil { - return nil, false - } - return &o.Start, true -} - -// SetStart sets field value. -func (o *CIAppPipelineEventPipeline) SetStart(v time.Time) { - o.Start = v -} - -// GetStatus returns the Status field value. -func (o *CIAppPipelineEventPipeline) GetStatus() CIAppPipelineEventPipelineStatus { - if o == nil { - var ret CIAppPipelineEventPipelineStatus - return ret - } - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *CIAppPipelineEventPipeline) GetStatusOk() (*CIAppPipelineEventPipelineStatus, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value. -func (o *CIAppPipelineEventPipeline) SetStatus(v CIAppPipelineEventPipelineStatus) { - o.Status = v -} - -// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *CIAppPipelineEventPipeline) GetTags() []string { - if o == nil || o.Tags.Get() == nil { - var ret []string - return ret - } - return *o.Tags.Get() -} + CIAppPipelineEventFinishedPipeline *CIAppPipelineEventFinishedPipeline + CIAppPipelineEventInProgressPipeline *CIAppPipelineEventInProgressPipeline -// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned. -func (o *CIAppPipelineEventPipeline) GetTagsOk() (*[]string, bool) { - if o == nil { - return nil, false - } - return o.Tags.Get(), o.Tags.IsSet() -} - -// HasTags returns a boolean if a field has been set. -func (o *CIAppPipelineEventPipeline) HasTags() bool { - return o != nil && o.Tags.IsSet() -} - -// SetTags gets a reference to the given datadog.NullableList[string] and assigns it to the Tags field. -func (o *CIAppPipelineEventPipeline) SetTags(v []string) { - o.Tags.Set(&v) -} - -// SetTagsNil sets the value for Tags to be an explicit nil. -func (o *CIAppPipelineEventPipeline) SetTagsNil() { - o.Tags.Set(nil) -} - -// UnsetTags ensures that no value is present for Tags, not even an explicit nil. -func (o *CIAppPipelineEventPipeline) UnsetTags() { - o.Tags.Unset() -} - -// GetUniqueId returns the UniqueId field value. -func (o *CIAppPipelineEventPipeline) GetUniqueId() string { - if o == nil { - var ret string - return ret - } - return o.UniqueId -} - -// GetUniqueIdOk returns a tuple with the UniqueId field value -// and a boolean to check if the value has been set. -func (o *CIAppPipelineEventPipeline) GetUniqueIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.UniqueId, true -} - -// SetUniqueId sets field value. -func (o *CIAppPipelineEventPipeline) SetUniqueId(v string) { - o.UniqueId = v -} - -// GetUrl returns the Url field value. -func (o *CIAppPipelineEventPipeline) GetUrl() string { - if o == nil { - var ret string - return ret - } - return o.Url -} - -// GetUrlOk returns a tuple with the Url field value -// and a boolean to check if the value has been set. -func (o *CIAppPipelineEventPipeline) GetUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Url, true -} - -// SetUrl sets field value. -func (o *CIAppPipelineEventPipeline) SetUrl(v string) { - o.Url = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o CIAppPipelineEventPipeline) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.End.Nanosecond() == 0 { - toSerialize["end"] = o.End.Format("2006-01-02T15:04:05Z07:00") + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// CIAppPipelineEventFinishedPipelineAsCIAppPipelineEventPipeline is a convenience function that returns CIAppPipelineEventFinishedPipeline wrapped in CIAppPipelineEventPipeline. +func CIAppPipelineEventFinishedPipelineAsCIAppPipelineEventPipeline(v *CIAppPipelineEventFinishedPipeline) CIAppPipelineEventPipeline { + return CIAppPipelineEventPipeline{CIAppPipelineEventFinishedPipeline: v} +} + +// CIAppPipelineEventInProgressPipelineAsCIAppPipelineEventPipeline is a convenience function that returns CIAppPipelineEventInProgressPipeline wrapped in CIAppPipelineEventPipeline. +func CIAppPipelineEventInProgressPipelineAsCIAppPipelineEventPipeline(v *CIAppPipelineEventInProgressPipeline) CIAppPipelineEventPipeline { + return CIAppPipelineEventPipeline{CIAppPipelineEventInProgressPipeline: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *CIAppPipelineEventPipeline) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CIAppPipelineEventFinishedPipeline + err = datadog.Unmarshal(data, &obj.CIAppPipelineEventFinishedPipeline) + if err == nil { + if obj.CIAppPipelineEventFinishedPipeline != nil && obj.CIAppPipelineEventFinishedPipeline.UnparsedObject == nil { + jsonCIAppPipelineEventFinishedPipeline, _ := datadog.Marshal(obj.CIAppPipelineEventFinishedPipeline) + if string(jsonCIAppPipelineEventFinishedPipeline) == "{}" { // empty struct + obj.CIAppPipelineEventFinishedPipeline = nil + } else { + match++ + } + } else { + obj.CIAppPipelineEventFinishedPipeline = nil + } } else { - toSerialize["end"] = o.End.Format("2006-01-02T15:04:05.000Z07:00") - } - if o.Error.IsSet() { - toSerialize["error"] = o.Error.Get() - } - if o.Git.IsSet() { - toSerialize["git"] = o.Git.Get() - } - if o.IsManual.IsSet() { - toSerialize["is_manual"] = o.IsManual.Get() - } - if o.IsResumed.IsSet() { - toSerialize["is_resumed"] = o.IsResumed.Get() - } - toSerialize["level"] = o.Level - if o.Metrics.IsSet() { - toSerialize["metrics"] = o.Metrics.Get() - } - toSerialize["name"] = o.Name - if o.Node.IsSet() { - toSerialize["node"] = o.Node.Get() - } - if o.Parameters != nil { - toSerialize["parameters"] = o.Parameters - } - if o.ParentPipeline.IsSet() { - toSerialize["parent_pipeline"] = o.ParentPipeline.Get() - } - toSerialize["partial_retry"] = o.PartialRetry - if o.PipelineId != nil { - toSerialize["pipeline_id"] = o.PipelineId - } - if o.PreviousAttempt.IsSet() { - toSerialize["previous_attempt"] = o.PreviousAttempt.Get() - } - if o.QueueTime.IsSet() { - toSerialize["queue_time"] = o.QueueTime.Get() - } - if o.Start.Nanosecond() == 0 { - toSerialize["start"] = o.Start.Format("2006-01-02T15:04:05Z07:00") + obj.CIAppPipelineEventFinishedPipeline = nil + } + + // try to unmarshal data into CIAppPipelineEventInProgressPipeline + err = datadog.Unmarshal(data, &obj.CIAppPipelineEventInProgressPipeline) + if err == nil { + if obj.CIAppPipelineEventInProgressPipeline != nil && obj.CIAppPipelineEventInProgressPipeline.UnparsedObject == nil { + jsonCIAppPipelineEventInProgressPipeline, _ := datadog.Marshal(obj.CIAppPipelineEventInProgressPipeline) + if string(jsonCIAppPipelineEventInProgressPipeline) == "{}" { // empty struct + obj.CIAppPipelineEventInProgressPipeline = nil + } else { + match++ + } + } else { + obj.CIAppPipelineEventInProgressPipeline = nil + } } else { - toSerialize["start"] = o.Start.Format("2006-01-02T15:04:05.000Z07:00") - } - toSerialize["status"] = o.Status - if o.Tags.IsSet() { - toSerialize["tags"] = o.Tags.Get() + obj.CIAppPipelineEventInProgressPipeline = nil } - toSerialize["unique_id"] = o.UniqueId - toSerialize["url"] = o.Url - for key, value := range o.AdditionalProperties { - toSerialize[key] = value + if match != 1 { // more than 1 match + // reset to nil + obj.CIAppPipelineEventFinishedPipeline = nil + obj.CIAppPipelineEventInProgressPipeline = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) } - return datadog.Marshal(toSerialize) + return nil // exactly one match } -// UnmarshalJSON deserializes the given payload. -func (o *CIAppPipelineEventPipeline) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - End *time.Time `json:"end"` - Error NullableCIAppCIError `json:"error,omitempty"` - Git NullableCIAppGitInfo `json:"git,omitempty"` - IsManual datadog.NullableBool `json:"is_manual,omitempty"` - IsResumed datadog.NullableBool `json:"is_resumed,omitempty"` - Level *CIAppPipelineEventPipelineLevel `json:"level"` - Metrics datadog.NullableList[string] `json:"metrics,omitempty"` - Name *string `json:"name"` - Node NullableCIAppHostInfo `json:"node,omitempty"` - Parameters map[string]string `json:"parameters,omitempty"` - ParentPipeline NullableCIAppPipelineEventParentPipeline `json:"parent_pipeline,omitempty"` - PartialRetry *bool `json:"partial_retry"` - PipelineId *string `json:"pipeline_id,omitempty"` - PreviousAttempt NullableCIAppPipelineEventPreviousPipeline `json:"previous_attempt,omitempty"` - QueueTime datadog.NullableInt64 `json:"queue_time,omitempty"` - Start *time.Time `json:"start"` - Status *CIAppPipelineEventPipelineStatus `json:"status"` - Tags datadog.NullableList[string] `json:"tags,omitempty"` - UniqueId *string `json:"unique_id"` - Url *string `json:"url"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.End == nil { - return fmt.Errorf("required field end missing") - } - if all.Level == nil { - return fmt.Errorf("required field level missing") - } - if all.Name == nil { - return fmt.Errorf("required field name missing") - } - if all.PartialRetry == nil { - return fmt.Errorf("required field partial_retry missing") - } - if all.Start == nil { - return fmt.Errorf("required field start missing") - } - if all.Status == nil { - return fmt.Errorf("required field status missing") - } - if all.UniqueId == nil { - return fmt.Errorf("required field unique_id missing") - } - if all.Url == nil { - return fmt.Errorf("required field url missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"end", "error", "git", "is_manual", "is_resumed", "level", "metrics", "name", "node", "parameters", "parent_pipeline", "partial_retry", "pipeline_id", "previous_attempt", "queue_time", "start", "status", "tags", "unique_id", "url"}) - } else { - return err +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj CIAppPipelineEventPipeline) MarshalJSON() ([]byte, error) { + if obj.CIAppPipelineEventFinishedPipeline != nil { + return datadog.Marshal(&obj.CIAppPipelineEventFinishedPipeline) } - hasInvalidField := false - o.End = *all.End - o.Error = all.Error - o.Git = all.Git - o.IsManual = all.IsManual - o.IsResumed = all.IsResumed - if !all.Level.IsValid() { - hasInvalidField = true - } else { - o.Level = *all.Level + if obj.CIAppPipelineEventInProgressPipeline != nil { + return datadog.Marshal(&obj.CIAppPipelineEventInProgressPipeline) } - o.Metrics = all.Metrics - o.Name = *all.Name - o.Node = all.Node - o.Parameters = all.Parameters - o.ParentPipeline = all.ParentPipeline - o.PartialRetry = *all.PartialRetry - o.PipelineId = all.PipelineId - o.PreviousAttempt = all.PreviousAttempt - o.QueueTime = all.QueueTime - o.Start = *all.Start - if !all.Status.IsValid() { - hasInvalidField = true - } else { - o.Status = *all.Status + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) } - o.Tags = all.Tags - o.UniqueId = *all.UniqueId - o.Url = *all.Url + return nil, nil // no data in oneOf schemas +} - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties +// GetActualInstance returns the actual instance. +func (obj *CIAppPipelineEventPipeline) GetActualInstance() interface{} { + if obj.CIAppPipelineEventFinishedPipeline != nil { + return obj.CIAppPipelineEventFinishedPipeline } - if hasInvalidField { - return datadog.Unmarshal(bytes, &o.UnparsedObject) + if obj.CIAppPipelineEventInProgressPipeline != nil { + return obj.CIAppPipelineEventInProgressPipeline } + // all schemas are nil return nil } diff --git a/api/datadogV2/model_ci_app_pipeline_event_pipeline_in_progress_status.go b/api/datadogV2/model_ci_app_pipeline_event_pipeline_in_progress_status.go new file mode 100644 index 00000000000..7f5168bb7e7 --- /dev/null +++ b/api/datadogV2/model_ci_app_pipeline_event_pipeline_in_progress_status.go @@ -0,0 +1,64 @@ +// 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 datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CIAppPipelineEventPipelineInProgressStatus The in progress status of the pipeline. +type CIAppPipelineEventPipelineInProgressStatus string + +// List of CIAppPipelineEventPipelineInProgressStatus. +const ( + CIAPPPIPELINEEVENTPIPELINEINPROGRESSSTATUS_RUNNING CIAppPipelineEventPipelineInProgressStatus = "running" +) + +var allowedCIAppPipelineEventPipelineInProgressStatusEnumValues = []CIAppPipelineEventPipelineInProgressStatus{ + CIAPPPIPELINEEVENTPIPELINEINPROGRESSSTATUS_RUNNING, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CIAppPipelineEventPipelineInProgressStatus) GetAllowedValues() []CIAppPipelineEventPipelineInProgressStatus { + return allowedCIAppPipelineEventPipelineInProgressStatusEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CIAppPipelineEventPipelineInProgressStatus) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CIAppPipelineEventPipelineInProgressStatus(value) + return nil +} + +// NewCIAppPipelineEventPipelineInProgressStatusFromValue returns a pointer to a valid CIAppPipelineEventPipelineInProgressStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCIAppPipelineEventPipelineInProgressStatusFromValue(v string) (*CIAppPipelineEventPipelineInProgressStatus, error) { + ev := CIAppPipelineEventPipelineInProgressStatus(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CIAppPipelineEventPipelineInProgressStatus: valid values are %v", v, allowedCIAppPipelineEventPipelineInProgressStatusEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CIAppPipelineEventPipelineInProgressStatus) IsValid() bool { + for _, existing := range allowedCIAppPipelineEventPipelineInProgressStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CIAppPipelineEventPipelineInProgressStatus value. +func (v CIAppPipelineEventPipelineInProgressStatus) Ptr() *CIAppPipelineEventPipelineInProgressStatus { + return &v +} diff --git a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.go b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.go index 9a4e5a7f82b..9904adfbb3e 100644 --- a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.go +++ b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent.go @@ -19,20 +19,21 @@ func main() { Attributes: &datadogV2.CIAppCreatePipelineEventRequestAttributes{ Resource: datadogV2.CIAppCreatePipelineEventRequestAttributesResource{ CIAppPipelineEventPipeline: &datadogV2.CIAppPipelineEventPipeline{ - End: time.Now().Add(time.Second * -30), - Level: datadogV2.CIAPPPIPELINEEVENTPIPELINELEVEL_PIPELINE, - Name: "Deploy to AWS", - PartialRetry: false, - Start: time.Now().Add(time.Second * -120), - Status: datadogV2.CIAPPPIPELINEEVENTPIPELINESTATUS_SUCCESS, - UniqueId: "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", - Url: "https://my-ci-provider.example/pipelines/my-pipeline/run/1", - Git: *datadogV2.NewNullableCIAppGitInfo(&datadogV2.CIAppGitInfo{ - RepositoryUrl: "https://github.com/DataDog/datadog-agent", - Sha: "7f263865994b76066c4612fd1965215e7dcb4cd2", - AuthorEmail: "john.doe@email.com", - }), - }}, + CIAppPipelineEventFinishedPipeline: &datadogV2.CIAppPipelineEventFinishedPipeline{ + Level: datadogV2.CIAPPPIPELINEEVENTPIPELINELEVEL_PIPELINE, + UniqueId: "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", + Name: "Deploy to AWS", + Url: "https://my-ci-provider.example/pipelines/my-pipeline/run/1", + Start: time.Now().Add(time.Second * -120), + End: time.Now().Add(time.Second * -30), + Status: datadogV2.CIAPPPIPELINEEVENTPIPELINESTATUS_SUCCESS, + PartialRetry: false, + Git: *datadogV2.NewNullableCIAppGitInfo(&datadogV2.CIAppGitInfo{ + RepositoryUrl: "https://github.com/DataDog/datadog-agent", + Sha: "7f263865994b76066c4612fd1965215e7dcb4cd2", + AuthorEmail: "john.doe@email.com", + }), + }}}, }, Type: datadogV2.CIAPPCREATEPIPELINEEVENTREQUESTDATATYPE_CIPIPELINE_RESOURCE_REQUEST.Ptr(), }, diff --git a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.go b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.go index fa2c55b66ef..833133af0d0 100644 --- a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.go +++ b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_129899466.go @@ -19,14 +19,14 @@ func main() { Attributes: &datadogV2.CIAppCreatePipelineEventRequestAttributes{ Resource: datadogV2.CIAppCreatePipelineEventRequestAttributesResource{ CIAppPipelineEventJob: &datadogV2.CIAppPipelineEventJob{ - End: time.Now().Add(time.Second * -30), Level: datadogV2.CIAPPPIPELINEEVENTJOBLEVEL_JOB, - Name: "Build image", - Start: time.Now().Add(time.Second * -120), - Status: datadogV2.CIAPPPIPELINEEVENTJOBSTATUS_ERROR, Id: "cf9456de-8b9e-4c27-aa79-27b1e78c1a33", + Name: "Build image", PipelineUniqueId: "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", PipelineName: "Deploy to AWS", + Start: time.Now().Add(time.Second * -120), + End: time.Now().Add(time.Second * -30), + Status: datadogV2.CIAPPPIPELINEEVENTJOBSTATUS_ERROR, Url: "https://my-ci-provider.example/jobs/my-jobs/run/1", }}, }, diff --git a/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_2341150096.go b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_2341150096.go new file mode 100644 index 00000000000..ecc04e094fc --- /dev/null +++ b/examples/v2/ci-visibility-pipelines/CreateCIAppPipelineEvent_2341150096.go @@ -0,0 +1,53 @@ +// Send running pipeline event returns "Request accepted for processing" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CIAppCreatePipelineEventRequest{ + Data: &datadogV2.CIAppCreatePipelineEventRequestData{ + Attributes: &datadogV2.CIAppCreatePipelineEventRequestAttributes{ + Resource: datadogV2.CIAppCreatePipelineEventRequestAttributesResource{ + CIAppPipelineEventPipeline: &datadogV2.CIAppPipelineEventPipeline{ + CIAppPipelineEventInProgressPipeline: &datadogV2.CIAppPipelineEventInProgressPipeline{ + Level: datadogV2.CIAPPPIPELINEEVENTPIPELINELEVEL_PIPELINE, + UniqueId: "3eacb6f3-ff04-4e10-8a9c-46e6d054024a", + Name: "Deploy to AWS", + Url: "https://my-ci-provider.example/pipelines/my-pipeline/run/1", + Start: time.Now().Add(time.Second * -120), + Status: datadogV2.CIAPPPIPELINEEVENTPIPELINEINPROGRESSSTATUS_RUNNING, + PartialRetry: false, + Git: *datadogV2.NewNullableCIAppGitInfo(&datadogV2.CIAppGitInfo{ + RepositoryUrl: "https://github.com/DataDog/datadog-agent", + Sha: "7f263865994b76066c4612fd1965215e7dcb4cd2", + AuthorEmail: "john.doe@email.com", + }), + }}}, + }, + Type: datadogV2.CIAPPCREATEPIPELINEEVENTREQUESTDATATYPE_CIPIPELINE_RESOURCE_REQUEST.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewCIVisibilityPipelinesApi(apiClient) + resp, r, err := api.CreateCIAppPipelineEvent(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CIVisibilityPipelinesApi.CreateCIAppPipelineEvent`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `CIVisibilityPipelinesApi.CreateCIAppPipelineEvent`:\n%s\n", responseContent) +} diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.freeze index de1ba14a554..2f1c06d3bfe 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_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/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.yaml index 9a88c433c5e..fa6fa6b6c24 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Aggregate_pipelines_events_returns_OK_response.yaml @@ -12,7 +12,9 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/ci/pipelines/analytics/aggregate response: - 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":[]}} + + ' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.freeze index db490a74c71..79cb47db835 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_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/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.yaml index 68b9cdca629..11246393195 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Get_a_list_of_pipelines_events_returns_OK_response.yaml @@ -7,24 +7,11 @@ interactions: - application/json id: 0 method: GET - url: https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bquery%5D=%40ci.provider.name%3Acircleci&filter%5Bfrom%5D=2022-11-28T11%3A27%3A44.947Z&filter%5Bto%5D=2022-11-28T11%3A57%3A44.947Z&page%5Blimit%5D=5 + url: https://api.datadoghq.com/api/v2/ci/pipelines/events?filter%5Bquery%5D=%40ci.provider.name%3Acircleci&filter%5Bfrom%5D=2024-11-25T19%3A38%3A40.699Z&filter%5Bto%5D=2024-11-25T20%3A08%3A40.699Z&page%5Blimit%5D=5 response: - 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"}} + + ' code: 200 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.freeze index 7fa75869614..934c9992ff3 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_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/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.yaml index 82a422e45e3..8757aeb9d75 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Search_pipelines_events_returns_OK_response.yaml @@ -12,19 +12,7 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/ci/pipelines/events/search response: - 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"}} + body: '{"data":[],"meta":{"elapsed":20,"request_id":"pddv1ChZSTVpjd2Q0MlI2LVVBNjVTYlhFUThBIi0KHQuJgBOuQyr2rULJokHKzwf2zKDYmaOmEm5TrJuvEgyvH4LB-7WWiTQznlw","status":"done"}} ' code: 200 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_event_returns_Request_accepted_for_processing_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_event_returns_Request_accepted_for_processing_response.freeze index f80fdc73b8c..9ea3b8ed04d 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_event_returns_Request_accepted_for_processing_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_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/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_event_returns_Request_accepted_for_processing_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_event_returns_Request_accepted_for_processing_response.yaml index 18247f9a4fe..48a57e7b286 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_event_returns_Request_accepted_for_processing_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_event_returns_Request_accepted_for_processing_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"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"}} + {"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"}} form: {} headers: Accept: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_job_event_returns_Request_accepted_for_processing_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_job_event_returns_Request_accepted_for_processing_response.freeze index bdbb925c5b2..ad34df9881f 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_job_event_returns_Request_accepted_for_processing_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_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/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_job_event_returns_Request_accepted_for_processing_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_job_event_returns_Request_accepted_for_processing_response.yaml index a9b70d7db9f..567a7a0d9ac 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_job_event_returns_Request_accepted_for_processing_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_pipeline_job_event_returns_Request_accepted_for_processing_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"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"}} + {"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"}} form: {} headers: Accept: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_running_pipeline_event_returns_Request_accepted_for_processing_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_running_pipeline_event_returns_Request_accepted_for_processing_response.freeze new file mode 100644 index 00000000000..229caddd7a6 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_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/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_running_pipeline_event_returns_Request_accepted_for_processing_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_running_pipeline_event_returns_Request_accepted_for_processing_response.yaml new file mode 100644 index 00000000000..a3ad3ed91de --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_CI_Visibility_Pipelines/Scenario_Send_running_pipeline_event_returns_Request_accepted_for_processing_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: | + {"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"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/ci/pipeline + response: + body: '{"data":null}' + code: 202 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 202 Accepted +version: 2 diff --git a/tests/scenarios/features/v2/ci_visibility_pipelines.feature b/tests/scenarios/features/v2/ci_visibility_pipelines.feature index 71dcea8c15a..7f707950723 100644 --- a/tests/scenarios/features/v2/ci_visibility_pipelines.feature +++ b/tests/scenarios/features/v2/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