Class: DeleteMocksMockIDUnpublishResponse404

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



3079
3080
3081
3082
3083
3084
# File 'lib/schemas.rb', line 3079

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    error: d["error"] ? DeleteMocksMockIDUnpublishResponse404Error.from_dynamic!(d["error"]) : nil,
  )
end

.from_json!(json) ⇒ Object



3086
3087
3088
# File 'lib/schemas.rb', line 3086

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

Instance Method Details

#to_dynamicObject



3090
3091
3092
3093
3094
# File 'lib/schemas.rb', line 3090

def to_dynamic
  {
    "error" => error&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



3096
3097
3098
# File 'lib/schemas.rb', line 3096

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