Class: Inttegro::Payout::SettingsConflictErrorEnvelope
- Inherits:
-
T::Struct
- Object
- T::Struct
- Inttegro::Payout::SettingsConflictErrorEnvelope
- Extended by:
- T::Sig
- Defined in:
- lib/inttegro/payout/settings_conflict_error_envelope.rb
Overview
Typed representation of the settings conflict error envelope object in the Inttegro API.
This generated model is immutable. Construct it with .new, or decode a string-keyed API
payload with .from_hash. #serialize produces a string-keyed hash using the original wire
field names and serialized enum values.
Instance Attribute Summary collapse
-
#error ⇒ Inttegro::Payout::SettingsConflictErrorEnvelopeErrorVariant1, Inttegro::Payout::SettingsConflictErrorEnvelopeErrorVariant2
readonly
Value of the
errorfield in the Inttegro API payload.
Class Method Summary collapse
Instance Attribute Details
#error ⇒ Inttegro::Payout::SettingsConflictErrorEnvelopeErrorVariant1, Inttegro::Payout::SettingsConflictErrorEnvelopeErrorVariant2 (readonly)
Value of the error field in the Inttegro API payload.
Required in the API payload. Wire name: error.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/inttegro/payout/settings_conflict_error_envelope.rb', line 25 class SettingsConflictErrorEnvelope < T::Struct const :error, T.any(Inttegro::Payout::SettingsConflictErrorEnvelopeErrorVariant1, Inttegro::Payout::SettingsConflictErrorEnvelopeErrorVariant2) extend T::Sig sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) } def self.from_hash(hash, strict = false) data = hash.dup if (error_value = data["error"]).is_a?(Hash) data["error"] = case error_value["cause"] when "idempotency_in_progress" Inttegro::Payout::SettingsConflictErrorEnvelopeErrorVariant1.from_hash(error_value) when "resource_locked" Inttegro::Payout::SettingsConflictErrorEnvelopeErrorVariant2.from_hash(error_value) else error_value end end super(data, strict) end end |
Class Method Details
.from_hash(hash, strict = false) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/inttegro/payout/settings_conflict_error_envelope.rb', line 31 def self.from_hash(hash, strict = false) data = hash.dup if (error_value = data["error"]).is_a?(Hash) data["error"] = case error_value["cause"] when "idempotency_in_progress" Inttegro::Payout::SettingsConflictErrorEnvelopeErrorVariant1.from_hash(error_value) when "resource_locked" Inttegro::Payout::SettingsConflictErrorEnvelopeErrorVariant2.from_hash(error_value) else error_value end end super(data, strict) end |