Class: ProjectsDeleteResponse

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



2265
2266
2267
2268
2269
2270
# File 'lib/schemas.rb', line 2265

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    data: d.fetch("data").map { |x| ProjectDeleteResponse.from_dynamic!(x) },
  )
end

.from_json!(json) ⇒ Object



2272
2273
2274
# File 'lib/schemas.rb', line 2272

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

Instance Method Details

#to_dynamicObject



2276
2277
2278
2279
2280
# File 'lib/schemas.rb', line 2276

def to_dynamic
  {
    "data" => data.map { |x| x.to_dynamic },
  }
end

#to_json(options = nil) ⇒ Object



2282
2283
2284
# File 'lib/schemas.rb', line 2282

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