...

Source file src/google.golang.org/api/mybusinessplaceactions/v1/mybusinessplaceactions-gen.go

Documentation: google.golang.org/api/mybusinessplaceactions/v1

     1  // Copyright 2024 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 mybusinessplaceactions provides access to the My Business Place Actions 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/mybusinessplaceactions/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	mybusinessplaceactionsService, err := mybusinessplaceactions.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  //	mybusinessplaceactionsService, err := mybusinessplaceactions.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  //	mybusinessplaceactionsService, err := mybusinessplaceactions.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package mybusinessplaceactions // import "google.golang.org/api/mybusinessplaceactions/v1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "mybusinessplaceactions:v1"
    90  const apiName = "mybusinessplaceactions"
    91  const apiVersion = "v1"
    92  const basePath = "https://mybusinessplaceactions.googleapis.com/"
    93  const basePathTemplate = "https://mybusinessplaceactions.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://mybusinessplaceactions.mtls.googleapis.com/"
    95  
    96  // NewService creates a new Service.
    97  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
    98  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
    99  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   100  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   101  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   102  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   103  	if err != nil {
   104  		return nil, err
   105  	}
   106  	s, err := New(client)
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	if endpoint != "" {
   111  		s.BasePath = endpoint
   112  	}
   113  	return s, nil
   114  }
   115  
   116  // New creates a new Service. It uses the provided http.Client for requests.
   117  //
   118  // Deprecated: please use NewService instead.
   119  // To provide a custom HTTP client, use option.WithHTTPClient.
   120  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   121  func New(client *http.Client) (*Service, error) {
   122  	if client == nil {
   123  		return nil, errors.New("client is nil")
   124  	}
   125  	s := &Service{client: client, BasePath: basePath}
   126  	s.Locations = NewLocationsService(s)
   127  	s.PlaceActionTypeMetadata = NewPlaceActionTypeMetadataService(s)
   128  	return s, nil
   129  }
   130  
   131  type Service struct {
   132  	client    *http.Client
   133  	BasePath  string // API endpoint base URL
   134  	UserAgent string // optional additional User-Agent fragment
   135  
   136  	Locations *LocationsService
   137  
   138  	PlaceActionTypeMetadata *PlaceActionTypeMetadataService
   139  }
   140  
   141  func (s *Service) userAgent() string {
   142  	if s.UserAgent == "" {
   143  		return googleapi.UserAgent
   144  	}
   145  	return googleapi.UserAgent + " " + s.UserAgent
   146  }
   147  
   148  func NewLocationsService(s *Service) *LocationsService {
   149  	rs := &LocationsService{s: s}
   150  	rs.PlaceActionLinks = NewLocationsPlaceActionLinksService(s)
   151  	return rs
   152  }
   153  
   154  type LocationsService struct {
   155  	s *Service
   156  
   157  	PlaceActionLinks *LocationsPlaceActionLinksService
   158  }
   159  
   160  func NewLocationsPlaceActionLinksService(s *Service) *LocationsPlaceActionLinksService {
   161  	rs := &LocationsPlaceActionLinksService{s: s}
   162  	return rs
   163  }
   164  
   165  type LocationsPlaceActionLinksService struct {
   166  	s *Service
   167  }
   168  
   169  func NewPlaceActionTypeMetadataService(s *Service) *PlaceActionTypeMetadataService {
   170  	rs := &PlaceActionTypeMetadataService{s: s}
   171  	return rs
   172  }
   173  
   174  type PlaceActionTypeMetadataService struct {
   175  	s *Service
   176  }
   177  
   178  // Empty: A generic empty message that you can re-use to avoid defining
   179  // duplicated empty messages in your APIs. A typical example is to use it as
   180  // the request or the response type of an API method. For instance: service Foo
   181  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   182  type Empty struct {
   183  	// ServerResponse contains the HTTP response code and headers from the server.
   184  	googleapi.ServerResponse `json:"-"`
   185  }
   186  
   187  // ListPlaceActionLinksResponse: Response message for
   188  // PlaceActions.ListPlaceActionLinks.
   189  type ListPlaceActionLinksResponse struct {
   190  	// NextPageToken: If there are more place action links than the requested page
   191  	// size, then this field is populated with a token to fetch the next page of
   192  	// results.
   193  	NextPageToken string `json:"nextPageToken,omitempty"`
   194  	// PlaceActionLinks: The returned list of place action links.
   195  	PlaceActionLinks []*PlaceActionLink `json:"placeActionLinks,omitempty"`
   196  
   197  	// ServerResponse contains the HTTP response code and headers from the server.
   198  	googleapi.ServerResponse `json:"-"`
   199  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   200  	// unconditionally include in API requests. By default, fields with empty or
   201  	// default values are omitted from API requests. See
   202  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   203  	// details.
   204  	ForceSendFields []string `json:"-"`
   205  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   206  	// requests with the JSON null value. By default, fields with empty values are
   207  	// omitted from API requests. See
   208  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   209  	NullFields []string `json:"-"`
   210  }
   211  
   212  func (s *ListPlaceActionLinksResponse) MarshalJSON() ([]byte, error) {
   213  	type NoMethod ListPlaceActionLinksResponse
   214  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   215  }
   216  
   217  // ListPlaceActionTypeMetadataResponse: Response message for
   218  // PlaceActions.ListPlaceActionTypeMetadata.
   219  type ListPlaceActionTypeMetadataResponse struct {
   220  	// NextPageToken: If the number of action types exceeded the requested page
   221  	// size, this field will be populated with a token to fetch the next page on a
   222  	// subsequent call to `placeActionTypeMetadata.list`. If there are no more
   223  	// results, this field will not be present in the response.
   224  	NextPageToken string `json:"nextPageToken,omitempty"`
   225  	// PlaceActionTypeMetadata: A collection of metadata for the available place
   226  	// action types.
   227  	PlaceActionTypeMetadata []*PlaceActionTypeMetadata `json:"placeActionTypeMetadata,omitempty"`
   228  
   229  	// ServerResponse contains the HTTP response code and headers from the server.
   230  	googleapi.ServerResponse `json:"-"`
   231  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   232  	// unconditionally include in API requests. By default, fields with empty or
   233  	// default values are omitted from API requests. See
   234  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   235  	// details.
   236  	ForceSendFields []string `json:"-"`
   237  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   238  	// requests with the JSON null value. By default, fields with empty values are
   239  	// omitted from API requests. See
   240  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   241  	NullFields []string `json:"-"`
   242  }
   243  
   244  func (s *ListPlaceActionTypeMetadataResponse) MarshalJSON() ([]byte, error) {
   245  	type NoMethod ListPlaceActionTypeMetadataResponse
   246  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   247  }
   248  
   249  // PlaceActionLink: Represents a place action link and its attributes.
   250  type PlaceActionLink struct {
   251  	// CreateTime: Output only. The time when the place action link was created.
   252  	CreateTime string `json:"createTime,omitempty"`
   253  	// IsEditable: Output only. Indicates whether this link can be edited by the
   254  	// client.
   255  	IsEditable bool `json:"isEditable,omitempty"`
   256  	// IsPreferred: Optional. Whether this link is preferred by the merchant. Only
   257  	// one link can be marked as preferred per place action type at a location. If
   258  	// a future request marks a different link as preferred for the same place
   259  	// action type, then the current preferred link (if any exists) will lose its
   260  	// preference.
   261  	IsPreferred bool `json:"isPreferred,omitempty"`
   262  	// Name: Optional. The resource name, in the format
   263  	// `locations/{location_id}/placeActionLinks/{place_action_link_id}`. The name
   264  	// field will only be considered in UpdatePlaceActionLink and
   265  	// DeletePlaceActionLink requests for updating and deleting links respectively.
   266  	// However, it will be ignored in CreatePlaceActionLink request, where
   267  	// `place_action_link_id` will be assigned by the server on successful creation
   268  	// of a new link and returned as part of the response.
   269  	Name string `json:"name,omitempty"`
   270  	// PlaceActionType: Required. The type of place action that can be performed
   271  	// using this link.
   272  	//
   273  	// Possible values:
   274  	//   "PLACE_ACTION_TYPE_UNSPECIFIED" - Not specified.
   275  	//   "APPOINTMENT" - The action type is booking an appointment.
   276  	//   "ONLINE_APPOINTMENT" - The action type is booking an online appointment.
   277  	//   "DINING_RESERVATION" - The action type is making a dining reservation.
   278  	//   "FOOD_ORDERING" - The action type is ordering food for delivery and/or
   279  	// takeout.
   280  	//   "FOOD_DELIVERY" - The action type is ordering food for delivery.
   281  	//   "FOOD_TAKEOUT" - The action type is ordering food for takeout.
   282  	//   "SHOP_ONLINE" - The action type is shopping, that can be delivery and/or
   283  	// pickup.
   284  	PlaceActionType string `json:"placeActionType,omitempty"`
   285  	// ProviderType: Output only. Specifies the provider type.
   286  	//
   287  	// Possible values:
   288  	//   "PROVIDER_TYPE_UNSPECIFIED" - Not specified.
   289  	//   "MERCHANT" - A 1P provider such as a merchant, or an agency on behalf of a
   290  	// merchant.
   291  	//   "AGGREGATOR_3P" - A 3P aggregator, such as a `Reserve with Google`
   292  	// partner.
   293  	ProviderType string `json:"providerType,omitempty"`
   294  	// UpdateTime: Output only. The time when the place action link was last
   295  	// modified.
   296  	UpdateTime string `json:"updateTime,omitempty"`
   297  	// Uri: Required. The link uri. The same uri can be reused for different action
   298  	// types across different locations. However, only one place action link is
   299  	// allowed for each unique combination of (uri, place action type, location).
   300  	Uri string `json:"uri,omitempty"`
   301  
   302  	// ServerResponse contains the HTTP response code and headers from the server.
   303  	googleapi.ServerResponse `json:"-"`
   304  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   305  	// unconditionally include in API requests. By default, fields with empty or
   306  	// default values are omitted from API requests. See
   307  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   308  	// details.
   309  	ForceSendFields []string `json:"-"`
   310  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   311  	// requests with the JSON null value. By default, fields with empty values are
   312  	// omitted from API requests. See
   313  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   314  	NullFields []string `json:"-"`
   315  }
   316  
   317  func (s *PlaceActionLink) MarshalJSON() ([]byte, error) {
   318  	type NoMethod PlaceActionLink
   319  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   320  }
   321  
   322  // PlaceActionTypeMetadata: Metadata for supported place action types.
   323  type PlaceActionTypeMetadata struct {
   324  	// DisplayName: The localized display name for the attribute, if available;
   325  	// otherwise, the English display name.
   326  	DisplayName string `json:"displayName,omitempty"`
   327  	// PlaceActionType: The place action type.
   328  	//
   329  	// Possible values:
   330  	//   "PLACE_ACTION_TYPE_UNSPECIFIED" - Not specified.
   331  	//   "APPOINTMENT" - The action type is booking an appointment.
   332  	//   "ONLINE_APPOINTMENT" - The action type is booking an online appointment.
   333  	//   "DINING_RESERVATION" - The action type is making a dining reservation.
   334  	//   "FOOD_ORDERING" - The action type is ordering food for delivery and/or
   335  	// takeout.
   336  	//   "FOOD_DELIVERY" - The action type is ordering food for delivery.
   337  	//   "FOOD_TAKEOUT" - The action type is ordering food for takeout.
   338  	//   "SHOP_ONLINE" - The action type is shopping, that can be delivery and/or
   339  	// pickup.
   340  	PlaceActionType string `json:"placeActionType,omitempty"`
   341  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   342  	// unconditionally include in API requests. By default, fields with empty or
   343  	// default values are omitted from API requests. See
   344  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   345  	// details.
   346  	ForceSendFields []string `json:"-"`
   347  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   348  	// requests with the JSON null value. By default, fields with empty values are
   349  	// omitted from API requests. See
   350  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   351  	NullFields []string `json:"-"`
   352  }
   353  
   354  func (s *PlaceActionTypeMetadata) MarshalJSON() ([]byte, error) {
   355  	type NoMethod PlaceActionTypeMetadata
   356  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   357  }
   358  
   359  type LocationsPlaceActionLinksCreateCall struct {
   360  	s               *Service
   361  	parent          string
   362  	placeactionlink *PlaceActionLink
   363  	urlParams_      gensupport.URLParams
   364  	ctx_            context.Context
   365  	header_         http.Header
   366  }
   367  
   368  // Create: Creates a place action link associated with the specified location,
   369  // and returns it. The request is considered duplicate if the `parent`,
   370  // `place_action_link.uri` and `place_action_link.place_action_type` are the
   371  // same as a previous request.
   372  //
   373  //   - parent: The resource name of the location where to create this place
   374  //     action link. `locations/{location_id}`.
   375  func (r *LocationsPlaceActionLinksService) Create(parent string, placeactionlink *PlaceActionLink) *LocationsPlaceActionLinksCreateCall {
   376  	c := &LocationsPlaceActionLinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   377  	c.parent = parent
   378  	c.placeactionlink = placeactionlink
   379  	return c
   380  }
   381  
   382  // Fields allows partial responses to be retrieved. See
   383  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   384  // details.
   385  func (c *LocationsPlaceActionLinksCreateCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksCreateCall {
   386  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   387  	return c
   388  }
   389  
   390  // Context sets the context to be used in this call's Do method.
   391  func (c *LocationsPlaceActionLinksCreateCall) Context(ctx context.Context) *LocationsPlaceActionLinksCreateCall {
   392  	c.ctx_ = ctx
   393  	return c
   394  }
   395  
   396  // Header returns a http.Header that can be modified by the caller to add
   397  // headers to the request.
   398  func (c *LocationsPlaceActionLinksCreateCall) Header() http.Header {
   399  	if c.header_ == nil {
   400  		c.header_ = make(http.Header)
   401  	}
   402  	return c.header_
   403  }
   404  
   405  func (c *LocationsPlaceActionLinksCreateCall) doRequest(alt string) (*http.Response, error) {
   406  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
   407  	var body io.Reader = nil
   408  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.placeactionlink)
   409  	if err != nil {
   410  		return nil, err
   411  	}
   412  	c.urlParams_.Set("alt", alt)
   413  	c.urlParams_.Set("prettyPrint", "false")
   414  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/placeActionLinks")
   415  	urls += "?" + c.urlParams_.Encode()
   416  	req, err := http.NewRequest("POST", urls, body)
   417  	if err != nil {
   418  		return nil, err
   419  	}
   420  	req.Header = reqHeaders
   421  	googleapi.Expand(req.URL, map[string]string{
   422  		"parent": c.parent,
   423  	})
   424  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   425  }
   426  
   427  // Do executes the "mybusinessplaceactions.locations.placeActionLinks.create" call.
   428  // Any non-2xx status code is an error. Response headers are in either
   429  // *PlaceActionLink.ServerResponse.Header or (if a response was returned at
   430  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
   431  // check whether the returned error was because http.StatusNotModified was
   432  // returned.
   433  func (c *LocationsPlaceActionLinksCreateCall) Do(opts ...googleapi.CallOption) (*PlaceActionLink, error) {
   434  	gensupport.SetOptions(c.urlParams_, opts...)
   435  	res, err := c.doRequest("json")
   436  	if res != nil && res.StatusCode == http.StatusNotModified {
   437  		if res.Body != nil {
   438  			res.Body.Close()
   439  		}
   440  		return nil, gensupport.WrapError(&googleapi.Error{
   441  			Code:   res.StatusCode,
   442  			Header: res.Header,
   443  		})
   444  	}
   445  	if err != nil {
   446  		return nil, err
   447  	}
   448  	defer googleapi.CloseBody(res)
   449  	if err := googleapi.CheckResponse(res); err != nil {
   450  		return nil, gensupport.WrapError(err)
   451  	}
   452  	ret := &PlaceActionLink{
   453  		ServerResponse: googleapi.ServerResponse{
   454  			Header:         res.Header,
   455  			HTTPStatusCode: res.StatusCode,
   456  		},
   457  	}
   458  	target := &ret
   459  	if err := gensupport.DecodeResponse(target, res); err != nil {
   460  		return nil, err
   461  	}
   462  	return ret, nil
   463  }
   464  
   465  type LocationsPlaceActionLinksDeleteCall struct {
   466  	s          *Service
   467  	name       string
   468  	urlParams_ gensupport.URLParams
   469  	ctx_       context.Context
   470  	header_    http.Header
   471  }
   472  
   473  // Delete: Deletes a place action link from the specified location.
   474  //
   475  //   - name: The resource name of the place action link to remove from the
   476  //     location.
   477  func (r *LocationsPlaceActionLinksService) Delete(name string) *LocationsPlaceActionLinksDeleteCall {
   478  	c := &LocationsPlaceActionLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   479  	c.name = name
   480  	return c
   481  }
   482  
   483  // Fields allows partial responses to be retrieved. See
   484  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   485  // details.
   486  func (c *LocationsPlaceActionLinksDeleteCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksDeleteCall {
   487  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   488  	return c
   489  }
   490  
   491  // Context sets the context to be used in this call's Do method.
   492  func (c *LocationsPlaceActionLinksDeleteCall) Context(ctx context.Context) *LocationsPlaceActionLinksDeleteCall {
   493  	c.ctx_ = ctx
   494  	return c
   495  }
   496  
   497  // Header returns a http.Header that can be modified by the caller to add
   498  // headers to the request.
   499  func (c *LocationsPlaceActionLinksDeleteCall) Header() http.Header {
   500  	if c.header_ == nil {
   501  		c.header_ = make(http.Header)
   502  	}
   503  	return c.header_
   504  }
   505  
   506  func (c *LocationsPlaceActionLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
   507  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   508  	var body io.Reader = nil
   509  	c.urlParams_.Set("alt", alt)
   510  	c.urlParams_.Set("prettyPrint", "false")
   511  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   512  	urls += "?" + c.urlParams_.Encode()
   513  	req, err := http.NewRequest("DELETE", urls, body)
   514  	if err != nil {
   515  		return nil, err
   516  	}
   517  	req.Header = reqHeaders
   518  	googleapi.Expand(req.URL, map[string]string{
   519  		"name": c.name,
   520  	})
   521  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   522  }
   523  
   524  // Do executes the "mybusinessplaceactions.locations.placeActionLinks.delete" call.
   525  // Any non-2xx status code is an error. Response headers are in either
   526  // *Empty.ServerResponse.Header or (if a response was returned at all) in
   527  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   528  // whether the returned error was because http.StatusNotModified was returned.
   529  func (c *LocationsPlaceActionLinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
   530  	gensupport.SetOptions(c.urlParams_, opts...)
   531  	res, err := c.doRequest("json")
   532  	if res != nil && res.StatusCode == http.StatusNotModified {
   533  		if res.Body != nil {
   534  			res.Body.Close()
   535  		}
   536  		return nil, gensupport.WrapError(&googleapi.Error{
   537  			Code:   res.StatusCode,
   538  			Header: res.Header,
   539  		})
   540  	}
   541  	if err != nil {
   542  		return nil, err
   543  	}
   544  	defer googleapi.CloseBody(res)
   545  	if err := googleapi.CheckResponse(res); err != nil {
   546  		return nil, gensupport.WrapError(err)
   547  	}
   548  	ret := &Empty{
   549  		ServerResponse: googleapi.ServerResponse{
   550  			Header:         res.Header,
   551  			HTTPStatusCode: res.StatusCode,
   552  		},
   553  	}
   554  	target := &ret
   555  	if err := gensupport.DecodeResponse(target, res); err != nil {
   556  		return nil, err
   557  	}
   558  	return ret, nil
   559  }
   560  
   561  type LocationsPlaceActionLinksGetCall struct {
   562  	s            *Service
   563  	name         string
   564  	urlParams_   gensupport.URLParams
   565  	ifNoneMatch_ string
   566  	ctx_         context.Context
   567  	header_      http.Header
   568  }
   569  
   570  // Get: Gets the specified place action link.
   571  //
   572  // - name: The name of the place action link to fetch.
   573  func (r *LocationsPlaceActionLinksService) Get(name string) *LocationsPlaceActionLinksGetCall {
   574  	c := &LocationsPlaceActionLinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   575  	c.name = name
   576  	return c
   577  }
   578  
   579  // Fields allows partial responses to be retrieved. See
   580  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   581  // details.
   582  func (c *LocationsPlaceActionLinksGetCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksGetCall {
   583  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   584  	return c
   585  }
   586  
   587  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   588  // object's ETag matches the given value. This is useful for getting updates
   589  // only after the object has changed since the last request.
   590  func (c *LocationsPlaceActionLinksGetCall) IfNoneMatch(entityTag string) *LocationsPlaceActionLinksGetCall {
   591  	c.ifNoneMatch_ = entityTag
   592  	return c
   593  }
   594  
   595  // Context sets the context to be used in this call's Do method.
   596  func (c *LocationsPlaceActionLinksGetCall) Context(ctx context.Context) *LocationsPlaceActionLinksGetCall {
   597  	c.ctx_ = ctx
   598  	return c
   599  }
   600  
   601  // Header returns a http.Header that can be modified by the caller to add
   602  // headers to the request.
   603  func (c *LocationsPlaceActionLinksGetCall) Header() http.Header {
   604  	if c.header_ == nil {
   605  		c.header_ = make(http.Header)
   606  	}
   607  	return c.header_
   608  }
   609  
   610  func (c *LocationsPlaceActionLinksGetCall) doRequest(alt string) (*http.Response, error) {
   611  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   612  	if c.ifNoneMatch_ != "" {
   613  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   614  	}
   615  	var body io.Reader = nil
   616  	c.urlParams_.Set("alt", alt)
   617  	c.urlParams_.Set("prettyPrint", "false")
   618  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   619  	urls += "?" + c.urlParams_.Encode()
   620  	req, err := http.NewRequest("GET", urls, body)
   621  	if err != nil {
   622  		return nil, err
   623  	}
   624  	req.Header = reqHeaders
   625  	googleapi.Expand(req.URL, map[string]string{
   626  		"name": c.name,
   627  	})
   628  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   629  }
   630  
   631  // Do executes the "mybusinessplaceactions.locations.placeActionLinks.get" call.
   632  // Any non-2xx status code is an error. Response headers are in either
   633  // *PlaceActionLink.ServerResponse.Header or (if a response was returned at
   634  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
   635  // check whether the returned error was because http.StatusNotModified was
   636  // returned.
   637  func (c *LocationsPlaceActionLinksGetCall) Do(opts ...googleapi.CallOption) (*PlaceActionLink, error) {
   638  	gensupport.SetOptions(c.urlParams_, opts...)
   639  	res, err := c.doRequest("json")
   640  	if res != nil && res.StatusCode == http.StatusNotModified {
   641  		if res.Body != nil {
   642  			res.Body.Close()
   643  		}
   644  		return nil, gensupport.WrapError(&googleapi.Error{
   645  			Code:   res.StatusCode,
   646  			Header: res.Header,
   647  		})
   648  	}
   649  	if err != nil {
   650  		return nil, err
   651  	}
   652  	defer googleapi.CloseBody(res)
   653  	if err := googleapi.CheckResponse(res); err != nil {
   654  		return nil, gensupport.WrapError(err)
   655  	}
   656  	ret := &PlaceActionLink{
   657  		ServerResponse: googleapi.ServerResponse{
   658  			Header:         res.Header,
   659  			HTTPStatusCode: res.StatusCode,
   660  		},
   661  	}
   662  	target := &ret
   663  	if err := gensupport.DecodeResponse(target, res); err != nil {
   664  		return nil, err
   665  	}
   666  	return ret, nil
   667  }
   668  
   669  type LocationsPlaceActionLinksListCall struct {
   670  	s            *Service
   671  	parent       string
   672  	urlParams_   gensupport.URLParams
   673  	ifNoneMatch_ string
   674  	ctx_         context.Context
   675  	header_      http.Header
   676  }
   677  
   678  // List: Lists the place action links for the specified location.
   679  //
   680  //   - parent: The name of the location whose place action links will be listed.
   681  //     `locations/{location_id}`.
   682  func (r *LocationsPlaceActionLinksService) List(parent string) *LocationsPlaceActionLinksListCall {
   683  	c := &LocationsPlaceActionLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   684  	c.parent = parent
   685  	return c
   686  }
   687  
   688  // Filter sets the optional parameter "filter": A filter constraining the place
   689  // action links to return. The response includes entries that match the filter.
   690  // We support only the following filter: 1. place_action_type=XYZ where XYZ is
   691  // a valid PlaceActionType.
   692  func (c *LocationsPlaceActionLinksListCall) Filter(filter string) *LocationsPlaceActionLinksListCall {
   693  	c.urlParams_.Set("filter", filter)
   694  	return c
   695  }
   696  
   697  // PageSize sets the optional parameter "pageSize": How many place action links
   698  // to return per page. Default of 10. The minimum is 1.
   699  func (c *LocationsPlaceActionLinksListCall) PageSize(pageSize int64) *LocationsPlaceActionLinksListCall {
   700  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   701  	return c
   702  }
   703  
   704  // PageToken sets the optional parameter "pageToken": If specified, returns the
   705  // next page of place action links.
   706  func (c *LocationsPlaceActionLinksListCall) PageToken(pageToken string) *LocationsPlaceActionLinksListCall {
   707  	c.urlParams_.Set("pageToken", pageToken)
   708  	return c
   709  }
   710  
   711  // Fields allows partial responses to be retrieved. See
   712  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   713  // details.
   714  func (c *LocationsPlaceActionLinksListCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksListCall {
   715  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   716  	return c
   717  }
   718  
   719  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   720  // object's ETag matches the given value. This is useful for getting updates
   721  // only after the object has changed since the last request.
   722  func (c *LocationsPlaceActionLinksListCall) IfNoneMatch(entityTag string) *LocationsPlaceActionLinksListCall {
   723  	c.ifNoneMatch_ = entityTag
   724  	return c
   725  }
   726  
   727  // Context sets the context to be used in this call's Do method.
   728  func (c *LocationsPlaceActionLinksListCall) Context(ctx context.Context) *LocationsPlaceActionLinksListCall {
   729  	c.ctx_ = ctx
   730  	return c
   731  }
   732  
   733  // Header returns a http.Header that can be modified by the caller to add
   734  // headers to the request.
   735  func (c *LocationsPlaceActionLinksListCall) Header() http.Header {
   736  	if c.header_ == nil {
   737  		c.header_ = make(http.Header)
   738  	}
   739  	return c.header_
   740  }
   741  
   742  func (c *LocationsPlaceActionLinksListCall) doRequest(alt string) (*http.Response, error) {
   743  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   744  	if c.ifNoneMatch_ != "" {
   745  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   746  	}
   747  	var body io.Reader = nil
   748  	c.urlParams_.Set("alt", alt)
   749  	c.urlParams_.Set("prettyPrint", "false")
   750  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/placeActionLinks")
   751  	urls += "?" + c.urlParams_.Encode()
   752  	req, err := http.NewRequest("GET", urls, body)
   753  	if err != nil {
   754  		return nil, err
   755  	}
   756  	req.Header = reqHeaders
   757  	googleapi.Expand(req.URL, map[string]string{
   758  		"parent": c.parent,
   759  	})
   760  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   761  }
   762  
   763  // Do executes the "mybusinessplaceactions.locations.placeActionLinks.list" call.
   764  // Any non-2xx status code is an error. Response headers are in either
   765  // *ListPlaceActionLinksResponse.ServerResponse.Header or (if a response was
   766  // returned at all) in error.(*googleapi.Error).Header. Use
   767  // googleapi.IsNotModified to check whether the returned error was because
   768  // http.StatusNotModified was returned.
   769  func (c *LocationsPlaceActionLinksListCall) Do(opts ...googleapi.CallOption) (*ListPlaceActionLinksResponse, error) {
   770  	gensupport.SetOptions(c.urlParams_, opts...)
   771  	res, err := c.doRequest("json")
   772  	if res != nil && res.StatusCode == http.StatusNotModified {
   773  		if res.Body != nil {
   774  			res.Body.Close()
   775  		}
   776  		return nil, gensupport.WrapError(&googleapi.Error{
   777  			Code:   res.StatusCode,
   778  			Header: res.Header,
   779  		})
   780  	}
   781  	if err != nil {
   782  		return nil, err
   783  	}
   784  	defer googleapi.CloseBody(res)
   785  	if err := googleapi.CheckResponse(res); err != nil {
   786  		return nil, gensupport.WrapError(err)
   787  	}
   788  	ret := &ListPlaceActionLinksResponse{
   789  		ServerResponse: googleapi.ServerResponse{
   790  			Header:         res.Header,
   791  			HTTPStatusCode: res.StatusCode,
   792  		},
   793  	}
   794  	target := &ret
   795  	if err := gensupport.DecodeResponse(target, res); err != nil {
   796  		return nil, err
   797  	}
   798  	return ret, nil
   799  }
   800  
   801  // Pages invokes f for each page of results.
   802  // A non-nil error returned from f will halt the iteration.
   803  // The provided context supersedes any context provided to the Context method.
   804  func (c *LocationsPlaceActionLinksListCall) Pages(ctx context.Context, f func(*ListPlaceActionLinksResponse) error) error {
   805  	c.ctx_ = ctx
   806  	defer c.PageToken(c.urlParams_.Get("pageToken"))
   807  	for {
   808  		x, err := c.Do()
   809  		if err != nil {
   810  			return err
   811  		}
   812  		if err := f(x); err != nil {
   813  			return err
   814  		}
   815  		if x.NextPageToken == "" {
   816  			return nil
   817  		}
   818  		c.PageToken(x.NextPageToken)
   819  	}
   820  }
   821  
   822  type LocationsPlaceActionLinksPatchCall struct {
   823  	s               *Service
   824  	name            string
   825  	placeactionlink *PlaceActionLink
   826  	urlParams_      gensupport.URLParams
   827  	ctx_            context.Context
   828  	header_         http.Header
   829  }
   830  
   831  // Patch: Updates the specified place action link and returns it.
   832  //
   833  //   - name: Optional. The resource name, in the format
   834  //     `locations/{location_id}/placeActionLinks/{place_action_link_id}`. The
   835  //     name field will only be considered in UpdatePlaceActionLink and
   836  //     DeletePlaceActionLink requests for updating and deleting links
   837  //     respectively. However, it will be ignored in CreatePlaceActionLink
   838  //     request, where `place_action_link_id` will be assigned by the server on
   839  //     successful creation of a new link and returned as part of the response.
   840  func (r *LocationsPlaceActionLinksService) Patch(name string, placeactionlink *PlaceActionLink) *LocationsPlaceActionLinksPatchCall {
   841  	c := &LocationsPlaceActionLinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   842  	c.name = name
   843  	c.placeactionlink = placeactionlink
   844  	return c
   845  }
   846  
   847  // UpdateMask sets the optional parameter "updateMask": Required. The specific
   848  // fields to update. The only editable fields are `uri`, `place_action_type`
   849  // and `is_preferred`. If the updated link already exists at the same location
   850  // with the same `place_action_type` and `uri`, fails with an `ALREADY_EXISTS`
   851  // error.
   852  func (c *LocationsPlaceActionLinksPatchCall) UpdateMask(updateMask string) *LocationsPlaceActionLinksPatchCall {
   853  	c.urlParams_.Set("updateMask", updateMask)
   854  	return c
   855  }
   856  
   857  // Fields allows partial responses to be retrieved. See
   858  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   859  // details.
   860  func (c *LocationsPlaceActionLinksPatchCall) Fields(s ...googleapi.Field) *LocationsPlaceActionLinksPatchCall {
   861  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   862  	return c
   863  }
   864  
   865  // Context sets the context to be used in this call's Do method.
   866  func (c *LocationsPlaceActionLinksPatchCall) Context(ctx context.Context) *LocationsPlaceActionLinksPatchCall {
   867  	c.ctx_ = ctx
   868  	return c
   869  }
   870  
   871  // Header returns a http.Header that can be modified by the caller to add
   872  // headers to the request.
   873  func (c *LocationsPlaceActionLinksPatchCall) Header() http.Header {
   874  	if c.header_ == nil {
   875  		c.header_ = make(http.Header)
   876  	}
   877  	return c.header_
   878  }
   879  
   880  func (c *LocationsPlaceActionLinksPatchCall) doRequest(alt string) (*http.Response, error) {
   881  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
   882  	var body io.Reader = nil
   883  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.placeactionlink)
   884  	if err != nil {
   885  		return nil, err
   886  	}
   887  	c.urlParams_.Set("alt", alt)
   888  	c.urlParams_.Set("prettyPrint", "false")
   889  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   890  	urls += "?" + c.urlParams_.Encode()
   891  	req, err := http.NewRequest("PATCH", urls, body)
   892  	if err != nil {
   893  		return nil, err
   894  	}
   895  	req.Header = reqHeaders
   896  	googleapi.Expand(req.URL, map[string]string{
   897  		"name": c.name,
   898  	})
   899  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   900  }
   901  
   902  // Do executes the "mybusinessplaceactions.locations.placeActionLinks.patch" call.
   903  // Any non-2xx status code is an error. Response headers are in either
   904  // *PlaceActionLink.ServerResponse.Header or (if a response was returned at
   905  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
   906  // check whether the returned error was because http.StatusNotModified was
   907  // returned.
   908  func (c *LocationsPlaceActionLinksPatchCall) Do(opts ...googleapi.CallOption) (*PlaceActionLink, error) {
   909  	gensupport.SetOptions(c.urlParams_, opts...)
   910  	res, err := c.doRequest("json")
   911  	if res != nil && res.StatusCode == http.StatusNotModified {
   912  		if res.Body != nil {
   913  			res.Body.Close()
   914  		}
   915  		return nil, gensupport.WrapError(&googleapi.Error{
   916  			Code:   res.StatusCode,
   917  			Header: res.Header,
   918  		})
   919  	}
   920  	if err != nil {
   921  		return nil, err
   922  	}
   923  	defer googleapi.CloseBody(res)
   924  	if err := googleapi.CheckResponse(res); err != nil {
   925  		return nil, gensupport.WrapError(err)
   926  	}
   927  	ret := &PlaceActionLink{
   928  		ServerResponse: googleapi.ServerResponse{
   929  			Header:         res.Header,
   930  			HTTPStatusCode: res.StatusCode,
   931  		},
   932  	}
   933  	target := &ret
   934  	if err := gensupport.DecodeResponse(target, res); err != nil {
   935  		return nil, err
   936  	}
   937  	return ret, nil
   938  }
   939  
   940  type PlaceActionTypeMetadataListCall struct {
   941  	s            *Service
   942  	urlParams_   gensupport.URLParams
   943  	ifNoneMatch_ string
   944  	ctx_         context.Context
   945  	header_      http.Header
   946  }
   947  
   948  // List: Returns the list of available place action types for a location or
   949  // country.
   950  func (r *PlaceActionTypeMetadataService) List() *PlaceActionTypeMetadataListCall {
   951  	c := &PlaceActionTypeMetadataListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   952  	return c
   953  }
   954  
   955  // Filter sets the optional parameter "filter": A filter constraining the place
   956  // action types to return metadata for. The response includes entries that
   957  // match the filter. We support only the following filters: 1. location=XYZ
   958  // where XYZ is a string indicating the resource name of a location, in the
   959  // format `locations/{location_id}`. 2. region_code=XYZ where XYZ is a Unicode
   960  // CLDR region code to find available action types. If no filter is provided,
   961  // all place action types are returned.
   962  func (c *PlaceActionTypeMetadataListCall) Filter(filter string) *PlaceActionTypeMetadataListCall {
   963  	c.urlParams_.Set("filter", filter)
   964  	return c
   965  }
   966  
   967  // LanguageCode sets the optional parameter "languageCode": The IETF BCP-47
   968  // code of language to get display names in. If this language is not available,
   969  // they will be provided in English.
   970  func (c *PlaceActionTypeMetadataListCall) LanguageCode(languageCode string) *PlaceActionTypeMetadataListCall {
   971  	c.urlParams_.Set("languageCode", languageCode)
   972  	return c
   973  }
   974  
   975  // PageSize sets the optional parameter "pageSize": How many action types to
   976  // include per page. Default is 10, minimum is 1.
   977  func (c *PlaceActionTypeMetadataListCall) PageSize(pageSize int64) *PlaceActionTypeMetadataListCall {
   978  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   979  	return c
   980  }
   981  
   982  // PageToken sets the optional parameter "pageToken": If specified, the next
   983  // page of place action type metadata is retrieved. The `pageToken` is returned
   984  // when a call to `placeActionTypeMetadata.list` returns more results than can
   985  // fit into the requested page size.
   986  func (c *PlaceActionTypeMetadataListCall) PageToken(pageToken string) *PlaceActionTypeMetadataListCall {
   987  	c.urlParams_.Set("pageToken", pageToken)
   988  	return c
   989  }
   990  
   991  // Fields allows partial responses to be retrieved. See
   992  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   993  // details.
   994  func (c *PlaceActionTypeMetadataListCall) Fields(s ...googleapi.Field) *PlaceActionTypeMetadataListCall {
   995  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   996  	return c
   997  }
   998  
   999  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1000  // object's ETag matches the given value. This is useful for getting updates
  1001  // only after the object has changed since the last request.
  1002  func (c *PlaceActionTypeMetadataListCall) IfNoneMatch(entityTag string) *PlaceActionTypeMetadataListCall {
  1003  	c.ifNoneMatch_ = entityTag
  1004  	return c
  1005  }
  1006  
  1007  // Context sets the context to be used in this call's Do method.
  1008  func (c *PlaceActionTypeMetadataListCall) Context(ctx context.Context) *PlaceActionTypeMetadataListCall {
  1009  	c.ctx_ = ctx
  1010  	return c
  1011  }
  1012  
  1013  // Header returns a http.Header that can be modified by the caller to add
  1014  // headers to the request.
  1015  func (c *PlaceActionTypeMetadataListCall) Header() http.Header {
  1016  	if c.header_ == nil {
  1017  		c.header_ = make(http.Header)
  1018  	}
  1019  	return c.header_
  1020  }
  1021  
  1022  func (c *PlaceActionTypeMetadataListCall) doRequest(alt string) (*http.Response, error) {
  1023  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1024  	if c.ifNoneMatch_ != "" {
  1025  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1026  	}
  1027  	var body io.Reader = nil
  1028  	c.urlParams_.Set("alt", alt)
  1029  	c.urlParams_.Set("prettyPrint", "false")
  1030  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/placeActionTypeMetadata")
  1031  	urls += "?" + c.urlParams_.Encode()
  1032  	req, err := http.NewRequest("GET", urls, body)
  1033  	if err != nil {
  1034  		return nil, err
  1035  	}
  1036  	req.Header = reqHeaders
  1037  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1038  }
  1039  
  1040  // Do executes the "mybusinessplaceactions.placeActionTypeMetadata.list" call.
  1041  // Any non-2xx status code is an error. Response headers are in either
  1042  // *ListPlaceActionTypeMetadataResponse.ServerResponse.Header or (if a response
  1043  // was returned at all) in error.(*googleapi.Error).Header. Use
  1044  // googleapi.IsNotModified to check whether the returned error was because
  1045  // http.StatusNotModified was returned.
  1046  func (c *PlaceActionTypeMetadataListCall) Do(opts ...googleapi.CallOption) (*ListPlaceActionTypeMetadataResponse, error) {
  1047  	gensupport.SetOptions(c.urlParams_, opts...)
  1048  	res, err := c.doRequest("json")
  1049  	if res != nil && res.StatusCode == http.StatusNotModified {
  1050  		if res.Body != nil {
  1051  			res.Body.Close()
  1052  		}
  1053  		return nil, gensupport.WrapError(&googleapi.Error{
  1054  			Code:   res.StatusCode,
  1055  			Header: res.Header,
  1056  		})
  1057  	}
  1058  	if err != nil {
  1059  		return nil, err
  1060  	}
  1061  	defer googleapi.CloseBody(res)
  1062  	if err := googleapi.CheckResponse(res); err != nil {
  1063  		return nil, gensupport.WrapError(err)
  1064  	}
  1065  	ret := &ListPlaceActionTypeMetadataResponse{
  1066  		ServerResponse: googleapi.ServerResponse{
  1067  			Header:         res.Header,
  1068  			HTTPStatusCode: res.StatusCode,
  1069  		},
  1070  	}
  1071  	target := &ret
  1072  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1073  		return nil, err
  1074  	}
  1075  	return ret, nil
  1076  }
  1077  
  1078  // Pages invokes f for each page of results.
  1079  // A non-nil error returned from f will halt the iteration.
  1080  // The provided context supersedes any context provided to the Context method.
  1081  func (c *PlaceActionTypeMetadataListCall) Pages(ctx context.Context, f func(*ListPlaceActionTypeMetadataResponse) error) error {
  1082  	c.ctx_ = ctx
  1083  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1084  	for {
  1085  		x, err := c.Do()
  1086  		if err != nil {
  1087  			return err
  1088  		}
  1089  		if err := f(x); err != nil {
  1090  			return err
  1091  		}
  1092  		if x.NextPageToken == "" {
  1093  			return nil
  1094  		}
  1095  		c.PageToken(x.NextPageToken)
  1096  	}
  1097  }
  1098  

View as plain text