Class: Pago::V2026_04::Models::BenefitGrantDiscordProperties

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])
{
  account_id: "account_id",
  guild_id: "guild_id",
  role_id: "role_id",
  granted_account_id: "granted_account_id"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
[].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(account_id: ::Pago::UNSET, guild_id: ::Pago::UNSET, role_id: ::Pago::UNSET, granted_account_id: ::Pago::UNSET) ⇒ BenefitGrantDiscordProperties

Returns a new instance of BenefitGrantDiscordProperties.

Parameters:

  • account_id: (String, nil) (defaults to: ::Pago::UNSET)
  • guild_id: (String, nil) (defaults to: ::Pago::UNSET)
  • role_id: (String, nil) (defaults to: ::Pago::UNSET)
  • granted_account_id: (String, nil) (defaults to: ::Pago::UNSET)


4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
# File 'lib/pago/v2026_04/models.rb', line 4958

def initialize(
  account_id: ::Pago::UNSET,
  guild_id: ::Pago::UNSET,
  role_id: ::Pago::UNSET,
  granted_account_id: ::Pago::UNSET
)
  super()
  assign(:account_id, )
  assign(:guild_id, guild_id)
  assign(:role_id, role_id)
  assign(:granted_account_id, )
end

Instance Attribute Details

#account_idString? (readonly)

Returns:

  • (String, nil)


4947
4948
4949
# File 'lib/pago/v2026_04/models.rb', line 4947

def 
  @account_id
end

#granted_account_idString (readonly)

Returns:

  • (String)


4956
4957
4958
# File 'lib/pago/v2026_04/models.rb', line 4956

def 
  @granted_account_id
end

#guild_idString (readonly)

Returns:

  • (String)


4950
4951
4952
# File 'lib/pago/v2026_04/models.rb', line 4950

def guild_id
  @guild_id
end

#role_idString (readonly)

Returns:

  • (String)


4953
4954
4955
# File 'lib/pago/v2026_04/models.rb', line 4953

def role_id
  @role_id
end

Class Method Details

.from_json(data) ⇒ BenefitGrantDiscordProperties?

Parameters:

  • data (Hash, String, nil)

Returns:



4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
# File 'lib/pago/v2026_04/models.rb', line 4973

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(
      account_id: (data.key?("account_id") ? data["account_id"] : ::Pago::UNSET),
      guild_id: (data.key?("guild_id") ? data["guild_id"] : ::Pago::UNSET),
      role_id: (data.key?("role_id") ? data["role_id"] : ::Pago::UNSET),
      granted_account_id: (data.key?("granted_account_id") ? data["granted_account_id"] : ::Pago::UNSET)
    ),
    data
  )
end