Class: ResponseForProjectsDeleteResponse

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



2298
2299
2300
2301
2302
2303
2304
2305
# File 'lib/schemas.rb', line 2298

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    data:          d["data"] ? ProjectsDeleteResponse.from_dynamic!(d["data"]) : nil,
    error_message: d["errorMessage"],
    success:       d.fetch("success"),
  )
end

.from_json!(json) ⇒ Object



2307
2308
2309
# File 'lib/schemas.rb', line 2307

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

Instance Method Details

#to_dynamicObject



2311
2312
2313
2314
2315
2316
2317
# File 'lib/schemas.rb', line 2311

def to_dynamic
  {
    "data"         => data&.to_dynamic,
    "errorMessage" => error_message,
    "success"      => success,
  }
end

#to_json(options = nil) ⇒ Object



2319
2320
2321
# File 'lib/schemas.rb', line 2319

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