growsurf-python 0.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. growsurf/__init__.py +102 -0
  2. growsurf/_base_client.py +2153 -0
  3. growsurf/_client.py +484 -0
  4. growsurf/_compat.py +226 -0
  5. growsurf/_constants.py +14 -0
  6. growsurf/_exceptions.py +108 -0
  7. growsurf/_files.py +173 -0
  8. growsurf/_models.py +878 -0
  9. growsurf/_qs.py +149 -0
  10. growsurf/_resource.py +43 -0
  11. growsurf/_response.py +833 -0
  12. growsurf/_streaming.py +338 -0
  13. growsurf/_types.py +274 -0
  14. growsurf/_utils/__init__.py +64 -0
  15. growsurf/_utils/_compat.py +45 -0
  16. growsurf/_utils/_datetime_parse.py +136 -0
  17. growsurf/_utils/_json.py +35 -0
  18. growsurf/_utils/_logs.py +25 -0
  19. growsurf/_utils/_path.py +127 -0
  20. growsurf/_utils/_proxy.py +65 -0
  21. growsurf/_utils/_reflection.py +42 -0
  22. growsurf/_utils/_resources_proxy.py +24 -0
  23. growsurf/_utils/_streams.py +12 -0
  24. growsurf/_utils/_sync.py +58 -0
  25. growsurf/_utils/_transform.py +457 -0
  26. growsurf/_utils/_typing.py +156 -0
  27. growsurf/_utils/_utils.py +433 -0
  28. growsurf/_version.py +4 -0
  29. growsurf/lib/.keep +4 -0
  30. growsurf/py.typed +0 -0
  31. growsurf/resources/__init__.py +19 -0
  32. growsurf/resources/campaign/__init__.py +61 -0
  33. growsurf/resources/campaign/campaign.py +1126 -0
  34. growsurf/resources/campaign/commission.py +259 -0
  35. growsurf/resources/campaign/participant.py +1587 -0
  36. growsurf/resources/campaign/reward.py +355 -0
  37. growsurf/types/__init__.py +18 -0
  38. growsurf/types/campaign/__init__.py +35 -0
  39. growsurf/types/campaign/campaign.py +73 -0
  40. growsurf/types/campaign/commission_approve_response.py +9 -0
  41. growsurf/types/campaign/commission_delete_response.py +9 -0
  42. growsurf/types/campaign/fraud_risk_level.py +7 -0
  43. growsurf/types/campaign/participant.py +147 -0
  44. growsurf/types/campaign/participant_add_params.py +30 -0
  45. growsurf/types/campaign/participant_delete_response.py +9 -0
  46. growsurf/types/campaign/participant_list_commissions_params.py +22 -0
  47. growsurf/types/campaign/participant_list_payouts_params.py +22 -0
  48. growsurf/types/campaign/participant_list_referrals_params.py +43 -0
  49. growsurf/types/campaign/participant_list_rewards_params.py +19 -0
  50. growsurf/types/campaign/participant_list_rewards_response.py +18 -0
  51. growsurf/types/campaign/participant_record_transaction_params.py +60 -0
  52. growsurf/types/campaign/participant_record_transaction_response.py +37 -0
  53. growsurf/types/campaign/participant_reward.py +39 -0
  54. growsurf/types/campaign/participant_send_invites_params.py +20 -0
  55. growsurf/types/campaign/participant_send_invites_response.py +15 -0
  56. growsurf/types/campaign/participant_trigger_referral_response.py +13 -0
  57. growsurf/types/campaign/participant_update_params.py +34 -0
  58. growsurf/types/campaign/referral_source.py +7 -0
  59. growsurf/types/campaign/referral_status.py +7 -0
  60. growsurf/types/campaign/reward_approve_params.py +14 -0
  61. growsurf/types/campaign/reward_approve_response.py +9 -0
  62. growsurf/types/campaign/reward_delete_response.py +9 -0
  63. growsurf/types/campaign/reward_fulfill_response.py +9 -0
  64. growsurf/types/campaign_list_commissions_params.py +20 -0
  65. growsurf/types/campaign_list_leaderboard_params.py +36 -0
  66. growsurf/types/campaign_list_participants_params.py +17 -0
  67. growsurf/types/campaign_list_payouts_params.py +20 -0
  68. growsurf/types/campaign_list_referrals_params.py +41 -0
  69. growsurf/types/campaign_list_response.py +12 -0
  70. growsurf/types/campaign_retrieve_analytics_params.py +26 -0
  71. growsurf/types/campaign_retrieve_analytics_response.py +75 -0
  72. growsurf/types/commission_structure.py +62 -0
  73. growsurf/types/participant_commission_list.py +62 -0
  74. growsurf/types/participant_list.py +18 -0
  75. growsurf/types/participant_payout_list.py +50 -0
  76. growsurf/types/referral_list.py +40 -0
  77. growsurf_python-0.0.2.dist-info/METADATA +399 -0
  78. growsurf_python-0.0.2.dist-info/RECORD +80 -0
  79. growsurf_python-0.0.2.dist-info/WHEEL +4 -0
  80. growsurf_python-0.0.2.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,355 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
8
+ from ..._utils import path_template, maybe_transform, async_maybe_transform
9
+ from ..._compat import cached_property
10
+ from ..._resource import SyncAPIResource, AsyncAPIResource
11
+ from ..._response import (
12
+ to_raw_response_wrapper,
13
+ to_streamed_response_wrapper,
14
+ async_to_raw_response_wrapper,
15
+ async_to_streamed_response_wrapper,
16
+ )
17
+ from ..._base_client import make_request_options
18
+ from ...types.campaign import reward_approve_params
19
+ from ...types.campaign.reward_delete_response import RewardDeleteResponse
20
+ from ...types.campaign.reward_approve_response import RewardApproveResponse
21
+ from ...types.campaign.reward_fulfill_response import RewardFulfillResponse
22
+
23
+ __all__ = ["RewardResource", "AsyncRewardResource"]
24
+
25
+
26
+ class RewardResource(SyncAPIResource):
27
+ """Participant reward retrieval and manual reward operations."""
28
+
29
+ @cached_property
30
+ def with_raw_response(self) -> RewardResourceWithRawResponse:
31
+ """
32
+ This property can be used as a prefix for any HTTP method call to return
33
+ the raw response object instead of the parsed content.
34
+
35
+ For more information, see https://www.github.com/growsurf/growsurf-python#accessing-raw-response-data-eg-headers
36
+ """
37
+ return RewardResourceWithRawResponse(self)
38
+
39
+ @cached_property
40
+ def with_streaming_response(self) -> RewardResourceWithStreamingResponse:
41
+ """
42
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
43
+
44
+ For more information, see https://www.github.com/growsurf/growsurf-python#with_streaming_response
45
+ """
46
+ return RewardResourceWithStreamingResponse(self)
47
+
48
+ def delete(
49
+ self,
50
+ reward_id: str,
51
+ *,
52
+ id: str,
53
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
54
+ # The extra values given here take precedence over values defined on the client or passed to this method.
55
+ extra_headers: Headers | None = None,
56
+ extra_query: Query | None = None,
57
+ extra_body: Body | None = None,
58
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
59
+ ) -> RewardDeleteResponse:
60
+ """
61
+ Removes a manually approved participant reward that has not already been
62
+ approved.
63
+
64
+ Args:
65
+ extra_headers: Send extra headers
66
+
67
+ extra_query: Add additional query parameters to the request
68
+
69
+ extra_body: Add additional JSON properties to the request
70
+
71
+ timeout: Override the client-level default timeout for this request, in seconds
72
+ """
73
+ if not id:
74
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
75
+ if not reward_id:
76
+ raise ValueError(f"Expected a non-empty value for `reward_id` but received {reward_id!r}")
77
+ return self._delete(
78
+ path_template("/campaign/{id}/reward/{reward_id}", id=id, reward_id=reward_id),
79
+ options=make_request_options(
80
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
81
+ ),
82
+ cast_to=RewardDeleteResponse,
83
+ )
84
+
85
+ def approve(
86
+ self,
87
+ reward_id: str,
88
+ *,
89
+ id: str,
90
+ fulfill: bool | Omit = omit,
91
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
92
+ # The extra values given here take precedence over values defined on the client or passed to this method.
93
+ extra_headers: Headers | None = None,
94
+ extra_query: Query | None = None,
95
+ extra_body: Body | None = None,
96
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
97
+ ) -> RewardApproveResponse:
98
+ """
99
+ Approves a manually approved reward earned by a participant.
100
+
101
+ Args:
102
+ fulfill: Set true to mark the reward as fulfilled after approval.
103
+
104
+ extra_headers: Send extra headers
105
+
106
+ extra_query: Add additional query parameters to the request
107
+
108
+ extra_body: Add additional JSON properties to the request
109
+
110
+ timeout: Override the client-level default timeout for this request, in seconds
111
+ """
112
+ if not id:
113
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
114
+ if not reward_id:
115
+ raise ValueError(f"Expected a non-empty value for `reward_id` but received {reward_id!r}")
116
+ return self._post(
117
+ path_template("/campaign/{id}/reward/{reward_id}/approve", id=id, reward_id=reward_id),
118
+ body=maybe_transform({"fulfill": fulfill}, reward_approve_params.RewardApproveParams),
119
+ options=make_request_options(
120
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
121
+ ),
122
+ cast_to=RewardApproveResponse,
123
+ )
124
+
125
+ def fulfill(
126
+ self,
127
+ reward_id: str,
128
+ *,
129
+ id: str,
130
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
131
+ # The extra values given here take precedence over values defined on the client or passed to this method.
132
+ extra_headers: Headers | None = None,
133
+ extra_query: Query | None = None,
134
+ extra_body: Body | None = None,
135
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
136
+ ) -> RewardFulfillResponse:
137
+ """
138
+ Marks an approved participant reward as fulfilled.
139
+
140
+ Args:
141
+ extra_headers: Send extra headers
142
+
143
+ extra_query: Add additional query parameters to the request
144
+
145
+ extra_body: Add additional JSON properties to the request
146
+
147
+ timeout: Override the client-level default timeout for this request, in seconds
148
+ """
149
+ if not id:
150
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
151
+ if not reward_id:
152
+ raise ValueError(f"Expected a non-empty value for `reward_id` but received {reward_id!r}")
153
+ return self._post(
154
+ path_template("/campaign/{id}/reward/{reward_id}/fulfill", id=id, reward_id=reward_id),
155
+ options=make_request_options(
156
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
157
+ ),
158
+ cast_to=RewardFulfillResponse,
159
+ )
160
+
161
+
162
+ class AsyncRewardResource(AsyncAPIResource):
163
+ """Participant reward retrieval and manual reward operations."""
164
+
165
+ @cached_property
166
+ def with_raw_response(self) -> AsyncRewardResourceWithRawResponse:
167
+ """
168
+ This property can be used as a prefix for any HTTP method call to return
169
+ the raw response object instead of the parsed content.
170
+
171
+ For more information, see https://www.github.com/growsurf/growsurf-python#accessing-raw-response-data-eg-headers
172
+ """
173
+ return AsyncRewardResourceWithRawResponse(self)
174
+
175
+ @cached_property
176
+ def with_streaming_response(self) -> AsyncRewardResourceWithStreamingResponse:
177
+ """
178
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
179
+
180
+ For more information, see https://www.github.com/growsurf/growsurf-python#with_streaming_response
181
+ """
182
+ return AsyncRewardResourceWithStreamingResponse(self)
183
+
184
+ async def delete(
185
+ self,
186
+ reward_id: str,
187
+ *,
188
+ id: str,
189
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
190
+ # The extra values given here take precedence over values defined on the client or passed to this method.
191
+ extra_headers: Headers | None = None,
192
+ extra_query: Query | None = None,
193
+ extra_body: Body | None = None,
194
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
195
+ ) -> RewardDeleteResponse:
196
+ """
197
+ Removes a manually approved participant reward that has not already been
198
+ approved.
199
+
200
+ Args:
201
+ extra_headers: Send extra headers
202
+
203
+ extra_query: Add additional query parameters to the request
204
+
205
+ extra_body: Add additional JSON properties to the request
206
+
207
+ timeout: Override the client-level default timeout for this request, in seconds
208
+ """
209
+ if not id:
210
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
211
+ if not reward_id:
212
+ raise ValueError(f"Expected a non-empty value for `reward_id` but received {reward_id!r}")
213
+ return await self._delete(
214
+ path_template("/campaign/{id}/reward/{reward_id}", id=id, reward_id=reward_id),
215
+ options=make_request_options(
216
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
217
+ ),
218
+ cast_to=RewardDeleteResponse,
219
+ )
220
+
221
+ async def approve(
222
+ self,
223
+ reward_id: str,
224
+ *,
225
+ id: str,
226
+ fulfill: bool | Omit = omit,
227
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
228
+ # The extra values given here take precedence over values defined on the client or passed to this method.
229
+ extra_headers: Headers | None = None,
230
+ extra_query: Query | None = None,
231
+ extra_body: Body | None = None,
232
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
233
+ ) -> RewardApproveResponse:
234
+ """
235
+ Approves a manually approved reward earned by a participant.
236
+
237
+ Args:
238
+ fulfill: Set true to mark the reward as fulfilled after approval.
239
+
240
+ extra_headers: Send extra headers
241
+
242
+ extra_query: Add additional query parameters to the request
243
+
244
+ extra_body: Add additional JSON properties to the request
245
+
246
+ timeout: Override the client-level default timeout for this request, in seconds
247
+ """
248
+ if not id:
249
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
250
+ if not reward_id:
251
+ raise ValueError(f"Expected a non-empty value for `reward_id` but received {reward_id!r}")
252
+ return await self._post(
253
+ path_template("/campaign/{id}/reward/{reward_id}/approve", id=id, reward_id=reward_id),
254
+ body=await async_maybe_transform({"fulfill": fulfill}, reward_approve_params.RewardApproveParams),
255
+ options=make_request_options(
256
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
257
+ ),
258
+ cast_to=RewardApproveResponse,
259
+ )
260
+
261
+ async def fulfill(
262
+ self,
263
+ reward_id: str,
264
+ *,
265
+ id: str,
266
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
267
+ # The extra values given here take precedence over values defined on the client or passed to this method.
268
+ extra_headers: Headers | None = None,
269
+ extra_query: Query | None = None,
270
+ extra_body: Body | None = None,
271
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
272
+ ) -> RewardFulfillResponse:
273
+ """
274
+ Marks an approved participant reward as fulfilled.
275
+
276
+ Args:
277
+ extra_headers: Send extra headers
278
+
279
+ extra_query: Add additional query parameters to the request
280
+
281
+ extra_body: Add additional JSON properties to the request
282
+
283
+ timeout: Override the client-level default timeout for this request, in seconds
284
+ """
285
+ if not id:
286
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
287
+ if not reward_id:
288
+ raise ValueError(f"Expected a non-empty value for `reward_id` but received {reward_id!r}")
289
+ return await self._post(
290
+ path_template("/campaign/{id}/reward/{reward_id}/fulfill", id=id, reward_id=reward_id),
291
+ options=make_request_options(
292
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
293
+ ),
294
+ cast_to=RewardFulfillResponse,
295
+ )
296
+
297
+
298
+ class RewardResourceWithRawResponse:
299
+ def __init__(self, reward: RewardResource) -> None:
300
+ self._reward = reward
301
+
302
+ self.delete = to_raw_response_wrapper(
303
+ reward.delete,
304
+ )
305
+ self.approve = to_raw_response_wrapper(
306
+ reward.approve,
307
+ )
308
+ self.fulfill = to_raw_response_wrapper(
309
+ reward.fulfill,
310
+ )
311
+
312
+
313
+ class AsyncRewardResourceWithRawResponse:
314
+ def __init__(self, reward: AsyncRewardResource) -> None:
315
+ self._reward = reward
316
+
317
+ self.delete = async_to_raw_response_wrapper(
318
+ reward.delete,
319
+ )
320
+ self.approve = async_to_raw_response_wrapper(
321
+ reward.approve,
322
+ )
323
+ self.fulfill = async_to_raw_response_wrapper(
324
+ reward.fulfill,
325
+ )
326
+
327
+
328
+ class RewardResourceWithStreamingResponse:
329
+ def __init__(self, reward: RewardResource) -> None:
330
+ self._reward = reward
331
+
332
+ self.delete = to_streamed_response_wrapper(
333
+ reward.delete,
334
+ )
335
+ self.approve = to_streamed_response_wrapper(
336
+ reward.approve,
337
+ )
338
+ self.fulfill = to_streamed_response_wrapper(
339
+ reward.fulfill,
340
+ )
341
+
342
+
343
+ class AsyncRewardResourceWithStreamingResponse:
344
+ def __init__(self, reward: AsyncRewardResource) -> None:
345
+ self._reward = reward
346
+
347
+ self.delete = async_to_streamed_response_wrapper(
348
+ reward.delete,
349
+ )
350
+ self.approve = async_to_streamed_response_wrapper(
351
+ reward.approve,
352
+ )
353
+ self.fulfill = async_to_streamed_response_wrapper(
354
+ reward.fulfill,
355
+ )
@@ -0,0 +1,18 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .campaign import Campaign as Campaign
6
+ from .referral_list import ReferralList as ReferralList
7
+ from .participant_list import ParticipantList as ParticipantList
8
+ from .commission_structure import CommissionStructure as CommissionStructure
9
+ from .campaign_list_response import CampaignListResponse as CampaignListResponse
10
+ from .participant_payout_list import ParticipantPayoutList as ParticipantPayoutList
11
+ from .participant_commission_list import ParticipantCommissionList as ParticipantCommissionList
12
+ from .campaign_list_payouts_params import CampaignListPayoutsParams as CampaignListPayoutsParams
13
+ from .campaign_list_referrals_params import CampaignListReferralsParams as CampaignListReferralsParams
14
+ from .campaign_list_commissions_params import CampaignListCommissionsParams as CampaignListCommissionsParams
15
+ from .campaign_list_leaderboard_params import CampaignListLeaderboardParams as CampaignListLeaderboardParams
16
+ from .campaign_list_participants_params import CampaignListParticipantsParams as CampaignListParticipantsParams
17
+ from .campaign_retrieve_analytics_params import CampaignRetrieveAnalyticsParams as CampaignRetrieveAnalyticsParams
18
+ from .campaign_retrieve_analytics_response import CampaignRetrieveAnalyticsResponse as CampaignRetrieveAnalyticsResponse
@@ -0,0 +1,35 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .campaign import Campaign as Campaign
6
+ from .participant import Participant as Participant
7
+ from .referral_source import ReferralSource as ReferralSource
8
+ from .referral_status import ReferralStatus as ReferralStatus
9
+ from .fraud_risk_level import FraudRiskLevel as FraudRiskLevel
10
+ from .participant_reward import ParticipantReward as ParticipantReward
11
+ from .reward_approve_params import RewardApproveParams as RewardApproveParams
12
+ from .participant_add_params import ParticipantAddParams as ParticipantAddParams
13
+ from .reward_delete_response import RewardDeleteResponse as RewardDeleteResponse
14
+ from .reward_approve_response import RewardApproveResponse as RewardApproveResponse
15
+ from .reward_fulfill_response import RewardFulfillResponse as RewardFulfillResponse
16
+ from .participant_update_params import ParticipantUpdateParams as ParticipantUpdateParams
17
+ from .commission_delete_response import CommissionDeleteResponse as CommissionDeleteResponse
18
+ from .commission_approve_response import CommissionApproveResponse as CommissionApproveResponse
19
+ from .participant_delete_response import ParticipantDeleteResponse as ParticipantDeleteResponse
20
+ from .participant_list_payouts_params import ParticipantListPayoutsParams as ParticipantListPayoutsParams
21
+ from .participant_list_rewards_params import ParticipantListRewardsParams as ParticipantListRewardsParams
22
+ from .participant_send_invites_params import ParticipantSendInvitesParams as ParticipantSendInvitesParams
23
+ from .participant_list_referrals_params import ParticipantListReferralsParams as ParticipantListReferralsParams
24
+ from .participant_list_rewards_response import ParticipantListRewardsResponse as ParticipantListRewardsResponse
25
+ from .participant_send_invites_response import ParticipantSendInvitesResponse as ParticipantSendInvitesResponse
26
+ from .participant_list_commissions_params import ParticipantListCommissionsParams as ParticipantListCommissionsParams
27
+ from .participant_record_transaction_params import (
28
+ ParticipantRecordTransactionParams as ParticipantRecordTransactionParams,
29
+ )
30
+ from .participant_trigger_referral_response import (
31
+ ParticipantTriggerReferralResponse as ParticipantTriggerReferralResponse,
32
+ )
33
+ from .participant_record_transaction_response import (
34
+ ParticipantRecordTransactionResponse as ParticipantRecordTransactionResponse,
35
+ )
@@ -0,0 +1,73 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, List, Optional
4
+ from typing_extensions import Literal
5
+
6
+ from pydantic import Field as FieldInfo
7
+
8
+ from ..._models import BaseModel
9
+ from ..commission_structure import CommissionStructure
10
+
11
+ __all__ = ["Campaign", "Reward"]
12
+
13
+
14
+ class Reward(BaseModel):
15
+ id: str
16
+
17
+ is_unlimited: bool = FieldInfo(alias="isUnlimited")
18
+
19
+ metadata: Dict[str, object]
20
+ """Shallow custom metadata object."""
21
+
22
+ type: Literal["SINGLE_SIDED", "DOUBLE_SIDED", "MILESTONE", "LEADERBOARD", "AFFILIATE"]
23
+
24
+ commission_structure: Optional[CommissionStructure] = FieldInfo(alias="commissionStructure", default=None)
25
+
26
+ conversions_required: Optional[int] = FieldInfo(alias="conversionsRequired", default=None)
27
+
28
+ coupon_code: Optional[str] = FieldInfo(alias="couponCode", default=None)
29
+
30
+ description: Optional[str] = None
31
+
32
+ image_url: Optional[str] = FieldInfo(alias="imageUrl", default=None)
33
+
34
+ limit: Optional[int] = None
35
+ """`-1` represents an unlimited reward in REST responses."""
36
+
37
+ limit_duration: Optional[Literal["IN_TOTAL", "PER_MONTH"]] = FieldInfo(alias="limitDuration", default=None)
38
+
39
+ next_milestone_prefix: Optional[str] = FieldInfo(alias="nextMilestonePrefix", default=None)
40
+
41
+ next_milestone_suffix: Optional[str] = FieldInfo(alias="nextMilestoneSuffix", default=None)
42
+
43
+ number_of_winners: Optional[int] = FieldInfo(alias="numberOfWinners", default=None)
44
+
45
+ order: Optional[int] = None
46
+
47
+ referral_description: Optional[str] = FieldInfo(alias="referralDescription", default=None)
48
+
49
+ referred_reward_upfront: Optional[bool] = FieldInfo(alias="referredRewardUpfront", default=None)
50
+
51
+
52
+ class Campaign(BaseModel):
53
+ id: str
54
+
55
+ impression_count: int = FieldInfo(alias="impressionCount")
56
+
57
+ invite_count: int = FieldInfo(alias="inviteCount")
58
+
59
+ name: str
60
+
61
+ participant_count: int = FieldInfo(alias="participantCount")
62
+
63
+ referral_count: int = FieldInfo(alias="referralCount")
64
+
65
+ rewards: List[Reward]
66
+
67
+ status: Literal["DRAFT", "IN_PROGRESS", "COMPLETE", "DELETED"]
68
+
69
+ type: Literal["REFERRAL", "AFFILIATE"]
70
+
71
+ winner_count: int = FieldInfo(alias="winnerCount")
72
+
73
+ currency_iso: Optional[str] = FieldInfo(alias="currencyISO", default=None)
@@ -0,0 +1,9 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ..._models import BaseModel
4
+
5
+ __all__ = ["CommissionApproveResponse"]
6
+
7
+
8
+ class CommissionApproveResponse(BaseModel):
9
+ success: bool
@@ -0,0 +1,9 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ..._models import BaseModel
4
+
5
+ __all__ = ["CommissionDeleteResponse"]
6
+
7
+
8
+ class CommissionDeleteResponse(BaseModel):
9
+ success: bool
@@ -0,0 +1,7 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing_extensions import Literal, TypeAlias
4
+
5
+ __all__ = ["FraudRiskLevel"]
6
+
7
+ FraudRiskLevel: TypeAlias = Literal["LOW", "MEDIUM", "HIGH"]
@@ -0,0 +1,147 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, List, Optional
4
+
5
+ from pydantic import Field as FieldInfo
6
+
7
+ from ..._models import BaseModel
8
+ from .referral_source import ReferralSource
9
+ from .referral_status import ReferralStatus
10
+ from .fraud_risk_level import FraudRiskLevel
11
+ from .participant_reward import ParticipantReward
12
+
13
+ __all__ = ["Participant", "Referrer"]
14
+
15
+
16
+ class Referrer(BaseModel):
17
+ id: Optional[str] = None
18
+
19
+ created_at: Optional[int] = FieldInfo(alias="createdAt", default=None)
20
+
21
+ email: Optional[str] = None
22
+
23
+ fingerprint: Optional[str] = None
24
+
25
+ first_name: Optional[str] = FieldInfo(alias="firstName", default=None)
26
+
27
+ fraud_reason_code: Optional[str] = FieldInfo(alias="fraudReasonCode", default=None)
28
+
29
+ fraud_risk_level: Optional[FraudRiskLevel] = FieldInfo(alias="fraudRiskLevel", default=None)
30
+
31
+ impression_count: Optional[int] = FieldInfo(alias="impressionCount", default=None)
32
+
33
+ invite_count: Optional[int] = FieldInfo(alias="inviteCount", default=None)
34
+
35
+ ip_address: Optional[str] = FieldInfo(alias="ipAddress", default=None)
36
+
37
+ is_winner: Optional[bool] = FieldInfo(alias="isWinner", default=None)
38
+
39
+ last_name: Optional[str] = FieldInfo(alias="lastName", default=None)
40
+
41
+ metadata: Optional[Dict[str, object]] = None
42
+ """Shallow custom metadata object."""
43
+
44
+ monthly_rank: Optional[int] = FieldInfo(alias="monthlyRank", default=None)
45
+
46
+ monthly_referral_count: Optional[int] = FieldInfo(alias="monthlyReferralCount", default=None)
47
+
48
+ monthly_referrals: Optional[List[str]] = FieldInfo(alias="monthlyReferrals", default=None)
49
+
50
+ prev_monthly_rank: Optional[int] = FieldInfo(alias="prevMonthlyRank", default=None)
51
+
52
+ prev_monthly_referral_count: Optional[int] = FieldInfo(alias="prevMonthlyReferralCount", default=None)
53
+
54
+ rank: Optional[int] = None
55
+
56
+ referral_count: Optional[int] = FieldInfo(alias="referralCount", default=None)
57
+
58
+ referrals: Optional[List[str]] = None
59
+
60
+ referral_source: Optional[ReferralSource] = FieldInfo(alias="referralSource", default=None)
61
+
62
+ referral_status: Optional[ReferralStatus] = FieldInfo(alias="referralStatus", default=None)
63
+
64
+ share_count: Optional[Dict[str, int]] = FieldInfo(alias="shareCount", default=None)
65
+
66
+ share_url: Optional[str] = FieldInfo(alias="shareUrl", default=None)
67
+
68
+ unique_impression_count: Optional[int] = FieldInfo(alias="uniqueImpressionCount", default=None)
69
+
70
+ unsubscribed: Optional[bool] = None
71
+
72
+
73
+ class Participant(BaseModel):
74
+ id: str
75
+
76
+ email: str
77
+
78
+ monthly_rank: int = FieldInfo(alias="monthlyRank")
79
+
80
+ monthly_referral_count: int = FieldInfo(alias="monthlyReferralCount")
81
+
82
+ rank: int
83
+
84
+ referral_count: int = FieldInfo(alias="referralCount")
85
+
86
+ rewards: List[ParticipantReward]
87
+
88
+ share_url: str = FieldInfo(alias="shareUrl")
89
+
90
+ all_matching_fraudsters: Optional[List[Dict[str, object]]] = FieldInfo(alias="allMatchingFraudsters", default=None)
91
+
92
+ created_at: Optional[int] = FieldInfo(alias="createdAt", default=None)
93
+
94
+ fingerprint: Optional[str] = None
95
+
96
+ first_name: Optional[str] = FieldInfo(alias="firstName", default=None)
97
+
98
+ fraud_reason_code: Optional[str] = FieldInfo(alias="fraudReasonCode", default=None)
99
+
100
+ fraud_risk_level: Optional[FraudRiskLevel] = FieldInfo(alias="fraudRiskLevel", default=None)
101
+
102
+ impression_count: Optional[int] = FieldInfo(alias="impressionCount", default=None)
103
+
104
+ invite_count: Optional[int] = FieldInfo(alias="inviteCount", default=None)
105
+
106
+ ip_address: Optional[str] = FieldInfo(alias="ipAddress", default=None)
107
+
108
+ is_new: Optional[bool] = FieldInfo(alias="isNew", default=None)
109
+
110
+ is_winner: Optional[bool] = FieldInfo(alias="isWinner", default=None)
111
+
112
+ last_name: Optional[str] = FieldInfo(alias="lastName", default=None)
113
+
114
+ metadata: Optional[Dict[str, object]] = None
115
+ """Shallow custom metadata object."""
116
+
117
+ monthly_referrals: Optional[List[str]] = FieldInfo(alias="monthlyReferrals", default=None)
118
+
119
+ notes: Optional[str] = None
120
+
121
+ paypal_email_address: Optional[str] = FieldInfo(alias="paypalEmailAddress", default=None)
122
+
123
+ prev_monthly_rank: Optional[int] = FieldInfo(alias="prevMonthlyRank", default=None)
124
+
125
+ prev_monthly_referral_count: Optional[int] = FieldInfo(alias="prevMonthlyReferralCount", default=None)
126
+
127
+ referrals: Optional[List[str]] = None
128
+
129
+ referral_source: Optional[ReferralSource] = FieldInfo(alias="referralSource", default=None)
130
+
131
+ referral_status: Optional[ReferralStatus] = FieldInfo(alias="referralStatus", default=None)
132
+
133
+ referred_by: Optional[str] = FieldInfo(alias="referredBy", default=None)
134
+
135
+ referrer: Optional[Referrer] = None
136
+
137
+ share_count: Optional[Dict[str, int]] = FieldInfo(alias="shareCount", default=None)
138
+
139
+ unique_impression_count: Optional[int] = FieldInfo(alias="uniqueImpressionCount", default=None)
140
+
141
+ unread_commissions_count: Optional[int] = FieldInfo(alias="unreadCommissionsCount", default=None)
142
+
143
+ unread_payouts_count: Optional[int] = FieldInfo(alias="unreadPayoutsCount", default=None)
144
+
145
+ unsubscribed: Optional[bool] = None
146
+
147
+ vanity_keys: Optional[List[str]] = FieldInfo(alias="vanityKeys", default=None)