Class: PostMocksResponse500

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



24960
24961
24962
24963
24964
24965
# File 'lib/schemas.rb', line 24960

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

.from_json!(json) ⇒ Object



24967
24968
24969
# File 'lib/schemas.rb', line 24967

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

Instance Method Details

#to_dynamicObject



24971
24972
24973
24974
24975
# File 'lib/schemas.rb', line 24971

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

#to_json(options = nil) ⇒ Object



24977
24978
24979
# File 'lib/schemas.rb', line 24977

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