Class: DeleteMocksMockIDUnpublishResponse400

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



2960
2961
2962
2963
2964
2965
# File 'lib/schemas.rb', line 2960

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

.from_json!(json) ⇒ Object



2967
2968
2969
# File 'lib/schemas.rb', line 2967

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

Instance Method Details

#to_dynamicObject



2971
2972
2973
2974
2975
# File 'lib/schemas.rb', line 2971

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

#to_json(options = nil) ⇒ Object



2977
2978
2979
# File 'lib/schemas.rb', line 2977

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