Class: Zernio::ListInboxReviews200ResponseDataInner

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ ListInboxReviews200ResponseDataInner

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {}) —

    Model attributes in the form of hash



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 148

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ListInboxReviews200ResponseDataInner` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ListInboxReviews200ResponseDataInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'platform')
    self.platform = attributes[:'platform']
  end

  if attributes.key?(:'account_id')
    self. = attributes[:'account_id']
  end

  if attributes.key?(:'account_username')
    self. = attributes[:'account_username']
  end

  if attributes.key?(:'location_id')
    self.location_id = attributes[:'location_id']
  end

  if attributes.key?(:'location_name')
    self.location_name = attributes[:'location_name']
  end

  if attributes.key?(:'reviewer')
    self.reviewer = attributes[:'reviewer']
  end

  if attributes.key?(:'rating')
    self.rating = attributes[:'rating']
  end

  if attributes.key?(:'recommendation_type')
    self.recommendation_type = attributes[:'recommendation_type']
  end

  if attributes.key?(:'text')
    self.text = attributes[:'text']
  end

  if attributes.key?(:'created')
    self.created = attributes[:'created']
  end

  if attributes.key?(:'has_reply')
    self.has_reply = attributes[:'has_reply']
  end

  if attributes.key?(:'has_photos')
    self.has_photos = attributes[:'has_photos']
  end

  if attributes.key?(:'photo_count')
    self.photo_count = attributes[:'photo_count']
  end

  if attributes.key?(:'photos')
    if (value = attributes[:'photos']).is_a?(Array)
      self.photos = value
    end
  end

  if attributes.key?(:'reply')
    self.reply = attributes[:'reply']
  end

  if attributes.key?(:'review_url')
    self.review_url = attributes[:'review_url']
  end
end

Instance Attribute Details

#account_id ⇒ Object

Returns the value of attribute account_id.



23
24
25
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 23

def 
  @account_id
end

#account_username ⇒ Object

Returns the value of attribute account_username.



25
26
27
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 25

def 
  @account_username
end

#created ⇒ Object

Returns the value of attribute created.



42
43
44
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 42

def created
  @created
end

#has_photos ⇒ Object

Whether the review has at least one photo. Google Business Profile only; always false for other platforms.



47
48
49
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 47

def has_photos
  @has_photos
end

#has_reply ⇒ Object

Returns the value of attribute has_reply.



44
45
46
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 44

def has_reply
  @has_reply
end

#id ⇒ Object

Review identifier. For Google Business Profile this is the full review resource name (accounts/accountId/locations/locationId/reviews/reviewId), so it also encodes the location.



19
20
21
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 19

def id
  @id
end

#location_id ⇒ Object

Bare Google Business Profile location id the review belongs to. Google Business Profile only; absent for other platforms.



28
29
30
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 28

def location_id
  @location_id
end

#location_name ⇒ Object

Human-readable Google Business Profile location display name. Google Business Profile only; absent for other platforms.



31
32
33
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 31

def location_name
  @location_name
end

#photo_count ⇒ Object

Number of photos attached to the review (photos only; videos are not counted). Google Business Profile only; 0 for other platforms.



50
51
52
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 50

def photo_count
  @photo_count
end

#photos ⇒ Object

Photos attached to the review. Google Business Profile only; always an empty array for other platforms.



53
54
55
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 53

def photos
  @photos
end

#platform ⇒ Object

Returns the value of attribute platform.



21
22
23
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 21

def platform
  @platform
end

#rating ⇒ Object

Returns the value of attribute rating.



35
36
37
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 35

def rating
  @rating
end

#recommendation_type ⇒ Object

Facebook recommendation: positive means recommends, negative means does not recommend. Null or absent when unavailable; absent for other platforms. Independent of the numeric rating.



38
39
40
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 38

def recommendation_type
  @recommendation_type
end

#reply ⇒ Object

Returns the value of attribute reply.



55
56
57
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 55

def reply
  @reply
end

#review_url ⇒ Object

Returns the value of attribute review_url.



57
58
59
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 57

def review_url
  @review_url
end

#reviewer ⇒ Object

Returns the value of attribute reviewer.



33
34
35
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 33

def reviewer
  @reviewer
end

#text ⇒ Object

Returns the value of attribute text.



40
41
42
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 40

def text
  @text
end

Class Method Details

.acceptable_attribute_map ⇒ Object

Returns attribute mapping this model knows about



105
106
107
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 105

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributes ⇒ Object

Returns all the JSON keys this model knows about



110
111
112
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 110

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_map ⇒ Object

Attribute mapping from ruby-style variable name to JSON key.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 82

def self.attribute_map
  {
    :'id' => :'id',
    :'platform' => :'platform',
    :'account_id' => :'accountId',
    :'account_username' => :'accountUsername',
    :'location_id' => :'locationId',
    :'location_name' => :'locationName',
    :'reviewer' => :'reviewer',
    :'rating' => :'rating',
    :'recommendation_type' => :'recommendationType',
    :'text' => :'text',
    :'created' => :'created',
    :'has_reply' => :'hasReply',
    :'has_photos' => :'hasPhotos',
    :'photo_count' => :'photoCount',
    :'photos' => :'photos',
    :'reply' => :'reply',
    :'review_url' => :'reviewUrl'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash) —

    Model attributes in the form of hash

Returns:

  • (Object) —

    Returns the model itself



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 299

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullable ⇒ Object

List of attributes with nullable: true



138
139
140
141
142
143
144
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 138

def self.openapi_nullable
  Set.new([
    :'location_name',
    :'recommendation_type',
    :'review_url'
  ])
end

.openapi_types ⇒ Object

Attribute type mapping.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 115

def self.openapi_types
  {
    :'id' => :'String',
    :'platform' => :'String',
    :'account_id' => :'String',
    :'account_username' => :'String',
    :'location_id' => :'String',
    :'location_name' => :'String',
    :'reviewer' => :'ListInboxReviews200ResponseDataInnerReviewer',
    :'rating' => :'Integer',
    :'recommendation_type' => :'String',
    :'text' => :'String',
    :'created' => :'Time',
    :'has_reply' => :'Boolean',
    :'has_photos' => :'Boolean',
    :'photo_count' => :'Integer',
    :'photos' => :'Array<ListInboxReviews200ResponseDataInnerPhotosInner>',
    :'reply' => :'ListInboxReviews200ResponseDataInnerReply',
    :'review_url' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object) —

    to be compared



262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 262

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      platform == o.platform &&
       == o. &&
       == o. &&
      location_id == o.location_id &&
      location_name == o.location_name &&
      reviewer == o.reviewer &&
      rating == o.rating &&
      recommendation_type == o.recommendation_type &&
      text == o.text &&
      created == o.created &&
      has_reply == o.has_reply &&
      has_photos == o.has_photos &&
      photo_count == o.photo_count &&
      photos == o.photos &&
      reply == o.reply &&
      review_url == o.review_url
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object) —

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


286
287
288
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 286

def eql?(o)
  self == o
end

#hash ⇒ Integer

Calculates hash code according to all attributes.

Returns:

  • (Integer) —

    Hash code



292
293
294
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 292

def hash
  [id, platform, , , location_id, location_name, reviewer, rating, recommendation_type, text, created, has_reply, has_photos, photo_count, photos, reply, review_url].hash
end

#list_invalid_properties ⇒ Object

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



235
236
237
238
239
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 235

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hash ⇒ Hash

Returns the object in the form of hash

Returns:

  • (Hash) —

    Returns the object in the form of hash



321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 321

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid? ⇒ Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean) —

    true if the model is valid



243
244
245
246
247
248
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 243

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  recommendation_type_validator = EnumAttributeValidator.new('String', ["positive", "negative"])
  return false unless recommendation_type_validator.valid?(@recommendation_type)
  true
end