Class: Pago::V2026_04::Models::CustomerStateBenefitGrant
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Overview
An active benefit grant for a customer.
Constant Summary collapse
- JSON_KEYS =
{ id: "id", created_at: "created_at", modified_at: "modified_at", granted_at: "granted_at", benefit_id: "benefit_id", benefit_type: "benefit_type", benefit_metadata: "benefit_metadata", properties: "properties" }.freeze
- REQUIRED_KEYS =
["id", "created_at", "modified_at", "granted_at", "benefit_id", "benefit_type", "benefit_metadata", "properties"].freeze
Instance Attribute Summary collapse
-
#benefit_id ⇒ String
readonly
The ID of the benefit concerned by this grant.
- #benefit_metadata ⇒ Hash{String => String, Integer, Float, Boolean} readonly
- #benefit_type ⇒ String readonly
-
#created_at ⇒ String
readonly
Creation timestamp of the object.
-
#granted_at ⇒ String
readonly
The timestamp when the benefit was granted.
-
#id ⇒ String
readonly
The ID of the grant.
-
#modified_at ⇒ String?
readonly
Last modification timestamp of the object.
- #properties ⇒ Models::BenefitGrantDiscordProperties, ... readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, created_at:, modified_at:, granted_at:, benefit_id:, benefit_type:, benefit_metadata:, properties:) ⇒ CustomerStateBenefitGrant
constructor
A new instance of CustomerStateBenefitGrant.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(id:, created_at:, modified_at:, granted_at:, benefit_id:, benefit_type:, benefit_metadata:, properties:) ⇒ CustomerStateBenefitGrant
Returns a new instance of CustomerStateBenefitGrant.
19963 19964 19965 19966 19967 19968 19969 19970 19971 19972 19973 19974 19975 19976 19977 19978 19979 19980 19981 19982 |
# File 'lib/pago/v2026_04/models.rb', line 19963 def initialize( id:, created_at:, modified_at:, granted_at:, benefit_id:, benefit_type:, benefit_metadata:, properties: ) super() assign(:id, id) assign(:created_at, created_at) assign(:modified_at, modified_at) assign(:granted_at, granted_at) assign(:benefit_id, benefit_id) assign(:benefit_type, benefit_type) assign(:benefit_metadata, ) assign(:properties, properties) end |
Instance Attribute Details
#benefit_id ⇒ String (readonly)
The ID of the benefit concerned by this grant.
19952 19953 19954 |
# File 'lib/pago/v2026_04/models.rb', line 19952 def benefit_id @benefit_id end |
#benefit_metadata ⇒ Hash{String => String, Integer, Float, Boolean} (readonly)
19958 19959 19960 |
# File 'lib/pago/v2026_04/models.rb', line 19958 def @benefit_metadata end |
#benefit_type ⇒ String (readonly)
19955 19956 19957 |
# File 'lib/pago/v2026_04/models.rb', line 19955 def benefit_type @benefit_type end |
#created_at ⇒ String (readonly)
Creation timestamp of the object.
19940 19941 19942 |
# File 'lib/pago/v2026_04/models.rb', line 19940 def created_at @created_at end |
#granted_at ⇒ String (readonly)
The timestamp when the benefit was granted.
19948 19949 19950 |
# File 'lib/pago/v2026_04/models.rb', line 19948 def granted_at @granted_at end |
#id ⇒ String (readonly)
The ID of the grant.
19936 19937 19938 |
# File 'lib/pago/v2026_04/models.rb', line 19936 def id @id end |
#modified_at ⇒ String? (readonly)
Last modification timestamp of the object.
19944 19945 19946 |
# File 'lib/pago/v2026_04/models.rb', line 19944 def modified_at @modified_at end |
#properties ⇒ Models::BenefitGrantDiscordProperties, ... (readonly)
19961 19962 19963 |
# File 'lib/pago/v2026_04/models.rb', line 19961 def properties @properties end |
Class Method Details
.from_json(data) ⇒ CustomerStateBenefitGrant?
19986 19987 19988 19989 19990 19991 19992 19993 19994 19995 19996 19997 19998 19999 20000 20001 20002 20003 20004 |
# File 'lib/pago/v2026_04/models.rb', line 19986 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( id: (data.key?("id") ? data["id"] : ::Pago::UNSET), created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET), modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET), granted_at: (data.key?("granted_at") ? data["granted_at"] : ::Pago::UNSET), benefit_id: (data.key?("benefit_id") ? data["benefit_id"] : ::Pago::UNSET), benefit_type: (data.key?("benefit_type") ? data["benefit_type"] : ::Pago::UNSET), benefit_metadata: (data.key?("benefit_metadata") ? data["benefit_metadata"] : ::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 |