Class: PutScimV2UsersUserIDResponse

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



34505
34506
34507
34508
34509
34510
34511
34512
34513
34514
34515
34516
# File 'lib/schemas.rb', line 34505

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    active:                                  d["active"],
    external_id:                             d["externalId"],
    id:                                      d["id"],
    put_scim_v2_users_user_id_response_meta: d["meta"] ? PutScimV2UsersUserIDResponseMeta.from_dynamic!(d["meta"]) : nil,
    put_scim_v2_users_user_id_response_name: d["name"] ? PutScimV2UsersUserIDResponseName.from_dynamic!(d["name"]) : nil,
    schemas:                                 d["schemas"],
    user_name:                               d["userName"],
  )
end

.from_json!(json) ⇒ Object



34518
34519
34520
# File 'lib/schemas.rb', line 34518

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

Instance Method Details

#to_dynamicObject



34522
34523
34524
34525
34526
34527
34528
34529
34530
34531
34532
# File 'lib/schemas.rb', line 34522

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

#to_json(options = nil) ⇒ Object



34534
34535
34536
# File 'lib/schemas.rb', line 34534

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