google-apis-mybusinessbusinessinformation_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,723 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module MybusinessbusinessinformationV1
23
+ # My Business Business Information API
24
+ #
25
+ # The My Business Business Information API provides an interface for managing
26
+ # business information on Google.
27
+ #
28
+ # @example
29
+ # require 'google/apis/mybusinessbusinessinformation_v1'
30
+ #
31
+ # Mybusinessbusinessinformation = Google::Apis::MybusinessbusinessinformationV1 # Alias the module
32
+ # service = Mybusinessbusinessinformation::MyBusinessBusinessInformationService.new
33
+ #
34
+ # @see https://developers.google.com/my-business/
35
+ class MyBusinessBusinessInformationService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://mybusinessbusinessinformation.googleapis.com/', '',
48
+ client_name: 'google-apis-mybusinessbusinessinformation_v1',
49
+ client_version: Google::Apis::MybusinessbusinessinformationV1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Creates a new Location that will be owned by the logged in user.
54
+ # @param [String] parent
55
+ # Required. The name of the account in which to create this location.
56
+ # @param [Google::Apis::MybusinessbusinessinformationV1::Location] location_object
57
+ # @param [String] request_id
58
+ # Optional. A unique request ID for the server to detect duplicated requests. We
59
+ # recommend using UUIDs. Max length is 50 characters.
60
+ # @param [Boolean] validate_only
61
+ # Optional. If true, the request is validated without actually creating the
62
+ # location.
63
+ # @param [String] fields
64
+ # Selector specifying which fields to include in a partial response.
65
+ # @param [String] quota_user
66
+ # Available to use for quota purposes for server-side applications. Can be any
67
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
68
+ # @param [Google::Apis::RequestOptions] options
69
+ # Request-specific options
70
+ #
71
+ # @yield [result, err] Result & error if block supplied
72
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::Location] parsed result object
73
+ # @yieldparam err [StandardError] error object if request failed
74
+ #
75
+ # @return [Google::Apis::MybusinessbusinessinformationV1::Location]
76
+ #
77
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
78
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
79
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
80
+ def create_account_location(parent, location_object = nil, request_id: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil, &block)
81
+ command = make_simple_command(:post, 'v1/{+parent}/locations', options)
82
+ command.request_representation = Google::Apis::MybusinessbusinessinformationV1::Location::Representation
83
+ command.request_object = location_object
84
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::Location::Representation
85
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::Location
86
+ command.params['parent'] = parent unless parent.nil?
87
+ command.query['requestId'] = request_id unless request_id.nil?
88
+ command.query['validateOnly'] = validate_only unless validate_only.nil?
89
+ command.query['fields'] = fields unless fields.nil?
90
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
91
+ execute_or_queue_command(command, &block)
92
+ end
93
+
94
+ # Lists the locations for the specified account.
95
+ # @param [String] parent
96
+ # Required. The name of the account to fetch locations from. If the parent
97
+ # Account is of AccountType PERSONAL, only Locations that are directly owned by
98
+ # the Account are returned, otherwise it will return all accessible locations
99
+ # from the Account, either directly or indirectly.
100
+ # @param [String] filter
101
+ # Optional. A filter constraining the locations to return. The response includes
102
+ # only entries that match the filter. If `filter` is empty, then constraints are
103
+ # applied and all locations (paginated) are retrieved for the requested account.
104
+ # For more information about valid fields and example usage, see [Work with
105
+ # Location Data Guide](https://developers.google.com/my-business/content/
106
+ # location-data#filter_results_when_you_list_locations).
107
+ # @param [String] order_by
108
+ # Optional. Sorting order for the request. Multiple fields should be comma-
109
+ # separated, following SQL syntax. The default sorting order is ascending. To
110
+ # specify descending order, a suffix " desc" should be added. Valid fields to
111
+ # order_by are title and store_code. For example: "title, store_code desc" or "
112
+ # title" or "store_code desc"
113
+ # @param [Fixnum] page_size
114
+ # Optional. How many locations to fetch per page. Default value is 10 if not set.
115
+ # Minimum is 1, and maximum page size is 100.
116
+ # @param [String] page_token
117
+ # Optional. If specified, it fetches the next `page` of locations. The page
118
+ # token is returned by previous calls to `ListLocations` when there were more
119
+ # locations than could fit in the requested page size.
120
+ # @param [String] read_mask
121
+ # Required. Read mask to specify what fields will be returned in the response.
122
+ # @param [String] fields
123
+ # Selector specifying which fields to include in a partial response.
124
+ # @param [String] quota_user
125
+ # Available to use for quota purposes for server-side applications. Can be any
126
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
127
+ # @param [Google::Apis::RequestOptions] options
128
+ # Request-specific options
129
+ #
130
+ # @yield [result, err] Result & error if block supplied
131
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::ListLocationsResponse] parsed result object
132
+ # @yieldparam err [StandardError] error object if request failed
133
+ #
134
+ # @return [Google::Apis::MybusinessbusinessinformationV1::ListLocationsResponse]
135
+ #
136
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
137
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
138
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
139
+ def list_account_locations(parent, filter: nil, order_by: nil, page_size: nil, page_token: nil, read_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
140
+ command = make_simple_command(:get, 'v1/{+parent}/locations', options)
141
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::ListLocationsResponse::Representation
142
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::ListLocationsResponse
143
+ command.params['parent'] = parent unless parent.nil?
144
+ command.query['filter'] = filter unless filter.nil?
145
+ command.query['orderBy'] = order_by unless order_by.nil?
146
+ command.query['pageSize'] = page_size unless page_size.nil?
147
+ command.query['pageToken'] = page_token unless page_token.nil?
148
+ command.query['readMask'] = read_mask unless read_mask.nil?
149
+ command.query['fields'] = fields unless fields.nil?
150
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
151
+ execute_or_queue_command(command, &block)
152
+ end
153
+
154
+ # Returns the list of attributes that would be available for a location with the
155
+ # given primary category and country.
156
+ # @param [String] category_name
157
+ # The primary category stable ID to find available attributes. Must be of the
158
+ # format categories/`category_id`.
159
+ # @param [String] language_code
160
+ # The BCP 47 code of language to get attribute display names in. If this
161
+ # language is not available, they will be provided in English.
162
+ # @param [Fixnum] page_size
163
+ # How many attributes to include per page. Default is 200, minimum is 1.
164
+ # @param [String] page_token
165
+ # If specified, the next page of attribute metadata is retrieved.
166
+ # @param [String] parent
167
+ # Resource name of the location to look up available attributes. If this field
168
+ # is set, category_name, region_code, language_code and show_all are not
169
+ # required and must not be set.
170
+ # @param [String] region_code
171
+ # The ISO 3166-1 alpha-2 country code to find available attributes.
172
+ # @param [Boolean] show_all
173
+ # Metadata for all available attributes are returned when this field is set to
174
+ # true, disregarding parent and category_name fields. language_code and
175
+ # region_code are required when show_all is set to true.
176
+ # @param [String] fields
177
+ # Selector specifying which fields to include in a partial response.
178
+ # @param [String] quota_user
179
+ # Available to use for quota purposes for server-side applications. Can be any
180
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
181
+ # @param [Google::Apis::RequestOptions] options
182
+ # Request-specific options
183
+ #
184
+ # @yield [result, err] Result & error if block supplied
185
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::ListAttributeMetadataResponse] parsed result object
186
+ # @yieldparam err [StandardError] error object if request failed
187
+ #
188
+ # @return [Google::Apis::MybusinessbusinessinformationV1::ListAttributeMetadataResponse]
189
+ #
190
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
191
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
192
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
193
+ def list_attributes(category_name: nil, language_code: nil, page_size: nil, page_token: nil, parent: nil, region_code: nil, show_all: nil, fields: nil, quota_user: nil, options: nil, &block)
194
+ command = make_simple_command(:get, 'v1/attributes', options)
195
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::ListAttributeMetadataResponse::Representation
196
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::ListAttributeMetadataResponse
197
+ command.query['categoryName'] = category_name unless category_name.nil?
198
+ command.query['languageCode'] = language_code unless language_code.nil?
199
+ command.query['pageSize'] = page_size unless page_size.nil?
200
+ command.query['pageToken'] = page_token unless page_token.nil?
201
+ command.query['parent'] = parent unless parent.nil?
202
+ command.query['regionCode'] = region_code unless region_code.nil?
203
+ command.query['showAll'] = show_all unless show_all.nil?
204
+ command.query['fields'] = fields unless fields.nil?
205
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
206
+ execute_or_queue_command(command, &block)
207
+ end
208
+
209
+ # Returns a list of business categories for the provided language and GConcept
210
+ # ids.
211
+ # @param [String] language_code
212
+ # Required. The BCP 47 code of language that the category names should be
213
+ # returned in.
214
+ # @param [Array<String>, String] names
215
+ # Required. At least one name must be set. The GConcept ids the localized
216
+ # category names should be returned for. To return details for more than one
217
+ # category, repeat this parameter in the request.
218
+ # @param [String] region_code
219
+ # Optional. The ISO 3166-1 alpha-2 country code used to infer non-standard
220
+ # language.
221
+ # @param [String] view
222
+ # Required. Specifies which parts to the Category resource should be returned in
223
+ # the response.
224
+ # @param [String] fields
225
+ # Selector specifying which fields to include in a partial response.
226
+ # @param [String] quota_user
227
+ # Available to use for quota purposes for server-side applications. Can be any
228
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
229
+ # @param [Google::Apis::RequestOptions] options
230
+ # Request-specific options
231
+ #
232
+ # @yield [result, err] Result & error if block supplied
233
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::BatchGetCategoriesResponse] parsed result object
234
+ # @yieldparam err [StandardError] error object if request failed
235
+ #
236
+ # @return [Google::Apis::MybusinessbusinessinformationV1::BatchGetCategoriesResponse]
237
+ #
238
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
239
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
240
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
241
+ def batch_category_get(language_code: nil, names: nil, region_code: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
242
+ command = make_simple_command(:get, 'v1/categories:batchGet', options)
243
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::BatchGetCategoriesResponse::Representation
244
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::BatchGetCategoriesResponse
245
+ command.query['languageCode'] = language_code unless language_code.nil?
246
+ command.query['names'] = names unless names.nil?
247
+ command.query['regionCode'] = region_code unless region_code.nil?
248
+ command.query['view'] = view unless view.nil?
249
+ command.query['fields'] = fields unless fields.nil?
250
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
251
+ execute_or_queue_command(command, &block)
252
+ end
253
+
254
+ # Returns a list of business categories. Search will match the category name but
255
+ # not the category ID. Search only matches the front of a category name (that is,
256
+ # 'food' may return 'Food Court' but not 'Fast Food Restaurant').
257
+ # @param [String] filter
258
+ # Optional. Filter string from user. The only field that supported is `
259
+ # displayName`. Eg: `filter=displayName=foo`.
260
+ # @param [String] language_code
261
+ # Required. The BCP 47 code of language.
262
+ # @param [Fixnum] page_size
263
+ # Optional. How many categories to fetch per page. Default is 100, minimum is 1,
264
+ # and maximum page size is 100.
265
+ # @param [String] page_token
266
+ # Optional. If specified, the next page of categories will be fetched.
267
+ # @param [String] region_code
268
+ # Required. The ISO 3166-1 alpha-2 country code.
269
+ # @param [String] view
270
+ # Required. Specifies which parts to the Category resource should be returned in
271
+ # the response.
272
+ # @param [String] fields
273
+ # Selector specifying which fields to include in a partial response.
274
+ # @param [String] quota_user
275
+ # Available to use for quota purposes for server-side applications. Can be any
276
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
277
+ # @param [Google::Apis::RequestOptions] options
278
+ # Request-specific options
279
+ #
280
+ # @yield [result, err] Result & error if block supplied
281
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::ListCategoriesResponse] parsed result object
282
+ # @yieldparam err [StandardError] error object if request failed
283
+ #
284
+ # @return [Google::Apis::MybusinessbusinessinformationV1::ListCategoriesResponse]
285
+ #
286
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
287
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
288
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
289
+ def list_categories(filter: nil, language_code: nil, page_size: nil, page_token: nil, region_code: nil, view: nil, fields: nil, quota_user: nil, options: nil, &block)
290
+ command = make_simple_command(:get, 'v1/categories', options)
291
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::ListCategoriesResponse::Representation
292
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::ListCategoriesResponse
293
+ command.query['filter'] = filter unless filter.nil?
294
+ command.query['languageCode'] = language_code unless language_code.nil?
295
+ command.query['pageSize'] = page_size unless page_size.nil?
296
+ command.query['pageToken'] = page_token unless page_token.nil?
297
+ command.query['regionCode'] = region_code unless region_code.nil?
298
+ command.query['view'] = view unless view.nil?
299
+ command.query['fields'] = fields unless fields.nil?
300
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
301
+ execute_or_queue_command(command, &block)
302
+ end
303
+
304
+ # Gets the specified chain. Returns `NOT_FOUND` if the chain does not exist.
305
+ # @param [String] name
306
+ # Required. The chain's resource name, in the format `chains/`chain_place_id``.
307
+ # @param [String] fields
308
+ # Selector specifying which fields to include in a partial response.
309
+ # @param [String] quota_user
310
+ # Available to use for quota purposes for server-side applications. Can be any
311
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
312
+ # @param [Google::Apis::RequestOptions] options
313
+ # Request-specific options
314
+ #
315
+ # @yield [result, err] Result & error if block supplied
316
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::Chain] parsed result object
317
+ # @yieldparam err [StandardError] error object if request failed
318
+ #
319
+ # @return [Google::Apis::MybusinessbusinessinformationV1::Chain]
320
+ #
321
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
322
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
323
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
324
+ def get_chain(name, fields: nil, quota_user: nil, options: nil, &block)
325
+ command = make_simple_command(:get, 'v1/{+name}', options)
326
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::Chain::Representation
327
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::Chain
328
+ command.params['name'] = name unless name.nil?
329
+ command.query['fields'] = fields unless fields.nil?
330
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
331
+ execute_or_queue_command(command, &block)
332
+ end
333
+
334
+ # Searches the chain based on chain name.
335
+ # @param [String] chain_name
336
+ # Required. Search for a chain by its name. Exact/partial/fuzzy/related queries
337
+ # are supported. Examples: "walmart", "wal-mart", "walmmmart", "沃尔玛"
338
+ # @param [Fixnum] page_size
339
+ # The maximum number of matched chains to return from this query. The default is
340
+ # 10. The maximum possible value is 500.
341
+ # @param [String] fields
342
+ # Selector specifying which fields to include in a partial response.
343
+ # @param [String] quota_user
344
+ # Available to use for quota purposes for server-side applications. Can be any
345
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
346
+ # @param [Google::Apis::RequestOptions] options
347
+ # Request-specific options
348
+ #
349
+ # @yield [result, err] Result & error if block supplied
350
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::SearchChainsResponse] parsed result object
351
+ # @yieldparam err [StandardError] error object if request failed
352
+ #
353
+ # @return [Google::Apis::MybusinessbusinessinformationV1::SearchChainsResponse]
354
+ #
355
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
356
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
357
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
358
+ def search_chains(chain_name: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block)
359
+ command = make_simple_command(:get, 'v1/chains:search', options)
360
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::SearchChainsResponse::Representation
361
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::SearchChainsResponse
362
+ command.query['chainName'] = chain_name unless chain_name.nil?
363
+ command.query['pageSize'] = page_size unless page_size.nil?
364
+ command.query['fields'] = fields unless fields.nil?
365
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
366
+ execute_or_queue_command(command, &block)
367
+ end
368
+
369
+ # Search all of the possible locations that are a match to the specified request.
370
+ # @param [Google::Apis::MybusinessbusinessinformationV1::SearchGoogleLocationsRequest] search_google_locations_request_object
371
+ # @param [String] fields
372
+ # Selector specifying which fields to include in a partial response.
373
+ # @param [String] quota_user
374
+ # Available to use for quota purposes for server-side applications. Can be any
375
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
376
+ # @param [Google::Apis::RequestOptions] options
377
+ # Request-specific options
378
+ #
379
+ # @yield [result, err] Result & error if block supplied
380
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::SearchGoogleLocationsResponse] parsed result object
381
+ # @yieldparam err [StandardError] error object if request failed
382
+ #
383
+ # @return [Google::Apis::MybusinessbusinessinformationV1::SearchGoogleLocationsResponse]
384
+ #
385
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
386
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
387
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
388
+ def search_google_locations(search_google_locations_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
389
+ command = make_simple_command(:post, 'v1/googleLocations:search', options)
390
+ command.request_representation = Google::Apis::MybusinessbusinessinformationV1::SearchGoogleLocationsRequest::Representation
391
+ command.request_object = search_google_locations_request_object
392
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::SearchGoogleLocationsResponse::Representation
393
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::SearchGoogleLocationsResponse
394
+ command.query['fields'] = fields unless fields.nil?
395
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
396
+ execute_or_queue_command(command, &block)
397
+ end
398
+
399
+ # Associates a location to a place ID. Any previous association is overwritten.
400
+ # This operation is only valid if the location is unverified. The association
401
+ # must be valid, that is, it appears in the list of `SearchGoogleLocations`.
402
+ # @param [String] name
403
+ # Required. The resource name of the location to associate.
404
+ # @param [Google::Apis::MybusinessbusinessinformationV1::AssociateLocationRequest] associate_location_request_object
405
+ # @param [String] fields
406
+ # Selector specifying which fields to include in a partial response.
407
+ # @param [String] quota_user
408
+ # Available to use for quota purposes for server-side applications. Can be any
409
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
410
+ # @param [Google::Apis::RequestOptions] options
411
+ # Request-specific options
412
+ #
413
+ # @yield [result, err] Result & error if block supplied
414
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::Empty] parsed result object
415
+ # @yieldparam err [StandardError] error object if request failed
416
+ #
417
+ # @return [Google::Apis::MybusinessbusinessinformationV1::Empty]
418
+ #
419
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
420
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
421
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
422
+ def associate_location(name, associate_location_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
423
+ command = make_simple_command(:post, 'v1/{+name}:associate', options)
424
+ command.request_representation = Google::Apis::MybusinessbusinessinformationV1::AssociateLocationRequest::Representation
425
+ command.request_object = associate_location_request_object
426
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::Empty::Representation
427
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::Empty
428
+ command.params['name'] = name unless name.nil?
429
+ command.query['fields'] = fields unless fields.nil?
430
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
431
+ execute_or_queue_command(command, &block)
432
+ end
433
+
434
+ # Clears an association between a location and its place ID. This operation is
435
+ # only valid if the location is unverified.
436
+ # @param [String] name
437
+ # Required. The resource name of the location to disassociate.
438
+ # @param [Google::Apis::MybusinessbusinessinformationV1::ClearLocationAssociationRequest] clear_location_association_request_object
439
+ # @param [String] fields
440
+ # Selector specifying which fields to include in a partial response.
441
+ # @param [String] quota_user
442
+ # Available to use for quota purposes for server-side applications. Can be any
443
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
444
+ # @param [Google::Apis::RequestOptions] options
445
+ # Request-specific options
446
+ #
447
+ # @yield [result, err] Result & error if block supplied
448
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::Empty] parsed result object
449
+ # @yieldparam err [StandardError] error object if request failed
450
+ #
451
+ # @return [Google::Apis::MybusinessbusinessinformationV1::Empty]
452
+ #
453
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
454
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
455
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
456
+ def clear_location_association(name, clear_location_association_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
457
+ command = make_simple_command(:post, 'v1/{+name}:clearLocationAssociation', options)
458
+ command.request_representation = Google::Apis::MybusinessbusinessinformationV1::ClearLocationAssociationRequest::Representation
459
+ command.request_object = clear_location_association_request_object
460
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::Empty::Representation
461
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::Empty
462
+ command.params['name'] = name unless name.nil?
463
+ command.query['fields'] = fields unless fields.nil?
464
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
465
+ execute_or_queue_command(command, &block)
466
+ end
467
+
468
+ # Deletes a location. If this location cannot be deleted using the API and it is
469
+ # marked so in the `google.mybusiness.businessinformation.v1.LocationState`, use
470
+ # the [Google My Business](https://business.google.com/manage/) website.
471
+ # @param [String] name
472
+ # Required. The name of the location to delete.
473
+ # @param [String] fields
474
+ # Selector specifying which fields to include in a partial response.
475
+ # @param [String] quota_user
476
+ # Available to use for quota purposes for server-side applications. Can be any
477
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
478
+ # @param [Google::Apis::RequestOptions] options
479
+ # Request-specific options
480
+ #
481
+ # @yield [result, err] Result & error if block supplied
482
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::Empty] parsed result object
483
+ # @yieldparam err [StandardError] error object if request failed
484
+ #
485
+ # @return [Google::Apis::MybusinessbusinessinformationV1::Empty]
486
+ #
487
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
488
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
489
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
490
+ def delete_location(name, fields: nil, quota_user: nil, options: nil, &block)
491
+ command = make_simple_command(:delete, 'v1/{+name}', options)
492
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::Empty::Representation
493
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::Empty
494
+ command.params['name'] = name unless name.nil?
495
+ command.query['fields'] = fields unless fields.nil?
496
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
497
+ execute_or_queue_command(command, &block)
498
+ end
499
+
500
+ # Returns the specified location.
501
+ # @param [String] name
502
+ # Required. The name of the location to fetch.
503
+ # @param [String] read_mask
504
+ # Required. Read mask to specify what fields will be returned in the response.
505
+ # @param [String] fields
506
+ # Selector specifying which fields to include in a partial response.
507
+ # @param [String] quota_user
508
+ # Available to use for quota purposes for server-side applications. Can be any
509
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
510
+ # @param [Google::Apis::RequestOptions] options
511
+ # Request-specific options
512
+ #
513
+ # @yield [result, err] Result & error if block supplied
514
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::Location] parsed result object
515
+ # @yieldparam err [StandardError] error object if request failed
516
+ #
517
+ # @return [Google::Apis::MybusinessbusinessinformationV1::Location]
518
+ #
519
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
520
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
521
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
522
+ def get_location(name, read_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
523
+ command = make_simple_command(:get, 'v1/{+name}', options)
524
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::Location::Representation
525
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::Location
526
+ command.params['name'] = name unless name.nil?
527
+ command.query['readMask'] = read_mask unless read_mask.nil?
528
+ command.query['fields'] = fields unless fields.nil?
529
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
530
+ execute_or_queue_command(command, &block)
531
+ end
532
+
533
+ # Looks up all the attributes set for a given location.
534
+ # @param [String] name
535
+ # Required. Google identifier for this location in the form of `locations/`
536
+ # location_id`/attributes`.
537
+ # @param [String] fields
538
+ # Selector specifying which fields to include in a partial response.
539
+ # @param [String] quota_user
540
+ # Available to use for quota purposes for server-side applications. Can be any
541
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
542
+ # @param [Google::Apis::RequestOptions] options
543
+ # Request-specific options
544
+ #
545
+ # @yield [result, err] Result & error if block supplied
546
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::Attributes] parsed result object
547
+ # @yieldparam err [StandardError] error object if request failed
548
+ #
549
+ # @return [Google::Apis::MybusinessbusinessinformationV1::Attributes]
550
+ #
551
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
552
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
553
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
554
+ def get_location_attributes(name, fields: nil, quota_user: nil, options: nil, &block)
555
+ command = make_simple_command(:get, 'v1/{+name}', options)
556
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::Attributes::Representation
557
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::Attributes
558
+ command.params['name'] = name unless name.nil?
559
+ command.query['fields'] = fields unless fields.nil?
560
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
561
+ execute_or_queue_command(command, &block)
562
+ end
563
+
564
+ # Gets the Google-updated version of the specified location.
565
+ # @param [String] name
566
+ # Required. The name of the location to fetch.
567
+ # @param [String] read_mask
568
+ # Required. Read mask to specify what fields will be returned in the response.
569
+ # @param [String] fields
570
+ # Selector specifying which fields to include in a partial response.
571
+ # @param [String] quota_user
572
+ # Available to use for quota purposes for server-side applications. Can be any
573
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
574
+ # @param [Google::Apis::RequestOptions] options
575
+ # Request-specific options
576
+ #
577
+ # @yield [result, err] Result & error if block supplied
578
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::GoogleUpdatedLocation] parsed result object
579
+ # @yieldparam err [StandardError] error object if request failed
580
+ #
581
+ # @return [Google::Apis::MybusinessbusinessinformationV1::GoogleUpdatedLocation]
582
+ #
583
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
584
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
585
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
586
+ def get_location_google_updated(name, read_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
587
+ command = make_simple_command(:get, 'v1/{+name}:getGoogleUpdated', options)
588
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::GoogleUpdatedLocation::Representation
589
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::GoogleUpdatedLocation
590
+ command.params['name'] = name unless name.nil?
591
+ command.query['readMask'] = read_mask unless read_mask.nil?
592
+ command.query['fields'] = fields unless fields.nil?
593
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
594
+ execute_or_queue_command(command, &block)
595
+ end
596
+
597
+ # Updates the specified location.
598
+ # @param [String] name
599
+ # Google identifier for this location in the form: `locations/`location_id``.
600
+ # @param [Google::Apis::MybusinessbusinessinformationV1::Location] location_object
601
+ # @param [String] update_mask
602
+ # Required. The specific fields to update.
603
+ # @param [Boolean] validate_only
604
+ # Optional. If true, the request is validated without actually updating the
605
+ # location. When this field is set, we will only return validation errors if
606
+ # there were any. The response will be empty if no errors were found.
607
+ # @param [String] fields
608
+ # Selector specifying which fields to include in a partial response.
609
+ # @param [String] quota_user
610
+ # Available to use for quota purposes for server-side applications. Can be any
611
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
612
+ # @param [Google::Apis::RequestOptions] options
613
+ # Request-specific options
614
+ #
615
+ # @yield [result, err] Result & error if block supplied
616
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::Location] parsed result object
617
+ # @yieldparam err [StandardError] error object if request failed
618
+ #
619
+ # @return [Google::Apis::MybusinessbusinessinformationV1::Location]
620
+ #
621
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
622
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
623
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
624
+ def patch_location(name, location_object = nil, update_mask: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil, &block)
625
+ command = make_simple_command(:patch, 'v1/{+name}', options)
626
+ command.request_representation = Google::Apis::MybusinessbusinessinformationV1::Location::Representation
627
+ command.request_object = location_object
628
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::Location::Representation
629
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::Location
630
+ command.params['name'] = name unless name.nil?
631
+ command.query['updateMask'] = update_mask unless update_mask.nil?
632
+ command.query['validateOnly'] = validate_only unless validate_only.nil?
633
+ command.query['fields'] = fields unless fields.nil?
634
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
635
+ execute_or_queue_command(command, &block)
636
+ end
637
+
638
+ # Update attributes for a given location.
639
+ # @param [String] name
640
+ # Required. Google identifier for this location in the form of `locations/`
641
+ # location_id`/attributes`.
642
+ # @param [Google::Apis::MybusinessbusinessinformationV1::Attributes] attributes_object
643
+ # @param [String] attribute_mask
644
+ # Required. Attribute name of attributes that you'd like to update. Represented
645
+ # by `attributes/`attribute``. Updates: All attributes provided in the
646
+ # attributes field that you would like to update must be set in the `
647
+ # attribute_mask`. Attributes set in the above list but not in the `
648
+ # attribute_mask` will be ignored. Deletes: If you'd like to delete certain
649
+ # attributes, they must be specified in the `attribute_mask` with no matching
650
+ # entry in the attributes list. If you'd like to delete all attributes set on a
651
+ # location, you should look up all the applicable attributes for the location
652
+ # and then add them to the `attribute_mask` with an empty attributes field.
653
+ # @param [String] fields
654
+ # Selector specifying which fields to include in a partial response.
655
+ # @param [String] quota_user
656
+ # Available to use for quota purposes for server-side applications. Can be any
657
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
658
+ # @param [Google::Apis::RequestOptions] options
659
+ # Request-specific options
660
+ #
661
+ # @yield [result, err] Result & error if block supplied
662
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::Attributes] parsed result object
663
+ # @yieldparam err [StandardError] error object if request failed
664
+ #
665
+ # @return [Google::Apis::MybusinessbusinessinformationV1::Attributes]
666
+ #
667
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
668
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
669
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
670
+ def update_location_attributes(name, attributes_object = nil, attribute_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
671
+ command = make_simple_command(:patch, 'v1/{+name}', options)
672
+ command.request_representation = Google::Apis::MybusinessbusinessinformationV1::Attributes::Representation
673
+ command.request_object = attributes_object
674
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::Attributes::Representation
675
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::Attributes
676
+ command.params['name'] = name unless name.nil?
677
+ command.query['attributeMask'] = attribute_mask unless attribute_mask.nil?
678
+ command.query['fields'] = fields unless fields.nil?
679
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
680
+ execute_or_queue_command(command, &block)
681
+ end
682
+
683
+ # Gets the Google-updated version of the specified location.
684
+ # @param [String] name
685
+ # Required. Google identifier for this location in the form of `locations/`
686
+ # location_id`/attributes`.
687
+ # @param [String] fields
688
+ # Selector specifying which fields to include in a partial response.
689
+ # @param [String] quota_user
690
+ # Available to use for quota purposes for server-side applications. Can be any
691
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
692
+ # @param [Google::Apis::RequestOptions] options
693
+ # Request-specific options
694
+ #
695
+ # @yield [result, err] Result & error if block supplied
696
+ # @yieldparam result [Google::Apis::MybusinessbusinessinformationV1::Attributes] parsed result object
697
+ # @yieldparam err [StandardError] error object if request failed
698
+ #
699
+ # @return [Google::Apis::MybusinessbusinessinformationV1::Attributes]
700
+ #
701
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
702
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
703
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
704
+ def get_location_attribute_google_updated(name, fields: nil, quota_user: nil, options: nil, &block)
705
+ command = make_simple_command(:get, 'v1/{+name}:getGoogleUpdated', options)
706
+ command.response_representation = Google::Apis::MybusinessbusinessinformationV1::Attributes::Representation
707
+ command.response_class = Google::Apis::MybusinessbusinessinformationV1::Attributes
708
+ command.params['name'] = name unless name.nil?
709
+ command.query['fields'] = fields unless fields.nil?
710
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
711
+ execute_or_queue_command(command, &block)
712
+ end
713
+
714
+ protected
715
+
716
+ def apply_command_defaults(command)
717
+ command.query['key'] = key unless key.nil?
718
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
719
+ end
720
+ end
721
+ end
722
+ end
723
+ end