Class: Zernio::ListInboxMentions200ResponseDataInner

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
200
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 135

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



23
24
25
# File 'lib/zernio-sdk/models/list_inbox_mentions200_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_mentions200_response_data_inner.rb', line 25

def 
  @account_username
end

#author_nameObject

Display name of the author, resolved from authorUrn. Null when LinkedIn does not allow resolving the profile.



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

def author_name
  @author_name
end

#author_pictureObject

Profile picture URL of the author. LinkedIn CDN URLs expire after some time, so fetch promptly rather than storing long-term.



43
44
45
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 43

def author_picture
  @author_picture
end

#author_urnObject

LinkedIn URN of the person who mentioned you



34
35
36
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 34

def author_urn
  @author_urn
end

#author_usernameObject

LinkedIn vanity name of the author (the slug in their profile URL)



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

def author_username
  @author_username
end

#contentObject

Text of the post that mentioned you



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

def content
  @content
end

#created_atObject

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#idObject

Mention document ID



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

def id
  @id
end

#organizational_entityObject

URN of the organization that was mentioned



46
47
48
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 46

def organizational_entity
  @organizational_entity
end

URL to the source post on LinkedIn



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

def permalink
  @permalink
end

#platformObject

Returns the value of attribute platform.



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

def platform
  @platform
end

#published_atObject

Returns the value of attribute published_at.



48
49
50
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 48

def published_at
  @published_at
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



94
95
96
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 94

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



99
100
101
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 99

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 75

def self.attribute_map
  {
    :'id' => :'id',
    :'platform' => :'platform',
    :'account_id' => :'accountId',
    :'account_username' => :'accountUsername',
    :'content' => :'content',
    :'permalink' => :'permalink',
    :'author_urn' => :'authorUrn',
    :'author_name' => :'authorName',
    :'author_username' => :'authorUsername',
    :'author_picture' => :'authorPicture',
    :'organizational_entity' => :'organizationalEntity',
    :'published_at' => :'publishedAt',
    :'created_at' => :'createdAt'
  }
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



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_mentions200_response_data_inner.rb', line 264

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



123
124
125
126
127
128
129
130
131
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 123

def self.openapi_nullable
  Set.new([
    :'permalink',
    :'author_urn',
    :'author_name',
    :'author_username',
    :'author_picture',
  ])
end

.openapi_typesObject

Attribute type mapping.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 104

def self.openapi_types
  {
    :'id' => :'String',
    :'platform' => :'String',
    :'account_id' => :'String',
    :'account_username' => :'String',
    :'content' => :'String',
    :'permalink' => :'String',
    :'author_urn' => :'String',
    :'author_name' => :'String',
    :'author_username' => :'String',
    :'author_picture' => :'String',
    :'organizational_entity' => :'String',
    :'published_at' => :'Time',
    :'created_at' => :'Time'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 231

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      platform == o.platform &&
       == o. &&
       == o. &&
      content == o.content &&
      permalink == o.permalink &&
      author_urn == o.author_urn &&
      author_name == o.author_name &&
      author_username == o.author_username &&
      author_picture == o.author_picture &&
      organizational_entity == o.organizational_entity &&
      published_at == o.published_at &&
      created_at == o.created_at
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


251
252
253
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 251

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



257
258
259
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 257

def hash
  [id, platform, , , content, permalink, author_urn, author_name, author_username, author_picture, organizational_entity, published_at, created_at].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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

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



286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 286

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



212
213
214
215
216
217
# File 'lib/zernio-sdk/models/list_inbox_mentions200_response_data_inner.rb', line 212

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