Class: Google::Apis::MybusinessqandaV1::Question

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#authorGoogle::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
  @author
end

#create_timeString

Output only. The timestamp for when the question was written. Corresponds to the JSON property createTime

Returns:

  • (String)


202
203
204
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 202

def create_time
  @create_time
end

#nameString

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

Returns:

  • (String)


208
209
210
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 208

def name
  @name
end

#textString

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

Returns:

  • (String)


215
216
217
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 215

def text
  @text
end

#top_answersArray<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_countFixnum

Output only. The total number of answers posted for this question. Corresponds to the JSON property totalAnswerCount

Returns:

  • (Fixnum)


227
228
229
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 227

def total_answer_count
  @total_answer_count
end

#update_timeString

Output only. The timestamp for when the question was last modified. Corresponds to the JSON property updateTime

Returns:

  • (String)


232
233
234
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 232

def update_time
  @update_time
end

#upvote_countFixnum

Output only. The number of upvotes for the question. Corresponds to the JSON property upvoteCount

Returns:

  • (Fixnum)


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