Class: Pago::V2026_04::Models::EventType

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])
{
  created_at: "created_at",
  modified_at: "modified_at",
  id: "id",
  name: "name",
  label: "label",
  label_property_selector: "label_property_selector",
  organization_id: "organization_id"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["created_at", "modified_at", "id", "name", "label", "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(created_at:, modified_at:, id:, name:, label:, label_property_selector: ::Pago::UNSET, organization_id:) ⇒ EventType

Returns a new instance of EventType.

Parameters:

  • created_at: (String)
  • modified_at: (String, nil)
  • id: (String)
  • name: (String)
  • label: (String)
  • label_property_selector: (String, nil) (defaults to: ::Pago::UNSET)
  • organization_id: (String)


25110
25111
25112
25113
25114
25115
25116
25117
25118
25119
25120
25121
25122
25123
25124
25125
25126
25127
# File 'lib/pago/v2026_04/models.rb', line 25110

def initialize(
  created_at:,
  modified_at:,
  id:,
  name:,
  label:,
  label_property_selector: ::Pago::UNSET,
  organization_id:
)
  super()
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:id, id)
  assign(:name, name)
  assign(:label, label)
  assign(:label_property_selector, label_property_selector)
  assign(:organization_id, organization_id)
end

Instance Attribute Details

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


25084
25085
25086
# File 'lib/pago/v2026_04/models.rb', line 25084

def created_at
  @created_at
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


25092
25093
25094
# File 'lib/pago/v2026_04/models.rb', line 25092

def id
  @id
end

#labelString (readonly)

The label for the event type.

Returns:

  • (String)


25100
25101
25102
# File 'lib/pago/v2026_04/models.rb', line 25100

def label
  @label
end

#label_property_selectorString? (readonly)

Property path to extract dynamic label from event metadata.

Returns:

  • (String, nil)


25104
25105
25106
# File 'lib/pago/v2026_04/models.rb', line 25104

def label_property_selector
  @label_property_selector
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


25088
25089
25090
# File 'lib/pago/v2026_04/models.rb', line 25088

def modified_at
  @modified_at
end

#nameString (readonly)

The name of the event type.

Returns:

  • (String)


25096
25097
25098
# File 'lib/pago/v2026_04/models.rb', line 25096

def name
  @name
end

#organization_idString (readonly)

The ID of the organization owning the event type.

Returns:

  • (String)


25108
25109
25110
# File 'lib/pago/v2026_04/models.rb', line 25108

def organization_id
  @organization_id
end

Class Method Details

.from_json(data) ⇒ EventType?

Parameters:

  • data (Hash, String, nil)

Returns:



25131
25132
25133
25134
25135
25136
25137
25138
25139
25140
25141
25142
25143
25144
25145
25146
25147
25148
# File 'lib/pago/v2026_04/models.rb', line 25131

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(
      created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET),
      modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET),
      id: (data.key?("id") ? data["id"] : ::Pago::UNSET),
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET),
      label: (data.key?("label") ? data["label"] : ::Pago::UNSET),
      label_property_selector: (data.key?("label_property_selector") ? data["label_property_selector"] : ::Pago::UNSET),
      organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET)
    ),
    data
  )
end