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.



240
241
242
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 240

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



198
199
200
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 198

def author
  @author
end

#create_timeString

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

Returns:

  • (String)


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

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)


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

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)


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

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



223
224
225
# File 'lib/google/apis/mybusinessqanda_v1/classes.rb', line 223

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)


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

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)


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

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)


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