Class: Pago::V2026_04::Models::BenefitPublic

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"
}.freeze
REQUIRED_KEYS =

Returns:

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

Returns a new instance of BenefitPublic.

Parameters:

  • id: (String)
  • created_at: (String)
  • modified_at: (String, nil)
  • type: (String)
  • description: (String)
  • selectable: (Boolean)
  • deletable: (Boolean)
  • is_deleted: (Boolean)
  • organization_id: (String)


7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
# File 'lib/pago/v2026_04/models.rb', line 7891

def initialize(
  id:,
  created_at:,
  modified_at:,
  type:,
  description:,
  selectable:,
  deletable:,
  is_deleted:,
  organization_id:
)
  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)
end

Instance Attribute Details

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


7862
7863
7864
# File 'lib/pago/v2026_04/models.rb', line 7862

def created_at
  @created_at
end

#deletableBoolean (readonly)

Whether the benefit is deletable.

Returns:

  • (Boolean)


7881
7882
7883
# File 'lib/pago/v2026_04/models.rb', line 7881

def deletable
  @deletable
end

#descriptionString (readonly)

The description of the benefit.

Returns:

  • (String)


7873
7874
7875
# File 'lib/pago/v2026_04/models.rb', line 7873

def description
  @description
end

#idString (readonly)

The ID of the benefit.

Returns:

  • (String)


7858
7859
7860
# File 'lib/pago/v2026_04/models.rb', line 7858

def id
  @id
end

#is_deletedBoolean (readonly)

Whether the benefit is deleted.

Returns:

  • (Boolean)


7885
7886
7887
# File 'lib/pago/v2026_04/models.rb', line 7885

def is_deleted
  @is_deleted
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


7866
7867
7868
# File 'lib/pago/v2026_04/models.rb', line 7866

def modified_at
  @modified_at
end

#organization_idString (readonly)

The ID of the organization owning the benefit.

Returns:

  • (String)


7889
7890
7891
# File 'lib/pago/v2026_04/models.rb', line 7889

def organization_id
  @organization_id
end

#selectableBoolean (readonly)

Whether the benefit is selectable when creating a product.

Returns:

  • (Boolean)


7877
7878
7879
# File 'lib/pago/v2026_04/models.rb', line 7877

def selectable
  @selectable
end

#typeString (readonly)

Returns:

  • (String)


7869
7870
7871
# File 'lib/pago/v2026_04/models.rb', line 7869

def type
  @type
end

Class Method Details

.from_json(data) ⇒ BenefitPublic?

Parameters:

  • data (Hash, String, nil)

Returns:



7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
# File 'lib/pago/v2026_04/models.rb', line 7916

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)
    ),
    data
  )
end