Skip to content

Commit a7fd5a0

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add Google PubSub destination to the Observability Pipelines API (#2677)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 7713313 commit a7fd5a0

6 files changed

+369
-1
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30324,6 +30324,7 @@ components:
3032430324
- $ref: '#/components/schemas/ObservabilityPipelineSocketDestination'
3032530325
- $ref: '#/components/schemas/ObservabilityPipelineAmazonSecurityLakeDestination'
3032630326
- $ref: '#/components/schemas/ObservabilityPipelineCrowdStrikeNextGenSiemDestination'
30327+
- $ref: '#/components/schemas/ObservabilityPipelineGooglePubSubDestination'
3032730328
ObservabilityPipelineConfigProcessorItem:
3032830329
description: A processor for the pipeline.
3032930330
oneOf:
@@ -31385,6 +31386,65 @@ components:
3138531386
type: string
3138631387
x-enum-varnames:
3138731388
- GOOGLE_CLOUD_STORAGE
31389+
ObservabilityPipelineGooglePubSubDestination:
31390+
description: The `google_pubsub` destination publishes logs to a Google Cloud
31391+
Pub/Sub topic.
31392+
properties:
31393+
auth:
31394+
$ref: '#/components/schemas/ObservabilityPipelineGcpAuth'
31395+
encoding:
31396+
$ref: '#/components/schemas/ObservabilityPipelineGooglePubSubDestinationEncoding'
31397+
id:
31398+
description: The unique identifier for this component.
31399+
example: google-pubsub-destination
31400+
type: string
31401+
inputs:
31402+
description: A list of component IDs whose output is used as the `input`
31403+
for this component.
31404+
example:
31405+
- filter-processor
31406+
items:
31407+
type: string
31408+
type: array
31409+
project:
31410+
description: The GCP project ID that owns the Pub/Sub topic.
31411+
example: my-gcp-project
31412+
type: string
31413+
tls:
31414+
$ref: '#/components/schemas/ObservabilityPipelineTls'
31415+
topic:
31416+
description: The Pub/Sub topic name to publish logs to.
31417+
example: logs-subscription
31418+
type: string
31419+
type:
31420+
$ref: '#/components/schemas/ObservabilityPipelineGooglePubSubDestinationType'
31421+
required:
31422+
- id
31423+
- type
31424+
- inputs
31425+
- encoding
31426+
- project
31427+
- topic
31428+
type: object
31429+
ObservabilityPipelineGooglePubSubDestinationEncoding:
31430+
description: Encoding format for log events.
31431+
enum:
31432+
- json
31433+
- raw_message
31434+
example: json
31435+
type: string
31436+
x-enum-varnames:
31437+
- JSON
31438+
- RAW_MESSAGE
31439+
ObservabilityPipelineGooglePubSubDestinationType:
31440+
default: google_pubsub
31441+
description: The destination type. The value should always be `google_pubsub`.
31442+
enum:
31443+
- google_pubsub
31444+
example: google_pubsub
31445+
type: string
31446+
x-enum-varnames:
31447+
- GOOGLE_PUBSUB
3138831448
ObservabilityPipelineGooglePubSubSource:
3138931449
description: The `google_pubsub` source ingests logs from a Google Cloud Pub/Sub
3139031450
subscription.

lib/datadog_api_client/inflector.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2866,6 +2866,9 @@ def overrides
28662866
"v2.observability_pipeline_google_cloud_storage_destination_acl" => "ObservabilityPipelineGoogleCloudStorageDestinationAcl",
28672867
"v2.observability_pipeline_google_cloud_storage_destination_storage_class" => "ObservabilityPipelineGoogleCloudStorageDestinationStorageClass",
28682868
"v2.observability_pipeline_google_cloud_storage_destination_type" => "ObservabilityPipelineGoogleCloudStorageDestinationType",
2869+
"v2.observability_pipeline_google_pub_sub_destination" => "ObservabilityPipelineGooglePubSubDestination",
2870+
"v2.observability_pipeline_google_pub_sub_destination_encoding" => "ObservabilityPipelineGooglePubSubDestinationEncoding",
2871+
"v2.observability_pipeline_google_pub_sub_destination_type" => "ObservabilityPipelineGooglePubSubDestinationType",
28692872
"v2.observability_pipeline_google_pub_sub_source" => "ObservabilityPipelineGooglePubSubSource",
28702873
"v2.observability_pipeline_google_pub_sub_source_type" => "ObservabilityPipelineGooglePubSubSourceType",
28712874
"v2.observability_pipeline_http_client_source" => "ObservabilityPipelineHttpClientSource",

lib/datadog_api_client/v2/models/observability_pipeline_config_destination_item.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def openapi_one_of
4343
:'ObservabilityPipelineAmazonOpenSearchDestination',
4444
:'ObservabilityPipelineSocketDestination',
4545
:'ObservabilityPipelineAmazonSecurityLakeDestination',
46-
:'ObservabilityPipelineCrowdStrikeNextGenSiemDestination'
46+
:'ObservabilityPipelineCrowdStrikeNextGenSiemDestination',
47+
:'ObservabilityPipelineGooglePubSubDestination'
4748
]
4849
end
4950
# Builds the object
Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# The `google_pubsub` destination publishes logs to a Google Cloud Pub/Sub topic.
21+
class ObservabilityPipelineGooglePubSubDestination
22+
include BaseGenericModel
23+
24+
# GCP credentials used to authenticate with Google Cloud Storage.
25+
#
26+
attr_accessor :auth
27+
28+
# Encoding format for log events.
29+
attr_reader :encoding
30+
31+
# The unique identifier for this component.
32+
attr_reader :id
33+
34+
# A list of component IDs whose output is used as the `input` for this component.
35+
attr_reader :inputs
36+
37+
# The GCP project ID that owns the Pub/Sub topic.
38+
attr_reader :project
39+
40+
# Configuration for enabling TLS encryption between the pipeline component and external services.
41+
attr_accessor :tls
42+
43+
# The Pub/Sub topic name to publish logs to.
44+
attr_reader :topic
45+
46+
# The destination type. The value should always be `google_pubsub`.
47+
attr_reader :type
48+
49+
attr_accessor :additional_properties
50+
51+
# Attribute mapping from ruby-style variable name to JSON key.
52+
# @!visibility private
53+
def self.attribute_map
54+
{
55+
:'auth' => :'auth',
56+
:'encoding' => :'encoding',
57+
:'id' => :'id',
58+
:'inputs' => :'inputs',
59+
:'project' => :'project',
60+
:'tls' => :'tls',
61+
:'topic' => :'topic',
62+
:'type' => :'type'
63+
}
64+
end
65+
66+
# Attribute type mapping.
67+
# @!visibility private
68+
def self.openapi_types
69+
{
70+
:'auth' => :'ObservabilityPipelineGcpAuth',
71+
:'encoding' => :'ObservabilityPipelineGooglePubSubDestinationEncoding',
72+
:'id' => :'String',
73+
:'inputs' => :'Array<String>',
74+
:'project' => :'String',
75+
:'tls' => :'ObservabilityPipelineTls',
76+
:'topic' => :'String',
77+
:'type' => :'ObservabilityPipelineGooglePubSubDestinationType'
78+
}
79+
end
80+
81+
# Initializes the object
82+
# @param attributes [Hash] Model attributes in the form of hash
83+
# @!visibility private
84+
def initialize(attributes = {})
85+
if (!attributes.is_a?(Hash))
86+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ObservabilityPipelineGooglePubSubDestination` initialize method"
87+
end
88+
89+
self.additional_properties = {}
90+
# check to see if the attribute exists and convert string to symbol for hash key
91+
attributes = attributes.each_with_object({}) { |(k, v), h|
92+
if (!self.class.attribute_map.key?(k.to_sym))
93+
self.additional_properties[k.to_sym] = v
94+
else
95+
h[k.to_sym] = v
96+
end
97+
}
98+
99+
if attributes.key?(:'auth')
100+
self.auth = attributes[:'auth']
101+
end
102+
103+
if attributes.key?(:'encoding')
104+
self.encoding = attributes[:'encoding']
105+
end
106+
107+
if attributes.key?(:'id')
108+
self.id = attributes[:'id']
109+
end
110+
111+
if attributes.key?(:'inputs')
112+
if (value = attributes[:'inputs']).is_a?(Array)
113+
self.inputs = value
114+
end
115+
end
116+
117+
if attributes.key?(:'project')
118+
self.project = attributes[:'project']
119+
end
120+
121+
if attributes.key?(:'tls')
122+
self.tls = attributes[:'tls']
123+
end
124+
125+
if attributes.key?(:'topic')
126+
self.topic = attributes[:'topic']
127+
end
128+
129+
if attributes.key?(:'type')
130+
self.type = attributes[:'type']
131+
end
132+
end
133+
134+
# Check to see if the all the properties in the model are valid
135+
# @return true if the model is valid
136+
# @!visibility private
137+
def valid?
138+
return false if @encoding.nil?
139+
return false if @id.nil?
140+
return false if @inputs.nil?
141+
return false if @project.nil?
142+
return false if @topic.nil?
143+
return false if @type.nil?
144+
true
145+
end
146+
147+
# Custom attribute writer method with validation
148+
# @param encoding [Object] Object to be assigned
149+
# @!visibility private
150+
def encoding=(encoding)
151+
if encoding.nil?
152+
fail ArgumentError, 'invalid value for "encoding", encoding cannot be nil.'
153+
end
154+
@encoding = encoding
155+
end
156+
157+
# Custom attribute writer method with validation
158+
# @param id [Object] Object to be assigned
159+
# @!visibility private
160+
def id=(id)
161+
if id.nil?
162+
fail ArgumentError, 'invalid value for "id", id cannot be nil.'
163+
end
164+
@id = id
165+
end
166+
167+
# Custom attribute writer method with validation
168+
# @param inputs [Object] Object to be assigned
169+
# @!visibility private
170+
def inputs=(inputs)
171+
if inputs.nil?
172+
fail ArgumentError, 'invalid value for "inputs", inputs cannot be nil.'
173+
end
174+
@inputs = inputs
175+
end
176+
177+
# Custom attribute writer method with validation
178+
# @param project [Object] Object to be assigned
179+
# @!visibility private
180+
def project=(project)
181+
if project.nil?
182+
fail ArgumentError, 'invalid value for "project", project cannot be nil.'
183+
end
184+
@project = project
185+
end
186+
187+
# Custom attribute writer method with validation
188+
# @param topic [Object] Object to be assigned
189+
# @!visibility private
190+
def topic=(topic)
191+
if topic.nil?
192+
fail ArgumentError, 'invalid value for "topic", topic cannot be nil.'
193+
end
194+
@topic = topic
195+
end
196+
197+
# Custom attribute writer method with validation
198+
# @param type [Object] Object to be assigned
199+
# @!visibility private
200+
def type=(type)
201+
if type.nil?
202+
fail ArgumentError, 'invalid value for "type", type cannot be nil.'
203+
end
204+
@type = type
205+
end
206+
207+
# Returns the object in the form of hash, with additionalProperties support.
208+
# @return [Hash] Returns the object in the form of hash
209+
# @!visibility private
210+
def to_hash
211+
hash = {}
212+
self.class.attribute_map.each_pair do |attr, param|
213+
value = self.send(attr)
214+
if value.nil?
215+
is_nullable = self.class.openapi_nullable.include?(attr)
216+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217+
end
218+
219+
hash[param] = _to_hash(value)
220+
end
221+
self.additional_properties.each_pair do |attr, value|
222+
hash[attr] = value
223+
end
224+
hash
225+
end
226+
227+
# Checks equality by comparing each attribute.
228+
# @param o [Object] Object to be compared
229+
# @!visibility private
230+
def ==(o)
231+
return true if self.equal?(o)
232+
self.class == o.class &&
233+
auth == o.auth &&
234+
encoding == o.encoding &&
235+
id == o.id &&
236+
inputs == o.inputs &&
237+
project == o.project &&
238+
tls == o.tls &&
239+
topic == o.topic &&
240+
type == o.type &&
241+
additional_properties == o.additional_properties
242+
end
243+
244+
# Calculates hash code according to all attributes.
245+
# @return [Integer] Hash code
246+
# @!visibility private
247+
def hash
248+
[auth, encoding, id, inputs, project, tls, topic, type, additional_properties].hash
249+
end
250+
end
251+
end
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V2
20+
# Encoding format for log events.
21+
class ObservabilityPipelineGooglePubSubDestinationEncoding
22+
include BaseEnumModel
23+
24+
JSON = "json".freeze
25+
RAW_MESSAGE = "raw_message".freeze
26+
end
27+
end

0 commit comments

Comments
 (0)