Skip to content
Merged
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 @@ -39011,6 +39011,9 @@ components:
SecurityMonitoringRuleConvertResponse:
description: Result of the convert rule request containing Terraform content.
properties:
ruleId:
description: the ID of the rule.
type: string
terraformContent:
description: Terraform string as a result of converting the rule from JSON.
type: string
Expand Down
37 changes: 36 additions & 1 deletion api/datadogV2/model_security_monitoring_rule_convert_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (

// SecurityMonitoringRuleConvertResponse Result of the convert rule request containing Terraform content.
type SecurityMonitoringRuleConvertResponse struct {
// the ID of the rule.
RuleId *string `json:"ruleId,omitempty"`
// Terraform string as a result of converting the rule from JSON.
TerraformContent *string `json:"terraformContent,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand All @@ -34,6 +36,34 @@ func NewSecurityMonitoringRuleConvertResponseWithDefaults() *SecurityMonitoringR
return &this
}

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

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

// HasRuleId returns a boolean if a field has been set.
func (o *SecurityMonitoringRuleConvertResponse) HasRuleId() bool {
return o != nil && o.RuleId != nil
}

// SetRuleId gets a reference to the given string and assigns it to the RuleId field.
func (o *SecurityMonitoringRuleConvertResponse) SetRuleId(v string) {
o.RuleId = &v
}

// GetTerraformContent returns the TerraformContent field value if set, zero value otherwise.
func (o *SecurityMonitoringRuleConvertResponse) GetTerraformContent() string {
if o == nil || o.TerraformContent == nil {
Expand Down Expand Up @@ -68,6 +98,9 @@ func (o SecurityMonitoringRuleConvertResponse) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.RuleId != nil {
toSerialize["ruleId"] = o.RuleId
}
if o.TerraformContent != nil {
toSerialize["terraformContent"] = o.TerraformContent
}
Expand All @@ -81,17 +114,19 @@ func (o SecurityMonitoringRuleConvertResponse) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *SecurityMonitoringRuleConvertResponse) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
RuleId *string `json:"ruleId,omitempty"`
TerraformContent *string `json:"terraformContent,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{"terraformContent"})
datadog.DeleteKeys(additionalProperties, &[]string{"ruleId", "terraformContent"})
} else {
return err
}
o.RuleId = all.RuleId
o.TerraformContent = all.TerraformContent

if len(additionalProperties) > 0 {
Expand Down
Loading