Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30324,6 +30324,7 @@ components:
- $ref: '#/components/schemas/ObservabilityPipelineSocketDestination'
- $ref: '#/components/schemas/ObservabilityPipelineAmazonSecurityLakeDestination'
- $ref: '#/components/schemas/ObservabilityPipelineCrowdStrikeNextGenSiemDestination'
- $ref: '#/components/schemas/ObservabilityPipelineGooglePubSubDestination'
ObservabilityPipelineConfigProcessorItem:
description: A processor for the pipeline.
oneOf:
Expand Down Expand Up @@ -31385,6 +31386,65 @@ components:
type: string
x-enum-varnames:
- GOOGLE_CLOUD_STORAGE
ObservabilityPipelineGooglePubSubDestination:
description: The `google_pubsub` destination publishes logs to a Google Cloud
Pub/Sub topic.
properties:
auth:
$ref: '#/components/schemas/ObservabilityPipelineGcpAuth'
encoding:
$ref: '#/components/schemas/ObservabilityPipelineGooglePubSubDestinationEncoding'
id:
description: The unique identifier for this component.
example: google-pubsub-destination
type: string
inputs:
description: A list of component IDs whose output is used as the `input`
for this component.
example:
- filter-processor
items:
type: string
type: array
project:
description: The GCP project ID that owns the Pub/Sub topic.
example: my-gcp-project
type: string
tls:
$ref: '#/components/schemas/ObservabilityPipelineTls'
topic:
description: The Pub/Sub topic name to publish logs to.
example: logs-subscription
type: string
type:
$ref: '#/components/schemas/ObservabilityPipelineGooglePubSubDestinationType'
required:
- id
- type
- inputs
- encoding
- project
- topic
type: object
ObservabilityPipelineGooglePubSubDestinationEncoding:
description: Encoding format for log events.
enum:
- json
- raw_message
example: json
type: string
x-enum-varnames:
- JSON
- RAW_MESSAGE
ObservabilityPipelineGooglePubSubDestinationType:
default: google_pubsub
description: The destination type. The value should always be `google_pubsub`.
enum:
- google_pubsub
example: google_pubsub
type: string
x-enum-varnames:
- GOOGLE_PUBSUB
ObservabilityPipelineGooglePubSubSource:
description: The `google_pubsub` source ingests logs from a Google Cloud Pub/Sub
subscription.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type ObservabilityPipelineConfigDestinationItem struct {
ObservabilityPipelineSocketDestination *ObservabilityPipelineSocketDestination
ObservabilityPipelineAmazonSecurityLakeDestination *ObservabilityPipelineAmazonSecurityLakeDestination
ObservabilityPipelineCrowdStrikeNextGenSiemDestination *ObservabilityPipelineCrowdStrikeNextGenSiemDestination
ObservabilityPipelineGooglePubSubDestination *ObservabilityPipelineGooglePubSubDestination

// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject interface{}
Expand Down Expand Up @@ -123,6 +124,11 @@ func ObservabilityPipelineCrowdStrikeNextGenSiemDestinationAsObservabilityPipeli
return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineCrowdStrikeNextGenSiemDestination: v}
}

// ObservabilityPipelineGooglePubSubDestinationAsObservabilityPipelineConfigDestinationItem is a convenience function that returns ObservabilityPipelineGooglePubSubDestination wrapped in ObservabilityPipelineConfigDestinationItem.
func ObservabilityPipelineGooglePubSubDestinationAsObservabilityPipelineConfigDestinationItem(v *ObservabilityPipelineGooglePubSubDestination) ObservabilityPipelineConfigDestinationItem {
return ObservabilityPipelineConfigDestinationItem{ObservabilityPipelineGooglePubSubDestination: v}
}

// UnmarshalJSON turns data into one of the pointers in the struct.
func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte) error {
var err error
Expand Down Expand Up @@ -433,6 +439,23 @@ func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte
obj.ObservabilityPipelineCrowdStrikeNextGenSiemDestination = nil
}

// try to unmarshal data into ObservabilityPipelineGooglePubSubDestination
err = datadog.Unmarshal(data, &obj.ObservabilityPipelineGooglePubSubDestination)
if err == nil {
if obj.ObservabilityPipelineGooglePubSubDestination != nil && obj.ObservabilityPipelineGooglePubSubDestination.UnparsedObject == nil {
jsonObservabilityPipelineGooglePubSubDestination, _ := datadog.Marshal(obj.ObservabilityPipelineGooglePubSubDestination)
if string(jsonObservabilityPipelineGooglePubSubDestination) == "{}" { // empty struct
obj.ObservabilityPipelineGooglePubSubDestination = nil
} else {
match++
}
} else {
obj.ObservabilityPipelineGooglePubSubDestination = nil
}
} else {
obj.ObservabilityPipelineGooglePubSubDestination = nil
}

if match != 1 { // more than 1 match
// reset to nil
obj.ObservabilityPipelineDatadogLogsDestination = nil
Expand All @@ -453,6 +476,7 @@ func (obj *ObservabilityPipelineConfigDestinationItem) UnmarshalJSON(data []byte
obj.ObservabilityPipelineSocketDestination = nil
obj.ObservabilityPipelineAmazonSecurityLakeDestination = nil
obj.ObservabilityPipelineCrowdStrikeNextGenSiemDestination = nil
obj.ObservabilityPipelineGooglePubSubDestination = nil
return datadog.Unmarshal(data, &obj.UnparsedObject)
}
return nil // exactly one match
Expand Down Expand Up @@ -532,6 +556,10 @@ func (obj ObservabilityPipelineConfigDestinationItem) MarshalJSON() ([]byte, err
return datadog.Marshal(&obj.ObservabilityPipelineCrowdStrikeNextGenSiemDestination)
}

if obj.ObservabilityPipelineGooglePubSubDestination != nil {
return datadog.Marshal(&obj.ObservabilityPipelineGooglePubSubDestination)
}

if obj.UnparsedObject != nil {
return datadog.Marshal(obj.UnparsedObject)
}
Expand Down Expand Up @@ -612,6 +640,10 @@ func (obj *ObservabilityPipelineConfigDestinationItem) GetActualInstance() inter
return obj.ObservabilityPipelineCrowdStrikeNextGenSiemDestination
}

if obj.ObservabilityPipelineGooglePubSubDestination != nil {
return obj.ObservabilityPipelineGooglePubSubDestination
}

// all schemas are nil
return nil
}
Loading
Loading