google-ads-marketing_platform-admin-v1alpha 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 (29) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +154 -0
  6. data/lib/google/ads/marketing_platform/admin/v1alpha/marketingplatform_admin_service/client.rb +877 -0
  7. data/lib/google/ads/marketing_platform/admin/v1alpha/marketingplatform_admin_service/credentials.rb +50 -0
  8. data/lib/google/ads/marketing_platform/admin/v1alpha/marketingplatform_admin_service/paths.rb +94 -0
  9. data/lib/google/ads/marketing_platform/admin/v1alpha/marketingplatform_admin_service/rest/client.rb +816 -0
  10. data/lib/google/ads/marketing_platform/admin/v1alpha/marketingplatform_admin_service/rest/service_stub.rb +390 -0
  11. data/lib/google/ads/marketing_platform/admin/v1alpha/marketingplatform_admin_service/rest.rb +54 -0
  12. data/lib/google/ads/marketing_platform/admin/v1alpha/marketingplatform_admin_service.rb +57 -0
  13. data/lib/google/ads/marketing_platform/admin/v1alpha/rest.rb +39 -0
  14. data/lib/google/ads/marketing_platform/admin/v1alpha/version.rb +30 -0
  15. data/lib/google/ads/marketing_platform/admin/v1alpha.rb +47 -0
  16. data/lib/google/marketingplatform/admin/v1alpha/marketingplatform_admin_pb.rb +59 -0
  17. data/lib/google/marketingplatform/admin/v1alpha/marketingplatform_admin_services_pb.rb +65 -0
  18. data/lib/google/marketingplatform/admin/v1alpha/resources_pb.rb +49 -0
  19. data/lib/google-ads-marketing_platform-admin-v1alpha.rb +21 -0
  20. data/proto_docs/README.md +4 -0
  21. data/proto_docs/google/api/client.rb +473 -0
  22. data/proto_docs/google/api/field_behavior.rb +85 -0
  23. data/proto_docs/google/api/launch_stage.rb +71 -0
  24. data/proto_docs/google/api/resource.rb +227 -0
  25. data/proto_docs/google/marketingplatform/admin/v1alpha/marketingplatform_admin.rb +138 -0
  26. data/proto_docs/google/marketingplatform/admin/v1alpha/resources.rb +84 -0
  27. data/proto_docs/google/protobuf/duration.rb +98 -0
  28. data/proto_docs/google/protobuf/empty.rb +34 -0
  29. metadata +103 -0
@@ -0,0 +1,816 @@
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/marketingplatform/admin/v1alpha/marketingplatform_admin_pb"
21
+ require "google/ads/marketing_platform/admin/v1alpha/marketingplatform_admin_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Ads
25
+ module MarketingPlatform
26
+ module Admin
27
+ module V1alpha
28
+ module MarketingplatformAdminService
29
+ module Rest
30
+ ##
31
+ # REST client for the MarketingplatformAdminService service.
32
+ #
33
+ # Service Interface for the Google Marketing Platform Admin API.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "marketingplatformadmin.$UNIVERSE_DOMAIN$"
41
+
42
+ include Paths
43
+
44
+ # @private
45
+ attr_reader :marketingplatform_admin_service_stub
46
+
47
+ ##
48
+ # Configure the MarketingplatformAdminService Client class.
49
+ #
50
+ # See {::Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all MarketingplatformAdminService clients
56
+ # ::Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::Client.configure do |config|
57
+ # config.timeout = 10.0
58
+ # end
59
+ #
60
+ # @yield [config] Configure the Client client.
61
+ # @yieldparam config [Client::Configuration]
62
+ #
63
+ # @return [Client::Configuration]
64
+ #
65
+ def self.configure
66
+ @configure ||= begin
67
+ namespace = ["Google", "Ads", "MarketingPlatform", "Admin", "V1alpha"]
68
+ parent_config = while namespace.any?
69
+ parent_name = namespace.join "::"
70
+ parent_const = const_get parent_name
71
+ break parent_const.configure if parent_const.respond_to? :configure
72
+ namespace.pop
73
+ end
74
+ default_config = Client::Configuration.new parent_config
75
+
76
+ default_config.timeout = 60.0
77
+ default_config.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2]
79
+ }
80
+
81
+ default_config
82
+ end
83
+ yield @configure if block_given?
84
+ @configure
85
+ end
86
+
87
+ ##
88
+ # Configure the MarketingplatformAdminService Client instance.
89
+ #
90
+ # The configuration is set to the derived mode, meaning that values can be changed,
91
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
92
+ # should be made on {Client.configure}.
93
+ #
94
+ # See {::Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::Client::Configuration}
95
+ # for a description of the configuration fields.
96
+ #
97
+ # @yield [config] Configure the Client client.
98
+ # @yieldparam config [Client::Configuration]
99
+ #
100
+ # @return [Client::Configuration]
101
+ #
102
+ def configure
103
+ yield @config if block_given?
104
+ @config
105
+ end
106
+
107
+ ##
108
+ # The effective universe domain
109
+ #
110
+ # @return [String]
111
+ #
112
+ def universe_domain
113
+ @marketingplatform_admin_service_stub.universe_domain
114
+ end
115
+
116
+ ##
117
+ # Create a new MarketingplatformAdminService REST client object.
118
+ #
119
+ # @example
120
+ #
121
+ # # Create a client using the default configuration
122
+ # client = ::Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::Client.new
123
+ #
124
+ # # Create a client using a custom configuration
125
+ # client = ::Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::Client.new do |config|
126
+ # config.timeout = 10.0
127
+ # end
128
+ #
129
+ # @yield [config] Configure the MarketingplatformAdminService client.
130
+ # @yieldparam config [Client::Configuration]
131
+ #
132
+ def initialize
133
+ # Create the configuration object
134
+ @config = Configuration.new Client.configure
135
+
136
+ # Yield the configuration if needed
137
+ yield @config if block_given?
138
+
139
+ # Create credentials
140
+ credentials = @config.credentials
141
+ # Use self-signed JWT if the endpoint is unchanged from default,
142
+ # but only if the default endpoint does not have a region prefix.
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+
152
+ @quota_project_id = @config.quota_project
153
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
154
+
155
+ @marketingplatform_admin_service_stub = ::Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::ServiceStub.new(
156
+ endpoint: @config.endpoint,
157
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
158
+ universe_domain: @config.universe_domain,
159
+ credentials: credentials,
160
+ logger: @config.logger
161
+ )
162
+
163
+ @marketingplatform_admin_service_stub.logger(stub: true)&.info do |entry|
164
+ entry.set_system_name
165
+ entry.set_service
166
+ entry.message = "Created client for #{entry.service}"
167
+ entry.set_credentials_fields credentials
168
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
169
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
170
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
171
+ end
172
+ end
173
+
174
+ ##
175
+ # The logger used for request/response debug logging.
176
+ #
177
+ # @return [Logger]
178
+ #
179
+ def logger
180
+ @marketingplatform_admin_service_stub.logger
181
+ end
182
+
183
+ # Service calls
184
+
185
+ ##
186
+ # Lookup for a single organization.
187
+ #
188
+ # @overload get_organization(request, options = nil)
189
+ # Pass arguments to `get_organization` via a request object, either of type
190
+ # {::Google::Ads::MarketingPlatform::Admin::V1alpha::GetOrganizationRequest} or an equivalent Hash.
191
+ #
192
+ # @param request [::Google::Ads::MarketingPlatform::Admin::V1alpha::GetOrganizationRequest, ::Hash]
193
+ # A request object representing the call parameters. Required. To specify no
194
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
195
+ # @param options [::Gapic::CallOptions, ::Hash]
196
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
197
+ #
198
+ # @overload get_organization(name: nil)
199
+ # Pass arguments to `get_organization` via keyword arguments. Note that at
200
+ # least one keyword argument is required. To specify no parameters, or to keep all
201
+ # the default parameter values, pass an empty Hash as a request object (see above).
202
+ #
203
+ # @param name [::String]
204
+ # Required. The name of the Organization to retrieve.
205
+ # Format: organizations/\\{org_id}
206
+ # @yield [result, operation] Access the result along with the TransportOperation object
207
+ # @yieldparam result [::Google::Ads::MarketingPlatform::Admin::V1alpha::Organization]
208
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
209
+ #
210
+ # @return [::Google::Ads::MarketingPlatform::Admin::V1alpha::Organization]
211
+ #
212
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
213
+ #
214
+ # @example Basic example
215
+ # require "google/ads/marketing_platform/admin/v1alpha"
216
+ #
217
+ # # Create a client object. The client can be reused for multiple calls.
218
+ # client = Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::Client.new
219
+ #
220
+ # # Create a request. To set request fields, pass in keyword arguments.
221
+ # request = Google::Ads::MarketingPlatform::Admin::V1alpha::GetOrganizationRequest.new
222
+ #
223
+ # # Call the get_organization method.
224
+ # result = client.get_organization request
225
+ #
226
+ # # The returned object is of type Google::Ads::MarketingPlatform::Admin::V1alpha::Organization.
227
+ # p result
228
+ #
229
+ def get_organization request, options = nil
230
+ raise ::ArgumentError, "request must be provided" if request.nil?
231
+
232
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::MarketingPlatform::Admin::V1alpha::GetOrganizationRequest
233
+
234
+ # Converts hash and nil to an options object
235
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
236
+
237
+ # Customize the options with defaults
238
+ call_metadata = @config.rpcs.get_organization.metadata.to_h
239
+
240
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
241
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
242
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
243
+ gapic_version: ::Google::Ads::MarketingPlatform::Admin::V1alpha::VERSION,
244
+ transports_version_send: [:rest]
245
+
246
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
247
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
248
+
249
+ options.apply_defaults timeout: @config.rpcs.get_organization.timeout,
250
+ metadata: call_metadata,
251
+ retry_policy: @config.rpcs.get_organization.retry_policy
252
+
253
+ options.apply_defaults timeout: @config.timeout,
254
+ metadata: @config.metadata,
255
+ retry_policy: @config.retry_policy
256
+
257
+ @marketingplatform_admin_service_stub.get_organization request, options do |result, operation|
258
+ yield result, operation if block_given?
259
+ end
260
+ rescue ::Gapic::Rest::Error => e
261
+ raise ::Google::Cloud::Error.from_error(e)
262
+ end
263
+
264
+ ##
265
+ # Lists the Google Analytics accounts link to the specified Google Marketing
266
+ # Platform organization.
267
+ #
268
+ # @overload list_analytics_account_links(request, options = nil)
269
+ # Pass arguments to `list_analytics_account_links` via a request object, either of type
270
+ # {::Google::Ads::MarketingPlatform::Admin::V1alpha::ListAnalyticsAccountLinksRequest} or an equivalent Hash.
271
+ #
272
+ # @param request [::Google::Ads::MarketingPlatform::Admin::V1alpha::ListAnalyticsAccountLinksRequest, ::Hash]
273
+ # A request object representing the call parameters. Required. To specify no
274
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
275
+ # @param options [::Gapic::CallOptions, ::Hash]
276
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
277
+ #
278
+ # @overload list_analytics_account_links(parent: nil, page_size: nil, page_token: nil)
279
+ # Pass arguments to `list_analytics_account_links` via keyword arguments. Note that at
280
+ # least one keyword argument is required. To specify no parameters, or to keep all
281
+ # the default parameter values, pass an empty Hash as a request object (see above).
282
+ #
283
+ # @param parent [::String]
284
+ # Required. The parent organization, which owns this collection of Analytics
285
+ # account links. Format: organizations/\\{org_id}
286
+ # @param page_size [::Integer]
287
+ # Optional. The maximum number of Analytics account links to return in one
288
+ # call. The service may return fewer than this value.
289
+ #
290
+ # If unspecified, at most 50 Analytics account links will be returned. The
291
+ # maximum value is 1000; values above 1000 will be coerced to 1000.
292
+ # @param page_token [::String]
293
+ # Optional. A page token, received from a previous ListAnalyticsAccountLinks
294
+ # call. Provide this to retrieve the subsequent page.
295
+ #
296
+ # When paginating, all other parameters provided to
297
+ # `ListAnalyticsAccountLinks` must match the call that provided the page
298
+ # token.
299
+ # @yield [result, operation] Access the result along with the TransportOperation object
300
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Ads::MarketingPlatform::Admin::V1alpha::AnalyticsAccountLink>]
301
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
302
+ #
303
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Ads::MarketingPlatform::Admin::V1alpha::AnalyticsAccountLink>]
304
+ #
305
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
306
+ #
307
+ # @example Basic example
308
+ # require "google/ads/marketing_platform/admin/v1alpha"
309
+ #
310
+ # # Create a client object. The client can be reused for multiple calls.
311
+ # client = Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::Client.new
312
+ #
313
+ # # Create a request. To set request fields, pass in keyword arguments.
314
+ # request = Google::Ads::MarketingPlatform::Admin::V1alpha::ListAnalyticsAccountLinksRequest.new
315
+ #
316
+ # # Call the list_analytics_account_links method.
317
+ # result = client.list_analytics_account_links request
318
+ #
319
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
320
+ # # over elements, and API calls will be issued to fetch pages as needed.
321
+ # result.each do |item|
322
+ # # Each element is of type ::Google::Ads::MarketingPlatform::Admin::V1alpha::AnalyticsAccountLink.
323
+ # p item
324
+ # end
325
+ #
326
+ def list_analytics_account_links request, options = nil
327
+ raise ::ArgumentError, "request must be provided" if request.nil?
328
+
329
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::MarketingPlatform::Admin::V1alpha::ListAnalyticsAccountLinksRequest
330
+
331
+ # Converts hash and nil to an options object
332
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
333
+
334
+ # Customize the options with defaults
335
+ call_metadata = @config.rpcs.list_analytics_account_links.metadata.to_h
336
+
337
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
338
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
339
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
340
+ gapic_version: ::Google::Ads::MarketingPlatform::Admin::V1alpha::VERSION,
341
+ transports_version_send: [:rest]
342
+
343
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
344
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
345
+
346
+ options.apply_defaults timeout: @config.rpcs.list_analytics_account_links.timeout,
347
+ metadata: call_metadata,
348
+ retry_policy: @config.rpcs.list_analytics_account_links.retry_policy
349
+
350
+ options.apply_defaults timeout: @config.timeout,
351
+ metadata: @config.metadata,
352
+ retry_policy: @config.retry_policy
353
+
354
+ @marketingplatform_admin_service_stub.list_analytics_account_links request, options do |result, operation|
355
+ result = ::Gapic::Rest::PagedEnumerable.new @marketingplatform_admin_service_stub, :list_analytics_account_links, "analytics_account_links", request, result, options
356
+ yield result, operation if block_given?
357
+ throw :response, result
358
+ end
359
+ rescue ::Gapic::Rest::Error => e
360
+ raise ::Google::Cloud::Error.from_error(e)
361
+ end
362
+
363
+ ##
364
+ # Creates the link between the Analytics account and the Google Marketing
365
+ # Platform organization.
366
+ #
367
+ # User needs to be an org user, and admin on the Analytics account to create
368
+ # the link. If the account is already linked to an organization, user needs
369
+ # to unlink the account from the current organization, then try link again.
370
+ #
371
+ # @overload create_analytics_account_link(request, options = nil)
372
+ # Pass arguments to `create_analytics_account_link` via a request object, either of type
373
+ # {::Google::Ads::MarketingPlatform::Admin::V1alpha::CreateAnalyticsAccountLinkRequest} or an equivalent Hash.
374
+ #
375
+ # @param request [::Google::Ads::MarketingPlatform::Admin::V1alpha::CreateAnalyticsAccountLinkRequest, ::Hash]
376
+ # A request object representing the call parameters. Required. To specify no
377
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
378
+ # @param options [::Gapic::CallOptions, ::Hash]
379
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
380
+ #
381
+ # @overload create_analytics_account_link(parent: nil, analytics_account_link: nil)
382
+ # Pass arguments to `create_analytics_account_link` via keyword arguments. Note that at
383
+ # least one keyword argument is required. To specify no parameters, or to keep all
384
+ # the default parameter values, pass an empty Hash as a request object (see above).
385
+ #
386
+ # @param parent [::String]
387
+ # Required. The parent resource where this Analytics account link will be
388
+ # created. Format: organizations/\\{org_id}
389
+ # @param analytics_account_link [::Google::Ads::MarketingPlatform::Admin::V1alpha::AnalyticsAccountLink, ::Hash]
390
+ # Required. The Analytics account link to create.
391
+ # @yield [result, operation] Access the result along with the TransportOperation object
392
+ # @yieldparam result [::Google::Ads::MarketingPlatform::Admin::V1alpha::AnalyticsAccountLink]
393
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
394
+ #
395
+ # @return [::Google::Ads::MarketingPlatform::Admin::V1alpha::AnalyticsAccountLink]
396
+ #
397
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
398
+ #
399
+ # @example Basic example
400
+ # require "google/ads/marketing_platform/admin/v1alpha"
401
+ #
402
+ # # Create a client object. The client can be reused for multiple calls.
403
+ # client = Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::Client.new
404
+ #
405
+ # # Create a request. To set request fields, pass in keyword arguments.
406
+ # request = Google::Ads::MarketingPlatform::Admin::V1alpha::CreateAnalyticsAccountLinkRequest.new
407
+ #
408
+ # # Call the create_analytics_account_link method.
409
+ # result = client.create_analytics_account_link request
410
+ #
411
+ # # The returned object is of type Google::Ads::MarketingPlatform::Admin::V1alpha::AnalyticsAccountLink.
412
+ # p result
413
+ #
414
+ def create_analytics_account_link request, options = nil
415
+ raise ::ArgumentError, "request must be provided" if request.nil?
416
+
417
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::MarketingPlatform::Admin::V1alpha::CreateAnalyticsAccountLinkRequest
418
+
419
+ # Converts hash and nil to an options object
420
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
421
+
422
+ # Customize the options with defaults
423
+ call_metadata = @config.rpcs.create_analytics_account_link.metadata.to_h
424
+
425
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
426
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
427
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
428
+ gapic_version: ::Google::Ads::MarketingPlatform::Admin::V1alpha::VERSION,
429
+ transports_version_send: [:rest]
430
+
431
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
432
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
433
+
434
+ options.apply_defaults timeout: @config.rpcs.create_analytics_account_link.timeout,
435
+ metadata: call_metadata,
436
+ retry_policy: @config.rpcs.create_analytics_account_link.retry_policy
437
+
438
+ options.apply_defaults timeout: @config.timeout,
439
+ metadata: @config.metadata,
440
+ retry_policy: @config.retry_policy
441
+
442
+ @marketingplatform_admin_service_stub.create_analytics_account_link request, options do |result, operation|
443
+ yield result, operation if block_given?
444
+ end
445
+ rescue ::Gapic::Rest::Error => e
446
+ raise ::Google::Cloud::Error.from_error(e)
447
+ end
448
+
449
+ ##
450
+ # Deletes the AnalyticsAccountLink, which detaches the Analytics account from
451
+ # the Google Marketing Platform organization.
452
+ #
453
+ # User needs to be an org user, and admin on the Analytics account in order
454
+ # to delete the link.
455
+ #
456
+ # @overload delete_analytics_account_link(request, options = nil)
457
+ # Pass arguments to `delete_analytics_account_link` via a request object, either of type
458
+ # {::Google::Ads::MarketingPlatform::Admin::V1alpha::DeleteAnalyticsAccountLinkRequest} or an equivalent Hash.
459
+ #
460
+ # @param request [::Google::Ads::MarketingPlatform::Admin::V1alpha::DeleteAnalyticsAccountLinkRequest, ::Hash]
461
+ # A request object representing the call parameters. Required. To specify no
462
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
463
+ # @param options [::Gapic::CallOptions, ::Hash]
464
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
465
+ #
466
+ # @overload delete_analytics_account_link(name: nil)
467
+ # Pass arguments to `delete_analytics_account_link` via keyword arguments. Note that at
468
+ # least one keyword argument is required. To specify no parameters, or to keep all
469
+ # the default parameter values, pass an empty Hash as a request object (see above).
470
+ #
471
+ # @param name [::String]
472
+ # Required. The name of the Analytics account link to delete.
473
+ # Format:
474
+ # organizations/\\{org_id}/analyticsAccountLinks/\\{analytics_account_link_id}
475
+ # @yield [result, operation] Access the result along with the TransportOperation object
476
+ # @yieldparam result [::Google::Protobuf::Empty]
477
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
478
+ #
479
+ # @return [::Google::Protobuf::Empty]
480
+ #
481
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
482
+ #
483
+ # @example Basic example
484
+ # require "google/ads/marketing_platform/admin/v1alpha"
485
+ #
486
+ # # Create a client object. The client can be reused for multiple calls.
487
+ # client = Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::Client.new
488
+ #
489
+ # # Create a request. To set request fields, pass in keyword arguments.
490
+ # request = Google::Ads::MarketingPlatform::Admin::V1alpha::DeleteAnalyticsAccountLinkRequest.new
491
+ #
492
+ # # Call the delete_analytics_account_link method.
493
+ # result = client.delete_analytics_account_link request
494
+ #
495
+ # # The returned object is of type Google::Protobuf::Empty.
496
+ # p result
497
+ #
498
+ def delete_analytics_account_link request, options = nil
499
+ raise ::ArgumentError, "request must be provided" if request.nil?
500
+
501
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::MarketingPlatform::Admin::V1alpha::DeleteAnalyticsAccountLinkRequest
502
+
503
+ # Converts hash and nil to an options object
504
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
505
+
506
+ # Customize the options with defaults
507
+ call_metadata = @config.rpcs.delete_analytics_account_link.metadata.to_h
508
+
509
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
510
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
511
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
512
+ gapic_version: ::Google::Ads::MarketingPlatform::Admin::V1alpha::VERSION,
513
+ transports_version_send: [:rest]
514
+
515
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
516
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
517
+
518
+ options.apply_defaults timeout: @config.rpcs.delete_analytics_account_link.timeout,
519
+ metadata: call_metadata,
520
+ retry_policy: @config.rpcs.delete_analytics_account_link.retry_policy
521
+
522
+ options.apply_defaults timeout: @config.timeout,
523
+ metadata: @config.metadata,
524
+ retry_policy: @config.retry_policy
525
+
526
+ @marketingplatform_admin_service_stub.delete_analytics_account_link request, options do |result, operation|
527
+ yield result, operation if block_given?
528
+ end
529
+ rescue ::Gapic::Rest::Error => e
530
+ raise ::Google::Cloud::Error.from_error(e)
531
+ end
532
+
533
+ ##
534
+ # Updates the service level for an Analytics property.
535
+ #
536
+ # @overload set_property_service_level(request, options = nil)
537
+ # Pass arguments to `set_property_service_level` via a request object, either of type
538
+ # {::Google::Ads::MarketingPlatform::Admin::V1alpha::SetPropertyServiceLevelRequest} or an equivalent Hash.
539
+ #
540
+ # @param request [::Google::Ads::MarketingPlatform::Admin::V1alpha::SetPropertyServiceLevelRequest, ::Hash]
541
+ # A request object representing the call parameters. Required. To specify no
542
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
543
+ # @param options [::Gapic::CallOptions, ::Hash]
544
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
545
+ #
546
+ # @overload set_property_service_level(analytics_account_link: nil, analytics_property: nil, service_level: nil)
547
+ # Pass arguments to `set_property_service_level` via keyword arguments. Note that at
548
+ # least one keyword argument is required. To specify no parameters, or to keep all
549
+ # the default parameter values, pass an empty Hash as a request object (see above).
550
+ #
551
+ # @param analytics_account_link [::String]
552
+ # Required. The parent AnalyticsAccountLink scope where this property is in.
553
+ # Format:
554
+ # organizations/\\{org_id}/analyticsAccountLinks/\\{analytics_account_link_id}
555
+ # @param analytics_property [::String]
556
+ # Required. The Analytics property to change the ServiceLevel setting. This
557
+ # field is the name of the Google Analytics Admin API property resource.
558
+ #
559
+ # Format: analyticsadmin.googleapis.com/properties/\\{property_id}
560
+ # @param service_level [::Google::Ads::MarketingPlatform::Admin::V1alpha::AnalyticsServiceLevel]
561
+ # Required. The service level to set for this property.
562
+ # @yield [result, operation] Access the result along with the TransportOperation object
563
+ # @yieldparam result [::Google::Ads::MarketingPlatform::Admin::V1alpha::SetPropertyServiceLevelResponse]
564
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
565
+ #
566
+ # @return [::Google::Ads::MarketingPlatform::Admin::V1alpha::SetPropertyServiceLevelResponse]
567
+ #
568
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
569
+ #
570
+ # @example Basic example
571
+ # require "google/ads/marketing_platform/admin/v1alpha"
572
+ #
573
+ # # Create a client object. The client can be reused for multiple calls.
574
+ # client = Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::Client.new
575
+ #
576
+ # # Create a request. To set request fields, pass in keyword arguments.
577
+ # request = Google::Ads::MarketingPlatform::Admin::V1alpha::SetPropertyServiceLevelRequest.new
578
+ #
579
+ # # Call the set_property_service_level method.
580
+ # result = client.set_property_service_level request
581
+ #
582
+ # # The returned object is of type Google::Ads::MarketingPlatform::Admin::V1alpha::SetPropertyServiceLevelResponse.
583
+ # p result
584
+ #
585
+ def set_property_service_level request, options = nil
586
+ raise ::ArgumentError, "request must be provided" if request.nil?
587
+
588
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::MarketingPlatform::Admin::V1alpha::SetPropertyServiceLevelRequest
589
+
590
+ # Converts hash and nil to an options object
591
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
592
+
593
+ # Customize the options with defaults
594
+ call_metadata = @config.rpcs.set_property_service_level.metadata.to_h
595
+
596
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
597
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
598
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
599
+ gapic_version: ::Google::Ads::MarketingPlatform::Admin::V1alpha::VERSION,
600
+ transports_version_send: [:rest]
601
+
602
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
603
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
604
+
605
+ options.apply_defaults timeout: @config.rpcs.set_property_service_level.timeout,
606
+ metadata: call_metadata,
607
+ retry_policy: @config.rpcs.set_property_service_level.retry_policy
608
+
609
+ options.apply_defaults timeout: @config.timeout,
610
+ metadata: @config.metadata,
611
+ retry_policy: @config.retry_policy
612
+
613
+ @marketingplatform_admin_service_stub.set_property_service_level request, options do |result, operation|
614
+ yield result, operation if block_given?
615
+ end
616
+ rescue ::Gapic::Rest::Error => e
617
+ raise ::Google::Cloud::Error.from_error(e)
618
+ end
619
+
620
+ ##
621
+ # Configuration class for the MarketingplatformAdminService REST API.
622
+ #
623
+ # This class represents the configuration for MarketingplatformAdminService REST,
624
+ # providing control over timeouts, retry behavior, logging, transport
625
+ # parameters, and other low-level controls. Certain parameters can also be
626
+ # applied individually to specific RPCs. See
627
+ # {::Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::Client::Configuration::Rpcs}
628
+ # for a list of RPCs that can be configured independently.
629
+ #
630
+ # Configuration can be applied globally to all clients, or to a single client
631
+ # on construction.
632
+ #
633
+ # @example
634
+ #
635
+ # # Modify the global config, setting the timeout for
636
+ # # get_organization to 20 seconds,
637
+ # # and all remaining timeouts to 10 seconds.
638
+ # ::Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::Client.configure do |config|
639
+ # config.timeout = 10.0
640
+ # config.rpcs.get_organization.timeout = 20.0
641
+ # end
642
+ #
643
+ # # Apply the above configuration only to a new client.
644
+ # client = ::Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Rest::Client.new do |config|
645
+ # config.timeout = 10.0
646
+ # config.rpcs.get_organization.timeout = 20.0
647
+ # end
648
+ #
649
+ # @!attribute [rw] endpoint
650
+ # A custom service endpoint, as a hostname or hostname:port. The default is
651
+ # nil, indicating to use the default endpoint in the current universe domain.
652
+ # @return [::String,nil]
653
+ # @!attribute [rw] credentials
654
+ # Credentials to send with calls. You may provide any of the following types:
655
+ # * (`String`) The path to a service account key file in JSON format
656
+ # * (`Hash`) A service account key as a Hash
657
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
658
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
659
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
660
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
661
+ # * (`nil`) indicating no credentials
662
+ #
663
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
664
+ # external source for authentication to Google Cloud, you must validate it before
665
+ # providing it to a Google API client library. Providing an unvalidated credential
666
+ # configuration to Google APIs can compromise the security of your systems and data.
667
+ # For more information, refer to [Validate credential configurations from external
668
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
669
+ # @return [::Object]
670
+ # @!attribute [rw] scope
671
+ # The OAuth scopes
672
+ # @return [::Array<::String>]
673
+ # @!attribute [rw] lib_name
674
+ # The library name as recorded in instrumentation and logging
675
+ # @return [::String]
676
+ # @!attribute [rw] lib_version
677
+ # The library version as recorded in instrumentation and logging
678
+ # @return [::String]
679
+ # @!attribute [rw] timeout
680
+ # The call timeout in seconds.
681
+ # @return [::Numeric]
682
+ # @!attribute [rw] metadata
683
+ # Additional headers to be sent with the call.
684
+ # @return [::Hash{::Symbol=>::String}]
685
+ # @!attribute [rw] retry_policy
686
+ # The retry policy. The value is a hash with the following keys:
687
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
688
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
689
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
690
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
691
+ # trigger a retry.
692
+ # @return [::Hash]
693
+ # @!attribute [rw] quota_project
694
+ # A separate project against which to charge quota.
695
+ # @return [::String]
696
+ # @!attribute [rw] universe_domain
697
+ # The universe domain within which to make requests. This determines the
698
+ # default endpoint URL. The default value of nil uses the environment
699
+ # universe (usually the default "googleapis.com" universe).
700
+ # @return [::String,nil]
701
+ # @!attribute [rw] logger
702
+ # A custom logger to use for request/response debug logging, or the value
703
+ # `:default` (the default) to construct a default logger, or `nil` to
704
+ # explicitly disable logging.
705
+ # @return [::Logger,:default,nil]
706
+ #
707
+ class Configuration
708
+ extend ::Gapic::Config
709
+
710
+ # @private
711
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
712
+ DEFAULT_ENDPOINT = "marketingplatformadmin.googleapis.com"
713
+
714
+ config_attr :endpoint, nil, ::String, nil
715
+ config_attr :credentials, nil do |value|
716
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
717
+ allowed.any? { |klass| klass === value }
718
+ end
719
+ config_attr :scope, nil, ::String, ::Array, nil
720
+ config_attr :lib_name, nil, ::String, nil
721
+ config_attr :lib_version, nil, ::String, nil
722
+ config_attr :timeout, nil, ::Numeric, nil
723
+ config_attr :metadata, nil, ::Hash, nil
724
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
725
+ config_attr :quota_project, nil, ::String, nil
726
+ config_attr :universe_domain, nil, ::String, nil
727
+ config_attr :logger, :default, ::Logger, nil, :default
728
+
729
+ # @private
730
+ def initialize parent_config = nil
731
+ @parent_config = parent_config unless parent_config.nil?
732
+
733
+ yield self if block_given?
734
+ end
735
+
736
+ ##
737
+ # Configurations for individual RPCs
738
+ # @return [Rpcs]
739
+ #
740
+ def rpcs
741
+ @rpcs ||= begin
742
+ parent_rpcs = nil
743
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
744
+ Rpcs.new parent_rpcs
745
+ end
746
+ end
747
+
748
+ ##
749
+ # Configuration RPC class for the MarketingplatformAdminService API.
750
+ #
751
+ # Includes fields providing the configuration for each RPC in this service.
752
+ # Each configuration object is of type `Gapic::Config::Method` and includes
753
+ # the following configuration fields:
754
+ #
755
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
756
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
757
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
758
+ # include the following keys:
759
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
760
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
761
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
762
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
763
+ # trigger a retry.
764
+ #
765
+ class Rpcs
766
+ ##
767
+ # RPC-specific configuration for `get_organization`
768
+ # @return [::Gapic::Config::Method]
769
+ #
770
+ attr_reader :get_organization
771
+ ##
772
+ # RPC-specific configuration for `list_analytics_account_links`
773
+ # @return [::Gapic::Config::Method]
774
+ #
775
+ attr_reader :list_analytics_account_links
776
+ ##
777
+ # RPC-specific configuration for `create_analytics_account_link`
778
+ # @return [::Gapic::Config::Method]
779
+ #
780
+ attr_reader :create_analytics_account_link
781
+ ##
782
+ # RPC-specific configuration for `delete_analytics_account_link`
783
+ # @return [::Gapic::Config::Method]
784
+ #
785
+ attr_reader :delete_analytics_account_link
786
+ ##
787
+ # RPC-specific configuration for `set_property_service_level`
788
+ # @return [::Gapic::Config::Method]
789
+ #
790
+ attr_reader :set_property_service_level
791
+
792
+ # @private
793
+ def initialize parent_rpcs = nil
794
+ get_organization_config = parent_rpcs.get_organization if parent_rpcs.respond_to? :get_organization
795
+ @get_organization = ::Gapic::Config::Method.new get_organization_config
796
+ list_analytics_account_links_config = parent_rpcs.list_analytics_account_links if parent_rpcs.respond_to? :list_analytics_account_links
797
+ @list_analytics_account_links = ::Gapic::Config::Method.new list_analytics_account_links_config
798
+ create_analytics_account_link_config = parent_rpcs.create_analytics_account_link if parent_rpcs.respond_to? :create_analytics_account_link
799
+ @create_analytics_account_link = ::Gapic::Config::Method.new create_analytics_account_link_config
800
+ delete_analytics_account_link_config = parent_rpcs.delete_analytics_account_link if parent_rpcs.respond_to? :delete_analytics_account_link
801
+ @delete_analytics_account_link = ::Gapic::Config::Method.new delete_analytics_account_link_config
802
+ set_property_service_level_config = parent_rpcs.set_property_service_level if parent_rpcs.respond_to? :set_property_service_level
803
+ @set_property_service_level = ::Gapic::Config::Method.new set_property_service_level_config
804
+
805
+ yield self if block_given?
806
+ end
807
+ end
808
+ end
809
+ end
810
+ end
811
+ end
812
+ end
813
+ end
814
+ end
815
+ end
816
+ end