Class: Zernio::GetInboxPostComments200ResponseCommentsInner

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/zernio-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



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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 151

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



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

def can_delete
  @can_delete
end

#can_hideObject

Whether this comment can be hidden (Facebook, Instagram, Threads)



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

def can_hide
  @can_hide
end

#can_likeObject

Whether this comment can be liked (Facebook, Twitter/X, Bluesky, Reddit)



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

def can_like
  @can_like
end

#can_replyObject

Returns the value of attribute can_reply.



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

def can_reply
  @can_reply
end

#cidObject

Bluesky content identifier



62
63
64
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 62

def cid
  @cid
end

#created_timeObject

Returns the value of attribute created_time.



22
23
24
# File 'lib/zernio-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/zernio-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/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 18

def id
  @id
end

#is_hiddenObject

Whether the comment is currently hidden



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

def is_hidden
  @is_hidden
end

#is_likedObject

Whether the current user has liked this comment



56
57
58
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 56

def is_liked
  @is_liked
end

#like_countObject

Returns the value of attribute like_count.



26
27
28
# File 'lib/zernio-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



59
60
61
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 59

def like_uri
  @like_uri
end

#messageObject

Returns the value of attribute message.



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

def message
  @message
end

#parent_idObject

ID of the parent comment. Present on entries inside replies for Facebook, Instagram and X/Twitter. On X/Twitter it is also present on top-level entries, where it holds the ID of the post replied to. Omitted entirely (key absent, not null) on top-level Facebook and Instagram entries and on every other platform, which express the parent relationship only through replies nesting.



65
66
67
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 65

def parent_id
  @parent_id
end

#platformObject

The platform this comment is from



32
33
34
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 32

def platform
  @platform
end

#repliesObject

Returns the value of attribute replies.



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

def replies
  @replies
end

#replies_has_moreObject

Facebook only. True when replies (capped at 10) does not hold the comment's full reply thread; fetch the rest by passing the comment id as postId to GET /v1/inbox/comments/postId. Absent (not false) on every other platform, including Instagram, which has no equivalent signal.



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

def replies_has_more
  @replies_has_more
end

#reply_countObject

The platform's own reply count, which includes hidden and deleted replies. Can exceed replies.length even when repliesHasMore is false or absent.



29
30
31
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 29

def reply_count
  @reply_count
end

#root_cidObject

Bluesky root post CID



71
72
73
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 71

def root_cid
  @root_cid
end

#root_uriObject

Bluesky root post URI



68
69
70
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 68

def root_uri
  @root_uri
end

#urlObject

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



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

def url
  @url
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



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

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



106
107
108
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 106

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 74

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',
    :'replies_has_more' => :'repliesHasMore',
    :'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



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 310

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



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

def self.openapi_nullable
  Set.new([
    :'url',
    :'like_uri',
    :'cid',
    :'parent_id',
    :'root_uri',
    :'root_cid'
  ])
end

.openapi_typesObject

Attribute type mapping.



111
112
113
114
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/get_inbox_post_comments200_response_comments_inner.rb', line 111

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>',
    :'replies_has_more' => :'Boolean',
    :'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



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 269

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 &&
      replies_has_more == o.replies_has_more &&
      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


297
298
299
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 297

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



303
304
305
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 303

def hash
  [id, message, created_time, from, like_count, reply_count, platform, url, replies, replies_has_more, 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



254
255
256
257
258
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 254

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



332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 332

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



262
263
264
265
# File 'lib/zernio-sdk/models/get_inbox_post_comments200_response_comments_inner.rb', line 262

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