Class: DeleteMocksMockIDUnpublishResponse500

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



3168
3169
3170
3171
3172
3173
# File 'lib/schemas.rb', line 3168

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

.from_json!(json) ⇒ Object



3175
3176
3177
# File 'lib/schemas.rb', line 3175

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

Instance Method Details

#to_dynamicObject



3179
3180
3181
3182
3183
# File 'lib/schemas.rb', line 3179

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

#to_json(options = nil) ⇒ Object



3185
3186
3187
# File 'lib/schemas.rb', line 3185

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