Class: Inttegro::Payout::SettingsAuthenticationErrorEnvelope
- Inherits:
-
T::Struct
- Object
- T::Struct
- Inttegro::Payout::SettingsAuthenticationErrorEnvelope
- Extended by:
- T::Sig
- Defined in:
- lib/inttegro/payout/settings_authentication_error_envelope.rb
Overview
Typed representation of the settings authentication 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::SettingsAuthenticationErrorEnvelopeErrorVariant1, Inttegro::Payout::SettingsAuthenticationErrorEnvelopeErrorVariant2
readonly
Value of the
errorfield in the Inttegro API payload.
Class Method Summary collapse
Instance Attribute Details
#error ⇒ Inttegro::Payout::SettingsAuthenticationErrorEnvelopeErrorVariant1, Inttegro::Payout::SettingsAuthenticationErrorEnvelopeErrorVariant2 (readonly)
Value of the error field in the Inttegro API payload.
Required in the API payload. Wire name: error.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/inttegro/payout/settings_authentication_error_envelope.rb', line 26 class SettingsAuthenticationErrorEnvelope < T::Struct const :error, T.any(Inttegro::Payout::SettingsAuthenticationErrorEnvelopeErrorVariant1, Inttegro::Payout::SettingsAuthenticationErrorEnvelopeErrorVariant2) 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["code"] when "authentication_failed" Inttegro::Payout::SettingsAuthenticationErrorEnvelopeErrorVariant1.from_hash(error_value) when "endpoint_authentication_required" Inttegro::Payout::SettingsAuthenticationErrorEnvelopeErrorVariant2.from_hash(error_value) else error_value end end super(data, strict) end end |
Class Method Details
.from_hash(hash, strict = false) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/inttegro/payout/settings_authentication_error_envelope.rb', line 32 def self.from_hash(hash, strict = false) data = hash.dup if (error_value = data["error"]).is_a?(Hash) data["error"] = case error_value["code"] when "authentication_failed" Inttegro::Payout::SettingsAuthenticationErrorEnvelopeErrorVariant1.from_hash(error_value) when "endpoint_authentication_required" Inttegro::Payout::SettingsAuthenticationErrorEnvelopeErrorVariant2.from_hash(error_value) else error_value end end super(data, strict) end |