@@ -14,9 +14,9 @@ import (
1414// It requires a bucket name, GCP authentication, and metadata fields.
1515type ObservabilityPipelineGoogleCloudStorageDestination struct {
1616 // Access control list setting for objects written to the bucket.
17- Acl ObservabilityPipelineGoogleCloudStorageDestinationAcl `json:"acl"`
17+ Acl * ObservabilityPipelineGoogleCloudStorageDestinationAcl `json:"acl,omitempty "`
1818 // GCP credentials used to authenticate with Google Cloud Storage.
19- Auth ObservabilityPipelineGcpAuth `json:"auth"`
19+ Auth * ObservabilityPipelineGcpAuth `json:"auth,omitempty "`
2020 // Name of the GCS bucket.
2121 Bucket string `json:"bucket"`
2222 // Unique identifier for the destination component.
@@ -40,10 +40,8 @@ type ObservabilityPipelineGoogleCloudStorageDestination struct {
4040// This constructor will assign default values to properties that have it defined,
4141// and makes sure properties required by API are set, but the set of arguments
4242// will change when the set of required properties is changed.
43- func NewObservabilityPipelineGoogleCloudStorageDestination (acl ObservabilityPipelineGoogleCloudStorageDestinationAcl , auth ObservabilityPipelineGcpAuth , bucket string , id string , inputs []string , storageClass ObservabilityPipelineGoogleCloudStorageDestinationStorageClass , typeVar ObservabilityPipelineGoogleCloudStorageDestinationType ) * ObservabilityPipelineGoogleCloudStorageDestination {
43+ func NewObservabilityPipelineGoogleCloudStorageDestination (bucket string , id string , inputs []string , storageClass ObservabilityPipelineGoogleCloudStorageDestinationStorageClass , typeVar ObservabilityPipelineGoogleCloudStorageDestinationType ) * ObservabilityPipelineGoogleCloudStorageDestination {
4444 this := ObservabilityPipelineGoogleCloudStorageDestination {}
45- this .Acl = acl
46- this .Auth = auth
4745 this .Bucket = bucket
4846 this .Id = id
4947 this .Inputs = inputs
@@ -62,50 +60,60 @@ func NewObservabilityPipelineGoogleCloudStorageDestinationWithDefaults() *Observ
6260 return & this
6361}
6462
65- // GetAcl returns the Acl field value.
63+ // GetAcl returns the Acl field value if set, zero value otherwise .
6664func (o * ObservabilityPipelineGoogleCloudStorageDestination ) GetAcl () ObservabilityPipelineGoogleCloudStorageDestinationAcl {
67- if o == nil {
65+ if o == nil || o . Acl == nil {
6866 var ret ObservabilityPipelineGoogleCloudStorageDestinationAcl
6967 return ret
7068 }
71- return o .Acl
69+ return * o .Acl
7270}
7371
74- // GetAclOk returns a tuple with the Acl field value
72+ // GetAclOk returns a tuple with the Acl field value if set, nil otherwise
7573// and a boolean to check if the value has been set.
7674func (o * ObservabilityPipelineGoogleCloudStorageDestination ) GetAclOk () (* ObservabilityPipelineGoogleCloudStorageDestinationAcl , bool ) {
77- if o == nil {
75+ if o == nil || o . Acl == nil {
7876 return nil , false
7977 }
80- return & o .Acl , true
78+ return o .Acl , true
79+ }
80+
81+ // HasAcl returns a boolean if a field has been set.
82+ func (o * ObservabilityPipelineGoogleCloudStorageDestination ) HasAcl () bool {
83+ return o != nil && o .Acl != nil
8184}
8285
83- // SetAcl sets field value .
86+ // SetAcl gets a reference to the given ObservabilityPipelineGoogleCloudStorageDestinationAcl and assigns it to the Acl field .
8487func (o * ObservabilityPipelineGoogleCloudStorageDestination ) SetAcl (v ObservabilityPipelineGoogleCloudStorageDestinationAcl ) {
85- o .Acl = v
88+ o .Acl = & v
8689}
8790
88- // GetAuth returns the Auth field value.
91+ // GetAuth returns the Auth field value if set, zero value otherwise .
8992func (o * ObservabilityPipelineGoogleCloudStorageDestination ) GetAuth () ObservabilityPipelineGcpAuth {
90- if o == nil {
93+ if o == nil || o . Auth == nil {
9194 var ret ObservabilityPipelineGcpAuth
9295 return ret
9396 }
94- return o .Auth
97+ return * o .Auth
9598}
9699
97- // GetAuthOk returns a tuple with the Auth field value
100+ // GetAuthOk returns a tuple with the Auth field value if set, nil otherwise
98101// and a boolean to check if the value has been set.
99102func (o * ObservabilityPipelineGoogleCloudStorageDestination ) GetAuthOk () (* ObservabilityPipelineGcpAuth , bool ) {
100- if o == nil {
103+ if o == nil || o . Auth == nil {
101104 return nil , false
102105 }
103- return & o .Auth , true
106+ return o .Auth , true
104107}
105108
106- // SetAuth sets field value.
109+ // HasAuth returns a boolean if a field has been set.
110+ func (o * ObservabilityPipelineGoogleCloudStorageDestination ) HasAuth () bool {
111+ return o != nil && o .Auth != nil
112+ }
113+
114+ // SetAuth gets a reference to the given ObservabilityPipelineGcpAuth and assigns it to the Auth field.
107115func (o * ObservabilityPipelineGoogleCloudStorageDestination ) SetAuth (v ObservabilityPipelineGcpAuth ) {
108- o .Auth = v
116+ o .Auth = & v
109117}
110118
111119// GetBucket returns the Bucket field value.
@@ -285,8 +293,12 @@ func (o ObservabilityPipelineGoogleCloudStorageDestination) MarshalJSON() ([]byt
285293 if o .UnparsedObject != nil {
286294 return datadog .Marshal (o .UnparsedObject )
287295 }
288- toSerialize ["acl" ] = o .Acl
289- toSerialize ["auth" ] = o .Auth
296+ if o .Acl != nil {
297+ toSerialize ["acl" ] = o .Acl
298+ }
299+ if o .Auth != nil {
300+ toSerialize ["auth" ] = o .Auth
301+ }
290302 toSerialize ["bucket" ] = o .Bucket
291303 toSerialize ["id" ] = o .Id
292304 toSerialize ["inputs" ] = o .Inputs
@@ -308,8 +320,8 @@ func (o ObservabilityPipelineGoogleCloudStorageDestination) MarshalJSON() ([]byt
308320// UnmarshalJSON deserializes the given payload.
309321func (o * ObservabilityPipelineGoogleCloudStorageDestination ) UnmarshalJSON (bytes []byte ) (err error ) {
310322 all := struct {
311- Acl * ObservabilityPipelineGoogleCloudStorageDestinationAcl `json:"acl"`
312- Auth * ObservabilityPipelineGcpAuth `json:"auth"`
323+ Acl * ObservabilityPipelineGoogleCloudStorageDestinationAcl `json:"acl,omitempty "`
324+ Auth * ObservabilityPipelineGcpAuth `json:"auth,omitempty "`
313325 Bucket * string `json:"bucket"`
314326 Id * string `json:"id"`
315327 Inputs * []string `json:"inputs"`
@@ -321,12 +333,6 @@ func (o *ObservabilityPipelineGoogleCloudStorageDestination) UnmarshalJSON(bytes
321333 if err = datadog .Unmarshal (bytes , & all ); err != nil {
322334 return datadog .Unmarshal (bytes , & o .UnparsedObject )
323335 }
324- if all .Acl == nil {
325- return fmt .Errorf ("required field acl missing" )
326- }
327- if all .Auth == nil {
328- return fmt .Errorf ("required field auth missing" )
329- }
330336 if all .Bucket == nil {
331337 return fmt .Errorf ("required field bucket missing" )
332338 }
@@ -350,15 +356,15 @@ func (o *ObservabilityPipelineGoogleCloudStorageDestination) UnmarshalJSON(bytes
350356 }
351357
352358 hasInvalidField := false
353- if ! all .Acl .IsValid () {
359+ if all . Acl != nil && ! all .Acl .IsValid () {
354360 hasInvalidField = true
355361 } else {
356- o .Acl = * all .Acl
362+ o .Acl = all .Acl
357363 }
358- if all .Auth .UnparsedObject != nil && o .UnparsedObject == nil {
364+ if all .Auth != nil && all . Auth .UnparsedObject != nil && o .UnparsedObject == nil {
359365 hasInvalidField = true
360366 }
361- o .Auth = * all .Auth
367+ o .Auth = all .Auth
362368 o .Bucket = * all .Bucket
363369 o .Id = * all .Id
364370 o .Inputs = * all .Inputs
0 commit comments