@@ -12,6 +12,8 @@ import (
1212
1313// LogsArchiveCreateRequestAttributes The attributes associated with the archive.
1414type LogsArchiveCreateRequestAttributes struct {
15+ // The type of compression for the archive.
16+ CompressionMethod * LogsArchiveAttributesCompressionMethod `json:"compression_method,omitempty"`
1517 // An archive's destination.
1618 Destination LogsArchiveCreateRequestDestination `json:"destination"`
1719 // To store the tags in the archive, set the value "true".
@@ -36,6 +38,8 @@ type LogsArchiveCreateRequestAttributes struct {
3638// will change when the set of required properties is changed.
3739func NewLogsArchiveCreateRequestAttributes (destination LogsArchiveCreateRequestDestination , name string , query string ) * LogsArchiveCreateRequestAttributes {
3840 this := LogsArchiveCreateRequestAttributes {}
41+ var compressionMethod LogsArchiveAttributesCompressionMethod = LOGSARCHIVEATTRIBUTESCOMPRESSIONMETHOD_GZIP
42+ this .CompressionMethod = & compressionMethod
3943 this .Destination = destination
4044 var includeTags bool = false
4145 this .IncludeTags = & includeTags
@@ -49,11 +53,41 @@ func NewLogsArchiveCreateRequestAttributes(destination LogsArchiveCreateRequestD
4953// but it doesn't guarantee that properties required by API are set.
5054func NewLogsArchiveCreateRequestAttributesWithDefaults () * LogsArchiveCreateRequestAttributes {
5155 this := LogsArchiveCreateRequestAttributes {}
56+ var compressionMethod LogsArchiveAttributesCompressionMethod = LOGSARCHIVEATTRIBUTESCOMPRESSIONMETHOD_GZIP
57+ this .CompressionMethod = & compressionMethod
5258 var includeTags bool = false
5359 this .IncludeTags = & includeTags
5460 return & this
5561}
5662
63+ // GetCompressionMethod returns the CompressionMethod field value if set, zero value otherwise.
64+ func (o * LogsArchiveCreateRequestAttributes ) GetCompressionMethod () LogsArchiveAttributesCompressionMethod {
65+ if o == nil || o .CompressionMethod == nil {
66+ var ret LogsArchiveAttributesCompressionMethod
67+ return ret
68+ }
69+ return * o .CompressionMethod
70+ }
71+
72+ // GetCompressionMethodOk returns a tuple with the CompressionMethod field value if set, nil otherwise
73+ // and a boolean to check if the value has been set.
74+ func (o * LogsArchiveCreateRequestAttributes ) GetCompressionMethodOk () (* LogsArchiveAttributesCompressionMethod , bool ) {
75+ if o == nil || o .CompressionMethod == nil {
76+ return nil , false
77+ }
78+ return o .CompressionMethod , true
79+ }
80+
81+ // HasCompressionMethod returns a boolean if a field has been set.
82+ func (o * LogsArchiveCreateRequestAttributes ) HasCompressionMethod () bool {
83+ return o != nil && o .CompressionMethod != nil
84+ }
85+
86+ // SetCompressionMethod gets a reference to the given LogsArchiveAttributesCompressionMethod and assigns it to the CompressionMethod field.
87+ func (o * LogsArchiveCreateRequestAttributes ) SetCompressionMethod (v LogsArchiveAttributesCompressionMethod ) {
88+ o .CompressionMethod = & v
89+ }
90+
5791// GetDestination returns the Destination field value.
5892func (o * LogsArchiveCreateRequestAttributes ) GetDestination () LogsArchiveCreateRequestDestination {
5993 if o == nil {
@@ -224,6 +258,9 @@ func (o LogsArchiveCreateRequestAttributes) MarshalJSON() ([]byte, error) {
224258 if o .UnparsedObject != nil {
225259 return datadog .Marshal (o .UnparsedObject )
226260 }
261+ if o .CompressionMethod != nil {
262+ toSerialize ["compression_method" ] = o .CompressionMethod
263+ }
227264 toSerialize ["destination" ] = o .Destination
228265 if o .IncludeTags != nil {
229266 toSerialize ["include_tags" ] = o .IncludeTags
@@ -246,12 +283,13 @@ func (o LogsArchiveCreateRequestAttributes) MarshalJSON() ([]byte, error) {
246283// UnmarshalJSON deserializes the given payload.
247284func (o * LogsArchiveCreateRequestAttributes ) UnmarshalJSON (bytes []byte ) (err error ) {
248285 all := struct {
249- Destination * LogsArchiveCreateRequestDestination `json:"destination"`
250- IncludeTags * bool `json:"include_tags,omitempty"`
251- Name * string `json:"name"`
252- Query * string `json:"query"`
253- RehydrationMaxScanSizeInGb datadog.NullableInt64 `json:"rehydration_max_scan_size_in_gb,omitempty"`
254- RehydrationTags []string `json:"rehydration_tags,omitempty"`
286+ CompressionMethod * LogsArchiveAttributesCompressionMethod `json:"compression_method,omitempty"`
287+ Destination * LogsArchiveCreateRequestDestination `json:"destination"`
288+ IncludeTags * bool `json:"include_tags,omitempty"`
289+ Name * string `json:"name"`
290+ Query * string `json:"query"`
291+ RehydrationMaxScanSizeInGb datadog.NullableInt64 `json:"rehydration_max_scan_size_in_gb,omitempty"`
292+ RehydrationTags []string `json:"rehydration_tags,omitempty"`
255293 }{}
256294 if err = datadog .Unmarshal (bytes , & all ); err != nil {
257295 return datadog .Unmarshal (bytes , & o .UnparsedObject )
@@ -267,10 +305,17 @@ func (o *LogsArchiveCreateRequestAttributes) UnmarshalJSON(bytes []byte) (err er
267305 }
268306 additionalProperties := make (map [string ]interface {})
269307 if err = datadog .Unmarshal (bytes , & additionalProperties ); err == nil {
270- datadog .DeleteKeys (additionalProperties , & []string {"destination" , "include_tags" , "name" , "query" , "rehydration_max_scan_size_in_gb" , "rehydration_tags" })
308+ datadog .DeleteKeys (additionalProperties , & []string {"compression_method" , " destination" , "include_tags" , "name" , "query" , "rehydration_max_scan_size_in_gb" , "rehydration_tags" })
271309 } else {
272310 return err
273311 }
312+
313+ hasInvalidField := false
314+ if all .CompressionMethod != nil && ! all .CompressionMethod .IsValid () {
315+ hasInvalidField = true
316+ } else {
317+ o .CompressionMethod = all .CompressionMethod
318+ }
274319 o .Destination = * all .Destination
275320 o .IncludeTags = all .IncludeTags
276321 o .Name = * all .Name
@@ -282,5 +327,9 @@ func (o *LogsArchiveCreateRequestAttributes) UnmarshalJSON(bytes []byte) (err er
282327 o .AdditionalProperties = additionalProperties
283328 }
284329
330+ if hasInvalidField {
331+ return datadog .Unmarshal (bytes , & o .UnparsedObject )
332+ }
333+
285334 return nil
286335}
0 commit comments