google-ads-data_manager-v1 0.2.0 → 0.3.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 (99) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/ads/data_manager/v1/marketing_data_insights_service/client.rb +494 -0
  3. data/lib/google/ads/data_manager/v1/marketing_data_insights_service/credentials.rb +47 -0
  4. data/lib/google/ads/data_manager/v1/marketing_data_insights_service/rest/client.rb +444 -0
  5. data/lib/google/ads/data_manager/v1/marketing_data_insights_service/rest/service_stub.rb +143 -0
  6. data/lib/google/ads/data_manager/v1/marketing_data_insights_service/rest.rb +53 -0
  7. data/lib/google/ads/data_manager/v1/marketing_data_insights_service.rb +56 -0
  8. data/lib/google/ads/data_manager/v1/partner_link_service/client.rb +739 -0
  9. data/lib/google/ads/data_manager/v1/partner_link_service/credentials.rb +47 -0
  10. data/lib/google/ads/data_manager/v1/partner_link_service/paths.rb +69 -0
  11. data/lib/google/ads/data_manager/v1/partner_link_service/rest/client.rb +675 -0
  12. data/lib/google/ads/data_manager/v1/partner_link_service/rest/service_stub.rb +265 -0
  13. data/lib/google/ads/data_manager/v1/partner_link_service/rest.rb +52 -0
  14. data/lib/google/ads/data_manager/v1/partner_link_service.rb +55 -0
  15. data/lib/google/ads/data_manager/v1/rest.rb +5 -0
  16. data/lib/google/ads/data_manager/v1/user_list_direct_license_service/client.rb +813 -0
  17. data/lib/google/ads/data_manager/v1/user_list_direct_license_service/credentials.rb +47 -0
  18. data/lib/google/ads/data_manager/v1/user_list_direct_license_service/paths.rb +69 -0
  19. data/lib/google/ads/data_manager/v1/user_list_direct_license_service/rest/client.rb +742 -0
  20. data/lib/google/ads/data_manager/v1/user_list_direct_license_service/rest/service_stub.rb +327 -0
  21. data/lib/google/ads/data_manager/v1/user_list_direct_license_service/rest.rb +56 -0
  22. data/lib/google/ads/data_manager/v1/user_list_direct_license_service.rb +59 -0
  23. data/lib/google/ads/data_manager/v1/user_list_global_license_service/client.rb +955 -0
  24. data/lib/google/ads/data_manager/v1/user_list_global_license_service/credentials.rb +47 -0
  25. data/lib/google/ads/data_manager/v1/user_list_global_license_service/paths.rb +69 -0
  26. data/lib/google/ads/data_manager/v1/user_list_global_license_service/rest/client.rb +877 -0
  27. data/lib/google/ads/data_manager/v1/user_list_global_license_service/rest/service_stub.rb +388 -0
  28. data/lib/google/ads/data_manager/v1/user_list_global_license_service/rest.rb +56 -0
  29. data/lib/google/ads/data_manager/v1/user_list_global_license_service.rb +59 -0
  30. data/lib/google/ads/data_manager/v1/user_list_service/client.rb +972 -0
  31. data/lib/google/ads/data_manager/v1/user_list_service/credentials.rb +47 -0
  32. data/lib/google/ads/data_manager/v1/user_list_service/paths.rb +69 -0
  33. data/lib/google/ads/data_manager/v1/user_list_service/rest/client.rb +894 -0
  34. data/lib/google/ads/data_manager/v1/user_list_service/rest/service_stub.rb +388 -0
  35. data/lib/google/ads/data_manager/v1/user_list_service/rest.rb +52 -0
  36. data/lib/google/ads/data_manager/v1/user_list_service.rb +55 -0
  37. data/lib/google/ads/data_manager/v1/version.rb +1 -1
  38. data/lib/google/ads/data_manager/v1.rb +5 -0
  39. data/lib/google/ads/datamanager/v1/age_range_pb.rb +21 -0
  40. data/lib/google/ads/datamanager/v1/audience_pb.rb +5 -26
  41. data/lib/google/ads/datamanager/v1/cart_data_pb.rb +3 -25
  42. data/lib/google/ads/datamanager/v1/consent_pb.rb +3 -24
  43. data/lib/google/ads/datamanager/v1/destination_pb.rb +4 -24
  44. data/lib/google/ads/datamanager/v1/device_info_pb.rb +3 -24
  45. data/lib/google/ads/datamanager/v1/encryption_info_pb.rb +3 -24
  46. data/lib/google/ads/datamanager/v1/error_pb.rb +3 -24
  47. data/lib/google/ads/datamanager/v1/event_pb.rb +3 -31
  48. data/lib/google/ads/datamanager/v1/experimental_field_pb.rb +3 -24
  49. data/lib/google/ads/datamanager/v1/gender_pb.rb +21 -0
  50. data/lib/google/ads/datamanager/v1/ingestion_service_pb.rb +3 -31
  51. data/lib/google/ads/datamanager/v1/insights_service_pb.rb +33 -0
  52. data/lib/google/ads/datamanager/v1/insights_service_services_pb.rb +62 -0
  53. data/lib/google/ads/datamanager/v1/item_parameter_pb.rb +3 -24
  54. data/lib/google/ads/datamanager/v1/match_rate_pb.rb +3 -24
  55. data/lib/google/ads/datamanager/v1/partner_link_service_pb.rb +32 -0
  56. data/lib/google/ads/datamanager/v1/partner_link_service_services_pb.rb +79 -0
  57. data/lib/google/ads/datamanager/v1/processing_errors_pb.rb +3 -24
  58. data/lib/google/ads/datamanager/v1/request_status_per_destination_pb.rb +7 -26
  59. data/lib/google/ads/datamanager/v1/terms_of_service_pb.rb +3 -24
  60. data/lib/google/ads/datamanager/v1/user_data_pb.rb +3 -24
  61. data/lib/google/ads/datamanager/v1/user_list_direct_license_pb.rb +28 -0
  62. data/lib/google/ads/datamanager/v1/user_list_direct_license_service_pb.rb +32 -0
  63. data/lib/google/ads/datamanager/v1/user_list_direct_license_service_services_pb.rb +63 -0
  64. data/lib/google/ads/datamanager/v1/user_list_global_license_pb.rb +30 -0
  65. data/lib/google/ads/datamanager/v1/user_list_global_license_service_pb.rb +34 -0
  66. data/lib/google/ads/datamanager/v1/user_list_global_license_service_services_pb.rb +67 -0
  67. data/lib/google/ads/datamanager/v1/user_list_global_license_type_pb.rb +21 -0
  68. data/lib/google/ads/datamanager/v1/user_list_license_client_account_type_pb.rb +21 -0
  69. data/lib/google/ads/datamanager/v1/user_list_license_metrics_pb.rb +23 -0
  70. data/lib/google/ads/datamanager/v1/user_list_license_pricing_pb.rb +26 -0
  71. data/lib/google/ads/datamanager/v1/user_list_license_status_pb.rb +21 -0
  72. data/lib/google/ads/datamanager/v1/user_list_pb.rb +43 -0
  73. data/lib/google/ads/datamanager/v1/user_list_service_pb.rb +34 -0
  74. data/lib/google/ads/datamanager/v1/user_list_service_services_pb.rb +118 -0
  75. data/lib/google/ads/datamanager/v1/user_properties_pb.rb +3 -24
  76. data/proto_docs/google/ads/datamanager/v1/age_range.rb +53 -0
  77. data/proto_docs/google/ads/datamanager/v1/audience.rb +42 -3
  78. data/proto_docs/google/ads/datamanager/v1/destination.rb +3 -0
  79. data/proto_docs/google/ads/datamanager/v1/encryption_info.rb +6 -3
  80. data/proto_docs/google/ads/datamanager/v1/error.rb +159 -1
  81. data/proto_docs/google/ads/datamanager/v1/gender.rb +41 -0
  82. data/proto_docs/google/ads/datamanager/v1/insights_service.rb +133 -0
  83. data/proto_docs/google/ads/datamanager/v1/partner_link_service.rb +141 -0
  84. data/proto_docs/google/ads/datamanager/v1/request_status_per_destination.rb +92 -6
  85. data/proto_docs/google/ads/datamanager/v1/user_list.rb +397 -0
  86. data/proto_docs/google/ads/datamanager/v1/user_list_direct_license.rb +75 -0
  87. data/proto_docs/google/ads/datamanager/v1/user_list_direct_license_service.rb +134 -0
  88. data/proto_docs/google/ads/datamanager/v1/user_list_global_license.rb +114 -0
  89. data/proto_docs/google/ads/datamanager/v1/user_list_global_license_service.rb +204 -0
  90. data/proto_docs/google/ads/datamanager/v1/user_list_global_license_type.rb +41 -0
  91. data/proto_docs/google/ads/datamanager/v1/user_list_license_client_account_type.rb +44 -0
  92. data/proto_docs/google/ads/datamanager/v1/user_list_license_metrics.rb +55 -0
  93. data/proto_docs/google/ads/datamanager/v1/user_list_license_pricing.rb +108 -0
  94. data/proto_docs/google/ads/datamanager/v1/user_list_license_status.rb +38 -0
  95. data/proto_docs/google/ads/datamanager/v1/user_list_service.rb +151 -0
  96. data/proto_docs/google/api/client.rb +149 -29
  97. data/proto_docs/google/protobuf/empty.rb +34 -0
  98. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  99. metadata +73 -2
@@ -0,0 +1,739 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/partner_link_service_pb"
21
+
22
+ module Google
23
+ module Ads
24
+ module DataManager
25
+ module V1
26
+ module PartnerLinkService
27
+ ##
28
+ # Client for the PartnerLinkService service.
29
+ #
30
+ # Service for managing partner links.
31
+ #
32
+ class Client
33
+ # @private
34
+ API_VERSION = ""
35
+
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "datamanager.$UNIVERSE_DOMAIN$"
38
+
39
+ include Paths
40
+
41
+ # @private
42
+ attr_reader :partner_link_service_stub
43
+
44
+ ##
45
+ # Configure the PartnerLinkService Client class.
46
+ #
47
+ # See {::Google::Ads::DataManager::V1::PartnerLinkService::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all PartnerLinkService clients
53
+ # ::Google::Ads::DataManager::V1::PartnerLinkService::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Ads", "DataManager", "V1"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config
74
+ end
75
+ yield @configure if block_given?
76
+ @configure
77
+ end
78
+
79
+ ##
80
+ # Configure the PartnerLinkService Client instance.
81
+ #
82
+ # The configuration is set to the derived mode, meaning that values can be changed,
83
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
84
+ # should be made on {Client.configure}.
85
+ #
86
+ # See {::Google::Ads::DataManager::V1::PartnerLinkService::Client::Configuration}
87
+ # for a description of the configuration fields.
88
+ #
89
+ # @yield [config] Configure the Client client.
90
+ # @yieldparam config [Client::Configuration]
91
+ #
92
+ # @return [Client::Configuration]
93
+ #
94
+ def configure
95
+ yield @config if block_given?
96
+ @config
97
+ end
98
+
99
+ ##
100
+ # The effective universe domain
101
+ #
102
+ # @return [String]
103
+ #
104
+ def universe_domain
105
+ @partner_link_service_stub.universe_domain
106
+ end
107
+
108
+ ##
109
+ # Create a new PartnerLinkService client object.
110
+ #
111
+ # @example
112
+ #
113
+ # # Create a client using the default configuration
114
+ # client = ::Google::Ads::DataManager::V1::PartnerLinkService::Client.new
115
+ #
116
+ # # Create a client using a custom configuration
117
+ # client = ::Google::Ads::DataManager::V1::PartnerLinkService::Client.new do |config|
118
+ # config.timeout = 10.0
119
+ # end
120
+ #
121
+ # @yield [config] Configure the PartnerLinkService client.
122
+ # @yieldparam config [Client::Configuration]
123
+ #
124
+ def initialize
125
+ # These require statements are intentionally placed here to initialize
126
+ # the gRPC module only when it's required.
127
+ # See https://github.com/googleapis/toolkit/issues/446
128
+ require "gapic/grpc"
129
+ require "google/ads/datamanager/v1/partner_link_service_services_pb"
130
+
131
+ # Create the configuration object
132
+ @config = Configuration.new Client.configure
133
+
134
+ # Yield the configuration if needed
135
+ yield @config if block_given?
136
+
137
+ # Create credentials
138
+ credentials = @config.credentials
139
+ # Use self-signed JWT if the endpoint is unchanged from default,
140
+ # but only if the default endpoint does not have a region prefix.
141
+ enable_self_signed_jwt = @config.endpoint.nil? ||
142
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
143
+ !@config.endpoint.split(".").first.include?("-"))
144
+ credentials ||= Credentials.default scope: @config.scope,
145
+ enable_self_signed_jwt: enable_self_signed_jwt
146
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
147
+ credentials = Credentials.new credentials, scope: @config.scope
148
+ end
149
+ @quota_project_id = @config.quota_project
150
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
151
+
152
+ @partner_link_service_stub = ::Gapic::ServiceStub.new(
153
+ ::Google::Ads::DataManager::V1::PartnerLinkService::Stub,
154
+ credentials: credentials,
155
+ endpoint: @config.endpoint,
156
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
157
+ universe_domain: @config.universe_domain,
158
+ channel_args: @config.channel_args,
159
+ interceptors: @config.interceptors,
160
+ channel_pool_config: @config.channel_pool,
161
+ logger: @config.logger
162
+ )
163
+
164
+ @partner_link_service_stub.stub_logger&.info do |entry|
165
+ entry.set_system_name
166
+ entry.set_service
167
+ entry.message = "Created client for #{entry.service}"
168
+ entry.set_credentials_fields credentials
169
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
170
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
171
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
172
+ end
173
+ end
174
+
175
+ ##
176
+ # The logger used for request/response debug logging.
177
+ #
178
+ # @return [Logger]
179
+ #
180
+ def logger
181
+ @partner_link_service_stub.logger
182
+ end
183
+
184
+ # Service calls
185
+
186
+ ##
187
+ # Creates a partner link for the given account.
188
+ #
189
+ # Authorization Headers:
190
+ #
191
+ # This method supports the following optional headers to define how the API
192
+ # authorizes access for the request:
193
+ #
194
+ # * `login-account`: (Optional) The resource name of the account where the
195
+ # Google Account of the credentials is a user. If not set, defaults to the
196
+ # account of the request. Format:
197
+ # `accountTypes/{loginAccountType}/accounts/{loginAccountId}`
198
+ #
199
+ # @overload create_partner_link(request, options = nil)
200
+ # Pass arguments to `create_partner_link` via a request object, either of type
201
+ # {::Google::Ads::DataManager::V1::CreatePartnerLinkRequest} or an equivalent Hash.
202
+ #
203
+ # @param request [::Google::Ads::DataManager::V1::CreatePartnerLinkRequest, ::Hash]
204
+ # A request object representing the call parameters. Required. To specify no
205
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
206
+ # @param options [::Gapic::CallOptions, ::Hash]
207
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
208
+ #
209
+ # @overload create_partner_link(parent: nil, partner_link: nil)
210
+ # Pass arguments to `create_partner_link` via keyword arguments. Note that at
211
+ # least one keyword argument is required. To specify no parameters, or to keep all
212
+ # the default parameter values, pass an empty Hash as a request object (see above).
213
+ #
214
+ # @param parent [::String]
215
+ # Required. The parent, which owns this collection of partner links.
216
+ # Format: accountTypes/\\{account_type}/accounts/\\{account}
217
+ # @param partner_link [::Google::Ads::DataManager::V1::PartnerLink, ::Hash]
218
+ # Required. The partner link to create.
219
+ #
220
+ # @yield [response, operation] Access the result along with the RPC operation
221
+ # @yieldparam response [::Google::Ads::DataManager::V1::PartnerLink]
222
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
223
+ #
224
+ # @return [::Google::Ads::DataManager::V1::PartnerLink]
225
+ #
226
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
227
+ #
228
+ # @example Basic example
229
+ # require "google/ads/data_manager/v1"
230
+ #
231
+ # # Create a client object. The client can be reused for multiple calls.
232
+ # client = Google::Ads::DataManager::V1::PartnerLinkService::Client.new
233
+ #
234
+ # # Create a request. To set request fields, pass in keyword arguments.
235
+ # request = Google::Ads::DataManager::V1::CreatePartnerLinkRequest.new
236
+ #
237
+ # # Call the create_partner_link method.
238
+ # result = client.create_partner_link request
239
+ #
240
+ # # The returned object is of type Google::Ads::DataManager::V1::PartnerLink.
241
+ # p result
242
+ #
243
+ def create_partner_link request, options = nil
244
+ raise ::ArgumentError, "request must be provided" if request.nil?
245
+
246
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::DataManager::V1::CreatePartnerLinkRequest
247
+
248
+ # Converts hash and nil to an options object
249
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
250
+
251
+ # Customize the options with defaults
252
+ metadata = @config.rpcs.create_partner_link.metadata.to_h
253
+
254
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
255
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
256
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
257
+ gapic_version: ::Google::Ads::DataManager::V1::VERSION
258
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
259
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
260
+
261
+ header_params = {}
262
+ if request.parent
263
+ header_params["parent"] = request.parent
264
+ end
265
+
266
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
267
+ metadata[:"x-goog-request-params"] ||= request_params_header
268
+
269
+ options.apply_defaults timeout: @config.rpcs.create_partner_link.timeout,
270
+ metadata: metadata,
271
+ retry_policy: @config.rpcs.create_partner_link.retry_policy
272
+
273
+ options.apply_defaults timeout: @config.timeout,
274
+ metadata: @config.metadata,
275
+ retry_policy: @config.retry_policy
276
+
277
+ @partner_link_service_stub.call_rpc :create_partner_link, request, options: options do |response, operation|
278
+ yield response, operation if block_given?
279
+ end
280
+ rescue ::GRPC::BadStatus => e
281
+ raise ::Google::Cloud::Error.from_error(e)
282
+ end
283
+
284
+ ##
285
+ # Deletes a partner link for the given account.
286
+ #
287
+ # Authorization Headers:
288
+ #
289
+ # This method supports the following optional headers to define how the API
290
+ # authorizes access for the request:
291
+ #
292
+ # * `login-account`: (Optional) The resource name of the account where the
293
+ # Google Account of the credentials is a user. If not set, defaults to the
294
+ # account of the request. Format:
295
+ # `accountTypes/{loginAccountType}/accounts/{loginAccountId}`
296
+ #
297
+ # @overload delete_partner_link(request, options = nil)
298
+ # Pass arguments to `delete_partner_link` via a request object, either of type
299
+ # {::Google::Ads::DataManager::V1::DeletePartnerLinkRequest} or an equivalent Hash.
300
+ #
301
+ # @param request [::Google::Ads::DataManager::V1::DeletePartnerLinkRequest, ::Hash]
302
+ # A request object representing the call parameters. Required. To specify no
303
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
304
+ # @param options [::Gapic::CallOptions, ::Hash]
305
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
306
+ #
307
+ # @overload delete_partner_link(name: nil)
308
+ # Pass arguments to `delete_partner_link` via keyword arguments. Note that at
309
+ # least one keyword argument is required. To specify no parameters, or to keep all
310
+ # the default parameter values, pass an empty Hash as a request object (see above).
311
+ #
312
+ # @param name [::String]
313
+ # Required. The resource name of the partner link to delete.
314
+ # Format:
315
+ # accountTypes/\\{account_type}/accounts/\\{account}/partnerLinks/\\{partner_link}
316
+ #
317
+ # @yield [response, operation] Access the result along with the RPC operation
318
+ # @yieldparam response [::Google::Protobuf::Empty]
319
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
320
+ #
321
+ # @return [::Google::Protobuf::Empty]
322
+ #
323
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
324
+ #
325
+ # @example Basic example
326
+ # require "google/ads/data_manager/v1"
327
+ #
328
+ # # Create a client object. The client can be reused for multiple calls.
329
+ # client = Google::Ads::DataManager::V1::PartnerLinkService::Client.new
330
+ #
331
+ # # Create a request. To set request fields, pass in keyword arguments.
332
+ # request = Google::Ads::DataManager::V1::DeletePartnerLinkRequest.new
333
+ #
334
+ # # Call the delete_partner_link method.
335
+ # result = client.delete_partner_link request
336
+ #
337
+ # # The returned object is of type Google::Protobuf::Empty.
338
+ # p result
339
+ #
340
+ def delete_partner_link request, options = nil
341
+ raise ::ArgumentError, "request must be provided" if request.nil?
342
+
343
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::DataManager::V1::DeletePartnerLinkRequest
344
+
345
+ # Converts hash and nil to an options object
346
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
347
+
348
+ # Customize the options with defaults
349
+ metadata = @config.rpcs.delete_partner_link.metadata.to_h
350
+
351
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
352
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
353
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
354
+ gapic_version: ::Google::Ads::DataManager::V1::VERSION
355
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
356
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
357
+
358
+ header_params = {}
359
+ if request.name
360
+ header_params["name"] = request.name
361
+ end
362
+
363
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
364
+ metadata[:"x-goog-request-params"] ||= request_params_header
365
+
366
+ options.apply_defaults timeout: @config.rpcs.delete_partner_link.timeout,
367
+ metadata: metadata,
368
+ retry_policy: @config.rpcs.delete_partner_link.retry_policy
369
+
370
+ options.apply_defaults timeout: @config.timeout,
371
+ metadata: @config.metadata,
372
+ retry_policy: @config.retry_policy
373
+
374
+ @partner_link_service_stub.call_rpc :delete_partner_link, request, options: options do |response, operation|
375
+ yield response, operation if block_given?
376
+ end
377
+ rescue ::GRPC::BadStatus => e
378
+ raise ::Google::Cloud::Error.from_error(e)
379
+ end
380
+
381
+ ##
382
+ # Searches for all partner links to and from a given account.
383
+ #
384
+ # Authorization Headers:
385
+ #
386
+ # This method supports the following optional headers to define how the API
387
+ # authorizes access for the request:
388
+ #
389
+ # * `login-account`: (Optional) The resource name of the account where the
390
+ # Google Account of the credentials is a user. If not set, defaults to the
391
+ # account of the request. Format:
392
+ # `accountTypes/{loginAccountType}/accounts/{loginAccountId}`
393
+ #
394
+ # @overload search_partner_links(request, options = nil)
395
+ # Pass arguments to `search_partner_links` via a request object, either of type
396
+ # {::Google::Ads::DataManager::V1::SearchPartnerLinksRequest} or an equivalent Hash.
397
+ #
398
+ # @param request [::Google::Ads::DataManager::V1::SearchPartnerLinksRequest, ::Hash]
399
+ # A request object representing the call parameters. Required. To specify no
400
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
401
+ # @param options [::Gapic::CallOptions, ::Hash]
402
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
403
+ #
404
+ # @overload search_partner_links(parent: nil, page_size: nil, page_token: nil, filter: nil)
405
+ # Pass arguments to `search_partner_links` via keyword arguments. Note that at
406
+ # least one keyword argument is required. To specify no parameters, or to keep all
407
+ # the default parameter values, pass an empty Hash as a request object (see above).
408
+ #
409
+ # @param parent [::String]
410
+ # Required. Account to search for partner links. If no `filter` is specified,
411
+ # all partner links where this account is either the `owning_account` or
412
+ # `partner_account` are returned.
413
+ #
414
+ # Format: `accountTypes/{account_type}/accounts/{account}`
415
+ # @param page_size [::Integer]
416
+ # The maximum number of partner links to return. The service may return
417
+ # fewer than this value.
418
+ # If unspecified, at most 10 partner links will be returned.
419
+ # The maximum value is 100; values above 100 will be coerced to 100.
420
+ # @param page_token [::String]
421
+ # A page token, received from a previous `SearchPartnerLinks` call.
422
+ # Provide this to retrieve the subsequent page.
423
+ #
424
+ # When paginating, all other parameters provided to `SearchPartnerLinks`
425
+ # must match the call that provided the page token.
426
+ # @param filter [::String]
427
+ # Optional. A [filter string](https://google.aip.dev/160). All fields need to
428
+ # be on the left hand side of each condition (for example: `partner_link_id =
429
+ # 123456789`). Fields must be specified using either all [camel
430
+ # case](https://en.wikipedia.org/wiki/Camel_case) or all [snake
431
+ # case](https://en.wikipedia.org/wiki/Snake_case). Don't use a combination of
432
+ # camel case and snake case.
433
+ #
434
+ # Supported operations:
435
+ #
436
+ # - `AND`
437
+ # - `=`
438
+ # - `!=`
439
+ #
440
+ # Supported fields:
441
+ #
442
+ # - `partner_link_id`
443
+ # - `owning_account.account_type`
444
+ # - `owning_account.account_id`
445
+ # - `partner_account.account_type`
446
+ # - `partner_account.account_id`
447
+ #
448
+ # Example:
449
+ # `owning_account.account_type = "GOOGLE_ADS" AND partner_account.account_id
450
+ # = 987654321`
451
+ #
452
+ # @yield [response, operation] Access the result along with the RPC operation
453
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Ads::DataManager::V1::PartnerLink>]
454
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
455
+ #
456
+ # @return [::Gapic::PagedEnumerable<::Google::Ads::DataManager::V1::PartnerLink>]
457
+ #
458
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
459
+ #
460
+ # @example Basic example
461
+ # require "google/ads/data_manager/v1"
462
+ #
463
+ # # Create a client object. The client can be reused for multiple calls.
464
+ # client = Google::Ads::DataManager::V1::PartnerLinkService::Client.new
465
+ #
466
+ # # Create a request. To set request fields, pass in keyword arguments.
467
+ # request = Google::Ads::DataManager::V1::SearchPartnerLinksRequest.new
468
+ #
469
+ # # Call the search_partner_links method.
470
+ # result = client.search_partner_links request
471
+ #
472
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
473
+ # # over elements, and API calls will be issued to fetch pages as needed.
474
+ # result.each do |item|
475
+ # # Each element is of type ::Google::Ads::DataManager::V1::PartnerLink.
476
+ # p item
477
+ # end
478
+ #
479
+ def search_partner_links request, options = nil
480
+ raise ::ArgumentError, "request must be provided" if request.nil?
481
+
482
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::DataManager::V1::SearchPartnerLinksRequest
483
+
484
+ # Converts hash and nil to an options object
485
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
486
+
487
+ # Customize the options with defaults
488
+ metadata = @config.rpcs.search_partner_links.metadata.to_h
489
+
490
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
491
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
492
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
493
+ gapic_version: ::Google::Ads::DataManager::V1::VERSION
494
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
495
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
496
+
497
+ header_params = {}
498
+ if request.parent
499
+ header_params["parent"] = request.parent
500
+ end
501
+
502
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
503
+ metadata[:"x-goog-request-params"] ||= request_params_header
504
+
505
+ options.apply_defaults timeout: @config.rpcs.search_partner_links.timeout,
506
+ metadata: metadata,
507
+ retry_policy: @config.rpcs.search_partner_links.retry_policy
508
+
509
+ options.apply_defaults timeout: @config.timeout,
510
+ metadata: @config.metadata,
511
+ retry_policy: @config.retry_policy
512
+
513
+ @partner_link_service_stub.call_rpc :search_partner_links, request, options: options do |response, operation|
514
+ response = ::Gapic::PagedEnumerable.new @partner_link_service_stub, :search_partner_links, request, response, operation, options
515
+ yield response, operation if block_given?
516
+ throw :response, response
517
+ end
518
+ rescue ::GRPC::BadStatus => e
519
+ raise ::Google::Cloud::Error.from_error(e)
520
+ end
521
+
522
+ ##
523
+ # Configuration class for the PartnerLinkService API.
524
+ #
525
+ # This class represents the configuration for PartnerLinkService,
526
+ # providing control over timeouts, retry behavior, logging, transport
527
+ # parameters, and other low-level controls. Certain parameters can also be
528
+ # applied individually to specific RPCs. See
529
+ # {::Google::Ads::DataManager::V1::PartnerLinkService::Client::Configuration::Rpcs}
530
+ # for a list of RPCs that can be configured independently.
531
+ #
532
+ # Configuration can be applied globally to all clients, or to a single client
533
+ # on construction.
534
+ #
535
+ # @example
536
+ #
537
+ # # Modify the global config, setting the timeout for
538
+ # # create_partner_link to 20 seconds,
539
+ # # and all remaining timeouts to 10 seconds.
540
+ # ::Google::Ads::DataManager::V1::PartnerLinkService::Client.configure do |config|
541
+ # config.timeout = 10.0
542
+ # config.rpcs.create_partner_link.timeout = 20.0
543
+ # end
544
+ #
545
+ # # Apply the above configuration only to a new client.
546
+ # client = ::Google::Ads::DataManager::V1::PartnerLinkService::Client.new do |config|
547
+ # config.timeout = 10.0
548
+ # config.rpcs.create_partner_link.timeout = 20.0
549
+ # end
550
+ #
551
+ # @!attribute [rw] endpoint
552
+ # A custom service endpoint, as a hostname or hostname:port. The default is
553
+ # nil, indicating to use the default endpoint in the current universe domain.
554
+ # @return [::String,nil]
555
+ # @!attribute [rw] credentials
556
+ # Credentials to send with calls. You may provide any of the following types:
557
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
558
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
559
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
560
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
561
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
562
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
563
+ # * (`nil`) indicating no credentials
564
+ #
565
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
566
+ # is deprecated. Providing an unvalidated credential configuration to
567
+ # Google APIs can compromise the security of your systems and data.
568
+ #
569
+ # @example
570
+ #
571
+ # # The recommended way to provide credentials is to use the `make_creds` method
572
+ # # on the appropriate credentials class for your environment.
573
+ #
574
+ # require "googleauth"
575
+ #
576
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
577
+ # json_key_io: ::File.open("/path/to/keyfile.json")
578
+ # )
579
+ #
580
+ # client = ::Google::Ads::DataManager::V1::PartnerLinkService::Client.new do |config|
581
+ # config.credentials = credentials
582
+ # end
583
+ #
584
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
585
+ # external source for authentication to Google Cloud, you must validate it before
586
+ # providing it to a Google API client library. Providing an unvalidated credential
587
+ # configuration to Google APIs can compromise the security of your systems and data.
588
+ # For more information, refer to [Validate credential configurations from external
589
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
590
+ # @return [::Object]
591
+ # @!attribute [rw] scope
592
+ # The OAuth scopes
593
+ # @return [::Array<::String>]
594
+ # @!attribute [rw] lib_name
595
+ # The library name as recorded in instrumentation and logging
596
+ # @return [::String]
597
+ # @!attribute [rw] lib_version
598
+ # The library version as recorded in instrumentation and logging
599
+ # @return [::String]
600
+ # @!attribute [rw] channel_args
601
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
602
+ # `GRPC::Core::Channel` object is provided as the credential.
603
+ # @return [::Hash]
604
+ # @!attribute [rw] interceptors
605
+ # An array of interceptors that are run before calls are executed.
606
+ # @return [::Array<::GRPC::ClientInterceptor>]
607
+ # @!attribute [rw] timeout
608
+ # The call timeout in seconds.
609
+ # @return [::Numeric]
610
+ # @!attribute [rw] metadata
611
+ # Additional gRPC headers to be sent with the call.
612
+ # @return [::Hash{::Symbol=>::String}]
613
+ # @!attribute [rw] retry_policy
614
+ # The retry policy. The value is a hash with the following keys:
615
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
616
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
617
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
618
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
619
+ # trigger a retry.
620
+ # @return [::Hash]
621
+ # @!attribute [rw] quota_project
622
+ # A separate project against which to charge quota.
623
+ # @return [::String]
624
+ # @!attribute [rw] universe_domain
625
+ # The universe domain within which to make requests. This determines the
626
+ # default endpoint URL. The default value of nil uses the environment
627
+ # universe (usually the default "googleapis.com" universe).
628
+ # @return [::String,nil]
629
+ # @!attribute [rw] logger
630
+ # A custom logger to use for request/response debug logging, or the value
631
+ # `:default` (the default) to construct a default logger, or `nil` to
632
+ # explicitly disable logging.
633
+ # @return [::Logger,:default,nil]
634
+ #
635
+ class Configuration
636
+ extend ::Gapic::Config
637
+
638
+ # @private
639
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
640
+ DEFAULT_ENDPOINT = "datamanager.googleapis.com"
641
+
642
+ config_attr :endpoint, nil, ::String, nil
643
+ config_attr :credentials, nil do |value|
644
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
645
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
646
+ allowed.any? { |klass| klass === value }
647
+ end
648
+ config_attr :scope, nil, ::String, ::Array, nil
649
+ config_attr :lib_name, nil, ::String, nil
650
+ config_attr :lib_version, nil, ::String, nil
651
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
652
+ config_attr :interceptors, nil, ::Array, nil
653
+ config_attr :timeout, nil, ::Numeric, nil
654
+ config_attr :metadata, nil, ::Hash, nil
655
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
656
+ config_attr :quota_project, nil, ::String, nil
657
+ config_attr :universe_domain, nil, ::String, nil
658
+ config_attr :logger, :default, ::Logger, nil, :default
659
+
660
+ # @private
661
+ def initialize parent_config = nil
662
+ @parent_config = parent_config unless parent_config.nil?
663
+
664
+ yield self if block_given?
665
+ end
666
+
667
+ ##
668
+ # Configurations for individual RPCs
669
+ # @return [Rpcs]
670
+ #
671
+ def rpcs
672
+ @rpcs ||= begin
673
+ parent_rpcs = nil
674
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
675
+ Rpcs.new parent_rpcs
676
+ end
677
+ end
678
+
679
+ ##
680
+ # Configuration for the channel pool
681
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
682
+ #
683
+ def channel_pool
684
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
685
+ end
686
+
687
+ ##
688
+ # Configuration RPC class for the PartnerLinkService API.
689
+ #
690
+ # Includes fields providing the configuration for each RPC in this service.
691
+ # Each configuration object is of type `Gapic::Config::Method` and includes
692
+ # the following configuration fields:
693
+ #
694
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
695
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
696
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
697
+ # include the following keys:
698
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
699
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
700
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
701
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
702
+ # trigger a retry.
703
+ #
704
+ class Rpcs
705
+ ##
706
+ # RPC-specific configuration for `create_partner_link`
707
+ # @return [::Gapic::Config::Method]
708
+ #
709
+ attr_reader :create_partner_link
710
+ ##
711
+ # RPC-specific configuration for `delete_partner_link`
712
+ # @return [::Gapic::Config::Method]
713
+ #
714
+ attr_reader :delete_partner_link
715
+ ##
716
+ # RPC-specific configuration for `search_partner_links`
717
+ # @return [::Gapic::Config::Method]
718
+ #
719
+ attr_reader :search_partner_links
720
+
721
+ # @private
722
+ def initialize parent_rpcs = nil
723
+ create_partner_link_config = parent_rpcs.create_partner_link if parent_rpcs.respond_to? :create_partner_link
724
+ @create_partner_link = ::Gapic::Config::Method.new create_partner_link_config
725
+ delete_partner_link_config = parent_rpcs.delete_partner_link if parent_rpcs.respond_to? :delete_partner_link
726
+ @delete_partner_link = ::Gapic::Config::Method.new delete_partner_link_config
727
+ search_partner_links_config = parent_rpcs.search_partner_links if parent_rpcs.respond_to? :search_partner_links
728
+ @search_partner_links = ::Gapic::Config::Method.new search_partner_links_config
729
+
730
+ yield self if block_given?
731
+ end
732
+ end
733
+ end
734
+ end
735
+ end
736
+ end
737
+ end
738
+ end
739
+ end