Class: Inttegro::Application::CapabilityProjection
- Inherits:
-
T::Struct
- Object
- T::Struct
- Inttegro::Application::CapabilityProjection
- Extended by:
- T::Sig
- Defined in:
- lib/inttegro/app/capability_projection.rb
Overview
Public capability states currently available to the application. Newly created applications can return an empty object until capabilities become available.
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
-
#payments ⇒ Inttegro::Application::EnabledCapability, ...
readonly
Value of the
paymentsfield in the Inttegro API payload. -
#payouts ⇒ Inttegro::Application::EnabledCapability, ...
readonly
Value of the
payoutsfield in the Inttegro API payload.
Class Method Summary collapse
Instance Attribute Details
#payments ⇒ Inttegro::Application::EnabledCapability, ... (readonly)
Value of the payments field in the Inttegro API payload.
Optional in the API payload; omitted values default to nil. Wire name: payments.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/inttegro/app/capability_projection.rb', line 33 class CapabilityProjection < T::Struct const :payments, T.nilable(T.any(Inttegro::Application::EnabledCapability, Inttegro::Application::RestrictedCapability)), default: nil const :payouts, T.nilable(T.any(Inttegro::Application::EnabledCapability, Inttegro::Application::RestrictedCapability, Inttegro::Application::PendingReviewCapability)), default: nil 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 (payments_value = data["payments"]).is_a?(Hash) data["payments"] = case payments_value["status"] when "enabled" Inttegro::Application::EnabledCapability.from_hash(payments_value) when "restricted" Inttegro::Application::RestrictedCapability.from_hash(payments_value) else payments_value end end if (payouts_value = data["payouts"]).is_a?(Hash) data["payouts"] = case payouts_value["status"] when "enabled" Inttegro::Application::EnabledCapability.from_hash(payouts_value) when "restricted" Inttegro::Application::RestrictedCapability.from_hash(payouts_value) when "pending_review" Inttegro::Application::PendingReviewCapability.from_hash(payouts_value) else payouts_value end end super(data, strict) end end |
#payouts ⇒ Inttegro::Application::EnabledCapability, ... (readonly)
Value of the payouts field in the Inttegro API payload.
Optional in the API payload; omitted values default to nil. Wire name: payouts.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/inttegro/app/capability_projection.rb', line 33 class CapabilityProjection < T::Struct const :payments, T.nilable(T.any(Inttegro::Application::EnabledCapability, Inttegro::Application::RestrictedCapability)), default: nil const :payouts, T.nilable(T.any(Inttegro::Application::EnabledCapability, Inttegro::Application::RestrictedCapability, Inttegro::Application::PendingReviewCapability)), default: nil 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 (payments_value = data["payments"]).is_a?(Hash) data["payments"] = case payments_value["status"] when "enabled" Inttegro::Application::EnabledCapability.from_hash(payments_value) when "restricted" Inttegro::Application::RestrictedCapability.from_hash(payments_value) else payments_value end end if (payouts_value = data["payouts"]).is_a?(Hash) data["payouts"] = case payouts_value["status"] when "enabled" Inttegro::Application::EnabledCapability.from_hash(payouts_value) when "restricted" Inttegro::Application::RestrictedCapability.from_hash(payouts_value) when "pending_review" Inttegro::Application::PendingReviewCapability.from_hash(payouts_value) else payouts_value end end super(data, strict) end end |
Class Method Details
.from_hash(hash, strict = false) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/inttegro/app/capability_projection.rb', line 40 def self.from_hash(hash, strict = false) data = hash.dup if (payments_value = data["payments"]).is_a?(Hash) data["payments"] = case payments_value["status"] when "enabled" Inttegro::Application::EnabledCapability.from_hash(payments_value) when "restricted" Inttegro::Application::RestrictedCapability.from_hash(payments_value) else payments_value end end if (payouts_value = data["payouts"]).is_a?(Hash) data["payouts"] = case payouts_value["status"] when "enabled" Inttegro::Application::EnabledCapability.from_hash(payouts_value) when "restricted" Inttegro::Application::RestrictedCapability.from_hash(payouts_value) when "pending_review" Inttegro::Application::PendingReviewCapability.from_hash(payouts_value) else payouts_value end end super(data, strict) end |