Class: Zernio::ListInboxReviews200ResponseDataInner

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

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



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
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
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 120

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?(:'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_idObject

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_usernameObject

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

#createdObject

Returns the value of attribute created.



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

def created
  @created
end

#has_photosObject

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



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

def has_photos
  @has_photos
end

#has_replyObject

Returns the value of attribute has_reply.



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

def has_reply
  @has_reply
end

#idObject

Review identifier. For Google Business 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_idObject

Bare GBP location id the review belongs to. Google Business 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_nameObject

Human-readable GBP location display name. Google Business 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_countObject

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



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

def photo_count
  @photo_count
end

#photosObject

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



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

def photos
  @photos
end

#platformObject

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

#ratingObject

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

#replyObject

Returns the value of attribute reply.



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

def reply
  @reply
end

#review_urlObject

Returns the value of attribute review_url.



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

def review_url
  @review_url
end

#reviewerObject

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

#textObject

Returns the value of attribute text.



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

def text
  @text
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



79
80
81
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 79

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



84
85
86
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 84

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 57

def self.attribute_map
  {
    :'id' => :'id',
    :'platform' => :'platform',
    :'account_id' => :'accountId',
    :'account_username' => :'accountUsername',
    :'location_id' => :'locationId',
    :'location_name' => :'locationName',
    :'reviewer' => :'reviewer',
    :'rating' => :'rating',
    :'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



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 254

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_nullableObject

List of attributes with nullable: true



111
112
113
114
115
116
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 111

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

.openapi_typesObject

Attribute type mapping.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 89

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

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 218

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 &&
      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


241
242
243
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 241

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



247
248
249
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 247

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

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



203
204
205
206
207
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 203

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 276

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



211
212
213
214
# File 'lib/zernio-sdk/models/list_inbox_reviews200_response_data_inner.rb', line 211

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end