google-ads-marketing_platform-admin-v1alpha 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0502060274a55ff3a056f98c5e19b963e1b41b2cc23d28bfb5e36af3b785fbf
4
- data.tar.gz: f8ac99962b95baeebe49db0c19a5f5ad8dea2b8fc1cd99d10e55fb3d9a8055bf
3
+ metadata.gz: 76407a51d9828e2cdb7e9d1169d10444578ee8a4c5dfe54491ff40995a511a01
4
+ data.tar.gz: 4de1406d090837a73e87c73bd2244006e23555d86f28b78f2e3281c8a0ad554d
5
5
  SHA512:
6
- metadata.gz: 5a430950fa7258380d6c6a4f6dfac6a23028c470cd1c792bc7a9e3858bda5eb1a703f86ed313c9b1359d7e440cdf67c3ee75c8407ae11d174e9c50f7885b83fb
7
- data.tar.gz: a7ab0b399df39e6a4fbd8e66eb1dc45fe78d7123c0ce274d8595ae3c2abb79fc9eee74d536a7f7f6761b4ccf2b0d87848e4441da1ebd3fa22d29bbb2e0514297
6
+ metadata.gz: 284af2d7542f48ca9b50de3f5ec8fa3138625be156f0b036fe1a020105a7808823a71a2d58e2d0c1acae9b9e4df77ad16c793a505c4548793e2bce3b2c0ca63f
7
+ data.tar.gz: 4a0156eb67baa553111760c52b8414ed5c1d38865531f61caf6159d4a2342a4ad50548839c92053ce9ed1969db17b3a5a9b357884b2058ac2959719ffc0e073e
@@ -275,6 +275,191 @@ module Google
275
275
  raise ::Google::Cloud::Error.from_error(e)
276
276
  end
277
277
 
278
+ ##
279
+ # Returns a list of organizations that the user has access to.
280
+ #
281
+ # @overload list_organizations(request, options = nil)
282
+ # Pass arguments to `list_organizations` via a request object, either of type
283
+ # {::Google::Ads::MarketingPlatform::Admin::V1alpha::ListOrganizationsRequest} or an equivalent Hash.
284
+ #
285
+ # @param request [::Google::Ads::MarketingPlatform::Admin::V1alpha::ListOrganizationsRequest, ::Hash]
286
+ # A request object representing the call parameters. Required. To specify no
287
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
288
+ # @param options [::Gapic::CallOptions, ::Hash]
289
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
290
+ #
291
+ # @overload list_organizations(page_size: nil, page_token: nil)
292
+ # Pass arguments to `list_organizations` via keyword arguments. Note that at
293
+ # least one keyword argument is required. To specify no parameters, or to keep all
294
+ # the default parameter values, pass an empty Hash as a request object (see above).
295
+ #
296
+ # @param page_size [::Integer]
297
+ # Optional. The maximum number of organizations to return in one call. The
298
+ # service may return fewer than this value.
299
+ #
300
+ # If unspecified, at most 50 organizations will be returned. The
301
+ # maximum value is 1000; values above 1000 will be coerced to 1000.
302
+ # @param page_token [::String]
303
+ # Optional. A page token, received from a previous ListOrganizations call.
304
+ # Provide this to retrieve the subsequent page.
305
+ #
306
+ # When paginating, all other parameters provided to
307
+ # `ListOrganizations` must match the call that provided the page
308
+ # token.
309
+ #
310
+ # @yield [response, operation] Access the result along with the RPC operation
311
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Ads::MarketingPlatform::Admin::V1alpha::Organization>]
312
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
313
+ #
314
+ # @return [::Gapic::PagedEnumerable<::Google::Ads::MarketingPlatform::Admin::V1alpha::Organization>]
315
+ #
316
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
317
+ #
318
+ # @example Basic example
319
+ # require "google/ads/marketing_platform/admin/v1alpha"
320
+ #
321
+ # # Create a client object. The client can be reused for multiple calls.
322
+ # client = Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Client.new
323
+ #
324
+ # # Create a request. To set request fields, pass in keyword arguments.
325
+ # request = Google::Ads::MarketingPlatform::Admin::V1alpha::ListOrganizationsRequest.new
326
+ #
327
+ # # Call the list_organizations method.
328
+ # result = client.list_organizations request
329
+ #
330
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
331
+ # # over elements, and API calls will be issued to fetch pages as needed.
332
+ # result.each do |item|
333
+ # # Each element is of type ::Google::Ads::MarketingPlatform::Admin::V1alpha::Organization.
334
+ # p item
335
+ # end
336
+ #
337
+ def list_organizations request, options = nil
338
+ raise ::ArgumentError, "request must be provided" if request.nil?
339
+
340
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::MarketingPlatform::Admin::V1alpha::ListOrganizationsRequest
341
+
342
+ # Converts hash and nil to an options object
343
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
344
+
345
+ # Customize the options with defaults
346
+ metadata = @config.rpcs.list_organizations.metadata.to_h
347
+
348
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
349
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
350
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
351
+ gapic_version: ::Google::Ads::MarketingPlatform::Admin::V1alpha::VERSION
352
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
353
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
354
+
355
+ options.apply_defaults timeout: @config.rpcs.list_organizations.timeout,
356
+ metadata: metadata,
357
+ retry_policy: @config.rpcs.list_organizations.retry_policy
358
+
359
+ options.apply_defaults timeout: @config.timeout,
360
+ metadata: @config.metadata,
361
+ retry_policy: @config.retry_policy
362
+
363
+ @marketingplatform_admin_service_stub.call_rpc :list_organizations, request, options: options do |response, operation|
364
+ response = ::Gapic::PagedEnumerable.new @marketingplatform_admin_service_stub, :list_organizations, request, response, operation, options
365
+ yield response, operation if block_given?
366
+ throw :response, response
367
+ end
368
+ rescue ::GRPC::BadStatus => e
369
+ raise ::Google::Cloud::Error.from_error(e)
370
+ end
371
+
372
+ ##
373
+ # Returns a list of clients managed by the sales partner organization.
374
+ #
375
+ # User needs to be an OrgAdmin/BillingAdmin on the sales partner organization
376
+ # in order to view the end clients.
377
+ #
378
+ # @overload find_sales_partner_managed_clients(request, options = nil)
379
+ # Pass arguments to `find_sales_partner_managed_clients` via a request object, either of type
380
+ # {::Google::Ads::MarketingPlatform::Admin::V1alpha::FindSalesPartnerManagedClientsRequest} or an equivalent Hash.
381
+ #
382
+ # @param request [::Google::Ads::MarketingPlatform::Admin::V1alpha::FindSalesPartnerManagedClientsRequest, ::Hash]
383
+ # A request object representing the call parameters. Required. To specify no
384
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
385
+ # @param options [::Gapic::CallOptions, ::Hash]
386
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
387
+ #
388
+ # @overload find_sales_partner_managed_clients(organization: nil, is_active: nil)
389
+ # Pass arguments to `find_sales_partner_managed_clients` via keyword arguments. Note that at
390
+ # least one keyword argument is required. To specify no parameters, or to keep all
391
+ # the default parameter values, pass an empty Hash as a request object (see above).
392
+ #
393
+ # @param organization [::String]
394
+ # Required. The name of the sales partner organization.
395
+ # Format: organizations/\\{org_id}
396
+ # @param is_active [::Boolean]
397
+ # Optional. If set, only active and just ended clients will be returned.
398
+ #
399
+ # @yield [response, operation] Access the result along with the RPC operation
400
+ # @yieldparam response [::Google::Ads::MarketingPlatform::Admin::V1alpha::FindSalesPartnerManagedClientsResponse]
401
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
402
+ #
403
+ # @return [::Google::Ads::MarketingPlatform::Admin::V1alpha::FindSalesPartnerManagedClientsResponse]
404
+ #
405
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
406
+ #
407
+ # @example Basic example
408
+ # require "google/ads/marketing_platform/admin/v1alpha"
409
+ #
410
+ # # Create a client object. The client can be reused for multiple calls.
411
+ # client = Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Client.new
412
+ #
413
+ # # Create a request. To set request fields, pass in keyword arguments.
414
+ # request = Google::Ads::MarketingPlatform::Admin::V1alpha::FindSalesPartnerManagedClientsRequest.new
415
+ #
416
+ # # Call the find_sales_partner_managed_clients method.
417
+ # result = client.find_sales_partner_managed_clients request
418
+ #
419
+ # # The returned object is of type Google::Ads::MarketingPlatform::Admin::V1alpha::FindSalesPartnerManagedClientsResponse.
420
+ # p result
421
+ #
422
+ def find_sales_partner_managed_clients request, options = nil
423
+ raise ::ArgumentError, "request must be provided" if request.nil?
424
+
425
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::MarketingPlatform::Admin::V1alpha::FindSalesPartnerManagedClientsRequest
426
+
427
+ # Converts hash and nil to an options object
428
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
429
+
430
+ # Customize the options with defaults
431
+ metadata = @config.rpcs.find_sales_partner_managed_clients.metadata.to_h
432
+
433
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
434
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
435
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
436
+ gapic_version: ::Google::Ads::MarketingPlatform::Admin::V1alpha::VERSION
437
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
438
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
439
+
440
+ header_params = {}
441
+ if request.organization
442
+ header_params["organization"] = request.organization
443
+ end
444
+
445
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
446
+ metadata[:"x-goog-request-params"] ||= request_params_header
447
+
448
+ options.apply_defaults timeout: @config.rpcs.find_sales_partner_managed_clients.timeout,
449
+ metadata: metadata,
450
+ retry_policy: @config.rpcs.find_sales_partner_managed_clients.retry_policy
451
+
452
+ options.apply_defaults timeout: @config.timeout,
453
+ metadata: @config.metadata,
454
+ retry_policy: @config.retry_policy
455
+
456
+ @marketingplatform_admin_service_stub.call_rpc :find_sales_partner_managed_clients, request, options: options do |response, operation|
457
+ yield response, operation if block_given?
458
+ end
459
+ rescue ::GRPC::BadStatus => e
460
+ raise ::Google::Cloud::Error.from_error(e)
461
+ end
462
+
278
463
  ##
279
464
  # Lists the Google Analytics accounts link to the specified Google Marketing
280
465
  # Platform organization.
@@ -659,6 +844,106 @@ module Google
659
844
  raise ::Google::Cloud::Error.from_error(e)
660
845
  end
661
846
 
847
+ ##
848
+ # Get the usage and billing data for properties within the organization for
849
+ # the specified month.
850
+ #
851
+ # Per direct client org, user needs to be OrgAdmin/BillingAdmin on the
852
+ # organization in order to view the billing and usage data.
853
+ #
854
+ # Per sales partner client org, user needs to be OrgAdmin/BillingAdmin on
855
+ # the sales partner org in order to view the billing and usage data, or
856
+ # OrgAdmin/BillingAdmin on the sales partner client org in order to view the
857
+ # usage data only.
858
+ #
859
+ # @overload report_property_usage(request, options = nil)
860
+ # Pass arguments to `report_property_usage` via a request object, either of type
861
+ # {::Google::Ads::MarketingPlatform::Admin::V1alpha::ReportPropertyUsageRequest} or an equivalent Hash.
862
+ #
863
+ # @param request [::Google::Ads::MarketingPlatform::Admin::V1alpha::ReportPropertyUsageRequest, ::Hash]
864
+ # A request object representing the call parameters. Required. To specify no
865
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
866
+ # @param options [::Gapic::CallOptions, ::Hash]
867
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
868
+ #
869
+ # @overload report_property_usage(organization: nil, month: nil)
870
+ # Pass arguments to `report_property_usage` via keyword arguments. Note that at
871
+ # least one keyword argument is required. To specify no parameters, or to keep all
872
+ # the default parameter values, pass an empty Hash as a request object (see above).
873
+ #
874
+ # @param organization [::String]
875
+ # Required. Specifies the organization whose property usage will be listed.
876
+ #
877
+ # Format: organizations/\\{org_id}
878
+ # @param month [::String]
879
+ # Required. The target month to list property usages.
880
+ #
881
+ # Format: YYYY-MM. For example, "2025-05"
882
+ #
883
+ # @yield [response, operation] Access the result along with the RPC operation
884
+ # @yieldparam response [::Google::Ads::MarketingPlatform::Admin::V1alpha::ReportPropertyUsageResponse]
885
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
886
+ #
887
+ # @return [::Google::Ads::MarketingPlatform::Admin::V1alpha::ReportPropertyUsageResponse]
888
+ #
889
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
890
+ #
891
+ # @example Basic example
892
+ # require "google/ads/marketing_platform/admin/v1alpha"
893
+ #
894
+ # # Create a client object. The client can be reused for multiple calls.
895
+ # client = Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Client.new
896
+ #
897
+ # # Create a request. To set request fields, pass in keyword arguments.
898
+ # request = Google::Ads::MarketingPlatform::Admin::V1alpha::ReportPropertyUsageRequest.new
899
+ #
900
+ # # Call the report_property_usage method.
901
+ # result = client.report_property_usage request
902
+ #
903
+ # # The returned object is of type Google::Ads::MarketingPlatform::Admin::V1alpha::ReportPropertyUsageResponse.
904
+ # p result
905
+ #
906
+ def report_property_usage request, options = nil
907
+ raise ::ArgumentError, "request must be provided" if request.nil?
908
+
909
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Ads::MarketingPlatform::Admin::V1alpha::ReportPropertyUsageRequest
910
+
911
+ # Converts hash and nil to an options object
912
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
913
+
914
+ # Customize the options with defaults
915
+ metadata = @config.rpcs.report_property_usage.metadata.to_h
916
+
917
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
918
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
919
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
920
+ gapic_version: ::Google::Ads::MarketingPlatform::Admin::V1alpha::VERSION
921
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
922
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
923
+
924
+ header_params = {}
925
+ if request.organization
926
+ header_params["organization"] = request.organization
927
+ end
928
+
929
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
930
+ metadata[:"x-goog-request-params"] ||= request_params_header
931
+
932
+ options.apply_defaults timeout: @config.rpcs.report_property_usage.timeout,
933
+ metadata: metadata,
934
+ retry_policy: @config.rpcs.report_property_usage.retry_policy
935
+
936
+ options.apply_defaults timeout: @config.timeout,
937
+ metadata: @config.metadata,
938
+ retry_policy: @config.retry_policy
939
+
940
+ @marketingplatform_admin_service_stub.call_rpc :report_property_usage, request, options: options do |response, operation|
941
+ yield response, operation if block_given?
942
+ end
943
+ rescue ::GRPC::BadStatus => e
944
+ raise ::Google::Cloud::Error.from_error(e)
945
+ end
946
+
662
947
  ##
663
948
  # Configuration class for the MarketingplatformAdminService API.
664
949
  #
@@ -694,8 +979,6 @@ module Google
694
979
  # @return [::String,nil]
695
980
  # @!attribute [rw] credentials
696
981
  # Credentials to send with calls. You may provide any of the following types:
697
- # * (`String`) The path to a service account key file in JSON format
698
- # * (`Hash`) A service account key as a Hash
699
982
  # * (`Google::Auth::Credentials`) A googleauth credentials object
700
983
  # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
701
984
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
@@ -704,7 +987,26 @@ module Google
704
987
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
705
988
  # * (`nil`) indicating no credentials
706
989
  #
707
- # Warning: If you accept a credential configuration (JSON file or Hash) from an
990
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
991
+ # is deprecated. Providing an unvalidated credential configuration to
992
+ # Google APIs can compromise the security of your systems and data.
993
+ #
994
+ # @example
995
+ #
996
+ # # The recommended way to provide credentials is to use the `make_creds` method
997
+ # # on the appropriate credentials class for your environment.
998
+ #
999
+ # require "googleauth"
1000
+ #
1001
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
1002
+ # json_key_io: ::File.open("/path/to/keyfile.json")
1003
+ # )
1004
+ #
1005
+ # client = ::Google::Ads::MarketingPlatform::Admin::V1alpha::MarketingplatformAdminService::Client.new do |config|
1006
+ # config.credentials = credentials
1007
+ # end
1008
+ #
1009
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
708
1010
  # external source for authentication to Google Cloud, you must validate it before
709
1011
  # providing it to a Google API client library. Providing an unvalidated credential
710
1012
  # configuration to Google APIs can compromise the security of your systems and data.
@@ -831,6 +1133,16 @@ module Google
831
1133
  #
832
1134
  attr_reader :get_organization
833
1135
  ##
1136
+ # RPC-specific configuration for `list_organizations`
1137
+ # @return [::Gapic::Config::Method]
1138
+ #
1139
+ attr_reader :list_organizations
1140
+ ##
1141
+ # RPC-specific configuration for `find_sales_partner_managed_clients`
1142
+ # @return [::Gapic::Config::Method]
1143
+ #
1144
+ attr_reader :find_sales_partner_managed_clients
1145
+ ##
834
1146
  # RPC-specific configuration for `list_analytics_account_links`
835
1147
  # @return [::Gapic::Config::Method]
836
1148
  #
@@ -850,11 +1162,20 @@ module Google
850
1162
  # @return [::Gapic::Config::Method]
851
1163
  #
852
1164
  attr_reader :set_property_service_level
1165
+ ##
1166
+ # RPC-specific configuration for `report_property_usage`
1167
+ # @return [::Gapic::Config::Method]
1168
+ #
1169
+ attr_reader :report_property_usage
853
1170
 
854
1171
  # @private
855
1172
  def initialize parent_rpcs = nil
856
1173
  get_organization_config = parent_rpcs.get_organization if parent_rpcs.respond_to? :get_organization
857
1174
  @get_organization = ::Gapic::Config::Method.new get_organization_config
1175
+ list_organizations_config = parent_rpcs.list_organizations if parent_rpcs.respond_to? :list_organizations
1176
+ @list_organizations = ::Gapic::Config::Method.new list_organizations_config
1177
+ find_sales_partner_managed_clients_config = parent_rpcs.find_sales_partner_managed_clients if parent_rpcs.respond_to? :find_sales_partner_managed_clients
1178
+ @find_sales_partner_managed_clients = ::Gapic::Config::Method.new find_sales_partner_managed_clients_config
858
1179
  list_analytics_account_links_config = parent_rpcs.list_analytics_account_links if parent_rpcs.respond_to? :list_analytics_account_links
859
1180
  @list_analytics_account_links = ::Gapic::Config::Method.new list_analytics_account_links_config
860
1181
  create_analytics_account_link_config = parent_rpcs.create_analytics_account_link if parent_rpcs.respond_to? :create_analytics_account_link
@@ -863,6 +1184,8 @@ module Google
863
1184
  @delete_analytics_account_link = ::Gapic::Config::Method.new delete_analytics_account_link_config
864
1185
  set_property_service_level_config = parent_rpcs.set_property_service_level if parent_rpcs.respond_to? :set_property_service_level
865
1186
  @set_property_service_level = ::Gapic::Config::Method.new set_property_service_level_config
1187
+ report_property_usage_config = parent_rpcs.report_property_usage if parent_rpcs.respond_to? :report_property_usage
1188
+ @report_property_usage = ::Gapic::Config::Method.new report_property_usage_config
866
1189
 
867
1190
  yield self if block_given?
868
1191
  end