Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30806,6 +30806,9 @@ components:
properties:
rateLimit:
$ref: '#/components/schemas/TriggerRateLimit'
version:
description: Version of the incident trigger.
type: string
type: object
IncidentTriggerWrapper:
description: Schema for an Incident-based trigger.
Expand Down
37 changes: 36 additions & 1 deletion api/datadogV2/model_incident_trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
type IncidentTrigger struct {
// Defines a rate limit for a trigger.
RateLimit *TriggerRateLimit `json:"rateLimit,omitempty"`
// Version of the incident trigger.
Version *string `json:"version,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{} `json:"-"`
Expand Down Expand Up @@ -62,6 +64,34 @@ func (o *IncidentTrigger) SetRateLimit(v TriggerRateLimit) {
o.RateLimit = &v
}

// GetVersion returns the Version field value if set, zero value otherwise.
func (o *IncidentTrigger) GetVersion() string {
if o == nil || o.Version == nil {
var ret string
return ret
}
return *o.Version
}

// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IncidentTrigger) GetVersionOk() (*string, bool) {
if o == nil || o.Version == nil {
return nil, false
}
return o.Version, true
}

// HasVersion returns a boolean if a field has been set.
func (o *IncidentTrigger) HasVersion() bool {
return o != nil && o.Version != nil
}

// SetVersion gets a reference to the given string and assigns it to the Version field.
func (o *IncidentTrigger) SetVersion(v string) {
o.Version = &v
}

// MarshalJSON serializes the struct using spec logic.
func (o IncidentTrigger) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
Expand All @@ -71,6 +101,9 @@ func (o IncidentTrigger) MarshalJSON() ([]byte, error) {
if o.RateLimit != nil {
toSerialize["rateLimit"] = o.RateLimit
}
if o.Version != nil {
toSerialize["version"] = o.Version
}

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
Expand All @@ -82,13 +115,14 @@ func (o IncidentTrigger) MarshalJSON() ([]byte, error) {
func (o *IncidentTrigger) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
RateLimit *TriggerRateLimit `json:"rateLimit,omitempty"`
Version *string `json:"version,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"rateLimit"})
datadog.DeleteKeys(additionalProperties, &[]string{"rateLimit", "version"})
} else {
return err
}
Expand All @@ -98,6 +132,7 @@ func (o *IncidentTrigger) UnmarshalJSON(bytes []byte) (err error) {
hasInvalidField = true
}
o.RateLimit = all.RateLimit
o.Version = all.Version

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
Expand Down