Movatterモバイル変換


[0]ホーム

URL:


mybusinessqanda

package
v0.257.0Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License:BSD-3-ClauseImports:18Imported by:0

Details

Repository

github.com/googleapis/google-api-go-client

Links

Documentation

Overview

Package mybusinessqanda provides access to the My Business Q&A API.

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

Library status

These client libraries are officially supported by Google. However, thislibrary is considered complete and is in maintenance mode. This meansthat we will address critical bugs and security issues but will not addany new features.

When possible, we recommend using our newer[Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)that are still actively being worked and iterated on.

Creating a client

Usage example:

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

In this example, Google Application Default Credentials are used forauthentication. For information on how to create and obtain ApplicationDefault Credentials, seehttps://developers.google.com/identity/protocols/application-default-credentials.

Other authentication options

To use an API key for authentication (note: some APIs do not support APIkeys), usegoogle.golang.org/api/option.WithAPIKey:

mybusinessqandaService, err := mybusinessqanda.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuthflow, usegoogle.golang.org/api/option.WithTokenSource:

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

Seegoogle.golang.org/api/option.ClientOption for details on options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeAnswer

type Answer struct {// Author: Output only. The author of the answer. Will only be set during list// operations.Author *Author `json:"author,omitempty"`// CreateTime: Output only. The timestamp for when the answer was written. Only// retrieved during ListResponse fetching.CreateTimestring `json:"createTime,omitempty"`// Name: Output only. The unique name for the answer// locations/*/questions/*/answers/*Namestring `json:"name,omitempty"`// Text: Required. The text of the answer. It should contain at least one// non-whitespace character. The maximum length is 4096 characters.Textstring `json:"text,omitempty"`// UpdateTime: Output only. The timestamp for when the answer was last// modified.UpdateTimestring `json:"updateTime,omitempty"`// UpvoteCount: Output only. The number of upvotes for the answer.UpvoteCountint64 `json:"upvoteCount,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Author") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Author") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}

Answer: Represents an answer to a question

func (Answer)MarshalJSON

func (sAnswer) MarshalJSON() ([]byte,error)

typeAuthor

type Author struct {// DisplayName: The display name of the userDisplayNamestring `json:"displayName,omitempty"`// ProfilePhotoUri: The profile photo URI of the user.ProfilePhotoUristring `json:"profilePhotoUri,omitempty"`// Type: The type of user the author is.//// Possible values://   "AUTHOR_TYPE_UNSPECIFIED" - This should not be used.//   "REGULAR_USER" - A regular user.//   "LOCAL_GUIDE" - A Local Guide//   "MERCHANT" - The owner/manager of the locationTypestring `json:"type,omitempty"`// ForceSendFields is a list of field names (e.g. "DisplayName") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.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. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}

Author: Represents the author of a question or answer

func (Author)MarshalJSON

func (sAuthor) MarshalJSON() ([]byte,error)

typeEmpty

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 definingduplicated empty messages in your APIs. A typical example is to use it asthe request or the response type of an API method. For instance: service Foo{ rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

typeListAnswersResponse

type ListAnswersResponse struct {// Answers: The requested answers.Answers []*Answer `json:"answers,omitempty"`// NextPageToken: If the number of answers exceeds the requested max page size,// this field is populated with a token to fetch the next page of answers on a// subsequent call. If there are no more answers, this field is not present in// the response.NextPageTokenstring `json:"nextPageToken,omitempty"`// TotalSize: The total number of answers posted for this question across all// pages.TotalSizeint64 `json:"totalSize,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Answers") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Answers") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}

ListAnswersResponse: Response message for QuestionsAndAnswers.ListAnswers

func (ListAnswersResponse)MarshalJSON

func (sListAnswersResponse) MarshalJSON() ([]byte,error)

typeListQuestionsResponse

type ListQuestionsResponse struct {// NextPageToken: If the number of questions exceeds the requested max page// size, this field is populated with a token to fetch the next page of// questions on a subsequent call. If there are no more questions, this field// is not present in the response.NextPageTokenstring `json:"nextPageToken,omitempty"`// Questions: The requested questions,Questions []*Question `json:"questions,omitempty"`// TotalSize: The total number of questions posted for this location across all// pages.TotalSizeint64 `json:"totalSize,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 or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.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. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}

ListQuestionsResponse: Response message forQuestionsAndAnswers.ListQuestions

func (ListQuestionsResponse)MarshalJSON

func (sListQuestionsResponse) MarshalJSON() ([]byte,error)

typeLocationsQuestionsAnswersDeleteCalladded inv0.75.0

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

func (*LocationsQuestionsAnswersDeleteCall)Contextadded inv0.75.0

Context sets the context to be used in this call's Do method.

func (*LocationsQuestionsAnswersDeleteCall)Doadded inv0.75.0

Do executes the "mybusinessqanda.locations.questions.answers.delete" call.Any non-2xx status code is an error. Response headers are in either*Empty.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*LocationsQuestionsAnswersDeleteCall)Fieldsadded inv0.75.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*LocationsQuestionsAnswersDeleteCall)Headeradded inv0.75.0

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeLocationsQuestionsAnswersListCall

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

func (*LocationsQuestionsAnswersListCall)Context

Context sets the context to be used in this call's Do method.

func (*LocationsQuestionsAnswersListCall)Do

Do executes the "mybusinessqanda.locations.questions.answers.list" call.Any non-2xx status code is an error. Response headers are in either*ListAnswersResponse.ServerResponse.Header or (if a response was returned atall) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified tocheck whether the returned error was because http.StatusNotModified wasreturned.

func (*LocationsQuestionsAnswersListCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*LocationsQuestionsAnswersListCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*LocationsQuestionsAnswersListCall)IfNoneMatch

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*LocationsQuestionsAnswersListCall)OrderBy

OrderBy sets the optional parameter "orderBy": The order to return theanswers. Valid options include 'update_time desc' and 'upvote_count desc',which will return the answers sorted descendingly by the requested field.The default sort order is 'update_time desc'.

func (*LocationsQuestionsAnswersListCall)PageSize

PageSize sets the optional parameter "pageSize": How many answers to fetchper page. The default and maximum `page_size` values are 10.

func (*LocationsQuestionsAnswersListCall)PageToken

PageToken sets the optional parameter "pageToken": If specified, the nextpage of answers is retrieved.

func (*LocationsQuestionsAnswersListCall)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.

typeLocationsQuestionsAnswersService

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

funcNewLocationsQuestionsAnswersService

func NewLocationsQuestionsAnswersService(s *Service) *LocationsQuestionsAnswersService

func (*LocationsQuestionsAnswersService)Deleteadded inv0.75.0

Delete: Deletes the answer written by the current user to a question.

- name: The name of the question to delete an answer for.

func (*LocationsQuestionsAnswersService)List

List: Returns the paginated list of answers for a specified question.

- parent: The name of the question to fetch answers for.

func (*LocationsQuestionsAnswersService)Upsert

Upsert: Creates an answer or updates the existing answer written by the userfor the specified question. A user can only create one answer per question.

- parent: The name of the question to write an answer for.

typeLocationsQuestionsAnswersUpsertCall

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

func (*LocationsQuestionsAnswersUpsertCall)Context

Context sets the context to be used in this call's Do method.

func (*LocationsQuestionsAnswersUpsertCall)Do

Do executes the "mybusinessqanda.locations.questions.answers.upsert" call.Any non-2xx status code is an error. Response headers are in either*Answer.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*LocationsQuestionsAnswersUpsertCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*LocationsQuestionsAnswersUpsertCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeLocationsQuestionsCreateCall

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

func (*LocationsQuestionsCreateCall)Context

Context sets the context to be used in this call's Do method.

func (*LocationsQuestionsCreateCall)Do

Do executes the "mybusinessqanda.locations.questions.create" call.Any non-2xx status code is an error. Response headers are in either*Question.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*LocationsQuestionsCreateCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*LocationsQuestionsCreateCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeLocationsQuestionsDeleteCall

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

func (*LocationsQuestionsDeleteCall)Context

Context sets the context to be used in this call's Do method.

func (*LocationsQuestionsDeleteCall)Do

Do executes the "mybusinessqanda.locations.questions.delete" call.Any non-2xx status code is an error. Response headers are in either*Empty.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*LocationsQuestionsDeleteCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*LocationsQuestionsDeleteCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeLocationsQuestionsListCall

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

func (*LocationsQuestionsListCall)AnswersPerQuestion

func (c *LocationsQuestionsListCall) AnswersPerQuestion(answersPerQuestionint64) *LocationsQuestionsListCall

AnswersPerQuestion sets the optional parameter "answersPerQuestion": Howmany answers to fetch per question. The default and maximum`answers_per_question` values are 10.

func (*LocationsQuestionsListCall)Context

Context sets the context to be used in this call's Do method.

func (*LocationsQuestionsListCall)Do

Do executes the "mybusinessqanda.locations.questions.list" call.Any non-2xx status code is an error. Response headers are in either*ListQuestionsResponse.ServerResponse.Header or (if a response was returnedat all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified tocheck whether the returned error was because http.StatusNotModified wasreturned.

func (*LocationsQuestionsListCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*LocationsQuestionsListCall)Filter

Filter sets the optional parameter "filter": A filter constraining thequestions to return. The only filter currently supported is"ignore_answered=true"

func (*LocationsQuestionsListCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*LocationsQuestionsListCall)IfNoneMatch

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*LocationsQuestionsListCall)OrderBy

OrderBy sets the optional parameter "orderBy": The order to return thequestions. Valid options include 'update_time desc' and 'upvote_count desc',which will return the questions sorted descendingly by the requested field.The default sort order is 'update_time desc'.

func (*LocationsQuestionsListCall)PageSize

PageSize sets the optional parameter "pageSize": How many questions to fetchper page. The default and maximum `page_size` values are 10.

func (*LocationsQuestionsListCall)PageToken

PageToken sets the optional parameter "pageToken": If specified, the nextpage of questions is retrieved.

func (*LocationsQuestionsListCall)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.

typeLocationsQuestionsPatchCall

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

func (*LocationsQuestionsPatchCall)Context

Context sets the context to be used in this call's Do method.

func (*LocationsQuestionsPatchCall)Do

Do executes the "mybusinessqanda.locations.questions.patch" call.Any non-2xx status code is an error. Response headers are in either*Question.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*LocationsQuestionsPatchCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*LocationsQuestionsPatchCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*LocationsQuestionsPatchCall)UpdateMask

UpdateMask sets the optional parameter "updateMask": Required. The specificfields to update. Only question text can be updated.

typeLocationsQuestionsService

type LocationsQuestionsService struct {Answers *LocationsQuestionsAnswersService// contains filtered or unexported fields}

funcNewLocationsQuestionsService

func NewLocationsQuestionsService(s *Service) *LocationsQuestionsService

func (*LocationsQuestionsService)Create

Create: Adds a question for the specified location.

- parent: The name of the location to write a question for.

func (*LocationsQuestionsService)Delete

Delete: Deletes a specific question written by the current user.

- name: The name of the question to delete.

func (*LocationsQuestionsService)List

List: Returns the paginated list of questions and some of its answers for aspecified location. This operation is only valid if the specified locationis verified.

- parent: The name of the location to fetch questions for.

func (*LocationsQuestionsService)Patch

Patch: Updates a specific question written by the current user.

  • name: Immutable. The unique name for the question. locations/*/questions/*This field will be ignored if set during question creation.

typeLocationsService

type LocationsService struct {Questions *LocationsQuestionsService// contains filtered or unexported fields}

funcNewLocationsService

func NewLocationsService(s *Service) *LocationsService

typeQuestion

type Question struct {// Author: Output only. The author of the question.Author *Author `json:"author,omitempty"`// CreateTime: Output only. The timestamp for when the question was written.CreateTimestring `json:"createTime,omitempty"`// Name: Immutable. The unique name for the question. locations/*/questions/*// This field will be ignored if set during question creation.Namestring `json:"name,omitempty"`// Text: Required. The text of the question. It should contain at least three// words and the total length should be greater than or equal to 10 characters.// The maximum length is 4096 characters.Textstring `json:"text,omitempty"`// TopAnswers: Output only. A list of answers to the question, sorted by// upvotes. This may not be a complete list of answers depending on the request// parameters (answers_per_question)TopAnswers []*Answer `json:"topAnswers,omitempty"`// TotalAnswerCount: Output only. The total number of answers posted for this// question.TotalAnswerCountint64 `json:"totalAnswerCount,omitempty"`// UpdateTime: Output only. The timestamp for when the question was last// modified.UpdateTimestring `json:"updateTime,omitempty"`// UpvoteCount: Output only. The number of upvotes for the question.UpvoteCountint64 `json:"upvoteCount,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Author") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Author") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}

Question: Represents a single question and some of its answers.

func (Question)MarshalJSON

func (sQuestion) MarshalJSON() ([]byte,error)

typeService

type Service struct {BasePathstring// API endpoint base URLUserAgentstring// optional additional User-Agent fragmentLocations *LocationsService// contains filtered or unexported fields}

funcNewdeprecated

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.

funcNewService

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

NewService creates a new Service.

typeUpsertAnswerRequest

type UpsertAnswerRequest struct {// Answer: Required. The new answer.Answer *Answer `json:"answer,omitempty"`// ForceSendFields is a list of field names (e.g. "Answer") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Answer") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}

UpsertAnswerRequest: Request message for QuestionsAndAnswers.UpsertAnswer

func (UpsertAnswerRequest)MarshalJSON

func (sUpsertAnswerRequest) MarshalJSON() ([]byte,error)

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp