Class: DeleteMocksMockIDServerResponsesServerResponseIDResponse429

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



2792
2793
2794
2795
2796
2797
2798
# File 'lib/schemas.rb', line 2792

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

.from_json!(json) ⇒ Object



2800
2801
2802
# File 'lib/schemas.rb', line 2800

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

Instance Method Details

#to_dynamicObject



2804
2805
2806
2807
2808
2809
# File 'lib/schemas.rb', line 2804

def to_dynamic
  {
    "error"   => error,
    "message" => message,
  }
end

#to_json(options = nil) ⇒ Object



2811
2812
2813
# File 'lib/schemas.rb', line 2811

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