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, this library is considered complete and is in maintenance mode. This means that we will address critical bugs and security issues but will not add any 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 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 google.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 OAuth flow, use google.golang.org/api/option.WithTokenSource:
config := &oauth2.Config{...} // ... token, err := config.Exchange(ctx, ...) mybusinessqandaService, err := mybusinessqanda.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
See google.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 ¶
type Answer ¶
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. CreateTime string `json:"createTime,omitempty"` // Name: Output only. The unique name for the answer // locations/*/questions/*/answers/* Name string `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. Text string `json:"text,omitempty"` // UpdateTime: Output only. The timestamp for when the answer was last // modified. UpdateTime string `json:"updateTime,omitempty"` // UpvoteCount: Output only. The number of upvotes for the answer. UpvoteCount int64 `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. 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. "Author") 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:"-"` }
Answer: Represents an answer to a question
func (*Answer) MarshalJSON ¶
type Author ¶
type Author struct { // DisplayName: The display name of the user DisplayName string `json:"displayName,omitempty"` // ProfilePhotoUri: The profile photo URI of the user. ProfilePhotoUri string `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 location Type string `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. 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:"-"` }
Author: Represents the author of a question or answer
func (*Author) MarshalJSON ¶
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); }
type ListAnswersResponse ¶
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. NextPageToken string `json:"nextPageToken,omitempty"` // TotalSize: The total number of answers posted for this question // across all pages. TotalSize int64 `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. 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. "Answers") 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:"-"` }
ListAnswersResponse: Response message for QuestionsAndAnswers.ListAnswers
func (*ListAnswersResponse) MarshalJSON ¶
func (s *ListAnswersResponse) MarshalJSON() ([]byte, error)
type ListQuestionsResponse ¶
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. NextPageToken string `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. TotalSize int64 `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. 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:"-"` }
ListQuestionsResponse: Response message for QuestionsAndAnswers.ListQuestions
func (*ListQuestionsResponse) MarshalJSON ¶
func (s *ListQuestionsResponse) MarshalJSON() ([]byte, error)
type LocationsQuestionsAnswersDeleteCall ¶
type LocationsQuestionsAnswersDeleteCall struct {
// contains filtered or unexported fields
}
func (*LocationsQuestionsAnswersDeleteCall) Context ¶
func (c *LocationsQuestionsAnswersDeleteCall) Context(ctx context.Context) *LocationsQuestionsAnswersDeleteCall
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 (*LocationsQuestionsAnswersDeleteCall) Do ¶
func (c *LocationsQuestionsAnswersDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "mybusinessqanda.locations.questions.answers.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 (*LocationsQuestionsAnswersDeleteCall) Fields ¶
func (c *LocationsQuestionsAnswersDeleteCall) Fields(s ...googleapi.Field) *LocationsQuestionsAnswersDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*LocationsQuestionsAnswersDeleteCall) Header ¶
func (c *LocationsQuestionsAnswersDeleteCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
type LocationsQuestionsAnswersListCall ¶
type LocationsQuestionsAnswersListCall struct {
// contains filtered or unexported fields
}
func (*LocationsQuestionsAnswersListCall) Context ¶
func (c *LocationsQuestionsAnswersListCall) Context(ctx context.Context) *LocationsQuestionsAnswersListCall
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 (*LocationsQuestionsAnswersListCall) Do ¶
func (c *LocationsQuestionsAnswersListCall) Do(opts ...googleapi.CallOption) (*ListAnswersResponse, error)
Do executes the "mybusinessqanda.locations.questions.answers.list" call. Exactly one of *ListAnswersResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListAnswersResponse.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 (*LocationsQuestionsAnswersListCall) Fields ¶
func (c *LocationsQuestionsAnswersListCall) Fields(s ...googleapi.Field) *LocationsQuestionsAnswersListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*LocationsQuestionsAnswersListCall) Header ¶
func (c *LocationsQuestionsAnswersListCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
func (*LocationsQuestionsAnswersListCall) IfNoneMatch ¶
func (c *LocationsQuestionsAnswersListCall) IfNoneMatch(entityTag string) *LocationsQuestionsAnswersListCall
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 (*LocationsQuestionsAnswersListCall) OrderBy ¶
func (c *LocationsQuestionsAnswersListCall) OrderBy(orderBy string) *LocationsQuestionsAnswersListCall
OrderBy sets the optional parameter "orderBy": The order to return the answers. 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(pageSize int64) *LocationsQuestionsAnswersListCall
PageSize sets the optional parameter "pageSize": How many answers to fetch per page. The default and maximum `page_size` values are 10.
func (*LocationsQuestionsAnswersListCall) PageToken ¶
func (c *LocationsQuestionsAnswersListCall) PageToken(pageToken string) *LocationsQuestionsAnswersListCall
PageToken sets the optional parameter "pageToken": If specified, the next page of answers is retrieved.
func (*LocationsQuestionsAnswersListCall) Pages ¶
func (c *LocationsQuestionsAnswersListCall) Pages(ctx context.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.
type LocationsQuestionsAnswersService ¶
type LocationsQuestionsAnswersService struct {
// contains filtered or unexported fields
}
func NewLocationsQuestionsAnswersService ¶
func NewLocationsQuestionsAnswersService(s *Service) *LocationsQuestionsAnswersService
func (*LocationsQuestionsAnswersService) Delete ¶
func (r *LocationsQuestionsAnswersService) Delete(name string) *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(parent string) *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(parent string, upsertanswerrequest *UpsertAnswerRequest) *LocationsQuestionsAnswersUpsertCall
Upsert: Creates an answer or updates the existing answer written by the user for the specified question. A user can only create one answer per question.
- parent: The name of the question to write an answer for.
type LocationsQuestionsAnswersUpsertCall ¶
type LocationsQuestionsAnswersUpsertCall struct {
// contains filtered or unexported fields
}
func (*LocationsQuestionsAnswersUpsertCall) Context ¶
func (c *LocationsQuestionsAnswersUpsertCall) Context(ctx context.Context) *LocationsQuestionsAnswersUpsertCall
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 (*LocationsQuestionsAnswersUpsertCall) Do ¶
func (c *LocationsQuestionsAnswersUpsertCall) Do(opts ...googleapi.CallOption) (*Answer, error)
Do executes the "mybusinessqanda.locations.questions.answers.upsert" call. Exactly one of *Answer or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Answer.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 (*LocationsQuestionsAnswersUpsertCall) Fields ¶
func (c *LocationsQuestionsAnswersUpsertCall) Fields(s ...googleapi.Field) *LocationsQuestionsAnswersUpsertCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*LocationsQuestionsAnswersUpsertCall) Header ¶
func (c *LocationsQuestionsAnswersUpsertCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
type LocationsQuestionsCreateCall ¶
type LocationsQuestionsCreateCall struct {
// contains filtered or unexported fields
}
func (*LocationsQuestionsCreateCall) Context ¶
func (c *LocationsQuestionsCreateCall) Context(ctx context.Context) *LocationsQuestionsCreateCall
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 (*LocationsQuestionsCreateCall) Do ¶
func (c *LocationsQuestionsCreateCall) Do(opts ...googleapi.CallOption) (*Question, error)
Do executes the "mybusinessqanda.locations.questions.create" call. Exactly one of *Question or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Question.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 (*LocationsQuestionsCreateCall) Fields ¶
func (c *LocationsQuestionsCreateCall) Fields(s ...googleapi.Field) *LocationsQuestionsCreateCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*LocationsQuestionsCreateCall) Header ¶
func (c *LocationsQuestionsCreateCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
type LocationsQuestionsDeleteCall ¶
type LocationsQuestionsDeleteCall struct {
// contains filtered or unexported fields
}
func (*LocationsQuestionsDeleteCall) Context ¶
func (c *LocationsQuestionsDeleteCall) Context(ctx context.Context) *LocationsQuestionsDeleteCall
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 (*LocationsQuestionsDeleteCall) Do ¶
func (c *LocationsQuestionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error)
Do executes the "mybusinessqanda.locations.questions.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 (*LocationsQuestionsDeleteCall) Fields ¶
func (c *LocationsQuestionsDeleteCall) Fields(s ...googleapi.Field) *LocationsQuestionsDeleteCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*LocationsQuestionsDeleteCall) Header ¶
func (c *LocationsQuestionsDeleteCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
type LocationsQuestionsListCall ¶
type LocationsQuestionsListCall struct {
// contains filtered or unexported fields
}
func (*LocationsQuestionsListCall) AnswersPerQuestion ¶
func (c *LocationsQuestionsListCall) AnswersPerQuestion(answersPerQuestion int64) *LocationsQuestionsListCall
AnswersPerQuestion sets the optional parameter "answersPerQuestion": How many answers to fetch per question. The default and maximum `answers_per_question` values are 10.
func (*LocationsQuestionsListCall) Context ¶
func (c *LocationsQuestionsListCall) Context(ctx context.Context) *LocationsQuestionsListCall
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 (*LocationsQuestionsListCall) Do ¶
func (c *LocationsQuestionsListCall) Do(opts ...googleapi.CallOption) (*ListQuestionsResponse, error)
Do executes the "mybusinessqanda.locations.questions.list" call. Exactly one of *ListQuestionsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListQuestionsResponse.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 (*LocationsQuestionsListCall) Fields ¶
func (c *LocationsQuestionsListCall) Fields(s ...googleapi.Field) *LocationsQuestionsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*LocationsQuestionsListCall) Filter ¶
func (c *LocationsQuestionsListCall) Filter(filter string) *LocationsQuestionsListCall
Filter sets the optional parameter "filter": A filter constraining the questions to return. The only filter currently supported is "ignore_answered=true"
func (*LocationsQuestionsListCall) Header ¶
func (c *LocationsQuestionsListCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
func (*LocationsQuestionsListCall) IfNoneMatch ¶
func (c *LocationsQuestionsListCall) IfNoneMatch(entityTag string) *LocationsQuestionsListCall
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 (*LocationsQuestionsListCall) OrderBy ¶
func (c *LocationsQuestionsListCall) OrderBy(orderBy string) *LocationsQuestionsListCall
OrderBy sets the optional parameter "orderBy": The order to return the questions. 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(pageSize int64) *LocationsQuestionsListCall
PageSize sets the optional parameter "pageSize": How many questions to fetch per page. The default and maximum `page_size` values are 10.
func (*LocationsQuestionsListCall) PageToken ¶
func (c *LocationsQuestionsListCall) PageToken(pageToken string) *LocationsQuestionsListCall
PageToken sets the optional parameter "pageToken": If specified, the next page of questions is retrieved.
func (*LocationsQuestionsListCall) Pages ¶
func (c *LocationsQuestionsListCall) Pages(ctx context.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.
type LocationsQuestionsPatchCall ¶
type LocationsQuestionsPatchCall struct {
// contains filtered or unexported fields
}
func (*LocationsQuestionsPatchCall) Context ¶
func (c *LocationsQuestionsPatchCall) Context(ctx context.Context) *LocationsQuestionsPatchCall
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 (*LocationsQuestionsPatchCall) Do ¶
func (c *LocationsQuestionsPatchCall) Do(opts ...googleapi.CallOption) (*Question, error)
Do executes the "mybusinessqanda.locations.questions.patch" call. Exactly one of *Question or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Question.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 (*LocationsQuestionsPatchCall) Fields ¶
func (c *LocationsQuestionsPatchCall) Fields(s ...googleapi.Field) *LocationsQuestionsPatchCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*LocationsQuestionsPatchCall) Header ¶
func (c *LocationsQuestionsPatchCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
func (*LocationsQuestionsPatchCall) UpdateMask ¶
func (c *LocationsQuestionsPatchCall) UpdateMask(updateMask string) *LocationsQuestionsPatchCall
UpdateMask sets the optional parameter "updateMask": Required. The specific fields to update. Only question text can be updated.
type LocationsQuestionsService ¶
type LocationsQuestionsService struct { Answers *LocationsQuestionsAnswersService // contains filtered or unexported fields }
func NewLocationsQuestionsService ¶
func NewLocationsQuestionsService(s *Service) *LocationsQuestionsService
func (*LocationsQuestionsService) Create ¶
func (r *LocationsQuestionsService) Create(parent string, 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(name string) *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(parent string) *LocationsQuestionsListCall
List: Returns the paginated list of questions and some of its answers for a specified location. This operation is only valid if the specified location is verified.
- parent: The name of the location to fetch questions for.
func (*LocationsQuestionsService) Patch ¶
func (r *LocationsQuestionsService) Patch(name string, 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.
type LocationsService ¶
type LocationsService struct { Questions *LocationsQuestionsService // contains filtered or unexported fields }
func NewLocationsService ¶
func NewLocationsService(s *Service) *LocationsService
type Question ¶
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. CreateTime string `json:"createTime,omitempty"` // Name: Immutable. The unique name for the question. // locations/*/questions/* This field will be ignored if set during // question creation. Name string `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. Text string `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. TotalAnswerCount int64 `json:"totalAnswerCount,omitempty"` // UpdateTime: Output only. The timestamp for when the question was last // modified. UpdateTime string `json:"updateTime,omitempty"` // UpvoteCount: Output only. The number of upvotes for the question. UpvoteCount int64 `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. 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. "Author") 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:"-"` }
Question: Represents a single question and some of its answers.
func (*Question) MarshalJSON ¶
type Service ¶
type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Locations *LocationsService // contains filtered or unexported fields }
func New
deprecated
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 ¶
NewService creates a new Service.
type UpsertAnswerRequest ¶
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. 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. "Answer") 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:"-"` }
UpsertAnswerRequest: Request message for QuestionsAndAnswers.UpsertAnswer
func (*UpsertAnswerRequest) MarshalJSON ¶
func (s *UpsertAnswerRequest) MarshalJSON() ([]byte, error)