Class: PostEnvironmentsResponse401Error

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



23283
23284
23285
23286
23287
23288
23289
# File 'lib/schemas.rb', line 23283

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

.from_json!(json) ⇒ Object



23291
23292
23293
# File 'lib/schemas.rb', line 23291

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

Instance Method Details

#to_dynamicObject



23295
23296
23297
23298
23299
23300
# File 'lib/schemas.rb', line 23295

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

#to_json(options = nil) ⇒ Object



23302
23303
23304
# File 'lib/schemas.rb', line 23302

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