Skip to content

Commit

Permalink
Regenerate client from commit 6f54a513 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Jul 28, 2023
1 parent d2c757e commit 49158ec
Show file tree
Hide file tree
Showing 8 changed files with 431 additions and 106 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.5",
"regenerated": "2023-07-26 17:14:49.689036",
"spec_repo_commit": "69e8c6e4"
"regenerated": "2023-07-28 14:18:17.408017",
"spec_repo_commit": "6f54a513"
},
"v2": {
"apigentools_version": "1.6.5",
"regenerated": "2023-07-26 17:14:49.702134",
"spec_repo_commit": "69e8c6e4"
"regenerated": "2023-07-28 14:18:17.425575",
"spec_repo_commit": "6f54a513"
}
}
}
71 changes: 51 additions & 20 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1481,25 +1481,15 @@ components:
properties:
attributes:
additionalProperties: {}
description: JSON object of attributes from CI Visibility events.
description: JSON object of attributes from CI Visibility test events.
example:
customAttribute: 123
duration: 2345
type: object
service:
description: 'The name of the application or service generating CI Visibility
events.

It is used to switch from CI Visibility to APM, so make sure you define
the same

value when you use both products.'
example: web-ui-tests
type: string
tags:
$ref: '#/components/schemas/TagsEventAttribute'
timestamp:
$ref: '#/components/schemas/TimestampEventAttribute'
test_level:
$ref: '#/components/schemas/CIAppTestLevel'
type: object
CIAppGitInfo:
description: 'If pipelines are triggered due to actions to a Git repository,
Expand Down Expand Up @@ -1661,14 +1651,30 @@ components:
stored by Datadog.
properties:
attributes:
$ref: '#/components/schemas/CIAppEventAttributes'
$ref: '#/components/schemas/CIAppPipelineEventAttributes'
id:
description: Unique ID of the event.
example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA
type: string
type:
$ref: '#/components/schemas/CIAppPipelineEventTypeName'
type: object
CIAppPipelineEventAttributes:
description: JSON object containing all event attributes and their associated
values.
properties:
attributes:
additionalProperties: {}
description: JSON object of attributes from CI Visibility pipeline events.
example:
customAttribute: 123
duration: 2345
type: object
ci_level:
$ref: '#/components/schemas/CIAppPipelineLevel'
tags:
$ref: '#/components/schemas/TagsEventAttribute'
type: object
CIAppPipelineEventJob:
description: Details of a CI job.
properties:
Expand Down Expand Up @@ -2190,6 +2196,22 @@ components:
meta:
$ref: '#/components/schemas/CIAppResponseMetadataWithPagination'
type: object
CIAppPipelineLevel:
description: Pipeline execution level.
enum:
- pipeline
- stage
- job
- step
- custom
example: pipeline
type: string
x-enum-varnames:
- PIPELINE
- STAGE
- JOB
- STEP
- CUSTOM
CIAppPipelinesAggregateRequest:
description: The object sent with the request to retrieve aggregation buckets
of pipeline events from your organization.
Expand Down Expand Up @@ -2463,6 +2485,20 @@ components:
meta:
$ref: '#/components/schemas/CIAppResponseMetadataWithPagination'
type: object
CIAppTestLevel:
description: Test run level.
enum:
- session
- module
- suite
- test
example: test
type: string
x-enum-varnames:
- SESSION
- MODULE
- SUITE
- TEST
CIAppTestsAggregateRequest:
description: The object sent with the request to retrieve aggregation buckets
of test events from your organization.
Expand Down Expand Up @@ -2500,7 +2536,7 @@ components:
links:
$ref: '#/components/schemas/CIAppResponseLinks'
meta:
$ref: '#/components/schemas/CIAppResponseMetadata'
$ref: '#/components/schemas/CIAppResponseMetadataWithPagination'
type: object
CIAppTestsBucketResponse:
description: Bucket values.
Expand Down Expand Up @@ -16579,11 +16615,6 @@ components:
items:
$ref: '#/components/schemas/TimeseriesResponseValues'
type: array
TimestampEventAttribute:
description: Timestamp of your event.
example: '2019-01-02T09:42:36.320Z'
format: date-time
type: string
Unit:
description: Object containing the metric unit family, scale factor, name, and
short name.
Expand Down
97 changes: 31 additions & 66 deletions api/datadogV2/model_ci_app_event_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,19 @@
package datadogV2

import (
"time"

"github.com/goccy/go-json"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// CIAppEventAttributes JSON object containing all event attributes and their associated values.
type CIAppEventAttributes struct {
// JSON object of attributes from CI Visibility events.
// JSON object of attributes from CI Visibility test events.
Attributes map[string]interface{} `json:"attributes,omitempty"`
// The name of the application or service generating CI Visibility events.
// It is used to switch from CI Visibility to APM, so make sure you define the same
// value when you use both products.
Service *string `json:"service,omitempty"`
// Array of tags associated with your event.
Tags []string `json:"tags,omitempty"`
// Timestamp of your event.
Timestamp *time.Time `json:"timestamp,omitempty"`
// Test run level.
TestLevel *CIAppTestLevel `json:"test_level,omitempty"`
// 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{}
Expand Down Expand Up @@ -74,34 +68,6 @@ func (o *CIAppEventAttributes) SetAttributes(v map[string]interface{}) {
o.Attributes = v
}

// GetService returns the Service field value if set, zero value otherwise.
func (o *CIAppEventAttributes) GetService() string {
if o == nil || o.Service == nil {
var ret string
return ret
}
return *o.Service
}

// GetServiceOk returns a tuple with the Service field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CIAppEventAttributes) GetServiceOk() (*string, bool) {
if o == nil || o.Service == nil {
return nil, false
}
return o.Service, true
}

// HasService returns a boolean if a field has been set.
func (o *CIAppEventAttributes) HasService() bool {
return o != nil && o.Service != nil
}

// SetService gets a reference to the given string and assigns it to the Service field.
func (o *CIAppEventAttributes) SetService(v string) {
o.Service = &v
}

// GetTags returns the Tags field value if set, zero value otherwise.
func (o *CIAppEventAttributes) GetTags() []string {
if o == nil || o.Tags == nil {
Expand Down Expand Up @@ -130,32 +96,32 @@ func (o *CIAppEventAttributes) SetTags(v []string) {
o.Tags = v
}

// GetTimestamp returns the Timestamp field value if set, zero value otherwise.
func (o *CIAppEventAttributes) GetTimestamp() time.Time {
if o == nil || o.Timestamp == nil {
var ret time.Time
// GetTestLevel returns the TestLevel field value if set, zero value otherwise.
func (o *CIAppEventAttributes) GetTestLevel() CIAppTestLevel {
if o == nil || o.TestLevel == nil {
var ret CIAppTestLevel
return ret
}
return *o.Timestamp
return *o.TestLevel
}

// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise
// GetTestLevelOk returns a tuple with the TestLevel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CIAppEventAttributes) GetTimestampOk() (*time.Time, bool) {
if o == nil || o.Timestamp == nil {
func (o *CIAppEventAttributes) GetTestLevelOk() (*CIAppTestLevel, bool) {
if o == nil || o.TestLevel == nil {
return nil, false
}
return o.Timestamp, true
return o.TestLevel, true
}

// HasTimestamp returns a boolean if a field has been set.
func (o *CIAppEventAttributes) HasTimestamp() bool {
return o != nil && o.Timestamp != nil
// HasTestLevel returns a boolean if a field has been set.
func (o *CIAppEventAttributes) HasTestLevel() bool {
return o != nil && o.TestLevel != nil
}

// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field.
func (o *CIAppEventAttributes) SetTimestamp(v time.Time) {
o.Timestamp = &v
// SetTestLevel gets a reference to the given CIAppTestLevel and assigns it to the TestLevel field.
func (o *CIAppEventAttributes) SetTestLevel(v CIAppTestLevel) {
o.TestLevel = &v
}

// MarshalJSON serializes the struct using spec logic.
Expand All @@ -167,18 +133,11 @@ func (o CIAppEventAttributes) MarshalJSON() ([]byte, error) {
if o.Attributes != nil {
toSerialize["attributes"] = o.Attributes
}
if o.Service != nil {
toSerialize["service"] = o.Service
}
if o.Tags != nil {
toSerialize["tags"] = o.Tags
}
if o.Timestamp != nil {
if o.Timestamp.Nanosecond() == 0 {
toSerialize["timestamp"] = o.Timestamp.Format("2006-01-02T15:04:05Z07:00")
} else {
toSerialize["timestamp"] = o.Timestamp.Format("2006-01-02T15:04:05.000Z07:00")
}
if o.TestLevel != nil {
toSerialize["test_level"] = o.TestLevel
}

for key, value := range o.AdditionalProperties {
Expand All @@ -192,9 +151,8 @@ func (o *CIAppEventAttributes) UnmarshalJSON(bytes []byte) (err error) {
raw := map[string]interface{}{}
all := struct {
Attributes map[string]interface{} `json:"attributes,omitempty"`
Service *string `json:"service,omitempty"`
Tags []string `json:"tags,omitempty"`
Timestamp *time.Time `json:"timestamp,omitempty"`
TestLevel *CIAppTestLevel `json:"test_level,omitempty"`
}{}
if err = json.Unmarshal(bytes, &all); err != nil {
err = json.Unmarshal(bytes, &raw)
Expand All @@ -206,14 +164,21 @@ func (o *CIAppEventAttributes) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "service", "tags", "timestamp"})
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "tags", "test_level"})
} else {
return err
}
if v := all.TestLevel; v != nil && !v.IsValid() {
err = json.Unmarshal(bytes, &raw)
if err != nil {
return err
}
o.UnparsedObject = raw
return nil
}
o.Attributes = all.Attributes
o.Service = all.Service
o.Tags = all.Tags
o.Timestamp = all.Timestamp
o.TestLevel = all.TestLevel
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}
Expand Down
18 changes: 9 additions & 9 deletions api/datadogV2/model_ci_app_pipeline_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// CIAppPipelineEvent Object description of a pipeline event after being processed and stored by Datadog.
type CIAppPipelineEvent struct {
// JSON object containing all event attributes and their associated values.
Attributes *CIAppEventAttributes `json:"attributes,omitempty"`
Attributes *CIAppPipelineEventAttributes `json:"attributes,omitempty"`
// Unique ID of the event.
Id *string `json:"id,omitempty"`
// Type of the event.
Expand Down Expand Up @@ -41,17 +41,17 @@ func NewCIAppPipelineEventWithDefaults() *CIAppPipelineEvent {
}

// GetAttributes returns the Attributes field value if set, zero value otherwise.
func (o *CIAppPipelineEvent) GetAttributes() CIAppEventAttributes {
func (o *CIAppPipelineEvent) GetAttributes() CIAppPipelineEventAttributes {
if o == nil || o.Attributes == nil {
var ret CIAppEventAttributes
var ret CIAppPipelineEventAttributes
return ret
}
return *o.Attributes
}

// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CIAppPipelineEvent) GetAttributesOk() (*CIAppEventAttributes, bool) {
func (o *CIAppPipelineEvent) GetAttributesOk() (*CIAppPipelineEventAttributes, bool) {
if o == nil || o.Attributes == nil {
return nil, false
}
Expand All @@ -63,8 +63,8 @@ func (o *CIAppPipelineEvent) HasAttributes() bool {
return o != nil && o.Attributes != nil
}

// SetAttributes gets a reference to the given CIAppEventAttributes and assigns it to the Attributes field.
func (o *CIAppPipelineEvent) SetAttributes(v CIAppEventAttributes) {
// SetAttributes gets a reference to the given CIAppPipelineEventAttributes and assigns it to the Attributes field.
func (o *CIAppPipelineEvent) SetAttributes(v CIAppPipelineEventAttributes) {
o.Attributes = &v
}

Expand Down Expand Up @@ -150,9 +150,9 @@ func (o CIAppPipelineEvent) MarshalJSON() ([]byte, error) {
func (o *CIAppPipelineEvent) UnmarshalJSON(bytes []byte) (err error) {
raw := map[string]interface{}{}
all := struct {
Attributes *CIAppEventAttributes `json:"attributes,omitempty"`
Id *string `json:"id,omitempty"`
Type *CIAppPipelineEventTypeName `json:"type,omitempty"`
Attributes *CIAppPipelineEventAttributes `json:"attributes,omitempty"`
Id *string `json:"id,omitempty"`
Type *CIAppPipelineEventTypeName `json:"type,omitempty"`
}{}
if err = json.Unmarshal(bytes, &all); err != nil {
err = json.Unmarshal(bytes, &raw)
Expand Down
Loading

0 comments on commit 49158ec

Please sign in to comment.