Class: Cadenya::Types::Tenant

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(metadata: nil, info: nil, state: nil) ⇒ Tenant

Returns a new instance of Tenant.



5504
5505
5506
5507
5508
# File 'lib/cadenya/types.rb', line 5504

def initialize(metadata: nil, info: nil, state: nil)
  @metadata = 
  @info = info
  @state = state
end

Instance Attribute Details

#infoObject (readonly)

Returns the value of attribute info.



5502
5503
5504
# File 'lib/cadenya/types.rb', line 5502

def info
  @info
end

#metadataObject (readonly)

Returns the value of attribute metadata.



5502
5503
5504
# File 'lib/cadenya/types.rb', line 5502

def 
  @metadata
end

#stateObject (readonly)

Returns the value of attribute state.



5502
5503
5504
# File 'lib/cadenya/types.rb', line 5502

def state
  @state
end

Class Method Details

.from_json(data) ⇒ Object



5510
5511
5512
5513
5514
5515
5516
# File 'lib/cadenya/types.rb', line 5510

def self.from_json(data)
  new(
    metadata: data["metadata"].nil? ? nil : Types::ResourceMetadata.from_json(data["metadata"]),
    info: data["info"].nil? ? nil : Types::TenantInfo.from_json(data["info"]),
    state: data["state"],
  )
end

Instance Method Details

#to_hObject



5518
5519
5520
5521
5522
5523
5524
# File 'lib/cadenya/types.rb', line 5518

def to_h
  {
    metadata: Util.plain(@metadata),
    info: Util.plain(@info),
    state: Util.plain(@state),
  }.reject { |_k, v| v.nil? }
end