Class: PostNetworkPrivateResponse401Error

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



25942
25943
25944
25945
25946
25947
25948
# File 'lib/schemas.rb', line 25942

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    message:                                     d["message"],
    post_network_private_response401_error_name: d["name"],
  )
end

.from_json!(json) ⇒ Object



25950
25951
25952
# File 'lib/schemas.rb', line 25950

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

Instance Method Details

#to_dynamicObject



25954
25955
25956
25957
25958
25959
# File 'lib/schemas.rb', line 25954

def to_dynamic
  {
    "message" => message,
    "name"    => post_network_private_response401_error_name,
  }
end

#to_json(options = nil) ⇒ Object



25961
25962
25963
# File 'lib/schemas.rb', line 25961

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