Debian Codegraph @

mybusinessbusinessinformation/v1/mybusinessbusinessinformation-gen.go

raw
1 // Copyright 2026 Google LLC.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // Code generated file. DO NOT EDIT.
6
7 // Package mybusinessbusinessinformation provides access to the My Business Business Information API.
8 //
9 // For product documentation, see: https://developers.google.com/my-business/
10 //
11 // # Library status
12 //
13 // These client libraries are officially supported by Google. However, this
14 // library is considered complete and is in maintenance mode. This means
15 // that we will address critical bugs and security issues but will not add
16 // any new features.
17 //
18 // When possible, we recommend using our newer
19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
20 // that are still actively being worked and iterated on.
21 //
22 // # Creating a client
23 //
24 // Usage example:
25 //
26 // import "google.golang.org/api/mybusinessbusinessinformation/v1"
27 // ...
28 // ctx := context.Background()
29 // mybusinessbusinessinformationService, err := mybusinessbusinessinformation.NewService(ctx)
30 //
31 // In this example, Google Application Default Credentials are used for
32 // authentication. For information on how to create and obtain Application
33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
34 //
35 // # Other authentication options
36 //
37 // To use an API key for authentication (note: some APIs do not support API
38 // keys), use [google.golang.org/api/option.WithAPIKey]:
39 //
40 // mybusinessbusinessinformationService, err := mybusinessbusinessinformation.NewService(ctx, option.WithAPIKey("AIza..."))
41 //
42 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
43 // flow, use [google.golang.org/api/option.WithTokenSource]:
44 //
45 // config := &oauth2.Config{...}
46 // // ...
47 // token, err := config.Exchange(ctx, ...)
48 // mybusinessbusinessinformationService, err := mybusinessbusinessinformation.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
49 //
50 // See [google.golang.org/api/option.ClientOption] for details on options.
51 package mybusinessbusinessinformation // import "google.golang.org/api/mybusinessbusinessinformation/v1"
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "log/slog"
61 "net/http"
62 "net/url"
63 "strconv"
64 "strings"
65
66 "github.com/googleapis/gax-go/v2/internallog"
67 googleapi "google.golang.org/api/googleapi"
68 internal "google.golang.org/api/internal"
69 gensupport "google.golang.org/api/internal/gensupport"
70 option "google.golang.org/api/option"
71 internaloption "google.golang.org/api/option/internaloption"
72 htransport "google.golang.org/api/transport/http"
73 )
74
75 // Always reference these packages, just in case the auto-generated code
76 // below doesn't.
77 var _ = bytes.NewBuffer
78 var _ = strconv.Itoa
79 var _ = fmt.Sprintf
80 var _ = json.NewDecoder
81 var _ = io.Copy
82 var _ = url.Parse
83 var _ = gensupport.MarshalJSON
84 var _ = googleapi.Version
85 var _ = errors.New
86 var _ = strings.Replace
87 var _ = context.Canceled
88 var _ = internaloption.WithDefaultEndpoint
89 var _ = internal.Version
90 var _ = internallog.New
91
92 const apiId = "mybusinessbusinessinformation:v1"
93 const apiName = "mybusinessbusinessinformation"
94 const apiVersion = "v1"
95 const basePath = "https://mybusinessbusinessinformation.googleapis.com/"
96 const basePathTemplate = "https://mybusinessbusinessinformation.UNIVERSE_DOMAIN/"
97 const mtlsBasePath = "https://mybusinessbusinessinformation.mtls.googleapis.com/"
98
99 // NewService creates a new Service.
100 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
101 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
102 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
103 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
104 opts = append(opts, internaloption.EnableNewAuthLibrary())
105 client, endpoint, err := htransport.NewClient(ctx, opts...)
106 if err != nil {
107 return nil, err
108 }
109 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
110 s.Accounts = NewAccountsService(s)
111 s.Attributes = NewAttributesService(s)
112 s.Categories = NewCategoriesService(s)
113 s.Chains = NewChainsService(s)
114 s.GoogleLocations = NewGoogleLocationsService(s)
115 s.Locations = NewLocationsService(s)
116 if endpoint != "" {
117 s.BasePath = endpoint
118 }
119 return s, nil
120 }
121
122 // New creates a new Service. It uses the provided http.Client for requests.
123 //
124 // Deprecated: please use NewService instead.
125 // To provide a custom HTTP client, use option.WithHTTPClient.
126 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
127 func New(client *http.Client) (*Service, error) {
128 if client == nil {
129 return nil, errors.New("client is nil")
130 }
131 return NewService(context.TODO(), option.WithHTTPClient(client))
132 }
133
134 type Service struct {
135 client *http.Client
136 logger *slog.Logger
137 BasePath string // API endpoint base URL
138 UserAgent string // optional additional User-Agent fragment
139
140 Accounts *AccountsService
141
142 Attributes *AttributesService
143
144 Categories *CategoriesService
145
146 Chains *ChainsService
147
148 GoogleLocations *GoogleLocationsService
149
150 Locations *LocationsService
151 }
152
153 func (s *Service) userAgent() string {
154 if s.UserAgent == "" {
155 return googleapi.UserAgent
156 }
157 return googleapi.UserAgent + " " + s.UserAgent
158 }
159
160 func NewAccountsService(s *Service) *AccountsService {
161 rs := &AccountsService{s: s}
162 rs.Locations = NewAccountsLocationsService(s)
163 return rs
164 }
165
166 type AccountsService struct {
167 s *Service
168
169 Locations *AccountsLocationsService
170 }
171
172 func NewAccountsLocationsService(s *Service) *AccountsLocationsService {
173 rs := &AccountsLocationsService{s: s}
174 return rs
175 }
176
177 type AccountsLocationsService struct {
178 s *Service
179 }
180
181 func NewAttributesService(s *Service) *AttributesService {
182 rs := &AttributesService{s: s}
183 return rs
184 }
185
186 type AttributesService struct {
187 s *Service
188 }
189
190 func NewCategoriesService(s *Service) *CategoriesService {
191 rs := &CategoriesService{s: s}
192 return rs
193 }
194
195 type CategoriesService struct {
196 s *Service
197 }
198
199 func NewChainsService(s *Service) *ChainsService {
200 rs := &ChainsService{s: s}
201 return rs
202 }
203
204 type ChainsService struct {
205 s *Service
206 }
207
208 func NewGoogleLocationsService(s *Service) *GoogleLocationsService {
209 rs := &GoogleLocationsService{s: s}
210 return rs
211 }
212
213 type GoogleLocationsService struct {
214 s *Service
215 }
216
217 func NewLocationsService(s *Service) *LocationsService {
218 rs := &LocationsService{s: s}
219 rs.Attributes = NewLocationsAttributesService(s)
220 return rs
221 }
222
223 type LocationsService struct {
224 s *Service
225
226 Attributes *LocationsAttributesService
227 }
228
229 func NewLocationsAttributesService(s *Service) *LocationsAttributesService {
230 rs := &LocationsAttributesService{s: s}
231 return rs
232 }
233
234 type LocationsAttributesService struct {
235 s *Service
236 }
237
238 // AdWordsLocationExtensions: Additional information that is surfaced in
239 // AdWords.
240 type AdWordsLocationExtensions struct {
241 // AdPhone: Required. An alternate phone number to display on AdWords location
242 // extensions instead of the location's primary phone number.
243 AdPhone string `json:"adPhone,omitempty"`
244 // ForceSendFields is a list of field names (e.g. "AdPhone") to unconditionally
245 // include in API requests. By default, fields with empty or default values are
246 // omitted from API requests. See
247 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
248 // details.
249 ForceSendFields []string `json:"-"`
250 // NullFields is a list of field names (e.g. "AdPhone") to include in API
251 // requests with the JSON null value. By default, fields with empty values are
252 // omitted from API requests. See
253 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
254 NullFields []string `json:"-"`
255 }
256
257 func (s AdWordsLocationExtensions) MarshalJSON() ([]byte, error) {
258 type NoMethod AdWordsLocationExtensions
259 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
260 }
261
262 // Attribute: A location attribute. Attributes provide additional information
263 // about a location. The attributes that can be set on a location may vary
264 // based on the properties of that location (for example, category). Available
265 // attributes are determined by Google and may be added and removed without API
266 // changes.
267 type Attribute struct {
268 // Name: Required. The resource name for this attribute.
269 Name string `json:"name,omitempty"`
270 // RepeatedEnumValue: When the attribute value type is REPEATED_ENUM, this
271 // contains the attribute value, and the other values fields must be empty.
272 RepeatedEnumValue *RepeatedEnumAttributeValue `json:"repeatedEnumValue,omitempty"`
273 // UriValues: When the attribute value type is URL, this field contains the
274 // value(s) for this attribute, and the other values fields must be empty.
275 UriValues []*UriAttributeValue `json:"uriValues,omitempty"`
276 // ValueType: Output only. The type of value that this attribute contains. This
277 // should be used to determine how to interpret the value.
278 //
279 // Possible values:
280 // "ATTRIBUTE_VALUE_TYPE_UNSPECIFIED" - Not specified.
281 // "BOOL" - The values for this attribute are boolean values.
282 // "ENUM" - The attribute has a predetermined list of available values that
283 // can be used. Metadata for this attribute will list these values.
284 // "URL" - The values for this attribute are URLs.
285 // "REPEATED_ENUM" - The attribute value is an enum with multiple possible
286 // values that can be explicitly set or unset.
287 ValueType string `json:"valueType,omitempty"`
288 // Values: The values for this attribute. The type of the values supplied must
289 // match that expected for that attribute. This is a repeated field where
290 // multiple attribute values may be provided. Attribute types only support one
291 // value.
292 Values []interface{} `json:"values,omitempty"`
293 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally
294 // include in API requests. By default, fields with empty or default values are
295 // omitted from API requests. See
296 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
297 // details.
298 ForceSendFields []string `json:"-"`
299 // NullFields is a list of field names (e.g. "Name") to include in API requests
300 // with the JSON null value. By default, fields with empty values are omitted
301 // from API requests. See
302 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
303 NullFields []string `json:"-"`
304 }
305
306 func (s Attribute) MarshalJSON() ([]byte, error) {
307 type NoMethod Attribute
308 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
309 }
310
311 // AttributeMetadata: Metadata for an attribute. Contains display information
312 // for the attribute, including a localized name and a heading for grouping
313 // related attributes together.
314 type AttributeMetadata struct {
315 // Deprecated -- If true, the attribute is deprecated and should no longer be
316 // used. If deprecated, updating this attribute will not result in an error,
317 // but updates will not be saved. At some point after being deprecated, the
318 // attribute will be removed entirely and it will become an error.
319 Deprecated bool `json:"deprecated,omitempty"`
320 // DisplayName: The localized display name for the attribute, if available;
321 // otherwise, the English display name.
322 DisplayName string `json:"displayName,omitempty"`
323 // GroupDisplayName: The localized display name of the group that contains this
324 // attribute, if available; otherwise, the English group name. Related
325 // attributes are collected into a group and should be displayed together under
326 // the heading given here.
327 GroupDisplayName string `json:"groupDisplayName,omitempty"`
328 // Parent: The unique identifier for the attribute.
329 Parent string `json:"parent,omitempty"`
330 // Repeatable: If true, the attribute supports multiple values. If false, only
331 // a single value should be provided.
332 Repeatable bool `json:"repeatable,omitempty"`
333 // ValueMetadata: For some types of attributes (for example, enums), a list of
334 // supported values and corresponding display names for those values is
335 // provided.
336 ValueMetadata []*AttributeValueMetadata `json:"valueMetadata,omitempty"`
337 // ValueType: The value type for the attribute. Values set and retrieved should
338 // be expected to be of this type.
339 //
340 // Possible values:
341 // "ATTRIBUTE_VALUE_TYPE_UNSPECIFIED" - Not specified.
342 // "BOOL" - The values for this attribute are boolean values.
343 // "ENUM" - The attribute has a predetermined list of available values that
344 // can be used. Metadata for this attribute will list these values.
345 // "URL" - The values for this attribute are URLs.
346 // "REPEATED_ENUM" - The attribute value is an enum with multiple possible
347 // values that can be explicitly set or unset.
348 ValueType string `json:"valueType,omitempty"`
349 // ForceSendFields is a list of field names (e.g. "Deprecated") to
350 // unconditionally include in API requests. By default, fields with empty or
351 // default values are omitted from API requests. See
352 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
353 // details.
354 ForceSendFields []string `json:"-"`
355 // NullFields is a list of field names (e.g. "Deprecated") to include in API
356 // requests with the JSON null value. By default, fields with empty values are
357 // omitted from API requests. See
358 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
359 NullFields []string `json:"-"`
360 }
361
362 func (s AttributeMetadata) MarshalJSON() ([]byte, error) {
363 type NoMethod AttributeMetadata
364 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
365 }
366
367 // AttributeValueMetadata: Metadata for supported attribute values.
368 type AttributeValueMetadata struct {
369 // DisplayName: The display name for this value, localized where available;
370 // otherwise, in English. The value display name is intended to be used in
371 // context with the attribute display name. For example, for a "WiFi" enum
372 // attribute, this could contain "Paid" to represent paid Wi-Fi.
373 DisplayName string `json:"displayName,omitempty"`
374 // Value: The attribute value.
375 Value interface{} `json:"value,omitempty"`
376 // ForceSendFields is a list of field names (e.g. "DisplayName") to
377 // unconditionally include in API requests. By default, fields with empty or
378 // default values are omitted from API requests. See
379 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
380 // details.
381 ForceSendFields []string `json:"-"`
382 // NullFields is a list of field names (e.g. "DisplayName") to include in API
383 // requests with the JSON null value. By default, fields with empty values are
384 // omitted from API requests. See
385 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
386 NullFields []string `json:"-"`
387 }
388
389 func (s AttributeValueMetadata) MarshalJSON() ([]byte, error) {
390 type NoMethod AttributeValueMetadata
391 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
392 }
393
394 // Attributes: A container for all the attributes for a given location.
395 type Attributes struct {
396 // Attributes: A collection of attributes that need to be updated.
397 Attributes []*Attribute `json:"attributes,omitempty"`
398 // Name: Required. Google identifier for this location in the form of
399 // `locations/{location_id}/attributes`.
400 Name string `json:"name,omitempty"`
401
402 // ServerResponse contains the HTTP response code and headers from the server.
403 googleapi.ServerResponse `json:"-"`
404 // ForceSendFields is a list of field names (e.g. "Attributes") to
405 // unconditionally include in API requests. By default, fields with empty or
406 // default values are omitted from API requests. See
407 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
408 // details.
409 ForceSendFields []string `json:"-"`
410 // NullFields is a list of field names (e.g. "Attributes") to include in API
411 // requests with the JSON null value. By default, fields with empty values are
412 // omitted from API requests. See
413 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
414 NullFields []string `json:"-"`
415 }
416
417 func (s Attributes) MarshalJSON() ([]byte, error) {
418 type NoMethod Attributes
419 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
420 }
421
422 // BatchGetCategoriesResponse: Response message for
423 // BusinessCategories.BatchGetBusinessCategories.
424 type BatchGetCategoriesResponse struct {
425 // Categories: Categories that match the GConcept ids provided in the request.
426 // They will not come in the same order as category ids in the request.
427 Categories []*Category `json:"categories,omitempty"`
428
429 // ServerResponse contains the HTTP response code and headers from the server.
430 googleapi.ServerResponse `json:"-"`
431 // ForceSendFields is a list of field names (e.g. "Categories") to
432 // unconditionally include in API requests. By default, fields with empty or
433 // default values are omitted from API requests. See
434 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
435 // details.
436 ForceSendFields []string `json:"-"`
437 // NullFields is a list of field names (e.g. "Categories") to include in API
438 // requests with the JSON null value. By default, fields with empty values are
439 // omitted from API requests. See
440 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
441 NullFields []string `json:"-"`
442 }
443
444 func (s BatchGetCategoriesResponse) MarshalJSON() ([]byte, error) {
445 type NoMethod BatchGetCategoriesResponse
446 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
447 }
448
449 // BusinessHours: Represents the time periods that this location is open for
450 // business. Holds a collection of TimePeriod instances.
451 type BusinessHours struct {
452 // Periods: Required. A collection of times that this location is open for
453 // business. Each period represents a range of hours when the location is open
454 // during the week.
455 Periods []*TimePeriod `json:"periods,omitempty"`
456 // ForceSendFields is a list of field names (e.g. "Periods") to unconditionally
457 // include in API requests. By default, fields with empty or default values are
458 // omitted from API requests. See
459 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
460 // details.
461 ForceSendFields []string `json:"-"`
462 // NullFields is a list of field names (e.g. "Periods") to include in API
463 // requests with the JSON null value. By default, fields with empty values are
464 // omitted from API requests. See
465 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
466 NullFields []string `json:"-"`
467 }
468
469 func (s BusinessHours) MarshalJSON() ([]byte, error) {
470 type NoMethod BusinessHours
471 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
472 }
473
474 // Categories: A collection of categories that describes the business. During
475 // updates, both fields must be set. Clients are prohibited from individually
476 // updating the primary or additional categories using the update mask.
477 type Categories struct {
478 // AdditionalCategories: Optional. Additional categories to describe your
479 // business. Categories help your customers find accurate, specific results for
480 // services they're interested in. To keep your business information accurate
481 // and live, make sure that you use as few categories as possible to describe
482 // your overall core business. Choose categories that are as specific as
483 // possible, but representative of your main business.
484 AdditionalCategories []*Category `json:"additionalCategories,omitempty"`
485 // PrimaryCategory: Required. Category that best describes the core business
486 // this location engages in.
487 PrimaryCategory *Category `json:"primaryCategory,omitempty"`
488 // ForceSendFields is a list of field names (e.g. "AdditionalCategories") to
489 // unconditionally include in API requests. By default, fields with empty or
490 // default values are omitted from API requests. See
491 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
492 // details.
493 ForceSendFields []string `json:"-"`
494 // NullFields is a list of field names (e.g. "AdditionalCategories") to include
495 // in API requests with the JSON null value. By default, fields with empty
496 // values are omitted from API requests. See
497 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
498 NullFields []string `json:"-"`
499 }
500
501 func (s Categories) MarshalJSON() ([]byte, error) {
502 type NoMethod Categories
503 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
504 }
505
506 // Category: A category describing what this business is (not what it does).
507 // For a list of valid category IDs, and the mappings to their human-readable
508 // names, see `categories.list`.
509 type Category struct {
510 // DisplayName: Output only. The human-readable name of the category. This is
511 // set when reading the location. When modifying the location, `category_id`
512 // must be set.
513 DisplayName string `json:"displayName,omitempty"`
514 // MoreHoursTypes: Output only. More hours types that are available for this
515 // business category.
516 MoreHoursTypes []*MoreHoursType `json:"moreHoursTypes,omitempty"`
517 // Name: Required. A stable ID (provided by Google) for this category. The
518 // value must be specified when modifying the category (when creating or
519 // updating a location).
520 Name string `json:"name,omitempty"`
521 // ServiceTypes: Output only. A list of all the service types that are
522 // available for this business category.
523 ServiceTypes []*ServiceType `json:"serviceTypes,omitempty"`
524 // ForceSendFields is a list of field names (e.g. "DisplayName") to
525 // unconditionally include in API requests. By default, fields with empty or
526 // default values are omitted from API requests. See
527 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
528 // details.
529 ForceSendFields []string `json:"-"`
530 // NullFields is a list of field names (e.g. "DisplayName") to include in API
531 // requests with the JSON null value. By default, fields with empty values are
532 // omitted from API requests. See
533 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
534 NullFields []string `json:"-"`
535 }
536
537 func (s Category) MarshalJSON() ([]byte, error) {
538 type NoMethod Category
539 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
540 }
541
542 // Chain: A chain is a brand that your business's locations can be affiliated
543 // with.
544 type Chain struct {
545 // ChainNames: Names of the chain.
546 ChainNames []*ChainName `json:"chainNames,omitempty"`
547 // LocationCount: Number of locations that are part of this chain.
548 LocationCount int64 `json:"locationCount,omitempty"`
549 // Name: Required. The chain's resource name, in the format
550 // `chains/{chain_id}`.
551 Name string `json:"name,omitempty"`
552 // Websites: Websites of the chain.
553 Websites []*ChainUri `json:"websites,omitempty"`
554
555 // ServerResponse contains the HTTP response code and headers from the server.
556 googleapi.ServerResponse `json:"-"`
557 // ForceSendFields is a list of field names (e.g. "ChainNames") to
558 // unconditionally include in API requests. By default, fields with empty or
559 // default values are omitted from API requests. See
560 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
561 // details.
562 ForceSendFields []string `json:"-"`
563 // NullFields is a list of field names (e.g. "ChainNames") to include in API
564 // requests with the JSON null value. By default, fields with empty values are
565 // omitted from API requests. See
566 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
567 NullFields []string `json:"-"`
568 }
569
570 func (s Chain) MarshalJSON() ([]byte, error) {
571 type NoMethod Chain
572 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
573 }
574
575 // ChainName: Name to be used when displaying the chain.
576 type ChainName struct {
577 // DisplayName: The display name for this chain.
578 DisplayName string `json:"displayName,omitempty"`
579 // LanguageCode: The BCP 47 code of language of the name.
580 LanguageCode string `json:"languageCode,omitempty"`
581 // ForceSendFields is a list of field names (e.g. "DisplayName") to
582 // unconditionally include in API requests. By default, fields with empty or
583 // default values are omitted from API requests. See
584 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
585 // details.
586 ForceSendFields []string `json:"-"`
587 // NullFields is a list of field names (e.g. "DisplayName") to include in API
588 // requests with the JSON null value. By default, fields with empty values are
589 // omitted from API requests. See
590 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
591 NullFields []string `json:"-"`
592 }
593
594 func (s ChainName) MarshalJSON() ([]byte, error) {
595 type NoMethod ChainName
596 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
597 }
598
599 // ChainUri: Url to be used when displaying the chain.
600 type ChainUri struct {
601 // Uri: The uri for this chain.
602 Uri string `json:"uri,omitempty"`
603 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally
604 // include in API requests. By default, fields with empty or default values are
605 // omitted from API requests. See
606 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
607 // details.
608 ForceSendFields []string `json:"-"`
609 // NullFields is a list of field names (e.g. "Uri") to include in API requests
610 // with the JSON null value. By default, fields with empty values are omitted
611 // from API requests. See
612 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
613 NullFields []string `json:"-"`
614 }
615
616 func (s ChainUri) MarshalJSON() ([]byte, error) {
617 type NoMethod ChainUri
618 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
619 }
620
621 // Date: Represents a whole or partial calendar date, such as a birthday. The
622 // time of day and time zone are either specified elsewhere or are
623 // insignificant. The date is relative to the Gregorian Calendar. This can
624 // represent one of the following: * A full date, with non-zero year, month,
625 // and day values. * A month and day, with a zero year (for example, an
626 // anniversary). * A year on its own, with a zero month and a zero day. * A
627 // year and month, with a zero day (for example, a credit card expiration
628 // date). Related types: * google.type.TimeOfDay * google.type.DateTime *
629 // google.protobuf.Timestamp
630 type Date struct {
631 // Day: Day of a month. Must be from 1 to 31 and valid for the year and month,
632 // or 0 to specify a year by itself or a year and month where the day isn't
633 // significant.
634 Day int64 `json:"day,omitempty"`
635 // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without
636 // a month and day.
637 Month int64 `json:"month,omitempty"`
638 // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date
639 // without a year.
640 Year int64 `json:"year,omitempty"`
641 // ForceSendFields is a list of field names (e.g. "Day") to unconditionally
642 // include in API requests. By default, fields with empty or default values are
643 // omitted from API requests. See
644 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
645 // details.
646 ForceSendFields []string `json:"-"`
647 // NullFields is a list of field names (e.g. "Day") to include in API requests
648 // with the JSON null value. By default, fields with empty values are omitted
649 // from API requests. See
650 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
651 NullFields []string `json:"-"`
652 }
653
654 func (s Date) MarshalJSON() ([]byte, error) {
655 type NoMethod Date
656 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
657 }
658
659 // Empty: A generic empty message that you can re-use to avoid defining
660 // duplicated empty messages in your APIs. A typical example is to use it as
661 // the request or the response type of an API method. For instance: service Foo
662 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
663 type Empty struct {
664 // ServerResponse contains the HTTP response code and headers from the server.
665 googleapi.ServerResponse `json:"-"`
666 }
667
668 // FreeFormServiceItem: Represents a free-form service offered by the merchant.
669 // These are services that are not exposed as part of our structure service
670 // data. The merchant manually enters the names for such services using a
671 // geomerchant surface.
672 type FreeFormServiceItem struct {
673 // Category: Required. This field represents the category name (i.e. the
674 // category's stable ID). The `category` and `service_type_id` should match the
675 // possible combinations provided in the `Category` message.
676 Category string `json:"category,omitempty"`
677 // Label: Required. Language-tagged labels for the item. We recommend that item
678 // names be 140 characters or less, and descriptions 250 characters or less.
679 // This field should only be set if the input is a custom service item.
680 // Standardized service types should be updated using service_type_id.
681 Label *Label `json:"label,omitempty"`
682 // ForceSendFields is a list of field names (e.g. "Category") to
683 // unconditionally include in API requests. By default, fields with empty or
684 // default values are omitted from API requests. See
685 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
686 // details.
687 ForceSendFields []string `json:"-"`
688 // NullFields is a list of field names (e.g. "Category") to include in API
689 // requests with the JSON null value. By default, fields with empty values are
690 // omitted from API requests. See
691 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
692 NullFields []string `json:"-"`
693 }
694
695 func (s FreeFormServiceItem) MarshalJSON() ([]byte, error) {
696 type NoMethod FreeFormServiceItem
697 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
698 }
699
700 // GoogleLocation: Represents a Location that is present on Google. This can be
701 // a location that has been claimed by the user, someone else, or could be
702 // unclaimed.
703 type GoogleLocation struct {
704 // Location: The sparsely populated Location information. This field can be
705 // re-used in CreateLocation if it is not currently claimed by a user.
706 Location *Location `json:"location,omitempty"`
707 // Name: Resource name of this GoogleLocation, in the format
708 // `googleLocations/{googleLocationId}`.
709 Name string `json:"name,omitempty"`
710 // RequestAdminRightsUri: A URL that will redirect the user to the request
711 // admin rights UI. This field is only present if the location has already been
712 // claimed by any user, including the current user.
713 RequestAdminRightsUri string `json:"requestAdminRightsUri,omitempty"`
714 // ForceSendFields is a list of field names (e.g. "Location") to
715 // unconditionally include in API requests. By default, fields with empty or
716 // default values are omitted from API requests. See
717 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
718 // details.
719 ForceSendFields []string `json:"-"`
720 // NullFields is a list of field names (e.g. "Location") to include in API
721 // requests with the JSON null value. By default, fields with empty values are
722 // omitted from API requests. See
723 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
724 NullFields []string `json:"-"`
725 }
726
727 func (s GoogleLocation) MarshalJSON() ([]byte, error) {
728 type NoMethod GoogleLocation
729 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
730 }
731
732 // GoogleUpdatedLocation: Represents the view of a location as it appears to
733 // consumers, which includes updates that are currently serving on Google Maps
734 // and Search.
735 type GoogleUpdatedLocation struct {
736 // DiffMask: The fields where the values in the view as it appears to consumers
737 // are different than the merchant's information. To accept these changes,
738 // patch the location. To reject, patch with your preferred values.
739 DiffMask string `json:"diffMask,omitempty"`
740 // Location: The Google-updated version of this location.
741 Location *Location `json:"location,omitempty"`
742 // PendingMask: The fields where the merchant has provided an update that is
743 // currently in flight and hasn't yet been published to Maps and Search. This
744 // mask only tracks the status of the merchant's own edits, not external
745 // changes.
746 PendingMask string `json:"pendingMask,omitempty"`
747
748 // ServerResponse contains the HTTP response code and headers from the server.
749 googleapi.ServerResponse `json:"-"`
750 // ForceSendFields is a list of field names (e.g. "DiffMask") to
751 // unconditionally include in API requests. By default, fields with empty or
752 // default values are omitted from API requests. See
753 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
754 // details.
755 ForceSendFields []string `json:"-"`
756 // NullFields is a list of field names (e.g. "DiffMask") to include in API
757 // requests with the JSON null value. By default, fields with empty values are
758 // omitted from API requests. See
759 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
760 NullFields []string `json:"-"`
761 }
762
763 func (s GoogleUpdatedLocation) MarshalJSON() ([]byte, error) {
764 type NoMethod GoogleUpdatedLocation
765 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
766 }
767
768 // Label: Label to be used when displaying the price list, section, or item.
769 type Label struct {
770 // Description: Optional. Description of the price list, section, or item.
771 Description string `json:"description,omitempty"`
772 // DisplayName: Required. Display name for the price list, section, or item.
773 DisplayName string `json:"displayName,omitempty"`
774 // LanguageCode: Optional. The BCP-47 language code that these strings apply
775 // for. Only one set of labels may be set per language.
776 LanguageCode string `json:"languageCode,omitempty"`
777 // ForceSendFields is a list of field names (e.g. "Description") to
778 // unconditionally include in API requests. By default, fields with empty or
779 // default values are omitted from API requests. See
780 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
781 // details.
782 ForceSendFields []string `json:"-"`
783 // NullFields is a list of field names (e.g. "Description") to include in API
784 // requests with the JSON null value. By default, fields with empty values are
785 // omitted from API requests. See
786 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
787 NullFields []string `json:"-"`
788 }
789
790 func (s Label) MarshalJSON() ([]byte, error) {
791 type NoMethod Label
792 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
793 }
794
795 // LatLng: An object that represents a latitude/longitude pair. This is
796 // expressed as a pair of doubles to represent degrees latitude and degrees
797 // longitude. Unless specified otherwise, this object must conform to the WGS84
798 // standard. Values must be within normalized ranges.
799 type LatLng struct {
800 // Latitude: The latitude in degrees. It must be in the range [-90.0, +90.0].
801 Latitude float64 `json:"latitude,omitempty"`
802 // Longitude: The longitude in degrees. It must be in the range [-180.0,
803 // +180.0].
804 Longitude float64 `json:"longitude,omitempty"`
805 // ForceSendFields is a list of field names (e.g. "Latitude") to
806 // unconditionally include in API requests. By default, fields with empty or
807 // default values are omitted from API requests. See
808 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
809 // details.
810 ForceSendFields []string `json:"-"`
811 // NullFields is a list of field names (e.g. "Latitude") to include in API
812 // requests with the JSON null value. By default, fields with empty values are
813 // omitted from API requests. See
814 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
815 NullFields []string `json:"-"`
816 }
817
818 func (s LatLng) MarshalJSON() ([]byte, error) {
819 type NoMethod LatLng
820 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
821 }
822
823 func (s *LatLng) UnmarshalJSON(data []byte) error {
824 type NoMethod LatLng
825 var s1 struct {
826 Latitude gensupport.JSONFloat64 `json:"latitude"`
827 Longitude gensupport.JSONFloat64 `json:"longitude"`
828 *NoMethod
829 }
830 s1.NoMethod = (*NoMethod)(s)
831 if err := json.Unmarshal(data, &s1); err != nil {
832 return err
833 }
834 s.Latitude = float64(s1.Latitude)
835 s.Longitude = float64(s1.Longitude)
836 return nil
837 }
838
839 // ListAttributeMetadataResponse: Response for
840 // AttributesService.ListAttributeMetadata.
841 type ListAttributeMetadataResponse struct {
842 // AttributeMetadata: A collection of attribute metadata for the available
843 // attributes.
844 AttributeMetadata []*AttributeMetadata `json:"attributeMetadata,omitempty"`
845 // NextPageToken: If the number of attributes exceeded the requested page size,
846 // this field will be populated with a token to fetch the next page of
847 // attributes on a subsequent call to `attributes.list`. If there are no more
848 // attributes, this field will not be present in the response.
849 NextPageToken string `json:"nextPageToken,omitempty"`
850
851 // ServerResponse contains the HTTP response code and headers from the server.
852 googleapi.ServerResponse `json:"-"`
853 // ForceSendFields is a list of field names (e.g. "AttributeMetadata") to
854 // unconditionally include in API requests. By default, fields with empty or
855 // default values are omitted from API requests. See
856 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
857 // details.
858 ForceSendFields []string `json:"-"`
859 // NullFields is a list of field names (e.g. "AttributeMetadata") to include in
860 // API requests with the JSON null value. By default, fields with empty values
861 // are omitted from API requests. See
862 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
863 NullFields []string `json:"-"`
864 }
865
866 func (s ListAttributeMetadataResponse) MarshalJSON() ([]byte, error) {
867 type NoMethod ListAttributeMetadataResponse
868 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
869 }
870
871 // ListCategoriesResponse: Response message for
872 // BusinessCategories.ListCategories.
873 type ListCategoriesResponse struct {
874 // Categories: The matching categories based on the requested parameters.
875 Categories []*Category `json:"categories,omitempty"`
876 // NextPageToken: If the number of categories exceeded the requested page size,
877 // this field will be populated with a token to fetch the next page of
878 // categories on a subsequent call to `ListCategories`.
879 NextPageToken string `json:"nextPageToken,omitempty"`
880
881 // ServerResponse contains the HTTP response code and headers from the server.
882 googleapi.ServerResponse `json:"-"`
883 // ForceSendFields is a list of field names (e.g. "Categories") to
884 // unconditionally include in API requests. By default, fields with empty or
885 // default values are omitted from API requests. See
886 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
887 // details.
888 ForceSendFields []string `json:"-"`
889 // NullFields is a list of field names (e.g. "Categories") to include in API
890 // requests with the JSON null value. By default, fields with empty values are
891 // omitted from API requests. See
892 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
893 NullFields []string `json:"-"`
894 }
895
896 func (s ListCategoriesResponse) MarshalJSON() ([]byte, error) {
897 type NoMethod ListCategoriesResponse
898 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
899 }
900
901 // ListLocationsResponse: Response message for Locations.ListLocations.
902 type ListLocationsResponse struct {
903 // Locations: The locations.
904 Locations []*Location `json:"locations,omitempty"`
905 // NextPageToken: If the number of locations exceeded the requested page size,
906 // this field is populated with a token to fetch the next page of locations on
907 // a subsequent call to `ListLocations`. If there are no more locations, this
908 // field is not present in the response.
909 NextPageToken string `json:"nextPageToken,omitempty"`
910 // TotalSize: The approximate number of Locations in the list irrespective of
911 // pagination. This field will only be returned if `filter` is used as a query
912 // parameter.
913 TotalSize int64 `json:"totalSize,omitempty"`
914
915 // ServerResponse contains the HTTP response code and headers from the server.
916 googleapi.ServerResponse `json:"-"`
917 // ForceSendFields is a list of field names (e.g. "Locations") to
918 // unconditionally include in API requests. By default, fields with empty or
919 // default values are omitted from API requests. See
920 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
921 // details.
922 ForceSendFields []string `json:"-"`
923 // NullFields is a list of field names (e.g. "Locations") to include in API
924 // requests with the JSON null value. By default, fields with empty values are
925 // omitted from API requests. See
926 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
927 NullFields []string `json:"-"`
928 }
929
930 func (s ListLocationsResponse) MarshalJSON() ([]byte, error) {
931 type NoMethod ListLocationsResponse
932 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
933 }
934
935 // Location: A location. See the [help center article]
936 // (https://support.google.com/business/answer/3038177) for a detailed
937 // description of these fields, or the category endpoint
938 // (/my-business/reference/rest/v4/categories) for a list of valid business
939 // categories.
940 type Location struct {
941 // AdWordsLocationExtensions: Optional. Additional information that is surfaced
942 // in AdWords.
943 AdWordsLocationExtensions *AdWordsLocationExtensions `json:"adWordsLocationExtensions,omitempty"`
944 // Categories: Optional. The different categories that describe the business.
945 Categories *Categories `json:"categories,omitempty"`
946 // Labels: Optional. A collection of free-form strings to allow you to tag your
947 // business. These labels are NOT user facing; only you can see them. Must be
948 // between 1-255 characters per label.
949 Labels []string `json:"labels,omitempty"`
950 // LanguageCode: Immutable. The language of the location. Set during creation
951 // and not updateable.
952 LanguageCode string `json:"languageCode,omitempty"`
953 // Latlng: Optional. User-provided latitude and longitude. When creating a
954 // location, this field is ignored if the provided address geocodes
955 // successfully. This field is only returned on get requests if the
956 // user-provided `latlng` value was accepted during create, or the `latlng`
957 // value was updated through the Google Business Profile website. This field
958 // can only be updated by approved clients.
959 Latlng *LatLng `json:"latlng,omitempty"`
960 // Metadata: Output only. Additional non-user-editable information.
961 Metadata *Metadata `json:"metadata,omitempty"`
962 // MoreHours: Optional. More hours for a business's different departments or
963 // specific customers.
964 MoreHours []*MoreHours `json:"moreHours,omitempty"`
965 // Name: Google identifier for this location in the form:
966 // `locations/{location_id}`.
967 Name string `json:"name,omitempty"`
968 // OpenInfo: Optional. A flag that indicates whether the location is currently
969 // open for business.
970 OpenInfo *OpenInfo `json:"openInfo,omitempty"`
971 // PhoneNumbers: Optional. The different phone numbers that customers can use
972 // to get in touch with the business.
973 PhoneNumbers *PhoneNumbers `json:"phoneNumbers,omitempty"`
974 // Profile: Optional. Describes your business in your own voice and shares with
975 // users the unique story of your business and offerings. This field is
976 // required for all categories except lodging categories (e.g., hotels, motels,
977 // inns).
978 Profile *Profile `json:"profile,omitempty"`
979 // RegularHours: Optional. Operating hours for the business.
980 RegularHours *BusinessHours `json:"regularHours,omitempty"`
981 // RelationshipData: Optional. All locations and chain related to this one.
982 RelationshipData *RelationshipData `json:"relationshipData,omitempty"`
983 // ServiceArea: Optional. Service area businesses provide their service at the
984 // customer's location. If this business is a service area business, this field
985 // describes the area(s) serviced by the business.
986 ServiceArea *ServiceAreaBusiness `json:"serviceArea,omitempty"`
987 // ServiceItems: Optional. List of services supported by merchants. A service
988 // can be haircut, install water heater, etc. Duplicated service items will be
989 // removed automatically.
990 ServiceItems []*ServiceItem `json:"serviceItems,omitempty"`
991 // SpecialHours: Optional. Special hours for the business. This typically
992 // includes holiday hours, and other times outside of regular operating hours.
993 // These override regular business hours. This field cannot be set without
994 // regular hours.
995 SpecialHours *SpecialHours `json:"specialHours,omitempty"`
996 // StoreCode: Optional. External identifier for this location, which must be
997 // unique within a given account. This is a means of associating the location
998 // with your own records.
999 StoreCode string `json:"storeCode,omitempty"`
1000 // StorefrontAddress: Optional. A precise, accurate address to describe your
1001 // business location. PO boxes or mailboxes located at remote locations are not
1002 // acceptable. At this time, you can specify a maximum of five `address_lines`
1003 // values in the address. This field should only be set for businesses that
1004 // have a storefront. This field should not be set for locations of type
1005 // `CUSTOMER_LOCATION_ONLY` but if set, any value provided will be discarded.
1006 StorefrontAddress *PostalAddress `json:"storefrontAddress,omitempty"`
1007 // Title: Required. Location name should reflect your business's real-world
1008 // name, as used consistently on your storefront, website, and stationery, and
1009 // as known to customers. Any additional information, when relevant, can be
1010 // included in other fields of the resource (for example, `Address`,
1011 // `Categories`). Don't add unnecessary information to your name (for example,
1012 // prefer "Google" over "Google Inc. - Mountain View Corporate Headquarters").
1013 // Don't include marketing taglines, store codes, special characters, hours or
1014 // closed/open status, phone numbers, website URLs, service/product
1015 // information, location/address or directions, or containment information (for
1016 // example, "Chase ATM in Duane Reade").
1017 Title string `json:"title,omitempty"`
1018 // WebsiteUri: Optional. A URL for this business. If possible, use a URL that
1019 // represents this individual business location instead of a generic
1020 // website/URL that represents all locations, or the brand.
1021 WebsiteUri string `json:"websiteUri,omitempty"`
1022
1023 // ServerResponse contains the HTTP response code and headers from the server.
1024 googleapi.ServerResponse `json:"-"`
1025 // ForceSendFields is a list of field names (e.g. "AdWordsLocationExtensions")
1026 // to unconditionally include in API requests. By default, fields with empty or
1027 // default values are omitted from API requests. See
1028 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1029 // details.
1030 ForceSendFields []string `json:"-"`
1031 // NullFields is a list of field names (e.g. "AdWordsLocationExtensions") to
1032 // include in API requests with the JSON null value. By default, fields with
1033 // empty values are omitted from API requests. See
1034 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1035 NullFields []string `json:"-"`
1036 }
1037
1038 func (s Location) MarshalJSON() ([]byte, error) {
1039 type NoMethod Location
1040 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1041 }
1042
1043 // Metadata: Additional non-user-editable information about the location.
1044 type Metadata struct {
1045 // CanDelete: Output only. Indicates whether the location can be deleted using
1046 // the API.
1047 CanDelete bool `json:"canDelete,omitempty"`
1048 // CanHaveBusinessCalls: Output only. Indicates if the listing is eligible for
1049 // business calls.
1050 CanHaveBusinessCalls bool `json:"canHaveBusinessCalls,omitempty"`
1051 // CanHaveFoodMenus: Output only. Indicates if the listing is eligible for food
1052 // menu.
1053 CanHaveFoodMenus bool `json:"canHaveFoodMenus,omitempty"`
1054 // CanModifyServiceList: Output only. Indicates if the listing can modify the
1055 // service list.
1056 CanModifyServiceList bool `json:"canModifyServiceList,omitempty"`
1057 // CanOperateHealthData: Output only. Indicates whether the location can
1058 // operate on Health data.
1059 CanOperateHealthData bool `json:"canOperateHealthData,omitempty"`
1060 // CanOperateLocalPost: Output only. Indicates if the listing can manage local
1061 // posts. Deprecated: This field is no longer populated and will be removed in
1062 // a future version.
1063 CanOperateLocalPost bool `json:"canOperateLocalPost,omitempty"`
1064 // CanOperateLodgingData: Output only. Indicates whether the location can
1065 // operate on Lodging data.
1066 CanOperateLodgingData bool `json:"canOperateLodgingData,omitempty"`
1067 // DuplicateLocation: Output only. The location resource that this location
1068 // duplicates.
1069 DuplicateLocation string `json:"duplicateLocation,omitempty"`
1070 // HasGoogleUpdated: Output only. Indicates whether the place ID associated
1071 // with this location has updates that need to be updated or rejected by the
1072 // client. If this boolean is set, you should call the `getGoogleUpdated`
1073 // method to look up information that's needs to be verified.
1074 HasGoogleUpdated bool `json:"hasGoogleUpdated,omitempty"`
1075 // HasPendingEdits: Output only. Indicates whether any of this Location's
1076 // properties are in the edit pending state.
1077 HasPendingEdits bool `json:"hasPendingEdits,omitempty"`
1078 // HasVoiceOfMerchant: Output only. Indicates if the listing has Voice of
1079 // Merchant. If this boolean is false, you should call the
1080 // locations.getVoiceOfMerchantState API to get details as to why they do not
1081 // have Voice of Merchant.
1082 HasVoiceOfMerchant bool `json:"hasVoiceOfMerchant,omitempty"`
1083 // IsParticularlyPersonalPlace: Output only.
1084 IsParticularlyPersonalPlace bool `json:"isParticularlyPersonalPlace,omitempty"`
1085 // MapsUri: Output only. A link to the location on Maps.
1086 MapsUri string `json:"mapsUri,omitempty"`
1087 // NewReviewUri: Output only. A link to the page on Google Search where a
1088 // customer can leave a review for the location.
1089 NewReviewUri string `json:"newReviewUri,omitempty"`
1090 // PlaceId: Output only. If this locationappears on Google Maps, this field is
1091 // populated with the place ID for the location. This ID can be used in various
1092 // Places APIs. This field can be set during Create calls, but not for Update.
1093 PlaceId string `json:"placeId,omitempty"`
1094 // ForceSendFields is a list of field names (e.g. "CanDelete") to
1095 // unconditionally include in API requests. By default, fields with empty or
1096 // default values are omitted from API requests. See
1097 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1098 // details.
1099 ForceSendFields []string `json:"-"`
1100 // NullFields is a list of field names (e.g. "CanDelete") to include in API
1101 // requests with the JSON null value. By default, fields with empty values are
1102 // omitted from API requests. See
1103 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1104 NullFields []string `json:"-"`
1105 }
1106
1107 func (s Metadata) MarshalJSON() ([]byte, error) {
1108 type NoMethod Metadata
1109 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1110 }
1111
1112 // Money: Represents an amount of money with its currency type.
1113 type Money struct {
1114 // CurrencyCode: The three-letter currency code defined in ISO 4217.
1115 CurrencyCode string `json:"currencyCode,omitempty"`
1116 // Nanos: Number of nano (10^-9) units of the amount. The value must be between
1117 // -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos`
1118 // must be positive or zero. If `units` is zero, `nanos` can be positive, zero,
1119 // or negative. If `units` is negative, `nanos` must be negative or zero. For
1120 // example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
1121 Nanos int64 `json:"nanos,omitempty"`
1122 // Units: The whole units of the amount. For example if `currencyCode` is
1123 // "USD", then 1 unit is one US dollar.
1124 Units int64 `json:"units,omitempty,string"`
1125 // ForceSendFields is a list of field names (e.g. "CurrencyCode") to
1126 // unconditionally include in API requests. By default, fields with empty or
1127 // default values are omitted from API requests. See
1128 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1129 // details.
1130 ForceSendFields []string `json:"-"`
1131 // NullFields is a list of field names (e.g. "CurrencyCode") to include in API
1132 // requests with the JSON null value. By default, fields with empty values are
1133 // omitted from API requests. See
1134 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1135 NullFields []string `json:"-"`
1136 }
1137
1138 func (s Money) MarshalJSON() ([]byte, error) {
1139 type NoMethod Money
1140 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1141 }
1142
1143 // MoreHours: The time periods during which a location is open for certain
1144 // types of business.
1145 type MoreHours struct {
1146 // HoursTypeId: Required. Type of hours. Clients should call {#link
1147 // businessCategories:BatchGet} to get supported hours types for categories of
1148 // their locations.
1149 HoursTypeId string `json:"hoursTypeId,omitempty"`
1150 // Periods: Required. A collection of times that this location is open. Each
1151 // period represents a range of hours when the location is open during the
1152 // week.
1153 Periods []*TimePeriod `json:"periods,omitempty"`
1154 // ForceSendFields is a list of field names (e.g. "HoursTypeId") to
1155 // unconditionally include in API requests. By default, fields with empty or
1156 // default values are omitted from API requests. See
1157 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1158 // details.
1159 ForceSendFields []string `json:"-"`
1160 // NullFields is a list of field names (e.g. "HoursTypeId") to include in API
1161 // requests with the JSON null value. By default, fields with empty values are
1162 // omitted from API requests. See
1163 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1164 NullFields []string `json:"-"`
1165 }
1166
1167 func (s MoreHours) MarshalJSON() ([]byte, error) {
1168 type NoMethod MoreHours
1169 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1170 }
1171
1172 // MoreHoursType: More hours types that a business can offers, in addition to
1173 // its regular hours.
1174 type MoreHoursType struct {
1175 // DisplayName: Output only. The human-readable English display name for the
1176 // hours type.
1177 DisplayName string `json:"displayName,omitempty"`
1178 // HoursTypeId: Output only. A stable ID provided by Google for this hours
1179 // type.
1180 HoursTypeId string `json:"hoursTypeId,omitempty"`
1181 // LocalizedDisplayName: Output only. The human-readable localized display name
1182 // for the hours type.
1183 LocalizedDisplayName string `json:"localizedDisplayName,omitempty"`
1184 // ForceSendFields is a list of field names (e.g. "DisplayName") to
1185 // unconditionally include in API requests. By default, fields with empty or
1186 // default values are omitted from API requests. See
1187 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1188 // details.
1189 ForceSendFields []string `json:"-"`
1190 // NullFields is a list of field names (e.g. "DisplayName") to include in API
1191 // requests with the JSON null value. By default, fields with empty values are
1192 // omitted from API requests. See
1193 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1194 NullFields []string `json:"-"`
1195 }
1196
1197 func (s MoreHoursType) MarshalJSON() ([]byte, error) {
1198 type NoMethod MoreHoursType
1199 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1200 }
1201
1202 // OpenInfo: Information related to the opening state of the business.
1203 type OpenInfo struct {
1204 // CanReopen: Output only. Indicates whether this business is eligible for
1205 // re-open.
1206 CanReopen bool `json:"canReopen,omitempty"`
1207 // OpeningDate: Optional. The date on which the location first opened. If the
1208 // exact day is not known, month and year only can be provided. The date must
1209 // be in the past or be no more than one year in the future.
1210 OpeningDate *Date `json:"openingDate,omitempty"`
1211 // Status: Required. Indicates whether or not the Location is currently open
1212 // for business. All locations are open by default, unless updated to be
1213 // closed.
1214 //
1215 // Possible values:
1216 // "OPEN_FOR_BUSINESS_UNSPECIFIED" - Not specified.
1217 // "OPEN" - Indicates that the location is open.
1218 // "CLOSED_PERMANENTLY" - Indicates that the location has been permanently
1219 // closed.
1220 // "CLOSED_TEMPORARILY" - Indicates that the location has been temporarily
1221 // closed.
1222 Status string `json:"status,omitempty"`
1223 // ForceSendFields is a list of field names (e.g. "CanReopen") to
1224 // unconditionally include in API requests. By default, fields with empty or
1225 // default values are omitted from API requests. See
1226 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1227 // details.
1228 ForceSendFields []string `json:"-"`
1229 // NullFields is a list of field names (e.g. "CanReopen") to include in API
1230 // requests with the JSON null value. By default, fields with empty values are
1231 // omitted from API requests. See
1232 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1233 NullFields []string `json:"-"`
1234 }
1235
1236 func (s OpenInfo) MarshalJSON() ([]byte, error) {
1237 type NoMethod OpenInfo
1238 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1239 }
1240
1241 // PhoneNumbers: A collection of phone numbers for the business. During
1242 // updates, both fields must be set. Clients may not update just the primary or
1243 // additional phone numbers using the update mask. International phone format
1244 // is preferred, such as "+1 415 555 0132", see more in
1245 // (https://developers.google.com/style/phone-numbers#international-phone-numbers).
1246 type PhoneNumbers struct {
1247 // AdditionalPhones: Optional. Up to two phone numbers (mobile or landline, no
1248 // fax) at which your business can be called, in addition to your primary phone
1249 // number.
1250 AdditionalPhones []string `json:"additionalPhones,omitempty"`
1251 // PrimaryPhone: Required. A phone number that connects to your individual
1252 // business location as directly as possible. Use a local phone number instead
1253 // of a central, call center helpline number whenever possible.
1254 PrimaryPhone string `json:"primaryPhone,omitempty"`
1255 // ForceSendFields is a list of field names (e.g. "AdditionalPhones") to
1256 // unconditionally include in API requests. By default, fields with empty or
1257 // default values are omitted from API requests. See
1258 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1259 // details.
1260 ForceSendFields []string `json:"-"`
1261 // NullFields is a list of field names (e.g. "AdditionalPhones") to include in
1262 // API requests with the JSON null value. By default, fields with empty values
1263 // are omitted from API requests. See
1264 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1265 NullFields []string `json:"-"`
1266 }
1267
1268 func (s PhoneNumbers) MarshalJSON() ([]byte, error) {
1269 type NoMethod PhoneNumbers
1270 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1271 }
1272
1273 // PlaceInfo: Defines an area that's represented by a place ID.
1274 type PlaceInfo struct {
1275 // PlaceId: Required. The ID of the place. Must correspond to a region.
1276 // (https://developers.google.com/places/web-service/supported_types#table3)
1277 PlaceId string `json:"placeId,omitempty"`
1278 // PlaceName: Required. The localized name of the place. For example,
1279 // `Scottsdale, AZ`.
1280 PlaceName string `json:"placeName,omitempty"`
1281 // ForceSendFields is a list of field names (e.g. "PlaceId") to unconditionally
1282 // include in API requests. By default, fields with empty or default values are
1283 // omitted from API requests. See
1284 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1285 // details.
1286 ForceSendFields []string `json:"-"`
1287 // NullFields is a list of field names (e.g. "PlaceId") to include in API
1288 // requests with the JSON null value. By default, fields with empty values are
1289 // omitted from API requests. See
1290 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1291 NullFields []string `json:"-"`
1292 }
1293
1294 func (s PlaceInfo) MarshalJSON() ([]byte, error) {
1295 type NoMethod PlaceInfo
1296 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1297 }
1298
1299 // Places: Defines the union of areas represented by a set of places.
1300 type Places struct {
1301 // PlaceInfos: The areas represented by place IDs. Limited to a maximum of 20
1302 // places.
1303 PlaceInfos []*PlaceInfo `json:"placeInfos,omitempty"`
1304 // ForceSendFields is a list of field names (e.g. "PlaceInfos") to
1305 // unconditionally include in API requests. By default, fields with empty or
1306 // default values are omitted from API requests. See
1307 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1308 // details.
1309 ForceSendFields []string `json:"-"`
1310 // NullFields is a list of field names (e.g. "PlaceInfos") to include in API
1311 // requests with the JSON null value. By default, fields with empty values are
1312 // omitted from API requests. See
1313 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1314 NullFields []string `json:"-"`
1315 }
1316
1317 func (s Places) MarshalJSON() ([]byte, error) {
1318 type NoMethod Places
1319 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1320 }
1321
1322 // PostalAddress: Represents a postal address, such as for postal delivery or
1323 // payments addresses. With a postal address, a postal service can deliver
1324 // items to a premise, P.O. box, or similar. A postal address is not intended
1325 // to model geographical locations like roads, towns, or mountains. In typical
1326 // usage, an address would be created by user input or from importing existing
1327 // data, depending on the type of process. Advice on address input or editing:
1328 // - Use an internationalization-ready address widget such as
1329 // https://github.com/google/libaddressinput. - Users should not be presented
1330 // with UI elements for input or editing of fields outside countries where that
1331 // field is used. For more guidance on how to use this schema, see:
1332 // https://support.google.com/business/answer/6397478.
1333 type PostalAddress struct {
1334 // AddressLines: Unstructured address lines describing the lower levels of an
1335 // address. Because values in `address_lines` do not have type information and
1336 // may sometimes contain multiple values in a single field (for example,
1337 // "Austin, TX"), it is important that the line order is clear. The order of
1338 // address lines should be "envelope order" for the country or region of the
1339 // address. In places where this can vary (for example, Japan),
1340 // `address_language` is used to make it explicit (for example, "ja" for
1341 // large-to-small ordering and "ja-Latn" or "en" for small-to-large). In this
1342 // way, the most specific line of an address can be selected based on the
1343 // language. The minimum permitted structural representation of an address
1344 // consists of a `region_code` with all remaining information placed in the
1345 // `address_lines`. It would be possible to format such an address very
1346 // approximately without geocoding, but no semantic reasoning could be made
1347 // about any of the address components until it was at least partially
1348 // resolved. Creating an address only containing a `region_code` and
1349 // `address_lines` and then geocoding is the recommended way to handle
1350 // completely unstructured addresses (as opposed to guessing which parts of the
1351 // address should be localities or administrative areas).
1352 AddressLines []string `json:"addressLines,omitempty"`
1353 // AdministrativeArea: Optional. Highest administrative subdivision which is
1354 // used for postal addresses of a country or region. For example, this can be a
1355 // state, a province, an oblast, or a prefecture. For Spain, this is the
1356 // province and not the autonomous community (for example, "Barcelona" and not
1357 // "Catalonia"). Many countries don't use an administrative area in postal
1358 // addresses. For example, in Switzerland, this should be left unpopulated.
1359 AdministrativeArea string `json:"administrativeArea,omitempty"`
1360 // LanguageCode: Optional. BCP-47 language code of the contents of this address
1361 // (if known). This is often the UI language of the input form or is expected
1362 // to match one of the languages used in the address' country/region, or their
1363 // transliterated equivalents. This can affect formatting in certain countries,
1364 // but is not critical to the correctness of the data and will never affect any
1365 // validation or other non-formatting related operations. If this value is not
1366 // known, it should be omitted (rather than specifying a possibly incorrect
1367 // default). Examples: "zh-Hant", "ja", "ja-Latn", "en".
1368 LanguageCode string `json:"languageCode,omitempty"`
1369 // Locality: Optional. Generally refers to the city or town portion of the
1370 // address. Examples: US city, IT comune, UK post town. In regions of the world
1371 // where localities are not well defined or do not fit into this structure
1372 // well, leave `locality` empty and use `address_lines`.
1373 Locality string `json:"locality,omitempty"`
1374 // Organization: Optional. The name of the organization at the address.
1375 Organization string `json:"organization,omitempty"`
1376 // PostalCode: Optional. Postal code of the address. Not all countries use or
1377 // require postal codes to be present, but where they are used, they may
1378 // trigger additional validation with other parts of the address (for example,
1379 // state or zip code validation in the United States).
1380 PostalCode string `json:"postalCode,omitempty"`
1381 // Recipients: Optional. The recipient at the address. This field may, under
1382 // certain circumstances, contain multiline information. For example, it might
1383 // contain "care of" information.
1384 Recipients []string `json:"recipients,omitempty"`
1385 // RegionCode: Required. CLDR region code of the country/region of the address.
1386 // This is never inferred and it is up to the user to ensure the value is
1387 // correct. See https://cldr.unicode.org/ and
1388 // https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
1389 // for details. Example: "CH" for Switzerland.
1390 RegionCode string `json:"regionCode,omitempty"`
1391 // Revision: The schema revision of the `PostalAddress`. This must be set to 0,
1392 // which is the latest revision. All new revisions **must** be backward
1393 // compatible with old revisions.
1394 Revision int64 `json:"revision,omitempty"`
1395 // SortingCode: Optional. Additional, country-specific, sorting code. This is
1396 // not used in most regions. Where it is used, the value is either a string
1397 // like "CEDEX", optionally followed by a number (for example, "CEDEX 7"), or
1398 // just a number alone, representing the "sector code" (Jamaica), "delivery
1399 // area indicator" (Malawi) or "post office indicator" (Côte d'Ivoire).
1400 SortingCode string `json:"sortingCode,omitempty"`
1401 // Sublocality: Optional. Sublocality of the address. For example, this can be
1402 // a neighborhood, borough, or district.
1403 Sublocality string `json:"sublocality,omitempty"`
1404 // ForceSendFields is a list of field names (e.g. "AddressLines") to
1405 // unconditionally include in API requests. By default, fields with empty or
1406 // default values are omitted from API requests. See
1407 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1408 // details.
1409 ForceSendFields []string `json:"-"`
1410 // NullFields is a list of field names (e.g. "AddressLines") to include in API
1411 // requests with the JSON null value. By default, fields with empty values are
1412 // omitted from API requests. See
1413 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1414 NullFields []string `json:"-"`
1415 }
1416
1417 func (s PostalAddress) MarshalJSON() ([]byte, error) {
1418 type NoMethod PostalAddress
1419 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1420 }
1421
1422 // Profile: All information pertaining to the location's profile.
1423 type Profile struct {
1424 // Description: Required. Description of the location in your own voice, not
1425 // editable by anyone else.
1426 Description string `json:"description,omitempty"`
1427 // ForceSendFields is a list of field names (e.g. "Description") to
1428 // unconditionally include in API requests. By default, fields with empty or
1429 // default values are omitted from API requests. See
1430 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1431 // details.
1432 ForceSendFields []string `json:"-"`
1433 // NullFields is a list of field names (e.g. "Description") to include in API
1434 // requests with the JSON null value. By default, fields with empty values are
1435 // omitted from API requests. See
1436 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1437 NullFields []string `json:"-"`
1438 }
1439
1440 func (s Profile) MarshalJSON() ([]byte, error) {
1441 type NoMethod Profile
1442 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1443 }
1444
1445 // RelationshipData: Information of all parent and children locations related
1446 // to this one.
1447 type RelationshipData struct {
1448 // ChildrenLocations: The list of children locations that this location has
1449 // relations with.
1450 ChildrenLocations []*RelevantLocation `json:"childrenLocations,omitempty"`
1451 // ParentChain: The resource name of the Chain that this location is member of.
1452 // How to find Chain ID
1453 ParentChain string `json:"parentChain,omitempty"`
1454 // ParentLocation: The parent location that this location has relations with.
1455 ParentLocation *RelevantLocation `json:"parentLocation,omitempty"`
1456 // ForceSendFields is a list of field names (e.g. "ChildrenLocations") to
1457 // unconditionally include in API requests. By default, fields with empty or
1458 // default values are omitted from API requests. See
1459 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1460 // details.
1461 ForceSendFields []string `json:"-"`
1462 // NullFields is a list of field names (e.g. "ChildrenLocations") to include in
1463 // API requests with the JSON null value. By default, fields with empty values
1464 // are omitted from API requests. See
1465 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1466 NullFields []string `json:"-"`
1467 }
1468
1469 func (s RelationshipData) MarshalJSON() ([]byte, error) {
1470 type NoMethod RelationshipData
1471 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1472 }
1473
1474 // RelevantLocation: Information about another location that is related to
1475 // current one. The relation can be any one of DEPARTMENT_OF or
1476 // INDEPENDENT_ESTABLISHMENT_OF, and the location specified here can be on
1477 // either side (parent/child) of the location.
1478 type RelevantLocation struct {
1479 // PlaceId: Required. Specify the location that is on the other side of the
1480 // relation by its placeID.
1481 PlaceId string `json:"placeId,omitempty"`
1482 // RelationType: Required. The type of the relationship.
1483 //
1484 // Possible values:
1485 // "RELATION_TYPE_UNSPECIFIED" - Type unspecified.
1486 // "DEPARTMENT_OF" - This represents a relation between 2 locations which
1487 // share one physical area, same brand/upper management/organization, but with
1488 // different key attributes like store hours or phone numbers. For example,
1489 // Costco Pharmacy is a department in Costco Wholesale.
1490 // "INDEPENDENT_ESTABLISHMENT_IN" - This represents the cases where 2
1491 // locations are co-located in the same physical location, but from different
1492 // companies (e.g., Starbucks in a Safeway, shops in a mall).
1493 RelationType string `json:"relationType,omitempty"`
1494 // ForceSendFields is a list of field names (e.g. "PlaceId") to unconditionally
1495 // include in API requests. By default, fields with empty or default values are
1496 // omitted from API requests. See
1497 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1498 // details.
1499 ForceSendFields []string `json:"-"`
1500 // NullFields is a list of field names (e.g. "PlaceId") to include in API
1501 // requests with the JSON null value. By default, fields with empty values are
1502 // omitted from API requests. See
1503 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1504 NullFields []string `json:"-"`
1505 }
1506
1507 func (s RelevantLocation) MarshalJSON() ([]byte, error) {
1508 type NoMethod RelevantLocation
1509 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1510 }
1511
1512 // RepeatedEnumAttributeValue: Values for an attribute with a `value_type` of
1513 // REPEATED_ENUM. This consists of two lists of value IDs: those that are set
1514 // (true) and those that are unset (false). Values absent are considered
1515 // unknown. At least one value must be specified.
1516 type RepeatedEnumAttributeValue struct {
1517 // SetValues: Enum values that are set.
1518 SetValues []string `json:"setValues,omitempty"`
1519 // UnsetValues: Enum values that are unset.
1520 UnsetValues []string `json:"unsetValues,omitempty"`
1521 // ForceSendFields is a list of field names (e.g. "SetValues") to
1522 // unconditionally include in API requests. By default, fields with empty or
1523 // default values are omitted from API requests. See
1524 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1525 // details.
1526 ForceSendFields []string `json:"-"`
1527 // NullFields is a list of field names (e.g. "SetValues") to include in API
1528 // requests with the JSON null value. By default, fields with empty values are
1529 // omitted from API requests. See
1530 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1531 NullFields []string `json:"-"`
1532 }
1533
1534 func (s RepeatedEnumAttributeValue) MarshalJSON() ([]byte, error) {
1535 type NoMethod RepeatedEnumAttributeValue
1536 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1537 }
1538
1539 // SearchChainsResponse: Response message for Locations.SearchChains.
1540 type SearchChainsResponse struct {
1541 // Chains: Chains that match the queried chain_display_name in
1542 // SearchChainsRequest. If there are no matches, this field will be empty.
1543 // Results are listed in order of relevance.
1544 Chains []*Chain `json:"chains,omitempty"`
1545
1546 // ServerResponse contains the HTTP response code and headers from the server.
1547 googleapi.ServerResponse `json:"-"`
1548 // ForceSendFields is a list of field names (e.g. "Chains") to unconditionally
1549 // include in API requests. By default, fields with empty or default values are
1550 // omitted from API requests. See
1551 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1552 // details.
1553 ForceSendFields []string `json:"-"`
1554 // NullFields is a list of field names (e.g. "Chains") to include in API
1555 // requests with the JSON null value. By default, fields with empty values are
1556 // omitted from API requests. See
1557 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1558 NullFields []string `json:"-"`
1559 }
1560
1561 func (s SearchChainsResponse) MarshalJSON() ([]byte, error) {
1562 type NoMethod SearchChainsResponse
1563 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1564 }
1565
1566 // SearchGoogleLocationsRequest: Request message for
1567 // GoogleLocations.SearchGoogleLocations.
1568 type SearchGoogleLocationsRequest struct {
1569 // Location: Location to search for. If provided, will find locations which
1570 // match the provided location details, which must include a value for the
1571 // title.
1572 Location *Location `json:"location,omitempty"`
1573 // PageSize: The number of matches to return. The default value is 3, with a
1574 // maximum of 10. Note that latency may increase if more are requested. There
1575 // is no pagination.
1576 PageSize int64 `json:"pageSize,omitempty"`
1577 // Query: Text query to search for. The search results from a query string will
1578 // be less accurate than if providing an exact location, but can provide more
1579 // inexact matches.
1580 Query string `json:"query,omitempty"`
1581 // ForceSendFields is a list of field names (e.g. "Location") to
1582 // unconditionally include in API requests. By default, fields with empty or
1583 // default values are omitted from API requests. See
1584 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1585 // details.
1586 ForceSendFields []string `json:"-"`
1587 // NullFields is a list of field names (e.g. "Location") to include in API
1588 // requests with the JSON null value. By default, fields with empty values are
1589 // omitted from API requests. See
1590 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1591 NullFields []string `json:"-"`
1592 }
1593
1594 func (s SearchGoogleLocationsRequest) MarshalJSON() ([]byte, error) {
1595 type NoMethod SearchGoogleLocationsRequest
1596 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1597 }
1598
1599 // SearchGoogleLocationsResponse: Response message for
1600 // GoogleLocations.SearchGoogleLocations.
1601 type SearchGoogleLocationsResponse struct {
1602 // GoogleLocations: A collection of GoogleLocations that are potential matches
1603 // to the specified request, listed in order from most to least accuracy.
1604 GoogleLocations []*GoogleLocation `json:"googleLocations,omitempty"`
1605
1606 // ServerResponse contains the HTTP response code and headers from the server.
1607 googleapi.ServerResponse `json:"-"`
1608 // ForceSendFields is a list of field names (e.g. "GoogleLocations") to
1609 // unconditionally include in API requests. By default, fields with empty or
1610 // default values are omitted from API requests. See
1611 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1612 // details.
1613 ForceSendFields []string `json:"-"`
1614 // NullFields is a list of field names (e.g. "GoogleLocations") to include in
1615 // API requests with the JSON null value. By default, fields with empty values
1616 // are omitted from API requests. See
1617 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1618 NullFields []string `json:"-"`
1619 }
1620
1621 func (s SearchGoogleLocationsResponse) MarshalJSON() ([]byte, error) {
1622 type NoMethod SearchGoogleLocationsResponse
1623 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1624 }
1625
1626 // ServiceAreaBusiness: Service area businesses provide their service at the
1627 // customer's location (for example, a locksmith or plumber).
1628 type ServiceAreaBusiness struct {
1629 // BusinessType: Required. Indicates the type of the service area business.
1630 //
1631 // Possible values:
1632 // "BUSINESS_TYPE_UNSPECIFIED" - Output only. Not specified.
1633 // "CUSTOMER_LOCATION_ONLY" - Offers service only in the surrounding area
1634 // (not at the business address). If a business is being updated from a
1635 // CUSTOMER_AND_BUSINESS_LOCATION to a CUSTOMER_LOCATION_ONLY, the location
1636 // update must include field mask `storefront_address` and set the field to
1637 // empty.
1638 // "CUSTOMER_AND_BUSINESS_LOCATION" - Offers service at the business address
1639 // and the surrounding area.
1640 BusinessType string `json:"businessType,omitempty"`
1641 // Places: The area that this business serves defined through a set of places.
1642 Places *Places `json:"places,omitempty"`
1643 // RegionCode: Immutable. CLDR region code of the country/region that this
1644 // service area business is based in. See http://cldr.unicode.org/ and
1645 // http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
1646 // for details. Example: "CH" for Switzerland. This field is required for
1647 // CUSTOMER_LOCATION_ONLY businesses, and is ignored otherwise. The region
1648 // specified here can be different from regions for the areas that this
1649 // business serves (e.g. service area businesses that provide services in
1650 // regions other than the one that they are based in). If this location
1651 // requires verification after creation, the address provided for verification
1652 // purposes *must* be located within this region, and the business owner or
1653 // their authorized representative *must* be able to receive postal mail at the
1654 // provided verification address.
1655 RegionCode string `json:"regionCode,omitempty"`
1656 // ForceSendFields is a list of field names (e.g. "BusinessType") to
1657 // unconditionally include in API requests. By default, fields with empty or
1658 // default values are omitted from API requests. See
1659 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1660 // details.
1661 ForceSendFields []string `json:"-"`
1662 // NullFields is a list of field names (e.g. "BusinessType") to include in API
1663 // requests with the JSON null value. By default, fields with empty values are
1664 // omitted from API requests. See
1665 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1666 NullFields []string `json:"-"`
1667 }
1668
1669 func (s ServiceAreaBusiness) MarshalJSON() ([]byte, error) {
1670 type NoMethod ServiceAreaBusiness
1671 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1672 }
1673
1674 // ServiceItem: A message that describes a single service item. It is used to
1675 // describe the type of service that the merchant provides. For example,
1676 // haircut can be a service.
1677 type ServiceItem struct {
1678 // FreeFormServiceItem: Optional. This field will be set case of free-form
1679 // services data.
1680 FreeFormServiceItem *FreeFormServiceItem `json:"freeFormServiceItem,omitempty"`
1681 // Price: Optional. Represents the monetary price of the service item. We
1682 // recommend that currency_code and units should be set when including a price.
1683 // This will be treated as a fixed price for the service item.
1684 Price *Money `json:"price,omitempty"`
1685 // StructuredServiceItem: Optional. This field will be set case of structured
1686 // services data.
1687 StructuredServiceItem *StructuredServiceItem `json:"structuredServiceItem,omitempty"`
1688 // ForceSendFields is a list of field names (e.g. "FreeFormServiceItem") to
1689 // unconditionally include in API requests. By default, fields with empty or
1690 // default values are omitted from API requests. See
1691 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1692 // details.
1693 ForceSendFields []string `json:"-"`
1694 // NullFields is a list of field names (e.g. "FreeFormServiceItem") to include
1695 // in API requests with the JSON null value. By default, fields with empty
1696 // values are omitted from API requests. See
1697 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1698 NullFields []string `json:"-"`
1699 }
1700
1701 func (s ServiceItem) MarshalJSON() ([]byte, error) {
1702 type NoMethod ServiceItem
1703 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1704 }
1705
1706 // ServiceType: A message describing a service type that the business offers.
1707 type ServiceType struct {
1708 // DisplayName: Output only. The human-readable display name for the service
1709 // type.
1710 DisplayName string `json:"displayName,omitempty"`
1711 // ServiceTypeId: Output only. A stable ID (provided by Google) for this
1712 // service type.
1713 ServiceTypeId string `json:"serviceTypeId,omitempty"`
1714 // ForceSendFields is a list of field names (e.g. "DisplayName") to
1715 // unconditionally include in API requests. By default, fields with empty or
1716 // default values are omitted from API requests. See
1717 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1718 // details.
1719 ForceSendFields []string `json:"-"`
1720 // NullFields is a list of field names (e.g. "DisplayName") to include in API
1721 // requests with the JSON null value. By default, fields with empty values are
1722 // omitted from API requests. See
1723 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1724 NullFields []string `json:"-"`
1725 }
1726
1727 func (s ServiceType) MarshalJSON() ([]byte, error) {
1728 type NoMethod ServiceType
1729 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1730 }
1731
1732 // SpecialHourPeriod: Represents a single time period when a location's
1733 // operational hours differ from its normal business hours. A special hour
1734 // period must represent a range of less than 24 hours. The `open_time` and
1735 // `start_date` must predate the `close_time` and `end_date`. The `close_time`
1736 // and `end_date` can extend to 11:59 a.m. on the day after the specified
1737 // `start_date`. For example, the following inputs are valid:
1738 // start_date=2015-11-23, open_time=08:00, close_time=18:00
1739 // start_date=2015-11-23, end_date=2015-11-23, open_time=08:00,
1740 // close_time=18:00 start_date=2015-11-23, end_date=2015-11-24,
1741 // open_time=13:00, close_time=11:59 The following inputs are not valid:
1742 // start_date=2015-11-23, open_time=13:00, close_time=11:59
1743 // start_date=2015-11-23, end_date=2015-11-24, open_time=13:00,
1744 // close_time=12:00 start_date=2015-11-23, end_date=2015-11-25,
1745 // open_time=08:00, close_time=18:00
1746 type SpecialHourPeriod struct {
1747 // CloseTime: Optional. Valid values are 00:00-24:00, where 24:00 represents
1748 // midnight at the end of the specified day field. Must be specified if
1749 // `closed` is false.
1750 CloseTime *TimeOfDay `json:"closeTime,omitempty"`
1751 // Closed: Optional. If true, `end_date`, `open_time`, and `close_time` are
1752 // ignored, and the date specified in `start_date` is treated as the location
1753 // being closed for the entire day.
1754 Closed bool `json:"closed,omitempty"`
1755 // EndDate: Optional. The calendar date this special hour period ends on. If
1756 // `end_date` field is not set, default to the date specified in `start_date`.
1757 // If set, this field must be equal to or at most 1 day after `start_date`.
1758 EndDate *Date `json:"endDate,omitempty"`
1759 // OpenTime: Optional. Valid values are 00:00-24:00 where 24:00 represents
1760 // midnight at the end of the specified day field. Must be specified if
1761 // `closed` is false.
1762 OpenTime *TimeOfDay `json:"openTime,omitempty"`
1763 // StartDate: Required. The calendar date this special hour period starts on.
1764 StartDate *Date `json:"startDate,omitempty"`
1765 // ForceSendFields is a list of field names (e.g. "CloseTime") to
1766 // unconditionally include in API requests. By default, fields with empty or
1767 // default values are omitted from API requests. See
1768 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1769 // details.
1770 ForceSendFields []string `json:"-"`
1771 // NullFields is a list of field names (e.g. "CloseTime") to include in API
1772 // requests with the JSON null value. By default, fields with empty values are
1773 // omitted from API requests. See
1774 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1775 NullFields []string `json:"-"`
1776 }
1777
1778 func (s SpecialHourPeriod) MarshalJSON() ([]byte, error) {
1779 type NoMethod SpecialHourPeriod
1780 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1781 }
1782
1783 // SpecialHours: Represents a set of time periods when a location's operational
1784 // hours differ from its normal business hours.
1785 type SpecialHours struct {
1786 // SpecialHourPeriods: Required. A list of exceptions to the business's regular
1787 // hours.
1788 SpecialHourPeriods []*SpecialHourPeriod `json:"specialHourPeriods,omitempty"`
1789 // ForceSendFields is a list of field names (e.g. "SpecialHourPeriods") to
1790 // unconditionally include in API requests. By default, fields with empty or
1791 // default values are omitted from API requests. See
1792 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1793 // details.
1794 ForceSendFields []string `json:"-"`
1795 // NullFields is a list of field names (e.g. "SpecialHourPeriods") to include
1796 // in API requests with the JSON null value. By default, fields with empty
1797 // values are omitted from API requests. See
1798 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1799 NullFields []string `json:"-"`
1800 }
1801
1802 func (s SpecialHours) MarshalJSON() ([]byte, error) {
1803 type NoMethod SpecialHours
1804 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1805 }
1806
1807 // StructuredServiceItem: Represents a structured service offered by the
1808 // merchant. For eg: toilet_installation.
1809 type StructuredServiceItem struct {
1810 // Description: Optional. Description of structured service item. The character
1811 // limit is 300.
1812 Description string `json:"description,omitempty"`
1813 // ServiceTypeId: Required. The `service_type_id` field is a Google provided
1814 // unique ID that can be found in `ServiceType`. This information is provided
1815 // by `BatchGetCategories` rpc service.
1816 ServiceTypeId string `json:"serviceTypeId,omitempty"`
1817 // ForceSendFields is a list of field names (e.g. "Description") to
1818 // unconditionally include in API requests. By default, fields with empty or
1819 // default values are omitted from API requests. See
1820 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1821 // details.
1822 ForceSendFields []string `json:"-"`
1823 // NullFields is a list of field names (e.g. "Description") to include in API
1824 // requests with the JSON null value. By default, fields with empty values are
1825 // omitted from API requests. See
1826 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1827 NullFields []string `json:"-"`
1828 }
1829
1830 func (s StructuredServiceItem) MarshalJSON() ([]byte, error) {
1831 type NoMethod StructuredServiceItem
1832 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1833 }
1834
1835 // TimeOfDay: Represents a time of day. The date and time zone are either not
1836 // significant or are specified elsewhere. An API may choose to allow leap
1837 // seconds. Related types are google.type.Date and `google.protobuf.Timestamp`.
1838 type TimeOfDay struct {
1839 // Hours: Hours of a day in 24 hour format. Must be greater than or equal to 0
1840 // and typically must be less than or equal to 23. An API may choose to allow
1841 // the value "24:00:00" for scenarios like business closing time.
1842 Hours int64 `json:"hours,omitempty"`
1843 // Minutes: Minutes of an hour. Must be greater than or equal to 0 and less
1844 // than or equal to 59.
1845 Minutes int64 `json:"minutes,omitempty"`
1846 // Nanos: Fractions of seconds, in nanoseconds. Must be greater than or equal
1847 // to 0 and less than or equal to 999,999,999.
1848 Nanos int64 `json:"nanos,omitempty"`
1849 // Seconds: Seconds of a minute. Must be greater than or equal to 0 and
1850 // typically must be less than or equal to 59. An API may allow the value 60 if
1851 // it allows leap-seconds.
1852 Seconds int64 `json:"seconds,omitempty"`
1853 // ForceSendFields is a list of field names (e.g. "Hours") to unconditionally
1854 // include in API requests. By default, fields with empty or default values are
1855 // omitted from API requests. See
1856 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1857 // details.
1858 ForceSendFields []string `json:"-"`
1859 // NullFields is a list of field names (e.g. "Hours") to include in API
1860 // requests with the JSON null value. By default, fields with empty values are
1861 // omitted from API requests. See
1862 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1863 NullFields []string `json:"-"`
1864 }
1865
1866 func (s TimeOfDay) MarshalJSON() ([]byte, error) {
1867 type NoMethod TimeOfDay
1868 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1869 }
1870
1871 // TimePeriod: Represents a span of time that the business is open, starting on
1872 // the specified open day/time and closing on the specified close day/time. The
1873 // closing time must occur after the opening time, for example later in the
1874 // same day, or on a subsequent day.
1875 type TimePeriod struct {
1876 // CloseDay: Required. Indicates the day of the week this period ends on.
1877 //
1878 // Possible values:
1879 // "DAY_OF_WEEK_UNSPECIFIED" - The day of the week is unspecified.
1880 // "MONDAY" - Monday
1881 // "TUESDAY" - Tuesday
1882 // "WEDNESDAY" - Wednesday
1883 // "THURSDAY" - Thursday
1884 // "FRIDAY" - Friday
1885 // "SATURDAY" - Saturday
1886 // "SUNDAY" - Sunday
1887 CloseDay string `json:"closeDay,omitempty"`
1888 // CloseTime: Required. Valid values are 00:00-24:00, where 24:00 represents
1889 // midnight at the end of the specified day field.
1890 CloseTime *TimeOfDay `json:"closeTime,omitempty"`
1891 // OpenDay: Required. Indicates the day of the week this period starts on.
1892 //
1893 // Possible values:
1894 // "DAY_OF_WEEK_UNSPECIFIED" - The day of the week is unspecified.
1895 // "MONDAY" - Monday
1896 // "TUESDAY" - Tuesday
1897 // "WEDNESDAY" - Wednesday
1898 // "THURSDAY" - Thursday
1899 // "FRIDAY" - Friday
1900 // "SATURDAY" - Saturday
1901 // "SUNDAY" - Sunday
1902 OpenDay string `json:"openDay,omitempty"`
1903 // OpenTime: Required. Valid values are 00:00-24:00, where 24:00 represents
1904 // midnight at the end of the specified day field.
1905 OpenTime *TimeOfDay `json:"openTime,omitempty"`
1906 // ForceSendFields is a list of field names (e.g. "CloseDay") to
1907 // unconditionally include in API requests. By default, fields with empty or
1908 // default values are omitted from API requests. See
1909 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1910 // details.
1911 ForceSendFields []string `json:"-"`
1912 // NullFields is a list of field names (e.g. "CloseDay") to include in API
1913 // requests with the JSON null value. By default, fields with empty values are
1914 // omitted from API requests. See
1915 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1916 NullFields []string `json:"-"`
1917 }
1918
1919 func (s TimePeriod) MarshalJSON() ([]byte, error) {
1920 type NoMethod TimePeriod
1921 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1922 }
1923
1924 // UriAttributeValue: Values for an attribute with a `value_type` of URL.
1925 type UriAttributeValue struct {
1926 // Uri: Required. The proposed URI value for this attribute.
1927 Uri string `json:"uri,omitempty"`
1928 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally
1929 // include in API requests. By default, fields with empty or default values are
1930 // omitted from API requests. See
1931 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1932 // details.
1933 ForceSendFields []string `json:"-"`
1934 // NullFields is a list of field names (e.g. "Uri") to include in API requests
1935 // with the JSON null value. By default, fields with empty values are omitted
1936 // from API requests. See
1937 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1938 NullFields []string `json:"-"`
1939 }
1940
1941 func (s UriAttributeValue) MarshalJSON() ([]byte, error) {
1942 type NoMethod UriAttributeValue
1943 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1944 }
1945
1946 type AccountsLocationsCreateCall struct {
1947 s *Service
1948 parent string
1949 location *Location
1950 urlParams_ gensupport.URLParams
1951 ctx_ context.Context
1952 header_ http.Header
1953 }
1954
1955 // Create: Creates a new Location that will be owned by the logged in user.
1956 //
1957 // - parent: The name of the account in which to create this location.
1958 func (r *AccountsLocationsService) Create(parent string, location *Location) *AccountsLocationsCreateCall {
1959 c := &AccountsLocationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1960 c.parent = parent
1961 c.location = location
1962 return c
1963 }
1964
1965 // RequestId sets the optional parameter "requestId": A unique request ID for
1966 // the server to detect duplicated requests. We recommend using UUIDs. Max
1967 // length is 50 characters.
1968 func (c *AccountsLocationsCreateCall) RequestId(requestId string) *AccountsLocationsCreateCall {
1969 c.urlParams_.Set("requestId", requestId)
1970 return c
1971 }
1972
1973 // ValidateOnly sets the optional parameter "validateOnly": If true, the
1974 // request is validated without actually creating the location.
1975 func (c *AccountsLocationsCreateCall) ValidateOnly(validateOnly bool) *AccountsLocationsCreateCall {
1976 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
1977 return c
1978 }
1979
1980 // Fields allows partial responses to be retrieved. See
1981 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1982 // details.
1983 func (c *AccountsLocationsCreateCall) Fields(s ...googleapi.Field) *AccountsLocationsCreateCall {
1984 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1985 return c
1986 }
1987
1988 // Context sets the context to be used in this call's Do method.
1989 func (c *AccountsLocationsCreateCall) Context(ctx context.Context) *AccountsLocationsCreateCall {
1990 c.ctx_ = ctx
1991 return c
1992 }
1993
1994 // Header returns a http.Header that can be modified by the caller to add
1995 // headers to the request.
1996 func (c *AccountsLocationsCreateCall) Header() http.Header {
1997 if c.header_ == nil {
1998 c.header_ = make(http.Header)
1999 }
2000 return c.header_
2001 }
2002
2003 func (c *AccountsLocationsCreateCall) doRequest(alt string) (*http.Response, error) {
2004 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2005 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.location)
2006 if err != nil {
2007 return nil, err
2008 }
2009 c.urlParams_.Set("alt", alt)
2010 c.urlParams_.Set("prettyPrint", "false")
2011 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/locations")
2012 urls += "?" + c.urlParams_.Encode()
2013 req, err := http.NewRequest("POST", urls, body)
2014 if err != nil {
2015 return nil, err
2016 }
2017 req.Header = reqHeaders
2018 googleapi.Expand(req.URL, map[string]string{
2019 "parent": c.parent,
2020 })
2021 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.accounts.locations.create", "request", internallog.HTTPRequest(req, body.Bytes()))
2022 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2023 }
2024
2025 // Do executes the "mybusinessbusinessinformation.accounts.locations.create" call.
2026 // Any non-2xx status code is an error. Response headers are in either
2027 // *Location.ServerResponse.Header or (if a response was returned at all) in
2028 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2029 // whether the returned error was because http.StatusNotModified was returned.
2030 func (c *AccountsLocationsCreateCall) Do(opts ...googleapi.CallOption) (*Location, error) {
2031 gensupport.SetOptions(c.urlParams_, opts...)
2032 res, err := c.doRequest("json")
2033 if res != nil && res.StatusCode == http.StatusNotModified {
2034 if res.Body != nil {
2035 res.Body.Close()
2036 }
2037 return nil, gensupport.WrapError(&googleapi.Error{
2038 Code: res.StatusCode,
2039 Header: res.Header,
2040 })
2041 }
2042 if err != nil {
2043 return nil, err
2044 }
2045 defer googleapi.CloseBody(res)
2046 if err := googleapi.CheckResponse(res); err != nil {
2047 return nil, gensupport.WrapError(err)
2048 }
2049 ret := &Location{
2050 ServerResponse: googleapi.ServerResponse{
2051 Header: res.Header,
2052 HTTPStatusCode: res.StatusCode,
2053 },
2054 }
2055 target := &ret
2056 b, err := gensupport.DecodeResponseBytes(target, res)
2057 if err != nil {
2058 return nil, err
2059 }
2060 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.accounts.locations.create", "response", internallog.HTTPResponse(res, b))
2061 return ret, nil
2062 }
2063
2064 type AccountsLocationsListCall struct {
2065 s *Service
2066 parent string
2067 urlParams_ gensupport.URLParams
2068 ifNoneMatch_ string
2069 ctx_ context.Context
2070 header_ http.Header
2071 }
2072
2073 // List: Lists the locations for the specified account.
2074 //
2075 // - parent: The name of the account to fetch locations from. If the parent
2076 // Account is of AccountType PERSONAL, only Locations that are directly owned
2077 // by the Account are returned, otherwise it will return all accessible
2078 // locations from the Account, either directly or indirectly.
2079 func (r *AccountsLocationsService) List(parent string) *AccountsLocationsListCall {
2080 c := &AccountsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2081 c.parent = parent
2082 return c
2083 }
2084
2085 // Filter sets the optional parameter "filter": A filter constraining the
2086 // locations to return. The response includes only entries that match the
2087 // filter. If `filter` is empty, then constraints are applied and all locations
2088 // (paginated) are retrieved for the requested account. For more information
2089 // about valid fields and example usage, see Work with Location Data Guide
2090 // (https://developers.google.com/my-business/content/location-data#filter_results_when_you_list_locations).
2091 func (c *AccountsLocationsListCall) Filter(filter string) *AccountsLocationsListCall {
2092 c.urlParams_.Set("filter", filter)
2093 return c
2094 }
2095
2096 // OrderBy sets the optional parameter "orderBy": Sorting order for the
2097 // request. Multiple fields should be comma-separated, following SQL syntax.
2098 // The default sorting order is ascending. To specify descending order, a
2099 // suffix " desc" should be added. Valid fields to order_by are title and
2100 // store_code. For example: "title, store_code desc" or "title" or "store_code
2101 // desc"
2102 func (c *AccountsLocationsListCall) OrderBy(orderBy string) *AccountsLocationsListCall {
2103 c.urlParams_.Set("orderBy", orderBy)
2104 return c
2105 }
2106
2107 // PageSize sets the optional parameter "pageSize": How many locations to fetch
2108 // per page. Default value is 10 if not set. Minimum is 1, and maximum page
2109 // size is 100.
2110 func (c *AccountsLocationsListCall) PageSize(pageSize int64) *AccountsLocationsListCall {
2111 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2112 return c
2113 }
2114
2115 // PageToken sets the optional parameter "pageToken": If specified, it fetches
2116 // the next `page` of locations. The page token is returned by previous calls
2117 // to `ListLocations` when there were more locations than could fit in the
2118 // requested page size.
2119 func (c *AccountsLocationsListCall) PageToken(pageToken string) *AccountsLocationsListCall {
2120 c.urlParams_.Set("pageToken", pageToken)
2121 return c
2122 }
2123
2124 // ReadMask sets the optional parameter "readMask": Required. Read mask to
2125 // specify what fields will be returned in the response.
2126 func (c *AccountsLocationsListCall) ReadMask(readMask string) *AccountsLocationsListCall {
2127 c.urlParams_.Set("readMask", readMask)
2128 return c
2129 }
2130
2131 // Fields allows partial responses to be retrieved. See
2132 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2133 // details.
2134 func (c *AccountsLocationsListCall) Fields(s ...googleapi.Field) *AccountsLocationsListCall {
2135 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2136 return c
2137 }
2138
2139 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2140 // object's ETag matches the given value. This is useful for getting updates
2141 // only after the object has changed since the last request.
2142 func (c *AccountsLocationsListCall) IfNoneMatch(entityTag string) *AccountsLocationsListCall {
2143 c.ifNoneMatch_ = entityTag
2144 return c
2145 }
2146
2147 // Context sets the context to be used in this call's Do method.
2148 func (c *AccountsLocationsListCall) Context(ctx context.Context) *AccountsLocationsListCall {
2149 c.ctx_ = ctx
2150 return c
2151 }
2152
2153 // Header returns a http.Header that can be modified by the caller to add
2154 // headers to the request.
2155 func (c *AccountsLocationsListCall) Header() http.Header {
2156 if c.header_ == nil {
2157 c.header_ = make(http.Header)
2158 }
2159 return c.header_
2160 }
2161
2162 func (c *AccountsLocationsListCall) doRequest(alt string) (*http.Response, error) {
2163 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2164 if c.ifNoneMatch_ != "" {
2165 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2166 }
2167 c.urlParams_.Set("alt", alt)
2168 c.urlParams_.Set("prettyPrint", "false")
2169 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/locations")
2170 urls += "?" + c.urlParams_.Encode()
2171 req, err := http.NewRequest("GET", urls, nil)
2172 if err != nil {
2173 return nil, err
2174 }
2175 req.Header = reqHeaders
2176 googleapi.Expand(req.URL, map[string]string{
2177 "parent": c.parent,
2178 })
2179 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.accounts.locations.list", "request", internallog.HTTPRequest(req, nil))
2180 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2181 }
2182
2183 // Do executes the "mybusinessbusinessinformation.accounts.locations.list" call.
2184 // Any non-2xx status code is an error. Response headers are in either
2185 // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
2186 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2187 // check whether the returned error was because http.StatusNotModified was
2188 // returned.
2189 func (c *AccountsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
2190 gensupport.SetOptions(c.urlParams_, opts...)
2191 res, err := c.doRequest("json")
2192 if res != nil && res.StatusCode == http.StatusNotModified {
2193 if res.Body != nil {
2194 res.Body.Close()
2195 }
2196 return nil, gensupport.WrapError(&googleapi.Error{
2197 Code: res.StatusCode,
2198 Header: res.Header,
2199 })
2200 }
2201 if err != nil {
2202 return nil, err
2203 }
2204 defer googleapi.CloseBody(res)
2205 if err := googleapi.CheckResponse(res); err != nil {
2206 return nil, gensupport.WrapError(err)
2207 }
2208 ret := &ListLocationsResponse{
2209 ServerResponse: googleapi.ServerResponse{
2210 Header: res.Header,
2211 HTTPStatusCode: res.StatusCode,
2212 },
2213 }
2214 target := &ret
2215 b, err := gensupport.DecodeResponseBytes(target, res)
2216 if err != nil {
2217 return nil, err
2218 }
2219 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.accounts.locations.list", "response", internallog.HTTPResponse(res, b))
2220 return ret, nil
2221 }
2222
2223 // Pages invokes f for each page of results.
2224 // A non-nil error returned from f will halt the iteration.
2225 // The provided context supersedes any context provided to the Context method.
2226 func (c *AccountsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
2227 c.ctx_ = ctx
2228 defer c.PageToken(c.urlParams_.Get("pageToken"))
2229 for {
2230 x, err := c.Do()
2231 if err != nil {
2232 return err
2233 }
2234 if err := f(x); err != nil {
2235 return err
2236 }
2237 if x.NextPageToken == "" {
2238 return nil
2239 }
2240 c.PageToken(x.NextPageToken)
2241 }
2242 }
2243
2244 type AttributesListCall struct {
2245 s *Service
2246 urlParams_ gensupport.URLParams
2247 ifNoneMatch_ string
2248 ctx_ context.Context
2249 header_ http.Header
2250 }
2251
2252 // List: Returns the list of attributes that would be available for a location
2253 // with the given primary category and country.
2254 func (r *AttributesService) List() *AttributesListCall {
2255 c := &AttributesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2256 return c
2257 }
2258
2259 // CategoryName sets the optional parameter "categoryName": The primary
2260 // category stable ID to find available attributes. Must be of the format
2261 // categories/{category_id}.
2262 func (c *AttributesListCall) CategoryName(categoryName string) *AttributesListCall {
2263 c.urlParams_.Set("categoryName", categoryName)
2264 return c
2265 }
2266
2267 // LanguageCode sets the optional parameter "languageCode": The BCP 47 code of
2268 // language to get attribute display names in. If this language is not
2269 // available, they will be provided in English.
2270 func (c *AttributesListCall) LanguageCode(languageCode string) *AttributesListCall {
2271 c.urlParams_.Set("languageCode", languageCode)
2272 return c
2273 }
2274
2275 // PageSize sets the optional parameter "pageSize": How many attributes to
2276 // include per page. Default is 200, minimum is 1.
2277 func (c *AttributesListCall) PageSize(pageSize int64) *AttributesListCall {
2278 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2279 return c
2280 }
2281
2282 // PageToken sets the optional parameter "pageToken": If specified, the next
2283 // page of attribute metadata is retrieved.
2284 func (c *AttributesListCall) PageToken(pageToken string) *AttributesListCall {
2285 c.urlParams_.Set("pageToken", pageToken)
2286 return c
2287 }
2288
2289 // Parent sets the optional parameter "parent": Resource name of the location
2290 // to look up available attributes. If this field is set, category_name,
2291 // region_code, language_code and show_all are not required and must not be
2292 // set.
2293 func (c *AttributesListCall) Parent(parent string) *AttributesListCall {
2294 c.urlParams_.Set("parent", parent)
2295 return c
2296 }
2297
2298 // RegionCode sets the optional parameter "regionCode": The ISO 3166-1 alpha-2
2299 // country code to find available attributes.
2300 func (c *AttributesListCall) RegionCode(regionCode string) *AttributesListCall {
2301 c.urlParams_.Set("regionCode", regionCode)
2302 return c
2303 }
2304
2305 // ShowAll sets the optional parameter "showAll": Metadata for all available
2306 // attributes are returned when this field is set to true, disregarding parent
2307 // and category_name fields. language_code and region_code are required when
2308 // show_all is set to true.
2309 func (c *AttributesListCall) ShowAll(showAll bool) *AttributesListCall {
2310 c.urlParams_.Set("showAll", fmt.Sprint(showAll))
2311 return c
2312 }
2313
2314 // Fields allows partial responses to be retrieved. See
2315 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2316 // details.
2317 func (c *AttributesListCall) Fields(s ...googleapi.Field) *AttributesListCall {
2318 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2319 return c
2320 }
2321
2322 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2323 // object's ETag matches the given value. This is useful for getting updates
2324 // only after the object has changed since the last request.
2325 func (c *AttributesListCall) IfNoneMatch(entityTag string) *AttributesListCall {
2326 c.ifNoneMatch_ = entityTag
2327 return c
2328 }
2329
2330 // Context sets the context to be used in this call's Do method.
2331 func (c *AttributesListCall) Context(ctx context.Context) *AttributesListCall {
2332 c.ctx_ = ctx
2333 return c
2334 }
2335
2336 // Header returns a http.Header that can be modified by the caller to add
2337 // headers to the request.
2338 func (c *AttributesListCall) Header() http.Header {
2339 if c.header_ == nil {
2340 c.header_ = make(http.Header)
2341 }
2342 return c.header_
2343 }
2344
2345 func (c *AttributesListCall) doRequest(alt string) (*http.Response, error) {
2346 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2347 if c.ifNoneMatch_ != "" {
2348 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2349 }
2350 c.urlParams_.Set("alt", alt)
2351 c.urlParams_.Set("prettyPrint", "false")
2352 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/attributes")
2353 urls += "?" + c.urlParams_.Encode()
2354 req, err := http.NewRequest("GET", urls, nil)
2355 if err != nil {
2356 return nil, err
2357 }
2358 req.Header = reqHeaders
2359 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.attributes.list", "request", internallog.HTTPRequest(req, nil))
2360 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2361 }
2362
2363 // Do executes the "mybusinessbusinessinformation.attributes.list" call.
2364 // Any non-2xx status code is an error. Response headers are in either
2365 // *ListAttributeMetadataResponse.ServerResponse.Header or (if a response was
2366 // returned at all) in error.(*googleapi.Error).Header. Use
2367 // googleapi.IsNotModified to check whether the returned error was because
2368 // http.StatusNotModified was returned.
2369 func (c *AttributesListCall) Do(opts ...googleapi.CallOption) (*ListAttributeMetadataResponse, error) {
2370 gensupport.SetOptions(c.urlParams_, opts...)
2371 res, err := c.doRequest("json")
2372 if res != nil && res.StatusCode == http.StatusNotModified {
2373 if res.Body != nil {
2374 res.Body.Close()
2375 }
2376 return nil, gensupport.WrapError(&googleapi.Error{
2377 Code: res.StatusCode,
2378 Header: res.Header,
2379 })
2380 }
2381 if err != nil {
2382 return nil, err
2383 }
2384 defer googleapi.CloseBody(res)
2385 if err := googleapi.CheckResponse(res); err != nil {
2386 return nil, gensupport.WrapError(err)
2387 }
2388 ret := &ListAttributeMetadataResponse{
2389 ServerResponse: googleapi.ServerResponse{
2390 Header: res.Header,
2391 HTTPStatusCode: res.StatusCode,
2392 },
2393 }
2394 target := &ret
2395 b, err := gensupport.DecodeResponseBytes(target, res)
2396 if err != nil {
2397 return nil, err
2398 }
2399 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.attributes.list", "response", internallog.HTTPResponse(res, b))
2400 return ret, nil
2401 }
2402
2403 // Pages invokes f for each page of results.
2404 // A non-nil error returned from f will halt the iteration.
2405 // The provided context supersedes any context provided to the Context method.
2406 func (c *AttributesListCall) Pages(ctx context.Context, f func(*ListAttributeMetadataResponse) error) error {
2407 c.ctx_ = ctx
2408 defer c.PageToken(c.urlParams_.Get("pageToken"))
2409 for {
2410 x, err := c.Do()
2411 if err != nil {
2412 return err
2413 }
2414 if err := f(x); err != nil {
2415 return err
2416 }
2417 if x.NextPageToken == "" {
2418 return nil
2419 }
2420 c.PageToken(x.NextPageToken)
2421 }
2422 }
2423
2424 type CategoriesBatchGetCall struct {
2425 s *Service
2426 urlParams_ gensupport.URLParams
2427 ifNoneMatch_ string
2428 ctx_ context.Context
2429 header_ http.Header
2430 }
2431
2432 // BatchGet: Returns a list of business categories for the provided language
2433 // and GConcept ids.
2434 func (r *CategoriesService) BatchGet() *CategoriesBatchGetCall {
2435 c := &CategoriesBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2436 return c
2437 }
2438
2439 // LanguageCode sets the optional parameter "languageCode": Required. The BCP
2440 // 47 code of language that the category names should be returned in.
2441 func (c *CategoriesBatchGetCall) LanguageCode(languageCode string) *CategoriesBatchGetCall {
2442 c.urlParams_.Set("languageCode", languageCode)
2443 return c
2444 }
2445
2446 // Names sets the optional parameter "names": Required. At least one name must
2447 // be set. The GConcept ids the localized category names should be returned
2448 // for. To return details for more than one category, repeat this parameter in
2449 // the request.
2450 func (c *CategoriesBatchGetCall) Names(names ...string) *CategoriesBatchGetCall {
2451 c.urlParams_.SetMulti("names", append([]string{}, names...))
2452 return c
2453 }
2454
2455 // RegionCode sets the optional parameter "regionCode": The ISO 3166-1 alpha-2
2456 // country code used to infer non-standard language.
2457 func (c *CategoriesBatchGetCall) RegionCode(regionCode string) *CategoriesBatchGetCall {
2458 c.urlParams_.Set("regionCode", regionCode)
2459 return c
2460 }
2461
2462 // View sets the optional parameter "view": Required. Specifies which parts to
2463 // the Category resource should be returned in the response.
2464 //
2465 // Possible values:
2466 //
2467 // "CATEGORY_VIEW_UNSPECIFIED" - Not specified, equivalent to
2468 //
2469 // CATEGORY_METADATA_ONLY.
2470 //
2471 // "BASIC" - The server response will only include Category fields
2472 //
2473 // display_name, category_id and language_code. It omits any service type
2474 // metadata related fields.
2475 //
2476 // "FULL" - Returns all the fields in the response.
2477 func (c *CategoriesBatchGetCall) View(view string) *CategoriesBatchGetCall {
2478 c.urlParams_.Set("view", view)
2479 return c
2480 }
2481
2482 // Fields allows partial responses to be retrieved. See
2483 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2484 // details.
2485 func (c *CategoriesBatchGetCall) Fields(s ...googleapi.Field) *CategoriesBatchGetCall {
2486 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2487 return c
2488 }
2489
2490 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2491 // object's ETag matches the given value. This is useful for getting updates
2492 // only after the object has changed since the last request.
2493 func (c *CategoriesBatchGetCall) IfNoneMatch(entityTag string) *CategoriesBatchGetCall {
2494 c.ifNoneMatch_ = entityTag
2495 return c
2496 }
2497
2498 // Context sets the context to be used in this call's Do method.
2499 func (c *CategoriesBatchGetCall) Context(ctx context.Context) *CategoriesBatchGetCall {
2500 c.ctx_ = ctx
2501 return c
2502 }
2503
2504 // Header returns a http.Header that can be modified by the caller to add
2505 // headers to the request.
2506 func (c *CategoriesBatchGetCall) Header() http.Header {
2507 if c.header_ == nil {
2508 c.header_ = make(http.Header)
2509 }
2510 return c.header_
2511 }
2512
2513 func (c *CategoriesBatchGetCall) doRequest(alt string) (*http.Response, error) {
2514 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2515 if c.ifNoneMatch_ != "" {
2516 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2517 }
2518 c.urlParams_.Set("alt", alt)
2519 c.urlParams_.Set("prettyPrint", "false")
2520 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/categories:batchGet")
2521 urls += "?" + c.urlParams_.Encode()
2522 req, err := http.NewRequest("GET", urls, nil)
2523 if err != nil {
2524 return nil, err
2525 }
2526 req.Header = reqHeaders
2527 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.categories.batchGet", "request", internallog.HTTPRequest(req, nil))
2528 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2529 }
2530
2531 // Do executes the "mybusinessbusinessinformation.categories.batchGet" call.
2532 // Any non-2xx status code is an error. Response headers are in either
2533 // *BatchGetCategoriesResponse.ServerResponse.Header or (if a response was
2534 // returned at all) in error.(*googleapi.Error).Header. Use
2535 // googleapi.IsNotModified to check whether the returned error was because
2536 // http.StatusNotModified was returned.
2537 func (c *CategoriesBatchGetCall) Do(opts ...googleapi.CallOption) (*BatchGetCategoriesResponse, error) {
2538 gensupport.SetOptions(c.urlParams_, opts...)
2539 res, err := c.doRequest("json")
2540 if res != nil && res.StatusCode == http.StatusNotModified {
2541 if res.Body != nil {
2542 res.Body.Close()
2543 }
2544 return nil, gensupport.WrapError(&googleapi.Error{
2545 Code: res.StatusCode,
2546 Header: res.Header,
2547 })
2548 }
2549 if err != nil {
2550 return nil, err
2551 }
2552 defer googleapi.CloseBody(res)
2553 if err := googleapi.CheckResponse(res); err != nil {
2554 return nil, gensupport.WrapError(err)
2555 }
2556 ret := &BatchGetCategoriesResponse{
2557 ServerResponse: googleapi.ServerResponse{
2558 Header: res.Header,
2559 HTTPStatusCode: res.StatusCode,
2560 },
2561 }
2562 target := &ret
2563 b, err := gensupport.DecodeResponseBytes(target, res)
2564 if err != nil {
2565 return nil, err
2566 }
2567 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.categories.batchGet", "response", internallog.HTTPResponse(res, b))
2568 return ret, nil
2569 }
2570
2571 type CategoriesListCall struct {
2572 s *Service
2573 urlParams_ gensupport.URLParams
2574 ifNoneMatch_ string
2575 ctx_ context.Context
2576 header_ http.Header
2577 }
2578
2579 // List: Returns a list of business categories. Search will match the category
2580 // name but not the category ID. Search only matches the front of a category
2581 // name (that is, 'food' may return 'Food Court' but not 'Fast Food
2582 // Restaurant').
2583 func (r *CategoriesService) List() *CategoriesListCall {
2584 c := &CategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2585 return c
2586 }
2587
2588 // Filter sets the optional parameter "filter": Filter string from user. The
2589 // only field that supported is `displayName`. Eg: `filter=displayName=foo`.
2590 func (c *CategoriesListCall) Filter(filter string) *CategoriesListCall {
2591 c.urlParams_.Set("filter", filter)
2592 return c
2593 }
2594
2595 // LanguageCode sets the optional parameter "languageCode": Required. The BCP
2596 // 47 code of language.
2597 func (c *CategoriesListCall) LanguageCode(languageCode string) *CategoriesListCall {
2598 c.urlParams_.Set("languageCode", languageCode)
2599 return c
2600 }
2601
2602 // PageSize sets the optional parameter "pageSize": How many categories to
2603 // fetch per page. Default is 100, minimum is 1, and maximum page size is 100.
2604 func (c *CategoriesListCall) PageSize(pageSize int64) *CategoriesListCall {
2605 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2606 return c
2607 }
2608
2609 // PageToken sets the optional parameter "pageToken": If specified, the next
2610 // page of categories will be fetched.
2611 func (c *CategoriesListCall) PageToken(pageToken string) *CategoriesListCall {
2612 c.urlParams_.Set("pageToken", pageToken)
2613 return c
2614 }
2615
2616 // RegionCode sets the optional parameter "regionCode": Required. The ISO
2617 // 3166-1 alpha-2 country code.
2618 func (c *CategoriesListCall) RegionCode(regionCode string) *CategoriesListCall {
2619 c.urlParams_.Set("regionCode", regionCode)
2620 return c
2621 }
2622
2623 // View sets the optional parameter "view": Required. Specifies which parts to
2624 // the Category resource should be returned in the response.
2625 //
2626 // Possible values:
2627 //
2628 // "CATEGORY_VIEW_UNSPECIFIED" - Not specified, equivalent to
2629 //
2630 // CATEGORY_METADATA_ONLY.
2631 //
2632 // "BASIC" - The server response will only include Category fields
2633 //
2634 // display_name, category_id and language_code. It omits any service type
2635 // metadata related fields.
2636 //
2637 // "FULL" - Returns all the fields in the response.
2638 func (c *CategoriesListCall) View(view string) *CategoriesListCall {
2639 c.urlParams_.Set("view", view)
2640 return c
2641 }
2642
2643 // Fields allows partial responses to be retrieved. See
2644 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2645 // details.
2646 func (c *CategoriesListCall) Fields(s ...googleapi.Field) *CategoriesListCall {
2647 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2648 return c
2649 }
2650
2651 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2652 // object's ETag matches the given value. This is useful for getting updates
2653 // only after the object has changed since the last request.
2654 func (c *CategoriesListCall) IfNoneMatch(entityTag string) *CategoriesListCall {
2655 c.ifNoneMatch_ = entityTag
2656 return c
2657 }
2658
2659 // Context sets the context to be used in this call's Do method.
2660 func (c *CategoriesListCall) Context(ctx context.Context) *CategoriesListCall {
2661 c.ctx_ = ctx
2662 return c
2663 }
2664
2665 // Header returns a http.Header that can be modified by the caller to add
2666 // headers to the request.
2667 func (c *CategoriesListCall) Header() http.Header {
2668 if c.header_ == nil {
2669 c.header_ = make(http.Header)
2670 }
2671 return c.header_
2672 }
2673
2674 func (c *CategoriesListCall) doRequest(alt string) (*http.Response, error) {
2675 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2676 if c.ifNoneMatch_ != "" {
2677 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2678 }
2679 c.urlParams_.Set("alt", alt)
2680 c.urlParams_.Set("prettyPrint", "false")
2681 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/categories")
2682 urls += "?" + c.urlParams_.Encode()
2683 req, err := http.NewRequest("GET", urls, nil)
2684 if err != nil {
2685 return nil, err
2686 }
2687 req.Header = reqHeaders
2688 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.categories.list", "request", internallog.HTTPRequest(req, nil))
2689 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2690 }
2691
2692 // Do executes the "mybusinessbusinessinformation.categories.list" call.
2693 // Any non-2xx status code is an error. Response headers are in either
2694 // *ListCategoriesResponse.ServerResponse.Header or (if a response was returned
2695 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2696 // check whether the returned error was because http.StatusNotModified was
2697 // returned.
2698 func (c *CategoriesListCall) Do(opts ...googleapi.CallOption) (*ListCategoriesResponse, error) {
2699 gensupport.SetOptions(c.urlParams_, opts...)
2700 res, err := c.doRequest("json")
2701 if res != nil && res.StatusCode == http.StatusNotModified {
2702 if res.Body != nil {
2703 res.Body.Close()
2704 }
2705 return nil, gensupport.WrapError(&googleapi.Error{
2706 Code: res.StatusCode,
2707 Header: res.Header,
2708 })
2709 }
2710 if err != nil {
2711 return nil, err
2712 }
2713 defer googleapi.CloseBody(res)
2714 if err := googleapi.CheckResponse(res); err != nil {
2715 return nil, gensupport.WrapError(err)
2716 }
2717 ret := &ListCategoriesResponse{
2718 ServerResponse: googleapi.ServerResponse{
2719 Header: res.Header,
2720 HTTPStatusCode: res.StatusCode,
2721 },
2722 }
2723 target := &ret
2724 b, err := gensupport.DecodeResponseBytes(target, res)
2725 if err != nil {
2726 return nil, err
2727 }
2728 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.categories.list", "response", internallog.HTTPResponse(res, b))
2729 return ret, nil
2730 }
2731
2732 // Pages invokes f for each page of results.
2733 // A non-nil error returned from f will halt the iteration.
2734 // The provided context supersedes any context provided to the Context method.
2735 func (c *CategoriesListCall) Pages(ctx context.Context, f func(*ListCategoriesResponse) error) error {
2736 c.ctx_ = ctx
2737 defer c.PageToken(c.urlParams_.Get("pageToken"))
2738 for {
2739 x, err := c.Do()
2740 if err != nil {
2741 return err
2742 }
2743 if err := f(x); err != nil {
2744 return err
2745 }
2746 if x.NextPageToken == "" {
2747 return nil
2748 }
2749 c.PageToken(x.NextPageToken)
2750 }
2751 }
2752
2753 type ChainsGetCall struct {
2754 s *Service
2755 name string
2756 urlParams_ gensupport.URLParams
2757 ifNoneMatch_ string
2758 ctx_ context.Context
2759 header_ http.Header
2760 }
2761
2762 // Get: Gets the specified chain. Returns `NOT_FOUND` if the chain does not
2763 // exist.
2764 //
2765 // - name: The chain's resource name, in the format `chains/{chain_place_id}`.
2766 func (r *ChainsService) Get(name string) *ChainsGetCall {
2767 c := &ChainsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2768 c.name = name
2769 return c
2770 }
2771
2772 // Fields allows partial responses to be retrieved. See
2773 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2774 // details.
2775 func (c *ChainsGetCall) Fields(s ...googleapi.Field) *ChainsGetCall {
2776 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2777 return c
2778 }
2779
2780 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2781 // object's ETag matches the given value. This is useful for getting updates
2782 // only after the object has changed since the last request.
2783 func (c *ChainsGetCall) IfNoneMatch(entityTag string) *ChainsGetCall {
2784 c.ifNoneMatch_ = entityTag
2785 return c
2786 }
2787
2788 // Context sets the context to be used in this call's Do method.
2789 func (c *ChainsGetCall) Context(ctx context.Context) *ChainsGetCall {
2790 c.ctx_ = ctx
2791 return c
2792 }
2793
2794 // Header returns a http.Header that can be modified by the caller to add
2795 // headers to the request.
2796 func (c *ChainsGetCall) Header() http.Header {
2797 if c.header_ == nil {
2798 c.header_ = make(http.Header)
2799 }
2800 return c.header_
2801 }
2802
2803 func (c *ChainsGetCall) doRequest(alt string) (*http.Response, error) {
2804 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2805 if c.ifNoneMatch_ != "" {
2806 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2807 }
2808 c.urlParams_.Set("alt", alt)
2809 c.urlParams_.Set("prettyPrint", "false")
2810 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2811 urls += "?" + c.urlParams_.Encode()
2812 req, err := http.NewRequest("GET", urls, nil)
2813 if err != nil {
2814 return nil, err
2815 }
2816 req.Header = reqHeaders
2817 googleapi.Expand(req.URL, map[string]string{
2818 "name": c.name,
2819 })
2820 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.chains.get", "request", internallog.HTTPRequest(req, nil))
2821 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2822 }
2823
2824 // Do executes the "mybusinessbusinessinformation.chains.get" call.
2825 // Any non-2xx status code is an error. Response headers are in either
2826 // *Chain.ServerResponse.Header or (if a response was returned at all) in
2827 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2828 // whether the returned error was because http.StatusNotModified was returned.
2829 func (c *ChainsGetCall) Do(opts ...googleapi.CallOption) (*Chain, error) {
2830 gensupport.SetOptions(c.urlParams_, opts...)
2831 res, err := c.doRequest("json")
2832 if res != nil && res.StatusCode == http.StatusNotModified {
2833 if res.Body != nil {
2834 res.Body.Close()
2835 }
2836 return nil, gensupport.WrapError(&googleapi.Error{
2837 Code: res.StatusCode,
2838 Header: res.Header,
2839 })
2840 }
2841 if err != nil {
2842 return nil, err
2843 }
2844 defer googleapi.CloseBody(res)
2845 if err := googleapi.CheckResponse(res); err != nil {
2846 return nil, gensupport.WrapError(err)
2847 }
2848 ret := &Chain{
2849 ServerResponse: googleapi.ServerResponse{
2850 Header: res.Header,
2851 HTTPStatusCode: res.StatusCode,
2852 },
2853 }
2854 target := &ret
2855 b, err := gensupport.DecodeResponseBytes(target, res)
2856 if err != nil {
2857 return nil, err
2858 }
2859 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.chains.get", "response", internallog.HTTPResponse(res, b))
2860 return ret, nil
2861 }
2862
2863 type ChainsSearchCall struct {
2864 s *Service
2865 urlParams_ gensupport.URLParams
2866 ifNoneMatch_ string
2867 ctx_ context.Context
2868 header_ http.Header
2869 }
2870
2871 // Search: Searches the chain based on chain name.
2872 func (r *ChainsService) Search() *ChainsSearchCall {
2873 c := &ChainsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2874 return c
2875 }
2876
2877 // ChainName sets the optional parameter "chainName": Required. Search for a
2878 // chain by its name. Exact/partial/fuzzy/related queries are supported.
2879 // Examples: "walmart", "wal-mart", "walmmmart", "沃尔玛"
2880 func (c *ChainsSearchCall) ChainName(chainName string) *ChainsSearchCall {
2881 c.urlParams_.Set("chainName", chainName)
2882 return c
2883 }
2884
2885 // PageSize sets the optional parameter "pageSize": The maximum number of
2886 // matched chains to return from this query. The default is 10. The maximum
2887 // possible value is 500.
2888 func (c *ChainsSearchCall) PageSize(pageSize int64) *ChainsSearchCall {
2889 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2890 return c
2891 }
2892
2893 // Fields allows partial responses to be retrieved. See
2894 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2895 // details.
2896 func (c *ChainsSearchCall) Fields(s ...googleapi.Field) *ChainsSearchCall {
2897 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2898 return c
2899 }
2900
2901 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2902 // object's ETag matches the given value. This is useful for getting updates
2903 // only after the object has changed since the last request.
2904 func (c *ChainsSearchCall) IfNoneMatch(entityTag string) *ChainsSearchCall {
2905 c.ifNoneMatch_ = entityTag
2906 return c
2907 }
2908
2909 // Context sets the context to be used in this call's Do method.
2910 func (c *ChainsSearchCall) Context(ctx context.Context) *ChainsSearchCall {
2911 c.ctx_ = ctx
2912 return c
2913 }
2914
2915 // Header returns a http.Header that can be modified by the caller to add
2916 // headers to the request.
2917 func (c *ChainsSearchCall) Header() http.Header {
2918 if c.header_ == nil {
2919 c.header_ = make(http.Header)
2920 }
2921 return c.header_
2922 }
2923
2924 func (c *ChainsSearchCall) doRequest(alt string) (*http.Response, error) {
2925 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2926 if c.ifNoneMatch_ != "" {
2927 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2928 }
2929 c.urlParams_.Set("alt", alt)
2930 c.urlParams_.Set("prettyPrint", "false")
2931 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/chains:search")
2932 urls += "?" + c.urlParams_.Encode()
2933 req, err := http.NewRequest("GET", urls, nil)
2934 if err != nil {
2935 return nil, err
2936 }
2937 req.Header = reqHeaders
2938 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.chains.search", "request", internallog.HTTPRequest(req, nil))
2939 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2940 }
2941
2942 // Do executes the "mybusinessbusinessinformation.chains.search" call.
2943 // Any non-2xx status code is an error. Response headers are in either
2944 // *SearchChainsResponse.ServerResponse.Header or (if a response was returned
2945 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2946 // check whether the returned error was because http.StatusNotModified was
2947 // returned.
2948 func (c *ChainsSearchCall) Do(opts ...googleapi.CallOption) (*SearchChainsResponse, error) {
2949 gensupport.SetOptions(c.urlParams_, opts...)
2950 res, err := c.doRequest("json")
2951 if res != nil && res.StatusCode == http.StatusNotModified {
2952 if res.Body != nil {
2953 res.Body.Close()
2954 }
2955 return nil, gensupport.WrapError(&googleapi.Error{
2956 Code: res.StatusCode,
2957 Header: res.Header,
2958 })
2959 }
2960 if err != nil {
2961 return nil, err
2962 }
2963 defer googleapi.CloseBody(res)
2964 if err := googleapi.CheckResponse(res); err != nil {
2965 return nil, gensupport.WrapError(err)
2966 }
2967 ret := &SearchChainsResponse{
2968 ServerResponse: googleapi.ServerResponse{
2969 Header: res.Header,
2970 HTTPStatusCode: res.StatusCode,
2971 },
2972 }
2973 target := &ret
2974 b, err := gensupport.DecodeResponseBytes(target, res)
2975 if err != nil {
2976 return nil, err
2977 }
2978 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.chains.search", "response", internallog.HTTPResponse(res, b))
2979 return ret, nil
2980 }
2981
2982 type GoogleLocationsSearchCall struct {
2983 s *Service
2984 searchgooglelocationsrequest *SearchGoogleLocationsRequest
2985 urlParams_ gensupport.URLParams
2986 ctx_ context.Context
2987 header_ http.Header
2988 }
2989
2990 // Search: Search all of the possible locations that are a match to the
2991 // specified request.
2992 func (r *GoogleLocationsService) Search(searchgooglelocationsrequest *SearchGoogleLocationsRequest) *GoogleLocationsSearchCall {
2993 c := &GoogleLocationsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2994 c.searchgooglelocationsrequest = searchgooglelocationsrequest
2995 return c
2996 }
2997
2998 // Fields allows partial responses to be retrieved. See
2999 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3000 // details.
3001 func (c *GoogleLocationsSearchCall) Fields(s ...googleapi.Field) *GoogleLocationsSearchCall {
3002 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3003 return c
3004 }
3005
3006 // Context sets the context to be used in this call's Do method.
3007 func (c *GoogleLocationsSearchCall) Context(ctx context.Context) *GoogleLocationsSearchCall {
3008 c.ctx_ = ctx
3009 return c
3010 }
3011
3012 // Header returns a http.Header that can be modified by the caller to add
3013 // headers to the request.
3014 func (c *GoogleLocationsSearchCall) Header() http.Header {
3015 if c.header_ == nil {
3016 c.header_ = make(http.Header)
3017 }
3018 return c.header_
3019 }
3020
3021 func (c *GoogleLocationsSearchCall) doRequest(alt string) (*http.Response, error) {
3022 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3023 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.searchgooglelocationsrequest)
3024 if err != nil {
3025 return nil, err
3026 }
3027 c.urlParams_.Set("alt", alt)
3028 c.urlParams_.Set("prettyPrint", "false")
3029 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/googleLocations:search")
3030 urls += "?" + c.urlParams_.Encode()
3031 req, err := http.NewRequest("POST", urls, body)
3032 if err != nil {
3033 return nil, err
3034 }
3035 req.Header = reqHeaders
3036 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.googleLocations.search", "request", internallog.HTTPRequest(req, body.Bytes()))
3037 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3038 }
3039
3040 // Do executes the "mybusinessbusinessinformation.googleLocations.search" call.
3041 // Any non-2xx status code is an error. Response headers are in either
3042 // *SearchGoogleLocationsResponse.ServerResponse.Header or (if a response was
3043 // returned at all) in error.(*googleapi.Error).Header. Use
3044 // googleapi.IsNotModified to check whether the returned error was because
3045 // http.StatusNotModified was returned.
3046 func (c *GoogleLocationsSearchCall) Do(opts ...googleapi.CallOption) (*SearchGoogleLocationsResponse, error) {
3047 gensupport.SetOptions(c.urlParams_, opts...)
3048 res, err := c.doRequest("json")
3049 if res != nil && res.StatusCode == http.StatusNotModified {
3050 if res.Body != nil {
3051 res.Body.Close()
3052 }
3053 return nil, gensupport.WrapError(&googleapi.Error{
3054 Code: res.StatusCode,
3055 Header: res.Header,
3056 })
3057 }
3058 if err != nil {
3059 return nil, err
3060 }
3061 defer googleapi.CloseBody(res)
3062 if err := googleapi.CheckResponse(res); err != nil {
3063 return nil, gensupport.WrapError(err)
3064 }
3065 ret := &SearchGoogleLocationsResponse{
3066 ServerResponse: googleapi.ServerResponse{
3067 Header: res.Header,
3068 HTTPStatusCode: res.StatusCode,
3069 },
3070 }
3071 target := &ret
3072 b, err := gensupport.DecodeResponseBytes(target, res)
3073 if err != nil {
3074 return nil, err
3075 }
3076 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.googleLocations.search", "response", internallog.HTTPResponse(res, b))
3077 return ret, nil
3078 }
3079
3080 type LocationsDeleteCall struct {
3081 s *Service
3082 name string
3083 urlParams_ gensupport.URLParams
3084 ctx_ context.Context
3085 header_ http.Header
3086 }
3087
3088 // Delete: Deletes a location. If this location cannot be deleted using the API
3089 // and it is marked so in the
3090 // `google.mybusiness.businessinformation.v1.LocationState`, use the Google
3091 // Business Profile (https://business.google.com/manage/) website.
3092 //
3093 // - name: The name of the location to delete.
3094 func (r *LocationsService) Delete(name string) *LocationsDeleteCall {
3095 c := &LocationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3096 c.name = name
3097 return c
3098 }
3099
3100 // Fields allows partial responses to be retrieved. See
3101 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3102 // details.
3103 func (c *LocationsDeleteCall) Fields(s ...googleapi.Field) *LocationsDeleteCall {
3104 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3105 return c
3106 }
3107
3108 // Context sets the context to be used in this call's Do method.
3109 func (c *LocationsDeleteCall) Context(ctx context.Context) *LocationsDeleteCall {
3110 c.ctx_ = ctx
3111 return c
3112 }
3113
3114 // Header returns a http.Header that can be modified by the caller to add
3115 // headers to the request.
3116 func (c *LocationsDeleteCall) Header() http.Header {
3117 if c.header_ == nil {
3118 c.header_ = make(http.Header)
3119 }
3120 return c.header_
3121 }
3122
3123 func (c *LocationsDeleteCall) doRequest(alt string) (*http.Response, error) {
3124 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3125 c.urlParams_.Set("alt", alt)
3126 c.urlParams_.Set("prettyPrint", "false")
3127 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3128 urls += "?" + c.urlParams_.Encode()
3129 req, err := http.NewRequest("DELETE", urls, nil)
3130 if err != nil {
3131 return nil, err
3132 }
3133 req.Header = reqHeaders
3134 googleapi.Expand(req.URL, map[string]string{
3135 "name": c.name,
3136 })
3137 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.delete", "request", internallog.HTTPRequest(req, nil))
3138 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3139 }
3140
3141 // Do executes the "mybusinessbusinessinformation.locations.delete" call.
3142 // Any non-2xx status code is an error. Response headers are in either
3143 // *Empty.ServerResponse.Header or (if a response was returned at all) in
3144 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3145 // whether the returned error was because http.StatusNotModified was returned.
3146 func (c *LocationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3147 gensupport.SetOptions(c.urlParams_, opts...)
3148 res, err := c.doRequest("json")
3149 if res != nil && res.StatusCode == http.StatusNotModified {
3150 if res.Body != nil {
3151 res.Body.Close()
3152 }
3153 return nil, gensupport.WrapError(&googleapi.Error{
3154 Code: res.StatusCode,
3155 Header: res.Header,
3156 })
3157 }
3158 if err != nil {
3159 return nil, err
3160 }
3161 defer googleapi.CloseBody(res)
3162 if err := googleapi.CheckResponse(res); err != nil {
3163 return nil, gensupport.WrapError(err)
3164 }
3165 ret := &Empty{
3166 ServerResponse: googleapi.ServerResponse{
3167 Header: res.Header,
3168 HTTPStatusCode: res.StatusCode,
3169 },
3170 }
3171 target := &ret
3172 b, err := gensupport.DecodeResponseBytes(target, res)
3173 if err != nil {
3174 return nil, err
3175 }
3176 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.delete", "response", internallog.HTTPResponse(res, b))
3177 return ret, nil
3178 }
3179
3180 type LocationsGetCall struct {
3181 s *Service
3182 name string
3183 urlParams_ gensupport.URLParams
3184 ifNoneMatch_ string
3185 ctx_ context.Context
3186 header_ http.Header
3187 }
3188
3189 // Get: Returns the specified location.
3190 //
3191 // - name: The name of the location to fetch.
3192 func (r *LocationsService) Get(name string) *LocationsGetCall {
3193 c := &LocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3194 c.name = name
3195 return c
3196 }
3197
3198 // ReadMask sets the optional parameter "readMask": Required. Read mask to
3199 // specify what fields will be returned in the response.
3200 func (c *LocationsGetCall) ReadMask(readMask string) *LocationsGetCall {
3201 c.urlParams_.Set("readMask", readMask)
3202 return c
3203 }
3204
3205 // Fields allows partial responses to be retrieved. See
3206 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3207 // details.
3208 func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall {
3209 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3210 return c
3211 }
3212
3213 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3214 // object's ETag matches the given value. This is useful for getting updates
3215 // only after the object has changed since the last request.
3216 func (c *LocationsGetCall) IfNoneMatch(entityTag string) *LocationsGetCall {
3217 c.ifNoneMatch_ = entityTag
3218 return c
3219 }
3220
3221 // Context sets the context to be used in this call's Do method.
3222 func (c *LocationsGetCall) Context(ctx context.Context) *LocationsGetCall {
3223 c.ctx_ = ctx
3224 return c
3225 }
3226
3227 // Header returns a http.Header that can be modified by the caller to add
3228 // headers to the request.
3229 func (c *LocationsGetCall) Header() http.Header {
3230 if c.header_ == nil {
3231 c.header_ = make(http.Header)
3232 }
3233 return c.header_
3234 }
3235
3236 func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) {
3237 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3238 if c.ifNoneMatch_ != "" {
3239 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3240 }
3241 c.urlParams_.Set("alt", alt)
3242 c.urlParams_.Set("prettyPrint", "false")
3243 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3244 urls += "?" + c.urlParams_.Encode()
3245 req, err := http.NewRequest("GET", urls, nil)
3246 if err != nil {
3247 return nil, err
3248 }
3249 req.Header = reqHeaders
3250 googleapi.Expand(req.URL, map[string]string{
3251 "name": c.name,
3252 })
3253 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.get", "request", internallog.HTTPRequest(req, nil))
3254 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3255 }
3256
3257 // Do executes the "mybusinessbusinessinformation.locations.get" call.
3258 // Any non-2xx status code is an error. Response headers are in either
3259 // *Location.ServerResponse.Header or (if a response was returned at all) in
3260 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3261 // whether the returned error was because http.StatusNotModified was returned.
3262 func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
3263 gensupport.SetOptions(c.urlParams_, opts...)
3264 res, err := c.doRequest("json")
3265 if res != nil && res.StatusCode == http.StatusNotModified {
3266 if res.Body != nil {
3267 res.Body.Close()
3268 }
3269 return nil, gensupport.WrapError(&googleapi.Error{
3270 Code: res.StatusCode,
3271 Header: res.Header,
3272 })
3273 }
3274 if err != nil {
3275 return nil, err
3276 }
3277 defer googleapi.CloseBody(res)
3278 if err := googleapi.CheckResponse(res); err != nil {
3279 return nil, gensupport.WrapError(err)
3280 }
3281 ret := &Location{
3282 ServerResponse: googleapi.ServerResponse{
3283 Header: res.Header,
3284 HTTPStatusCode: res.StatusCode,
3285 },
3286 }
3287 target := &ret
3288 b, err := gensupport.DecodeResponseBytes(target, res)
3289 if err != nil {
3290 return nil, err
3291 }
3292 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.get", "response", internallog.HTTPResponse(res, b))
3293 return ret, nil
3294 }
3295
3296 type LocationsGetAttributesCall struct {
3297 s *Service
3298 nameid string
3299 urlParams_ gensupport.URLParams
3300 ifNoneMatch_ string
3301 ctx_ context.Context
3302 header_ http.Header
3303 }
3304
3305 // GetAttributes: Looks up all the attributes set for a given location.
3306 //
3307 // - name: Google identifier for this location in the form of
3308 // `locations/{location_id}/attributes`.
3309 func (r *LocationsService) GetAttributes(nameid string) *LocationsGetAttributesCall {
3310 c := &LocationsGetAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3311 c.nameid = nameid
3312 return c
3313 }
3314
3315 // Fields allows partial responses to be retrieved. See
3316 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3317 // details.
3318 func (c *LocationsGetAttributesCall) Fields(s ...googleapi.Field) *LocationsGetAttributesCall {
3319 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3320 return c
3321 }
3322
3323 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3324 // object's ETag matches the given value. This is useful for getting updates
3325 // only after the object has changed since the last request.
3326 func (c *LocationsGetAttributesCall) IfNoneMatch(entityTag string) *LocationsGetAttributesCall {
3327 c.ifNoneMatch_ = entityTag
3328 return c
3329 }
3330
3331 // Context sets the context to be used in this call's Do method.
3332 func (c *LocationsGetAttributesCall) Context(ctx context.Context) *LocationsGetAttributesCall {
3333 c.ctx_ = ctx
3334 return c
3335 }
3336
3337 // Header returns a http.Header that can be modified by the caller to add
3338 // headers to the request.
3339 func (c *LocationsGetAttributesCall) Header() http.Header {
3340 if c.header_ == nil {
3341 c.header_ = make(http.Header)
3342 }
3343 return c.header_
3344 }
3345
3346 func (c *LocationsGetAttributesCall) doRequest(alt string) (*http.Response, error) {
3347 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3348 if c.ifNoneMatch_ != "" {
3349 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3350 }
3351 c.urlParams_.Set("alt", alt)
3352 c.urlParams_.Set("prettyPrint", "false")
3353 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3354 urls += "?" + c.urlParams_.Encode()
3355 req, err := http.NewRequest("GET", urls, nil)
3356 if err != nil {
3357 return nil, err
3358 }
3359 req.Header = reqHeaders
3360 googleapi.Expand(req.URL, map[string]string{
3361 "name": c.nameid,
3362 })
3363 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.getAttributes", "request", internallog.HTTPRequest(req, nil))
3364 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3365 }
3366
3367 // Do executes the "mybusinessbusinessinformation.locations.getAttributes" call.
3368 // Any non-2xx status code is an error. Response headers are in either
3369 // *Attributes.ServerResponse.Header or (if a response was returned at all) in
3370 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3371 // whether the returned error was because http.StatusNotModified was returned.
3372 func (c *LocationsGetAttributesCall) Do(opts ...googleapi.CallOption) (*Attributes, error) {
3373 gensupport.SetOptions(c.urlParams_, opts...)
3374 res, err := c.doRequest("json")
3375 if res != nil && res.StatusCode == http.StatusNotModified {
3376 if res.Body != nil {
3377 res.Body.Close()
3378 }
3379 return nil, gensupport.WrapError(&googleapi.Error{
3380 Code: res.StatusCode,
3381 Header: res.Header,
3382 })
3383 }
3384 if err != nil {
3385 return nil, err
3386 }
3387 defer googleapi.CloseBody(res)
3388 if err := googleapi.CheckResponse(res); err != nil {
3389 return nil, gensupport.WrapError(err)
3390 }
3391 ret := &Attributes{
3392 ServerResponse: googleapi.ServerResponse{
3393 Header: res.Header,
3394 HTTPStatusCode: res.StatusCode,
3395 },
3396 }
3397 target := &ret
3398 b, err := gensupport.DecodeResponseBytes(target, res)
3399 if err != nil {
3400 return nil, err
3401 }
3402 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.getAttributes", "response", internallog.HTTPResponse(res, b))
3403 return ret, nil
3404 }
3405
3406 type LocationsGetGoogleUpdatedCall struct {
3407 s *Service
3408 name string
3409 urlParams_ gensupport.URLParams
3410 ifNoneMatch_ string
3411 ctx_ context.Context
3412 header_ http.Header
3413 }
3414
3415 // GetGoogleUpdated: Gets the version of the specified location, returning a
3416 // `GoogleUpdatedLocation` that provides the location view as it appears to
3417 // consumers and masks indicating which fields are different than the
3418 // merchant's information.
3419 //
3420 // - name: The name of the location to fetch.
3421 func (r *LocationsService) GetGoogleUpdated(name string) *LocationsGetGoogleUpdatedCall {
3422 c := &LocationsGetGoogleUpdatedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3423 c.name = name
3424 return c
3425 }
3426
3427 // ReadMask sets the optional parameter "readMask": Required. Read mask to
3428 // specify what fields will be returned in the response.
3429 func (c *LocationsGetGoogleUpdatedCall) ReadMask(readMask string) *LocationsGetGoogleUpdatedCall {
3430 c.urlParams_.Set("readMask", readMask)
3431 return c
3432 }
3433
3434 // Fields allows partial responses to be retrieved. See
3435 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3436 // details.
3437 func (c *LocationsGetGoogleUpdatedCall) Fields(s ...googleapi.Field) *LocationsGetGoogleUpdatedCall {
3438 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3439 return c
3440 }
3441
3442 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3443 // object's ETag matches the given value. This is useful for getting updates
3444 // only after the object has changed since the last request.
3445 func (c *LocationsGetGoogleUpdatedCall) IfNoneMatch(entityTag string) *LocationsGetGoogleUpdatedCall {
3446 c.ifNoneMatch_ = entityTag
3447 return c
3448 }
3449
3450 // Context sets the context to be used in this call's Do method.
3451 func (c *LocationsGetGoogleUpdatedCall) Context(ctx context.Context) *LocationsGetGoogleUpdatedCall {
3452 c.ctx_ = ctx
3453 return c
3454 }
3455
3456 // Header returns a http.Header that can be modified by the caller to add
3457 // headers to the request.
3458 func (c *LocationsGetGoogleUpdatedCall) Header() http.Header {
3459 if c.header_ == nil {
3460 c.header_ = make(http.Header)
3461 }
3462 return c.header_
3463 }
3464
3465 func (c *LocationsGetGoogleUpdatedCall) doRequest(alt string) (*http.Response, error) {
3466 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3467 if c.ifNoneMatch_ != "" {
3468 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3469 }
3470 c.urlParams_.Set("alt", alt)
3471 c.urlParams_.Set("prettyPrint", "false")
3472 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getGoogleUpdated")
3473 urls += "?" + c.urlParams_.Encode()
3474 req, err := http.NewRequest("GET", urls, nil)
3475 if err != nil {
3476 return nil, err
3477 }
3478 req.Header = reqHeaders
3479 googleapi.Expand(req.URL, map[string]string{
3480 "name": c.name,
3481 })
3482 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.getGoogleUpdated", "request", internallog.HTTPRequest(req, nil))
3483 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3484 }
3485
3486 // Do executes the "mybusinessbusinessinformation.locations.getGoogleUpdated" call.
3487 // Any non-2xx status code is an error. Response headers are in either
3488 // *GoogleUpdatedLocation.ServerResponse.Header or (if a response was returned
3489 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3490 // check whether the returned error was because http.StatusNotModified was
3491 // returned.
3492 func (c *LocationsGetGoogleUpdatedCall) Do(opts ...googleapi.CallOption) (*GoogleUpdatedLocation, error) {
3493 gensupport.SetOptions(c.urlParams_, opts...)
3494 res, err := c.doRequest("json")
3495 if res != nil && res.StatusCode == http.StatusNotModified {
3496 if res.Body != nil {
3497 res.Body.Close()
3498 }
3499 return nil, gensupport.WrapError(&googleapi.Error{
3500 Code: res.StatusCode,
3501 Header: res.Header,
3502 })
3503 }
3504 if err != nil {
3505 return nil, err
3506 }
3507 defer googleapi.CloseBody(res)
3508 if err := googleapi.CheckResponse(res); err != nil {
3509 return nil, gensupport.WrapError(err)
3510 }
3511 ret := &GoogleUpdatedLocation{
3512 ServerResponse: googleapi.ServerResponse{
3513 Header: res.Header,
3514 HTTPStatusCode: res.StatusCode,
3515 },
3516 }
3517 target := &ret
3518 b, err := gensupport.DecodeResponseBytes(target, res)
3519 if err != nil {
3520 return nil, err
3521 }
3522 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.getGoogleUpdated", "response", internallog.HTTPResponse(res, b))
3523 return ret, nil
3524 }
3525
3526 type LocationsPatchCall struct {
3527 s *Service
3528 nameid string
3529 location *Location
3530 urlParams_ gensupport.URLParams
3531 ctx_ context.Context
3532 header_ http.Header
3533 }
3534
3535 // Patch: Updates the specified location.
3536 //
3537 // - name: Google identifier for this location in the form:
3538 // `locations/{location_id}`.
3539 func (r *LocationsService) Patch(nameid string, location *Location) *LocationsPatchCall {
3540 c := &LocationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3541 c.nameid = nameid
3542 c.location = location
3543 return c
3544 }
3545
3546 // UpdateMask sets the optional parameter "updateMask": Required. The specific
3547 // fields to update.
3548 func (c *LocationsPatchCall) UpdateMask(updateMask string) *LocationsPatchCall {
3549 c.urlParams_.Set("updateMask", updateMask)
3550 return c
3551 }
3552
3553 // ValidateOnly sets the optional parameter "validateOnly": If true, the
3554 // request is validated without actually updating the location. When this field
3555 // is set, we will only return validation errors if there were any. The
3556 // response will be empty if no errors were found.
3557 func (c *LocationsPatchCall) ValidateOnly(validateOnly bool) *LocationsPatchCall {
3558 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
3559 return c
3560 }
3561
3562 // Fields allows partial responses to be retrieved. See
3563 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3564 // details.
3565 func (c *LocationsPatchCall) Fields(s ...googleapi.Field) *LocationsPatchCall {
3566 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3567 return c
3568 }
3569
3570 // Context sets the context to be used in this call's Do method.
3571 func (c *LocationsPatchCall) Context(ctx context.Context) *LocationsPatchCall {
3572 c.ctx_ = ctx
3573 return c
3574 }
3575
3576 // Header returns a http.Header that can be modified by the caller to add
3577 // headers to the request.
3578 func (c *LocationsPatchCall) Header() http.Header {
3579 if c.header_ == nil {
3580 c.header_ = make(http.Header)
3581 }
3582 return c.header_
3583 }
3584
3585 func (c *LocationsPatchCall) doRequest(alt string) (*http.Response, error) {
3586 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3587 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.location)
3588 if err != nil {
3589 return nil, err
3590 }
3591 c.urlParams_.Set("alt", alt)
3592 c.urlParams_.Set("prettyPrint", "false")
3593 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3594 urls += "?" + c.urlParams_.Encode()
3595 req, err := http.NewRequest("PATCH", urls, body)
3596 if err != nil {
3597 return nil, err
3598 }
3599 req.Header = reqHeaders
3600 googleapi.Expand(req.URL, map[string]string{
3601 "name": c.nameid,
3602 })
3603 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
3604 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3605 }
3606
3607 // Do executes the "mybusinessbusinessinformation.locations.patch" call.
3608 // Any non-2xx status code is an error. Response headers are in either
3609 // *Location.ServerResponse.Header or (if a response was returned at all) in
3610 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3611 // whether the returned error was because http.StatusNotModified was returned.
3612 func (c *LocationsPatchCall) Do(opts ...googleapi.CallOption) (*Location, error) {
3613 gensupport.SetOptions(c.urlParams_, opts...)
3614 res, err := c.doRequest("json")
3615 if res != nil && res.StatusCode == http.StatusNotModified {
3616 if res.Body != nil {
3617 res.Body.Close()
3618 }
3619 return nil, gensupport.WrapError(&googleapi.Error{
3620 Code: res.StatusCode,
3621 Header: res.Header,
3622 })
3623 }
3624 if err != nil {
3625 return nil, err
3626 }
3627 defer googleapi.CloseBody(res)
3628 if err := googleapi.CheckResponse(res); err != nil {
3629 return nil, gensupport.WrapError(err)
3630 }
3631 ret := &Location{
3632 ServerResponse: googleapi.ServerResponse{
3633 Header: res.Header,
3634 HTTPStatusCode: res.StatusCode,
3635 },
3636 }
3637 target := &ret
3638 b, err := gensupport.DecodeResponseBytes(target, res)
3639 if err != nil {
3640 return nil, err
3641 }
3642 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.patch", "response", internallog.HTTPResponse(res, b))
3643 return ret, nil
3644 }
3645
3646 type LocationsUpdateAttributesCall struct {
3647 s *Service
3648 nameid string
3649 attributes *Attributes
3650 urlParams_ gensupport.URLParams
3651 ctx_ context.Context
3652 header_ http.Header
3653 }
3654
3655 // UpdateAttributes: Update attributes for a given location.
3656 //
3657 // - name: Google identifier for this location in the form of
3658 // `locations/{location_id}/attributes`.
3659 func (r *LocationsService) UpdateAttributes(nameid string, attributes *Attributes) *LocationsUpdateAttributesCall {
3660 c := &LocationsUpdateAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3661 c.nameid = nameid
3662 c.attributes = attributes
3663 return c
3664 }
3665
3666 // AttributeMask sets the optional parameter "attributeMask": Required.
3667 // Attribute name of attributes that you'd like to update. Represented by
3668 // `attributes/{attribute}`. Updates: All attributes provided in the attributes
3669 // field that you would like to update must be set in the `attribute_mask`.
3670 // Attributes set in the above list but not in the `attribute_mask` will be
3671 // ignored. Deletes: If you'd like to delete certain attributes, they must be
3672 // specified in the `attribute_mask` with no matching entry in the attributes
3673 // list. If you'd like to delete all attributes set on a location, you should
3674 // look up all the applicable attributes for the location and then add them to
3675 // the `attribute_mask` with an empty attributes field.
3676 func (c *LocationsUpdateAttributesCall) AttributeMask(attributeMask string) *LocationsUpdateAttributesCall {
3677 c.urlParams_.Set("attributeMask", attributeMask)
3678 return c
3679 }
3680
3681 // Fields allows partial responses to be retrieved. See
3682 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3683 // details.
3684 func (c *LocationsUpdateAttributesCall) Fields(s ...googleapi.Field) *LocationsUpdateAttributesCall {
3685 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3686 return c
3687 }
3688
3689 // Context sets the context to be used in this call's Do method.
3690 func (c *LocationsUpdateAttributesCall) Context(ctx context.Context) *LocationsUpdateAttributesCall {
3691 c.ctx_ = ctx
3692 return c
3693 }
3694
3695 // Header returns a http.Header that can be modified by the caller to add
3696 // headers to the request.
3697 func (c *LocationsUpdateAttributesCall) Header() http.Header {
3698 if c.header_ == nil {
3699 c.header_ = make(http.Header)
3700 }
3701 return c.header_
3702 }
3703
3704 func (c *LocationsUpdateAttributesCall) doRequest(alt string) (*http.Response, error) {
3705 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3706 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.attributes)
3707 if err != nil {
3708 return nil, err
3709 }
3710 c.urlParams_.Set("alt", alt)
3711 c.urlParams_.Set("prettyPrint", "false")
3712 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3713 urls += "?" + c.urlParams_.Encode()
3714 req, err := http.NewRequest("PATCH", urls, body)
3715 if err != nil {
3716 return nil, err
3717 }
3718 req.Header = reqHeaders
3719 googleapi.Expand(req.URL, map[string]string{
3720 "name": c.nameid,
3721 })
3722 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.updateAttributes", "request", internallog.HTTPRequest(req, body.Bytes()))
3723 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3724 }
3725
3726 // Do executes the "mybusinessbusinessinformation.locations.updateAttributes" call.
3727 // Any non-2xx status code is an error. Response headers are in either
3728 // *Attributes.ServerResponse.Header or (if a response was returned at all) in
3729 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3730 // whether the returned error was because http.StatusNotModified was returned.
3731 func (c *LocationsUpdateAttributesCall) Do(opts ...googleapi.CallOption) (*Attributes, error) {
3732 gensupport.SetOptions(c.urlParams_, opts...)
3733 res, err := c.doRequest("json")
3734 if res != nil && res.StatusCode == http.StatusNotModified {
3735 if res.Body != nil {
3736 res.Body.Close()
3737 }
3738 return nil, gensupport.WrapError(&googleapi.Error{
3739 Code: res.StatusCode,
3740 Header: res.Header,
3741 })
3742 }
3743 if err != nil {
3744 return nil, err
3745 }
3746 defer googleapi.CloseBody(res)
3747 if err := googleapi.CheckResponse(res); err != nil {
3748 return nil, gensupport.WrapError(err)
3749 }
3750 ret := &Attributes{
3751 ServerResponse: googleapi.ServerResponse{
3752 Header: res.Header,
3753 HTTPStatusCode: res.StatusCode,
3754 },
3755 }
3756 target := &ret
3757 b, err := gensupport.DecodeResponseBytes(target, res)
3758 if err != nil {
3759 return nil, err
3760 }
3761 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.updateAttributes", "response", internallog.HTTPResponse(res, b))
3762 return ret, nil
3763 }
3764
3765 type LocationsAttributesGetGoogleUpdatedCall struct {
3766 s *Service
3767 nameid string
3768 urlParams_ gensupport.URLParams
3769 ifNoneMatch_ string
3770 ctx_ context.Context
3771 header_ http.Header
3772 }
3773
3774 // GetGoogleUpdated: Gets the version of the specified location, returning an
3775 // `Attributes` message that provides the attributes view as it appears to
3776 // consumers, which may be different than the merchant's information.
3777 //
3778 // - name: Google identifier for this location in the form of
3779 // `locations/{location_id}/attributes`.
3780 func (r *LocationsAttributesService) GetGoogleUpdated(nameid string) *LocationsAttributesGetGoogleUpdatedCall {
3781 c := &LocationsAttributesGetGoogleUpdatedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3782 c.nameid = nameid
3783 return c
3784 }
3785
3786 // Fields allows partial responses to be retrieved. See
3787 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3788 // details.
3789 func (c *LocationsAttributesGetGoogleUpdatedCall) Fields(s ...googleapi.Field) *LocationsAttributesGetGoogleUpdatedCall {
3790 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3791 return c
3792 }
3793
3794 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3795 // object's ETag matches the given value. This is useful for getting updates
3796 // only after the object has changed since the last request.
3797 func (c *LocationsAttributesGetGoogleUpdatedCall) IfNoneMatch(entityTag string) *LocationsAttributesGetGoogleUpdatedCall {
3798 c.ifNoneMatch_ = entityTag
3799 return c
3800 }
3801
3802 // Context sets the context to be used in this call's Do method.
3803 func (c *LocationsAttributesGetGoogleUpdatedCall) Context(ctx context.Context) *LocationsAttributesGetGoogleUpdatedCall {
3804 c.ctx_ = ctx
3805 return c
3806 }
3807
3808 // Header returns a http.Header that can be modified by the caller to add
3809 // headers to the request.
3810 func (c *LocationsAttributesGetGoogleUpdatedCall) Header() http.Header {
3811 if c.header_ == nil {
3812 c.header_ = make(http.Header)
3813 }
3814 return c.header_
3815 }
3816
3817 func (c *LocationsAttributesGetGoogleUpdatedCall) doRequest(alt string) (*http.Response, error) {
3818 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3819 if c.ifNoneMatch_ != "" {
3820 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3821 }
3822 c.urlParams_.Set("alt", alt)
3823 c.urlParams_.Set("prettyPrint", "false")
3824 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getGoogleUpdated")
3825 urls += "?" + c.urlParams_.Encode()
3826 req, err := http.NewRequest("GET", urls, nil)
3827 if err != nil {
3828 return nil, err
3829 }
3830 req.Header = reqHeaders
3831 googleapi.Expand(req.URL, map[string]string{
3832 "name": c.nameid,
3833 })
3834 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.attributes.getGoogleUpdated", "request", internallog.HTTPRequest(req, nil))
3835 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3836 }
3837
3838 // Do executes the "mybusinessbusinessinformation.locations.attributes.getGoogleUpdated" call.
3839 // Any non-2xx status code is an error. Response headers are in either
3840 // *Attributes.ServerResponse.Header or (if a response was returned at all) in
3841 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3842 // whether the returned error was because http.StatusNotModified was returned.
3843 func (c *LocationsAttributesGetGoogleUpdatedCall) Do(opts ...googleapi.CallOption) (*Attributes, error) {
3844 gensupport.SetOptions(c.urlParams_, opts...)
3845 res, err := c.doRequest("json")
3846 if res != nil && res.StatusCode == http.StatusNotModified {
3847 if res.Body != nil {
3848 res.Body.Close()
3849 }
3850 return nil, gensupport.WrapError(&googleapi.Error{
3851 Code: res.StatusCode,
3852 Header: res.Header,
3853 })
3854 }
3855 if err != nil {
3856 return nil, err
3857 }
3858 defer googleapi.CloseBody(res)
3859 if err := googleapi.CheckResponse(res); err != nil {
3860 return nil, gensupport.WrapError(err)
3861 }
3862 ret := &Attributes{
3863 ServerResponse: googleapi.ServerResponse{
3864 Header: res.Header,
3865 HTTPStatusCode: res.StatusCode,
3866 },
3867 }
3868 target := &ret
3869 b, err := gensupport.DecodeResponseBytes(target, res)
3870 if err != nil {
3871 return nil, err
3872 }
3873 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "mybusinessbusinessinformation.locations.attributes.getGoogleUpdated", "response", internallog.HTTPResponse(res, b))
3874 return ret, nil
3875 }