Class: PostImportOpenapiResponse401

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



23664
23665
23666
23667
23668
23669
# File 'lib/schemas.rb', line 23664

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

.from_json!(json) ⇒ Object



23671
23672
23673
# File 'lib/schemas.rb', line 23671

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

Instance Method Details

#to_dynamicObject



23675
23676
23677
23678
23679
# File 'lib/schemas.rb', line 23675

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

#to_json(options = nil) ⇒ Object



23681
23682
23683
# File 'lib/schemas.rb', line 23681

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