Class: PatchScimV2UsersUserIDBodyOperationsItem

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



18851
18852
18853
18854
18855
18856
18857
# File 'lib/schemas.rb', line 18851

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    op:    d["op"],
    value: d["value"] ? PatchScimV2UsersUserIDBodyOperationsItemValue.from_dynamic!(d["value"]) : nil,
  )
end

.from_json!(json) ⇒ Object



18859
18860
18861
# File 'lib/schemas.rb', line 18859

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

Instance Method Details

#to_dynamicObject



18863
18864
18865
18866
18867
18868
# File 'lib/schemas.rb', line 18863

def to_dynamic
  {
    "op"    => op,
    "value" => value&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



18870
18871
18872
# File 'lib/schemas.rb', line 18870

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