Class: Cadenya::Types::AccountResourceMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, account_id: nil, name: nil, external_id: nil, labels: nil, profile_id: nil, created_at: nil) ⇒ AccountResourceMetadata

Returns a new instance of AccountResourceMetadata.



247
248
249
250
251
252
253
254
255
# File 'lib/cadenya/types.rb', line 247

def initialize(id: nil, account_id: nil, name: nil, external_id: nil, labels: nil, profile_id: nil, created_at: nil)
  @id = id
  @account_id = 
  @name = name
  @external_id = external_id
  @labels = labels
  @profile_id = profile_id
  @created_at = created_at
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



245
246
247
# File 'lib/cadenya/types.rb', line 245

def 
  @account_id
end

#created_atObject (readonly)

Returns the value of attribute created_at.



245
246
247
# File 'lib/cadenya/types.rb', line 245

def created_at
  @created_at
end

#external_idObject (readonly)

Returns the value of attribute external_id.



245
246
247
# File 'lib/cadenya/types.rb', line 245

def external_id
  @external_id
end

#idObject (readonly)

Returns the value of attribute id.



245
246
247
# File 'lib/cadenya/types.rb', line 245

def id
  @id
end

#labelsObject (readonly)

Returns the value of attribute labels.



245
246
247
# File 'lib/cadenya/types.rb', line 245

def labels
  @labels
end

#nameObject (readonly)

Returns the value of attribute name.



245
246
247
# File 'lib/cadenya/types.rb', line 245

def name
  @name
end

#profile_idObject (readonly)

Returns the value of attribute profile_id.



245
246
247
# File 'lib/cadenya/types.rb', line 245

def profile_id
  @profile_id
end

Class Method Details

.from_json(data) ⇒ Object



257
258
259
260
261
262
263
264
265
266
267
# File 'lib/cadenya/types.rb', line 257

def self.from_json(data)
  new(
    id: data["id"],
    account_id: data["accountId"],
    name: data["name"],
    external_id: data["externalId"],
    labels: data["labels"],
    profile_id: data["profileId"],
    created_at: data["createdAt"].nil? ? nil : Time.iso8601(data["createdAt"]),
  )
end

Instance Method Details

#to_hObject



269
270
271
272
273
274
275
276
277
278
279
# File 'lib/cadenya/types.rb', line 269

def to_h
  {
    id: Util.plain(@id),
    account_id: Util.plain(@account_id),
    name: Util.plain(@name),
    external_id: Util.plain(@external_id),
    labels: Util.plain(@labels),
    profile_id: Util.plain(@profile_id),
    created_at: Util.plain(@created_at),
  }.reject { |_k, v| v.nil? }
end