Class: DeleteMocksMockIDUnpublishResponse401

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



3017
3018
3019
3020
3021
3022
# File 'lib/schemas.rb', line 3017

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

.from_json!(json) ⇒ Object



3024
3025
3026
# File 'lib/schemas.rb', line 3024

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

Instance Method Details

#to_dynamicObject



3028
3029
3030
3031
3032
# File 'lib/schemas.rb', line 3028

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

#to_json(options = nil) ⇒ Object



3034
3035
3036
# File 'lib/schemas.rb', line 3034

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