From d060b34bcf180551566addcb2badd7857256af9b Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 18 Jul 2025 21:24:34 +0000 Subject: [PATCH] Regenerate client from commit 5b64e98 of spec repo --- .generated-info | 4 +- .generator/schemas/v2/openapi.yaml | 75 +++++ ...vability_pipeline_config_processor_item.go | 32 ++ ...ability_pipeline_datadog_tags_processor.go | 313 ++++++++++++++++++ ..._pipeline_datadog_tags_processor_action.go | 66 ++++ ...ty_pipeline_datadog_tags_processor_mode.go | 64 ++++ ...ty_pipeline_datadog_tags_processor_type.go | 64 ++++ 7 files changed, 616 insertions(+), 2 deletions(-) create mode 100644 api/datadogV2/model_observability_pipeline_datadog_tags_processor.go create mode 100644 api/datadogV2/model_observability_pipeline_datadog_tags_processor_action.go create mode 100644 api/datadogV2/model_observability_pipeline_datadog_tags_processor_mode.go create mode 100644 api/datadogV2/model_observability_pipeline_datadog_tags_processor_type.go diff --git a/.generated-info b/.generated-info index e86fa933c5f..0101cf653e8 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "0f24b8e", - "generated": "2025-07-18 16:54:43.860" + "spec_repo_commit": "5b64e98", + "generated": "2025-07-18 21:24:34.609" } diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5a4d2ba1227..571011d490d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -25557,6 +25557,7 @@ components: - $ref: '#/components/schemas/ObservabilityPipelineEnrichmentTableProcessor' - $ref: '#/components/schemas/ObservabilityPipelineReduceProcessor' - $ref: '#/components/schemas/ObservabilityPipelineThrottleProcessor' + - $ref: '#/components/schemas/ObservabilityPipelineDatadogTagsProcessor' ObservabilityPipelineConfigSourceItem: description: A data source for the pipeline. oneOf: @@ -25666,6 +25667,80 @@ components: type: string x-enum-varnames: - DATADOG_LOGS + ObservabilityPipelineDatadogTagsProcessor: + description: The `datadog_tags` processor includes or excludes specific Datadog + tags in your logs. + properties: + action: + $ref: '#/components/schemas/ObservabilityPipelineDatadogTagsProcessorAction' + id: + description: The unique identifier for this component. Used to reference + this component in other parts of the pipeline (for example, as the `input` + to downstream components). + example: datadog-tags-processor + type: string + include: + description: A Datadog search query used to determine which logs this processor + targets. + example: service:my-service + type: string + inputs: + description: A list of component IDs whose output is used as the `input` + for this component. + example: + - datadog-agent-source + items: + type: string + type: array + keys: + description: A list of tag keys. + example: + - env + - service + - version + items: + type: string + type: array + mode: + $ref: '#/components/schemas/ObservabilityPipelineDatadogTagsProcessorMode' + type: + $ref: '#/components/schemas/ObservabilityPipelineDatadogTagsProcessorType' + required: + - id + - type + - include + - mode + - action + - keys + - inputs + type: object + ObservabilityPipelineDatadogTagsProcessorAction: + description: The action to take on tags with matching keys. + enum: + - include + - exclude + example: include + type: string + x-enum-varnames: + - INCLUDE + - EXCLUDE + ObservabilityPipelineDatadogTagsProcessorMode: + description: The processing mode. + enum: + - filter + example: filter + type: string + x-enum-varnames: + - FILTER + ObservabilityPipelineDatadogTagsProcessorType: + default: datadog_tags + description: The processor type. The value should always be `datadog_tags`. + enum: + - datadog_tags + example: datadog_tags + type: string + x-enum-varnames: + - DATADOG_TAGS ObservabilityPipelineDecoding: description: The decoding format used to interpret incoming logs. enum: diff --git a/api/datadogV2/model_observability_pipeline_config_processor_item.go b/api/datadogV2/model_observability_pipeline_config_processor_item.go index 0864c6cfb30..64b49024bcb 100644 --- a/api/datadogV2/model_observability_pipeline_config_processor_item.go +++ b/api/datadogV2/model_observability_pipeline_config_processor_item.go @@ -26,6 +26,7 @@ type ObservabilityPipelineConfigProcessorItem struct { ObservabilityPipelineEnrichmentTableProcessor *ObservabilityPipelineEnrichmentTableProcessor ObservabilityPipelineReduceProcessor *ObservabilityPipelineReduceProcessor ObservabilityPipelineThrottleProcessor *ObservabilityPipelineThrottleProcessor + ObservabilityPipelineDatadogTagsProcessor *ObservabilityPipelineDatadogTagsProcessor // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject interface{} @@ -111,6 +112,11 @@ func ObservabilityPipelineThrottleProcessorAsObservabilityPipelineConfigProcesso return ObservabilityPipelineConfigProcessorItem{ObservabilityPipelineThrottleProcessor: v} } +// ObservabilityPipelineDatadogTagsProcessorAsObservabilityPipelineConfigProcessorItem is a convenience function that returns ObservabilityPipelineDatadogTagsProcessor wrapped in ObservabilityPipelineConfigProcessorItem. +func ObservabilityPipelineDatadogTagsProcessorAsObservabilityPipelineConfigProcessorItem(v *ObservabilityPipelineDatadogTagsProcessor) ObservabilityPipelineConfigProcessorItem { + return ObservabilityPipelineConfigProcessorItem{ObservabilityPipelineDatadogTagsProcessor: v} +} + // UnmarshalJSON turns data into one of the pointers in the struct. func (obj *ObservabilityPipelineConfigProcessorItem) UnmarshalJSON(data []byte) error { var err error @@ -387,6 +393,23 @@ func (obj *ObservabilityPipelineConfigProcessorItem) UnmarshalJSON(data []byte) obj.ObservabilityPipelineThrottleProcessor = nil } + // try to unmarshal data into ObservabilityPipelineDatadogTagsProcessor + err = datadog.Unmarshal(data, &obj.ObservabilityPipelineDatadogTagsProcessor) + if err == nil { + if obj.ObservabilityPipelineDatadogTagsProcessor != nil && obj.ObservabilityPipelineDatadogTagsProcessor.UnparsedObject == nil { + jsonObservabilityPipelineDatadogTagsProcessor, _ := datadog.Marshal(obj.ObservabilityPipelineDatadogTagsProcessor) + if string(jsonObservabilityPipelineDatadogTagsProcessor) == "{}" { // empty struct + obj.ObservabilityPipelineDatadogTagsProcessor = nil + } else { + match++ + } + } else { + obj.ObservabilityPipelineDatadogTagsProcessor = nil + } + } else { + obj.ObservabilityPipelineDatadogTagsProcessor = nil + } + if match != 1 { // more than 1 match // reset to nil obj.ObservabilityPipelineFilterProcessor = nil @@ -405,6 +428,7 @@ func (obj *ObservabilityPipelineConfigProcessorItem) UnmarshalJSON(data []byte) obj.ObservabilityPipelineEnrichmentTableProcessor = nil obj.ObservabilityPipelineReduceProcessor = nil obj.ObservabilityPipelineThrottleProcessor = nil + obj.ObservabilityPipelineDatadogTagsProcessor = nil return datadog.Unmarshal(data, &obj.UnparsedObject) } return nil // exactly one match @@ -476,6 +500,10 @@ func (obj ObservabilityPipelineConfigProcessorItem) MarshalJSON() ([]byte, error return datadog.Marshal(&obj.ObservabilityPipelineThrottleProcessor) } + if obj.ObservabilityPipelineDatadogTagsProcessor != nil { + return datadog.Marshal(&obj.ObservabilityPipelineDatadogTagsProcessor) + } + if obj.UnparsedObject != nil { return datadog.Marshal(obj.UnparsedObject) } @@ -548,6 +576,10 @@ func (obj *ObservabilityPipelineConfigProcessorItem) GetActualInstance() interfa return obj.ObservabilityPipelineThrottleProcessor } + if obj.ObservabilityPipelineDatadogTagsProcessor != nil { + return obj.ObservabilityPipelineDatadogTagsProcessor + } + // all schemas are nil return nil } diff --git a/api/datadogV2/model_observability_pipeline_datadog_tags_processor.go b/api/datadogV2/model_observability_pipeline_datadog_tags_processor.go new file mode 100644 index 00000000000..caa0c674067 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_datadog_tags_processor.go @@ -0,0 +1,313 @@ +// 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 ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ObservabilityPipelineDatadogTagsProcessor The `datadog_tags` processor includes or excludes specific Datadog tags in your logs. +type ObservabilityPipelineDatadogTagsProcessor struct { + // The action to take on tags with matching keys. + Action ObservabilityPipelineDatadogTagsProcessorAction `json:"action"` + // The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the `input` to downstream components). + Id string `json:"id"` + // A Datadog search query used to determine which logs this processor targets. + Include string `json:"include"` + // A list of component IDs whose output is used as the `input` for this component. + Inputs []string `json:"inputs"` + // A list of tag keys. + Keys []string `json:"keys"` + // The processing mode. + Mode ObservabilityPipelineDatadogTagsProcessorMode `json:"mode"` + // The processor type. The value should always be `datadog_tags`. + Type ObservabilityPipelineDatadogTagsProcessorType `json:"type"` + // 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:"-"` +} + +// NewObservabilityPipelineDatadogTagsProcessor instantiates a new ObservabilityPipelineDatadogTagsProcessor 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 NewObservabilityPipelineDatadogTagsProcessor(action ObservabilityPipelineDatadogTagsProcessorAction, id string, include string, inputs []string, keys []string, mode ObservabilityPipelineDatadogTagsProcessorMode, typeVar ObservabilityPipelineDatadogTagsProcessorType) *ObservabilityPipelineDatadogTagsProcessor { + this := ObservabilityPipelineDatadogTagsProcessor{} + this.Action = action + this.Id = id + this.Include = include + this.Inputs = inputs + this.Keys = keys + this.Mode = mode + this.Type = typeVar + return &this +} + +// NewObservabilityPipelineDatadogTagsProcessorWithDefaults instantiates a new ObservabilityPipelineDatadogTagsProcessor 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 NewObservabilityPipelineDatadogTagsProcessorWithDefaults() *ObservabilityPipelineDatadogTagsProcessor { + this := ObservabilityPipelineDatadogTagsProcessor{} + var typeVar ObservabilityPipelineDatadogTagsProcessorType = OBSERVABILITYPIPELINEDATADOGTAGSPROCESSORTYPE_DATADOG_TAGS + this.Type = typeVar + return &this +} + +// GetAction returns the Action field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetAction() ObservabilityPipelineDatadogTagsProcessorAction { + if o == nil { + var ret ObservabilityPipelineDatadogTagsProcessorAction + return ret + } + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetActionOk() (*ObservabilityPipelineDatadogTagsProcessorAction, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) SetAction(v ObservabilityPipelineDatadogTagsProcessorAction) { + o.Action = v +} + +// GetId returns the Id field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) SetId(v string) { + o.Id = v +} + +// GetInclude returns the Include field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetInclude() string { + if o == nil { + var ret string + return ret + } + return o.Include +} + +// GetIncludeOk returns a tuple with the Include field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetIncludeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Include, true +} + +// SetInclude sets field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) SetInclude(v string) { + o.Include = v +} + +// GetInputs returns the Inputs field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetInputs() []string { + if o == nil { + var ret []string + return ret + } + return o.Inputs +} + +// GetInputsOk returns a tuple with the Inputs field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetInputsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Inputs, true +} + +// SetInputs sets field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) SetInputs(v []string) { + o.Inputs = v +} + +// GetKeys returns the Keys field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetKeys() []string { + if o == nil { + var ret []string + return ret + } + return o.Keys +} + +// GetKeysOk returns a tuple with the Keys field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetKeysOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Keys, true +} + +// SetKeys sets field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) SetKeys(v []string) { + o.Keys = v +} + +// GetMode returns the Mode field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetMode() ObservabilityPipelineDatadogTagsProcessorMode { + if o == nil { + var ret ObservabilityPipelineDatadogTagsProcessorMode + return ret + } + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetModeOk() (*ObservabilityPipelineDatadogTagsProcessorMode, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) SetMode(v ObservabilityPipelineDatadogTagsProcessorMode) { + o.Mode = v +} + +// GetType returns the Type field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetType() ObservabilityPipelineDatadogTagsProcessorType { + if o == nil { + var ret ObservabilityPipelineDatadogTagsProcessorType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatadogTagsProcessor) GetTypeOk() (*ObservabilityPipelineDatadogTagsProcessorType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ObservabilityPipelineDatadogTagsProcessor) SetType(v ObservabilityPipelineDatadogTagsProcessorType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ObservabilityPipelineDatadogTagsProcessor) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["action"] = o.Action + toSerialize["id"] = o.Id + toSerialize["include"] = o.Include + toSerialize["inputs"] = o.Inputs + toSerialize["keys"] = o.Keys + toSerialize["mode"] = o.Mode + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ObservabilityPipelineDatadogTagsProcessor) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Action *ObservabilityPipelineDatadogTagsProcessorAction `json:"action"` + Id *string `json:"id"` + Include *string `json:"include"` + Inputs *[]string `json:"inputs"` + Keys *[]string `json:"keys"` + Mode *ObservabilityPipelineDatadogTagsProcessorMode `json:"mode"` + Type *ObservabilityPipelineDatadogTagsProcessorType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Action == nil { + return fmt.Errorf("required field action missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Include == nil { + return fmt.Errorf("required field include missing") + } + if all.Inputs == nil { + return fmt.Errorf("required field inputs missing") + } + if all.Keys == nil { + return fmt.Errorf("required field keys missing") + } + if all.Mode == nil { + return fmt.Errorf("required field mode missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"action", "id", "include", "inputs", "keys", "mode", "type"}) + } else { + return err + } + + hasInvalidField := false + if !all.Action.IsValid() { + hasInvalidField = true + } else { + o.Action = *all.Action + } + o.Id = *all.Id + o.Include = *all.Include + o.Inputs = *all.Inputs + o.Keys = *all.Keys + if !all.Mode.IsValid() { + hasInvalidField = true + } else { + o.Mode = *all.Mode + } + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_observability_pipeline_datadog_tags_processor_action.go b/api/datadogV2/model_observability_pipeline_datadog_tags_processor_action.go new file mode 100644 index 00000000000..b9469b79792 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_datadog_tags_processor_action.go @@ -0,0 +1,66 @@ +// 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 ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ObservabilityPipelineDatadogTagsProcessorAction The action to take on tags with matching keys. +type ObservabilityPipelineDatadogTagsProcessorAction string + +// List of ObservabilityPipelineDatadogTagsProcessorAction. +const ( + OBSERVABILITYPIPELINEDATADOGTAGSPROCESSORACTION_INCLUDE ObservabilityPipelineDatadogTagsProcessorAction = "include" + OBSERVABILITYPIPELINEDATADOGTAGSPROCESSORACTION_EXCLUDE ObservabilityPipelineDatadogTagsProcessorAction = "exclude" +) + +var allowedObservabilityPipelineDatadogTagsProcessorActionEnumValues = []ObservabilityPipelineDatadogTagsProcessorAction{ + OBSERVABILITYPIPELINEDATADOGTAGSPROCESSORACTION_INCLUDE, + OBSERVABILITYPIPELINEDATADOGTAGSPROCESSORACTION_EXCLUDE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ObservabilityPipelineDatadogTagsProcessorAction) GetAllowedValues() []ObservabilityPipelineDatadogTagsProcessorAction { + return allowedObservabilityPipelineDatadogTagsProcessorActionEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ObservabilityPipelineDatadogTagsProcessorAction) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ObservabilityPipelineDatadogTagsProcessorAction(value) + return nil +} + +// NewObservabilityPipelineDatadogTagsProcessorActionFromValue returns a pointer to a valid ObservabilityPipelineDatadogTagsProcessorAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewObservabilityPipelineDatadogTagsProcessorActionFromValue(v string) (*ObservabilityPipelineDatadogTagsProcessorAction, error) { + ev := ObservabilityPipelineDatadogTagsProcessorAction(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ObservabilityPipelineDatadogTagsProcessorAction: valid values are %v", v, allowedObservabilityPipelineDatadogTagsProcessorActionEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ObservabilityPipelineDatadogTagsProcessorAction) IsValid() bool { + for _, existing := range allowedObservabilityPipelineDatadogTagsProcessorActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ObservabilityPipelineDatadogTagsProcessorAction value. +func (v ObservabilityPipelineDatadogTagsProcessorAction) Ptr() *ObservabilityPipelineDatadogTagsProcessorAction { + return &v +} diff --git a/api/datadogV2/model_observability_pipeline_datadog_tags_processor_mode.go b/api/datadogV2/model_observability_pipeline_datadog_tags_processor_mode.go new file mode 100644 index 00000000000..f78d92d8479 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_datadog_tags_processor_mode.go @@ -0,0 +1,64 @@ +// 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 ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ObservabilityPipelineDatadogTagsProcessorMode The processing mode. +type ObservabilityPipelineDatadogTagsProcessorMode string + +// List of ObservabilityPipelineDatadogTagsProcessorMode. +const ( + OBSERVABILITYPIPELINEDATADOGTAGSPROCESSORMODE_FILTER ObservabilityPipelineDatadogTagsProcessorMode = "filter" +) + +var allowedObservabilityPipelineDatadogTagsProcessorModeEnumValues = []ObservabilityPipelineDatadogTagsProcessorMode{ + OBSERVABILITYPIPELINEDATADOGTAGSPROCESSORMODE_FILTER, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ObservabilityPipelineDatadogTagsProcessorMode) GetAllowedValues() []ObservabilityPipelineDatadogTagsProcessorMode { + return allowedObservabilityPipelineDatadogTagsProcessorModeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ObservabilityPipelineDatadogTagsProcessorMode) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ObservabilityPipelineDatadogTagsProcessorMode(value) + return nil +} + +// NewObservabilityPipelineDatadogTagsProcessorModeFromValue returns a pointer to a valid ObservabilityPipelineDatadogTagsProcessorMode +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewObservabilityPipelineDatadogTagsProcessorModeFromValue(v string) (*ObservabilityPipelineDatadogTagsProcessorMode, error) { + ev := ObservabilityPipelineDatadogTagsProcessorMode(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ObservabilityPipelineDatadogTagsProcessorMode: valid values are %v", v, allowedObservabilityPipelineDatadogTagsProcessorModeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ObservabilityPipelineDatadogTagsProcessorMode) IsValid() bool { + for _, existing := range allowedObservabilityPipelineDatadogTagsProcessorModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ObservabilityPipelineDatadogTagsProcessorMode value. +func (v ObservabilityPipelineDatadogTagsProcessorMode) Ptr() *ObservabilityPipelineDatadogTagsProcessorMode { + return &v +} diff --git a/api/datadogV2/model_observability_pipeline_datadog_tags_processor_type.go b/api/datadogV2/model_observability_pipeline_datadog_tags_processor_type.go new file mode 100644 index 00000000000..10492d0db7c --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_datadog_tags_processor_type.go @@ -0,0 +1,64 @@ +// 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 ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ObservabilityPipelineDatadogTagsProcessorType The processor type. The value should always be `datadog_tags`. +type ObservabilityPipelineDatadogTagsProcessorType string + +// List of ObservabilityPipelineDatadogTagsProcessorType. +const ( + OBSERVABILITYPIPELINEDATADOGTAGSPROCESSORTYPE_DATADOG_TAGS ObservabilityPipelineDatadogTagsProcessorType = "datadog_tags" +) + +var allowedObservabilityPipelineDatadogTagsProcessorTypeEnumValues = []ObservabilityPipelineDatadogTagsProcessorType{ + OBSERVABILITYPIPELINEDATADOGTAGSPROCESSORTYPE_DATADOG_TAGS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ObservabilityPipelineDatadogTagsProcessorType) GetAllowedValues() []ObservabilityPipelineDatadogTagsProcessorType { + return allowedObservabilityPipelineDatadogTagsProcessorTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ObservabilityPipelineDatadogTagsProcessorType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ObservabilityPipelineDatadogTagsProcessorType(value) + return nil +} + +// NewObservabilityPipelineDatadogTagsProcessorTypeFromValue returns a pointer to a valid ObservabilityPipelineDatadogTagsProcessorType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewObservabilityPipelineDatadogTagsProcessorTypeFromValue(v string) (*ObservabilityPipelineDatadogTagsProcessorType, error) { + ev := ObservabilityPipelineDatadogTagsProcessorType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ObservabilityPipelineDatadogTagsProcessorType: valid values are %v", v, allowedObservabilityPipelineDatadogTagsProcessorTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ObservabilityPipelineDatadogTagsProcessorType) IsValid() bool { + for _, existing := range allowedObservabilityPipelineDatadogTagsProcessorTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ObservabilityPipelineDatadogTagsProcessorType value. +func (v ObservabilityPipelineDatadogTagsProcessorType) Ptr() *ObservabilityPipelineDatadogTagsProcessorType { + return &v +}