Class: WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader

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

Defined Under Namespace

Classes: User

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(first_referral_started_at:, rank:, total_earnings_usd:, total_volume_usd:, user:) ⇒ Object

Some parameter documentations has been truncated, see WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader for more details.

Parameters:

  • first_referral_started_at (Time)

    When the referrer's earliest business referral became active.

  • rank (Integer)

    1-based leaderboard position.

  • total_earnings_usd (String)

    The referrer's pending + completed earnings across all referred businesses, in U

  • total_volume_usd (String)

    Credited GMV across all the referrer's referred businesses, in USD.

  • user (WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User, nil)

    The ranked referrer. Identity fields (id, name, username, profile_picture) are r



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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/whop_sdk/models/referrals/business_leaderboard_response.rb', line 26

class Leader < WhopSDK::Internal::Type::BaseModel
  # @!attribute first_referral_started_at
  #   When the referrer's earliest business referral became active.
  #
  #   @return [Time]
  required :first_referral_started_at, Time

  # @!attribute rank
  #   1-based leaderboard position.
  #
  #   @return [Integer]
  required :rank, Integer

  # @!attribute total_earnings_usd
  #   The referrer's pending + completed earnings across all referred businesses, in
  #   USD.
  #
  #   @return [String]
  required :total_earnings_usd, String

  # @!attribute total_volume_usd
  #   Credited GMV across all the referrer's referred businesses, in USD.
  #
  #   @return [String]
  required :total_volume_usd, String

  # @!attribute user
  #   The ranked referrer. Identity fields (id, name, username, profile_picture) are
  #   returned only on the caller's own entry; other referrers expose coarse location
  #   only.
  #
  #   @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User, nil]
  required :user, -> { WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User }, nil?: true

  # @!method initialize(first_referral_started_at:, rank:, total_earnings_usd:, total_volume_usd:, user:)
  #   Some parameter documentations has been truncated, see
  #   {WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader} for more
  #   details.
  #
  #   @param first_referral_started_at [Time] When the referrer's earliest business referral became active.
  #
  #   @param rank [Integer] 1-based leaderboard position.
  #
  #   @param total_earnings_usd [String] The referrer's pending + completed earnings across all referred businesses, in U
  #
  #   @param total_volume_usd [String] Credited GMV across all the referrer's referred businesses, in USD.
  #
  #   @param user [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User, nil] The ranked referrer. Identity fields (id, name, username, profile_picture) are r

  # @see WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader#user
  class User < WhopSDK::Internal::Type::BaseModel
    # @!attribute city
    #   The city where the referrer is located, derived from their IP address. Null if
    #   location sharing is disabled.
    #
    #   @return [String, nil]
    required :city, String, nil?: true

    # @!attribute country
    #   The country where the referrer is located, derived from their IP address. Null
    #   if location sharing is disabled.
    #
    #   @return [String, nil]
    required :country, String, nil?: true

    # @!attribute id
    #   User ID, prefixed `user_`. Present only on the caller's own entry.
    #
    #   @return [String, nil]
    optional :id, String

    # @!attribute name
    #   The user's display name. Present only on the caller's own entry.
    #
    #   @return [String, nil]
    optional :name, String, nil?: true

    # @!attribute profile_picture
    #   The user's profile picture. Present only on the caller's own entry.
    #
    #   @return [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture, nil]
    optional :profile_picture,
             -> { WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture }

    # @!attribute username
    #   The user's unique username. Present only on the caller's own entry.
    #
    #   @return [String, nil]
    optional :username, String

    # @!method initialize(city:, country:, id: nil, name: nil, profile_picture: nil, username: nil)
    #   Some parameter documentations has been truncated, see
    #   {WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User} for more
    #   details.
    #
    #   The ranked referrer. Identity fields (id, name, username, profile_picture) are
    #   returned only on the caller's own entry; other referrers expose coarse location
    #   only.
    #
    #   @param city [String, nil] The city where the referrer is located, derived from their IP address. Null if l
    #
    #   @param country [String, nil] The country where the referrer is located, derived from their IP address. Null i
    #
    #   @param id [String] User ID, prefixed `user_`. Present only on the caller's own entry.
    #
    #   @param name [String, nil] The user's display name. Present only on the caller's own entry.
    #
    #   @param profile_picture [WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User::ProfilePicture] The user's profile picture. Present only on the caller's own entry.
    #
    #   @param username [String] The user's unique username. Present only on the caller's own entry.

    # @see WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User#profile_picture
    class ProfilePicture < WhopSDK::Internal::Type::BaseModel
      # @!attribute url
      #   The user's profile picture URL.
      #
      #   @return [String]
      required :url, String

      # @!method initialize(url:)
      #   The user's profile picture. Present only on the caller's own entry.
      #
      #   @param url [String] The user's profile picture URL.
    end
  end
end

Instance Attribute Details

#first_referral_started_atTime

When the referrer's earliest business referral became active.

Parameters:

  • value (Time)

Returns:

  • (Time)


31
# File 'lib/whop_sdk/models/referrals/business_leaderboard_response.rb', line 31

required :first_referral_started_at, Time

#rankInteger

1-based leaderboard position.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


37
# File 'lib/whop_sdk/models/referrals/business_leaderboard_response.rb', line 37

required :rank, Integer

#total_earnings_usdString

The referrer's pending + completed earnings across all referred businesses, in USD.

Parameters:

  • value (String)

Returns:

  • (String)


44
# File 'lib/whop_sdk/models/referrals/business_leaderboard_response.rb', line 44

required :total_earnings_usd, String

#total_volume_usdString

Credited GMV across all the referrer's referred businesses, in USD.

Parameters:

  • value (String)

Returns:

  • (String)


50
# File 'lib/whop_sdk/models/referrals/business_leaderboard_response.rb', line 50

required :total_volume_usd, String

#userWhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User?

The ranked referrer. Identity fields (id, name, username, profile_picture) are returned only on the caller's own entry; other referrers expose coarse location only.



58
# File 'lib/whop_sdk/models/referrals/business_leaderboard_response.rb', line 58

required :user, -> { WhopSDK::Models::Referrals::BusinessLeaderboardResponse::Leader::User }, nil?: true

Instance Method Details

#to_hash{

Returns:

  • ({)


53
# File 'sig/whop_sdk/models/referrals/business_leaderboard_response.rbs', line 53

def to_hash: -> {