Class: Pago::V2026_04::Models::EventTypeWithStats

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",
  name: "name",
  label: "label",
  label_property_selector: "label_property_selector",
  organization_id: "organization_id",
  source: "source",
  occurrences: "occurrences",
  first_seen: "first_seen",
  last_seen: "last_seen"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["name", "label", "organization_id", "source", "occurrences", "first_seen", "last_seen"].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: ::Pago::UNSET, created_at: ::Pago::UNSET, modified_at: ::Pago::UNSET, name:, label:, label_property_selector: ::Pago::UNSET, organization_id:, source:, occurrences:, first_seen:, last_seen:) ⇒ EventTypeWithStats

Returns a new instance of EventTypeWithStats.

Parameters:

  • id: (String, nil) (defaults to: ::Pago::UNSET)
  • created_at: (String, nil) (defaults to: ::Pago::UNSET)
  • modified_at: (String, nil) (defaults to: ::Pago::UNSET)
  • name: (String)
  • label: (String)
  • label_property_selector: (String, nil) (defaults to: ::Pago::UNSET)
  • organization_id: (String)
  • source: (String)
  • occurrences: (Integer)
  • first_seen: (String)
  • last_seen: (String)


25251
25252
25253
25254
25255
25256
25257
25258
25259
25260
25261
25262
25263
25264
25265
25266
25267
25268
25269
25270
25271
25272
25273
25274
25275
25276
# File 'lib/pago/v2026_04/models.rb', line 25251

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

Instance Attribute Details

#created_atString? (readonly)

Creation timestamp of the event type. Null for system event types.

Returns:

  • (String, nil)


25214
25215
25216
# File 'lib/pago/v2026_04/models.rb', line 25214

def created_at
  @created_at
end

#first_seenString (readonly)

The first time the event occurred.

Returns:

  • (String)


25245
25246
25247
# File 'lib/pago/v2026_04/models.rb', line 25245

def first_seen
  @first_seen
end

#idString? (readonly)

The ID of the event type. Null for system event types.

Returns:

  • (String, nil)


25210
25211
25212
# File 'lib/pago/v2026_04/models.rb', line 25210

def id
  @id
end

#labelString (readonly)

The label for the event type.

Returns:

  • (String)


25226
25227
25228
# File 'lib/pago/v2026_04/models.rb', line 25226

def label
  @label
end

#label_property_selectorString? (readonly)

Property path to extract dynamic label from event metadata.

Returns:

  • (String, nil)


25230
25231
25232
# File 'lib/pago/v2026_04/models.rb', line 25230

def label_property_selector
  @label_property_selector
end

#last_seenString (readonly)

The last time the event occurred.

Returns:

  • (String)


25249
25250
25251
# File 'lib/pago/v2026_04/models.rb', line 25249

def last_seen
  @last_seen
end

#modified_atString? (readonly)

Last modification timestamp of the event type. Null for system event types.

Returns:

  • (String, nil)


25218
25219
25220
# File 'lib/pago/v2026_04/models.rb', line 25218

def modified_at
  @modified_at
end

#nameString (readonly)

The name of the event type.

Returns:

  • (String)


25222
25223
25224
# File 'lib/pago/v2026_04/models.rb', line 25222

def name
  @name
end

#occurrencesInteger (readonly)

Number of times the event has occurred.

Returns:

  • (Integer)


25241
25242
25243
# File 'lib/pago/v2026_04/models.rb', line 25241

def occurrences
  @occurrences
end

#organization_idString (readonly)

The ID of the organization owning the event type.

Returns:

  • (String)


25234
25235
25236
# File 'lib/pago/v2026_04/models.rb', line 25234

def organization_id
  @organization_id
end

#sourceString (readonly)

Returns:

  • (String)


25237
25238
25239
# File 'lib/pago/v2026_04/models.rb', line 25237

def source
  @source
end

Class Method Details

.from_json(data) ⇒ EventTypeWithStats?

Parameters:

  • data (Hash, String, nil)

Returns:



25280
25281
25282
25283
25284
25285
25286
25287
25288
25289
25290
25291
25292
25293
25294
25295
25296
25297
25298
25299
25300
25301
# File 'lib/pago/v2026_04/models.rb', line 25280

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),
      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),
      source: (data.key?("source") ? data["source"] : ::Pago::UNSET),
      occurrences: (data.key?("occurrences") ? data["occurrences"] : ::Pago::UNSET),
      first_seen: (data.key?("first_seen") ? data["first_seen"] : ::Pago::UNSET),
      last_seen: (data.key?("last_seen") ? data["last_seen"] : ::Pago::UNSET)
    ),
    data
  )
end