Class: GetEnvironmentsResponse401Error

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



10030
10031
10032
10033
10034
10035
10036
# File 'lib/schemas.rb', line 10030

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

.from_json!(json) ⇒ Object



10038
10039
10040
# File 'lib/schemas.rb', line 10038

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

Instance Method Details

#to_dynamicObject



10042
10043
10044
10045
10046
10047
# File 'lib/schemas.rb', line 10042

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

#to_json(options = nil) ⇒ Object



10049
10050
10051
# File 'lib/schemas.rb', line 10049

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