Class: WhopSDK::Models::StatListResponse::Data

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/whop_sdk/models/stat_list_response.rb,
sig/whop_sdk/models/stat_list_response.rbs

Defined Under Namespace

Modules: Unit

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(description:, key:, name:, properties:, unit:, windows: nil) ⇒ Object

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

Parameters:

  • description (String)

    A short description of what the metric measures.

  • key (String)

    The metric's key. Pass it to GET /stats/metric to query its values.

  • name (String)

    Human-readable display name for the metric.

  • properties (Array<String>)

    The properties you can use with this metric — pass one as a filter (property=val

  • unit (Symbol, WhopSDK::Models::StatListResponse::Data::Unit)

    How to read the metric's values: count is an integer, currency is a decimal amou

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

    Snapshot metrics only: the trailing windows you can pass as snapshot_window, for



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/whop_sdk/models/stat_list_response.rb', line 16

class Data < WhopSDK::Internal::Type::BaseModel
  # @!attribute description
  #   A short description of what the metric measures.
  #
  #   @return [String]
  required :description, String

  # @!attribute key
  #   The metric's key. Pass it to GET /stats/{metric} to query its values.
  #
  #   @return [String]
  required :key, String

  # @!attribute name
  #   Human-readable display name for the metric.
  #
  #   @return [String]
  required :name, String

  # @!attribute properties
  #   The properties you can use with this metric — pass one as a filter
  #   (property=value) to narrow the series, or as breakdown_by=property to split it.
  #
  #   @return [Array<String>]
  required :properties, WhopSDK::Internal::Type::ArrayOf[String]

  # @!attribute unit
  #   How to read the metric's values: count is an integer, currency is a decimal
  #   amount, and percent is a number where 1.6 means 1.6%.
  #
  #   @return [Symbol, WhopSDK::Models::StatListResponse::Data::Unit]
  required :unit, enum: -> { WhopSDK::Models::StatListResponse::Data::Unit }

  # @!attribute windows
  #   Snapshot metrics only: the trailing windows you can pass as snapshot_window, for
  #   example 30d. Absent on live metrics, which use from/to instead.
  #
  #   @return [Array<String>, nil]
  optional :windows, WhopSDK::Internal::Type::ArrayOf[String]

  # @!method initialize(description:, key:, name:, properties:, unit:, windows: nil)
  #   Some parameter documentations has been truncated, see
  #   {WhopSDK::Models::StatListResponse::Data} for more details.
  #
  #   @param description [String] A short description of what the metric measures.
  #
  #   @param key [String] The metric's key. Pass it to GET /stats/{metric} to query its values.
  #
  #   @param name [String] Human-readable display name for the metric.
  #
  #   @param properties [Array<String>] The properties you can use with this metric — pass one as a filter (property=val
  #
  #   @param unit [Symbol, WhopSDK::Models::StatListResponse::Data::Unit] How to read the metric's values: count is an integer, currency is a decimal amou
  #
  #   @param windows [Array<String>] Snapshot metrics only: the trailing windows you can pass as snapshot_window, for

  # How to read the metric's values: count is an integer, currency is a decimal
  # amount, and percent is a number where 1.6 means 1.6%.
  #
  # @see WhopSDK::Models::StatListResponse::Data#unit
  module Unit
    extend WhopSDK::Internal::Type::Enum

    COUNT = :count
    CURRENCY = :currency
    PERCENT = :percent

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#descriptionString

A short description of what the metric measures.

Parameters:

  • value (String)

Returns:

  • (String)


21
# File 'lib/whop_sdk/models/stat_list_response.rb', line 21

required :description, String

#keyString

The metric's key. Pass it to GET /stats/metric to query its values.

Parameters:

  • value (String)

Returns:

  • (String)


27
# File 'lib/whop_sdk/models/stat_list_response.rb', line 27

required :key, String

#nameString

Human-readable display name for the metric.

Parameters:

  • value (String)

Returns:

  • (String)


33
# File 'lib/whop_sdk/models/stat_list_response.rb', line 33

required :name, String

#propertiesArray<String>

The properties you can use with this metric — pass one as a filter (property=value) to narrow the series, or as breakdown_by=property to split it.

Parameters:

  • value (::Array[String])

Returns:

  • (Array<String>)


40
# File 'lib/whop_sdk/models/stat_list_response.rb', line 40

required :properties, WhopSDK::Internal::Type::ArrayOf[String]

#unitSymbol, WhopSDK::Models::StatListResponse::Data::Unit

How to read the metric's values: count is an integer, currency is a decimal amount, and percent is a number where 1.6 means 1.6%.

Parameters:

  • value (WhopSDK::Models::StatListResponse::Data::unit)

Returns:



47
# File 'lib/whop_sdk/models/stat_list_response.rb', line 47

required :unit, enum: -> { WhopSDK::Models::StatListResponse::Data::Unit }

#windowsArray<String>?

Snapshot metrics only: the trailing windows you can pass as snapshot_window, for example 30d. Absent on live metrics, which use from/to instead.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


54
# File 'lib/whop_sdk/models/stat_list_response.rb', line 54

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

Instance Method Details

#to_hash{

Returns:

  • ({)


49
# File 'sig/whop_sdk/models/stat_list_response.rbs', line 49

def to_hash: -> {