@@ -13,7 +13,7 @@ import (
1313// CreateComponentRequestData
1414type CreateComponentRequestData struct {
1515 // The supported attributes for creating a component.
16- Attributes * CreateComponentRequestDataAttributes `json:"attributes,omitempty "`
16+ Attributes CreateComponentRequestDataAttributes `json:"attributes"`
1717 // The supported relationships for creating a component.
1818 Relationships * CreateComponentRequestDataRelationships `json:"relationships,omitempty"`
1919 // Components resource type.
@@ -27,8 +27,9 @@ type CreateComponentRequestData struct {
2727// This constructor will assign default values to properties that have it defined,
2828// and makes sure properties required by API are set, but the set of arguments
2929// will change when the set of required properties is changed.
30- func NewCreateComponentRequestData (typeVar StatusPagesComponentGroupType ) * CreateComponentRequestData {
30+ func NewCreateComponentRequestData (attributes CreateComponentRequestDataAttributes , typeVar StatusPagesComponentGroupType ) * CreateComponentRequestData {
3131 this := CreateComponentRequestData {}
32+ this .Attributes = attributes
3233 this .Type = typeVar
3334 return & this
3435}
@@ -43,32 +44,27 @@ func NewCreateComponentRequestDataWithDefaults() *CreateComponentRequestData {
4344 return & this
4445}
4546
46- // GetAttributes returns the Attributes field value if set, zero value otherwise .
47+ // GetAttributes returns the Attributes field value.
4748func (o * CreateComponentRequestData ) GetAttributes () CreateComponentRequestDataAttributes {
48- if o == nil || o . Attributes == nil {
49+ if o == nil {
4950 var ret CreateComponentRequestDataAttributes
5051 return ret
5152 }
52- return * o .Attributes
53+ return o .Attributes
5354}
5455
55- // GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
56+ // GetAttributesOk returns a tuple with the Attributes field value
5657// and a boolean to check if the value has been set.
5758func (o * CreateComponentRequestData ) GetAttributesOk () (* CreateComponentRequestDataAttributes , bool ) {
58- if o == nil || o . Attributes == nil {
59+ if o == nil {
5960 return nil , false
6061 }
61- return o .Attributes , true
62- }
63-
64- // HasAttributes returns a boolean if a field has been set.
65- func (o * CreateComponentRequestData ) HasAttributes () bool {
66- return o != nil && o .Attributes != nil
62+ return & o .Attributes , true
6763}
6864
69- // SetAttributes gets a reference to the given CreateComponentRequestDataAttributes and assigns it to the Attributes field.
65+ // SetAttributes sets field value .
7066func (o * CreateComponentRequestData ) SetAttributes (v CreateComponentRequestDataAttributes ) {
71- o .Attributes = & v
67+ o .Attributes = v
7268}
7369
7470// GetRelationships returns the Relationships field value if set, zero value otherwise.
@@ -128,9 +124,7 @@ func (o CreateComponentRequestData) MarshalJSON() ([]byte, error) {
128124 if o .UnparsedObject != nil {
129125 return datadog .Marshal (o .UnparsedObject )
130126 }
131- if o .Attributes != nil {
132- toSerialize ["attributes" ] = o .Attributes
133- }
127+ toSerialize ["attributes" ] = o .Attributes
134128 if o .Relationships != nil {
135129 toSerialize ["relationships" ] = o .Relationships
136130 }
@@ -145,13 +139,16 @@ func (o CreateComponentRequestData) MarshalJSON() ([]byte, error) {
145139// UnmarshalJSON deserializes the given payload.
146140func (o * CreateComponentRequestData ) UnmarshalJSON (bytes []byte ) (err error ) {
147141 all := struct {
148- Attributes * CreateComponentRequestDataAttributes `json:"attributes,omitempty "`
142+ Attributes * CreateComponentRequestDataAttributes `json:"attributes"`
149143 Relationships * CreateComponentRequestDataRelationships `json:"relationships,omitempty"`
150144 Type * StatusPagesComponentGroupType `json:"type"`
151145 }{}
152146 if err = datadog .Unmarshal (bytes , & all ); err != nil {
153147 return datadog .Unmarshal (bytes , & o .UnparsedObject )
154148 }
149+ if all .Attributes == nil {
150+ return fmt .Errorf ("required field attributes missing" )
151+ }
155152 if all .Type == nil {
156153 return fmt .Errorf ("required field type missing" )
157154 }
@@ -163,10 +160,10 @@ func (o *CreateComponentRequestData) UnmarshalJSON(bytes []byte) (err error) {
163160 }
164161
165162 hasInvalidField := false
166- if all .Attributes != nil && all . Attributes .UnparsedObject != nil && o .UnparsedObject == nil {
163+ if all .Attributes .UnparsedObject != nil && o .UnparsedObject == nil {
167164 hasInvalidField = true
168165 }
169- o .Attributes = all .Attributes
166+ o .Attributes = * all .Attributes
170167 if all .Relationships != nil && all .Relationships .UnparsedObject != nil && o .UnparsedObject == nil {
171168 hasInvalidField = true
172169 }
0 commit comments