mybusinessplaceactions

package
v0.48.1-0...-67a0a95 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2021 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package mybusinessplaceactions provides access to the My Business Place Actions API.

For product documentation, see: https://developers.google.com/my-business/

Creating a client

Usage example:

import "google.golang.org/api/mybusinessplaceactions/v1"
...
ctx := context.Background()
mybusinessplaceactionsService, err := mybusinessplaceactions.NewService(ctx)

In this example, Google Application Default Credentials are used for authentication.

For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.

Other authentication options

To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:

mybusinessplaceactionsService, err := mybusinessplaceactions.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
mybusinessplaceactionsService, err := mybusinessplaceactions.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See https://godoc.org/google.golang.org/api/option/ for details on options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Empty

type Empty struct {
	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`
}

Empty: A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.

type ListPlaceActionLinksResponse

type ListPlaceActionLinksResponse struct {
	// NextPageToken: If there are more place action links than the
	// requested page size, then this field is populated with a token to
	// fetch the next page of results.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// PlaceActionLinks: The returned list of place action links.
	PlaceActionLinks []*PlaceActionLink `json:"placeActionLinks,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "NextPageToken") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ListPlaceActionLinksResponse: Response message for PlaceActions.ListPlaceActionLinks.

func (*ListPlaceActionLinksResponse) MarshalJSON

func (s *ListPlaceActionLinksResponse) MarshalJSON() ([]byte, error)

type ListPlaceActionTypeMetadataResponse

type ListPlaceActionTypeMetadataResponse struct {
	// NextPageToken: If the number of action types exceeded the requested
	// page size, this field will be populated with a token to fetch the
	// next page on a subsequent call to `placeActionTypeMetadata.list`. If
	// there are no more results, this field will not be present in the
	// response.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// PlaceActionTypeMetadata: A collection of metadata for the available
	// place action types.
	PlaceActionTypeMetadata []*PlaceActionTypeMetadata `json:"placeActionTypeMetadata,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "NextPageToken") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ListPlaceActionTypeMetadataResponse: Response message for PlaceActions.ListPlaceActionTypeMetadata.

func (*ListPlaceActionTypeMetadataResponse) MarshalJSON

func (s *ListPlaceActionTypeMetadataResponse) MarshalJSON() ([]byte, error)

type LocationsPlaceActionLinksCreateCall

type LocationsPlaceActionLinksCreateCall struct {
	// contains filtered or unexported fields
}

func (*LocationsPlaceActionLinksCreateCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*LocationsPlaceActionLinksCreateCall) Do

Do executes the "mybusinessplaceactions.locations.placeActionLinks.create" call. Exactly one of *PlaceActionLink or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *PlaceActionLink.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*LocationsPlaceActionLinksCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*LocationsPlaceActionLinksCreateCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type LocationsPlaceActionLinksDeleteCall

type LocationsPlaceActionLinksDeleteCall struct {
	// contains filtered or unexported fields
}

func (*LocationsPlaceActionLinksDeleteCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*LocationsPlaceActionLinksDeleteCall) Do

Do executes the "mybusinessplaceactions.locations.placeActionLinks.delete" call. Exactly one of *Empty or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*LocationsPlaceActionLinksDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*LocationsPlaceActionLinksDeleteCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type LocationsPlaceActionLinksGetCall

type LocationsPlaceActionLinksGetCall struct {
	// contains filtered or unexported fields
}

func (*LocationsPlaceActionLinksGetCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*LocationsPlaceActionLinksGetCall) Do

Do executes the "mybusinessplaceactions.locations.placeActionLinks.get" call. Exactly one of *PlaceActionLink or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *PlaceActionLink.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*LocationsPlaceActionLinksGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*LocationsPlaceActionLinksGetCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*LocationsPlaceActionLinksGetCall) IfNoneMatch

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type LocationsPlaceActionLinksListCall

type LocationsPlaceActionLinksListCall struct {
	// contains filtered or unexported fields
}

func (*LocationsPlaceActionLinksListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*LocationsPlaceActionLinksListCall) Do

Do executes the "mybusinessplaceactions.locations.placeActionLinks.list" call. Exactly one of *ListPlaceActionLinksResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListPlaceActionLinksResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*LocationsPlaceActionLinksListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*LocationsPlaceActionLinksListCall) Filter

Filter sets the optional parameter "filter": A filter constraining the place action links to return. The response includes entries that match the filter. We support only the following filter: 1. place_action_type=XYZ where XYZ is a valid PlaceActionType.

func (*LocationsPlaceActionLinksListCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*LocationsPlaceActionLinksListCall) IfNoneMatch

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*LocationsPlaceActionLinksListCall) PageSize

PageSize sets the optional parameter "pageSize": How many place action links to return per page. Default of 10. The minimum is 1.

func (*LocationsPlaceActionLinksListCall) PageToken

PageToken sets the optional parameter "pageToken": If specified, returns the next page of place action links.

func (*LocationsPlaceActionLinksListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type LocationsPlaceActionLinksPatchCall

type LocationsPlaceActionLinksPatchCall struct {
	// contains filtered or unexported fields
}

func (*LocationsPlaceActionLinksPatchCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*LocationsPlaceActionLinksPatchCall) Do

Do executes the "mybusinessplaceactions.locations.placeActionLinks.patch" call. Exactly one of *PlaceActionLink or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *PlaceActionLink.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*LocationsPlaceActionLinksPatchCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*LocationsPlaceActionLinksPatchCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*LocationsPlaceActionLinksPatchCall) UpdateMask

UpdateMask sets the optional parameter "updateMask": Required. The specific fields to update. The only editable fields are `uri`, `place_action_type` and `is_preferred`. If the updated link already exists at the same location with the same `place_action_type` and `uri`, fails with an `ALREADY_EXISTS` error.

type LocationsPlaceActionLinksService

type LocationsPlaceActionLinksService struct {
	// contains filtered or unexported fields
}

func NewLocationsPlaceActionLinksService

func NewLocationsPlaceActionLinksService(s *Service) *LocationsPlaceActionLinksService

func (*LocationsPlaceActionLinksService) Create

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

  • parent: The resource name of the location where to create this place action link. `locations/{location_id}`.

func (*LocationsPlaceActionLinksService) Delete

Delete: Deletes a place action link from the specified location.

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

func (*LocationsPlaceActionLinksService) Get

Get: Gets the specified place action link.

- name: The name of the place action link to fetch.

func (*LocationsPlaceActionLinksService) List

List: Lists the place action links for the specified location.

  • parent: The name of the location whose place action links will be listed. `locations/{location_id}`.

func (*LocationsPlaceActionLinksService) Patch

Patch: Updates the specified place action link and returns it.

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

type LocationsService

type LocationsService struct {
	PlaceActionLinks *LocationsPlaceActionLinksService
	// contains filtered or unexported fields
}

func NewLocationsService

func NewLocationsService(s *Service) *LocationsService
type PlaceActionLink struct {
	// CreateTime: Output only. The time when the place action link was
	// created.
	CreateTime string `json:"createTime,omitempty"`

	// IsEditable: Output only. Indicates whether this link can be edited by
	// the client.
	IsEditable bool `json:"isEditable,omitempty"`

	// IsPreferred: Optional. Whether this link is preferred by the
	// merchant. Only one link can be marked as preferred per place action
	// type at a location. If a future request marks a different link as
	// preferred for the same place action type, then the current preferred
	// link (if any exists) will lose its preference.
	IsPreferred bool `json:"isPreferred,omitempty"`

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

	// PlaceActionType: Required. The type of place action that can be
	// performed using this link.
	//
	// Possible values:
	//   "PLACE_ACTION_TYPE_UNSPECIFIED" - Not specified.
	//   "APPOINTMENT" - The action type is booking an appointment.
	//   "ONLINE_APPOINTMENT" - The action type is booking an online
	// appointment.
	//   "DINING_RESERVATION" - The action type is making a dining
	// reservation.
	//   "FOOD_ORDERING" - The action type is ordering food for delivery
	// and/or takeout.
	//   "FOOD_DELIVERY" - The action type is ordering food for delivery.
	//   "FOOD_TAKEOUT" - The action type is ordering food for takeout.
	PlaceActionType string `json:"placeActionType,omitempty"`

	// ProviderType: Output only. Specifies the provider type.
	//
	// Possible values:
	//   "PROVIDER_TYPE_UNSPECIFIED" - Not specified.
	//   "MERCHANT" - A 1P provider such as a merchant, or an agency on
	// behalf of a merchant.
	//   "AGGREGATOR_3P" - A 3P aggregator, such as a `Reserve with Google`
	// partner.
	ProviderType string `json:"providerType,omitempty"`

	// UpdateTime: Output only. The time when the place action link was last
	// modified.
	UpdateTime string `json:"updateTime,omitempty"`

	// Uri: Required. The link uri. The same uri can be reused for different
	// action types across different locations. However, only one place
	// action link is allowed for each unique combination of (uri, place
	// action type, location).
	Uri string `json:"uri,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "CreateTime") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CreateTime") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

PlaceActionLink: Represents a place action link and its attributes.

func (*PlaceActionLink) MarshalJSON

func (s *PlaceActionLink) MarshalJSON() ([]byte, error)

type PlaceActionTypeMetadata

type PlaceActionTypeMetadata struct {
	// DisplayName: The localized display name for the attribute, if
	// available; otherwise, the English display name.
	DisplayName string `json:"displayName,omitempty"`

	// PlaceActionType: The place action type.
	//
	// Possible values:
	//   "PLACE_ACTION_TYPE_UNSPECIFIED" - Not specified.
	//   "APPOINTMENT" - The action type is booking an appointment.
	//   "ONLINE_APPOINTMENT" - The action type is booking an online
	// appointment.
	//   "DINING_RESERVATION" - The action type is making a dining
	// reservation.
	//   "FOOD_ORDERING" - The action type is ordering food for delivery
	// and/or takeout.
	//   "FOOD_DELIVERY" - The action type is ordering food for delivery.
	//   "FOOD_TAKEOUT" - The action type is ordering food for takeout.
	PlaceActionType string `json:"placeActionType,omitempty"`

	// ForceSendFields is a list of field names (e.g. "DisplayName") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "DisplayName") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

PlaceActionTypeMetadata: Metadata for supported place action types.

func (*PlaceActionTypeMetadata) MarshalJSON

func (s *PlaceActionTypeMetadata) MarshalJSON() ([]byte, error)

type PlaceActionTypeMetadataListCall

type PlaceActionTypeMetadataListCall struct {
	// contains filtered or unexported fields
}

func (*PlaceActionTypeMetadataListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*PlaceActionTypeMetadataListCall) Do

Do executes the "mybusinessplaceactions.placeActionTypeMetadata.list" call. Exactly one of *ListPlaceActionTypeMetadataResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListPlaceActionTypeMetadataResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*PlaceActionTypeMetadataListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*PlaceActionTypeMetadataListCall) Filter

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

func (*PlaceActionTypeMetadataListCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*PlaceActionTypeMetadataListCall) IfNoneMatch

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*PlaceActionTypeMetadataListCall) LanguageCode

LanguageCode sets the optional parameter "languageCode": The IETF BCP-47 code of language to get display names in. If this language is not available, they will be provided in English.

func (*PlaceActionTypeMetadataListCall) PageSize

PageSize sets the optional parameter "pageSize": How many action types to include per page. Default is 10, minimum is 1.

func (*PlaceActionTypeMetadataListCall) PageToken

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

func (*PlaceActionTypeMetadataListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type PlaceActionTypeMetadataService

type PlaceActionTypeMetadataService struct {
	// contains filtered or unexported fields
}

func NewPlaceActionTypeMetadataService

func NewPlaceActionTypeMetadataService(s *Service) *PlaceActionTypeMetadataService

func (*PlaceActionTypeMetadataService) List

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

type Service

type Service struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Locations *LocationsService

	PlaceActionTypeMetadata *PlaceActionTypeMetadataService
	// contains filtered or unexported fields
}

func New deprecated

func New(client *http.Client) (*Service, error)

New creates a new Service. It uses the provided http.Client for requests.

Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.

func NewService

func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)

NewService creates a new Service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL