Class: PostMocksMockIDPublishResponse404

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



24049
24050
24051
24052
24053
24054
# File 'lib/schemas.rb', line 24049

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

.from_json!(json) ⇒ Object



24056
24057
24058
# File 'lib/schemas.rb', line 24056

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

Instance Method Details

#to_dynamicObject



24060
24061
24062
24063
24064
# File 'lib/schemas.rb', line 24060

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

#to_json(options = nil) ⇒ Object



24066
24067
24068
# File 'lib/schemas.rb', line 24066

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