Class: Cadenya::Types::Profile

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, spec: nil) ⇒ Profile

Returns a new instance of Profile.



4611
4612
4613
4614
# File 'lib/cadenya/types.rb', line 4611

def initialize(metadata: nil, spec: nil)
  @metadata = 
  @spec = spec
end

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata.



4609
4610
4611
# File 'lib/cadenya/types.rb', line 4609

def 
  @metadata
end

#specObject (readonly)

Returns the value of attribute spec.



4609
4610
4611
# File 'lib/cadenya/types.rb', line 4609

def spec
  @spec
end

Class Method Details

.from_json(data) ⇒ Object



4616
4617
4618
4619
4620
4621
# File 'lib/cadenya/types.rb', line 4616

def self.from_json(data)
  new(
    metadata: data["metadata"].nil? ? nil : Types::AccountResourceMetadata.from_json(data["metadata"]),
    spec: data["spec"].nil? ? nil : Types::ProfileSpec.from_json(data["spec"]),
  )
end

Instance Method Details

#to_hObject



4623
4624
4625
4626
4627
4628
# File 'lib/cadenya/types.rb', line 4623

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