Class: Dodopayments::Models::EventInput

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/dodopayments/models/event_input.rb

Defined Under Namespace

Modules: Metadata

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(customer_id: , event_id: , event_name: , metadata: nil, timestamp: nil) ⇒ Object

Some parameter documentations has been truncated, see Dodopayments::Models::EventInput for more details.

Parameters:

  • customer_id (String) (defaults to: )

    customer_id of the customer whose usage needs to be tracked

  • event_id (String) (defaults to: )

    Event Id acts as an idempotency key. Any subsequent requests with the same event

  • event_name (String) (defaults to: )

    Name of the event

  • metadata (Hash{Symbol=>String, Float, Boolean}, nil) (defaults to: nil)

    Custom metadata. Only key value pairs are accepted, objects or arrays submitted

  • timestamp (Time, nil) (defaults to: nil)

    Custom Timestamp. Defaults to current timestamp in UTC.



# File 'lib/dodopayments/models/event_input.rb', line 41


Instance Attribute Details

#customer_idString

customer_id of the customer whose usage needs to be tracked

Returns:

  • (String)


10
# File 'lib/dodopayments/models/event_input.rb', line 10

required :customer_id, String

#event_idString

Event Id acts as an idempotency key. Any subsequent requests with the same event_id will be ignored

Returns:

  • (String)


17
# File 'lib/dodopayments/models/event_input.rb', line 17

required :event_id, String

#event_nameString

Name of the event

Returns:

  • (String)


23
# File 'lib/dodopayments/models/event_input.rb', line 23

required :event_name, String

#metadataHash{Symbol=>String, Float, Boolean}?

Custom metadata. Only key value pairs are accepted, objects or arrays submitted will be rejected.

Returns:

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


30
31
32
# File 'lib/dodopayments/models/event_input.rb', line 30

optional :metadata,
-> { Dodopayments::Internal::Type::HashOf[union: Dodopayments::EventInput::] },
nil?: true

#timestampTime?

Custom Timestamp. Defaults to current timestamp in UTC. Timestamps that are older that 1 hour or after 5 mins, from current timestamp, will be rejected.

Returns:

  • (Time, nil)


39
# File 'lib/dodopayments/models/event_input.rb', line 39

optional :timestamp, Time, nil?: true