Class: Google::Apis::MarketingplatformadminV1alpha::GoogleMarketingPlatformAdminAPIService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/marketingplatformadmin_v1alpha/service.rb

Overview

Google Marketing Platform Admin API

The Google Marketing Platform Admin API allows for programmatic access to the Google Marketing Platform configuration data. You can use the Google Marketing Platform Admin API to manage links between your Google Marketing Platform organization and Google Analytics accounts, and to set the service level of your GA4 properties.

Examples:

require 'google/apis/marketingplatformadmin_v1alpha'

Marketingplatformadmin = Google::Apis::MarketingplatformadminV1alpha # Alias the module
service = Marketingplatformadmin::GoogleMarketingPlatformAdminAPIService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://marketingplatformadmin.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGoogleMarketingPlatformAdminAPIService

Returns a new instance of GoogleMarketingPlatformAdminAPIService.



51
52
53
54
55
56
# File 'lib/google/apis/marketingplatformadmin_v1alpha/service.rb', line 51

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-marketingplatformadmin_v1alpha',
        client_version: Google::Apis::MarketingplatformadminV1alpha::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



44
45
46
# File 'lib/google/apis/marketingplatformadmin_v1alpha/service.rb', line 44

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



49
50
51
# File 'lib/google/apis/marketingplatformadmin_v1alpha/service.rb', line 49

def quota_user
  @quota_user
end

Instance Method Details

Creates the link between the Analytics account and the Google Marketing Platform organization. User needs to be an org user, and admin on the Analytics account to create the link. If the account is already linked to an organization, user needs to unlink the account from the current organization, then try link again.

Parameters:

  • parent (String)

    Required. The parent resource where this Analytics account link will be created. Format: organizations/org_id

  • analytics_account_link_object (Google::Apis::MarketingplatformadminV1alpha::AnalyticsAccountLink) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



115
116
117
118
119
120
121
122
123
124
125
# File 'lib/google/apis/marketingplatformadmin_v1alpha/service.rb', line 115

def (parent,  = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1alpha/{+parent}/analyticsAccountLinks', options)
  command.request_representation = Google::Apis::MarketingplatformadminV1alpha::AnalyticsAccountLink::Representation
  command.request_object = 
  command.response_representation = Google::Apis::MarketingplatformadminV1alpha::AnalyticsAccountLink::Representation
  command.response_class = Google::Apis::MarketingplatformadminV1alpha::AnalyticsAccountLink
  command.params['parent'] = parent unless parent.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

Deletes the AnalyticsAccountLink, which detaches the Analytics account from the Google Marketing Platform organization. User needs to be an org user, and admin on the Analytics account in order to delete the link.

Parameters:

  • name (String)

    Required. The name of the Analytics account link to delete. Format: organizations/org_id/analyticsAccountLinks/analytics_account_link_id

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



150
151
152
153
154
155
156
157
158
# File 'lib/google/apis/marketingplatformadmin_v1alpha/service.rb', line 150

def (name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1alpha/{+name}', options)
  command.response_representation = Google::Apis::MarketingplatformadminV1alpha::Empty::Representation
  command.response_class = Google::Apis::MarketingplatformadminV1alpha::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_organization(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MarketingplatformadminV1alpha::Organization

Lookup for a single organization.

Parameters:

  • name (String)

    Required. The name of the Organization to retrieve. Format: organizations/ org_id

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



79
80
81
82
83
84
85
86
87
# File 'lib/google/apis/marketingplatformadmin_v1alpha/service.rb', line 79

def get_organization(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1alpha/{+name}', options)
  command.response_representation = Google::Apis::MarketingplatformadminV1alpha::Organization::Representation
  command.response_class = Google::Apis::MarketingplatformadminV1alpha::Organization
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

Lists the Google Analytics accounts link to the specified Google Marketing Platform organization.

Parameters:

  • parent (String)

    Required. The parent organization, which owns this collection of Analytics account links. Format: organizations/org_id

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of Analytics account links to return in one call. The service may return fewer than this value. If unspecified, at most 50 Analytics account links will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous ListAnalyticsAccountLinks call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListAnalyticsAccountLinks must match the call that provided the page token.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



192
193
194
195
196
197
198
199
200
201
202
# File 'lib/google/apis/marketingplatformadmin_v1alpha/service.rb', line 192

def (parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1alpha/{+parent}/analyticsAccountLinks', options)
  command.response_representation = Google::Apis::MarketingplatformadminV1alpha::ListAnalyticsAccountLinksResponse::Representation
  command.response_class = Google::Apis::MarketingplatformadminV1alpha::ListAnalyticsAccountLinksResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

Updates the service level for an Analytics property.

Parameters:

  • analytics_account_link (String)

    Required. The parent AnalyticsAccountLink scope where this property is in. Format: organizations/org_id/analyticsAccountLinks/ analytics_account_link_id

  • set_property_service_level_request_object (Google::Apis::MarketingplatformadminV1alpha::SetPropertyServiceLevelRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



227
228
229
230
231
232
233
234
235
236
237
# File 'lib/google/apis/marketingplatformadmin_v1alpha/service.rb', line 227

def (, set_property_service_level_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1alpha/{+analyticsAccountLink}:setPropertyServiceLevel', options)
  command.request_representation = Google::Apis::MarketingplatformadminV1alpha::SetPropertyServiceLevelRequest::Representation
  command.request_object = set_property_service_level_request_object
  command.response_representation = Google::Apis::MarketingplatformadminV1alpha::SetPropertyServiceLevelResponse::Representation
  command.response_class = Google::Apis::MarketingplatformadminV1alpha::SetPropertyServiceLevelResponse
  command.params['analyticsAccountLink'] =  unless .nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end