Class: Pago::V2026_04::Models::BenefitDownloadablesSubscriber

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:) ⇒ BenefitDownloadablesSubscriber

Returns a new instance of BenefitDownloadablesSubscriber.

Parameters:



3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
# File 'lib/pago/v2026_04/models.rb', line 3465

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)


3430
3431
3432
# File 'lib/pago/v2026_04/models.rb', line 3430

def created_at
  @created_at
end

#deletableBoolean (readonly)

Whether the benefit is deletable.

Returns:

  • (Boolean)


3449
3450
3451
# File 'lib/pago/v2026_04/models.rb', line 3449

def deletable
  @deletable
end

#descriptionString (readonly)

The description of the benefit.

Returns:

  • (String)


3441
3442
3443
# File 'lib/pago/v2026_04/models.rb', line 3441

def description
  @description
end

#idString (readonly)

The ID of the benefit.

Returns:

  • (String)


3426
3427
3428
# File 'lib/pago/v2026_04/models.rb', line 3426

def id
  @id
end

#is_deletedBoolean (readonly)

Whether the benefit is deleted.

Returns:

  • (Boolean)


3453
3454
3455
# File 'lib/pago/v2026_04/models.rb', line 3453

def is_deleted
  @is_deleted
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


3434
3435
3436
# File 'lib/pago/v2026_04/models.rb', line 3434

def modified_at
  @modified_at
end

#organizationModels::BenefitSubscriberOrganization (readonly)



3460
3461
3462
# File 'lib/pago/v2026_04/models.rb', line 3460

def organization
  @organization
end

#organization_idString (readonly)

The ID of the organization owning the benefit.

Returns:

  • (String)


3457
3458
3459
# File 'lib/pago/v2026_04/models.rb', line 3457

def organization_id
  @organization_id
end

#propertiesModels::BenefitDownloadablesSubscriberProperties (readonly)



3463
3464
3465
# File 'lib/pago/v2026_04/models.rb', line 3463

def properties
  @properties
end

#selectableBoolean (readonly)

Whether the benefit is selectable when creating a product.

Returns:

  • (Boolean)


3445
3446
3447
# File 'lib/pago/v2026_04/models.rb', line 3445

def selectable
  @selectable
end

#typeString (readonly)

Returns:

  • (String)


3437
3438
3439
# File 'lib/pago/v2026_04/models.rb', line 3437

def type
  @type
end

Class Method Details

.from_json(data) ⇒ BenefitDownloadablesSubscriber?

Parameters:

  • data (Hash, String, nil)

Returns:



3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
# File 'lib/pago/v2026_04/models.rb', line 3494

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::BenefitDownloadablesSubscriberProperties.from_json(data["properties"]) : ::Pago::UNSET)
    ),
    data
  )
end