Class: Late::GetInboxPostComments200ResponseCommentsInner

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/late-sdk/models/get_inbox_post_comments200_response_comments_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 = {}) ⇒ GetInboxPostComments200ResponseCommentsInner

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
232
233
234
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 139

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Late::GetInboxPostComments200ResponseCommentsInner` 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 `Late::GetInboxPostComments200ResponseCommentsInner`. 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?(:'message')
    self.message = attributes[:'message']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#can_deleteObject

Returns the value of attribute can_delete.



40
41
42
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 40

def can_delete
  @can_delete
end

#can_hideObject

Whether this comment can be hidden (Facebook



43
44
45
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 43

def can_hide
  @can_hide
end

#can_likeObject

Whether this comment can be liked (Facebook



46
47
48
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 46

def can_like
  @can_like
end

#can_replyObject

Returns the value of attribute can_reply.



38
39
40
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 38

def can_reply
  @can_reply
end

#cidObject

Bluesky content identifier



58
59
60
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 58

def cid
  @cid
end

#created_timeObject

Returns the value of attribute created_time.



22
23
24
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 22

def created_time
  @created_time
end

#fromObject

Returns the value of attribute from.



24
25
26
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 24

def from
  @from
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 18

def id
  @id
end

#is_hiddenObject

Whether the comment is currently hidden



49
50
51
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 49

def is_hidden
  @is_hidden
end

#is_likedObject

Whether the current user has liked this comment



52
53
54
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 52

def is_liked
  @is_liked
end

#like_countObject

Returns the value of attribute like_count.



26
27
28
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 26

def like_count
  @like_count
end

#like_uriObject

Bluesky like URI for unliking



55
56
57
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 55

def like_uri
  @like_uri
end

#messageObject

Returns the value of attribute message.



20
21
22
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 20

def message
  @message
end

#parent_idObject

Parent comment ID for nested replies



61
62
63
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 61

def parent_id
  @parent_id
end

#platformObject

The platform this comment is from



31
32
33
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 31

def platform
  @platform
end

#repliesObject

Returns the value of attribute replies.



36
37
38
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 36

def replies
  @replies
end

#reply_countObject

Returns the value of attribute reply_count.



28
29
30
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 28

def reply_count
  @reply_count
end

#root_cidObject

Bluesky root post CID



67
68
69
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 67

def root_cid
  @root_cid
end

#root_uriObject

Bluesky root post URI



64
65
66
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 64

def root_uri
  @root_uri
end

#urlObject

Direct link to the comment on the platform (if available)



34
35
36
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 34

def url
  @url
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



96
97
98
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 96

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



101
102
103
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 101

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 70

def self.attribute_map
  {
    :'id' => :'id',
    :'message' => :'message',
    :'created_time' => :'createdTime',
    :'from' => :'from',
    :'like_count' => :'likeCount',
    :'reply_count' => :'replyCount',
    :'platform' => :'platform',
    :'url' => :'url',
    :'replies' => :'replies',
    :'can_reply' => :'canReply',
    :'can_delete' => :'canDelete',
    :'can_hide' => :'canHide',
    :'can_like' => :'canLike',
    :'is_hidden' => :'isHidden',
    :'is_liked' => :'isLiked',
    :'like_uri' => :'likeUri',
    :'cid' => :'cid',
    :'parent_id' => :'parentId',
    :'root_uri' => :'rootUri',
    :'root_cid' => :'rootCid'
  }
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



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 293

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



132
133
134
135
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 132

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 106

def self.openapi_types
  {
    :'id' => :'String',
    :'message' => :'String',
    :'created_time' => :'Time',
    :'from' => :'GetInboxPostComments200ResponseCommentsInnerFrom',
    :'like_count' => :'Integer',
    :'reply_count' => :'Integer',
    :'platform' => :'String',
    :'url' => :'String',
    :'replies' => :'Array<Object>',
    :'can_reply' => :'Boolean',
    :'can_delete' => :'Boolean',
    :'can_hide' => :'Boolean',
    :'can_like' => :'Boolean',
    :'is_hidden' => :'Boolean',
    :'is_liked' => :'Boolean',
    :'like_uri' => :'String',
    :'cid' => :'String',
    :'parent_id' => :'String',
    :'root_uri' => :'String',
    :'root_cid' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 253

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      message == o.message &&
      created_time == o.created_time &&
      from == o.from &&
      like_count == o.like_count &&
      reply_count == o.reply_count &&
      platform == o.platform &&
      url == o.url &&
      replies == o.replies &&
      can_reply == o.can_reply &&
      can_delete == o.can_delete &&
      can_hide == o.can_hide &&
      can_like == o.can_like &&
      is_hidden == o.is_hidden &&
      is_liked == o.is_liked &&
      like_uri == o.like_uri &&
      cid == o.cid &&
      parent_id == o.parent_id &&
      root_uri == o.root_uri &&
      root_cid == o.root_cid
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


280
281
282
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 280

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



286
287
288
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 286

def hash
  [id, message, created_time, from, like_count, reply_count, platform, url, replies, can_reply, can_delete, can_hide, can_like, is_hidden, is_liked, like_uri, cid, parent_id, root_uri, root_cid].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



238
239
240
241
242
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 238

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



315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 315

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



246
247
248
249
# File 'lib/late-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 246

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