Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13283,6 +13283,7 @@ components:
type:
$ref: '#/components/schemas/StatusPagesComponentGroupType'
required:
- attributes
- type
type: object
CreateComponentRequestDataAttributes:
Expand Down Expand Up @@ -13367,7 +13368,7 @@ components:
properties:
id:
description: The ID of the group.
example: ''
example: 1234abcd-12ab-34cd-56ef-123456abcdef
format: uuid
type: string
type:
Expand Down Expand Up @@ -13569,6 +13570,7 @@ components:
type:
$ref: '#/components/schemas/PatchDegradationRequestDataType'
required:
- attributes
- type
type: object
CreateDegradationRequestDataAttributes:
Expand Down Expand Up @@ -13604,7 +13606,7 @@ components:
properties:
id:
description: The ID of the component. Must be a component of type `component`.
example: ''
example: 1234abcd-12ab-34cd-56ef-123456abcdef
format: uuid
type: string
name:
Expand Down Expand Up @@ -14327,6 +14329,7 @@ components:
type:
$ref: '#/components/schemas/StatusPageDataType'
required:
- attributes
- type
type: object
CreateStatusPageRequestDataAttributes:
Expand Down Expand Up @@ -18391,7 +18394,7 @@ components:
properties:
id:
description: The ID of the component.
example: ''
example: 1234abcd-12ab-34cd-56ef-123456abcdef
format: uuid
type: string
name:
Expand Down Expand Up @@ -18436,7 +18439,7 @@ components:
properties:
id:
description: Identifier of the component affected at the time of the update.
example: ''
example: 1234abcd-12ab-34cd-56ef-123456abcdef
format: uuid
type: string
name:
Expand Down Expand Up @@ -18512,7 +18515,7 @@ components:
properties:
id:
description: The ID of the status page.
example: ''
example: 1234abcd-12ab-34cd-56ef-123456abcdef
format: uuid
type: string
type:
Expand Down Expand Up @@ -43661,11 +43664,14 @@ components:
$ref: '#/components/schemas/PatchComponentRequestDataAttributes'
id:
description: The ID of the component.
example: 1234abcd-12ab-34cd-56ef-123456abcdef
format: uuid
type: string
type:
$ref: '#/components/schemas/StatusPagesComponentGroupType'
required:
- attributes
- id
- type
type: object
PatchComponentRequestDataAttributes:
Expand Down Expand Up @@ -43704,11 +43710,14 @@ components:
$ref: '#/components/schemas/PatchDegradationRequestDataAttributes'
id:
description: The ID of the degradation.
example: 1234abcd-12ab-34cd-56ef-123456abcdef
format: uuid
type: string
type:
$ref: '#/components/schemas/PatchDegradationRequestDataType'
required:
- attributes
- id
- type
type: object
PatchDegradationRequestDataAttributes:
Expand Down Expand Up @@ -43739,7 +43748,7 @@ components:
properties:
id:
description: The ID of the component. Must be a component of type `component`.
example: ''
example: 1234abcd-12ab-34cd-56ef-123456abcdef
format: uuid
type: string
name:
Expand Down Expand Up @@ -43844,11 +43853,14 @@ components:
$ref: '#/components/schemas/PatchStatusPageRequestDataAttributes'
id:
description: The ID of the status page.
example: 1234abcd-12ab-34cd-56ef-123456abcdef
format: uuid
type: string
type:
$ref: '#/components/schemas/StatusPageDataType'
required:
- attributes
- id
- type
type: object
PatchStatusPageRequestDataAttributes:
Expand Down Expand Up @@ -58776,7 +58788,7 @@ components:
properties:
id:
description: The ID of the group the component belongs to.
example: ''
example: 1234abcd-12ab-34cd-56ef-123456abcdef
format: uuid
type: string
type:
Expand Down Expand Up @@ -58815,7 +58827,7 @@ components:
properties:
id:
description: The ID of the status page the component belongs to.
example: ''
example: 1234abcd-12ab-34cd-56ef-123456abcdef
format: uuid
type: string
type:
Expand Down Expand Up @@ -58957,7 +58969,7 @@ components:
nullable: true
properties:
id:
example: ''
example: 1234abcd-12ab-34cd-56ef-123456abcdef
format: uuid
type: string
type:
Expand Down Expand Up @@ -58999,7 +59011,7 @@ components:
properties:
id:
description: The ID of the status page.
example: ''
example: 1234abcd-12ab-34cd-56ef-123456abcdef
format: uuid
type: string
type:
Expand Down
39 changes: 18 additions & 21 deletions api/datadogV2/model_create_component_request_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// CreateComponentRequestData
type CreateComponentRequestData struct {
// The supported attributes for creating a component.
Attributes *CreateComponentRequestDataAttributes `json:"attributes,omitempty"`
Attributes CreateComponentRequestDataAttributes `json:"attributes"`
// The supported relationships for creating a component.
Relationships *CreateComponentRequestDataRelationships `json:"relationships,omitempty"`
// Components resource type.
Expand All @@ -27,8 +27,9 @@ type CreateComponentRequestData struct {
// 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 NewCreateComponentRequestData(typeVar StatusPagesComponentGroupType) *CreateComponentRequestData {
func NewCreateComponentRequestData(attributes CreateComponentRequestDataAttributes, typeVar StatusPagesComponentGroupType) *CreateComponentRequestData {
this := CreateComponentRequestData{}
this.Attributes = attributes
this.Type = typeVar
return &this
}
Expand All @@ -43,32 +44,27 @@ func NewCreateComponentRequestDataWithDefaults() *CreateComponentRequestData {
return &this
}

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

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

// HasAttributes returns a boolean if a field has been set.
func (o *CreateComponentRequestData) HasAttributes() bool {
return o != nil && o.Attributes != nil
return &o.Attributes, true
}

// SetAttributes gets a reference to the given CreateComponentRequestDataAttributes and assigns it to the Attributes field.
// SetAttributes sets field value.
func (o *CreateComponentRequestData) SetAttributes(v CreateComponentRequestDataAttributes) {
o.Attributes = &v
o.Attributes = v
}

// GetRelationships returns the Relationships field value if set, zero value otherwise.
Expand Down Expand Up @@ -128,9 +124,7 @@ func (o CreateComponentRequestData) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Attributes != nil {
toSerialize["attributes"] = o.Attributes
}
toSerialize["attributes"] = o.Attributes
if o.Relationships != nil {
toSerialize["relationships"] = o.Relationships
}
Expand All @@ -145,13 +139,16 @@ func (o CreateComponentRequestData) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *CreateComponentRequestData) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Attributes *CreateComponentRequestDataAttributes `json:"attributes,omitempty"`
Attributes *CreateComponentRequestDataAttributes `json:"attributes"`
Relationships *CreateComponentRequestDataRelationships `json:"relationships,omitempty"`
Type *StatusPagesComponentGroupType `json:"type"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if all.Attributes == nil {
return fmt.Errorf("required field attributes missing")
}
if all.Type == nil {
return fmt.Errorf("required field type missing")
}
Expand All @@ -163,10 +160,10 @@ func (o *CreateComponentRequestData) UnmarshalJSON(bytes []byte) (err error) {
}

hasInvalidField := false
if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil {
if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Attributes = all.Attributes
o.Attributes = *all.Attributes
if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
Expand Down
39 changes: 18 additions & 21 deletions api/datadogV2/model_create_degradation_request_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// CreateDegradationRequestData
type CreateDegradationRequestData struct {
// The supported attributes for creating a degradation.
Attributes *CreateDegradationRequestDataAttributes `json:"attributes,omitempty"`
Attributes CreateDegradationRequestDataAttributes `json:"attributes"`
// Degradations resource type.
Type PatchDegradationRequestDataType `json:"type"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand All @@ -25,8 +25,9 @@ type CreateDegradationRequestData struct {
// 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 NewCreateDegradationRequestData(typeVar PatchDegradationRequestDataType) *CreateDegradationRequestData {
func NewCreateDegradationRequestData(attributes CreateDegradationRequestDataAttributes, typeVar PatchDegradationRequestDataType) *CreateDegradationRequestData {
this := CreateDegradationRequestData{}
this.Attributes = attributes
this.Type = typeVar
return &this
}
Expand All @@ -41,32 +42,27 @@ func NewCreateDegradationRequestDataWithDefaults() *CreateDegradationRequestData
return &this
}

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

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

// HasAttributes returns a boolean if a field has been set.
func (o *CreateDegradationRequestData) HasAttributes() bool {
return o != nil && o.Attributes != nil
return &o.Attributes, true
}

// SetAttributes gets a reference to the given CreateDegradationRequestDataAttributes and assigns it to the Attributes field.
// SetAttributes sets field value.
func (o *CreateDegradationRequestData) SetAttributes(v CreateDegradationRequestDataAttributes) {
o.Attributes = &v
o.Attributes = v
}

// GetType returns the Type field value.
Expand Down Expand Up @@ -98,9 +94,7 @@ func (o CreateDegradationRequestData) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Attributes != nil {
toSerialize["attributes"] = o.Attributes
}
toSerialize["attributes"] = o.Attributes
toSerialize["type"] = o.Type

for key, value := range o.AdditionalProperties {
Expand All @@ -112,12 +106,15 @@ func (o CreateDegradationRequestData) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *CreateDegradationRequestData) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Attributes *CreateDegradationRequestDataAttributes `json:"attributes,omitempty"`
Attributes *CreateDegradationRequestDataAttributes `json:"attributes"`
Type *PatchDegradationRequestDataType `json:"type"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if all.Attributes == nil {
return fmt.Errorf("required field attributes missing")
}
if all.Type == nil {
return fmt.Errorf("required field type missing")
}
Expand All @@ -129,10 +126,10 @@ func (o *CreateDegradationRequestData) UnmarshalJSON(bytes []byte) (err error) {
}

hasInvalidField := false
if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil {
if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Attributes = all.Attributes
o.Attributes = *all.Attributes
if !all.Type.IsValid() {
hasInvalidField = true
} else {
Expand Down
Loading
Loading