Class: DeleteMocksMockIDServerResponsesServerResponseIDResponse400

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



2643
2644
2645
2646
2647
2648
# File 'lib/schemas.rb', line 2643

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

.from_json!(json) ⇒ Object



2650
2651
2652
# File 'lib/schemas.rb', line 2650

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

Instance Method Details

#to_dynamicObject



2654
2655
2656
2657
2658
# File 'lib/schemas.rb', line 2654

def to_dynamic
  {
    "error" => error&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



2660
2661
2662
# File 'lib/schemas.rb', line 2660

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