diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5b3f25722be..e5175c1dc60 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -46522,6 +46522,7 @@ components: - $ref: "#/components/schemas/ObservabilityPipelineSplunkHecDestination" - $ref: "#/components/schemas/ObservabilityPipelineSumoLogicDestination" - $ref: "#/components/schemas/ObservabilityPipelineSyslogNgDestination" + - $ref: "#/components/schemas/ObservabilityPipelineDatabricksZerobusDestination" - $ref: "#/components/schemas/ObservabilityPipelineDatadogMetricsDestination" ObservabilityPipelineConfigPipelineType: default: logs @@ -46806,6 +46807,74 @@ components: - name - config type: object + ObservabilityPipelineDatabricksZerobusDestination: + description: |- + The `databricks_zerobus` destination sends logs to Databricks using the Zerobus ingestion API, streaming data directly into your Databricks Lakehouse. + + **Supported pipeline types:** Logs, rehydration + properties: + auth: + $ref: "#/components/schemas/ObservabilityPipelineDatabricksZerobusDestinationAuth" + buffer: + $ref: "#/components/schemas/ObservabilityPipelineBufferOptions" + id: + description: The unique identifier for this component. + example: databricks-zerobus-destination + type: string + ingestion_endpoint: + description: Your Databricks Zerobus ingestion endpoint. This is the endpoint used to stream data directly into your Databricks Lakehouse. + example: https://my-workspace-id.zerobus.us-east-1.cloud.databricks.com + type: string + inputs: + description: A list of component IDs whose output is used as the `input` for this component. + example: ["filter-processor"] + items: + description: The ID of a component whose output is used as input for this destination. + type: string + type: array + table_name: + description: The fully qualified name of your target Databricks table. Make sure this table already exists in your Databricks workspace before deploying. + example: catalog.schema.table + type: string + type: + $ref: "#/components/schemas/ObservabilityPipelineDatabricksZerobusDestinationType" + unity_catalog_endpoint: + description: Your Databricks workspace URL. This is used to communicate with the Unity Catalog API. + example: https://my-workspace.cloud.databricks.com + type: string + required: + - id + - type + - inputs + - ingestion_endpoint + - table_name + - unity_catalog_endpoint + - auth + type: object + x-pipeline-types: [logs, rehydration] + ObservabilityPipelineDatabricksZerobusDestinationAuth: + description: OAuth credentials for authenticating with the Databricks Zerobus ingestion API. + properties: + client_id: + description: Your service principal application ID (UUID). + example: 9a8b7c6d-1234-5678-abcd-ef0123456789 + type: string + client_secret_key: + description: Name of the environment variable or secret that holds the OAuth client secret used to authenticate with the Databricks ingestion endpoint. + example: DD_OP_DESTINATION_DATABRICKS_ZEROBUS_OAUTH_CLIENT_SECRET + type: string + required: + - client_id + type: object + ObservabilityPipelineDatabricksZerobusDestinationType: + default: databricks_zerobus + description: The destination type. The value must be `databricks_zerobus`. + enum: + - databricks_zerobus + example: databricks_zerobus + type: string + x-enum-varnames: + - DATABRICKS_ZEROBUS ObservabilityPipelineDatadogAgentSource: description: |- The `datadog_agent` source collects logs/metrics from the Datadog Agent. diff --git a/api/datadogV2/model_observability_pipeline_config_destination_item.go b/api/datadogV2/model_observability_pipeline_config_destination_item.go index 5b8058eebf5..f141bb386c3 100644 --- a/api/datadogV2/model_observability_pipeline_config_destination_item.go +++ b/api/datadogV2/model_observability_pipeline_config_destination_item.go @@ -33,6 +33,7 @@ type ObservabilityPipelineConfigDestinationItem struct { ObservabilityPipelineSplunkHecDestination *ObservabilityPipelineSplunkHecDestination ObservabilityPipelineSumoLogicDestination *ObservabilityPipelineSumoLogicDestination ObservabilityPipelineSyslogNgDestination *ObservabilityPipelineSyslogNgDestination + ObservabilityPipelineDatabricksZerobusDestination *ObservabilityPipelineDatabricksZerobusDestination ObservabilityPipelineDatadogMetricsDestination *ObservabilityPipelineDatadogMetricsDestination // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -154,6 +155,11 @@ func ObservabilityPipelineSyslogNgDestinationAsObservabilityPipelineConfigDestin return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineSyslogNgDestination: v} } +// ObservabilityPipelineDatabricksZerobusDestinationAsObservabilityPipelineConfigDestinationItem is a convenience function that returns ObservabilityPipelineDatabricksZerobusDestination wrapped in ObservabilityPipelineConfigDestinationItem. +func ObservabilityPipelineDatabricksZerobusDestinationAsObservabilityPipelineConfigDestinationItem(v *ObservabilityPipelineDatabricksZerobusDestination) ObservabilityPipelineConfigDestinationItem { + return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineDatabricksZerobusDestination: v} +} + // ObservabilityPipelineDatadogMetricsDestinationAsObservabilityPipelineConfigDestinationItem is a convenience function that returns ObservabilityPipelineDatadogMetricsDestination wrapped in ObservabilityPipelineConfigDestinationItem. func ObservabilityPipelineDatadogMetricsDestinationAsObservabilityPipelineConfigDestinationItem(v *ObservabilityPipelineDatadogMetricsDestination) ObservabilityPipelineConfigDestinationItem { return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineDatadogMetricsDestination: v} @@ -554,6 +560,23 @@ func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte obj.ObservabilityPipelineSyslogNgDestination = nil } + // try to unmarshal data into ObservabilityPipelineDatabricksZerobusDestination + err = datadog.Unmarshal(data, &obj.ObservabilityPipelineDatabricksZerobusDestination) + if err == nil { + if obj.ObservabilityPipelineDatabricksZerobusDestination != nil && obj.ObservabilityPipelineDatabricksZerobusDestination.UnparsedObject == nil { + jsonObservabilityPipelineDatabricksZerobusDestination, _ := datadog.Marshal(obj.ObservabilityPipelineDatabricksZerobusDestination) + if string(jsonObservabilityPipelineDatabricksZerobusDestination) == "{}" { // empty struct + obj.ObservabilityPipelineDatabricksZerobusDestination = nil + } else { + match++ + } + } else { + obj.ObservabilityPipelineDatabricksZerobusDestination = nil + } + } else { + obj.ObservabilityPipelineDatabricksZerobusDestination = nil + } + // try to unmarshal data into ObservabilityPipelineDatadogMetricsDestination err = datadog.Unmarshal(data, &obj.ObservabilityPipelineDatadogMetricsDestination) if err == nil { @@ -596,6 +619,7 @@ func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte obj.ObservabilityPipelineSplunkHecDestination = nil obj.ObservabilityPipelineSumoLogicDestination = nil obj.ObservabilityPipelineSyslogNgDestination = nil + obj.ObservabilityPipelineDatabricksZerobusDestination = nil obj.ObservabilityPipelineDatadogMetricsDestination = nil return datadog.Unmarshal(data, &obj.UnparsedObject) } @@ -696,6 +720,10 @@ func (obj ObservabilityPipelineConfigDestinationItem) MarshalJSON() ([]byte, err return datadog.Marshal(&obj.ObservabilityPipelineSyslogNgDestination) } + if obj.ObservabilityPipelineDatabricksZerobusDestination != nil { + return datadog.Marshal(&obj.ObservabilityPipelineDatabricksZerobusDestination) + } + if obj.ObservabilityPipelineDatadogMetricsDestination != nil { return datadog.Marshal(&obj.ObservabilityPipelineDatadogMetricsDestination) } @@ -800,6 +828,10 @@ func (obj *ObservabilityPipelineConfigDestinationItem) GetActualInstance() inter return obj.ObservabilityPipelineSyslogNgDestination } + if obj.ObservabilityPipelineDatabricksZerobusDestination != nil { + return obj.ObservabilityPipelineDatabricksZerobusDestination + } + if obj.ObservabilityPipelineDatadogMetricsDestination != nil { return obj.ObservabilityPipelineDatadogMetricsDestination } diff --git a/api/datadogV2/model_observability_pipeline_databricks_zerobus_destination.go b/api/datadogV2/model_observability_pipeline_databricks_zerobus_destination.go new file mode 100644 index 00000000000..0fda24e4bd9 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_databricks_zerobus_destination.go @@ -0,0 +1,345 @@ +// 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" +) + +// ObservabilityPipelineDatabricksZerobusDestination The `databricks_zerobus` destination sends logs to Databricks using the Zerobus ingestion API, streaming data directly into your Databricks Lakehouse. +// +// **Supported pipeline types:** Logs, rehydration +type ObservabilityPipelineDatabricksZerobusDestination struct { + // OAuth credentials for authenticating with the Databricks Zerobus ingestion API. + Auth ObservabilityPipelineDatabricksZerobusDestinationAuth `json:"auth"` + // Configuration for buffer settings on destination components. + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` + // The unique identifier for this component. + Id string `json:"id"` + // Your Databricks Zerobus ingestion endpoint. This is the endpoint used to stream data directly into your Databricks Lakehouse. + IngestionEndpoint string `json:"ingestion_endpoint"` + // A list of component IDs whose output is used as the `input` for this component. + Inputs []string `json:"inputs"` + // The fully qualified name of your target Databricks table. Make sure this table already exists in your Databricks workspace before deploying. + TableName string `json:"table_name"` + // The destination type. The value must be `databricks_zerobus`. + Type ObservabilityPipelineDatabricksZerobusDestinationType `json:"type"` + // Your Databricks workspace URL. This is used to communicate with the Unity Catalog API. + UnityCatalogEndpoint string `json:"unity_catalog_endpoint"` + // 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:"-"` +} + +// NewObservabilityPipelineDatabricksZerobusDestination instantiates a new ObservabilityPipelineDatabricksZerobusDestination 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 NewObservabilityPipelineDatabricksZerobusDestination(auth ObservabilityPipelineDatabricksZerobusDestinationAuth, id string, ingestionEndpoint string, inputs []string, tableName string, typeVar ObservabilityPipelineDatabricksZerobusDestinationType, unityCatalogEndpoint string) *ObservabilityPipelineDatabricksZerobusDestination { + this := ObservabilityPipelineDatabricksZerobusDestination{} + this.Auth = auth + this.Id = id + this.IngestionEndpoint = ingestionEndpoint + this.Inputs = inputs + this.TableName = tableName + this.Type = typeVar + this.UnityCatalogEndpoint = unityCatalogEndpoint + return &this +} + +// NewObservabilityPipelineDatabricksZerobusDestinationWithDefaults instantiates a new ObservabilityPipelineDatabricksZerobusDestination 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 NewObservabilityPipelineDatabricksZerobusDestinationWithDefaults() *ObservabilityPipelineDatabricksZerobusDestination { + this := ObservabilityPipelineDatabricksZerobusDestination{} + var typeVar ObservabilityPipelineDatabricksZerobusDestinationType = OBSERVABILITYPIPELINEDATABRICKSZEROBUSDESTINATIONTYPE_DATABRICKS_ZEROBUS + this.Type = typeVar + return &this +} + +// GetAuth returns the Auth field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetAuth() ObservabilityPipelineDatabricksZerobusDestinationAuth { + if o == nil { + var ret ObservabilityPipelineDatabricksZerobusDestinationAuth + return ret + } + return o.Auth +} + +// GetAuthOk returns a tuple with the Auth field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetAuthOk() (*ObservabilityPipelineDatabricksZerobusDestinationAuth, bool) { + if o == nil { + return nil, false + } + return &o.Auth, true +} + +// SetAuth sets field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) SetAuth(v ObservabilityPipelineDatabricksZerobusDestinationAuth) { + o.Auth = v +} + +// GetBuffer returns the Buffer field value if set, zero value otherwise. +func (o *ObservabilityPipelineDatabricksZerobusDestination) 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 *ObservabilityPipelineDatabricksZerobusDestination) 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 *ObservabilityPipelineDatabricksZerobusDestination) 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 *ObservabilityPipelineDatabricksZerobusDestination) SetBuffer(v ObservabilityPipelineBufferOptions) { + o.Buffer = &v +} + +// GetId returns the Id field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) SetId(v string) { + o.Id = v +} + +// GetIngestionEndpoint returns the IngestionEndpoint field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetIngestionEndpoint() string { + if o == nil { + var ret string + return ret + } + return o.IngestionEndpoint +} + +// GetIngestionEndpointOk returns a tuple with the IngestionEndpoint field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetIngestionEndpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IngestionEndpoint, true +} + +// SetIngestionEndpoint sets field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) SetIngestionEndpoint(v string) { + o.IngestionEndpoint = v +} + +// GetInputs returns the Inputs field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetInputs() []string { + if o == nil { + var ret []string + return ret + } + return o.Inputs +} + +// GetInputsOk returns a tuple with the Inputs field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetInputsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Inputs, true +} + +// SetInputs sets field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) SetInputs(v []string) { + o.Inputs = v +} + +// GetTableName returns the TableName field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetTableName() string { + if o == nil { + var ret string + return ret + } + return o.TableName +} + +// GetTableNameOk returns a tuple with the TableName field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetTableNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TableName, true +} + +// SetTableName sets field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) SetTableName(v string) { + o.TableName = v +} + +// GetType returns the Type field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetType() ObservabilityPipelineDatabricksZerobusDestinationType { + if o == nil { + var ret ObservabilityPipelineDatabricksZerobusDestinationType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetTypeOk() (*ObservabilityPipelineDatabricksZerobusDestinationType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) SetType(v ObservabilityPipelineDatabricksZerobusDestinationType) { + o.Type = v +} + +// GetUnityCatalogEndpoint returns the UnityCatalogEndpoint field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetUnityCatalogEndpoint() string { + if o == nil { + var ret string + return ret + } + return o.UnityCatalogEndpoint +} + +// GetUnityCatalogEndpointOk returns a tuple with the UnityCatalogEndpoint field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatabricksZerobusDestination) GetUnityCatalogEndpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UnityCatalogEndpoint, true +} + +// SetUnityCatalogEndpoint sets field value. +func (o *ObservabilityPipelineDatabricksZerobusDestination) SetUnityCatalogEndpoint(v string) { + o.UnityCatalogEndpoint = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ObservabilityPipelineDatabricksZerobusDestination) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["auth"] = o.Auth + if o.Buffer != nil { + toSerialize["buffer"] = o.Buffer + } + toSerialize["id"] = o.Id + toSerialize["ingestion_endpoint"] = o.IngestionEndpoint + toSerialize["inputs"] = o.Inputs + toSerialize["table_name"] = o.TableName + toSerialize["type"] = o.Type + toSerialize["unity_catalog_endpoint"] = o.UnityCatalogEndpoint + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ObservabilityPipelineDatabricksZerobusDestination) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Auth *ObservabilityPipelineDatabricksZerobusDestinationAuth `json:"auth"` + Buffer *ObservabilityPipelineBufferOptions `json:"buffer,omitempty"` + Id *string `json:"id"` + IngestionEndpoint *string `json:"ingestion_endpoint"` + Inputs *[]string `json:"inputs"` + TableName *string `json:"table_name"` + Type *ObservabilityPipelineDatabricksZerobusDestinationType `json:"type"` + UnityCatalogEndpoint *string `json:"unity_catalog_endpoint"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Auth == nil { + return fmt.Errorf("required field auth missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.IngestionEndpoint == nil { + return fmt.Errorf("required field ingestion_endpoint missing") + } + if all.Inputs == nil { + return fmt.Errorf("required field inputs missing") + } + if all.TableName == nil { + return fmt.Errorf("required field table_name missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + if all.UnityCatalogEndpoint == nil { + return fmt.Errorf("required field unity_catalog_endpoint missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"auth", "buffer", "id", "ingestion_endpoint", "inputs", "table_name", "type", "unity_catalog_endpoint"}) + } else { + return err + } + + hasInvalidField := false + if all.Auth.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Auth = *all.Auth + o.Buffer = all.Buffer + o.Id = *all.Id + o.IngestionEndpoint = *all.IngestionEndpoint + o.Inputs = *all.Inputs + o.TableName = *all.TableName + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + o.UnityCatalogEndpoint = *all.UnityCatalogEndpoint + + 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_databricks_zerobus_destination_auth.go b/api/datadogV2/model_observability_pipeline_databricks_zerobus_destination_auth.go new file mode 100644 index 00000000000..c37776bfff0 --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_databricks_zerobus_destination_auth.go @@ -0,0 +1,136 @@ +// 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" +) + +// ObservabilityPipelineDatabricksZerobusDestinationAuth OAuth credentials for authenticating with the Databricks Zerobus ingestion API. +type ObservabilityPipelineDatabricksZerobusDestinationAuth struct { + // Your service principal application ID (UUID). + ClientId string `json:"client_id"` + // Name of the environment variable or secret that holds the OAuth client secret used to authenticate with the Databricks ingestion endpoint. + ClientSecretKey *string `json:"client_secret_key,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:"-"` +} + +// NewObservabilityPipelineDatabricksZerobusDestinationAuth instantiates a new ObservabilityPipelineDatabricksZerobusDestinationAuth 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 NewObservabilityPipelineDatabricksZerobusDestinationAuth(clientId string) *ObservabilityPipelineDatabricksZerobusDestinationAuth { + this := ObservabilityPipelineDatabricksZerobusDestinationAuth{} + this.ClientId = clientId + return &this +} + +// NewObservabilityPipelineDatabricksZerobusDestinationAuthWithDefaults instantiates a new ObservabilityPipelineDatabricksZerobusDestinationAuth 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 NewObservabilityPipelineDatabricksZerobusDestinationAuthWithDefaults() *ObservabilityPipelineDatabricksZerobusDestinationAuth { + this := ObservabilityPipelineDatabricksZerobusDestinationAuth{} + return &this +} + +// GetClientId returns the ClientId field value. +func (o *ObservabilityPipelineDatabricksZerobusDestinationAuth) GetClientId() string { + if o == nil { + var ret string + return ret + } + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatabricksZerobusDestinationAuth) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value. +func (o *ObservabilityPipelineDatabricksZerobusDestinationAuth) SetClientId(v string) { + o.ClientId = v +} + +// GetClientSecretKey returns the ClientSecretKey field value if set, zero value otherwise. +func (o *ObservabilityPipelineDatabricksZerobusDestinationAuth) GetClientSecretKey() string { + if o == nil || o.ClientSecretKey == nil { + var ret string + return ret + } + return *o.ClientSecretKey +} + +// GetClientSecretKeyOk returns a tuple with the ClientSecretKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ObservabilityPipelineDatabricksZerobusDestinationAuth) GetClientSecretKeyOk() (*string, bool) { + if o == nil || o.ClientSecretKey == nil { + return nil, false + } + return o.ClientSecretKey, true +} + +// HasClientSecretKey returns a boolean if a field has been set. +func (o *ObservabilityPipelineDatabricksZerobusDestinationAuth) HasClientSecretKey() bool { + return o != nil && o.ClientSecretKey != nil +} + +// SetClientSecretKey gets a reference to the given string and assigns it to the ClientSecretKey field. +func (o *ObservabilityPipelineDatabricksZerobusDestinationAuth) SetClientSecretKey(v string) { + o.ClientSecretKey = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ObservabilityPipelineDatabricksZerobusDestinationAuth) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["client_id"] = o.ClientId + if o.ClientSecretKey != nil { + toSerialize["client_secret_key"] = o.ClientSecretKey + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ObservabilityPipelineDatabricksZerobusDestinationAuth) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ClientId *string `json:"client_id"` + ClientSecretKey *string `json:"client_secret_key,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.ClientId == nil { + return fmt.Errorf("required field client_id missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"client_id", "client_secret_key"}) + } else { + return err + } + o.ClientId = *all.ClientId + o.ClientSecretKey = all.ClientSecretKey + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_observability_pipeline_databricks_zerobus_destination_type.go b/api/datadogV2/model_observability_pipeline_databricks_zerobus_destination_type.go new file mode 100644 index 00000000000..47bd719fc6a --- /dev/null +++ b/api/datadogV2/model_observability_pipeline_databricks_zerobus_destination_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" +) + +// ObservabilityPipelineDatabricksZerobusDestinationType The destination type. The value must be `databricks_zerobus`. +type ObservabilityPipelineDatabricksZerobusDestinationType string + +// List of ObservabilityPipelineDatabricksZerobusDestinationType. +const ( + OBSERVABILITYPIPELINEDATABRICKSZEROBUSDESTINATIONTYPE_DATABRICKS_ZEROBUS ObservabilityPipelineDatabricksZerobusDestinationType = "databricks_zerobus" +) + +var allowedObservabilityPipelineDatabricksZerobusDestinationTypeEnumValues = []ObservabilityPipelineDatabricksZerobusDestinationType{ + OBSERVABILITYPIPELINEDATABRICKSZEROBUSDESTINATIONTYPE_DATABRICKS_ZEROBUS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ObservabilityPipelineDatabricksZerobusDestinationType) GetAllowedValues() []ObservabilityPipelineDatabricksZerobusDestinationType { + return allowedObservabilityPipelineDatabricksZerobusDestinationTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ObservabilityPipelineDatabricksZerobusDestinationType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ObservabilityPipelineDatabricksZerobusDestinationType(value) + return nil +} + +// NewObservabilityPipelineDatabricksZerobusDestinationTypeFromValue returns a pointer to a valid ObservabilityPipelineDatabricksZerobusDestinationType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewObservabilityPipelineDatabricksZerobusDestinationTypeFromValue(v string) (*ObservabilityPipelineDatabricksZerobusDestinationType, error) { + ev := ObservabilityPipelineDatabricksZerobusDestinationType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ObservabilityPipelineDatabricksZerobusDestinationType: valid values are %v", v, allowedObservabilityPipelineDatabricksZerobusDestinationTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ObservabilityPipelineDatabricksZerobusDestinationType) IsValid() bool { + for _, existing := range allowedObservabilityPipelineDatabricksZerobusDestinationTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ObservabilityPipelineDatabricksZerobusDestinationType value. +func (v ObservabilityPipelineDatabricksZerobusDestinationType) Ptr() *ObservabilityPipelineDatabricksZerobusDestinationType { + return &v +}