Class: Google::Apis::MybusinessqandaV1::Question
- Inherits:
-
Object
- Object
- Google::Apis::MybusinessqandaV1::Question
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/mybusinessqanda_v1/classes.rb,
lib/google/apis/mybusinessqanda_v1/representations.rb,
lib/google/apis/mybusinessqanda_v1/representations.rb
Overview
Represents a single question and some of its answers.
Instance Attribute Summary collapse
-
#author ⇒ Google::Apis::MybusinessqandaV1::Author
Represents the author of a question or answer Corresponds to the JSON property
author
. -
#create_time ⇒ String
Output only.
-
#name ⇒ String
Immutable.
-
#text ⇒ String
Required.
-
#top_answers ⇒ Array<Google::Apis::MybusinessqandaV1::Answer>
Output only.
-
#total_answer_count ⇒ Fixnum
Output only.
-
#update_time ⇒ String
Output only.
-
#upvote_count ⇒ Fixnum
Output only.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Question
constructor
A new instance of Question.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Question
Returns a new instance of Question.
239 240 241 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 239 def initialize(**args) update!(**args) end |
Instance Attribute Details
#author ⇒ Google::Apis::MybusinessqandaV1::Author
Represents the author of a question or answer
Corresponds to the JSON property author
197 198 199 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 197 def @author end |
#create_time ⇒ String
Output only. The timestamp for when the question was written.
Corresponds to the JSON property createTime
202 203 204 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 202 def create_time @create_time end |
#name ⇒ String
Immutable. The unique name for the question. locations//questions/ This
field will be ignored if set during question creation.
Corresponds to the JSON property name
208 209 210 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 208 def name @name end |
#text ⇒ String
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.
Corresponds to the JSON property text
215 216 217 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 215 def text @text end |
#top_answers ⇒ Array<Google::Apis::MybusinessqandaV1::Answer>
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)
Corresponds to the JSON property topAnswers
222 223 224 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 222 def top_answers @top_answers end |
#total_answer_count ⇒ Fixnum
Output only. The total number of answers posted for this question.
Corresponds to the JSON property totalAnswerCount
227 228 229 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 227 def total_answer_count @total_answer_count end |
#update_time ⇒ String
Output only. The timestamp for when the question was last modified.
Corresponds to the JSON property updateTime
232 233 234 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 232 def update_time @update_time end |
#upvote_count ⇒ Fixnum
Output only. The number of upvotes for the question.
Corresponds to the JSON property upvoteCount
237 238 239 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 237 def upvote_count @upvote_count end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
244 245 246 247 248 249 250 251 252 253 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 244 def update!(**args) @author = args[:author] if args.key?(:author) @create_time = args[:create_time] if args.key?(:create_time) @name = args[:name] if args.key?(:name) @text = args[:text] if args.key?(:text) @top_answers = args[:top_answers] if args.key?(:top_answers) @total_answer_count = args[:total_answer_count] if args.key?(:total_answer_count) @update_time = args[:update_time] if args.key?(:update_time) @upvote_count = args[:upvote_count] if args.key?(:upvote_count) end |