Class: PostNetworkPrivateResponse403

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



26026
26027
26028
26029
26030
26031
# File 'lib/schemas.rb', line 26026

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

.from_json!(json) ⇒ Object



26033
26034
26035
# File 'lib/schemas.rb', line 26033

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

Instance Method Details

#to_dynamicObject



26037
26038
26039
26040
26041
# File 'lib/schemas.rb', line 26037

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

#to_json(options = nil) ⇒ Object



26043
26044
26045
# File 'lib/schemas.rb', line 26043

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