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. Note - If you have a quota of 0 after enabling the API, please request for GBP API access.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://mybusinessqanda.$UNIVERSE_DOMAIN$/"
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.
49 50 51 52 53 54 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 49 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', 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.
42 43 44 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 42 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.
47 48 49 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 47 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.
77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 77 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.
109 110 111 112 113 114 115 116 117 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 109 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.
229 230 231 232 233 234 235 236 237 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 229 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.
269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 269 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.
157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 157 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.
196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 196 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.
304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/google/apis/mybusinessqanda_v1/service.rb', line 304 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 |