Class: Pago::V2026_04::Models::BenefitLicenseKeysSubscriber

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])
{
  id: "id",
  created_at: "created_at",
  modified_at: "modified_at",
  type: "type",
  description: "description",
  selectable: "selectable",
  deletable: "deletable",
  is_deleted: "is_deleted",
  organization_id: "organization_id",
  organization: "organization",
  properties: "properties"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["id", "created_at", "modified_at", "type", "description", "selectable", "deletable", "is_deleted", "organization_id", "organization", "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(id:, created_at:, modified_at:, type:, description:, selectable:, deletable:, is_deleted:, organization_id:, organization:, properties:) ⇒ BenefitLicenseKeysSubscriber

Returns a new instance of BenefitLicenseKeysSubscriber.

Parameters:



7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
# File 'lib/pago/v2026_04/models.rb', line 7130

def initialize(
  id:,
  created_at:,
  modified_at:,
  type:,
  description:,
  selectable:,
  deletable:,
  is_deleted:,
  organization_id:,
  organization:,
  properties:
)
  super()
  assign(:id, id)
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:type, type)
  assign(:description, description)
  assign(:selectable, selectable)
  assign(:deletable, deletable)
  assign(:is_deleted, is_deleted)
  assign(:organization_id, organization_id)
  assign(:organization, organization)
  assign(:properties, properties)
end

Instance Attribute Details

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


7095
7096
7097
# File 'lib/pago/v2026_04/models.rb', line 7095

def created_at
  @created_at
end

#deletableBoolean (readonly)

Whether the benefit is deletable.

Returns:

  • (Boolean)


7114
7115
7116
# File 'lib/pago/v2026_04/models.rb', line 7114

def deletable
  @deletable
end

#descriptionString (readonly)

The description of the benefit.

Returns:

  • (String)


7106
7107
7108
# File 'lib/pago/v2026_04/models.rb', line 7106

def description
  @description
end

#idString (readonly)

The ID of the benefit.

Returns:

  • (String)


7091
7092
7093
# File 'lib/pago/v2026_04/models.rb', line 7091

def id
  @id
end

#is_deletedBoolean (readonly)

Whether the benefit is deleted.

Returns:

  • (Boolean)


7118
7119
7120
# File 'lib/pago/v2026_04/models.rb', line 7118

def is_deleted
  @is_deleted
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


7099
7100
7101
# File 'lib/pago/v2026_04/models.rb', line 7099

def modified_at
  @modified_at
end

#organizationModels::BenefitSubscriberOrganization (readonly)



7125
7126
7127
# File 'lib/pago/v2026_04/models.rb', line 7125

def organization
  @organization
end

#organization_idString (readonly)

The ID of the organization owning the benefit.

Returns:

  • (String)


7122
7123
7124
# File 'lib/pago/v2026_04/models.rb', line 7122

def organization_id
  @organization_id
end

#propertiesModels::BenefitLicenseKeysSubscriberProperties (readonly)



7128
7129
7130
# File 'lib/pago/v2026_04/models.rb', line 7128

def properties
  @properties
end

#selectableBoolean (readonly)

Whether the benefit is selectable when creating a product.

Returns:

  • (Boolean)


7110
7111
7112
# File 'lib/pago/v2026_04/models.rb', line 7110

def selectable
  @selectable
end

#typeString (readonly)

Returns:

  • (String)


7102
7103
7104
# File 'lib/pago/v2026_04/models.rb', line 7102

def type
  @type
end

Class Method Details

.from_json(data) ⇒ BenefitLicenseKeysSubscriber?

Parameters:

  • data (Hash, String, nil)

Returns:



7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
# File 'lib/pago/v2026_04/models.rb', line 7159

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),
      type: (data.key?("type") ? data["type"] : ::Pago::UNSET),
      description: (data.key?("description") ? data["description"] : ::Pago::UNSET),
      selectable: (data.key?("selectable") ? data["selectable"] : ::Pago::UNSET),
      deletable: (data.key?("deletable") ? data["deletable"] : ::Pago::UNSET),
      is_deleted: (data.key?("is_deleted") ? data["is_deleted"] : ::Pago::UNSET),
      organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET),
      organization: (data.key?("organization") ? Models::BenefitSubscriberOrganization.from_json(data["organization"]) : ::Pago::UNSET),
      properties: (data.key?("properties") ? Models::BenefitLicenseKeysSubscriberProperties.from_json(data["properties"]) : ::Pago::UNSET)
    ),
    data
  )
end