Class: PostMocksMockIDServerResponsesBody

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



24243
24244
24245
24246
24247
24248
# File 'lib/schemas.rb', line 24243

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

.from_json!(json) ⇒ Object



24250
24251
24252
# File 'lib/schemas.rb', line 24250

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

Instance Method Details

#to_dynamicObject



24254
24255
24256
24257
24258
# File 'lib/schemas.rb', line 24254

def to_dynamic
  {
    "serverResponse" => server_response&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



24260
24261
24262
# File 'lib/schemas.rb', line 24260

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