From 651a2e637cac68151294c4fff0ab3d6bdbfbdf17 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 21 Aug 2025 17:10:33 +0000 Subject: [PATCH] Regenerate client from commit ca16233 of spec repo --- .generated-info | 4 +- .generator/schemas/v2/openapi.yaml | 110 ++++++++++++- .../model_azure_storage_destination.go | 47 +++++- .../model_microsoft_sentinel_destination.go | 51 +++++- ...pipeline_amazon_open_search_destination.go | 37 ++++- ...vability_pipeline_amazon_s3_destination.go | 37 ++++- ...l_observability_pipeline_buffer_options.go | 137 ++++++++++++++++ ...ility_pipeline_buffer_options_disk_type.go | 64 ++++++++ ...ity_pipeline_buffer_options_memory_type.go | 64 ++++++++ ...ility_pipeline_datadog_logs_destination.go | 37 ++++- ...ervability_pipeline_disk_buffer_options.go | 151 ++++++++++++++++++ ...lity_pipeline_elasticsearch_destination.go | 37 ++++- ...y_pipeline_google_chronicle_destination.go | 37 ++++- ...peline_google_cloud_storage_destination.go | 37 ++++- ...vability_pipeline_memory_buffer_options.go | 151 ++++++++++++++++++ ...ity_pipeline_memory_buffer_size_options.go | 151 ++++++++++++++++++ ...vability_pipeline_new_relic_destination.go | 37 ++++- ...bility_pipeline_open_search_destination.go | 37 ++++- ..._observability_pipeline_quota_processor.go | 86 +++++++--- ...ipeline_quota_processor_overflow_action.go | 2 +- ...ervability_pipeline_rsyslog_destination.go | 37 ++++- ...observability_pipeline_sample_processor.go | 37 ++++- ...ility_pipeline_sentinel_one_destination.go | 37 ++++- ...ability_pipeline_splunk_hec_destination.go | 37 ++++- ...ability_pipeline_sumo_logic_destination.go | 37 ++++- ...vability_pipeline_syslog_ng_destination.go | 37 ++++- 26 files changed, 1480 insertions(+), 56 deletions(-) create mode 100644 api/datadogV2/model_observability_pipeline_buffer_options.go create mode 100644 api/datadogV2/model_observability_pipeline_buffer_options_disk_type.go create mode 100644 api/datadogV2/model_observability_pipeline_buffer_options_memory_type.go create mode 100644 api/datadogV2/model_observability_pipeline_disk_buffer_options.go create mode 100644 api/datadogV2/model_observability_pipeline_memory_buffer_options.go create mode 100644 api/datadogV2/model_observability_pipeline_memory_buffer_size_options.go diff --git a/.generated-info b/.generated-info index 9bd0cd6eba2..aec863a3dc3 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "4413e63", - "generated": "2025-08-19 20:30:08.992" + "spec_repo_commit": "ca16233", + "generated": "2025-08-21 17:10:33.279" } diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5dc52e4a2ee..7be522b9349 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -4983,6 +4983,8 @@ components: description: Optional prefix for blobs written to the container. example: logs/ type: string + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' container_name: description: The name of the Azure Blob Storage container to store logs in. @@ -25037,6 +25039,8 @@ components: description: The `microsoft_sentinel` destination forwards logs to Microsoft Sentinel. properties: + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' client_id: description: Azure AD client ID used for authentication. example: a1b2c3d4-5678-90ab-cdef-1234567890ab @@ -26669,6 +26673,8 @@ components: properties: auth: $ref: '#/components/schemas/ObservabilityPipelineAmazonOpenSearchDestinationAuth' + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' bulk_index: description: The index to write logs to. example: logs-index @@ -26747,6 +26753,8 @@ components: description: S3 bucket name. example: error-logs type: string + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' id: description: Unique identifier for the destination component. example: amazon-s3-destination @@ -26919,6 +26927,30 @@ components: role session. type: string type: object + ObservabilityPipelineBufferOptions: + description: Configuration for buffer settings on destination components. + oneOf: + - $ref: '#/components/schemas/ObservabilityPipelineDiskBufferOptions' + - $ref: '#/components/schemas/ObservabilityPipelineMemoryBufferOptions' + - $ref: '#/components/schemas/ObservabilityPipelineMemoryBufferSizeOptions' + ObservabilityPipelineBufferOptionsDiskType: + default: disk + description: Specifies the buffer type to configure. This option supports only + a disk buffer. + enum: + - disk + type: string + x-enum-varnames: + - DISK + ObservabilityPipelineBufferOptionsMemoryType: + default: memory + description: Specifies the buffer type to configure. This option supports only + a memory buffer. + enum: + - memory + type: string + x-enum-varnames: + - MEMORY ObservabilityPipelineConfig: description: Specifies the pipeline's configuration, including its sources, processors, and destinations. @@ -27232,6 +27264,8 @@ components: ObservabilityPipelineDatadogLogsDestination: description: The `datadog_logs` destination forwards logs to Datadog Log Management. properties: + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' id: description: The unique identifier for this component. example: datadog-logs-destination @@ -27407,12 +27441,25 @@ components: type: string x-enum-varnames: - DEDUPE + ObservabilityPipelineDiskBufferOptions: + description: Options for configuring a disk buffer. + properties: + max_size: + description: Maximum size of the disk buffer. + example: 4096 + format: int64 + type: integer + type: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptionsDiskType' + type: object ObservabilityPipelineElasticsearchDestination: description: The `elasticsearch` destination writes logs to an Elasticsearch cluster. properties: api_version: $ref: '#/components/schemas/ObservabilityPipelineElasticsearchDestinationApiVersion' + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' bulk_index: description: The index to write logs to in Elasticsearch. example: logs-index @@ -27897,6 +27944,8 @@ components: properties: auth: $ref: '#/components/schemas/ObservabilityPipelineGcpAuth' + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' customer_id: description: The Google Chronicle customer ID. example: abcdefg123456789 @@ -27963,6 +28012,8 @@ components: description: Name of the GCS bucket. example: error-logs type: string + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' id: description: Unique identifier for the destination component. example: gcs-destination @@ -28273,6 +28324,28 @@ components: type: string x-enum-varnames: - LOGSTASH + ObservabilityPipelineMemoryBufferOptions: + description: Options for configuring a memory buffer by byte size. + properties: + max_size: + description: Maximum size of the disk buffer. + example: 4096 + format: int64 + type: integer + type: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptionsMemoryType' + type: object + ObservabilityPipelineMemoryBufferSizeOptions: + description: Options for configuring a memory buffer by queue length. + properties: + max_events: + description: Maximum events for the memory buffer. + example: 500 + format: int64 + type: integer + type: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptionsMemoryType' + type: object ObservabilityPipelineMetadataEntry: description: A custom metadata entry. properties: @@ -28296,6 +28369,8 @@ components: ObservabilityPipelineNewRelicDestination: description: The `new_relic` destination sends logs to the New Relic platform. properties: + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' id: description: The unique identifier for this component. example: new-relic-destination @@ -28433,6 +28508,8 @@ components: ObservabilityPipelineOpenSearchDestination: description: The `opensearch` destination writes logs to an OpenSearch cluster. properties: + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' bulk_index: description: The index to write logs to. example: logs-index @@ -28657,9 +28734,10 @@ components: can drop or alert. properties: drop_events: - description: If set to `true`, logs that matched the quota filter and sent - after the quota has been met are dropped; only logs that did not match - the filter query continue through the pipeline. + description: 'If set to `true`, logs that match the quota filter and are + sent after the quota is exceeded are dropped. Logs that do not match the + filter continue through the pipeline. **Note**: You can set either `drop_events` + or `overflow_action`, but not both.' example: false type: boolean id: @@ -28707,6 +28785,8 @@ components: items: type: string type: array + too_many_buckets_action: + $ref: '#/components/schemas/ObservabilityPipelineQuotaProcessorOverflowAction' type: $ref: '#/components/schemas/ObservabilityPipelineQuotaProcessorType' required: @@ -28714,7 +28794,6 @@ components: - type - include - name - - drop_events - limit - inputs type: object @@ -28745,7 +28824,8 @@ components: - BYTES - EVENTS ObservabilityPipelineQuotaProcessorOverflowAction: - description: 'The action to take when the quota is exceeded. Options: + description: 'The action to take when the quota or bucket limit is exceeded. + Options: - `drop`: Drop the event. @@ -29006,6 +29086,8 @@ components: description: The `rsyslog` destination forwards logs to an external `rsyslog` server over TCP or UDP using the syslog protocol. properties: + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' id: description: The unique identifier for this component. example: rsyslog-destination @@ -29076,6 +29158,16 @@ components: description: The `sample` processor allows probabilistic sampling of logs at a fixed rate. properties: + group_by: + description: Optional list of fields to group events by. Each group is sampled + independently. + example: + - service + - host + items: + type: string + minItems: 1 + type: array id: description: The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the `input` @@ -29480,6 +29572,8 @@ components: ObservabilityPipelineSentinelOneDestination: description: The `sentinel_one` destination sends logs to SentinelOne. properties: + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' id: description: The unique identifier for this component. example: sentinelone-destination @@ -29836,6 +29930,8 @@ components: ' example: true type: boolean + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' encoding: $ref: '#/components/schemas/ObservabilityPipelineSplunkHecDestinationEncoding' id: @@ -29949,6 +30045,8 @@ components: ObservabilityPipelineSumoLogicDestination: description: The `sumo_logic` destination forwards logs to Sumo Logic. properties: + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' encoding: $ref: '#/components/schemas/ObservabilityPipelineSumoLogicDestinationEncoding' header_custom_fields: @@ -30052,6 +30150,8 @@ components: description: The `syslog_ng` destination forwards logs to an external `syslog-ng` server over TCP or UDP using the syslog protocol. properties: + buffer: + $ref: '#/components/schemas/ObservabilityPipelineBufferOptions' id: description: The unique identifier for this component. example: syslog-ng-destination diff --git a/api/datadogV2/model_azure_storage_destination.go b/api/datadogV2/model_azure_storage_destination.go index 56d5564e7a2..8e5254878dc 100644 --- a/api/datadogV2/model_azure_storage_destination.go +++ b/api/datadogV2/model_azure_storage_destination.go @@ -14,6 +14,8 @@ import ( type AzureStorageDestination struct { // Optional prefix for blobs written to the container. BlobPrefix *string `json:"blob_prefix,omitempty"` + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // The name of the Azure Blob Storage container to store logs in. ContainerName string `json:"container_name"` // The unique identifier for this component. @@ -78,6 +80,34 @@ func (o *AzureStorageDestination) SetBlobPrefix(v string) { o.BlobPrefix = &v } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *AzureStorageDestination) 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 *AzureStorageDestination) 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 *AzureStorageDestination) 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 *AzureStorageDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetContainerName returns the ContainerName field value. func (o *AzureStorageDestination) GetContainerName() string { if o == nil { @@ -179,6 +209,9 @@ func (o AzureStorageDestination) MarshalJSON() ([]byte, error) { if o.BlobPrefix != nil { toSerialize["blob_prefix"] = o.BlobPrefix } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } toSerialize["container_name"] = o.ContainerName toSerialize["id"] = o.Id toSerialize["inputs"] = o.Inputs @@ -193,11 +226,12 @@ func (o AzureStorageDestination) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *AzureStorageDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { - BlobPrefix *string `json:"blob_prefix,omitempty"` - ContainerName *string `json:"container_name"` - Id *string `json:"id"` - Inputs *[]string `json:"inputs"` - Type *AzureStorageDestinationType `json:"type"` + BlobPrefix *string `json:"blob_prefix,omitempty"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` + ContainerName *string `json:"container_name"` + Id *string `json:"id"` + Inputs *[]string `json:"inputs"` + Type *AzureStorageDestinationType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -216,13 +250,14 @@ func (o *AzureStorageDestination) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"blob_prefix", "container_name", "id", "inputs", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"blob_prefix", "buffer", "container_name", "id", "inputs", "type"}) } else { return err } hasInvalidField := false o.BlobPrefix = all.BlobPrefix + o.Buffer = all.Buffer o.ContainerName = *all.ContainerName o.Id = *all.Id o.Inputs = *all.Inputs diff --git a/api/datadogV2/model_microsoft_sentinel_destination.go b/api/datadogV2/model_microsoft_sentinel_destination.go index 3ef1f7d9b82..9287df6ed40 100644 --- a/api/datadogV2/model_microsoft_sentinel_destination.go +++ b/api/datadogV2/model_microsoft_sentinel_destination.go @@ -12,6 +12,8 @@ import ( // MicrosoftSentinelDestination The `microsoft_sentinel` destination forwards logs to Microsoft Sentinel. type MicrosoftSentinelDestination struct { + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // Azure AD client ID used for authentication. ClientId string `json:"client_id"` // The immutable ID of the Data Collection Rule (DCR). @@ -57,6 +59,34 @@ func NewMicrosoftSentinelDestinationWithDefaults() *MicrosoftSentinelDestination return &this } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *MicrosoftSentinelDestination) 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 *MicrosoftSentinelDestination) 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 *MicrosoftSentinelDestination) 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 *MicrosoftSentinelDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetClientId returns the ClientId field value. func (o *MicrosoftSentinelDestination) GetClientId() string { if o == nil { @@ -224,6 +254,9 @@ func (o MicrosoftSentinelDestination) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } toSerialize["client_id"] = o.ClientId toSerialize["dcr_immutable_id"] = o.DcrImmutableId toSerialize["id"] = o.Id @@ -241,13 +274,14 @@ func (o MicrosoftSentinelDestination) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *MicrosoftSentinelDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { - ClientId *string `json:"client_id"` - DcrImmutableId *string `json:"dcr_immutable_id"` - Id *string `json:"id"` - Inputs *[]string `json:"inputs"` - Table *string `json:"table"` - TenantId *string `json:"tenant_id"` - Type *MicrosoftSentinelDestinationType `json:"type"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` + ClientId *string `json:"client_id"` + DcrImmutableId *string `json:"dcr_immutable_id"` + Id *string `json:"id"` + Inputs *[]string `json:"inputs"` + Table *string `json:"table"` + TenantId *string `json:"tenant_id"` + Type *MicrosoftSentinelDestinationType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -275,12 +309,13 @@ func (o *MicrosoftSentinelDestination) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"client_id", "dcr_immutable_id", "id", "inputs", "table", "tenant_id", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"buffer", "client_id", "dcr_immutable_id", "id", "inputs", "table", "tenant_id", "type"}) } else { return err } hasInvalidField := false + o.Buffer = all.Buffer o.ClientId = *all.ClientId o.DcrImmutableId = *all.DcrImmutableId o.Id = *all.Id diff --git a/api/datadogV2/model_observability_pipeline_amazon_open_search_destination.go b/api/datadogV2/model_observability_pipeline_amazon_open_search_destination.go index ea295c7a7dc..b39570aae49 100644 --- a/api/datadogV2/model_observability_pipeline_amazon_open_search_destination.go +++ b/api/datadogV2/model_observability_pipeline_amazon_open_search_destination.go @@ -16,6 +16,8 @@ type ObservabilityPipelineAmazonOpenSearchDestination struct { // The `strategy` field determines whether basic or AWS-based authentication is used. // Auth ObservabilityPipelineAmazonOpenSearchDestinationAuth `json:"auth"` + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // The index to write logs to. BulkIndex *string `json:"bulk_index,omitempty"` // The unique identifier for this component. @@ -75,6 +77,34 @@ func (o *ObservabilityPipelineAmazonOpenSearchDestination) SetAuth(v Observabili o.Auth = v } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineAmazonOpenSearchDestination) 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 *ObservabilityPipelineAmazonOpenSearchDestination) 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 *ObservabilityPipelineAmazonOpenSearchDestination) 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 *ObservabilityPipelineAmazonOpenSearchDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetBulkIndex returns the BulkIndex field value if set, zero value otherwise. func (o *ObservabilityPipelineAmazonOpenSearchDestination) GetBulkIndex() string { if o == nil || o.BulkIndex == nil { @@ -179,6 +209,9 @@ func (o ObservabilityPipelineAmazonOpenSearchDestination) MarshalJSON() ([]byte, return datadog.Marshal(o.UnparsedObject) } toSerialize["auth"] = o.Auth + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } if o.BulkIndex != nil { toSerialize["bulk_index"] = o.BulkIndex } @@ -196,6 +229,7 @@ func (o ObservabilityPipelineAmazonOpenSearchDestination) MarshalJSON() ([]byte, func (o *ObservabilityPipelineAmazonOpenSearchDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { Auth *ObservabilityPipelineAmazonOpenSearchDestinationAuth `json:"auth"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` BulkIndex *string `json:"bulk_index,omitempty"` Id *string `json:"id"` Inputs *[]string `json:"inputs"` @@ -218,7 +252,7 @@ func (o *ObservabilityPipelineAmazonOpenSearchDestination) UnmarshalJSON(bytes [ } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"auth", "bulk_index", "id", "inputs", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"auth", "buffer", "bulk_index", "id", "inputs", "type"}) } else { return err } @@ -228,6 +262,7 @@ func (o *ObservabilityPipelineAmazonOpenSearchDestination) UnmarshalJSON(bytes [ hasInvalidField = true } o.Auth = *all.Auth + o.Buffer = all.Buffer o.BulkIndex = all.BulkIndex o.Id = *all.Id o.Inputs = *all.Inputs diff --git a/api/datadogV2/model_observability_pipeline_amazon_s3_destination.go b/api/datadogV2/model_observability_pipeline_amazon_s3_destination.go index 236255f45ce..e27ff4e9636 100644 --- a/api/datadogV2/model_observability_pipeline_amazon_s3_destination.go +++ b/api/datadogV2/model_observability_pipeline_amazon_s3_destination.go @@ -18,6 +18,8 @@ type ObservabilityPipelineAmazonS3Destination struct { Auth *ObservabilityPipelineAwsAuth `json:"auth,omitempty"` // S3 bucket name. Bucket string `json:"bucket"` + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // Unique identifier for the destination component. Id string `json:"id"` // A list of component IDs whose output is used as the `input` for this component. @@ -113,6 +115,34 @@ func (o *ObservabilityPipelineAmazonS3Destination) SetBucket(v string) { o.Bucket = v } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineAmazonS3Destination) 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 *ObservabilityPipelineAmazonS3Destination) 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 *ObservabilityPipelineAmazonS3Destination) 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 *ObservabilityPipelineAmazonS3Destination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetId returns the Id field value. func (o *ObservabilityPipelineAmazonS3Destination) GetId() string { if o == nil { @@ -294,6 +324,9 @@ func (o ObservabilityPipelineAmazonS3Destination) MarshalJSON() ([]byte, error) toSerialize["auth"] = o.Auth } toSerialize["bucket"] = o.Bucket + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } toSerialize["id"] = o.Id toSerialize["inputs"] = o.Inputs if o.KeyPrefix != nil { @@ -317,6 +350,7 @@ func (o *ObservabilityPipelineAmazonS3Destination) UnmarshalJSON(bytes []byte) ( all := struct { Auth *ObservabilityPipelineAwsAuth `json:"auth,omitempty"` Bucket *string `json:"bucket"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` Id *string `json:"id"` Inputs *[]string `json:"inputs"` KeyPrefix *string `json:"key_prefix,omitempty"` @@ -348,7 +382,7 @@ func (o *ObservabilityPipelineAmazonS3Destination) UnmarshalJSON(bytes []byte) ( } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"auth", "bucket", "id", "inputs", "key_prefix", "region", "storage_class", "tls", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"auth", "bucket", "buffer", "id", "inputs", "key_prefix", "region", "storage_class", "tls", "type"}) } else { return err } @@ -359,6 +393,7 @@ func (o *ObservabilityPipelineAmazonS3Destination) UnmarshalJSON(bytes []byte) ( } o.Auth = all.Auth o.Bucket = *all.Bucket + o.Buffer = all.Buffer o.Id = *all.Id o.Inputs = *all.Inputs o.KeyPrefix = all.KeyPrefix diff --git a/api/datadogV2/model_observability_pipeline_buffer_options.go b/api/datadogV2/model_observability_pipeline_buffer_options.go new file mode 100644 index 00000000000..8dc082cf247 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_buffer_options.go @@ -0,0 +1,137 @@ +// 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" +) + +// ObservabilityPipelineBufferOptions - Configuration for buffer settings on destination components. +type ObservabilityPipelineBufferOptions struct { + ObservabilityPipelineDiskBufferOptions *ObservabilityPipelineDiskBufferOptions + ObservabilityPipelineMemoryBufferOptions *ObservabilityPipelineMemoryBufferOptions + ObservabilityPipelineMemoryBufferSizeOptions *ObservabilityPipelineMemoryBufferSizeOptions + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// ObservabilityPipelineDiskBufferOptionsAsObservabilityPipelineBufferOptions is a convenience function that returns ObservabilityPipelineDiskBufferOptions wrapped in ObservabilityPipelineBufferOptions. +func ObservabilityPipelineDiskBufferOptionsAsObservabilityPipelineBufferOptions(v *ObservabilityPipelineDiskBufferOptions) ObservabilityPipelineBufferOptions { + return ObservabilityPipelineBufferOptions{ObservabilityPipelineDiskBufferOptions: v} +} + +// ObservabilityPipelineMemoryBufferOptionsAsObservabilityPipelineBufferOptions is a convenience function that returns ObservabilityPipelineMemoryBufferOptions wrapped in ObservabilityPipelineBufferOptions. +func ObservabilityPipelineMemoryBufferOptionsAsObservabilityPipelineBufferOptions(v *ObservabilityPipelineMemoryBufferOptions) ObservabilityPipelineBufferOptions { + return ObservabilityPipelineBufferOptions{ObservabilityPipelineMemoryBufferOptions: v} +} + +// ObservabilityPipelineMemoryBufferSizeOptionsAsObservabilityPipelineBufferOptions is a convenience function that returns ObservabilityPipelineMemoryBufferSizeOptions wrapped in ObservabilityPipelineBufferOptions. +func ObservabilityPipelineMemoryBufferSizeOptionsAsObservabilityPipelineBufferOptions(v *ObservabilityPipelineMemoryBufferSizeOptions) ObservabilityPipelineBufferOptions { + return ObservabilityPipelineBufferOptions{ObservabilityPipelineMemoryBufferSizeOptions: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ObservabilityPipelineBufferOptions) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into ObservabilityPipelineDiskBufferOptions + err = datadog.Unmarshal(data, &obj.ObservabilityPipelineDiskBufferOptions) + if err == nil { + if obj.ObservabilityPipelineDiskBufferOptions != nil && obj.ObservabilityPipelineDiskBufferOptions.UnparsedObject == nil { + jsonObservabilityPipelineDiskBufferOptions, _ := datadog.Marshal(obj.ObservabilityPipelineDiskBufferOptions) + if string(jsonObservabilityPipelineDiskBufferOptions) == "{}" && string(data) != "{}" { // empty struct + obj.ObservabilityPipelineDiskBufferOptions = nil + } else { + match++ + } + } else { + obj.ObservabilityPipelineDiskBufferOptions = nil + } + } else { + obj.ObservabilityPipelineDiskBufferOptions = nil + } + + // try to unmarshal data into ObservabilityPipelineMemoryBufferOptions + err = datadog.Unmarshal(data, &obj.ObservabilityPipelineMemoryBufferOptions) + if err == nil { + if obj.ObservabilityPipelineMemoryBufferOptions != nil && obj.ObservabilityPipelineMemoryBufferOptions.UnparsedObject == nil { + jsonObservabilityPipelineMemoryBufferOptions, _ := datadog.Marshal(obj.ObservabilityPipelineMemoryBufferOptions) + if string(jsonObservabilityPipelineMemoryBufferOptions) == "{}" && string(data) != "{}" { // empty struct + obj.ObservabilityPipelineMemoryBufferOptions = nil + } else { + match++ + } + } else { + obj.ObservabilityPipelineMemoryBufferOptions = nil + } + } else { + obj.ObservabilityPipelineMemoryBufferOptions = nil + } + + // try to unmarshal data into ObservabilityPipelineMemoryBufferSizeOptions + err = datadog.Unmarshal(data, &obj.ObservabilityPipelineMemoryBufferSizeOptions) + if err == nil { + if obj.ObservabilityPipelineMemoryBufferSizeOptions != nil && obj.ObservabilityPipelineMemoryBufferSizeOptions.UnparsedObject == nil { + jsonObservabilityPipelineMemoryBufferSizeOptions, _ := datadog.Marshal(obj.ObservabilityPipelineMemoryBufferSizeOptions) + if string(jsonObservabilityPipelineMemoryBufferSizeOptions) == "{}" && string(data) != "{}" { // empty struct + obj.ObservabilityPipelineMemoryBufferSizeOptions = nil + } else { + match++ + } + } else { + obj.ObservabilityPipelineMemoryBufferSizeOptions = nil + } + } else { + obj.ObservabilityPipelineMemoryBufferSizeOptions = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.ObservabilityPipelineDiskBufferOptions = nil + obj.ObservabilityPipelineMemoryBufferOptions = nil + obj.ObservabilityPipelineMemoryBufferSizeOptions = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ObservabilityPipelineBufferOptions) MarshalJSON() ([]byte, error) { + if obj.ObservabilityPipelineDiskBufferOptions != nil { + return datadog.Marshal(&obj.ObservabilityPipelineDiskBufferOptions) + } + + if obj.ObservabilityPipelineMemoryBufferOptions != nil { + return datadog.Marshal(&obj.ObservabilityPipelineMemoryBufferOptions) + } + + if obj.ObservabilityPipelineMemoryBufferSizeOptions != nil { + return datadog.Marshal(&obj.ObservabilityPipelineMemoryBufferSizeOptions) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ObservabilityPipelineBufferOptions) GetActualInstance() interface{} { + if obj.ObservabilityPipelineDiskBufferOptions != nil { + return obj.ObservabilityPipelineDiskBufferOptions + } + + if obj.ObservabilityPipelineMemoryBufferOptions != nil { + return obj.ObservabilityPipelineMemoryBufferOptions + } + + if obj.ObservabilityPipelineMemoryBufferSizeOptions != nil { + return obj.ObservabilityPipelineMemoryBufferSizeOptions + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_observability_pipeline_buffer_options_disk_type.go b/api/datadogV2/model_observability_pipeline_buffer_options_disk_type.go new file mode 100644 index 00000000000..fbd4f7f851e --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_buffer_options_disk_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" +) + +// ObservabilityPipelineBufferOptionsDiskType Specifies the buffer type to configure. This option supports only a disk buffer. +type ObservabilityPipelineBufferOptionsDiskType string + +// List of ObservabilityPipelineBufferOptionsDiskType. +const ( + OBSERVABILITYPIPELINEBUFFEROPTIONSDISKTYPE_DISK ObservabilityPipelineBufferOptionsDiskType = "disk" +) + +var allowedObservabilityPipelineBufferOptionsDiskTypeEnumValues = []ObservabilityPipelineBufferOptionsDiskType{ + OBSERVABILITYPIPELINEBUFFEROPTIONSDISKTYPE_DISK, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ObservabilityPipelineBufferOptionsDiskType) GetAllowedValues() []ObservabilityPipelineBufferOptionsDiskType { + return allowedObservabilityPipelineBufferOptionsDiskTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ObservabilityPipelineBufferOptionsDiskType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ObservabilityPipelineBufferOptionsDiskType(value) + return nil +} + +// NewObservabilityPipelineBufferOptionsDiskTypeFromValue returns a pointer to a valid ObservabilityPipelineBufferOptionsDiskType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewObservabilityPipelineBufferOptionsDiskTypeFromValue(v string) (*ObservabilityPipelineBufferOptionsDiskType, error) { + ev := ObservabilityPipelineBufferOptionsDiskType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ObservabilityPipelineBufferOptionsDiskType: valid values are %v", v, allowedObservabilityPipelineBufferOptionsDiskTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ObservabilityPipelineBufferOptionsDiskType) IsValid() bool { + for _, existing := range allowedObservabilityPipelineBufferOptionsDiskTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ObservabilityPipelineBufferOptionsDiskType value. +func (v ObservabilityPipelineBufferOptionsDiskType) Ptr() *ObservabilityPipelineBufferOptionsDiskType { + return &v +} diff --git a/api/datadogV2/model_observability_pipeline_buffer_options_memory_type.go b/api/datadogV2/model_observability_pipeline_buffer_options_memory_type.go new file mode 100644 index 00000000000..354dccac92a --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_buffer_options_memory_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" +) + +// ObservabilityPipelineBufferOptionsMemoryType Specifies the buffer type to configure. This option supports only a memory buffer. +type ObservabilityPipelineBufferOptionsMemoryType string + +// List of ObservabilityPipelineBufferOptionsMemoryType. +const ( + OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY ObservabilityPipelineBufferOptionsMemoryType = "memory" +) + +var allowedObservabilityPipelineBufferOptionsMemoryTypeEnumValues = []ObservabilityPipelineBufferOptionsMemoryType{ + OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ObservabilityPipelineBufferOptionsMemoryType) GetAllowedValues() []ObservabilityPipelineBufferOptionsMemoryType { + return allowedObservabilityPipelineBufferOptionsMemoryTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ObservabilityPipelineBufferOptionsMemoryType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ObservabilityPipelineBufferOptionsMemoryType(value) + return nil +} + +// NewObservabilityPipelineBufferOptionsMemoryTypeFromValue returns a pointer to a valid ObservabilityPipelineBufferOptionsMemoryType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewObservabilityPipelineBufferOptionsMemoryTypeFromValue(v string) (*ObservabilityPipelineBufferOptionsMemoryType, error) { + ev := ObservabilityPipelineBufferOptionsMemoryType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ObservabilityPipelineBufferOptionsMemoryType: valid values are %v", v, allowedObservabilityPipelineBufferOptionsMemoryTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ObservabilityPipelineBufferOptionsMemoryType) IsValid() bool { + for _, existing := range allowedObservabilityPipelineBufferOptionsMemoryTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ObservabilityPipelineBufferOptionsMemoryType value. +func (v ObservabilityPipelineBufferOptionsMemoryType) Ptr() *ObservabilityPipelineBufferOptionsMemoryType { + return &v +} diff --git a/api/datadogV2/model_observability_pipeline_datadog_logs_destination.go b/api/datadogV2/model_observability_pipeline_datadog_logs_destination.go index f728d80acc2..815cf98490d 100644 --- a/api/datadogV2/model_observability_pipeline_datadog_logs_destination.go +++ b/api/datadogV2/model_observability_pipeline_datadog_logs_destination.go @@ -12,6 +12,8 @@ import ( // ObservabilityPipelineDatadogLogsDestination The `datadog_logs` destination forwards logs to Datadog Log Management. type ObservabilityPipelineDatadogLogsDestination struct { + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // The unique identifier for this component. Id string `json:"id"` // A list of component IDs whose output is used as the `input` for this component. @@ -45,6 +47,34 @@ func NewObservabilityPipelineDatadogLogsDestinationWithDefaults() *Observability return &this } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineDatadogLogsDestination) 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 *ObservabilityPipelineDatadogLogsDestination) 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 *ObservabilityPipelineDatadogLogsDestination) 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 *ObservabilityPipelineDatadogLogsDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetId returns the Id field value. func (o *ObservabilityPipelineDatadogLogsDestination) GetId() string { if o == nil { @@ -120,6 +150,9 @@ func (o ObservabilityPipelineDatadogLogsDestination) MarshalJSON() ([]byte, erro if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } toSerialize["id"] = o.Id toSerialize["inputs"] = o.Inputs toSerialize["type"] = o.Type @@ -133,6 +166,7 @@ func (o ObservabilityPipelineDatadogLogsDestination) MarshalJSON() ([]byte, erro // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineDatadogLogsDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` Id *string `json:"id"` Inputs *[]string `json:"inputs"` Type *ObservabilityPipelineDatadogLogsDestinationType `json:"type"` @@ -151,12 +185,13 @@ func (o *ObservabilityPipelineDatadogLogsDestination) UnmarshalJSON(bytes []byte } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"id", "inputs", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"buffer", "id", "inputs", "type"}) } else { return err } hasInvalidField := false + o.Buffer = all.Buffer o.Id = *all.Id o.Inputs = *all.Inputs if !all.Type.IsValid() { diff --git a/api/datadogV2/model_observability_pipeline_disk_buffer_options.go b/api/datadogV2/model_observability_pipeline_disk_buffer_options.go new file mode 100644 index 00000000000..0d9eca6f639 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_disk_buffer_options.go @@ -0,0 +1,151 @@ +// 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" +) + +// ObservabilityPipelineDiskBufferOptions Options for configuring a disk buffer. +type ObservabilityPipelineDiskBufferOptions struct { + // Maximum size of the disk buffer. + MaxSize *int64 `json:"max_size,omitempty"` + // Specifies the buffer type to configure. This option supports only a disk buffer. + Type *ObservabilityPipelineBufferOptionsDiskType `json:"type,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:"-"` +} + +// NewObservabilityPipelineDiskBufferOptions instantiates a new ObservabilityPipelineDiskBufferOptions 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 NewObservabilityPipelineDiskBufferOptions() *ObservabilityPipelineDiskBufferOptions { + this := ObservabilityPipelineDiskBufferOptions{} + var typeVar ObservabilityPipelineBufferOptionsDiskType = OBSERVABILITYPIPELINEBUFFEROPTIONSDISKTYPE_DISK + this.Type = &typeVar + return &this +} + +// NewObservabilityPipelineDiskBufferOptionsWithDefaults instantiates a new ObservabilityPipelineDiskBufferOptions 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 NewObservabilityPipelineDiskBufferOptionsWithDefaults() *ObservabilityPipelineDiskBufferOptions { + this := ObservabilityPipelineDiskBufferOptions{} + var typeVar ObservabilityPipelineBufferOptionsDiskType = OBSERVABILITYPIPELINEBUFFEROPTIONSDISKTYPE_DISK + this.Type = &typeVar + return &this +} + +// GetMaxSize returns the MaxSize field value if set, zero value otherwise. +func (o *ObservabilityPipelineDiskBufferOptions) GetMaxSize() int64 { + if o == nil || o.MaxSize == nil { + var ret int64 + return ret + } + return *o.MaxSize +} + +// GetMaxSizeOk returns a tuple with the MaxSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDiskBufferOptions) GetMaxSizeOk() (*int64, bool) { + if o == nil || o.MaxSize == nil { + return nil, false + } + return o.MaxSize, true +} + +// HasMaxSize returns a boolean if a field has been set. +func (o *ObservabilityPipelineDiskBufferOptions) HasMaxSize() bool { + return o != nil && o.MaxSize != nil +} + +// SetMaxSize gets a reference to the given int64 and assigns it to the MaxSize field. +func (o *ObservabilityPipelineDiskBufferOptions) SetMaxSize(v int64) { + o.MaxSize = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ObservabilityPipelineDiskBufferOptions) GetType() ObservabilityPipelineBufferOptionsDiskType { + if o == nil || o.Type == nil { + var ret ObservabilityPipelineBufferOptionsDiskType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDiskBufferOptions) GetTypeOk() (*ObservabilityPipelineBufferOptionsDiskType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ObservabilityPipelineDiskBufferOptions) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given ObservabilityPipelineBufferOptionsDiskType and assigns it to the Type field. +func (o *ObservabilityPipelineDiskBufferOptions) SetType(v ObservabilityPipelineBufferOptionsDiskType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ObservabilityPipelineDiskBufferOptions) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.MaxSize != nil { + toSerialize["max_size"] = o.MaxSize + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ObservabilityPipelineDiskBufferOptions) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + MaxSize *int64 `json:"max_size,omitempty"` + Type *ObservabilityPipelineBufferOptionsDiskType `json:"type,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{"max_size", "type"}) + } else { + return err + } + + hasInvalidField := false + o.MaxSize = all.MaxSize + if all.Type != nil && !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_elasticsearch_destination.go b/api/datadogV2/model_observability_pipeline_elasticsearch_destination.go index 2db708543e2..e956c3cb9f1 100644 --- a/api/datadogV2/model_observability_pipeline_elasticsearch_destination.go +++ b/api/datadogV2/model_observability_pipeline_elasticsearch_destination.go @@ -14,6 +14,8 @@ import ( type ObservabilityPipelineElasticsearchDestination struct { // The Elasticsearch API version to use. Set to `auto` to auto-detect. ApiVersion *ObservabilityPipelineElasticsearchDestinationApiVersion `json:"api_version,omitempty"` + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // The index to write logs to in Elasticsearch. BulkIndex *string `json:"bulk_index,omitempty"` // The unique identifier for this component. @@ -77,6 +79,34 @@ func (o *ObservabilityPipelineElasticsearchDestination) SetApiVersion(v Observab o.ApiVersion = &v } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineElasticsearchDestination) 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 *ObservabilityPipelineElasticsearchDestination) 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 *ObservabilityPipelineElasticsearchDestination) 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 *ObservabilityPipelineElasticsearchDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetBulkIndex returns the BulkIndex field value if set, zero value otherwise. func (o *ObservabilityPipelineElasticsearchDestination) GetBulkIndex() string { if o == nil || o.BulkIndex == nil { @@ -183,6 +213,9 @@ func (o ObservabilityPipelineElasticsearchDestination) MarshalJSON() ([]byte, er if o.ApiVersion != nil { toSerialize["api_version"] = o.ApiVersion } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } if o.BulkIndex != nil { toSerialize["bulk_index"] = o.BulkIndex } @@ -200,6 +233,7 @@ func (o ObservabilityPipelineElasticsearchDestination) MarshalJSON() ([]byte, er func (o *ObservabilityPipelineElasticsearchDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { ApiVersion *ObservabilityPipelineElasticsearchDestinationApiVersion `json:"api_version,omitempty"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` BulkIndex *string `json:"bulk_index,omitempty"` Id *string `json:"id"` Inputs *[]string `json:"inputs"` @@ -219,7 +253,7 @@ func (o *ObservabilityPipelineElasticsearchDestination) UnmarshalJSON(bytes []by } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"api_version", "bulk_index", "id", "inputs", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"api_version", "buffer", "bulk_index", "id", "inputs", "type"}) } else { return err } @@ -230,6 +264,7 @@ func (o *ObservabilityPipelineElasticsearchDestination) UnmarshalJSON(bytes []by } else { o.ApiVersion = all.ApiVersion } + o.Buffer = all.Buffer o.BulkIndex = all.BulkIndex o.Id = *all.Id o.Inputs = *all.Inputs diff --git a/api/datadogV2/model_observability_pipeline_google_chronicle_destination.go b/api/datadogV2/model_observability_pipeline_google_chronicle_destination.go index c31e9fafa98..06318698fba 100644 --- a/api/datadogV2/model_observability_pipeline_google_chronicle_destination.go +++ b/api/datadogV2/model_observability_pipeline_google_chronicle_destination.go @@ -15,6 +15,8 @@ type ObservabilityPipelineGoogleChronicleDestination struct { // GCP credentials used to authenticate with Google Cloud Storage. // Auth ObservabilityPipelineGcpAuth `json:"auth"` + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // The Google Chronicle customer ID. CustomerId string `json:"customer_id"` // The encoding format for the logs sent to Chronicle. @@ -79,6 +81,34 @@ func (o *ObservabilityPipelineGoogleChronicleDestination) SetAuth(v Observabilit o.Auth = v } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineGoogleChronicleDestination) 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 *ObservabilityPipelineGoogleChronicleDestination) 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 *ObservabilityPipelineGoogleChronicleDestination) 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 *ObservabilityPipelineGoogleChronicleDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetCustomerId returns the CustomerId field value. func (o *ObservabilityPipelineGoogleChronicleDestination) GetCustomerId() string { if o == nil { @@ -234,6 +264,9 @@ func (o ObservabilityPipelineGoogleChronicleDestination) MarshalJSON() ([]byte, return datadog.Marshal(o.UnparsedObject) } toSerialize["auth"] = o.Auth + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } toSerialize["customer_id"] = o.CustomerId if o.Encoding != nil { toSerialize["encoding"] = o.Encoding @@ -255,6 +288,7 @@ func (o ObservabilityPipelineGoogleChronicleDestination) MarshalJSON() ([]byte, func (o *ObservabilityPipelineGoogleChronicleDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { Auth *ObservabilityPipelineGcpAuth `json:"auth"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` CustomerId *string `json:"customer_id"` Encoding *ObservabilityPipelineGoogleChronicleDestinationEncoding `json:"encoding,omitempty"` Id *string `json:"id"` @@ -282,7 +316,7 @@ func (o *ObservabilityPipelineGoogleChronicleDestination) UnmarshalJSON(bytes [] } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"auth", "customer_id", "encoding", "id", "inputs", "log_type", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"auth", "buffer", "customer_id", "encoding", "id", "inputs", "log_type", "type"}) } else { return err } @@ -292,6 +326,7 @@ func (o *ObservabilityPipelineGoogleChronicleDestination) UnmarshalJSON(bytes [] hasInvalidField = true } o.Auth = *all.Auth + o.Buffer = all.Buffer o.CustomerId = *all.CustomerId if all.Encoding != nil && !all.Encoding.IsValid() { hasInvalidField = true diff --git a/api/datadogV2/model_observability_pipeline_google_cloud_storage_destination.go b/api/datadogV2/model_observability_pipeline_google_cloud_storage_destination.go index 0ecf569bd69..17252bb13d4 100644 --- a/api/datadogV2/model_observability_pipeline_google_cloud_storage_destination.go +++ b/api/datadogV2/model_observability_pipeline_google_cloud_storage_destination.go @@ -20,6 +20,8 @@ type ObservabilityPipelineGoogleCloudStorageDestination struct { Auth ObservabilityPipelineGcpAuth `json:"auth"` // Name of the GCS bucket. Bucket string `json:"bucket"` + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // Unique identifier for the destination component. Id string `json:"id"` // A list of component IDs whose output is used as the `input` for this component. @@ -132,6 +134,34 @@ func (o *ObservabilityPipelineGoogleCloudStorageDestination) SetBucket(v string) o.Bucket = v } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineGoogleCloudStorageDestination) 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 *ObservabilityPipelineGoogleCloudStorageDestination) 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 *ObservabilityPipelineGoogleCloudStorageDestination) 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 *ObservabilityPipelineGoogleCloudStorageDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetId returns the Id field value. func (o *ObservabilityPipelineGoogleCloudStorageDestination) GetId() string { if o == nil { @@ -289,6 +319,9 @@ func (o ObservabilityPipelineGoogleCloudStorageDestination) MarshalJSON() ([]byt toSerialize["acl"] = o.Acl toSerialize["auth"] = o.Auth toSerialize["bucket"] = o.Bucket + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } toSerialize["id"] = o.Id toSerialize["inputs"] = o.Inputs if o.KeyPrefix != nil { @@ -312,6 +345,7 @@ func (o *ObservabilityPipelineGoogleCloudStorageDestination) UnmarshalJSON(bytes Acl *ObservabilityPipelineGoogleCloudStorageDestinationAcl `json:"acl"` Auth *ObservabilityPipelineGcpAuth `json:"auth"` Bucket *string `json:"bucket"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` Id *string `json:"id"` Inputs *[]string `json:"inputs"` KeyPrefix *string `json:"key_prefix,omitempty"` @@ -345,7 +379,7 @@ func (o *ObservabilityPipelineGoogleCloudStorageDestination) UnmarshalJSON(bytes } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"acl", "auth", "bucket", "id", "inputs", "key_prefix", "metadata", "storage_class", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"acl", "auth", "bucket", "buffer", "id", "inputs", "key_prefix", "metadata", "storage_class", "type"}) } else { return err } @@ -361,6 +395,7 @@ func (o *ObservabilityPipelineGoogleCloudStorageDestination) UnmarshalJSON(bytes } o.Auth = *all.Auth o.Bucket = *all.Bucket + o.Buffer = all.Buffer o.Id = *all.Id o.Inputs = *all.Inputs o.KeyPrefix = all.KeyPrefix diff --git a/api/datadogV2/model_observability_pipeline_memory_buffer_options.go b/api/datadogV2/model_observability_pipeline_memory_buffer_options.go new file mode 100644 index 00000000000..7851381fc11 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_memory_buffer_options.go @@ -0,0 +1,151 @@ +// 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" +) + +// ObservabilityPipelineMemoryBufferOptions Options for configuring a memory buffer by byte size. +type ObservabilityPipelineMemoryBufferOptions struct { + // Maximum size of the disk buffer. + MaxSize *int64 `json:"max_size,omitempty"` + // Specifies the buffer type to configure. This option supports only a memory buffer. + Type *ObservabilityPipelineBufferOptionsMemoryType `json:"type,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:"-"` +} + +// NewObservabilityPipelineMemoryBufferOptions instantiates a new ObservabilityPipelineMemoryBufferOptions 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 NewObservabilityPipelineMemoryBufferOptions() *ObservabilityPipelineMemoryBufferOptions { + this := ObservabilityPipelineMemoryBufferOptions{} + var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY + this.Type = &typeVar + return &this +} + +// NewObservabilityPipelineMemoryBufferOptionsWithDefaults instantiates a new ObservabilityPipelineMemoryBufferOptions 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 NewObservabilityPipelineMemoryBufferOptionsWithDefaults() *ObservabilityPipelineMemoryBufferOptions { + this := ObservabilityPipelineMemoryBufferOptions{} + var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY + this.Type = &typeVar + return &this +} + +// GetMaxSize returns the MaxSize field value if set, zero value otherwise. +func (o *ObservabilityPipelineMemoryBufferOptions) GetMaxSize() int64 { + if o == nil || o.MaxSize == nil { + var ret int64 + return ret + } + return *o.MaxSize +} + +// GetMaxSizeOk returns a tuple with the MaxSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineMemoryBufferOptions) GetMaxSizeOk() (*int64, bool) { + if o == nil || o.MaxSize == nil { + return nil, false + } + return o.MaxSize, true +} + +// HasMaxSize returns a boolean if a field has been set. +func (o *ObservabilityPipelineMemoryBufferOptions) HasMaxSize() bool { + return o != nil && o.MaxSize != nil +} + +// SetMaxSize gets a reference to the given int64 and assigns it to the MaxSize field. +func (o *ObservabilityPipelineMemoryBufferOptions) SetMaxSize(v int64) { + o.MaxSize = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ObservabilityPipelineMemoryBufferOptions) GetType() ObservabilityPipelineBufferOptionsMemoryType { + if o == nil || o.Type == nil { + var ret ObservabilityPipelineBufferOptionsMemoryType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineMemoryBufferOptions) GetTypeOk() (*ObservabilityPipelineBufferOptionsMemoryType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ObservabilityPipelineMemoryBufferOptions) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given ObservabilityPipelineBufferOptionsMemoryType and assigns it to the Type field. +func (o *ObservabilityPipelineMemoryBufferOptions) SetType(v ObservabilityPipelineBufferOptionsMemoryType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ObservabilityPipelineMemoryBufferOptions) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.MaxSize != nil { + toSerialize["max_size"] = o.MaxSize + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ObservabilityPipelineMemoryBufferOptions) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + MaxSize *int64 `json:"max_size,omitempty"` + Type *ObservabilityPipelineBufferOptionsMemoryType `json:"type,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{"max_size", "type"}) + } else { + return err + } + + hasInvalidField := false + o.MaxSize = all.MaxSize + if all.Type != nil && !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_memory_buffer_size_options.go b/api/datadogV2/model_observability_pipeline_memory_buffer_size_options.go new file mode 100644 index 00000000000..93a65c1039f --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_memory_buffer_size_options.go @@ -0,0 +1,151 @@ +// 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" +) + +// ObservabilityPipelineMemoryBufferSizeOptions Options for configuring a memory buffer by queue length. +type ObservabilityPipelineMemoryBufferSizeOptions struct { + // Maximum events for the memory buffer. + MaxEvents *int64 `json:"max_events,omitempty"` + // Specifies the buffer type to configure. This option supports only a memory buffer. + Type *ObservabilityPipelineBufferOptionsMemoryType `json:"type,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:"-"` +} + +// NewObservabilityPipelineMemoryBufferSizeOptions instantiates a new ObservabilityPipelineMemoryBufferSizeOptions 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 NewObservabilityPipelineMemoryBufferSizeOptions() *ObservabilityPipelineMemoryBufferSizeOptions { + this := ObservabilityPipelineMemoryBufferSizeOptions{} + var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY + this.Type = &typeVar + return &this +} + +// NewObservabilityPipelineMemoryBufferSizeOptionsWithDefaults instantiates a new ObservabilityPipelineMemoryBufferSizeOptions 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 NewObservabilityPipelineMemoryBufferSizeOptionsWithDefaults() *ObservabilityPipelineMemoryBufferSizeOptions { + this := ObservabilityPipelineMemoryBufferSizeOptions{} + var typeVar ObservabilityPipelineBufferOptionsMemoryType = OBSERVABILITYPIPELINEBUFFEROPTIONSMEMORYTYPE_MEMORY + this.Type = &typeVar + return &this +} + +// GetMaxEvents returns the MaxEvents field value if set, zero value otherwise. +func (o *ObservabilityPipelineMemoryBufferSizeOptions) GetMaxEvents() int64 { + if o == nil || o.MaxEvents == nil { + var ret int64 + return ret + } + return *o.MaxEvents +} + +// GetMaxEventsOk returns a tuple with the MaxEvents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineMemoryBufferSizeOptions) GetMaxEventsOk() (*int64, bool) { + if o == nil || o.MaxEvents == nil { + return nil, false + } + return o.MaxEvents, true +} + +// HasMaxEvents returns a boolean if a field has been set. +func (o *ObservabilityPipelineMemoryBufferSizeOptions) HasMaxEvents() bool { + return o != nil && o.MaxEvents != nil +} + +// SetMaxEvents gets a reference to the given int64 and assigns it to the MaxEvents field. +func (o *ObservabilityPipelineMemoryBufferSizeOptions) SetMaxEvents(v int64) { + o.MaxEvents = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ObservabilityPipelineMemoryBufferSizeOptions) GetType() ObservabilityPipelineBufferOptionsMemoryType { + if o == nil || o.Type == nil { + var ret ObservabilityPipelineBufferOptionsMemoryType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineMemoryBufferSizeOptions) GetTypeOk() (*ObservabilityPipelineBufferOptionsMemoryType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ObservabilityPipelineMemoryBufferSizeOptions) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given ObservabilityPipelineBufferOptionsMemoryType and assigns it to the Type field. +func (o *ObservabilityPipelineMemoryBufferSizeOptions) SetType(v ObservabilityPipelineBufferOptionsMemoryType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ObservabilityPipelineMemoryBufferSizeOptions) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.MaxEvents != nil { + toSerialize["max_events"] = o.MaxEvents + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ObservabilityPipelineMemoryBufferSizeOptions) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + MaxEvents *int64 `json:"max_events,omitempty"` + Type *ObservabilityPipelineBufferOptionsMemoryType `json:"type,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{"max_events", "type"}) + } else { + return err + } + + hasInvalidField := false + o.MaxEvents = all.MaxEvents + if all.Type != nil && !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_new_relic_destination.go b/api/datadogV2/model_observability_pipeline_new_relic_destination.go index 25044e88893..0d8538243c7 100644 --- a/api/datadogV2/model_observability_pipeline_new_relic_destination.go +++ b/api/datadogV2/model_observability_pipeline_new_relic_destination.go @@ -12,6 +12,8 @@ import ( // ObservabilityPipelineNewRelicDestination The `new_relic` destination sends logs to the New Relic platform. type ObservabilityPipelineNewRelicDestination struct { + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // The unique identifier for this component. Id string `json:"id"` // A list of component IDs whose output is used as the `input` for this component. @@ -48,6 +50,34 @@ func NewObservabilityPipelineNewRelicDestinationWithDefaults() *ObservabilityPip return &this } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineNewRelicDestination) 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 *ObservabilityPipelineNewRelicDestination) 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 *ObservabilityPipelineNewRelicDestination) 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 *ObservabilityPipelineNewRelicDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetId returns the Id field value. func (o *ObservabilityPipelineNewRelicDestination) GetId() string { if o == nil { @@ -146,6 +176,9 @@ func (o ObservabilityPipelineNewRelicDestination) MarshalJSON() ([]byte, error) if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } toSerialize["id"] = o.Id toSerialize["inputs"] = o.Inputs toSerialize["region"] = o.Region @@ -160,6 +193,7 @@ func (o ObservabilityPipelineNewRelicDestination) MarshalJSON() ([]byte, error) // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineNewRelicDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` Id *string `json:"id"` Inputs *[]string `json:"inputs"` Region *ObservabilityPipelineNewRelicDestinationRegion `json:"region"` @@ -182,12 +216,13 @@ func (o *ObservabilityPipelineNewRelicDestination) UnmarshalJSON(bytes []byte) ( } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"id", "inputs", "region", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"buffer", "id", "inputs", "region", "type"}) } else { return err } hasInvalidField := false + o.Buffer = all.Buffer o.Id = *all.Id o.Inputs = *all.Inputs if !all.Region.IsValid() { diff --git a/api/datadogV2/model_observability_pipeline_open_search_destination.go b/api/datadogV2/model_observability_pipeline_open_search_destination.go index 7853962f6a9..1fb62c9c52a 100644 --- a/api/datadogV2/model_observability_pipeline_open_search_destination.go +++ b/api/datadogV2/model_observability_pipeline_open_search_destination.go @@ -12,6 +12,8 @@ import ( // ObservabilityPipelineOpenSearchDestination The `opensearch` destination writes logs to an OpenSearch cluster. type ObservabilityPipelineOpenSearchDestination struct { + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // The index to write logs to. BulkIndex *string `json:"bulk_index,omitempty"` // The unique identifier for this component. @@ -47,6 +49,34 @@ func NewObservabilityPipelineOpenSearchDestinationWithDefaults() *ObservabilityP return &this } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineOpenSearchDestination) 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 *ObservabilityPipelineOpenSearchDestination) 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 *ObservabilityPipelineOpenSearchDestination) 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 *ObservabilityPipelineOpenSearchDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetBulkIndex returns the BulkIndex field value if set, zero value otherwise. func (o *ObservabilityPipelineOpenSearchDestination) GetBulkIndex() string { if o == nil || o.BulkIndex == nil { @@ -150,6 +180,9 @@ func (o ObservabilityPipelineOpenSearchDestination) MarshalJSON() ([]byte, error if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } if o.BulkIndex != nil { toSerialize["bulk_index"] = o.BulkIndex } @@ -166,6 +199,7 @@ func (o ObservabilityPipelineOpenSearchDestination) MarshalJSON() ([]byte, error // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineOpenSearchDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` BulkIndex *string `json:"bulk_index,omitempty"` Id *string `json:"id"` Inputs *[]string `json:"inputs"` @@ -185,12 +219,13 @@ func (o *ObservabilityPipelineOpenSearchDestination) UnmarshalJSON(bytes []byte) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"bulk_index", "id", "inputs", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"buffer", "bulk_index", "id", "inputs", "type"}) } else { return err } hasInvalidField := false + o.Buffer = all.Buffer o.BulkIndex = all.BulkIndex o.Id = *all.Id o.Inputs = *all.Inputs diff --git a/api/datadogV2/model_observability_pipeline_quota_processor.go b/api/datadogV2/model_observability_pipeline_quota_processor.go index 9a382c4182c..94399567d9d 100644 --- a/api/datadogV2/model_observability_pipeline_quota_processor.go +++ b/api/datadogV2/model_observability_pipeline_quota_processor.go @@ -12,8 +12,8 @@ import ( // ObservabilityPipelineQuotaProcessor The Quota Processor measures logging traffic for logs that match a specified filter. When the configured daily quota is met, the processor can drop or alert. type ObservabilityPipelineQuotaProcessor struct { - // If set to `true`, logs that matched the quota filter and sent after the quota has been met are dropped; only logs that did not match the filter query continue through the pipeline. - DropEvents bool `json:"drop_events"` + // If set to `true`, logs that match the quota filter and are sent after the quota is exceeded are dropped. Logs that do not match the filter continue through the pipeline. **Note**: You can set either `drop_events` or `overflow_action`, but not both. + DropEvents *bool `json:"drop_events,omitempty"` // 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"` // If `true`, the processor skips quota checks when partition fields are missing from the logs. @@ -26,7 +26,7 @@ type ObservabilityPipelineQuotaProcessor struct { Limit ObservabilityPipelineQuotaProcessorLimit `json:"limit"` // Name of the quota. Name string `json:"name"` - // The action to take when the quota is exceeded. Options: + // The action to take when the quota or bucket limit is exceeded. Options: // - `drop`: Drop the event. // - `no_action`: Let the event pass through. // - `overflow_routing`: Route to an overflow destination. @@ -36,6 +36,12 @@ type ObservabilityPipelineQuotaProcessor struct { Overrides []ObservabilityPipelineQuotaProcessorOverride `json:"overrides,omitempty"` // A list of fields used to segment log traffic for quota enforcement. Quotas are tracked independently by unique combinations of these field values. PartitionFields []string `json:"partition_fields,omitempty"` + // The action to take when the quota or bucket limit is exceeded. Options: + // - `drop`: Drop the event. + // - `no_action`: Let the event pass through. + // - `overflow_routing`: Route to an overflow destination. + // + TooManyBucketsAction *ObservabilityPipelineQuotaProcessorOverflowAction `json:"too_many_buckets_action,omitempty"` // The processor type. The value should always be `quota`. Type ObservabilityPipelineQuotaProcessorType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -47,9 +53,8 @@ type ObservabilityPipelineQuotaProcessor struct { // 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 NewObservabilityPipelineQuotaProcessor(dropEvents bool, id string, include string, inputs []string, limit ObservabilityPipelineQuotaProcessorLimit, name string, typeVar ObservabilityPipelineQuotaProcessorType) *ObservabilityPipelineQuotaProcessor { +func NewObservabilityPipelineQuotaProcessor(id string, include string, inputs []string, limit ObservabilityPipelineQuotaProcessorLimit, name string, typeVar ObservabilityPipelineQuotaProcessorType) *ObservabilityPipelineQuotaProcessor { this := ObservabilityPipelineQuotaProcessor{} - this.DropEvents = dropEvents this.Id = id this.Include = include this.Inputs = inputs @@ -69,27 +74,32 @@ func NewObservabilityPipelineQuotaProcessorWithDefaults() *ObservabilityPipeline return &this } -// GetDropEvents returns the DropEvents field value. +// GetDropEvents returns the DropEvents field value if set, zero value otherwise. func (o *ObservabilityPipelineQuotaProcessor) GetDropEvents() bool { - if o == nil { + if o == nil || o.DropEvents == nil { var ret bool return ret } - return o.DropEvents + return *o.DropEvents } -// GetDropEventsOk returns a tuple with the DropEvents field value +// GetDropEventsOk returns a tuple with the DropEvents field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ObservabilityPipelineQuotaProcessor) GetDropEventsOk() (*bool, bool) { - if o == nil { + if o == nil || o.DropEvents == nil { return nil, false } - return &o.DropEvents, true + return o.DropEvents, true +} + +// HasDropEvents returns a boolean if a field has been set. +func (o *ObservabilityPipelineQuotaProcessor) HasDropEvents() bool { + return o != nil && o.DropEvents != nil } -// SetDropEvents sets field value. +// SetDropEvents gets a reference to the given bool and assigns it to the DropEvents field. func (o *ObservabilityPipelineQuotaProcessor) SetDropEvents(v bool) { - o.DropEvents = v + o.DropEvents = &v } // GetId returns the Id field value. @@ -319,6 +329,34 @@ func (o *ObservabilityPipelineQuotaProcessor) SetPartitionFields(v []string) { o.PartitionFields = v } +// GetTooManyBucketsAction returns the TooManyBucketsAction field value if set, zero value otherwise. +func (o *ObservabilityPipelineQuotaProcessor) GetTooManyBucketsAction() ObservabilityPipelineQuotaProcessorOverflowAction { + if o == nil || o.TooManyBucketsAction == nil { + var ret ObservabilityPipelineQuotaProcessorOverflowAction + return ret + } + return *o.TooManyBucketsAction +} + +// GetTooManyBucketsActionOk returns a tuple with the TooManyBucketsAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineQuotaProcessor) GetTooManyBucketsActionOk() (*ObservabilityPipelineQuotaProcessorOverflowAction, bool) { + if o == nil || o.TooManyBucketsAction == nil { + return nil, false + } + return o.TooManyBucketsAction, true +} + +// HasTooManyBucketsAction returns a boolean if a field has been set. +func (o *ObservabilityPipelineQuotaProcessor) HasTooManyBucketsAction() bool { + return o != nil && o.TooManyBucketsAction != nil +} + +// SetTooManyBucketsAction gets a reference to the given ObservabilityPipelineQuotaProcessorOverflowAction and assigns it to the TooManyBucketsAction field. +func (o *ObservabilityPipelineQuotaProcessor) SetTooManyBucketsAction(v ObservabilityPipelineQuotaProcessorOverflowAction) { + o.TooManyBucketsAction = &v +} + // GetType returns the Type field value. func (o *ObservabilityPipelineQuotaProcessor) GetType() ObservabilityPipelineQuotaProcessorType { if o == nil { @@ -348,7 +386,9 @@ func (o ObservabilityPipelineQuotaProcessor) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } - toSerialize["drop_events"] = o.DropEvents + if o.DropEvents != nil { + toSerialize["drop_events"] = o.DropEvents + } toSerialize["id"] = o.Id if o.IgnoreWhenMissingPartitions != nil { toSerialize["ignore_when_missing_partitions"] = o.IgnoreWhenMissingPartitions @@ -366,6 +406,9 @@ func (o ObservabilityPipelineQuotaProcessor) MarshalJSON() ([]byte, error) { if o.PartitionFields != nil { toSerialize["partition_fields"] = o.PartitionFields } + if o.TooManyBucketsAction != nil { + toSerialize["too_many_buckets_action"] = o.TooManyBucketsAction + } toSerialize["type"] = o.Type for key, value := range o.AdditionalProperties { @@ -377,7 +420,7 @@ func (o ObservabilityPipelineQuotaProcessor) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineQuotaProcessor) UnmarshalJSON(bytes []byte) (err error) { all := struct { - DropEvents *bool `json:"drop_events"` + DropEvents *bool `json:"drop_events,omitempty"` Id *string `json:"id"` IgnoreWhenMissingPartitions *bool `json:"ignore_when_missing_partitions,omitempty"` Include *string `json:"include"` @@ -387,14 +430,12 @@ func (o *ObservabilityPipelineQuotaProcessor) UnmarshalJSON(bytes []byte) (err e OverflowAction *ObservabilityPipelineQuotaProcessorOverflowAction `json:"overflow_action,omitempty"` Overrides []ObservabilityPipelineQuotaProcessorOverride `json:"overrides,omitempty"` PartitionFields []string `json:"partition_fields,omitempty"` + TooManyBucketsAction *ObservabilityPipelineQuotaProcessorOverflowAction `json:"too_many_buckets_action,omitempty"` Type *ObservabilityPipelineQuotaProcessorType `json:"type"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } - if all.DropEvents == nil { - return fmt.Errorf("required field drop_events missing") - } if all.Id == nil { return fmt.Errorf("required field id missing") } @@ -415,13 +456,13 @@ func (o *ObservabilityPipelineQuotaProcessor) UnmarshalJSON(bytes []byte) (err e } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"drop_events", "id", "ignore_when_missing_partitions", "include", "inputs", "limit", "name", "overflow_action", "overrides", "partition_fields", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"drop_events", "id", "ignore_when_missing_partitions", "include", "inputs", "limit", "name", "overflow_action", "overrides", "partition_fields", "too_many_buckets_action", "type"}) } else { return err } hasInvalidField := false - o.DropEvents = *all.DropEvents + o.DropEvents = all.DropEvents o.Id = *all.Id o.IgnoreWhenMissingPartitions = all.IgnoreWhenMissingPartitions o.Include = *all.Include @@ -438,6 +479,11 @@ func (o *ObservabilityPipelineQuotaProcessor) UnmarshalJSON(bytes []byte) (err e } o.Overrides = all.Overrides o.PartitionFields = all.PartitionFields + if all.TooManyBucketsAction != nil && !all.TooManyBucketsAction.IsValid() { + hasInvalidField = true + } else { + o.TooManyBucketsAction = all.TooManyBucketsAction + } if !all.Type.IsValid() { hasInvalidField = true } else { diff --git a/api/datadogV2/model_observability_pipeline_quota_processor_overflow_action.go b/api/datadogV2/model_observability_pipeline_quota_processor_overflow_action.go index dc77aeb0834..177835094fb 100644 --- a/api/datadogV2/model_observability_pipeline_quota_processor_overflow_action.go +++ b/api/datadogV2/model_observability_pipeline_quota_processor_overflow_action.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// ObservabilityPipelineQuotaProcessorOverflowAction The action to take when the quota is exceeded. Options: +// ObservabilityPipelineQuotaProcessorOverflowAction The action to take when the quota or bucket limit is exceeded. Options: // - `drop`: Drop the event. // - `no_action`: Let the event pass through. // - `overflow_routing`: Route to an overflow destination. diff --git a/api/datadogV2/model_observability_pipeline_rsyslog_destination.go b/api/datadogV2/model_observability_pipeline_rsyslog_destination.go index df544bf190e..7d8f2274cc4 100644 --- a/api/datadogV2/model_observability_pipeline_rsyslog_destination.go +++ b/api/datadogV2/model_observability_pipeline_rsyslog_destination.go @@ -12,6 +12,8 @@ import ( // ObservabilityPipelineRsyslogDestination The `rsyslog` destination forwards logs to an external `rsyslog` server over TCP or UDP using the syslog protocol. type ObservabilityPipelineRsyslogDestination struct { + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // The unique identifier for this component. Id string `json:"id"` // A list of component IDs whose output is used as the `input` for this component. @@ -49,6 +51,34 @@ func NewObservabilityPipelineRsyslogDestinationWithDefaults() *ObservabilityPipe return &this } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineRsyslogDestination) 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 *ObservabilityPipelineRsyslogDestination) 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 *ObservabilityPipelineRsyslogDestination) 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 *ObservabilityPipelineRsyslogDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetId returns the Id field value. func (o *ObservabilityPipelineRsyslogDestination) GetId() string { if o == nil { @@ -180,6 +210,9 @@ func (o ObservabilityPipelineRsyslogDestination) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } toSerialize["id"] = o.Id toSerialize["inputs"] = o.Inputs if o.Keepalive != nil { @@ -199,6 +232,7 @@ func (o ObservabilityPipelineRsyslogDestination) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineRsyslogDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` Id *string `json:"id"` Inputs *[]string `json:"inputs"` Keepalive *int64 `json:"keepalive,omitempty"` @@ -219,12 +253,13 @@ func (o *ObservabilityPipelineRsyslogDestination) UnmarshalJSON(bytes []byte) (e } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"id", "inputs", "keepalive", "tls", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"buffer", "id", "inputs", "keepalive", "tls", "type"}) } else { return err } hasInvalidField := false + o.Buffer = all.Buffer o.Id = *all.Id o.Inputs = *all.Inputs o.Keepalive = all.Keepalive diff --git a/api/datadogV2/model_observability_pipeline_sample_processor.go b/api/datadogV2/model_observability_pipeline_sample_processor.go index 9c230f6976a..7ec30139f65 100644 --- a/api/datadogV2/model_observability_pipeline_sample_processor.go +++ b/api/datadogV2/model_observability_pipeline_sample_processor.go @@ -12,6 +12,8 @@ import ( // ObservabilityPipelineSampleProcessor The `sample` processor allows probabilistic sampling of logs at a fixed rate. type ObservabilityPipelineSampleProcessor struct { + // Optional list of fields to group events by. Each group is sampled independently. + GroupBy []string `json:"group_by,omitempty"` // 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. @@ -52,6 +54,34 @@ func NewObservabilityPipelineSampleProcessorWithDefaults() *ObservabilityPipelin return &this } +// GetGroupBy returns the GroupBy field value if set, zero value otherwise. +func (o *ObservabilityPipelineSampleProcessor) GetGroupBy() []string { + if o == nil || o.GroupBy == nil { + var ret []string + return ret + } + return o.GroupBy +} + +// GetGroupByOk returns a tuple with the GroupBy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineSampleProcessor) GetGroupByOk() (*[]string, bool) { + if o == nil || o.GroupBy == nil { + return nil, false + } + return &o.GroupBy, true +} + +// HasGroupBy returns a boolean if a field has been set. +func (o *ObservabilityPipelineSampleProcessor) HasGroupBy() bool { + return o != nil && o.GroupBy != nil +} + +// SetGroupBy gets a reference to the given []string and assigns it to the GroupBy field. +func (o *ObservabilityPipelineSampleProcessor) SetGroupBy(v []string) { + o.GroupBy = v +} + // GetId returns the Id field value. func (o *ObservabilityPipelineSampleProcessor) GetId() string { if o == nil { @@ -206,6 +236,9 @@ func (o ObservabilityPipelineSampleProcessor) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } + if o.GroupBy != nil { + toSerialize["group_by"] = o.GroupBy + } toSerialize["id"] = o.Id toSerialize["include"] = o.Include toSerialize["inputs"] = o.Inputs @@ -226,6 +259,7 @@ func (o ObservabilityPipelineSampleProcessor) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineSampleProcessor) UnmarshalJSON(bytes []byte) (err error) { all := struct { + GroupBy []string `json:"group_by,omitempty"` Id *string `json:"id"` Include *string `json:"include"` Inputs *[]string `json:"inputs"` @@ -250,12 +284,13 @@ func (o *ObservabilityPipelineSampleProcessor) UnmarshalJSON(bytes []byte) (err } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"id", "include", "inputs", "percentage", "rate", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"group_by", "id", "include", "inputs", "percentage", "rate", "type"}) } else { return err } hasInvalidField := false + o.GroupBy = all.GroupBy o.Id = *all.Id o.Include = *all.Include o.Inputs = *all.Inputs diff --git a/api/datadogV2/model_observability_pipeline_sentinel_one_destination.go b/api/datadogV2/model_observability_pipeline_sentinel_one_destination.go index b528ed16df9..1eee4ac2e2e 100644 --- a/api/datadogV2/model_observability_pipeline_sentinel_one_destination.go +++ b/api/datadogV2/model_observability_pipeline_sentinel_one_destination.go @@ -12,6 +12,8 @@ import ( // ObservabilityPipelineSentinelOneDestination The `sentinel_one` destination sends logs to SentinelOne. type ObservabilityPipelineSentinelOneDestination struct { + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // The unique identifier for this component. Id string `json:"id"` // A list of component IDs whose output is used as the `input` for this component. @@ -48,6 +50,34 @@ func NewObservabilityPipelineSentinelOneDestinationWithDefaults() *Observability return &this } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineSentinelOneDestination) 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 *ObservabilityPipelineSentinelOneDestination) 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 *ObservabilityPipelineSentinelOneDestination) 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 *ObservabilityPipelineSentinelOneDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetId returns the Id field value. func (o *ObservabilityPipelineSentinelOneDestination) GetId() string { if o == nil { @@ -146,6 +176,9 @@ func (o ObservabilityPipelineSentinelOneDestination) MarshalJSON() ([]byte, erro if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } toSerialize["id"] = o.Id toSerialize["inputs"] = o.Inputs toSerialize["region"] = o.Region @@ -160,6 +193,7 @@ func (o ObservabilityPipelineSentinelOneDestination) MarshalJSON() ([]byte, erro // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineSentinelOneDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` Id *string `json:"id"` Inputs *[]string `json:"inputs"` Region *ObservabilityPipelineSentinelOneDestinationRegion `json:"region"` @@ -182,12 +216,13 @@ func (o *ObservabilityPipelineSentinelOneDestination) UnmarshalJSON(bytes []byte } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"id", "inputs", "region", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"buffer", "id", "inputs", "region", "type"}) } else { return err } hasInvalidField := false + o.Buffer = all.Buffer o.Id = *all.Id o.Inputs = *all.Inputs if !all.Region.IsValid() { diff --git a/api/datadogV2/model_observability_pipeline_splunk_hec_destination.go b/api/datadogV2/model_observability_pipeline_splunk_hec_destination.go index 156ca9d71e1..cfdfb84a28f 100644 --- a/api/datadogV2/model_observability_pipeline_splunk_hec_destination.go +++ b/api/datadogV2/model_observability_pipeline_splunk_hec_destination.go @@ -16,6 +16,8 @@ type ObservabilityPipelineSplunkHecDestination struct { // If `false`, Splunk assigns the time the event was received. // AutoExtractTimestamp *bool `json:"auto_extract_timestamp,omitempty"` + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // Encoding format for log events. Encoding *ObservabilityPipelineSplunkHecDestinationEncoding `json:"encoding,omitempty"` // The unique identifier for this component. Used to reference this component in other parts of the pipeline (e.g., as input to downstream components). @@ -83,6 +85,34 @@ func (o *ObservabilityPipelineSplunkHecDestination) SetAutoExtractTimestamp(v bo o.AutoExtractTimestamp = &v } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineSplunkHecDestination) 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 *ObservabilityPipelineSplunkHecDestination) 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 *ObservabilityPipelineSplunkHecDestination) 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 *ObservabilityPipelineSplunkHecDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetEncoding returns the Encoding field value if set, zero value otherwise. func (o *ObservabilityPipelineSplunkHecDestination) GetEncoding() ObservabilityPipelineSplunkHecDestinationEncoding { if o == nil || o.Encoding == nil { @@ -245,6 +275,9 @@ func (o ObservabilityPipelineSplunkHecDestination) MarshalJSON() ([]byte, error) if o.AutoExtractTimestamp != nil { toSerialize["auto_extract_timestamp"] = o.AutoExtractTimestamp } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } if o.Encoding != nil { toSerialize["encoding"] = o.Encoding } @@ -268,6 +301,7 @@ func (o ObservabilityPipelineSplunkHecDestination) MarshalJSON() ([]byte, error) func (o *ObservabilityPipelineSplunkHecDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { AutoExtractTimestamp *bool `json:"auto_extract_timestamp,omitempty"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` Encoding *ObservabilityPipelineSplunkHecDestinationEncoding `json:"encoding,omitempty"` Id *string `json:"id"` Index *string `json:"index,omitempty"` @@ -289,13 +323,14 @@ func (o *ObservabilityPipelineSplunkHecDestination) UnmarshalJSON(bytes []byte) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"auto_extract_timestamp", "encoding", "id", "index", "inputs", "sourcetype", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"auto_extract_timestamp", "buffer", "encoding", "id", "index", "inputs", "sourcetype", "type"}) } else { return err } hasInvalidField := false o.AutoExtractTimestamp = all.AutoExtractTimestamp + o.Buffer = all.Buffer if all.Encoding != nil && !all.Encoding.IsValid() { hasInvalidField = true } else { diff --git a/api/datadogV2/model_observability_pipeline_sumo_logic_destination.go b/api/datadogV2/model_observability_pipeline_sumo_logic_destination.go index 0b4b27bbf01..c7abde77963 100644 --- a/api/datadogV2/model_observability_pipeline_sumo_logic_destination.go +++ b/api/datadogV2/model_observability_pipeline_sumo_logic_destination.go @@ -12,6 +12,8 @@ import ( // ObservabilityPipelineSumoLogicDestination The `sumo_logic` destination forwards logs to Sumo Logic. type ObservabilityPipelineSumoLogicDestination struct { + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // The output encoding format. Encoding *ObservabilityPipelineSumoLogicDestinationEncoding `json:"encoding,omitempty"` // A list of custom headers to include in the request to Sumo Logic. @@ -55,6 +57,34 @@ func NewObservabilityPipelineSumoLogicDestinationWithDefaults() *ObservabilityPi return &this } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineSumoLogicDestination) 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 *ObservabilityPipelineSumoLogicDestination) 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 *ObservabilityPipelineSumoLogicDestination) 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 *ObservabilityPipelineSumoLogicDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetEncoding returns the Encoding field value if set, zero value otherwise. func (o *ObservabilityPipelineSumoLogicDestination) GetEncoding() ObservabilityPipelineSumoLogicDestinationEncoding { if o == nil || o.Encoding == nil { @@ -270,6 +300,9 @@ func (o ObservabilityPipelineSumoLogicDestination) MarshalJSON() ([]byte, error) if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } if o.Encoding != nil { toSerialize["encoding"] = o.Encoding } @@ -298,6 +331,7 @@ func (o ObservabilityPipelineSumoLogicDestination) MarshalJSON() ([]byte, error) // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineSumoLogicDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` Encoding *ObservabilityPipelineSumoLogicDestinationEncoding `json:"encoding,omitempty"` HeaderCustomFields []ObservabilityPipelineSumoLogicDestinationHeaderCustomFieldsItem `json:"header_custom_fields,omitempty"` HeaderHostName *string `json:"header_host_name,omitempty"` @@ -321,12 +355,13 @@ func (o *ObservabilityPipelineSumoLogicDestination) UnmarshalJSON(bytes []byte) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"encoding", "header_custom_fields", "header_host_name", "header_source_category", "header_source_name", "id", "inputs", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"buffer", "encoding", "header_custom_fields", "header_host_name", "header_source_category", "header_source_name", "id", "inputs", "type"}) } else { return err } hasInvalidField := false + o.Buffer = all.Buffer if all.Encoding != nil && !all.Encoding.IsValid() { hasInvalidField = true } else { diff --git a/api/datadogV2/model_observability_pipeline_syslog_ng_destination.go b/api/datadogV2/model_observability_pipeline_syslog_ng_destination.go index 2cb3b42f05a..a800e64d195 100644 --- a/api/datadogV2/model_observability_pipeline_syslog_ng_destination.go +++ b/api/datadogV2/model_observability_pipeline_syslog_ng_destination.go @@ -12,6 +12,8 @@ import ( // ObservabilityPipelineSyslogNgDestination The `syslog_ng` destination forwards logs to an external `syslog-ng` server over TCP or UDP using the syslog protocol. type ObservabilityPipelineSyslogNgDestination struct { + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` // The unique identifier for this component. Id string `json:"id"` // A list of component IDs whose output is used as the `input` for this component. @@ -49,6 +51,34 @@ func NewObservabilityPipelineSyslogNgDestinationWithDefaults() *ObservabilityPip return &this } +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineSyslogNgDestination) 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 *ObservabilityPipelineSyslogNgDestination) 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 *ObservabilityPipelineSyslogNgDestination) 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 *ObservabilityPipelineSyslogNgDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + // GetId returns the Id field value. func (o *ObservabilityPipelineSyslogNgDestination) GetId() string { if o == nil { @@ -180,6 +210,9 @@ func (o ObservabilityPipelineSyslogNgDestination) MarshalJSON() ([]byte, error) if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } toSerialize["id"] = o.Id toSerialize["inputs"] = o.Inputs if o.Keepalive != nil { @@ -199,6 +232,7 @@ func (o ObservabilityPipelineSyslogNgDestination) MarshalJSON() ([]byte, error) // UnmarshalJSON deserializes the given payload. func (o *ObservabilityPipelineSyslogNgDestination) UnmarshalJSON(bytes []byte) (err error) { all := struct { + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` Id *string `json:"id"` Inputs *[]string `json:"inputs"` Keepalive *int64 `json:"keepalive,omitempty"` @@ -219,12 +253,13 @@ func (o *ObservabilityPipelineSyslogNgDestination) UnmarshalJSON(bytes []byte) ( } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"id", "inputs", "keepalive", "tls", "type"}) + datadog.DeleteKeys(additionalProperties, &[]string{"buffer", "id", "inputs", "keepalive", "tls", "type"}) } else { return err } hasInvalidField := false + o.Buffer = all.Buffer o.Id = *all.Id o.Inputs = *all.Inputs o.Keepalive = all.Keepalive