Class: Pago::V2026_04::Models::EventName

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

Returns:

  • (Array[String])
["name", "label", "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(name:, label:, source:, occurrences:, first_seen:, last_seen:) ⇒ EventName

Returns a new instance of EventName.

Parameters:

  • name: (String)
  • label: (String)
  • source: (String)
  • occurrences: (Integer)
  • first_seen: (String)
  • last_seen: (String)


25032
25033
25034
25035
25036
25037
25038
25039
25040
25041
25042
25043
25044
25045
25046
25047
# File 'lib/pago/v2026_04/models.rb', line 25032

def initialize(
  name:,
  label:,
  source:,
  occurrences:,
  first_seen:,
  last_seen:
)
  super()
  assign(:name, name)
  assign(:label, label)
  assign(:source, source)
  assign(:occurrences, occurrences)
  assign(:first_seen, first_seen)
  assign(:last_seen, last_seen)
end

Instance Attribute Details

#first_seenString (readonly)

The first time the event occurred.

Returns:

  • (String)


25026
25027
25028
# File 'lib/pago/v2026_04/models.rb', line 25026

def first_seen
  @first_seen
end

#labelString (readonly)

Human readable label of the event.

Returns:

  • (String)


25015
25016
25017
# File 'lib/pago/v2026_04/models.rb', line 25015

def label
  @label
end

#last_seenString (readonly)

The last time the event occurred.

Returns:

  • (String)


25030
25031
25032
# File 'lib/pago/v2026_04/models.rb', line 25030

def last_seen
  @last_seen
end

#nameString (readonly)

The name of the event.

Returns:

  • (String)


25011
25012
25013
# File 'lib/pago/v2026_04/models.rb', line 25011

def name
  @name
end

#occurrencesInteger (readonly)

Number of times the event has occurred.

Returns:

  • (Integer)


25022
25023
25024
# File 'lib/pago/v2026_04/models.rb', line 25022

def occurrences
  @occurrences
end

#sourceString (readonly)

Returns:

  • (String)


25018
25019
25020
# File 'lib/pago/v2026_04/models.rb', line 25018

def source
  @source
end

Class Method Details

.from_json(data) ⇒ EventName?

Parameters:

  • data (Hash, String, nil)

Returns:



25051
25052
25053
25054
25055
25056
25057
25058
25059
25060
25061
25062
25063
25064
25065
25066
25067
# File 'lib/pago/v2026_04/models.rb', line 25051

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(
      name: (data.key?("name") ? data["name"] : ::Pago::UNSET),
      label: (data.key?("label") ? data["label"] : ::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