Class: PostScimV2UsersResponse

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



26824
26825
26826
26827
26828
26829
26830
26831
26832
26833
26834
26835
# File 'lib/schemas.rb', line 26824

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    active:                           d["active"],
    external_id:                      d["externalId"],
    id:                               d["id"],
    post_scim_v2_users_response_meta: d["meta"] ? PostScimV2UsersResponseMeta.from_dynamic!(d["meta"]) : nil,
    post_scim_v2_users_response_name: d["name"] ? PostScimV2UsersResponseName.from_dynamic!(d["name"]) : nil,
    schemas:                          d["schemas"],
    user_name:                        d["userName"],
  )
end

.from_json!(json) ⇒ Object



26837
26838
26839
# File 'lib/schemas.rb', line 26837

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

Instance Method Details

#to_dynamicObject



26841
26842
26843
26844
26845
26846
26847
26848
26849
26850
26851
# File 'lib/schemas.rb', line 26841

def to_dynamic
  {
    "active"     => active,
    "externalId" => external_id,
    "id"         => id,
    "meta"       => post_scim_v2_users_response_meta&.to_dynamic,
    "name"       => post_scim_v2_users_response_name&.to_dynamic,
    "schemas"    => schemas,
    "userName"   => user_name,
  }
end

#to_json(options = nil) ⇒ Object



26853
26854
26855
# File 'lib/schemas.rb', line 26853

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