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