Class: MetronomeSDK::Models::V1::CustomerPreviewEventsParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/metronome_sdk/models/v1/customer_preview_events_params.rb,
sig/metronome_sdk/models/v1/customer_preview_events_params.rbs

Overview

See Also:

  • MetronomeSDK::Resources::V1::Customers#preview_events

Defined Under Namespace

Modules: Mode Classes: Event

Constant Summary

Constants included from Internal::Type::RequestParameters

Internal::Type::RequestParameters::MetronomeSDK

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(event_type:, properties: nil, timestamp: nil, transaction_id: nil) ⇒ Object

Some parameter documentations has been truncated, see Event for more details.

Parameters:

  • event_type (String)
  • properties (Hash{Symbol=>Object}) (defaults to: nil)
  • timestamp (String) (defaults to: nil)

    RFC 3339 formatted. If not provided, the current time will be used.

  • transaction_id (String) (defaults to: nil)

    Optional unique identifier for event deduplication. When provided, preview event



# File 'lib/metronome_sdk/models/v1/customer_preview_events_params.rb', line 78

Instance Attribute Details

#customer_idString

Parameters:

  • value (String)

Returns:

  • (String)


14
# File 'lib/metronome_sdk/models/v1/customer_preview_events_params.rb', line 14

required :customer_id, String

#eventsArray<MetronomeSDK::Models::V1::CustomerPreviewEventsParams::Event>

Array of usage events to include in the preview calculation. Must contain at least one event in merge mode.

Parameters:

  • value (::Array[MetronomeSDK::V1::CustomerPreviewEventsParams::Event])

Returns:



21
22
# File 'lib/metronome_sdk/models/v1/customer_preview_events_params.rb', line 21

required :events,
-> { MetronomeSDK::Internal::Type::ArrayOf[MetronomeSDK::V1::CustomerPreviewEventsParams::Event] }

#modeSymbol, ...

Controls how the provided events are combined with existing usage data. Use replace to calculate the preview as if these are the only events for the customer, ignoring all historical usage. Use merge to combine these events with the customer's existing usage. Defaults to replace.



31
# File 'lib/metronome_sdk/models/v1/customer_preview_events_params.rb', line 31

optional :mode, enum: -> { MetronomeSDK::V1::CustomerPreviewEventsParams::Mode }

#skip_zero_qty_line_itemsBoolean?

When true, line items with zero quantity are excluded from the response.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


37
# File 'lib/metronome_sdk/models/v1/customer_preview_events_params.rb', line 37

optional :skip_zero_qty_line_items, MetronomeSDK::Internal::Type::Boolean

Instance Method Details

#to_hash{

Returns:

  • ({)


39
# File 'sig/metronome_sdk/models/v1/customer_preview_events_params.rbs', line 39

def to_hash: -> {