Class: Google::Apis::MybusinessqandaV1::MyBusinessQAService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::MybusinessqandaV1::MyBusinessQAService
- Defined in:
- lib/google/apis/mybusinessqanda_v1/service.rb
Overview
My Business Q&A API
The My Business Q&A API allows questions and answers to be posted for specific listings.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#create_location_question(parent, question_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::Question
Adds a question for the specified location.
-
#delete_location_question(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::Empty
Deletes a specific question written by the current user.
-
#delete_location_question_answer(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::Empty
Deletes the answer written by the current user to a question.
-
#initialize ⇒ MyBusinessQAService
constructor
A new instance of MyBusinessQAService.
-
#list_location_question_answers(parent, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::ListAnswersResponse
Returns the paginated list of answers for a specified question.
-
#list_location_questions(parent, answers_per_question: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::ListQuestionsResponse
Returns the paginated list of questions and some of its answers for a specified location.
-
#patch_location_question(name, question_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::Question
Updates a specific question written by the current user.
-
#upsert_answer(parent, upsert_answer_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::Answer
Creates an answer or updates the existing answer written by the user for the specified question.
Constructor Details
#initialize ⇒ MyBusinessQAService
Returns a new instance of MyBusinessQAService.
46 47 48 49 50 51 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 46 def initialize super('https://mybusinessqanda.googleapis.com/', '', client_name: 'google-apis-mybusinessqanda_v1', client_version: Google::Apis::MybusinessqandaV1::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
39 40 41 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 39 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
44 45 46 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 44 def quota_user @quota_user end |
Instance Method Details
#create_location_question(parent, question_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::Question
Adds a question for the specified location.
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 74 def create_location_question(parent, question_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}', ) command.request_representation = Google::Apis::MybusinessqandaV1::Question::Representation command.request_object = question_object command.response_representation = Google::Apis::MybusinessqandaV1::Question::Representation command.response_class = Google::Apis::MybusinessqandaV1::Question command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_location_question(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::Empty
Deletes a specific question written by the current user.
106 107 108 109 110 111 112 113 114 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 106 def delete_location_question(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}', ) command.response_representation = Google::Apis::MybusinessqandaV1::Empty::Representation command.response_class = Google::Apis::MybusinessqandaV1::Empty command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_location_question_answer(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::Empty
Deletes the answer written by the current user to a question.
226 227 228 229 230 231 232 233 234 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 226 def delete_location_question_answer(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}/answers:delete', ) command.response_representation = Google::Apis::MybusinessqandaV1::Empty::Representation command.response_class = Google::Apis::MybusinessqandaV1::Empty command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_location_question_answers(parent, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::ListAnswersResponse
Returns the paginated list of answers for a specified question.
266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 266 def list_location_question_answers(parent, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/answers', ) command.response_representation = Google::Apis::MybusinessqandaV1::ListAnswersResponse::Representation command.response_class = Google::Apis::MybusinessqandaV1::ListAnswersResponse command.params['parent'] = parent unless parent.nil? command.query['orderBy'] = order_by unless order_by.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_location_questions(parent, answers_per_question: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::ListQuestionsResponse
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.
154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 154 def list_location_questions(parent, answers_per_question: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}', ) command.response_representation = Google::Apis::MybusinessqandaV1::ListQuestionsResponse::Representation command.response_class = Google::Apis::MybusinessqandaV1::ListQuestionsResponse command.params['parent'] = parent unless parent.nil? command.query['answersPerQuestion'] = answers_per_question unless answers_per_question.nil? command.query['filter'] = filter unless filter.nil? command.query['orderBy'] = order_by unless order_by.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#patch_location_question(name, question_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::Question
Updates a specific question written by the current user.
193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 193 def patch_location_question(name, question_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', ) command.request_representation = Google::Apis::MybusinessqandaV1::Question::Representation command.request_object = question_object command.response_representation = Google::Apis::MybusinessqandaV1::Question::Representation command.response_class = Google::Apis::MybusinessqandaV1::Question command.params['name'] = name unless name.nil? command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#upsert_answer(parent, upsert_answer_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessqandaV1::Answer
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.
301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 301 def upsert_answer(parent, upsert_answer_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/answers:upsert', ) command.request_representation = Google::Apis::MybusinessqandaV1::UpsertAnswerRequest::Representation command.request_object = upsert_answer_request_object command.response_representation = Google::Apis::MybusinessqandaV1::Answer::Representation command.response_class = Google::Apis::MybusinessqandaV1::Answer command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |