Class: GetEnvironmentsResponse404Error

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



10087
10088
10089
10090
10091
10092
10093
# File 'lib/schemas.rb', line 10087

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

.from_json!(json) ⇒ Object



10095
10096
10097
# File 'lib/schemas.rb', line 10095

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

Instance Method Details

#to_dynamicObject



10099
10100
10101
10102
10103
10104
# File 'lib/schemas.rb', line 10099

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

#to_json(options = nil) ⇒ Object



10106
10107
10108
# File 'lib/schemas.rb', line 10106

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