Class: DeleteCollectionsCollectionIDRequestsRequestIDResponse401ErrorDetails

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



1084
1085
1086
1087
1088
1089
1090
1091
# File 'lib/schemas.rb', line 1084

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    model:    d["model"],
    model_id: d["model_id"],
    owner:    d["owner"],
  )
end

.from_json!(json) ⇒ Object



1093
1094
1095
# File 'lib/schemas.rb', line 1093

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

Instance Method Details

#to_dynamicObject



1097
1098
1099
1100
1101
1102
1103
# File 'lib/schemas.rb', line 1097

def to_dynamic
  {
    "model"    => model,
    "model_id" => model_id,
    "owner"    => owner,
  }
end

#to_json(options = nil) ⇒ Object



1105
1106
1107
# File 'lib/schemas.rb', line 1105

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