Class: Courier::Models::NotificationGetMetricsParams

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

Overview

See Also:

  • Courier::Resources::Notifications#get_metrics

Defined Under Namespace

Modules: Granularity

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(id:, end_: nil, granularity: nil, lookback: nil, start: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see Courier::Models::NotificationGetMetricsParams for more details.

Parameters:

  • id (String)
  • end_ (Time) (defaults to: nil)

    The end of the window, as an ISO 8601 timestamp with an offset. Must be supplied

  • granularity (Symbol, Courier::Models::NotificationGetMetricsParams::Granularity) (defaults to: nil)

    The size of each bucket in the series. Defaults to DAY. WEEK buckets start o

  • lookback (String) (defaults to: nil)

    The length of the window, counted back from now, as an ISO 8601 duration (P30D

  • start (Time) (defaults to: nil)

    The inclusive start of the window, as an ISO 8601 timestamp with an offset (`202

  • request_options (Courier::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


# File 'lib/courier/models/notification_get_metrics_params.rb', line 49

Instance Attribute Details

#end_Time?

The end of the window, as an ISO 8601 timestamp with an offset. Must be supplied together with start. An end in the future is accepted and not clamped — the trailing buckets come back empty.

Parameters:

  • (Time)

Returns:

  • (Time, nil)


21
# File 'lib/courier/models/notification_get_metrics_params.rb', line 21

optional :end_, Time

#granularitySymbol, ...

The size of each bucket in the series. Defaults to DAY. WEEK buckets start on Sunday. A fine granularity caps the window it can cover: HOUR spans at most 7 days and DAY at most 90 days, and a wider window returns 400 — request a coarser granularity instead. WEEK and MONTH are uncapped, subject to the 1000-bucket limit on a single response.



31
# File 'lib/courier/models/notification_get_metrics_params.rb', line 31

optional :granularity, enum: -> { Courier::NotificationGetMetricsParams::Granularity }

#idString

Parameters:

  • value (String)

Returns:

  • (String)


13
# File 'lib/courier/models/notification_get_metrics_params.rb', line 13

required :id, String

#lookbackString?

The length of the window, counted back from now, as an ISO 8601 duration (P30D, P12W, PT12H). Defaults to P30D, and is ignored when start and end are supplied. A malformed or non-positive duration returns 400.

Parameters:

  • (String)

Returns:

  • (String, nil)


39
# File 'lib/courier/models/notification_get_metrics_params.rb', line 39

optional :lookback, String

#startTime?

The inclusive start of the window, as an ISO 8601 timestamp with an offset (2026-04-01T00:00:00Z). Must be supplied together with end and be earlier than it; either one alone returns 400.

Parameters:

  • (Time)

Returns:

  • (Time, nil)


47
# File 'lib/courier/models/notification_get_metrics_params.rb', line 47

optional :start, Time

Instance Method Details

#to_hash{

Returns:

  • ({)


46
# File 'sig/courier/models/notification_get_metrics_params.rbs', line 46

def to_hash: -> {