Class: Pago::V2026_04::Models::BenefitGrant
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ created_at: "created_at", modified_at: "modified_at", id: "id", granted_at: "granted_at", is_granted: "is_granted", revoked_at: "revoked_at", is_revoked: "is_revoked", subscription_id: "subscription_id", order_id: "order_id", customer_id: "customer_id", member_id: "member_id", benefit_id: "benefit_id", error: "error", customer: "customer", member: "member", benefit: "benefit", properties: "properties" }.freeze
- REQUIRED_KEYS =
["created_at", "modified_at", "id", "is_granted", "is_revoked", "subscription_id", "order_id", "customer_id", "benefit_id", "customer", "benefit", "properties"].freeze
Instance Attribute Summary collapse
- #benefit ⇒ Object readonly
-
#benefit_id ⇒ String
readonly
The ID of the benefit concerned by this grant.
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
- #customer ⇒ Object readonly
-
#customer_id ⇒ String
readonly
The ID of the customer concerned by this grant.
-
#error ⇒ Models::BenefitGrantError?
readonly
The error information if the benefit grant failed with an unrecoverable error.
-
#granted_at ⇒ String?
readonly
The timestamp when the benefit was granted.
-
#id ⇒ String
readonly
The ID of the grant.
-
#is_granted ⇒ Boolean
readonly
Whether the benefit is granted.
-
#is_revoked ⇒ Boolean
readonly
Whether the benefit is revoked.
- #member ⇒ Models::Member? readonly
-
#member_id ⇒ String?
readonly
The ID of the member concerned by this grant.
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
-
#order_id ⇒ String?
readonly
The ID of the order that granted this benefit.
- #properties ⇒ Models::BenefitGrantDiscordProperties, ... readonly
-
#revoked_at ⇒ String?
readonly
The timestamp when the benefit was revoked.
-
#subscription_id ⇒ String?
readonly
The ID of the subscription that granted this benefit.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(created_at:, modified_at:, id:, granted_at: ::Pago::UNSET, is_granted:, revoked_at: ::Pago::UNSET, is_revoked:, subscription_id:, order_id:, customer_id:, member_id: ::Pago::UNSET, benefit_id:, error: ::Pago::UNSET, customer:, member: ::Pago::UNSET, benefit:, properties:) ⇒ BenefitGrant
constructor
A new instance of BenefitGrant.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(created_at:, modified_at:, id:, granted_at: ::Pago::UNSET, is_granted:, revoked_at: ::Pago::UNSET, is_revoked:, subscription_id:, order_id:, customer_id:, member_id: ::Pago::UNSET, benefit_id:, error: ::Pago::UNSET, customer:, member: ::Pago::UNSET, benefit:, properties:) ⇒ BenefitGrant
Returns a new instance of BenefitGrant.
4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 |
# File 'lib/pago/v2026_04/models.rb', line 4682 def initialize( created_at:, modified_at:, id:, granted_at: ::Pago::UNSET, is_granted:, revoked_at: ::Pago::UNSET, is_revoked:, subscription_id:, order_id:, customer_id:, member_id: ::Pago::UNSET, benefit_id:, error: ::Pago::UNSET, customer:, member: ::Pago::UNSET, benefit:, properties: ) super() assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:id, id) assign(:granted_at, granted_at) assign(:is_granted, is_granted) assign(:revoked_at, revoked_at) assign(:is_revoked, is_revoked) assign(:subscription_id, subscription_id) assign(:order_id, order_id) assign(:customer_id, customer_id) assign(:member_id, member_id) assign(:benefit_id, benefit_id) assign(:error, error) assign(:customer, customer) assign(:member, member) assign(:benefit, benefit) assign(:properties, properties) end |
Instance Attribute Details
#benefit ⇒ Object (readonly)
4677 4678 4679 |
# File 'lib/pago/v2026_04/models.rb', line 4677 def benefit @benefit end |
#benefit_id ⇒ String (readonly)
The ID of the benefit concerned by this grant.
4664 4665 4666 |
# File 'lib/pago/v2026_04/models.rb', line 4664 def benefit_id @benefit_id end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
4620 4621 4622 |
# File 'lib/pago/v2026_04/models.rb', line 4620 def created_at @created_at end |
#customer ⇒ Object (readonly)
4671 4672 4673 |
# File 'lib/pago/v2026_04/models.rb', line 4671 def customer @customer end |
#customer_id ⇒ String (readonly)
The ID of the customer concerned by this grant.
4656 4657 4658 |
# File 'lib/pago/v2026_04/models.rb', line 4656 def customer_id @customer_id end |
#error ⇒ Models::BenefitGrantError? (readonly)
The error information if the benefit grant failed with an unrecoverable error.
4668 4669 4670 |
# File 'lib/pago/v2026_04/models.rb', line 4668 def error @error end |
#granted_at ⇒ String? (readonly)
The timestamp when the benefit was granted. If None, the benefit is not granted.
4632 4633 4634 |
# File 'lib/pago/v2026_04/models.rb', line 4632 def granted_at @granted_at end |
#id ⇒ String (readonly)
The ID of the grant.
4628 4629 4630 |
# File 'lib/pago/v2026_04/models.rb', line 4628 def id @id end |
#is_granted ⇒ Boolean (readonly)
Whether the benefit is granted.
4636 4637 4638 |
# File 'lib/pago/v2026_04/models.rb', line 4636 def is_granted @is_granted end |
#is_revoked ⇒ Boolean (readonly)
Whether the benefit is revoked.
4644 4645 4646 |
# File 'lib/pago/v2026_04/models.rb', line 4644 def is_revoked @is_revoked end |
#member ⇒ Models::Member? (readonly)
4674 4675 4676 |
# File 'lib/pago/v2026_04/models.rb', line 4674 def member @member end |
#member_id ⇒ String? (readonly)
The ID of the member concerned by this grant.
4660 4661 4662 |
# File 'lib/pago/v2026_04/models.rb', line 4660 def member_id @member_id end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
4624 4625 4626 |
# File 'lib/pago/v2026_04/models.rb', line 4624 def modified_at @modified_at end |
#order_id ⇒ String? (readonly)
The ID of the order that granted this benefit.
4652 4653 4654 |
# File 'lib/pago/v2026_04/models.rb', line 4652 def order_id @order_id end |
#properties ⇒ Models::BenefitGrantDiscordProperties, ... (readonly)
4680 4681 4682 |
# File 'lib/pago/v2026_04/models.rb', line 4680 def properties @properties end |
#revoked_at ⇒ String? (readonly)
The timestamp when the benefit was revoked. If None, the benefit is not revoked.
4640 4641 4642 |
# File 'lib/pago/v2026_04/models.rb', line 4640 def revoked_at @revoked_at end |
#subscription_id ⇒ String? (readonly)
The ID of the subscription that granted this benefit.
4648 4649 4650 |
# File 'lib/pago/v2026_04/models.rb', line 4648 def subscription_id @subscription_id end |
Class Method Details
.from_json(data) ⇒ BenefitGrant?
4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 |
# File 'lib/pago/v2026_04/models.rb', line 4723 def self.from_json(data) data = ::JSON.parse(data) if data.is_a?(String) data = ::Pago::Serde.object(data) return nil if data.nil? wrap_raw( new( created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET), modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET), id: (data.key?("id") ? data["id"] : ::Pago::UNSET), granted_at: (data.key?("granted_at") ? data["granted_at"] : ::Pago::UNSET), is_granted: (data.key?("is_granted") ? data["is_granted"] : ::Pago::UNSET), revoked_at: (data.key?("revoked_at") ? data["revoked_at"] : ::Pago::UNSET), is_revoked: (data.key?("is_revoked") ? data["is_revoked"] : ::Pago::UNSET), subscription_id: (data.key?("subscription_id") ? data["subscription_id"] : ::Pago::UNSET), order_id: (data.key?("order_id") ? data["order_id"] : ::Pago::UNSET), customer_id: (data.key?("customer_id") ? data["customer_id"] : ::Pago::UNSET), member_id: (data.key?("member_id") ? data["member_id"] : ::Pago::UNSET), benefit_id: (data.key?("benefit_id") ? data["benefit_id"] : ::Pago::UNSET), error: (data.key?("error") ? Models::BenefitGrantError.from_json(data["error"]) : ::Pago::UNSET), customer: (data.key?("customer") ? Unions::Customer.from_json(data["customer"]) : ::Pago::UNSET), member: (data.key?("member") ? Models::Member.from_json(data["member"]) : ::Pago::UNSET), benefit: (data.key?("benefit") ? Unions::Benefit.from_json(data["benefit"]) : ::Pago::UNSET), properties: (data.key?("properties") ? ::Pago::Serde.union(data["properties"], variants: [Models::BenefitGrantDiscordProperties, Models::BenefitGrantGitHubRepositoryProperties, Models::BenefitGrantDownloadablesProperties, Models::BenefitGrantLicenseKeysProperties, Models::BenefitGrantCustomProperties, Models::BenefitGrantFeatureFlagProperties, Models::BenefitGrantSlackSharedChannelProperties]) : ::Pago::UNSET) ), data ) end |