Skip to content

Commit

Permalink
Security Monitoring Suppressions - Make expiration date nullable in u…
Browse files Browse the repository at this point in the history
…pdate payload (#2365)

Co-authored-by: ci.datadog-api-spec <[email protected]>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Jan 25, 2024
1 parent 854cfec commit c5d2119
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 23 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-01-24 20:59:51.699144",
"spec_repo_commit": "9d7a3d85"
"regenerated": "2024-01-25 15:52:44.093364",
"spec_repo_commit": "bdb7b215"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-01-24 20:59:51.720633",
"spec_repo_commit": "9d7a3d85"
"regenerated": "2024-01-25 15:52:44.107943",
"spec_repo_commit": "bdb7b215"
}
}
}
3 changes: 3 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16759,8 +16759,11 @@ components:
expiration_date:
description: A Unix millisecond timestamp giving an expiration date for
the suppression rule. After this date, it won't suppress signals anymore.
If unset, the expiration date of the suppression rule is left untouched.
If set to `null`, the expiration date is removed.
example: 1703187336000
format: int64
nullable: true
type: integer
name:
description: The name of the suppression rule.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ type SecurityMonitoringSuppressionUpdateAttributes struct {
Description *string `json:"description,omitempty"`
// Whether the suppression rule is enabled.
Enabled *bool `json:"enabled,omitempty"`
// A Unix millisecond timestamp giving an expiration date for the suppression rule. After this date, it won't suppress signals anymore.
ExpirationDate *int64 `json:"expiration_date,omitempty"`
// A Unix millisecond timestamp giving an expiration date for the suppression rule. After this date, it won't suppress signals anymore. If unset, the expiration date of the suppression rule is left untouched. If set to `null`, the expiration date is removed.
ExpirationDate datadog.NullableInt64 `json:"expiration_date,omitempty"`
// The name of the suppression rule.
Name *string `json:"name,omitempty"`
// The rule query of the suppression rule, with the same syntax as the search bar for detection rules.
Expand Down Expand Up @@ -102,32 +102,43 @@ func (o *SecurityMonitoringSuppressionUpdateAttributes) SetEnabled(v bool) {
o.Enabled = &v
}

// GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise.
// GetExpirationDate returns the ExpirationDate field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *SecurityMonitoringSuppressionUpdateAttributes) GetExpirationDate() int64 {
if o == nil || o.ExpirationDate == nil {
if o == nil || o.ExpirationDate.Get() == nil {
var ret int64
return ret
}
return *o.ExpirationDate
return *o.ExpirationDate.Get()
}

// GetExpirationDateOk returns a tuple with the ExpirationDate field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned.
func (o *SecurityMonitoringSuppressionUpdateAttributes) GetExpirationDateOk() (*int64, bool) {
if o == nil || o.ExpirationDate == nil {
if o == nil {
return nil, false
}
return o.ExpirationDate, true
return o.ExpirationDate.Get(), o.ExpirationDate.IsSet()
}

// HasExpirationDate returns a boolean if a field has been set.
func (o *SecurityMonitoringSuppressionUpdateAttributes) HasExpirationDate() bool {
return o != nil && o.ExpirationDate != nil
return o != nil && o.ExpirationDate.IsSet()
}

// SetExpirationDate gets a reference to the given int64 and assigns it to the ExpirationDate field.
// SetExpirationDate gets a reference to the given datadog.NullableInt64 and assigns it to the ExpirationDate field.
func (o *SecurityMonitoringSuppressionUpdateAttributes) SetExpirationDate(v int64) {
o.ExpirationDate = &v
o.ExpirationDate.Set(&v)
}

// SetExpirationDateNil sets the value for ExpirationDate to be an explicit nil.
func (o *SecurityMonitoringSuppressionUpdateAttributes) SetExpirationDateNil() {
o.ExpirationDate.Set(nil)
}

// UnsetExpirationDate ensures that no value is present for ExpirationDate, not even an explicit nil.
func (o *SecurityMonitoringSuppressionUpdateAttributes) UnsetExpirationDate() {
o.ExpirationDate.Unset()
}

// GetName returns the Name field value if set, zero value otherwise.
Expand Down Expand Up @@ -254,8 +265,8 @@ func (o SecurityMonitoringSuppressionUpdateAttributes) MarshalJSON() ([]byte, er
if o.Enabled != nil {
toSerialize["enabled"] = o.Enabled
}
if o.ExpirationDate != nil {
toSerialize["expiration_date"] = o.ExpirationDate
if o.ExpirationDate.IsSet() {
toSerialize["expiration_date"] = o.ExpirationDate.Get()
}
if o.Name != nil {
toSerialize["name"] = o.Name
Expand All @@ -279,13 +290,13 @@ func (o SecurityMonitoringSuppressionUpdateAttributes) MarshalJSON() ([]byte, er
// UnmarshalJSON deserializes the given payload.
func (o *SecurityMonitoringSuppressionUpdateAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Description *string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
ExpirationDate *int64 `json:"expiration_date,omitempty"`
Name *string `json:"name,omitempty"`
RuleQuery *string `json:"rule_query,omitempty"`
SuppressionQuery *string `json:"suppression_query,omitempty"`
Version *int32 `json:"version,omitempty"`
Description *string `json:"description,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
ExpirationDate datadog.NullableInt64 `json:"expiration_date,omitempty"`
Name *string `json:"name,omitempty"`
RuleQuery *string `json:"rule_query,omitempty"`
SuppressionQuery *string `json:"suppression_query,omitempty"`
Version *int32 `json:"version,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
Expand Down

0 comments on commit c5d2119

Please sign in to comment.