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
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "fd3370f",
"generated": "2025-08-06 20:55:33.459"
"spec_repo_commit": "c5cca50",
"generated": "2025-08-07 18:05:06.066"
}
40 changes: 40 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,8 @@ components:
example: arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder
type: string
type: array
log_source_config:
$ref: '#/components/schemas/AWSLambdaForwarderConfigLogSourceConfig'
sources:
description: 'List of service IDs set to enable automatic log collection.
Discover the list of available services with the
Expand All @@ -1636,6 +1638,44 @@ components:
type: string
type: array
type: object
AWSLambdaForwarderConfigLogSourceConfig:
description: Log source configuration.
properties:
tag_filters:
description: List of AWS log source tag filters. Defaults to `[]`.
items:
$ref: '#/components/schemas/AWSLogSourceTagFilter'
type: array
type: object
AWSLogSourceTagFilter:
description: 'AWS log source tag filter list. Defaults to `[]`.

Array of log source to AWS resource tag mappings. Each mapping contains a
log source and its associated AWS resource tags (in `key:value` format) used
to filter logs submitted to Datadog.

Tag filters are applied for tags on the AWS resource emitting logs; tags associated
with the log storage entity (such as a CloudWatch Log Group or S3 Bucket)
are not considered.

For more information on resource tag filter syntax, [see AWS resource exclusion](https://docs.datadoghq.com/account_management/billing/aws/#aws-resource-exclusion)
in the AWS integration billing page.'
properties:
source:
description: The AWS log source to which the tag filters defined in `tags`
are applied.
example: s3
type: string
tags:
description: The AWS resource tags to filter on for the log source specified
by `source`.
items:
description: Tag in the form `key:value`.
example: env:prod
type: string
nullable: true
type: array
type: object
AWSLogsConfig:
description: AWS Logs Collection config.
properties:
Expand Down
50 changes: 47 additions & 3 deletions api/datadogV2/model_aws_lambda_forwarder_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
type AWSLambdaForwarderConfig struct {
// List of Datadog Lambda Log Forwarder ARNs in your AWS account. Defaults to `[]`.
Lambdas []string `json:"lambdas,omitempty"`
// Log source configuration.
LogSourceConfig *AWSLambdaForwarderConfigLogSourceConfig `json:"log_source_config,omitempty"`
// List of service IDs set to enable automatic log collection. Discover the list of available services with the
// [Get list of AWS log ready services](https://docs.datadoghq.com/api/latest/aws-logs-integration/#get-list-of-aws-log-ready-services) endpoint.
Sources []string `json:"sources,omitempty"`
Expand Down Expand Up @@ -66,6 +68,34 @@ func (o *AWSLambdaForwarderConfig) SetLambdas(v []string) {
o.Lambdas = v
}

// GetLogSourceConfig returns the LogSourceConfig field value if set, zero value otherwise.
func (o *AWSLambdaForwarderConfig) GetLogSourceConfig() AWSLambdaForwarderConfigLogSourceConfig {
if o == nil || o.LogSourceConfig == nil {
var ret AWSLambdaForwarderConfigLogSourceConfig
return ret
}
return *o.LogSourceConfig
}

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

// HasLogSourceConfig returns a boolean if a field has been set.
func (o *AWSLambdaForwarderConfig) HasLogSourceConfig() bool {
return o != nil && o.LogSourceConfig != nil
}

// SetLogSourceConfig gets a reference to the given AWSLambdaForwarderConfigLogSourceConfig and assigns it to the LogSourceConfig field.
func (o *AWSLambdaForwarderConfig) SetLogSourceConfig(v AWSLambdaForwarderConfigLogSourceConfig) {
o.LogSourceConfig = &v
}

// GetSources returns the Sources field value if set, zero value otherwise.
func (o *AWSLambdaForwarderConfig) GetSources() []string {
if o == nil || o.Sources == nil {
Expand Down Expand Up @@ -103,6 +133,9 @@ func (o AWSLambdaForwarderConfig) MarshalJSON() ([]byte, error) {
if o.Lambdas != nil {
toSerialize["lambdas"] = o.Lambdas
}
if o.LogSourceConfig != nil {
toSerialize["log_source_config"] = o.LogSourceConfig
}
if o.Sources != nil {
toSerialize["sources"] = o.Sources
}
Expand All @@ -116,24 +149,35 @@ func (o AWSLambdaForwarderConfig) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *AWSLambdaForwarderConfig) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Lambdas []string `json:"lambdas,omitempty"`
Sources []string `json:"sources,omitempty"`
Lambdas []string `json:"lambdas,omitempty"`
LogSourceConfig *AWSLambdaForwarderConfigLogSourceConfig `json:"log_source_config,omitempty"`
Sources []string `json:"sources,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{"lambdas", "sources"})
datadog.DeleteKeys(additionalProperties, &[]string{"lambdas", "log_source_config", "sources"})
} else {
return err
}

hasInvalidField := false
o.Lambdas = all.Lambdas
if all.LogSourceConfig != nil && all.LogSourceConfig.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.LogSourceConfig = all.LogSourceConfig
o.Sources = all.Sources

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

if hasInvalidField {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}

return nil
}
102 changes: 102 additions & 0 deletions api/datadogV2/model_aws_lambda_forwarder_config_log_source_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// 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"
)

// AWSLambdaForwarderConfigLogSourceConfig Log source configuration.
type AWSLambdaForwarderConfigLogSourceConfig struct {
// List of AWS log source tag filters. Defaults to `[]`.
TagFilters []AWSLogSourceTagFilter `json:"tag_filters,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:"-"`
}

// NewAWSLambdaForwarderConfigLogSourceConfig instantiates a new AWSLambdaForwarderConfigLogSourceConfig 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 NewAWSLambdaForwarderConfigLogSourceConfig() *AWSLambdaForwarderConfigLogSourceConfig {
this := AWSLambdaForwarderConfigLogSourceConfig{}
return &this
}

// NewAWSLambdaForwarderConfigLogSourceConfigWithDefaults instantiates a new AWSLambdaForwarderConfigLogSourceConfig 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 NewAWSLambdaForwarderConfigLogSourceConfigWithDefaults() *AWSLambdaForwarderConfigLogSourceConfig {
this := AWSLambdaForwarderConfigLogSourceConfig{}
return &this
}

// GetTagFilters returns the TagFilters field value if set, zero value otherwise.
func (o *AWSLambdaForwarderConfigLogSourceConfig) GetTagFilters() []AWSLogSourceTagFilter {
if o == nil || o.TagFilters == nil {
var ret []AWSLogSourceTagFilter
return ret
}
return o.TagFilters
}

// GetTagFiltersOk returns a tuple with the TagFilters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AWSLambdaForwarderConfigLogSourceConfig) GetTagFiltersOk() (*[]AWSLogSourceTagFilter, bool) {
if o == nil || o.TagFilters == nil {
return nil, false
}
return &o.TagFilters, true
}

// HasTagFilters returns a boolean if a field has been set.
func (o *AWSLambdaForwarderConfigLogSourceConfig) HasTagFilters() bool {
return o != nil && o.TagFilters != nil
}

// SetTagFilters gets a reference to the given []AWSLogSourceTagFilter and assigns it to the TagFilters field.
func (o *AWSLambdaForwarderConfigLogSourceConfig) SetTagFilters(v []AWSLogSourceTagFilter) {
o.TagFilters = v
}

// MarshalJSON serializes the struct using spec logic.
func (o AWSLambdaForwarderConfigLogSourceConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.TagFilters != nil {
toSerialize["tag_filters"] = o.TagFilters
}

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

// UnmarshalJSON deserializes the given payload.
func (o *AWSLambdaForwarderConfigLogSourceConfig) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
TagFilters []AWSLogSourceTagFilter `json:"tag_filters,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{"tag_filters"})
} else {
return err
}
o.TagFilters = all.TagFilters

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

return nil
}
Loading
Loading