Class: PostScimV2GroupsResponse

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



26378
26379
26380
26381
26382
26383
26384
26385
26386
26387
26388
26389
# File 'lib/schemas.rb', line 26378

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    active:                            d["active"],
    external_id:                       d["externalId"],
    id:                                d["id"],
    post_scim_v2_groups_response_meta: d["meta"] ? PostScimV2GroupsResponseMeta.from_dynamic!(d["meta"]) : nil,
    post_scim_v2_groups_response_name: d["name"] ? PostScimV2GroupsResponseName.from_dynamic!(d["name"]) : nil,
    schemas:                           d["schemas"],
    user_name:                         d["userName"],
  )
end

.from_json!(json) ⇒ Object



26391
26392
26393
# File 'lib/schemas.rb', line 26391

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

Instance Method Details

#to_dynamicObject



26395
26396
26397
26398
26399
26400
26401
26402
26403
26404
26405
# File 'lib/schemas.rb', line 26395

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

#to_json(options = nil) ⇒ Object



26407
26408
26409
# File 'lib/schemas.rb', line 26407

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