Class: Pago::V2026_04::Models::BenefitDiscord

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

Overview

A benefit of type discord.

Use it to automatically invite your backers to a Discord server.

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",
  metadata: "metadata",
  visibility: "visibility",
  properties: "properties",
  visibility_configurable: "visibility_configurable"
}.freeze
REQUIRED_KEYS =

Returns:

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

Returns a new instance of BenefitDiscord.

Parameters:

  • id: (String)
  • created_at: (String)
  • modified_at: (String, nil)
  • type: (String)
  • description: (String)
  • selectable: (Boolean)
  • deletable: (Boolean)
  • is_deleted: (Boolean)
  • organization_id: (String)
  • metadata: (Hash[String, untyped])
  • visibility: (String)
  • properties: (Models::BenefitDiscordProperties)
  • visibility_configurable: (Boolean)


2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
# File 'lib/pago/v2026_04/models.rb', line 2670

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

Instance Attribute Details

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


2629
2630
2631
# File 'lib/pago/v2026_04/models.rb', line 2629

def created_at
  @created_at
end

#deletableBoolean (readonly)

Whether the benefit is deletable.

Returns:

  • (Boolean)


2648
2649
2650
# File 'lib/pago/v2026_04/models.rb', line 2648

def deletable
  @deletable
end

#descriptionString (readonly)

The description of the benefit.

Returns:

  • (String)


2640
2641
2642
# File 'lib/pago/v2026_04/models.rb', line 2640

def description
  @description
end

#idString (readonly)

The ID of the benefit.

Returns:

  • (String)


2625
2626
2627
# File 'lib/pago/v2026_04/models.rb', line 2625

def id
  @id
end

#is_deletedBoolean (readonly)

Whether the benefit is deleted.

Returns:

  • (Boolean)


2652
2653
2654
# File 'lib/pago/v2026_04/models.rb', line 2652

def is_deleted
  @is_deleted
end

#metadataHash{String => String, Integer, Float, Boolean} (readonly)

Returns:

  • (Hash{String => String, Integer, Float, Boolean})


2659
2660
2661
# File 'lib/pago/v2026_04/models.rb', line 2659

def 
  @metadata
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


2633
2634
2635
# File 'lib/pago/v2026_04/models.rb', line 2633

def modified_at
  @modified_at
end

#organization_idString (readonly)

The ID of the organization owning the benefit.

Returns:

  • (String)


2656
2657
2658
# File 'lib/pago/v2026_04/models.rb', line 2656

def organization_id
  @organization_id
end

#propertiesModels::BenefitDiscordProperties (readonly)



2665
2666
2667
# File 'lib/pago/v2026_04/models.rb', line 2665

def properties
  @properties
end

#selectableBoolean (readonly)

Whether the benefit is selectable when creating a product.

Returns:

  • (Boolean)


2644
2645
2646
# File 'lib/pago/v2026_04/models.rb', line 2644

def selectable
  @selectable
end

#typeString (readonly)

Returns:

  • (String)


2636
2637
2638
# File 'lib/pago/v2026_04/models.rb', line 2636

def type
  @type
end

#visibilityString (readonly)

Returns:

  • (String)


2662
2663
2664
# File 'lib/pago/v2026_04/models.rb', line 2662

def visibility
  @visibility
end

#visibility_configurableBoolean (readonly)

Returns:

  • (Boolean)


2668
2669
2670
# File 'lib/pago/v2026_04/models.rb', line 2668

def visibility_configurable
  @visibility_configurable
end

Class Method Details

.from_json(data) ⇒ BenefitDiscord?

Parameters:

  • data (Hash, String, nil)

Returns:



2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
# File 'lib/pago/v2026_04/models.rb', line 2703

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),
      metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET),
      visibility: (data.key?("visibility") ? data["visibility"] : ::Pago::UNSET),
      properties: (data.key?("properties") ? Models::BenefitDiscordProperties.from_json(data["properties"]) : ::Pago::UNSET),
      visibility_configurable: (data.key?("visibility_configurable") ? data["visibility_configurable"] : ::Pago::UNSET)
    ),
    data
  )
end