Class: PostScimV2UsersBodyName

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schemas.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



26652
26653
26654
26655
26656
26657
26658
# File 'lib/schemas.rb', line 26652

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    family_name: d["familyName"],
    given_name:  d["givenName"],
  )
end

.from_json!(json) ⇒ Object



26660
26661
26662
# File 'lib/schemas.rb', line 26660

def self.from_json!(json)
  from_dynamic!(JSON.parse(json))
end

Instance Method Details

#to_dynamicObject



26664
26665
26666
26667
26668
26669
# File 'lib/schemas.rb', line 26664

def to_dynamic
  {
    "familyName" => family_name,
    "givenName"  => given_name,
  }
end

#to_json(options = nil) ⇒ Object



26671
26672
26673
# File 'lib/schemas.rb', line 26671

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end