google-ads-data_manager-v1 0.a → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/ads/data_manager/v1/ingestion_service/client.rb +787 -0
  6. data/lib/google/ads/data_manager/v1/ingestion_service/credentials.rb +47 -0
  7. data/lib/google/ads/data_manager/v1/ingestion_service/rest/client.rb +748 -0
  8. data/lib/google/ads/data_manager/v1/ingestion_service/rest/service_stub.rb +320 -0
  9. data/lib/google/ads/data_manager/v1/ingestion_service/rest.rb +51 -0
  10. data/lib/google/ads/data_manager/v1/ingestion_service.rb +54 -0
  11. data/lib/google/ads/data_manager/v1/rest.rb +37 -0
  12. data/lib/google/ads/data_manager/v1/version.rb +7 -2
  13. data/lib/google/ads/data_manager/v1.rb +45 -0
  14. data/lib/google/ads/datamanager/v1/audience_pb.rb +50 -0
  15. data/lib/google/ads/datamanager/v1/cart_data_pb.rb +45 -0
  16. data/lib/google/ads/datamanager/v1/consent_pb.rb +45 -0
  17. data/lib/google/ads/datamanager/v1/destination_pb.rb +47 -0
  18. data/lib/google/ads/datamanager/v1/device_info_pb.rb +44 -0
  19. data/lib/google/ads/datamanager/v1/encryption_info_pb.rb +46 -0
  20. data/lib/google/ads/datamanager/v1/error_pb.rb +42 -0
  21. data/lib/google/ads/datamanager/v1/event_pb.rb +61 -0
  22. data/lib/google/ads/datamanager/v1/experimental_field_pb.rb +44 -0
  23. data/lib/google/ads/datamanager/v1/ingestion_service_pb.rb +68 -0
  24. data/lib/google/ads/datamanager/v1/ingestion_service_services_pb.rb +57 -0
  25. data/lib/google/ads/datamanager/v1/match_rate_pb.rb +42 -0
  26. data/lib/google/ads/datamanager/v1/processing_errors_pb.rb +47 -0
  27. data/lib/google/ads/datamanager/v1/request_status_per_destination_pb.rb +58 -0
  28. data/lib/google/ads/datamanager/v1/terms_of_service_pb.rb +45 -0
  29. data/lib/google/ads/datamanager/v1/user_data_pb.rb +46 -0
  30. data/lib/google/ads/datamanager/v1/user_properties_pb.rb +46 -0
  31. data/lib/google-ads-data_manager-v1.rb +21 -0
  32. data/proto_docs/README.md +4 -0
  33. data/proto_docs/google/ads/datamanager/v1/audience.rb +81 -0
  34. data/proto_docs/google/ads/datamanager/v1/cart_data.rb +65 -0
  35. data/proto_docs/google/ads/datamanager/v1/consent.rb +52 -0
  36. data/proto_docs/google/ads/datamanager/v1/destination.rb +124 -0
  37. data/proto_docs/google/ads/datamanager/v1/device_info.rb +48 -0
  38. data/proto_docs/google/ads/datamanager/v1/encryption_info.rb +68 -0
  39. data/proto_docs/google/ads/datamanager/v1/error.rb +151 -0
  40. data/proto_docs/google/ads/datamanager/v1/event.rb +157 -0
  41. data/proto_docs/google/ads/datamanager/v1/experimental_field.rb +38 -0
  42. data/proto_docs/google/ads/datamanager/v1/ingestion_service.rb +201 -0
  43. data/proto_docs/google/ads/datamanager/v1/match_rate.rb +63 -0
  44. data/proto_docs/google/ads/datamanager/v1/processing_errors.rb +196 -0
  45. data/proto_docs/google/ads/datamanager/v1/request_status_per_destination.rb +234 -0
  46. data/proto_docs/google/ads/datamanager/v1/terms_of_service.rb +52 -0
  47. data/proto_docs/google/ads/datamanager/v1/user_data.rb +84 -0
  48. data/proto_docs/google/ads/datamanager/v1/user_properties.rb +70 -0
  49. data/proto_docs/google/api/client.rb +473 -0
  50. data/proto_docs/google/api/field_behavior.rb +85 -0
  51. data/proto_docs/google/api/launch_stage.rb +71 -0
  52. data/proto_docs/google/api/resource.rb +227 -0
  53. data/proto_docs/google/protobuf/duration.rb +98 -0
  54. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  55. metadata +88 -9
@@ -0,0 +1,787 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/ads/datamanager/v1/ingestion_service_pb"
21
+
22
+ module Google
23
+ module Ads
24
+ module DataManager
25
+ module V1
26
+ module IngestionService
27
+ ##
28
+ # Client for the IngestionService service.
29
+ #
30
+ # Service for sending audience data to supported destinations.
31
+ #
32
+ class Client
33
+ # @private
34
+ API_VERSION = ""
35
+
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "datamanager.$UNIVERSE_DOMAIN$"
38
+
39
+ # @private
40
+ attr_reader :ingestion_service_stub
41
+
42
+ ##
43
+ # Configure the IngestionService Client class.
44
+ #
45
+ # See {::Google::Ads::DataManager::V1::IngestionService::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all IngestionService clients
51
+ # ::Google::Ads::DataManager::V1::IngestionService::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Ads", "DataManager", "V1"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config
72
+ end
73
+ yield @configure if block_given?
74
+ @configure
75
+ end
76
+
77
+ ##
78
+ # Configure the IngestionService Client instance.
79
+ #
80
+ # The configuration is set to the derived mode, meaning that values can be changed,
81
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
82
+ # should be made on {Client.configure}.
83
+ #
84
+ # See {::Google::Ads::DataManager::V1::IngestionService::Client::Configuration}
85
+ # for a description of the configuration fields.
86
+ #
87
+ # @yield [config] Configure the Client client.
88
+ # @yieldparam config [Client::Configuration]
89
+ #
90
+ # @return [Client::Configuration]
91
+ #
92
+ def configure
93
+ yield @config if block_given?
94
+ @config
95
+ end
96
+
97
+ ##
98
+ # The effective universe domain
99
+ #
100
+ # @return [String]
101
+ #
102
+ def universe_domain
103
+ @ingestion_service_stub.universe_domain
104
+ end
105
+
106
+ ##
107
+ # Create a new IngestionService client object.
108
+ #
109
+ # @example
110
+ #
111
+ # # Create a client using the default configuration
112
+ # client = ::Google::Ads::DataManager::V1::IngestionService::Client.new
113
+ #
114
+ # # Create a client using a custom configuration
115
+ # client = ::Google::Ads::DataManager::V1::IngestionService::Client.new do |config|
116
+ # config.timeout = 10.0
117
+ # end
118
+ #
119
+ # @yield [config] Configure the IngestionService client.
120
+ # @yieldparam config [Client::Configuration]
121
+ #
122
+ def initialize
123
+ # These require statements are intentionally placed here to initialize
124
+ # the gRPC module only when it's required.
125
+ # See https://github.com/googleapis/toolkit/issues/446
126
+ require "gapic/grpc"
127
+ require "google/ads/datamanager/v1/ingestion_service_services_pb"
128
+
129
+ # Create the configuration object
130
+ @config = Configuration.new Client.configure
131
+
132
+ # Yield the configuration if needed
133
+ yield @config if block_given?
134
+
135
+ # Create credentials
136
+ credentials = @config.credentials
137
+ # Use self-signed JWT if the endpoint is unchanged from default,
138
+ # but only if the default endpoint does not have a region prefix.
139
+ enable_self_signed_jwt = @config.endpoint.nil? ||
140
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
+ !@config.endpoint.split(".").first.include?("-"))
142
+ credentials ||= Credentials.default scope: @config.scope,
143
+ enable_self_signed_jwt: enable_self_signed_jwt
144
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
+ credentials = Credentials.new credentials, scope: @config.scope
146
+ end
147
+ @quota_project_id = @config.quota_project
148
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
149
+
150
+ @ingestion_service_stub = ::Gapic::ServiceStub.new(
151
+ ::Google::Ads::DataManager::V1::IngestionService::Stub,
152
+ credentials: credentials,
153
+ endpoint: @config.endpoint,
154
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
155
+ universe_domain: @config.universe_domain,
156
+ channel_args: @config.channel_args,
157
+ interceptors: @config.interceptors,
158
+ channel_pool_config: @config.channel_pool,
159
+ logger: @config.logger
160
+ )
161
+
162
+ @ingestion_service_stub.stub_logger&.info do |entry|
163
+ entry.set_system_name
164
+ entry.set_service
165
+ entry.message = "Created client for #{entry.service}"
166
+ entry.set_credentials_fields credentials
167
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
168
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
169
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
170
+ end
171
+ end
172
+
173
+ ##
174
+ # The logger used for request/response debug logging.
175
+ #
176
+ # @return [Logger]
177
+ #
178
+ def logger
179
+ @ingestion_service_stub.logger
180
+ end
181
+
182
+ # Service calls
183
+
184
+ ##
185
+ # Uploads a list of
186
+ # {::Google::Ads::DataManager::V1::AudienceMember AudienceMember} resources to the
187
+ # provided {::Google::Ads::DataManager::V1::Destination Destination}.
188
+ #
189
+ # @overload ingest_audience_members(request, options = nil)
190
+ # Pass arguments to `ingest_audience_members` via a request object, either of type
191
+ # {::Google::Ads::DataManager::V1::IngestAudienceMembersRequest} or an equivalent Hash.
192
+ #
193
+ # @param request [::Google::Ads::DataManager::V1::IngestAudienceMembersRequest, ::Hash]
194
+ # A request object representing the call parameters. Required. To specify no
195
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
196
+ # @param options [::Gapic::CallOptions, ::Hash]
197
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
198
+ #
199
+ # @overload ingest_audience_members(destinations: nil, audience_members: nil, consent: nil, validate_only: nil, encoding: nil, encryption_info: nil, terms_of_service: nil)
200
+ # Pass arguments to `ingest_audience_members` via keyword arguments. Note that at
201
+ # least one keyword argument is required. To specify no parameters, or to keep all
202
+ # the default parameter values, pass an empty Hash as a request object (see above).
203
+ #
204
+ # @param destinations [::Array<::Google::Ads::DataManager::V1::Destination, ::Hash>]
205
+ # Required. The list of destinations to send the audience members to.
206
+ # @param audience_members [::Array<::Google::Ads::DataManager::V1::AudienceMember, ::Hash>]
207
+ # Required. The list of users to send to the specified destinations. At most
208
+ # 10000 {::Google::Ads::DataManager::V1::AudienceMember AudienceMember} resources
209
+ # can be sent in a single request.
210
+ # @param consent [::Google::Ads::DataManager::V1::Consent, ::Hash]
211
+ # Optional. Request-level consent to apply to all users in the request.
212
+ # User-level consent overrides request-level consent, and can be specified in
213
+ # each {::Google::Ads::DataManager::V1::AudienceMember AudienceMember}.
214
+ # @param validate_only [::Boolean]
215
+ # Optional. For testing purposes. If `true`, the request is validated but not
216
+ # executed. Only errors are returned, not results.
217
+ # @param encoding [::Google::Ads::DataManager::V1::Encoding]
218
+ # Optional. Required for {::Google::Ads::DataManager::V1::UserData UserData}
219
+ # uploads. The encoding type of the user identifiers. For hashed user
220
+ # identifiers, this is the encoding type of the hashed string. For encrypted
221
+ # hashed user identifiers, this is the encoding type of the outer encrypted
222
+ # string, but not necessarily the inner hashed string, meaning the inner
223
+ # hashed string could be encoded in a different way than the outer encrypted
224
+ # string. For non `UserData` uploads, this field is ignored.
225
+ # @param encryption_info [::Google::Ads::DataManager::V1::EncryptionInfo, ::Hash]
226
+ # Optional. Encryption information for
227
+ # {::Google::Ads::DataManager::V1::UserData UserData} uploads. If not set, it's
228
+ # assumed that uploaded identifying information is hashed but not encrypted.
229
+ # For non `UserData` uploads, this field is ignored.
230
+ # @param terms_of_service [::Google::Ads::DataManager::V1::TermsOfService, ::Hash]
231
+ # Optional. The terms of service that the user has accepted/rejected.
232
+ #
233
+ # @yield [response, operation] Access the result along with the RPC operation
234
+ # @yieldparam response [::Google::Ads::DataManager::V1::IngestAudienceMembersResponse]
235
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
236
+ #
237
+ # @return [::Google::Ads::DataManager::V1::IngestAudienceMembersResponse]
238
+ #
239
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
240
+ #
241
+ # @example Basic example
242
+ # require "google/ads/data_manager/v1"
243
+ #
244
+ # # Create a client object. The client can be reused for multiple calls.
245
+ # client = Google::Ads::DataManager::V1::IngestionService::Client.new
246
+ #
247
+ # # Create a request. To set request fields, pass in keyword arguments.
248
+ # request = Google::Ads::DataManager::V1::IngestAudienceMembersRequest.new
249
+ #
250
+ # # Call the ingest_audience_members method.
251
+ # result = client.ingest_audience_members request
252
+ #
253
+ # # The returned object is of type Google::Ads::DataManager::V1::IngestAudienceMembersResponse.
254
+ # p result
255
+ #
256
+ def ingest_audience_members request, options = nil
257
+ raise ::ArgumentError, "request must be provided" if request.nil?
258
+
259
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::DataManager::V1::IngestAudienceMembersRequest
260
+
261
+ # Converts hash and nil to an options object
262
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
263
+
264
+ # Customize the options with defaults
265
+ metadata = @config.rpcs.ingest_audience_members.metadata.to_h
266
+
267
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
268
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
269
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
270
+ gapic_version: ::Google::Ads::DataManager::V1::VERSION
271
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
272
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
273
+
274
+ options.apply_defaults timeout: @config.rpcs.ingest_audience_members.timeout,
275
+ metadata: metadata,
276
+ retry_policy: @config.rpcs.ingest_audience_members.retry_policy
277
+
278
+ options.apply_defaults timeout: @config.timeout,
279
+ metadata: @config.metadata,
280
+ retry_policy: @config.retry_policy
281
+
282
+ @ingestion_service_stub.call_rpc :ingest_audience_members, request, options: options do |response, operation|
283
+ yield response, operation if block_given?
284
+ end
285
+ rescue ::GRPC::BadStatus => e
286
+ raise ::Google::Cloud::Error.from_error(e)
287
+ end
288
+
289
+ ##
290
+ # Removes a list of
291
+ # {::Google::Ads::DataManager::V1::AudienceMember AudienceMember} resources from
292
+ # the provided {::Google::Ads::DataManager::V1::Destination Destination}.
293
+ #
294
+ # @overload remove_audience_members(request, options = nil)
295
+ # Pass arguments to `remove_audience_members` via a request object, either of type
296
+ # {::Google::Ads::DataManager::V1::RemoveAudienceMembersRequest} or an equivalent Hash.
297
+ #
298
+ # @param request [::Google::Ads::DataManager::V1::RemoveAudienceMembersRequest, ::Hash]
299
+ # A request object representing the call parameters. Required. To specify no
300
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
301
+ # @param options [::Gapic::CallOptions, ::Hash]
302
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
303
+ #
304
+ # @overload remove_audience_members(destinations: nil, audience_members: nil, validate_only: nil, encoding: nil, encryption_info: nil)
305
+ # Pass arguments to `remove_audience_members` via keyword arguments. Note that at
306
+ # least one keyword argument is required. To specify no parameters, or to keep all
307
+ # the default parameter values, pass an empty Hash as a request object (see above).
308
+ #
309
+ # @param destinations [::Array<::Google::Ads::DataManager::V1::Destination, ::Hash>]
310
+ # Required. The list of destinations to remove the users from.
311
+ # @param audience_members [::Array<::Google::Ads::DataManager::V1::AudienceMember, ::Hash>]
312
+ # Required. The list of users to remove.
313
+ # @param validate_only [::Boolean]
314
+ # Optional. For testing purposes. If `true`, the request is validated but not
315
+ # executed. Only errors are returned, not results.
316
+ # @param encoding [::Google::Ads::DataManager::V1::Encoding]
317
+ # Optional. Required for {::Google::Ads::DataManager::V1::UserData UserData}
318
+ # uploads. The encoding type of the user identifiers. Applies to only the
319
+ # outer encoding for encrypted user identifiers. For non `UserData` uploads,
320
+ # this field is ignored.
321
+ # @param encryption_info [::Google::Ads::DataManager::V1::EncryptionInfo, ::Hash]
322
+ # Optional. Encryption information for
323
+ # {::Google::Ads::DataManager::V1::UserData UserData} uploads. If not set, it's
324
+ # assumed that uploaded identifying information is hashed but not encrypted.
325
+ # For non `UserData` uploads, this field is ignored.
326
+ #
327
+ # @yield [response, operation] Access the result along with the RPC operation
328
+ # @yieldparam response [::Google::Ads::DataManager::V1::RemoveAudienceMembersResponse]
329
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
330
+ #
331
+ # @return [::Google::Ads::DataManager::V1::RemoveAudienceMembersResponse]
332
+ #
333
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
334
+ #
335
+ # @example Basic example
336
+ # require "google/ads/data_manager/v1"
337
+ #
338
+ # # Create a client object. The client can be reused for multiple calls.
339
+ # client = Google::Ads::DataManager::V1::IngestionService::Client.new
340
+ #
341
+ # # Create a request. To set request fields, pass in keyword arguments.
342
+ # request = Google::Ads::DataManager::V1::RemoveAudienceMembersRequest.new
343
+ #
344
+ # # Call the remove_audience_members method.
345
+ # result = client.remove_audience_members request
346
+ #
347
+ # # The returned object is of type Google::Ads::DataManager::V1::RemoveAudienceMembersResponse.
348
+ # p result
349
+ #
350
+ def remove_audience_members request, options = nil
351
+ raise ::ArgumentError, "request must be provided" if request.nil?
352
+
353
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::DataManager::V1::RemoveAudienceMembersRequest
354
+
355
+ # Converts hash and nil to an options object
356
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
357
+
358
+ # Customize the options with defaults
359
+ metadata = @config.rpcs.remove_audience_members.metadata.to_h
360
+
361
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
362
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
363
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
364
+ gapic_version: ::Google::Ads::DataManager::V1::VERSION
365
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
366
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
367
+
368
+ options.apply_defaults timeout: @config.rpcs.remove_audience_members.timeout,
369
+ metadata: metadata,
370
+ retry_policy: @config.rpcs.remove_audience_members.retry_policy
371
+
372
+ options.apply_defaults timeout: @config.timeout,
373
+ metadata: @config.metadata,
374
+ retry_policy: @config.retry_policy
375
+
376
+ @ingestion_service_stub.call_rpc :remove_audience_members, request, options: options do |response, operation|
377
+ yield response, operation if block_given?
378
+ end
379
+ rescue ::GRPC::BadStatus => e
380
+ raise ::Google::Cloud::Error.from_error(e)
381
+ end
382
+
383
+ ##
384
+ # Uploads a list of
385
+ # {::Google::Ads::DataManager::V1::Event Event} resources from
386
+ # the provided {::Google::Ads::DataManager::V1::Destination Destination}.
387
+ #
388
+ # @overload ingest_events(request, options = nil)
389
+ # Pass arguments to `ingest_events` via a request object, either of type
390
+ # {::Google::Ads::DataManager::V1::IngestEventsRequest} or an equivalent Hash.
391
+ #
392
+ # @param request [::Google::Ads::DataManager::V1::IngestEventsRequest, ::Hash]
393
+ # A request object representing the call parameters. Required. To specify no
394
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
395
+ # @param options [::Gapic::CallOptions, ::Hash]
396
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
397
+ #
398
+ # @overload ingest_events(destinations: nil, events: nil, consent: nil, validate_only: nil, encoding: nil, encryption_info: nil)
399
+ # Pass arguments to `ingest_events` via keyword arguments. Note that at
400
+ # least one keyword argument is required. To specify no parameters, or to keep all
401
+ # the default parameter values, pass an empty Hash as a request object (see above).
402
+ #
403
+ # @param destinations [::Array<::Google::Ads::DataManager::V1::Destination, ::Hash>]
404
+ # Required. The list of destinations to send the events to.
405
+ # @param events [::Array<::Google::Ads::DataManager::V1::Event, ::Hash>]
406
+ # Required. The list of events to send to the specified destinations. At most
407
+ # 2000 {::Google::Ads::DataManager::V1::Event Event} resources
408
+ # can be sent in a single request.
409
+ # @param consent [::Google::Ads::DataManager::V1::Consent, ::Hash]
410
+ # Optional. Request-level consent to apply to all users in the request.
411
+ # User-level consent overrides request-level consent, and can be specified in
412
+ # each {::Google::Ads::DataManager::V1::Event Event}.
413
+ # @param validate_only [::Boolean]
414
+ # Optional. For testing purposes. If `true`, the request is validated but not
415
+ # executed. Only errors are returned, not results.
416
+ # @param encoding [::Google::Ads::DataManager::V1::Encoding]
417
+ # Optional. Required for {::Google::Ads::DataManager::V1::UserData UserData}
418
+ # uploads. The encoding type of the user identifiers. For hashed user
419
+ # identifiers, this is the encoding type of the hashed string. For encrypted
420
+ # hashed user identifiers, this is the encoding type of the outer encrypted
421
+ # string, but not necessarily the inner hashed string, meaning the inner
422
+ # hashed string could be encoded in a different way than the outer encrypted
423
+ # string. For non `UserData` uploads, this field is ignored.
424
+ # @param encryption_info [::Google::Ads::DataManager::V1::EncryptionInfo, ::Hash]
425
+ # Optional. Encryption information for
426
+ # {::Google::Ads::DataManager::V1::UserData UserData} uploads. If not set, it's
427
+ # assumed that uploaded identifying information is hashed but not encrypted.
428
+ # For non `UserData` uploads, this field is ignored.
429
+ #
430
+ # @yield [response, operation] Access the result along with the RPC operation
431
+ # @yieldparam response [::Google::Ads::DataManager::V1::IngestEventsResponse]
432
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
433
+ #
434
+ # @return [::Google::Ads::DataManager::V1::IngestEventsResponse]
435
+ #
436
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
437
+ #
438
+ # @example Basic example
439
+ # require "google/ads/data_manager/v1"
440
+ #
441
+ # # Create a client object. The client can be reused for multiple calls.
442
+ # client = Google::Ads::DataManager::V1::IngestionService::Client.new
443
+ #
444
+ # # Create a request. To set request fields, pass in keyword arguments.
445
+ # request = Google::Ads::DataManager::V1::IngestEventsRequest.new
446
+ #
447
+ # # Call the ingest_events method.
448
+ # result = client.ingest_events request
449
+ #
450
+ # # The returned object is of type Google::Ads::DataManager::V1::IngestEventsResponse.
451
+ # p result
452
+ #
453
+ def ingest_events request, options = nil
454
+ raise ::ArgumentError, "request must be provided" if request.nil?
455
+
456
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::DataManager::V1::IngestEventsRequest
457
+
458
+ # Converts hash and nil to an options object
459
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
460
+
461
+ # Customize the options with defaults
462
+ metadata = @config.rpcs.ingest_events.metadata.to_h
463
+
464
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
465
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
466
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
467
+ gapic_version: ::Google::Ads::DataManager::V1::VERSION
468
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
469
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
470
+
471
+ options.apply_defaults timeout: @config.rpcs.ingest_events.timeout,
472
+ metadata: metadata,
473
+ retry_policy: @config.rpcs.ingest_events.retry_policy
474
+
475
+ options.apply_defaults timeout: @config.timeout,
476
+ metadata: @config.metadata,
477
+ retry_policy: @config.retry_policy
478
+
479
+ @ingestion_service_stub.call_rpc :ingest_events, request, options: options do |response, operation|
480
+ yield response, operation if block_given?
481
+ end
482
+ rescue ::GRPC::BadStatus => e
483
+ raise ::Google::Cloud::Error.from_error(e)
484
+ end
485
+
486
+ ##
487
+ # Gets the status of a request given request id.
488
+ #
489
+ # @overload retrieve_request_status(request, options = nil)
490
+ # Pass arguments to `retrieve_request_status` via a request object, either of type
491
+ # {::Google::Ads::DataManager::V1::RetrieveRequestStatusRequest} or an equivalent Hash.
492
+ #
493
+ # @param request [::Google::Ads::DataManager::V1::RetrieveRequestStatusRequest, ::Hash]
494
+ # A request object representing the call parameters. Required. To specify no
495
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
496
+ # @param options [::Gapic::CallOptions, ::Hash]
497
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
498
+ #
499
+ # @overload retrieve_request_status(request_id: nil)
500
+ # Pass arguments to `retrieve_request_status` via keyword arguments. Note that at
501
+ # least one keyword argument is required. To specify no parameters, or to keep all
502
+ # the default parameter values, pass an empty Hash as a request object (see above).
503
+ #
504
+ # @param request_id [::String]
505
+ # Required. Required. The request ID of the Data Manager API request.
506
+ #
507
+ # @yield [response, operation] Access the result along with the RPC operation
508
+ # @yieldparam response [::Google::Ads::DataManager::V1::RetrieveRequestStatusResponse]
509
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
510
+ #
511
+ # @return [::Google::Ads::DataManager::V1::RetrieveRequestStatusResponse]
512
+ #
513
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
514
+ #
515
+ # @example Basic example
516
+ # require "google/ads/data_manager/v1"
517
+ #
518
+ # # Create a client object. The client can be reused for multiple calls.
519
+ # client = Google::Ads::DataManager::V1::IngestionService::Client.new
520
+ #
521
+ # # Create a request. To set request fields, pass in keyword arguments.
522
+ # request = Google::Ads::DataManager::V1::RetrieveRequestStatusRequest.new
523
+ #
524
+ # # Call the retrieve_request_status method.
525
+ # result = client.retrieve_request_status request
526
+ #
527
+ # # The returned object is of type Google::Ads::DataManager::V1::RetrieveRequestStatusResponse.
528
+ # p result
529
+ #
530
+ def retrieve_request_status request, options = nil
531
+ raise ::ArgumentError, "request must be provided" if request.nil?
532
+
533
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::DataManager::V1::RetrieveRequestStatusRequest
534
+
535
+ # Converts hash and nil to an options object
536
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
537
+
538
+ # Customize the options with defaults
539
+ metadata = @config.rpcs.retrieve_request_status.metadata.to_h
540
+
541
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
542
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
543
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
544
+ gapic_version: ::Google::Ads::DataManager::V1::VERSION
545
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
546
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
547
+
548
+ options.apply_defaults timeout: @config.rpcs.retrieve_request_status.timeout,
549
+ metadata: metadata,
550
+ retry_policy: @config.rpcs.retrieve_request_status.retry_policy
551
+
552
+ options.apply_defaults timeout: @config.timeout,
553
+ metadata: @config.metadata,
554
+ retry_policy: @config.retry_policy
555
+
556
+ @ingestion_service_stub.call_rpc :retrieve_request_status, request, options: options do |response, operation|
557
+ yield response, operation if block_given?
558
+ end
559
+ rescue ::GRPC::BadStatus => e
560
+ raise ::Google::Cloud::Error.from_error(e)
561
+ end
562
+
563
+ ##
564
+ # Configuration class for the IngestionService API.
565
+ #
566
+ # This class represents the configuration for IngestionService,
567
+ # providing control over timeouts, retry behavior, logging, transport
568
+ # parameters, and other low-level controls. Certain parameters can also be
569
+ # applied individually to specific RPCs. See
570
+ # {::Google::Ads::DataManager::V1::IngestionService::Client::Configuration::Rpcs}
571
+ # for a list of RPCs that can be configured independently.
572
+ #
573
+ # Configuration can be applied globally to all clients, or to a single client
574
+ # on construction.
575
+ #
576
+ # @example
577
+ #
578
+ # # Modify the global config, setting the timeout for
579
+ # # ingest_audience_members to 20 seconds,
580
+ # # and all remaining timeouts to 10 seconds.
581
+ # ::Google::Ads::DataManager::V1::IngestionService::Client.configure do |config|
582
+ # config.timeout = 10.0
583
+ # config.rpcs.ingest_audience_members.timeout = 20.0
584
+ # end
585
+ #
586
+ # # Apply the above configuration only to a new client.
587
+ # client = ::Google::Ads::DataManager::V1::IngestionService::Client.new do |config|
588
+ # config.timeout = 10.0
589
+ # config.rpcs.ingest_audience_members.timeout = 20.0
590
+ # end
591
+ #
592
+ # @!attribute [rw] endpoint
593
+ # A custom service endpoint, as a hostname or hostname:port. The default is
594
+ # nil, indicating to use the default endpoint in the current universe domain.
595
+ # @return [::String,nil]
596
+ # @!attribute [rw] credentials
597
+ # Credentials to send with calls. You may provide any of the following types:
598
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
599
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
600
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
601
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
602
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
603
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
604
+ # * (`nil`) indicating no credentials
605
+ #
606
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
607
+ # is deprecated. Providing an unvalidated credential configuration to
608
+ # Google APIs can compromise the security of your systems and data.
609
+ #
610
+ # @example
611
+ #
612
+ # # The recommended way to provide credentials is to use the `make_creds` method
613
+ # # on the appropriate credentials class for your environment.
614
+ #
615
+ # require "googleauth"
616
+ #
617
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
618
+ # json_key_io: ::File.open("/path/to/keyfile.json")
619
+ # )
620
+ #
621
+ # client = ::Google::Ads::DataManager::V1::IngestionService::Client.new do |config|
622
+ # config.credentials = credentials
623
+ # end
624
+ #
625
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
626
+ # external source for authentication to Google Cloud, you must validate it before
627
+ # providing it to a Google API client library. Providing an unvalidated credential
628
+ # configuration to Google APIs can compromise the security of your systems and data.
629
+ # For more information, refer to [Validate credential configurations from external
630
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
631
+ # @return [::Object]
632
+ # @!attribute [rw] scope
633
+ # The OAuth scopes
634
+ # @return [::Array<::String>]
635
+ # @!attribute [rw] lib_name
636
+ # The library name as recorded in instrumentation and logging
637
+ # @return [::String]
638
+ # @!attribute [rw] lib_version
639
+ # The library version as recorded in instrumentation and logging
640
+ # @return [::String]
641
+ # @!attribute [rw] channel_args
642
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
643
+ # `GRPC::Core::Channel` object is provided as the credential.
644
+ # @return [::Hash]
645
+ # @!attribute [rw] interceptors
646
+ # An array of interceptors that are run before calls are executed.
647
+ # @return [::Array<::GRPC::ClientInterceptor>]
648
+ # @!attribute [rw] timeout
649
+ # The call timeout in seconds.
650
+ # @return [::Numeric]
651
+ # @!attribute [rw] metadata
652
+ # Additional gRPC headers to be sent with the call.
653
+ # @return [::Hash{::Symbol=>::String}]
654
+ # @!attribute [rw] retry_policy
655
+ # The retry policy. The value is a hash with the following keys:
656
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
657
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
658
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
659
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
660
+ # trigger a retry.
661
+ # @return [::Hash]
662
+ # @!attribute [rw] quota_project
663
+ # A separate project against which to charge quota.
664
+ # @return [::String]
665
+ # @!attribute [rw] universe_domain
666
+ # The universe domain within which to make requests. This determines the
667
+ # default endpoint URL. The default value of nil uses the environment
668
+ # universe (usually the default "googleapis.com" universe).
669
+ # @return [::String,nil]
670
+ # @!attribute [rw] logger
671
+ # A custom logger to use for request/response debug logging, or the value
672
+ # `:default` (the default) to construct a default logger, or `nil` to
673
+ # explicitly disable logging.
674
+ # @return [::Logger,:default,nil]
675
+ #
676
+ class Configuration
677
+ extend ::Gapic::Config
678
+
679
+ # @private
680
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
681
+ DEFAULT_ENDPOINT = "datamanager.googleapis.com"
682
+
683
+ config_attr :endpoint, nil, ::String, nil
684
+ config_attr :credentials, nil do |value|
685
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
686
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
687
+ allowed.any? { |klass| klass === value }
688
+ end
689
+ config_attr :scope, nil, ::String, ::Array, nil
690
+ config_attr :lib_name, nil, ::String, nil
691
+ config_attr :lib_version, nil, ::String, nil
692
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
693
+ config_attr :interceptors, nil, ::Array, nil
694
+ config_attr :timeout, nil, ::Numeric, nil
695
+ config_attr :metadata, nil, ::Hash, nil
696
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
697
+ config_attr :quota_project, nil, ::String, nil
698
+ config_attr :universe_domain, nil, ::String, nil
699
+ config_attr :logger, :default, ::Logger, nil, :default
700
+
701
+ # @private
702
+ def initialize parent_config = nil
703
+ @parent_config = parent_config unless parent_config.nil?
704
+
705
+ yield self if block_given?
706
+ end
707
+
708
+ ##
709
+ # Configurations for individual RPCs
710
+ # @return [Rpcs]
711
+ #
712
+ def rpcs
713
+ @rpcs ||= begin
714
+ parent_rpcs = nil
715
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
716
+ Rpcs.new parent_rpcs
717
+ end
718
+ end
719
+
720
+ ##
721
+ # Configuration for the channel pool
722
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
723
+ #
724
+ def channel_pool
725
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
726
+ end
727
+
728
+ ##
729
+ # Configuration RPC class for the IngestionService API.
730
+ #
731
+ # Includes fields providing the configuration for each RPC in this service.
732
+ # Each configuration object is of type `Gapic::Config::Method` and includes
733
+ # the following configuration fields:
734
+ #
735
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
736
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
737
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
738
+ # include the following keys:
739
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
740
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
741
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
742
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
743
+ # trigger a retry.
744
+ #
745
+ class Rpcs
746
+ ##
747
+ # RPC-specific configuration for `ingest_audience_members`
748
+ # @return [::Gapic::Config::Method]
749
+ #
750
+ attr_reader :ingest_audience_members
751
+ ##
752
+ # RPC-specific configuration for `remove_audience_members`
753
+ # @return [::Gapic::Config::Method]
754
+ #
755
+ attr_reader :remove_audience_members
756
+ ##
757
+ # RPC-specific configuration for `ingest_events`
758
+ # @return [::Gapic::Config::Method]
759
+ #
760
+ attr_reader :ingest_events
761
+ ##
762
+ # RPC-specific configuration for `retrieve_request_status`
763
+ # @return [::Gapic::Config::Method]
764
+ #
765
+ attr_reader :retrieve_request_status
766
+
767
+ # @private
768
+ def initialize parent_rpcs = nil
769
+ ingest_audience_members_config = parent_rpcs.ingest_audience_members if parent_rpcs.respond_to? :ingest_audience_members
770
+ @ingest_audience_members = ::Gapic::Config::Method.new ingest_audience_members_config
771
+ remove_audience_members_config = parent_rpcs.remove_audience_members if parent_rpcs.respond_to? :remove_audience_members
772
+ @remove_audience_members = ::Gapic::Config::Method.new remove_audience_members_config
773
+ ingest_events_config = parent_rpcs.ingest_events if parent_rpcs.respond_to? :ingest_events
774
+ @ingest_events = ::Gapic::Config::Method.new ingest_events_config
775
+ retrieve_request_status_config = parent_rpcs.retrieve_request_status if parent_rpcs.respond_to? :retrieve_request_status
776
+ @retrieve_request_status = ::Gapic::Config::Method.new retrieve_request_status_config
777
+
778
+ yield self if block_given?
779
+ end
780
+ end
781
+ end
782
+ end
783
+ end
784
+ end
785
+ end
786
+ end
787
+ end