diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4afc8ca399d..94f455378b6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -55624,7 +55624,6 @@ components: - $ref: "#/components/schemas/ObservabilityPipelineSyslogNgDestination" - $ref: "#/components/schemas/ObservabilityPipelineDatabricksZerobusDestination" - $ref: "#/components/schemas/ObservabilityPipelineDatadogMetricsDestination" - - $ref: "#/components/schemas/ObservabilityPipelineSplunkHecMetricsDestination" ObservabilityPipelineConfigPipelineType: default: logs description: The type of data being ingested. Defaults to `logs` if not specified. @@ -59746,81 +59745,6 @@ components: type: string x-enum-varnames: - SPLUNK_HEC - ObservabilityPipelineSplunkHecMetricsDestination: - description: |- - The `splunk_hec_metrics` destination forwards metrics to Splunk using the HTTP Event Collector (HEC). - - **Supported pipeline types:** metrics - properties: - buffer: - $ref: "#/components/schemas/ObservabilityPipelineBufferOptions" - compression: - $ref: "#/components/schemas/ObservabilityPipelineSplunkHecMetricsDestinationCompression" - default_namespace: - description: Optional default namespace for metrics sent to Splunk HEC. - example: "custom_namespace" - type: string - endpoint_url_key: - description: Name of the environment variable or secret that holds the Splunk HEC endpoint URL. - example: SPLUNK_HEC_ENDPOINT_URL - type: string - id: - description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). - example: splunk-hec-metrics-destination - type: string - index: - description: Optional name of the Splunk index where metrics are written. - example: "metrics" - type: string - inputs: - description: A list of component IDs whose output is used as the `input` for this component. - example: ["metrics-filter-processor"] - items: - description: The ID of a component whose output is used as input for this destination. - type: string - type: array - source: - description: The Splunk source field value for metric events. - example: "observability_pipelines" - type: string - sourcetype: - description: The Splunk sourcetype to assign to metric events. - example: "custom_sourcetype" - type: string - tls: - $ref: "#/components/schemas/ObservabilityPipelineTls" - token_key: - description: Name of the environment variable or secret that holds the Splunk HEC token. - example: SPLUNK_HEC_TOKEN - type: string - type: - $ref: "#/components/schemas/ObservabilityPipelineSplunkHecMetricsDestinationType" - required: - - id - - type - - inputs - type: object - x-pipeline-types: [metrics] - ObservabilityPipelineSplunkHecMetricsDestinationCompression: - default: none - description: Compression algorithm applied when sending metrics to Splunk HEC. - enum: - - none - - gzip - example: none - type: string - x-enum-varnames: - - NONE - - GZIP - ObservabilityPipelineSplunkHecMetricsDestinationType: - default: splunk_hec_metrics - description: The destination type. Always `splunk_hec_metrics`. - enum: - - splunk_hec_metrics - example: splunk_hec_metrics - type: string - x-enum-varnames: - - SPLUNK_HEC_METRICS ObservabilityPipelineSplunkHecSource: description: |- The `splunk_hec` source implements the Splunk HTTP Event Collector (HEC) API. @@ -155012,7 +154936,7 @@ paths: **Note**: This endpoint is in beta and may be subject to changes. Please check the documentation regularly for updates. /api/v2/siem-historical-detections/histsignals/search: - get: + post: description: Search hist signals. operationId: SearchSecurityMonitoringHistsignals requestBody: @@ -155064,6 +154988,7 @@ paths: - security_monitoring_signals_read summary: Search hist signals tags: ["Security Monitoring"] + x-codegen-request-body-name: body "x-permission": operator: OR permissions: diff --git a/api/datadogV2/api_security_monitoring.go b/api/datadogV2/api_security_monitoring.go index 8bbdfede7e7..839c43d82e3 100644 --- a/api/datadogV2/api_security_monitoring.go +++ b/api/datadogV2/api_security_monitoring.go @@ -11810,7 +11810,7 @@ func (r *SearchSecurityMonitoringHistsignalsOptionalParameters) WithBody(body Se // Search hist signals. func (a *SecurityMonitoringApi) SearchSecurityMonitoringHistsignals(ctx _context.Context, o ...SearchSecurityMonitoringHistsignalsOptionalParameters) (SecurityMonitoringSignalsListResponse, *_nethttp.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = _nethttp.MethodPost localVarPostBody interface{} localVarReturnValue SecurityMonitoringSignalsListResponse optionalParams SearchSecurityMonitoringHistsignalsOptionalParameters diff --git a/api/datadogV2/model_observability_pipeline_config_destination_item.go b/api/datadogV2/model_observability_pipeline_config_destination_item.go index 6a56642046d..f141bb386c3 100644 --- a/api/datadogV2/model_observability_pipeline_config_destination_item.go +++ b/api/datadogV2/model_observability_pipeline_config_destination_item.go @@ -35,7 +35,6 @@ type ObservabilityPipelineConfigDestinationItem struct { ObservabilityPipelineSyslogNgDestination *ObservabilityPipelineSyslogNgDestination ObservabilityPipelineDatabricksZerobusDestination *ObservabilityPipelineDatabricksZerobusDestination ObservabilityPipelineDatadogMetricsDestination *ObservabilityPipelineDatadogMetricsDestination - ObservabilityPipelineSplunkHecMetricsDestination *ObservabilityPipelineSplunkHecMetricsDestination // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject interface{} @@ -166,11 +165,6 @@ func ObservabilityPipelineDatadogMetricsDestinationAsObservabilityPipelineConfig return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineDatadogMetricsDestination: v} } -// ObservabilityPipelineSplunkHecMetricsDestinationAsObservabilityPipelineConfigDestinationItem is a convenience function that returns ObservabilityPipelineSplunkHecMetricsDestination wrapped in ObservabilityPipelineConfigDestinationItem. -func ObservabilityPipelineSplunkHecMetricsDestinationAsObservabilityPipelineConfigDestinationItem(v *ObservabilityPipelineSplunkHecMetricsDestination) ObservabilityPipelineConfigDestinationItem { - return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineSplunkHecMetricsDestination: v} -} - // UnmarshalJSON turns data into one of the pointers in the struct. func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte) error { var err error @@ -600,23 +594,6 @@ func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte obj.ObservabilityPipelineDatadogMetricsDestination = nil } - // try to unmarshal data into ObservabilityPipelineSplunkHecMetricsDestination - err = datadog.Unmarshal(data, &obj.ObservabilityPipelineSplunkHecMetricsDestination) - if err == nil { - if obj.ObservabilityPipelineSplunkHecMetricsDestination != nil && obj.ObservabilityPipelineSplunkHecMetricsDestination.UnparsedObject == nil { - jsonObservabilityPipelineSplunkHecMetricsDestination, _ := datadog.Marshal(obj.ObservabilityPipelineSplunkHecMetricsDestination) - if string(jsonObservabilityPipelineSplunkHecMetricsDestination) == "{}" { // empty struct - obj.ObservabilityPipelineSplunkHecMetricsDestination = nil - } else { - match++ - } - } else { - obj.ObservabilityPipelineSplunkHecMetricsDestination = nil - } - } else { - obj.ObservabilityPipelineSplunkHecMetricsDestination = nil - } - if match != 1 { // more than 1 match // reset to nil obj.ObservabilityPipelineElasticsearchDestination = nil @@ -644,7 +621,6 @@ func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte obj.ObservabilityPipelineSyslogNgDestination = nil obj.ObservabilityPipelineDatabricksZerobusDestination = nil obj.ObservabilityPipelineDatadogMetricsDestination = nil - obj.ObservabilityPipelineSplunkHecMetricsDestination = nil return datadog.Unmarshal(data, &obj.UnparsedObject) } return nil // exactly one match @@ -752,10 +728,6 @@ func (obj ObservabilityPipelineConfigDestinationItem) MarshalJSON() ([]byte, err return datadog.Marshal(&obj.ObservabilityPipelineDatadogMetricsDestination) } - if obj.ObservabilityPipelineSplunkHecMetricsDestination != nil { - return datadog.Marshal(&obj.ObservabilityPipelineSplunkHecMetricsDestination) - } - if obj.UnparsedObject != nil { return datadog.Marshal(obj.UnparsedObject) } @@ -864,10 +836,6 @@ func (obj *ObservabilityPipelineConfigDestinationItem) GetActualInstance() inter return obj.ObservabilityPipelineDatadogMetricsDestination } - if obj.ObservabilityPipelineSplunkHecMetricsDestination != nil { - return obj.ObservabilityPipelineSplunkHecMetricsDestination - } - // all schemas are nil return nil } diff --git a/api/datadogV2/model_observability_pipeline_splunk_hec_metrics_destination.go b/api/datadogV2/model_observability_pipeline_splunk_hec_metrics_destination.go deleted file mode 100644 index be8389cbdd5..00000000000 --- a/api/datadogV2/model_observability_pipeline_splunk_hec_metrics_destination.go +++ /dev/null @@ -1,505 +0,0 @@ -// 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" -) - -// ObservabilityPipelineSplunkHecMetricsDestination The `splunk_hec_metrics` destination forwards metrics to Splunk using the HTTP Event Collector (HEC). -// -// **Supported pipeline types:** metrics -type ObservabilityPipelineSplunkHecMetricsDestination struct { - // Configuration for buffer settings on destination components. - Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` - // Compression algorithm applied when sending metrics to Splunk HEC. - Compression *ObservabilityPipelineSplunkHecMetricsDestinationCompression `json:"compression,omitempty"` - // Optional default namespace for metrics sent to Splunk HEC. - DefaultNamespace *string `json:"default_namespace,omitempty"` - // Name of the environment variable or secret that holds the Splunk HEC endpoint URL. - EndpointUrlKey *string `json:"endpoint_url_key,omitempty"` - // The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). - Id string `json:"id"` - // Optional name of the Splunk index where metrics are written. - Index *string `json:"index,omitempty"` - // A list of component IDs whose output is used as the `input` for this component. - Inputs []string `json:"inputs"` - // The Splunk source field value for metric events. - Source *string `json:"source,omitempty"` - // The Splunk sourcetype to assign to metric events. - Sourcetype *string `json:"sourcetype,omitempty"` - // Configuration for enabling TLS encryption between the pipeline component and external services. - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` - // Name of the environment variable or secret that holds the Splunk HEC token. - TokenKey *string `json:"token_key,omitempty"` - // The destination type. Always `splunk_hec_metrics`. - Type ObservabilityPipelineSplunkHecMetricsDestinationType `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:"-"` -} - -// NewObservabilityPipelineSplunkHecMetricsDestination instantiates a new ObservabilityPipelineSplunkHecMetricsDestination 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 NewObservabilityPipelineSplunkHecMetricsDestination(id string, inputs []string, typeVar ObservabilityPipelineSplunkHecMetricsDestinationType) *ObservabilityPipelineSplunkHecMetricsDestination { - this := ObservabilityPipelineSplunkHecMetricsDestination{} - var compression ObservabilityPipelineSplunkHecMetricsDestinationCompression = OBSERVABILITYPIPELINESPLUNKHECMETRICSDESTINATIONCOMPRESSION_NONE - this.Compression = &compression - this.Id = id - this.Inputs = inputs - this.Type = typeVar - return &this -} - -// NewObservabilityPipelineSplunkHecMetricsDestinationWithDefaults instantiates a new ObservabilityPipelineSplunkHecMetricsDestination 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 NewObservabilityPipelineSplunkHecMetricsDestinationWithDefaults() *ObservabilityPipelineSplunkHecMetricsDestination { - this := ObservabilityPipelineSplunkHecMetricsDestination{} - var compression ObservabilityPipelineSplunkHecMetricsDestinationCompression = OBSERVABILITYPIPELINESPLUNKHECMETRICSDESTINATIONCOMPRESSION_NONE - this.Compression = &compression - var typeVar ObservabilityPipelineSplunkHecMetricsDestinationType = OBSERVABILITYPIPELINESPLUNKHECMETRICSDESTINATIONTYPE_SPLUNK_HEC_METRICS - this.Type = typeVar - return &this -} - -// GetBuffer returns the Buffer field value if set, zero value otherwise. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetBuffer() ObservabilityPipelineBufferOptions { - if o == nil || o.Buffer == nil { - var ret ObservabilityPipelineBufferOptions - return ret - } - return *o.Buffer -} - -// GetBufferOk returns a tuple with the Buffer field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetBufferOk() (*ObservabilityPipelineBufferOptions, bool) { - if o == nil || o.Buffer == nil { - return nil, false - } - return o.Buffer, true -} - -// HasBuffer returns a boolean if a field has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) HasBuffer() bool { - return o != nil && o.Buffer != nil -} - -// SetBuffer gets a reference to the given ObservabilityPipelineBufferOptions and assigns it to the Buffer field. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { - o.Buffer = &v -} - -// GetCompression returns the Compression field value if set, zero value otherwise. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetCompression() ObservabilityPipelineSplunkHecMetricsDestinationCompression { - if o == nil || o.Compression == nil { - var ret ObservabilityPipelineSplunkHecMetricsDestinationCompression - return ret - } - return *o.Compression -} - -// GetCompressionOk returns a tuple with the Compression field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetCompressionOk() (*ObservabilityPipelineSplunkHecMetricsDestinationCompression, bool) { - if o == nil || o.Compression == nil { - return nil, false - } - return o.Compression, true -} - -// HasCompression returns a boolean if a field has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) HasCompression() bool { - return o != nil && o.Compression != nil -} - -// SetCompression gets a reference to the given ObservabilityPipelineSplunkHecMetricsDestinationCompression and assigns it to the Compression field. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) SetCompression(v ObservabilityPipelineSplunkHecMetricsDestinationCompression) { - o.Compression = &v -} - -// GetDefaultNamespace returns the DefaultNamespace field value if set, zero value otherwise. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetDefaultNamespace() string { - if o == nil || o.DefaultNamespace == nil { - var ret string - return ret - } - return *o.DefaultNamespace -} - -// GetDefaultNamespaceOk returns a tuple with the DefaultNamespace field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetDefaultNamespaceOk() (*string, bool) { - if o == nil || o.DefaultNamespace == nil { - return nil, false - } - return o.DefaultNamespace, true -} - -// HasDefaultNamespace returns a boolean if a field has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) HasDefaultNamespace() bool { - return o != nil && o.DefaultNamespace != nil -} - -// SetDefaultNamespace gets a reference to the given string and assigns it to the DefaultNamespace field. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) SetDefaultNamespace(v string) { - o.DefaultNamespace = &v -} - -// GetEndpointUrlKey returns the EndpointUrlKey field value if set, zero value otherwise. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetEndpointUrlKey() string { - if o == nil || o.EndpointUrlKey == nil { - var ret string - return ret - } - return *o.EndpointUrlKey -} - -// GetEndpointUrlKeyOk returns a tuple with the EndpointUrlKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetEndpointUrlKeyOk() (*string, bool) { - if o == nil || o.EndpointUrlKey == nil { - return nil, false - } - return o.EndpointUrlKey, true -} - -// HasEndpointUrlKey returns a boolean if a field has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) HasEndpointUrlKey() bool { - return o != nil && o.EndpointUrlKey != nil -} - -// SetEndpointUrlKey gets a reference to the given string and assigns it to the EndpointUrlKey field. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) SetEndpointUrlKey(v string) { - o.EndpointUrlKey = &v -} - -// GetId returns the Id field value. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) 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 *ObservabilityPipelineSplunkHecMetricsDestination) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) SetId(v string) { - o.Id = v -} - -// GetIndex returns the Index field value if set, zero value otherwise. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetIndex() string { - if o == nil || o.Index == nil { - var ret string - return ret - } - return *o.Index -} - -// GetIndexOk returns a tuple with the Index field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetIndexOk() (*string, bool) { - if o == nil || o.Index == nil { - return nil, false - } - return o.Index, true -} - -// HasIndex returns a boolean if a field has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) HasIndex() bool { - return o != nil && o.Index != nil -} - -// SetIndex gets a reference to the given string and assigns it to the Index field. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) SetIndex(v string) { - o.Index = &v -} - -// GetInputs returns the Inputs field value. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) 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 *ObservabilityPipelineSplunkHecMetricsDestination) GetInputsOk() (*[]string, bool) { - if o == nil { - return nil, false - } - return &o.Inputs, true -} - -// SetInputs sets field value. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) SetInputs(v []string) { - o.Inputs = v -} - -// GetSource returns the Source field value if set, zero value otherwise. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetSource() string { - if o == nil || o.Source == nil { - var ret string - return ret - } - return *o.Source -} - -// GetSourceOk returns a tuple with the Source field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetSourceOk() (*string, bool) { - if o == nil || o.Source == nil { - return nil, false - } - return o.Source, true -} - -// HasSource returns a boolean if a field has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) HasSource() bool { - return o != nil && o.Source != nil -} - -// SetSource gets a reference to the given string and assigns it to the Source field. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) SetSource(v string) { - o.Source = &v -} - -// GetSourcetype returns the Sourcetype field value if set, zero value otherwise. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetSourcetype() string { - if o == nil || o.Sourcetype == nil { - var ret string - return ret - } - return *o.Sourcetype -} - -// GetSourcetypeOk returns a tuple with the Sourcetype field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetSourcetypeOk() (*string, bool) { - if o == nil || o.Sourcetype == nil { - return nil, false - } - return o.Sourcetype, true -} - -// HasSourcetype returns a boolean if a field has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) HasSourcetype() bool { - return o != nil && o.Sourcetype != nil -} - -// SetSourcetype gets a reference to the given string and assigns it to the Sourcetype field. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) SetSourcetype(v string) { - o.Sourcetype = &v -} - -// GetTls returns the Tls field value if set, zero value otherwise. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetTls() ObservabilityPipelineTls { - if o == nil || o.Tls == nil { - var ret ObservabilityPipelineTls - return ret - } - return *o.Tls -} - -// GetTlsOk returns a tuple with the Tls field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetTlsOk() (*ObservabilityPipelineTls, bool) { - if o == nil || o.Tls == nil { - return nil, false - } - return o.Tls, true -} - -// HasTls returns a boolean if a field has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) HasTls() bool { - return o != nil && o.Tls != nil -} - -// SetTls gets a reference to the given ObservabilityPipelineTls and assigns it to the Tls field. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) SetTls(v ObservabilityPipelineTls) { - o.Tls = &v -} - -// GetTokenKey returns the TokenKey field value if set, zero value otherwise. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetTokenKey() string { - if o == nil || o.TokenKey == nil { - var ret string - return ret - } - return *o.TokenKey -} - -// GetTokenKeyOk returns a tuple with the TokenKey field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetTokenKeyOk() (*string, bool) { - if o == nil || o.TokenKey == nil { - return nil, false - } - return o.TokenKey, true -} - -// HasTokenKey returns a boolean if a field has been set. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) HasTokenKey() bool { - return o != nil && o.TokenKey != nil -} - -// SetTokenKey gets a reference to the given string and assigns it to the TokenKey field. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) SetTokenKey(v string) { - o.TokenKey = &v -} - -// GetType returns the Type field value. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) GetType() ObservabilityPipelineSplunkHecMetricsDestinationType { - if o == nil { - var ret ObservabilityPipelineSplunkHecMetricsDestinationType - 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 *ObservabilityPipelineSplunkHecMetricsDestination) GetTypeOk() (*ObservabilityPipelineSplunkHecMetricsDestinationType, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) SetType(v ObservabilityPipelineSplunkHecMetricsDestinationType) { - o.Type = v -} - -// MarshalJSON serializes the struct using spec logic. -func (o ObservabilityPipelineSplunkHecMetricsDestination) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Buffer != nil { - toSerialize["buffer"] = o.Buffer - } - if o.Compression != nil { - toSerialize["compression"] = o.Compression - } - if o.DefaultNamespace != nil { - toSerialize["default_namespace"] = o.DefaultNamespace - } - if o.EndpointUrlKey != nil { - toSerialize["endpoint_url_key"] = o.EndpointUrlKey - } - toSerialize["id"] = o.Id - if o.Index != nil { - toSerialize["index"] = o.Index - } - toSerialize["inputs"] = o.Inputs - if o.Source != nil { - toSerialize["source"] = o.Source - } - if o.Sourcetype != nil { - toSerialize["sourcetype"] = o.Sourcetype - } - if o.Tls != nil { - toSerialize["tls"] = o.Tls - } - if o.TokenKey != nil { - toSerialize["token_key"] = o.TokenKey - } - toSerialize["type"] = o.Type - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *ObservabilityPipelineSplunkHecMetricsDestination) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` - Compression *ObservabilityPipelineSplunkHecMetricsDestinationCompression `json:"compression,omitempty"` - DefaultNamespace *string `json:"default_namespace,omitempty"` - EndpointUrlKey *string `json:"endpoint_url_key,omitempty"` - Id *string `json:"id"` - Index *string `json:"index,omitempty"` - Inputs *[]string `json:"inputs"` - Source *string `json:"source,omitempty"` - Sourcetype *string `json:"sourcetype,omitempty"` - Tls *ObservabilityPipelineTls `json:"tls,omitempty"` - TokenKey *string `json:"token_key,omitempty"` - Type *ObservabilityPipelineSplunkHecMetricsDestinationType `json:"type"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - if all.Id == nil { - return fmt.Errorf("required field id missing") - } - if all.Inputs == nil { - return fmt.Errorf("required field inputs missing") - } - if all.Type == nil { - return fmt.Errorf("required field type missing") - } - additionalProperties := make(map[string]interface{}) - if err = datadog.UnmarshalUseNumber(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"buffer", "compression", "default_namespace", "endpoint_url_key", "id", "index", "inputs", "source", "sourcetype", "tls", "token_key", "type"}) - } else { - return err - } - - hasInvalidField := false - o.Buffer = all.Buffer - if all.Compression != nil && !all.Compression.IsValid() { - hasInvalidField = true - } else { - o.Compression = all.Compression - } - o.DefaultNamespace = all.DefaultNamespace - o.EndpointUrlKey = all.EndpointUrlKey - o.Id = *all.Id - o.Index = all.Index - o.Inputs = *all.Inputs - o.Source = all.Source - o.Sourcetype = all.Sourcetype - if all.Tls != nil && all.Tls.UnparsedObject != nil && o.UnparsedObject == nil { - hasInvalidField = true - } - o.Tls = all.Tls - o.TokenKey = all.TokenKey - 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_splunk_hec_metrics_destination_compression.go b/api/datadogV2/model_observability_pipeline_splunk_hec_metrics_destination_compression.go deleted file mode 100644 index f1868ac820d..00000000000 --- a/api/datadogV2/model_observability_pipeline_splunk_hec_metrics_destination_compression.go +++ /dev/null @@ -1,66 +0,0 @@ -// 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" -) - -// ObservabilityPipelineSplunkHecMetricsDestinationCompression Compression algorithm applied when sending metrics to Splunk HEC. -type ObservabilityPipelineSplunkHecMetricsDestinationCompression string - -// List of ObservabilityPipelineSplunkHecMetricsDestinationCompression. -const ( - OBSERVABILITYPIPELINESPLUNKHECMETRICSDESTINATIONCOMPRESSION_NONE ObservabilityPipelineSplunkHecMetricsDestinationCompression = "none" - OBSERVABILITYPIPELINESPLUNKHECMETRICSDESTINATIONCOMPRESSION_GZIP ObservabilityPipelineSplunkHecMetricsDestinationCompression = "gzip" -) - -var allowedObservabilityPipelineSplunkHecMetricsDestinationCompressionEnumValues = []ObservabilityPipelineSplunkHecMetricsDestinationCompression{ - OBSERVABILITYPIPELINESPLUNKHECMETRICSDESTINATIONCOMPRESSION_NONE, - OBSERVABILITYPIPELINESPLUNKHECMETRICSDESTINATIONCOMPRESSION_GZIP, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *ObservabilityPipelineSplunkHecMetricsDestinationCompression) GetAllowedValues() []ObservabilityPipelineSplunkHecMetricsDestinationCompression { - return allowedObservabilityPipelineSplunkHecMetricsDestinationCompressionEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *ObservabilityPipelineSplunkHecMetricsDestinationCompression) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = ObservabilityPipelineSplunkHecMetricsDestinationCompression(value) - return nil -} - -// NewObservabilityPipelineSplunkHecMetricsDestinationCompressionFromValue returns a pointer to a valid ObservabilityPipelineSplunkHecMetricsDestinationCompression -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewObservabilityPipelineSplunkHecMetricsDestinationCompressionFromValue(v string) (*ObservabilityPipelineSplunkHecMetricsDestinationCompression, error) { - ev := ObservabilityPipelineSplunkHecMetricsDestinationCompression(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for ObservabilityPipelineSplunkHecMetricsDestinationCompression: valid values are %v", v, allowedObservabilityPipelineSplunkHecMetricsDestinationCompressionEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v ObservabilityPipelineSplunkHecMetricsDestinationCompression) IsValid() bool { - for _, existing := range allowedObservabilityPipelineSplunkHecMetricsDestinationCompressionEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ObservabilityPipelineSplunkHecMetricsDestinationCompression value. -func (v ObservabilityPipelineSplunkHecMetricsDestinationCompression) Ptr() *ObservabilityPipelineSplunkHecMetricsDestinationCompression { - return &v -} diff --git a/api/datadogV2/model_observability_pipeline_splunk_hec_metrics_destination_type.go b/api/datadogV2/model_observability_pipeline_splunk_hec_metrics_destination_type.go deleted file mode 100644 index 745b0db3aab..00000000000 --- a/api/datadogV2/model_observability_pipeline_splunk_hec_metrics_destination_type.go +++ /dev/null @@ -1,64 +0,0 @@ -// 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" -) - -// ObservabilityPipelineSplunkHecMetricsDestinationType The destination type. Always `splunk_hec_metrics`. -type ObservabilityPipelineSplunkHecMetricsDestinationType string - -// List of ObservabilityPipelineSplunkHecMetricsDestinationType. -const ( - OBSERVABILITYPIPELINESPLUNKHECMETRICSDESTINATIONTYPE_SPLUNK_HEC_METRICS ObservabilityPipelineSplunkHecMetricsDestinationType = "splunk_hec_metrics" -) - -var allowedObservabilityPipelineSplunkHecMetricsDestinationTypeEnumValues = []ObservabilityPipelineSplunkHecMetricsDestinationType{ - OBSERVABILITYPIPELINESPLUNKHECMETRICSDESTINATIONTYPE_SPLUNK_HEC_METRICS, -} - -// GetAllowedValues reeturns the list of possible values. -func (v *ObservabilityPipelineSplunkHecMetricsDestinationType) GetAllowedValues() []ObservabilityPipelineSplunkHecMetricsDestinationType { - return allowedObservabilityPipelineSplunkHecMetricsDestinationTypeEnumValues -} - -// UnmarshalJSON deserializes the given payload. -func (v *ObservabilityPipelineSplunkHecMetricsDestinationType) UnmarshalJSON(src []byte) error { - var value string - err := datadog.Unmarshal(src, &value) - if err != nil { - return err - } - *v = ObservabilityPipelineSplunkHecMetricsDestinationType(value) - return nil -} - -// NewObservabilityPipelineSplunkHecMetricsDestinationTypeFromValue returns a pointer to a valid ObservabilityPipelineSplunkHecMetricsDestinationType -// for the value passed as argument, or an error if the value passed is not allowed by the enum. -func NewObservabilityPipelineSplunkHecMetricsDestinationTypeFromValue(v string) (*ObservabilityPipelineSplunkHecMetricsDestinationType, error) { - ev := ObservabilityPipelineSplunkHecMetricsDestinationType(v) - if ev.IsValid() { - return &ev, nil - } - return nil, fmt.Errorf("invalid value '%v' for ObservabilityPipelineSplunkHecMetricsDestinationType: valid values are %v", v, allowedObservabilityPipelineSplunkHecMetricsDestinationTypeEnumValues) -} - -// IsValid return true if the value is valid for the enum, false otherwise. -func (v ObservabilityPipelineSplunkHecMetricsDestinationType) IsValid() bool { - for _, existing := range allowedObservabilityPipelineSplunkHecMetricsDestinationTypeEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ObservabilityPipelineSplunkHecMetricsDestinationType value. -func (v ObservabilityPipelineSplunkHecMetricsDestinationType) Ptr() *ObservabilityPipelineSplunkHecMetricsDestinationType { - return &v -}