Skip to content

Commit

Permalink
Add referenceTables field to security monitoring endpoints (#2697)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Sep 30, 2024
1 parent 2de9c6c commit 4cd97ae
Show file tree
Hide file tree
Showing 12 changed files with 486 additions and 15 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-09-30 14:37:39.238144",
"spec_repo_commit": "60bc9127"
"regenerated": "2024-09-30 19:44:25.864590",
"spec_repo_commit": "909e369c"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-30 14:37:39.252667",
"spec_repo_commit": "60bc9127"
"regenerated": "2024-09-30 19:44:25.879560",
"spec_repo_commit": "909e369c"
}
}
}
44 changes: 44 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19089,6 +19089,25 @@ components:
meta:
$ref: '#/components/schemas/ResponseMetaAttributes'
type: object
SecurityMonitoringReferenceTable:
description: Reference table for the rule.
properties:
checkPresence:
description: Whether to include or exclude the matched values.
type: boolean
columnName:
description: The name of the column in the reference table.
type: string
logFieldPath:
description: The field in the log to match against the reference table.
type: string
ruleQueryName:
description: The name of the rule query to apply the reference table to.
type: string
tableName:
description: The name of the reference table.
type: string
type: object
SecurityMonitoringRuleCase:
description: Case when signal is generated.
properties:
Expand Down Expand Up @@ -19594,6 +19613,11 @@ components:
items:
$ref: '#/components/schemas/SecurityMonitoringRuleQuery'
type: array
referenceTables:
description: Reference tables for the rule.
items:
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
type: array
tags:
description: Tags for generated signals.
items:
Expand Down Expand Up @@ -20298,6 +20322,11 @@ components:
items:
$ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery'
type: array
referenceTables:
description: Reference tables for the rule.
items:
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
type: array
tags:
description: Tags for generated signals.
example:
Expand Down Expand Up @@ -20365,6 +20394,11 @@ components:
items:
$ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery'
type: array
referenceTables:
description: Reference tables for the rule.
items:
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
type: array
tags:
description: Tags for generated signals.
example:
Expand Down Expand Up @@ -20505,6 +20539,11 @@ components:
items:
$ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery'
type: array
referenceTables:
description: Reference tables for the rule.
items:
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
type: array
tags:
description: Tags for generated signals.
items:
Expand Down Expand Up @@ -20569,6 +20608,11 @@ components:
items:
$ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery'
type: array
referenceTables:
description: Reference tables for the rule.
items:
$ref: '#/components/schemas/SecurityMonitoringReferenceTable'
type: array
tags:
description: Tags for generated signals.
example:
Expand Down
242 changes: 242 additions & 0 deletions api/datadogV2/model_security_monitoring_reference_table.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

package datadogV2

import (
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// SecurityMonitoringReferenceTable Reference table for the rule.
type SecurityMonitoringReferenceTable struct {
// Whether to include or exclude the matched values.
CheckPresence *bool `json:"checkPresence,omitempty"`
// The name of the column in the reference table.
ColumnName *string `json:"columnName,omitempty"`
// The field in the log to match against the reference table.
LogFieldPath *string `json:"logFieldPath,omitempty"`
// The name of the rule query to apply the reference table to.
RuleQueryName *string `json:"ruleQueryName,omitempty"`
// The name of the reference table.
TableName *string `json:"tableName,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:"-"`
}

// NewSecurityMonitoringReferenceTable instantiates a new SecurityMonitoringReferenceTable object.
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewSecurityMonitoringReferenceTable() *SecurityMonitoringReferenceTable {
this := SecurityMonitoringReferenceTable{}
return &this
}

// NewSecurityMonitoringReferenceTableWithDefaults instantiates a new SecurityMonitoringReferenceTable object.
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set.
func NewSecurityMonitoringReferenceTableWithDefaults() *SecurityMonitoringReferenceTable {
this := SecurityMonitoringReferenceTable{}
return &this
}

// GetCheckPresence returns the CheckPresence field value if set, zero value otherwise.
func (o *SecurityMonitoringReferenceTable) GetCheckPresence() bool {
if o == nil || o.CheckPresence == nil {
var ret bool
return ret
}
return *o.CheckPresence
}

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

// HasCheckPresence returns a boolean if a field has been set.
func (o *SecurityMonitoringReferenceTable) HasCheckPresence() bool {
return o != nil && o.CheckPresence != nil
}

// SetCheckPresence gets a reference to the given bool and assigns it to the CheckPresence field.
func (o *SecurityMonitoringReferenceTable) SetCheckPresence(v bool) {
o.CheckPresence = &v
}

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

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

// HasColumnName returns a boolean if a field has been set.
func (o *SecurityMonitoringReferenceTable) HasColumnName() bool {
return o != nil && o.ColumnName != nil
}

// SetColumnName gets a reference to the given string and assigns it to the ColumnName field.
func (o *SecurityMonitoringReferenceTable) SetColumnName(v string) {
o.ColumnName = &v
}

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

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

// HasLogFieldPath returns a boolean if a field has been set.
func (o *SecurityMonitoringReferenceTable) HasLogFieldPath() bool {
return o != nil && o.LogFieldPath != nil
}

// SetLogFieldPath gets a reference to the given string and assigns it to the LogFieldPath field.
func (o *SecurityMonitoringReferenceTable) SetLogFieldPath(v string) {
o.LogFieldPath = &v
}

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

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

// HasRuleQueryName returns a boolean if a field has been set.
func (o *SecurityMonitoringReferenceTable) HasRuleQueryName() bool {
return o != nil && o.RuleQueryName != nil
}

// SetRuleQueryName gets a reference to the given string and assigns it to the RuleQueryName field.
func (o *SecurityMonitoringReferenceTable) SetRuleQueryName(v string) {
o.RuleQueryName = &v
}

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

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

// HasTableName returns a boolean if a field has been set.
func (o *SecurityMonitoringReferenceTable) HasTableName() bool {
return o != nil && o.TableName != nil
}

// SetTableName gets a reference to the given string and assigns it to the TableName field.
func (o *SecurityMonitoringReferenceTable) SetTableName(v string) {
o.TableName = &v
}

// MarshalJSON serializes the struct using spec logic.
func (o SecurityMonitoringReferenceTable) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.CheckPresence != nil {
toSerialize["checkPresence"] = o.CheckPresence
}
if o.ColumnName != nil {
toSerialize["columnName"] = o.ColumnName
}
if o.LogFieldPath != nil {
toSerialize["logFieldPath"] = o.LogFieldPath
}
if o.RuleQueryName != nil {
toSerialize["ruleQueryName"] = o.RuleQueryName
}
if o.TableName != nil {
toSerialize["tableName"] = o.TableName
}

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}

// UnmarshalJSON deserializes the given payload.
func (o *SecurityMonitoringReferenceTable) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
CheckPresence *bool `json:"checkPresence,omitempty"`
ColumnName *string `json:"columnName,omitempty"`
LogFieldPath *string `json:"logFieldPath,omitempty"`
RuleQueryName *string `json:"ruleQueryName,omitempty"`
TableName *string `json:"tableName,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{"checkPresence", "columnName", "logFieldPath", "ruleQueryName", "tableName"})
} else {
return err
}
o.CheckPresence = all.CheckPresence
o.ColumnName = all.ColumnName
o.LogFieldPath = all.LogFieldPath
o.RuleQueryName = all.RuleQueryName
o.TableName = all.TableName

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

return nil
}
Loading

0 comments on commit 4cd97ae

Please sign in to comment.