Class: WhopSDK::Models::StatRetrieveParams

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

Overview

See Also:

  • WhopSDK::Resources::Stats#retrieve

Defined Under Namespace

Modules: Interval, SnapshotWindow

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Class Method Summary collapse

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(metric:, from:, to:, access_level: nil, account_id: nil, ad_campaign_ids: nil, ad_group_ids: nil, ad_ids: nil, breakdown_by: nil, card_network: nil, category: nil, convert_to: nil, currency: nil, fee_type: nil, interval: nil, most_recent_action: nil, payment_method: nil, product: nil, referred_user_id: nil, segment: nil, snapshot_window: nil, source: nil, status: nil, time_zone: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see WhopSDK::Models::StatRetrieveParams for more details.

the

A

Parameters:

  • metric (String)
  • from (Date)

    Start of the date range (YYYY-MM-DD).

  • to (Date)

    End of the date range (YYYY-MM-DD).

  • access_level (String) (defaults to: nil)

    Filter to a single access level. Pair with breakdown_by=access_level. Available

  • account_id (String) (defaults to: nil)

    The account this query concerns, for example biz_AbC123.

  • ad_campaign_ids (Array<String>) (defaults to: nil)

    Ad campaign ids (adcamp_...) to scope the report to; stats are summed across

  • ad_group_ids (Array<String>) (defaults to: nil)

    Ad group ids (adgrp_...) to scope the report to; stats are summed across them.

  • ad_ids (Array<String>) (defaults to: nil)

    Ad ids (ad_...) to scope the report to; stats are summed across them. Available

  • breakdown_by (String) (defaults to: nil)

    Split the metric out by one of its properties — each point gets a breakdown arra

  • card_network (String) (defaults to: nil)

    Filter to a single card brand, for example visa. A refinement of payment_method=

  • category (String) (defaults to: nil)

    Filter to a single balance-activity category, for example payments. Pair with br

  • convert_to (String) (defaults to: nil)

    Display currency for money metrics — every amount is converted into this ISO cur

  • currency (String) (defaults to: nil)

    Filter to transactions made in this original ISO currency, for example eur — rep

  • fee_type (String) (defaults to: nil)

    Filter to a single fee type. Pair with breakdown_by=fee_type to split fees by ty

  • interval (Symbol, WhopSDK::Models::StatRetrieveParams::Interval) (defaults to: nil)

    How wide each point is. Defaults to day. Snapshot metrics are day-only.

  • most_recent_action (String) (defaults to: nil)

    Filter to a single most-recent member action. Pair with breakdown_by=most_recent

  • payment_method (String) (defaults to: nil)

    Filter to a single payment method, for example card or crypto. Available on metr

  • product (String) (defaults to: nil)

    Filter to a single product (access pass id), for example prod_AbC123. Pair with

  • referred_user_id (String) (defaults to: nil)

    Filter a referral metric to the businesses attributed to one person you referred

  • segment (String) (defaults to: nil)

    Filter to a single wallet-balance segment, for example available. Pair with brea

  • snapshot_window (Symbol, WhopSDK::Models::StatRetrieveParams::SnapshotWindow) (defaults to: nil)

    Trailing window for snapshot metrics. Only accepted by snapshot metrics (each li

  • source (String) (defaults to: nil)

    Filter to a single GMV source, for example payments. Pair with breakdown_by=sour

  • status (String) (defaults to: nil)

    Filter to a single membership status. Pair with breakdown_by=status. Available o

  • time_zone (String) (defaults to: nil)

    IANA time zone to bucket the series in, for example America/New_York. Defaults t

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


# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 182

Instance Attribute Details

#access_levelString?

Filter to a single access level. Pair with breakdown_by=access_level. Available on metrics that list access_level.

Parameters:

  • (String)

Returns:

  • (String, nil)


32
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 32

optional :access_level, String

#account_idString?

The account this query concerns, for example biz_AbC123.

Parameters:

  • (String)

Returns:

  • (String, nil)


38
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 38

optional :account_id, String

#ad_campaign_idsArray<String>?

Ad campaign ids (adcamp_...) to scope the report to; stats are summed across them. Available on metrics that list ad_campaign_ids.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


45
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 45

optional :ad_campaign_ids, WhopSDK::Internal::Type::ArrayOf[String]

#ad_group_idsArray<String>?

Ad group ids (adgrp_...) to scope the report to; stats are summed across them. Available on metrics that list ad_group_ids.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


52
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 52

optional :ad_group_ids, WhopSDK::Internal::Type::ArrayOf[String]

#ad_idsArray<String>?

Ad ids (ad_...) to scope the report to; stats are summed across them. Available on metrics that list ad_ids.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


59
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 59

optional :ad_ids, WhopSDK::Internal::Type::ArrayOf[String]

#breakdown_byString?

Split the metric out by one of its properties — each point gets a breakdown array. For example breakdown_by=currency returns an entry for usd, an entry for eur, and so on.

Parameters:

  • (String)

Returns:

  • (String, nil)


67
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 67

optional :breakdown_by, String

#card_networkString?

Filter to a single card brand, for example visa. A refinement of payment_method=card. Available on metrics that list card_network.

Parameters:

  • (String)

Returns:

  • (String, nil)


74
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 74

optional :card_network, String

#categoryString?

Filter to a single balance-activity category, for example payments. Pair with breakdown_by=category to split the activity. Available on metrics that list category.

Parameters:

  • (String)

Returns:

  • (String, nil)


82
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 82

optional :category, String

#convert_toString?

Display currency for money metrics — every amount is converted into this ISO currency using the exchange rate on each period's date. Defaults to usd. For the ads metrics (ad_spend, ad_report), pass the account's ads reporting currency to match the ad entity endpoints. Ignored when you filter or break down by currency (those report the original transaction currency, unconverted).

Parameters:

  • (String)

Returns:

  • (String, nil)


92
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 92

optional :convert_to, String

#currencyString?

Filter to transactions made in this original ISO currency, for example eur — reported in that currency, not converted. Pair with breakdown_by=currency to split a metric by currency. Available on metrics that list currency.

Parameters:

  • (String)

Returns:

  • (String, nil)


100
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 100

optional :currency, String

#fee_typeString?

Filter to a single fee type. Pair with breakdown_by=fee_type to split fees by type. Available on metrics that list fee_type.

Parameters:

  • (String)

Returns:

  • (String, nil)


107
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 107

optional :fee_type, String

#fromDate

Start of the date range (YYYY-MM-DD).

Parameters:

  • value (Date)

Returns:

  • (Date)


19
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 19

required :from, Date

#intervalSymbol, ...

How wide each point is. Defaults to day. Snapshot metrics are day-only.



113
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 113

optional :interval, enum: -> { WhopSDK::StatRetrieveParams::Interval }

#metricString

Parameters:

  • value (String)

Returns:

  • (String)


13
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 13

required :metric, String

#most_recent_actionString?

Filter to a single most-recent member action. Pair with breakdown_by=most_recent_action. Available on metrics that list most_recent_action.

Parameters:

  • (String)

Returns:

  • (String, nil)


121
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 121

optional :most_recent_action, String

#payment_methodString?

Filter to a single payment method, for example card or crypto. Available on metrics that list payment_method.

Parameters:

  • (String)

Returns:

  • (String, nil)


128
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 128

optional :payment_method, String

#productString?

Filter to a single product (access pass id), for example prod_AbC123. Pair with breakdown_by=product. Available on metrics that list product.

Parameters:

  • (String)

Returns:

  • (String, nil)


135
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 135

optional :product, String

#referred_user_idString?

Filter a referral metric to the businesses attributed to one person you referred, for example user_AbC123. Available on metrics that list referred_user_id.

Parameters:

  • (String)

Returns:

  • (String, nil)


143
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 143

optional :referred_user_id, String

#segmentString?

Filter to a single wallet-balance segment, for example available. Pair with breakdown_by=segment to split the balance. Available on metrics that list segment.

Parameters:

  • (String)

Returns:

  • (String, nil)


151
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 151

optional :segment, String

#snapshot_windowSymbol, ...

Trailing window for snapshot metrics. Only accepted by snapshot metrics (each lists its allowed windows in the catalog); defaults to the metric's first supported window. Only 30d today.



159
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 159

optional :snapshot_window, enum: -> { WhopSDK::StatRetrieveParams::SnapshotWindow }

#sourceString?

Filter to a single GMV source, for example payments. Pair with breakdown_by=source to split by source. Available on metrics that list source.

Parameters:

  • (String)

Returns:

  • (String, nil)


166
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 166

optional :source, String

#statusString?

Filter to a single membership status. Pair with breakdown_by=status. Available on metrics that list status.

Parameters:

  • (String)

Returns:

  • (String, nil)


173
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 173

optional :status, String

#time_zoneString?

IANA time zone to bucket the series in, for example America/New_York. Defaults to UTC. Not accepted by snapshot metrics, which are UTC only.

Parameters:

  • (String)

Returns:

  • (String, nil)


180
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 180

optional :time_zone, String

#toDate

End of the date range (YYYY-MM-DD).

Parameters:

  • value (Date)

Returns:

  • (Date)


25
# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 25

required :to, Date

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/whop_sdk/models/stat_retrieve_params.rb', line 248

Instance Method Details

#to_hash{

Returns:

  • ({)


158
# File 'sig/whop_sdk/models/stat_retrieve_params.rbs', line 158

def to_hash: -> {