Class: Pago::V2026_04::Models::BenefitGrantDiscordWebhook

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  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",
  previous_properties: "previous_properties"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["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

Class Method Summary collapse

Instance Method Summary collapse

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:, previous_properties: ::Pago::UNSET) ⇒ BenefitGrantDiscordWebhook

Returns a new instance of BenefitGrantDiscordWebhook.

Parameters:

  • created_at: (String)
  • modified_at: (String, nil)
  • id: (String)
  • granted_at: (String, nil) (defaults to: ::Pago::UNSET)
  • is_granted: (Boolean)
  • revoked_at: (String, nil) (defaults to: ::Pago::UNSET)
  • is_revoked: (Boolean)
  • subscription_id: (String, nil)
  • order_id: (String, nil)
  • customer_id: (String)
  • member_id: (String, nil) (defaults to: ::Pago::UNSET)
  • benefit_id: (String)
  • error: (Models::BenefitGrantError, nil) (defaults to: ::Pago::UNSET)
  • customer: (Object)
  • member: (Models::Member, nil) (defaults to: ::Pago::UNSET)
  • benefit: (Models::BenefitDiscord)
  • properties: (Models::BenefitGrantDiscordProperties)
  • previous_properties: (Models::BenefitGrantDiscordProperties, nil) (defaults to: ::Pago::UNSET)


5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
# File 'lib/pago/v2026_04/models.rb', line 5080

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:,
  previous_properties: ::Pago::UNSET
)
  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)
  assign(:previous_properties, previous_properties)
end

Instance Attribute Details

#benefitModels::BenefitDiscord (readonly)



5072
5073
5074
# File 'lib/pago/v2026_04/models.rb', line 5072

def benefit
  @benefit
end

#benefit_idString (readonly)

The ID of the benefit concerned by this grant.

Returns:

  • (String)


5059
5060
5061
# File 'lib/pago/v2026_04/models.rb', line 5059

def benefit_id
  @benefit_id
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


5015
5016
5017
# File 'lib/pago/v2026_04/models.rb', line 5015

def created_at
  @created_at
end

#customerObject (readonly)

Returns:

  • (Object)


5066
5067
5068
# File 'lib/pago/v2026_04/models.rb', line 5066

def customer
  @customer
end

#customer_idString (readonly)

The ID of the customer concerned by this grant.

Returns:

  • (String)


5051
5052
5053
# File 'lib/pago/v2026_04/models.rb', line 5051

def customer_id
  @customer_id
end

#errorModels::BenefitGrantError? (readonly)

The error information if the benefit grant failed with an unrecoverable error.

Returns:



5063
5064
5065
# File 'lib/pago/v2026_04/models.rb', line 5063

def error
  @error
end

#granted_atString? (readonly)

The timestamp when the benefit was granted. If None, the benefit is not granted.

Returns:

  • (String, nil)


5027
5028
5029
# File 'lib/pago/v2026_04/models.rb', line 5027

def granted_at
  @granted_at
end

#idString (readonly)

The ID of the grant.

Returns:

  • (String)


5023
5024
5025
# File 'lib/pago/v2026_04/models.rb', line 5023

def id
  @id
end

#is_grantedBoolean (readonly)

Whether the benefit is granted.

Returns:

  • (Boolean)


5031
5032
5033
# File 'lib/pago/v2026_04/models.rb', line 5031

def is_granted
  @is_granted
end

#is_revokedBoolean (readonly)

Whether the benefit is revoked.

Returns:

  • (Boolean)


5039
5040
5041
# File 'lib/pago/v2026_04/models.rb', line 5039

def is_revoked
  @is_revoked
end

#memberModels::Member? (readonly)

Returns:



5069
5070
5071
# File 'lib/pago/v2026_04/models.rb', line 5069

def member
  @member
end

#member_idString? (readonly)

The ID of the member concerned by this grant.

Returns:

  • (String, nil)


5055
5056
5057
# File 'lib/pago/v2026_04/models.rb', line 5055

def member_id
  @member_id
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


5019
5020
5021
# File 'lib/pago/v2026_04/models.rb', line 5019

def modified_at
  @modified_at
end

#order_idString? (readonly)

The ID of the order that granted this benefit.

Returns:

  • (String, nil)


5047
5048
5049
# File 'lib/pago/v2026_04/models.rb', line 5047

def order_id
  @order_id
end

#previous_propertiesModels::BenefitGrantDiscordProperties? (readonly)



5078
5079
5080
# File 'lib/pago/v2026_04/models.rb', line 5078

def previous_properties
  @previous_properties
end

#propertiesModels::BenefitGrantDiscordProperties (readonly)



5075
5076
5077
# File 'lib/pago/v2026_04/models.rb', line 5075

def properties
  @properties
end

#revoked_atString? (readonly)

The timestamp when the benefit was revoked. If None, the benefit is not revoked.

Returns:

  • (String, nil)


5035
5036
5037
# File 'lib/pago/v2026_04/models.rb', line 5035

def revoked_at
  @revoked_at
end

#subscription_idString? (readonly)

The ID of the subscription that granted this benefit.

Returns:

  • (String, nil)


5043
5044
5045
# File 'lib/pago/v2026_04/models.rb', line 5043

def subscription_id
  @subscription_id
end

Class Method Details

.from_json(data) ⇒ BenefitGrantDiscordWebhook?

Parameters:

  • data (Hash, String, nil)

Returns:



5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
# File 'lib/pago/v2026_04/models.rb', line 5123

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") ? Models::BenefitDiscord.from_json(data["benefit"]) : ::Pago::UNSET),
      properties: (data.key?("properties") ? Models::BenefitGrantDiscordProperties.from_json(data["properties"]) : ::Pago::UNSET),
      previous_properties: (data.key?("previous_properties") ? Models::BenefitGrantDiscordProperties.from_json(data["previous_properties"]) : ::Pago::UNSET)
    ),
    data
  )
end