mybusinessqanda
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
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¶
- type Answer
- type Author
- type Empty
- type ListAnswersResponse
- type ListQuestionsResponse
- type LocationsQuestionsAnswersDeleteCall
- func (c *LocationsQuestionsAnswersDeleteCall) Context(ctx context.Context) *LocationsQuestionsAnswersDeleteCall
- func (c *LocationsQuestionsAnswersDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *LocationsQuestionsAnswersDeleteCall) Fields(s ...googleapi.Field) *LocationsQuestionsAnswersDeleteCall
- func (c *LocationsQuestionsAnswersDeleteCall) Header() http.Header
- type LocationsQuestionsAnswersListCall
- func (c *LocationsQuestionsAnswersListCall) Context(ctx context.Context) *LocationsQuestionsAnswersListCall
- func (c *LocationsQuestionsAnswersListCall) Do(opts ...googleapi.CallOption) (*ListAnswersResponse, error)
- func (c *LocationsQuestionsAnswersListCall) Fields(s ...googleapi.Field) *LocationsQuestionsAnswersListCall
- func (c *LocationsQuestionsAnswersListCall) Header() http.Header
- func (c *LocationsQuestionsAnswersListCall) IfNoneMatch(entityTag string) *LocationsQuestionsAnswersListCall
- func (c *LocationsQuestionsAnswersListCall) OrderBy(orderBy string) *LocationsQuestionsAnswersListCall
- func (c *LocationsQuestionsAnswersListCall) PageSize(pageSize int64) *LocationsQuestionsAnswersListCall
- func (c *LocationsQuestionsAnswersListCall) PageToken(pageToken string) *LocationsQuestionsAnswersListCall
- func (c *LocationsQuestionsAnswersListCall) Pages(ctx context.Context, f func(*ListAnswersResponse) error) error
- type LocationsQuestionsAnswersService
- func (r *LocationsQuestionsAnswersService) Delete(name string) *LocationsQuestionsAnswersDeleteCall
- func (r *LocationsQuestionsAnswersService) List(parent string) *LocationsQuestionsAnswersListCall
- func (r *LocationsQuestionsAnswersService) Upsert(parent string, upsertanswerrequest *UpsertAnswerRequest) *LocationsQuestionsAnswersUpsertCall
- type LocationsQuestionsAnswersUpsertCall
- func (c *LocationsQuestionsAnswersUpsertCall) Context(ctx context.Context) *LocationsQuestionsAnswersUpsertCall
- func (c *LocationsQuestionsAnswersUpsertCall) Do(opts ...googleapi.CallOption) (*Answer, error)
- func (c *LocationsQuestionsAnswersUpsertCall) Fields(s ...googleapi.Field) *LocationsQuestionsAnswersUpsertCall
- func (c *LocationsQuestionsAnswersUpsertCall) Header() http.Header
- type LocationsQuestionsCreateCall
- func (c *LocationsQuestionsCreateCall) Context(ctx context.Context) *LocationsQuestionsCreateCall
- func (c *LocationsQuestionsCreateCall) Do(opts ...googleapi.CallOption) (*Question, error)
- func (c *LocationsQuestionsCreateCall) Fields(s ...googleapi.Field) *LocationsQuestionsCreateCall
- func (c *LocationsQuestionsCreateCall) Header() http.Header
- type LocationsQuestionsDeleteCall
- func (c *LocationsQuestionsDeleteCall) Context(ctx context.Context) *LocationsQuestionsDeleteCall
- func (c *LocationsQuestionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
- func (c *LocationsQuestionsDeleteCall) Fields(s ...googleapi.Field) *LocationsQuestionsDeleteCall
- func (c *LocationsQuestionsDeleteCall) Header() http.Header
- type LocationsQuestionsListCall
- func (c *LocationsQuestionsListCall) AnswersPerQuestion(answersPerQuestion int64) *LocationsQuestionsListCall
- func (c *LocationsQuestionsListCall) Context(ctx context.Context) *LocationsQuestionsListCall
- func (c *LocationsQuestionsListCall) Do(opts ...googleapi.CallOption) (*ListQuestionsResponse, error)
- func (c *LocationsQuestionsListCall) Fields(s ...googleapi.Field) *LocationsQuestionsListCall
- func (c *LocationsQuestionsListCall) Filter(filter string) *LocationsQuestionsListCall
- func (c *LocationsQuestionsListCall) Header() http.Header
- func (c *LocationsQuestionsListCall) IfNoneMatch(entityTag string) *LocationsQuestionsListCall
- func (c *LocationsQuestionsListCall) OrderBy(orderBy string) *LocationsQuestionsListCall
- func (c *LocationsQuestionsListCall) PageSize(pageSize int64) *LocationsQuestionsListCall
- func (c *LocationsQuestionsListCall) PageToken(pageToken string) *LocationsQuestionsListCall
- func (c *LocationsQuestionsListCall) Pages(ctx context.Context, f func(*ListQuestionsResponse) error) error
- type LocationsQuestionsPatchCall
- func (c *LocationsQuestionsPatchCall) Context(ctx context.Context) *LocationsQuestionsPatchCall
- func (c *LocationsQuestionsPatchCall) Do(opts ...googleapi.CallOption) (*Question, error)
- func (c *LocationsQuestionsPatchCall) Fields(s ...googleapi.Field) *LocationsQuestionsPatchCall
- func (c *LocationsQuestionsPatchCall) Header() http.Header
- func (c *LocationsQuestionsPatchCall) UpdateMask(updateMask string) *LocationsQuestionsPatchCall
- type LocationsQuestionsService
- func (r *LocationsQuestionsService) Create(parent string, question *Question) *LocationsQuestionsCreateCall
- func (r *LocationsQuestionsService) Delete(name string) *LocationsQuestionsDeleteCall
- func (r *LocationsQuestionsService) List(parent string) *LocationsQuestionsListCall
- func (r *LocationsQuestionsService) Patch(name string, question *Question) *LocationsQuestionsPatchCall
- type LocationsService
- type Question
- type Service
- type UpsertAnswerRequest
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¶
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¶
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)
typeLocationsQuestionsAnswersDeleteCall¶added inv0.75.0
type LocationsQuestionsAnswersDeleteCall struct {// contains filtered or unexported fields}func (*LocationsQuestionsAnswersDeleteCall)Context¶added inv0.75.0
func (c *LocationsQuestionsAnswersDeleteCall) Context(ctxcontext.Context) *LocationsQuestionsAnswersDeleteCall
Context sets the context to be used in this call's Do method.
func (*LocationsQuestionsAnswersDeleteCall)Do¶added inv0.75.0
func (c *LocationsQuestionsAnswersDeleteCall) Do(opts ...googleapi.CallOption) (*Empty,error)
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)Fields¶added inv0.75.0
func (c *LocationsQuestionsAnswersDeleteCall) Fields(s ...googleapi.Field) *LocationsQuestionsAnswersDeleteCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*LocationsQuestionsAnswersDeleteCall)Header¶added inv0.75.0
func (c *LocationsQuestionsAnswersDeleteCall) Header()http.Header
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¶
func (c *LocationsQuestionsAnswersListCall) Context(ctxcontext.Context) *LocationsQuestionsAnswersListCall
Context sets the context to be used in this call's Do method.
func (*LocationsQuestionsAnswersListCall)Do¶
func (c *LocationsQuestionsAnswersListCall) Do(opts ...googleapi.CallOption) (*ListAnswersResponse,error)
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¶
func (c *LocationsQuestionsAnswersListCall) Fields(s ...googleapi.Field) *LocationsQuestionsAnswersListCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*LocationsQuestionsAnswersListCall)Header¶
func (c *LocationsQuestionsAnswersListCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*LocationsQuestionsAnswersListCall)IfNoneMatch¶
func (c *LocationsQuestionsAnswersListCall) IfNoneMatch(entityTagstring) *LocationsQuestionsAnswersListCall
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¶
func (c *LocationsQuestionsAnswersListCall) OrderBy(orderBystring) *LocationsQuestionsAnswersListCall
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¶
func (c *LocationsQuestionsAnswersListCall) PageSize(pageSizeint64) *LocationsQuestionsAnswersListCall
PageSize sets the optional parameter "pageSize": How many answers to fetchper page. The default and maximum `page_size` values are 10.
func (*LocationsQuestionsAnswersListCall)PageToken¶
func (c *LocationsQuestionsAnswersListCall) PageToken(pageTokenstring) *LocationsQuestionsAnswersListCall
PageToken sets the optional parameter "pageToken": If specified, the nextpage of answers is retrieved.
func (*LocationsQuestionsAnswersListCall)Pages¶
func (c *LocationsQuestionsAnswersListCall) Pages(ctxcontext.Context, f func(*ListAnswersResponse)error)error
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)Delete¶added inv0.75.0
func (r *LocationsQuestionsAnswersService) Delete(namestring) *LocationsQuestionsAnswersDeleteCall
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¶
func (r *LocationsQuestionsAnswersService) List(parentstring) *LocationsQuestionsAnswersListCall
List: Returns the paginated list of answers for a specified question.
- parent: The name of the question to fetch answers for.
func (*LocationsQuestionsAnswersService)Upsert¶
func (r *LocationsQuestionsAnswersService) Upsert(parentstring, upsertanswerrequest *UpsertAnswerRequest) *LocationsQuestionsAnswersUpsertCall
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¶
func (c *LocationsQuestionsAnswersUpsertCall) Context(ctxcontext.Context) *LocationsQuestionsAnswersUpsertCall
Context sets the context to be used in this call's Do method.
func (*LocationsQuestionsAnswersUpsertCall)Do¶
func (c *LocationsQuestionsAnswersUpsertCall) Do(opts ...googleapi.CallOption) (*Answer,error)
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¶
func (c *LocationsQuestionsAnswersUpsertCall) Fields(s ...googleapi.Field) *LocationsQuestionsAnswersUpsertCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*LocationsQuestionsAnswersUpsertCall)Header¶
func (c *LocationsQuestionsAnswersUpsertCall) Header()http.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¶
func (c *LocationsQuestionsCreateCall) Context(ctxcontext.Context) *LocationsQuestionsCreateCall
Context sets the context to be used in this call's Do method.
func (*LocationsQuestionsCreateCall)Do¶
func (c *LocationsQuestionsCreateCall) Do(opts ...googleapi.CallOption) (*Question,error)
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¶
func (c *LocationsQuestionsCreateCall) Fields(s ...googleapi.Field) *LocationsQuestionsCreateCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*LocationsQuestionsCreateCall)Header¶
func (c *LocationsQuestionsCreateCall) Header()http.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¶
func (c *LocationsQuestionsDeleteCall) Context(ctxcontext.Context) *LocationsQuestionsDeleteCall
Context sets the context to be used in this call's Do method.
func (*LocationsQuestionsDeleteCall)Do¶
func (c *LocationsQuestionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty,error)
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¶
func (c *LocationsQuestionsDeleteCall) Fields(s ...googleapi.Field) *LocationsQuestionsDeleteCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*LocationsQuestionsDeleteCall)Header¶
func (c *LocationsQuestionsDeleteCall) Header()http.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¶
func (c *LocationsQuestionsListCall) Context(ctxcontext.Context) *LocationsQuestionsListCall
Context sets the context to be used in this call's Do method.
func (*LocationsQuestionsListCall)Do¶
func (c *LocationsQuestionsListCall) Do(opts ...googleapi.CallOption) (*ListQuestionsResponse,error)
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¶
func (c *LocationsQuestionsListCall) Fields(s ...googleapi.Field) *LocationsQuestionsListCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*LocationsQuestionsListCall)Filter¶
func (c *LocationsQuestionsListCall) Filter(filterstring) *LocationsQuestionsListCall
Filter sets the optional parameter "filter": A filter constraining thequestions to return. The only filter currently supported is"ignore_answered=true"
func (*LocationsQuestionsListCall)Header¶
func (c *LocationsQuestionsListCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*LocationsQuestionsListCall)IfNoneMatch¶
func (c *LocationsQuestionsListCall) IfNoneMatch(entityTagstring) *LocationsQuestionsListCall
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¶
func (c *LocationsQuestionsListCall) OrderBy(orderBystring) *LocationsQuestionsListCall
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¶
func (c *LocationsQuestionsListCall) PageSize(pageSizeint64) *LocationsQuestionsListCall
PageSize sets the optional parameter "pageSize": How many questions to fetchper page. The default and maximum `page_size` values are 10.
func (*LocationsQuestionsListCall)PageToken¶
func (c *LocationsQuestionsListCall) PageToken(pageTokenstring) *LocationsQuestionsListCall
PageToken sets the optional parameter "pageToken": If specified, the nextpage of questions is retrieved.
func (*LocationsQuestionsListCall)Pages¶
func (c *LocationsQuestionsListCall) Pages(ctxcontext.Context, f func(*ListQuestionsResponse)error)error
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¶
func (c *LocationsQuestionsPatchCall) Context(ctxcontext.Context) *LocationsQuestionsPatchCall
Context sets the context to be used in this call's Do method.
func (*LocationsQuestionsPatchCall)Do¶
func (c *LocationsQuestionsPatchCall) Do(opts ...googleapi.CallOption) (*Question,error)
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¶
func (c *LocationsQuestionsPatchCall) Fields(s ...googleapi.Field) *LocationsQuestionsPatchCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*LocationsQuestionsPatchCall)Header¶
func (c *LocationsQuestionsPatchCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*LocationsQuestionsPatchCall)UpdateMask¶
func (c *LocationsQuestionsPatchCall) UpdateMask(updateMaskstring) *LocationsQuestionsPatchCall
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¶
func (r *LocationsQuestionsService) Create(parentstring, question *Question) *LocationsQuestionsCreateCall
Create: Adds a question for the specified location.
- parent: The name of the location to write a question for.
func (*LocationsQuestionsService)Delete¶
func (r *LocationsQuestionsService) Delete(namestring) *LocationsQuestionsDeleteCall
Delete: Deletes a specific question written by the current user.
- name: The name of the question to delete.
func (*LocationsQuestionsService)List¶
func (r *LocationsQuestionsService) List(parentstring) *LocationsQuestionsListCall
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¶
func (r *LocationsQuestionsService) Patch(namestring, question *Question) *LocationsQuestionsPatchCall
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¶
typeService¶
type Service struct {BasePathstring// API endpoint base URLUserAgentstring// optional additional User-Agent fragmentLocations *LocationsService// contains filtered or unexported fields} funcNewdeprecated
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¶
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)