Answer: Represents an answer to a question
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. 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:"-"` }
func (s *Answer) MarshalJSON() ([]byte, error)
Author: Represents the author of a question or answer
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. 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:"-"` }
func (s *Author) MarshalJSON() ([]byte, error)
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 Empty struct { // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` }
ListAnswersResponse: Response message for QuestionsAndAnswers.ListAnswers
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. 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:"-"` }
func (s *ListAnswersResponse) MarshalJSON() ([]byte, error)
ListQuestionsResponse: Response message for QuestionsAndAnswers.ListQuestions
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. 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:"-"` }
func (s *ListQuestionsResponse) MarshalJSON() ([]byte, error)
type LocationsQuestionsAnswersDeleteCall struct {
// contains filtered or unexported fields
}
func (c *LocationsQuestionsAnswersDeleteCall) Context(ctx context.Context) *LocationsQuestionsAnswersDeleteCall
Context sets the context to be used in this call's Do method.
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) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
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 details.
func (c *LocationsQuestionsAnswersDeleteCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type LocationsQuestionsAnswersListCall struct {
// contains filtered or unexported fields
}
func (c *LocationsQuestionsAnswersListCall) Context(ctx context.Context) *LocationsQuestionsAnswersListCall
Context sets the context to be used in this call's Do method.
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 at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
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 details.
func (c *LocationsQuestionsAnswersListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (c *LocationsQuestionsAnswersListCall) IfNoneMatch(entityTag string) *LocationsQuestionsAnswersListCall
IfNoneMatch sets an 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.
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 (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 (c *LocationsQuestionsAnswersListCall) PageToken(pageToken string) *LocationsQuestionsAnswersListCall
PageToken sets the optional parameter "pageToken": If specified, the next page of answers is retrieved.
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 struct {
// contains filtered or unexported fields
}
func NewLocationsQuestionsAnswersService(s *Service) *LocationsQuestionsAnswersService
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 (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 (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 struct {
// contains filtered or unexported fields
}
func (c *LocationsQuestionsAnswersUpsertCall) Context(ctx context.Context) *LocationsQuestionsAnswersUpsertCall
Context sets the context to be used in this call's Do method.
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) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
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 details.
func (c *LocationsQuestionsAnswersUpsertCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type LocationsQuestionsCreateCall struct {
// contains filtered or unexported fields
}
func (c *LocationsQuestionsCreateCall) Context(ctx context.Context) *LocationsQuestionsCreateCall
Context sets the context to be used in this call's Do method.
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) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
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 details.
func (c *LocationsQuestionsCreateCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type LocationsQuestionsDeleteCall struct {
// contains filtered or unexported fields
}
func (c *LocationsQuestionsDeleteCall) Context(ctx context.Context) *LocationsQuestionsDeleteCall
Context sets the context to be used in this call's Do method.
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) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
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 details.
func (c *LocationsQuestionsDeleteCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
type LocationsQuestionsListCall struct {
// contains filtered or unexported fields
}
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 (c *LocationsQuestionsListCall) Context(ctx context.Context) *LocationsQuestionsListCall
Context sets the context to be used in this call's Do method.
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 returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
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 details.
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 (c *LocationsQuestionsListCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (c *LocationsQuestionsListCall) IfNoneMatch(entityTag string) *LocationsQuestionsListCall
IfNoneMatch sets an 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.
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 (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 (c *LocationsQuestionsListCall) PageToken(pageToken string) *LocationsQuestionsListCall
PageToken sets the optional parameter "pageToken": If specified, the next page of questions is retrieved.
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 struct {
// contains filtered or unexported fields
}
func (c *LocationsQuestionsPatchCall) Context(ctx context.Context) *LocationsQuestionsPatchCall
Context sets the context to be used in this call's Do method.
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) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
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 details.
func (c *LocationsQuestionsPatchCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
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 struct { Answers *LocationsQuestionsAnswersService // contains filtered or unexported fields }
func NewLocationsQuestionsService(s *Service) *LocationsQuestionsService
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 (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 (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 (r *LocationsQuestionsService) Patch(name string, question *Question) *LocationsQuestionsPatchCall
Patch: Updates a specific question written by the current user.
type LocationsService struct { Questions *LocationsQuestionsService // contains filtered or unexported fields }
func NewLocationsService(s *Service) *LocationsService
Question: Represents a single question and some of its answers.
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. 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:"-"` }
func (s *Question) MarshalJSON() ([]byte, error)
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(client *http.Client) (*Service, error)
New creates a new Service. It uses the provided http.Client for requests.
Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)
NewService creates a new Service.
UpsertAnswerRequest: Request message for QuestionsAndAnswers.UpsertAnswer
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:"-"` }
func (s *UpsertAnswerRequest) MarshalJSON() ([]byte, error)