Class: Google::Apis::MybusinessplaceactionsV1::MyBusinessPlaceActionsService

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

Overview

My Business Place Actions API

The My Business Place Actions API provides an interface for managing place action links of a location on Google. Note - If you have a quota of 0 after enabling the API, please request for GBP API access.

Examples:

require 'google/apis/mybusinessplaceactions_v1'

Mybusinessplaceactions = Google::Apis::MybusinessplaceactionsV1 # Alias the module
service = Mybusinessplaceactions::MyBusinessPlaceActionsService.new

See Also:

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMyBusinessPlaceActionsService

Returns a new instance of MyBusinessPlaceActionsService.



49
50
51
52
53
54
# File 'lib/google/apis/mybusinessplaceactions_v1/service.rb', line 49

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-mybusinessplaceactions_v1',
        client_version: Google::Apis::MybusinessplaceactionsV1::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.



42
43
44
# File 'lib/google/apis/mybusinessplaceactions_v1/service.rb', line 42

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.



47
48
49
# File 'lib/google/apis/mybusinessplaceactions_v1/service.rb', line 47

def quota_user
  @quota_user
end

Instance Method Details

Creates a place action link associated with the specified location, and returns it. The request is considered duplicate if the parent, place_action_link.uri and place_action_link.place_action_type are the same as a previous request.

Parameters:

  • parent (String)

    Required. The resource name of the location where to create this place action link. locations/location_id``.

  • place_action_link_object (Google::Apis::MybusinessplaceactionsV1::PlaceActionLink) (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



81
82
83
84
85
86
87
88
89
90
91
# File 'lib/google/apis/mybusinessplaceactions_v1/service.rb', line 81

def create_location_place_action_link(parent, place_action_link_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/placeActionLinks', options)
  command.request_representation = Google::Apis::MybusinessplaceactionsV1::PlaceActionLink::Representation
  command.request_object = place_action_link_object
  command.response_representation = Google::Apis::MybusinessplaceactionsV1::PlaceActionLink::Representation
  command.response_class = Google::Apis::MybusinessplaceactionsV1::PlaceActionLink
  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 a place action link from the specified location.

Parameters:

  • name (String)

    Required. The resource name of the place action link to remove from the location.

  • 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



114
115
116
117
118
119
120
121
122
# File 'lib/google/apis/mybusinessplaceactions_v1/service.rb', line 114

def delete_location_place_action_link(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::MybusinessplaceactionsV1::Empty::Representation
  command.response_class = Google::Apis::MybusinessplaceactionsV1::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

Gets the specified place action link.

Parameters:

  • name (String)

    Required. The name of the place action link to fetch.

  • 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



144
145
146
147
148
149
150
151
152
# File 'lib/google/apis/mybusinessplaceactions_v1/service.rb', line 144

def get_location_place_action_link(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::MybusinessplaceactionsV1::PlaceActionLink::Representation
  command.response_class = Google::Apis::MybusinessplaceactionsV1::PlaceActionLink
  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 place action links for the specified location.

Parameters:

  • parent (String)

    Required. The name of the location whose place action links will be listed. locations/location_id``.

  • filter (String) (defaults to: nil)

    Optional. A filter constraining the place action links to return. The response includes entries that match the filter. We support only the following filter:

    1. place_action_type=XYZ where XYZ is a valid PlaceActionType.
  • page_size (Fixnum) (defaults to: nil)

    Optional. How many place action links to return per page. Default of 10. The minimum is 1.

  • page_token (String) (defaults to: nil)

    Optional. If specified, returns the next page of place action links.

  • 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



184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/google/apis/mybusinessplaceactions_v1/service.rb', line 184

def list_location_place_action_links(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/placeActionLinks', options)
  command.response_representation = Google::Apis::MybusinessplaceactionsV1::ListPlaceActionLinksResponse::Representation
  command.response_class = Google::Apis::MybusinessplaceactionsV1::ListPlaceActionLinksResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.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

#list_place_action_type_metadata(filter: nil, language_code: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessplaceactionsV1::ListPlaceActionTypeMetadataResponse

Returns the list of available place action types for a location or country.

Parameters:

  • filter (String) (defaults to: nil)

    Optional. A filter constraining the place action types to return metadata for. The response includes entries that match the filter. We support only the following filters: 1. location=XYZ where XYZ is a string indicating the resource name of a location, in the format locations/location_id``. 2. region_code=XYZ where XYZ is a Unicode CLDR region code to find available action types. If no filter is provided, all place action types are returned.

  • language_code (String) (defaults to: nil)

    Optional. The IETF BCP-47 code of language to get display names in. If this language is not available, they will be provided in English.

  • page_size (Fixnum) (defaults to: nil)

    Optional. How many action types to include per page. Default is 10, minimum is 1.

  • page_token (String) (defaults to: nil)

    Optional. If specified, the next page of place action type metadata is retrieved. The pageToken is returned when a call to placeActionTypeMetadata. list returns more results than can fit into the requested page size.

  • 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



277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/google/apis/mybusinessplaceactions_v1/service.rb', line 277

def (filter: nil, language_code: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/placeActionTypeMetadata', options)
  command.response_representation = Google::Apis::MybusinessplaceactionsV1::ListPlaceActionTypeMetadataResponse::Representation
  command.response_class = Google::Apis::MybusinessplaceactionsV1::ListPlaceActionTypeMetadataResponse
  command.query['filter'] = filter unless filter.nil?
  command.query['languageCode'] = language_code unless language_code.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 specified place action link and returns it.

Parameters:

  • name (String)

    Optional. The resource name, in the format locations/location_id/ placeActionLinks/place_action_link_id`. The name field will only be considered in UpdatePlaceActionLink and DeletePlaceActionLink requests for updating and deleting links respectively. However, it will be ignored in CreatePlaceActionLink request, whereplace_action_link_id` will be assigned by the server on successful creation of a new link and returned as part of the response.

  • place_action_link_object (Google::Apis::MybusinessplaceactionsV1::PlaceActionLink) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Required. The specific fields to update. The only editable fields are uri, place_action_type and is_preferred. If the updated link already exists at the same location with the same place_action_type and uri, fails with an ALREADY_EXISTS error.

  • 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



229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/google/apis/mybusinessplaceactions_v1/service.rb', line 229

def patch_location_place_action_link(name, place_action_link_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::MybusinessplaceactionsV1::PlaceActionLink::Representation
  command.request_object = place_action_link_object
  command.response_representation = Google::Apis::MybusinessplaceactionsV1::PlaceActionLink::Representation
  command.response_class = Google::Apis::MybusinessplaceactionsV1::PlaceActionLink
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end