@@ -24,8 +24,8 @@ type DatasetResponse struct {
2424 Attributes * DatasetAttributesResponse `json:"attributes,omitempty"`
2525 // Unique identifier for the dataset.
2626 Id * string `json:"id,omitempty"`
27- // Resource type, always " dataset" .
28- Type * string `json:"type,omitempty"`
27+ // Resource type, always set to ` dataset` .
28+ Type * DatasetType `json:"type,omitempty"`
2929 // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
3030 UnparsedObject map [string ]interface {} `json:"-"`
3131 AdditionalProperties map [string ]interface {} `json:"-"`
@@ -37,6 +37,8 @@ type DatasetResponse struct {
3737// will change when the set of required properties is changed.
3838func NewDatasetResponse () * DatasetResponse {
3939 this := DatasetResponse {}
40+ var typeVar DatasetType = DATASETTYPE_DATASET
41+ this .Type = & typeVar
4042 return & this
4143}
4244
@@ -45,6 +47,8 @@ func NewDatasetResponse() *DatasetResponse {
4547// but it doesn't guarantee that properties required by API are set.
4648func NewDatasetResponseWithDefaults () * DatasetResponse {
4749 this := DatasetResponse {}
50+ var typeVar DatasetType = DATASETTYPE_DATASET
51+ this .Type = & typeVar
4852 return & this
4953}
5054
@@ -105,17 +109,17 @@ func (o *DatasetResponse) SetId(v string) {
105109}
106110
107111// GetType returns the Type field value if set, zero value otherwise.
108- func (o * DatasetResponse ) GetType () string {
112+ func (o * DatasetResponse ) GetType () DatasetType {
109113 if o == nil || o .Type == nil {
110- var ret string
114+ var ret DatasetType
111115 return ret
112116 }
113117 return * o .Type
114118}
115119
116120// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
117121// and a boolean to check if the value has been set.
118- func (o * DatasetResponse ) GetTypeOk () (* string , bool ) {
122+ func (o * DatasetResponse ) GetTypeOk () (* DatasetType , bool ) {
119123 if o == nil || o .Type == nil {
120124 return nil , false
121125 }
@@ -127,8 +131,8 @@ func (o *DatasetResponse) HasType() bool {
127131 return o != nil && o .Type != nil
128132}
129133
130- // SetType gets a reference to the given string and assigns it to the Type field.
131- func (o * DatasetResponse ) SetType (v string ) {
134+ // SetType gets a reference to the given DatasetType and assigns it to the Type field.
135+ func (o * DatasetResponse ) SetType (v DatasetType ) {
132136 o .Type = & v
133137}
134138
@@ -159,7 +163,7 @@ func (o *DatasetResponse) UnmarshalJSON(bytes []byte) (err error) {
159163 all := struct {
160164 Attributes * DatasetAttributesResponse `json:"attributes,omitempty"`
161165 Id * string `json:"id,omitempty"`
162- Type * string `json:"type,omitempty"`
166+ Type * DatasetType `json:"type,omitempty"`
163167 }{}
164168 if err = datadog .Unmarshal (bytes , & all ); err != nil {
165169 return datadog .Unmarshal (bytes , & o .UnparsedObject )
@@ -177,7 +181,11 @@ func (o *DatasetResponse) UnmarshalJSON(bytes []byte) (err error) {
177181 }
178182 o .Attributes = all .Attributes
179183 o .Id = all .Id
180- o .Type = all .Type
184+ if all .Type != nil && ! all .Type .IsValid () {
185+ hasInvalidField = true
186+ } else {
187+ o .Type = all .Type
188+ }
181189
182190 if len (additionalProperties ) > 0 {
183191 o .AdditionalProperties = additionalProperties
0 commit comments