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.
240 241 242 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 240 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
198 199 200 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 198 def @author end |
#create_time ⇒ String
Output only. The timestamp for when the question was written.
Corresponds to the JSON property createTime
203 204 205 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 203 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
209 210 211 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 209 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
216 217 218 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 216 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
223 224 225 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 223 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
228 229 230 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 228 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
233 234 235 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 233 def update_time @update_time end |
#upvote_count ⇒ Fixnum
Output only. The number of upvotes for the question.
Corresponds to the JSON property upvoteCount
238 239 240 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 238 def upvote_count @upvote_count end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
245 246 247 248 249 250 251 252 253 254 |
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 245 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 |