Class: PostNetworkPrivateResponse401

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



25969
25970
25971
25972
25973
25974
# File 'lib/schemas.rb', line 25969

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

.from_json!(json) ⇒ Object



25976
25977
25978
# File 'lib/schemas.rb', line 25976

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

Instance Method Details

#to_dynamicObject



25980
25981
25982
25983
25984
# File 'lib/schemas.rb', line 25980

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

#to_json(options = nil) ⇒ Object



25986
25987
25988
# File 'lib/schemas.rb', line 25986

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