growsurf-python 0.2.0__tar.gz → 0.4.0__tar.gz

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 (120) hide show
  1. growsurf_python-0.4.0/.release-please-manifest.json +3 -0
  2. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/CHANGELOG.md +16 -0
  3. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/PKG-INFO +1 -1
  4. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/api.md +3 -2
  5. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/pyproject.toml +1 -1
  6. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_version.py +1 -1
  7. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/resources/campaign/campaign.py +147 -0
  8. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/resources/campaign/participant.py +10 -101
  9. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/__init__.py +6 -0
  10. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/__init__.py +0 -3
  11. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant.py +6 -0
  12. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_add_params.py +6 -0
  13. growsurf_python-0.4.0/src/growsurf/types/campaign_create_mobile_participant_token_params.py +36 -0
  14. growsurf_python-0.4.0/src/growsurf/types/campaign_create_mobile_participant_token_response.py +24 -0
  15. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/api_resources/campaign/test_participant.py +22 -135
  16. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/api_resources/test_campaign.py +127 -0
  17. growsurf_python-0.2.0/.release-please-manifest.json +0 -3
  18. growsurf_python-0.2.0/src/growsurf/types/campaign/participant_create_mobile_token_response.py +0 -15
  19. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/.gitignore +0 -0
  20. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/CONTRIBUTING.md +0 -0
  21. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/LICENSE +0 -0
  22. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/README.md +0 -0
  23. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/SECURITY.md +0 -0
  24. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/bin/check-release-environment +0 -0
  25. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/bin/publish-pypi +0 -0
  26. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/examples/.keep +0 -0
  27. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/release-please-config.json +0 -0
  28. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/requirements-dev.lock +0 -0
  29. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/__init__.py +0 -0
  30. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_base_client.py +0 -0
  31. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_client.py +0 -0
  32. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_compat.py +0 -0
  33. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_constants.py +0 -0
  34. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_exceptions.py +0 -0
  35. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_files.py +0 -0
  36. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_models.py +0 -0
  37. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_qs.py +0 -0
  38. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_resource.py +0 -0
  39. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_response.py +0 -0
  40. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_streaming.py +0 -0
  41. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_types.py +0 -0
  42. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/__init__.py +0 -0
  43. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/_compat.py +0 -0
  44. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/_datetime_parse.py +0 -0
  45. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/_json.py +0 -0
  46. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/_logs.py +0 -0
  47. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/_path.py +0 -0
  48. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/_proxy.py +0 -0
  49. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/_reflection.py +0 -0
  50. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/_resources_proxy.py +0 -0
  51. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/_streams.py +0 -0
  52. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/_sync.py +0 -0
  53. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/_transform.py +0 -0
  54. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/_typing.py +0 -0
  55. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/_utils/_utils.py +0 -0
  56. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/lib/.keep +0 -0
  57. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/py.typed +0 -0
  58. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/resources/__init__.py +0 -0
  59. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/resources/campaign/__init__.py +0 -0
  60. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/resources/campaign/commission.py +0 -0
  61. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/resources/campaign/reward.py +0 -0
  62. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/campaign.py +0 -0
  63. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/commission_approve_response.py +0 -0
  64. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/commission_delete_response.py +0 -0
  65. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/fraud_risk_level.py +0 -0
  66. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_delete_response.py +0 -0
  67. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_list_commissions_params.py +0 -0
  68. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_list_payouts_params.py +0 -0
  69. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_list_referrals_params.py +0 -0
  70. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_list_rewards_params.py +0 -0
  71. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_list_rewards_response.py +0 -0
  72. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_record_transaction_params.py +0 -0
  73. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_record_transaction_response.py +0 -0
  74. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_reward.py +0 -0
  75. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_send_invites_params.py +0 -0
  76. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_send_invites_response.py +0 -0
  77. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_trigger_referral_response.py +0 -0
  78. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/participant_update_params.py +0 -0
  79. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/referral_source.py +0 -0
  80. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/referral_status.py +0 -0
  81. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/reward_approve_params.py +0 -0
  82. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/reward_approve_response.py +0 -0
  83. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/reward_delete_response.py +0 -0
  84. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign/reward_fulfill_response.py +0 -0
  85. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign_list_commissions_params.py +0 -0
  86. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign_list_leaderboard_params.py +0 -0
  87. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign_list_participants_params.py +0 -0
  88. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign_list_payouts_params.py +0 -0
  89. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign_list_referrals_params.py +0 -0
  90. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign_list_response.py +0 -0
  91. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign_retrieve_analytics_params.py +0 -0
  92. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/campaign_retrieve_analytics_response.py +0 -0
  93. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/commission_structure.py +0 -0
  94. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/participant_commission_list.py +0 -0
  95. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/participant_list.py +0 -0
  96. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/participant_payout_list.py +0 -0
  97. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/src/growsurf/types/referral_list.py +0 -0
  98. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/__init__.py +0 -0
  99. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/api_resources/__init__.py +0 -0
  100. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/api_resources/campaign/__init__.py +0 -0
  101. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/api_resources/campaign/test_commission.py +0 -0
  102. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/api_resources/campaign/test_reward.py +0 -0
  103. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/conftest.py +0 -0
  104. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/sample_file.txt +0 -0
  105. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_client.py +0 -0
  106. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_extract_files.py +0 -0
  107. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_files.py +0 -0
  108. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_models.py +0 -0
  109. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_qs.py +0 -0
  110. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_required_args.py +0 -0
  111. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_response.py +0 -0
  112. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_streaming.py +0 -0
  113. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_transform.py +0 -0
  114. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_utils/test_datetime_parse.py +0 -0
  115. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_utils/test_json.py +0 -0
  116. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_utils/test_path.py +0 -0
  117. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_utils/test_proxy.py +0 -0
  118. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/test_utils/test_typing.py +0 -0
  119. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/tests/utils.py +0 -0
  120. {growsurf_python-0.2.0 → growsurf_python-0.4.0}/uv.lock +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.4.0"
3
+ }
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0 (2026-05-20)
4
+
5
+ Full Changelog: [v0.3.0...v0.4.0](https://github.com/growsurf/growsurf-python/compare/v0.3.0...v0.4.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** Add Participant.mobileInstanceId ([0dc8db9](https://github.com/growsurf/growsurf-python/commit/0dc8db9d24e075b782975aaa5236281fb8d4c5fd))
10
+
11
+ ## 0.3.0 (2026-05-19)
12
+
13
+ Full Changelog: [v0.2.0...v0.3.0](https://github.com/growsurf/growsurf-python/compare/v0.2.0...v0.3.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** manual updates ([fa106aa](https://github.com/growsurf/growsurf-python/commit/fa106aacec6012c1edd197e17f39bd05fb0396ec))
18
+
3
19
  ## 0.2.0 (2026-05-15)
4
20
 
5
21
  Full Changelog: [v0.1.1...v0.2.0](https://github.com/growsurf/growsurf-python/compare/v0.1.1...v0.2.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: growsurf-python
3
- Version: 0.2.0
3
+ Version: 0.4.0
4
4
  Summary: The official Python library for the growsurf API
5
5
  Project-URL: Homepage, https://github.com/growsurf/growsurf-python
6
6
  Project-URL: Repository, https://github.com/growsurf/growsurf-python
@@ -11,6 +11,7 @@ from growsurf.types import (
11
11
  ParticipantPayoutList,
12
12
  ReferralList,
13
13
  CampaignListResponse,
14
+ CampaignCreateMobileParticipantTokenResponse,
14
15
  CampaignRetrieveAnalyticsResponse,
15
16
  )
16
17
  ```
@@ -19,6 +20,7 @@ Methods:
19
20
 
20
21
  - <code title="get /campaign/{id}">client.campaign.<a href="./src/growsurf/resources/campaign/campaign.py">retrieve</a>(id) -> <a href="./src/growsurf/types/campaign/campaign.py">Campaign</a></code>
21
22
  - <code title="get /campaigns">client.campaign.<a href="./src/growsurf/resources/campaign/campaign.py">list</a>() -> <a href="./src/growsurf/types/campaign_list_response.py">CampaignListResponse</a></code>
23
+ - <code title="post /campaign/{id}/mobile-participant-token">client.campaign.<a href="./src/growsurf/resources/campaign/campaign.py">create_mobile_participant_token</a>(id, \*\*<a href="src/growsurf/types/campaign_create_mobile_participant_token_params.py">params</a>) -> <a href="./src/growsurf/types/campaign_create_mobile_participant_token_response.py">CampaignCreateMobileParticipantTokenResponse</a></code>
22
24
  - <code title="get /campaign/{id}/commissions">client.campaign.<a href="./src/growsurf/resources/campaign/campaign.py">list_commissions</a>(id, \*\*<a href="src/growsurf/types/campaign_list_commissions_params.py">params</a>) -> <a href="./src/growsurf/types/participant_commission_list.py">ParticipantCommissionList</a></code>
23
25
  - <code title="get /campaign/{id}/leaderboard">client.campaign.<a href="./src/growsurf/resources/campaign/campaign.py">list_leaderboard</a>(id, \*\*<a href="src/growsurf/types/campaign_list_leaderboard_params.py">params</a>) -> <a href="./src/growsurf/types/participant_list.py">ParticipantList</a></code>
24
26
  - <code title="get /campaign/{id}/participants">client.campaign.<a href="./src/growsurf/resources/campaign/campaign.py">list_participants</a>(id, \*\*<a href="src/growsurf/types/campaign_list_participants_params.py">params</a>) -> <a href="./src/growsurf/types/participant_list.py">ParticipantList</a></code>
@@ -32,13 +34,13 @@ Types:
32
34
 
33
35
  ```python
34
36
  from growsurf.types.campaign import (
37
+ Create,
35
38
  FraudRiskLevel,
36
39
  Participant,
37
40
  ParticipantReward,
38
41
  ReferralSource,
39
42
  ReferralStatus,
40
43
  ParticipantDeleteResponse,
41
- ParticipantCreateMobileTokenResponse,
42
44
  ParticipantListRewardsResponse,
43
45
  ParticipantRecordTransactionResponse,
44
46
  ParticipantSendInvitesResponse,
@@ -52,7 +54,6 @@ Methods:
52
54
  - <code title="post /campaign/{id}/participant/{participantIdOrEmail}">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">update</a>(participant_id_or_email, \*, id, \*\*<a href="src/growsurf/types/campaign/participant_update_params.py">params</a>) -> <a href="./src/growsurf/types/campaign/participant.py">Participant</a></code>
53
55
  - <code title="delete /campaign/{id}/participant/{participantIdOrEmail}">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">delete</a>(participant_id_or_email, \*, id) -> <a href="./src/growsurf/types/campaign/participant_delete_response.py">ParticipantDeleteResponse</a></code>
54
56
  - <code title="post /campaign/{id}/participant">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">add</a>(id, \*\*<a href="src/growsurf/types/campaign/participant_add_params.py">params</a>) -> <a href="./src/growsurf/types/campaign/participant.py">Participant</a></code>
55
- - <code title="post /campaign/{id}/participant/{participantIdOrEmail}/mobile-token">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">create_mobile_token</a>(participant_id_or_email, \*, id) -> <a href="./src/growsurf/types/campaign/participant_create_mobile_token_response.py">ParticipantCreateMobileTokenResponse</a></code>
56
57
  - <code title="get /campaign/{id}/participant/{participantIdOrEmail}/commissions">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">list_commissions</a>(participant_id_or_email, \*, id, \*\*<a href="src/growsurf/types/campaign/participant_list_commissions_params.py">params</a>) -> <a href="./src/growsurf/types/participant_commission_list.py">ParticipantCommissionList</a></code>
57
58
  - <code title="get /campaign/{id}/participant/{participantIdOrEmail}/payouts">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">list_payouts</a>(participant_id_or_email, \*, id, \*\*<a href="src/growsurf/types/campaign/participant_list_payouts_params.py">params</a>) -> <a href="./src/growsurf/types/participant_payout_list.py">ParticipantPayoutList</a></code>
58
59
  - <code title="get /campaign/{id}/participant/{participantIdOrEmail}/referrals">client.campaign.participant.<a href="./src/growsurf/resources/campaign/participant.py">list_referrals</a>(participant_id_or_email, \*, id, \*\*<a href="src/growsurf/types/campaign/participant_list_referrals_params.py">params</a>) -> <a href="./src/growsurf/types/referral_list.py">ReferralList</a></code>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "growsurf-python"
3
- version = "0.2.0"
3
+ version = "0.4.0"
4
4
  description = "The official Python library for the growsurf API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "growsurf"
4
- __version__ = "0.2.0" # x-release-please-version
4
+ __version__ = "0.4.0" # x-release-please-version
@@ -2,6 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from typing import Dict
5
6
  from typing_extensions import Literal
6
7
 
7
8
  import httpx
@@ -21,6 +22,7 @@ from ...types import (
21
22
  campaign_list_leaderboard_params,
22
23
  campaign_list_participants_params,
23
24
  campaign_retrieve_analytics_params,
25
+ campaign_create_mobile_participant_token_params,
24
26
  )
25
27
  from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
26
28
  from ..._utils import path_template, maybe_transform, async_maybe_transform
@@ -58,6 +60,7 @@ from ...types.participant_payout_list import ParticipantPayoutList
58
60
  from ...types.campaign.referral_status import ReferralStatus
59
61
  from ...types.participant_commission_list import ParticipantCommissionList
60
62
  from ...types.campaign_retrieve_analytics_response import CampaignRetrieveAnalyticsResponse
63
+ from ...types.campaign_create_mobile_participant_token_response import CampaignCreateMobileParticipantTokenResponse
61
64
 
62
65
  __all__ = ["CampaignResource", "AsyncCampaignResource"]
63
66
 
@@ -148,6 +151,72 @@ class CampaignResource(SyncAPIResource):
148
151
  cast_to=CampaignListResponse,
149
152
  )
150
153
 
154
+ def create_mobile_participant_token(
155
+ self,
156
+ id: str,
157
+ *,
158
+ email: str,
159
+ fingerprint: str | Omit = omit,
160
+ first_name: str | Omit = omit,
161
+ ip_address: str | Omit = omit,
162
+ last_name: str | Omit = omit,
163
+ metadata: Dict[str, object] | Omit = omit,
164
+ mobile_instance_id: str | Omit = omit,
165
+ referral_status: Literal["CREDIT_PENDING", "CREDIT_AWARDED"] | Omit = omit,
166
+ referred_by: str | Omit = omit,
167
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
168
+ # The extra values given here take precedence over values defined on the client or passed to this method.
169
+ extra_headers: Headers | None = None,
170
+ extra_query: Query | None = None,
171
+ extra_body: Body | None = None,
172
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
173
+ ) -> CampaignCreateMobileParticipantTokenResponse:
174
+ """
175
+ Creates or returns a participant using the same input behavior as Add
176
+ Participant, then returns a participant-scoped token for GrowSurf mobile SDK
177
+ participant endpoints. Use this endpoint from your backend after your mobile app
178
+ authenticates a signed-in user. The program must have mobile SDK access enabled.
179
+
180
+ Args:
181
+ metadata: Shallow custom metadata object.
182
+
183
+ mobile_instance_id: Optional app-install scoped identifier for native mobile anti-fraud. Recommended
184
+ for mobile participant creation and mobile participant token flows.
185
+
186
+ referred_by: Referrer participant ID or email address.
187
+
188
+ extra_headers: Send extra headers
189
+
190
+ extra_query: Add additional query parameters to the request
191
+
192
+ extra_body: Add additional JSON properties to the request
193
+
194
+ timeout: Override the client-level default timeout for this request, in seconds
195
+ """
196
+ if not id:
197
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
198
+ return self._post(
199
+ path_template("/campaign/{id}/mobile-participant-token", id=id),
200
+ body=maybe_transform(
201
+ {
202
+ "email": email,
203
+ "fingerprint": fingerprint,
204
+ "first_name": first_name,
205
+ "ip_address": ip_address,
206
+ "last_name": last_name,
207
+ "metadata": metadata,
208
+ "mobile_instance_id": mobile_instance_id,
209
+ "referral_status": referral_status,
210
+ "referred_by": referred_by,
211
+ },
212
+ campaign_create_mobile_participant_token_params.CampaignCreateMobileParticipantTokenParams,
213
+ ),
214
+ options=make_request_options(
215
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
216
+ ),
217
+ cast_to=CampaignCreateMobileParticipantTokenResponse,
218
+ )
219
+
151
220
  def list_commissions(
152
221
  self,
153
222
  id: str,
@@ -592,6 +661,72 @@ class AsyncCampaignResource(AsyncAPIResource):
592
661
  cast_to=CampaignListResponse,
593
662
  )
594
663
 
664
+ async def create_mobile_participant_token(
665
+ self,
666
+ id: str,
667
+ *,
668
+ email: str,
669
+ fingerprint: str | Omit = omit,
670
+ first_name: str | Omit = omit,
671
+ ip_address: str | Omit = omit,
672
+ last_name: str | Omit = omit,
673
+ metadata: Dict[str, object] | Omit = omit,
674
+ mobile_instance_id: str | Omit = omit,
675
+ referral_status: Literal["CREDIT_PENDING", "CREDIT_AWARDED"] | Omit = omit,
676
+ referred_by: str | Omit = omit,
677
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
678
+ # The extra values given here take precedence over values defined on the client or passed to this method.
679
+ extra_headers: Headers | None = None,
680
+ extra_query: Query | None = None,
681
+ extra_body: Body | None = None,
682
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
683
+ ) -> CampaignCreateMobileParticipantTokenResponse:
684
+ """
685
+ Creates or returns a participant using the same input behavior as Add
686
+ Participant, then returns a participant-scoped token for GrowSurf mobile SDK
687
+ participant endpoints. Use this endpoint from your backend after your mobile app
688
+ authenticates a signed-in user. The program must have mobile SDK access enabled.
689
+
690
+ Args:
691
+ metadata: Shallow custom metadata object.
692
+
693
+ mobile_instance_id: Optional app-install scoped identifier for native mobile anti-fraud. Recommended
694
+ for mobile participant creation and mobile participant token flows.
695
+
696
+ referred_by: Referrer participant ID or email address.
697
+
698
+ extra_headers: Send extra headers
699
+
700
+ extra_query: Add additional query parameters to the request
701
+
702
+ extra_body: Add additional JSON properties to the request
703
+
704
+ timeout: Override the client-level default timeout for this request, in seconds
705
+ """
706
+ if not id:
707
+ raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
708
+ return await self._post(
709
+ path_template("/campaign/{id}/mobile-participant-token", id=id),
710
+ body=await async_maybe_transform(
711
+ {
712
+ "email": email,
713
+ "fingerprint": fingerprint,
714
+ "first_name": first_name,
715
+ "ip_address": ip_address,
716
+ "last_name": last_name,
717
+ "metadata": metadata,
718
+ "mobile_instance_id": mobile_instance_id,
719
+ "referral_status": referral_status,
720
+ "referred_by": referred_by,
721
+ },
722
+ campaign_create_mobile_participant_token_params.CampaignCreateMobileParticipantTokenParams,
723
+ ),
724
+ options=make_request_options(
725
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
726
+ ),
727
+ cast_to=CampaignCreateMobileParticipantTokenResponse,
728
+ )
729
+
595
730
  async def list_commissions(
596
731
  self,
597
732
  id: str,
@@ -960,6 +1095,9 @@ class CampaignResourceWithRawResponse:
960
1095
  self.list = to_raw_response_wrapper(
961
1096
  campaign.list,
962
1097
  )
1098
+ self.create_mobile_participant_token = to_raw_response_wrapper(
1099
+ campaign.create_mobile_participant_token,
1100
+ )
963
1101
  self.list_commissions = to_raw_response_wrapper(
964
1102
  campaign.list_commissions,
965
1103
  )
@@ -1004,6 +1142,9 @@ class AsyncCampaignResourceWithRawResponse:
1004
1142
  self.list = async_to_raw_response_wrapper(
1005
1143
  campaign.list,
1006
1144
  )
1145
+ self.create_mobile_participant_token = async_to_raw_response_wrapper(
1146
+ campaign.create_mobile_participant_token,
1147
+ )
1007
1148
  self.list_commissions = async_to_raw_response_wrapper(
1008
1149
  campaign.list_commissions,
1009
1150
  )
@@ -1048,6 +1189,9 @@ class CampaignResourceWithStreamingResponse:
1048
1189
  self.list = to_streamed_response_wrapper(
1049
1190
  campaign.list,
1050
1191
  )
1192
+ self.create_mobile_participant_token = to_streamed_response_wrapper(
1193
+ campaign.create_mobile_participant_token,
1194
+ )
1051
1195
  self.list_commissions = to_streamed_response_wrapper(
1052
1196
  campaign.list_commissions,
1053
1197
  )
@@ -1092,6 +1236,9 @@ class AsyncCampaignResourceWithStreamingResponse:
1092
1236
  self.list = async_to_streamed_response_wrapper(
1093
1237
  campaign.list,
1094
1238
  )
1239
+ self.create_mobile_participant_token = async_to_streamed_response_wrapper(
1240
+ campaign.create_mobile_participant_token,
1241
+ )
1095
1242
  self.list_commissions = async_to_streamed_response_wrapper(
1096
1243
  campaign.list_commissions,
1097
1244
  )
@@ -39,7 +39,6 @@ from ...types.campaign.participant_list_rewards_response import ParticipantListR
39
39
  from ...types.campaign.participant_send_invites_response import ParticipantSendInvitesResponse
40
40
  from ...types.campaign.participant_trigger_referral_response import ParticipantTriggerReferralResponse
41
41
  from ...types.campaign.participant_record_transaction_response import ParticipantRecordTransactionResponse
42
- from ...types.campaign.participant_create_mobile_token_response import ParticipantCreateMobileTokenResponse
43
42
 
44
43
  __all__ = ["ParticipantResource", "AsyncParticipantResource"]
45
44
 
@@ -223,6 +222,7 @@ class ParticipantResource(SyncAPIResource):
223
222
  ip_address: str | Omit = omit,
224
223
  last_name: str | Omit = omit,
225
224
  metadata: Dict[str, object] | Omit = omit,
225
+ mobile_instance_id: str | Omit = omit,
226
226
  referral_status: Literal["CREDIT_PENDING", "CREDIT_AWARDED"] | Omit = omit,
227
227
  referred_by: str | Omit = omit,
228
228
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -240,6 +240,9 @@ class ParticipantResource(SyncAPIResource):
240
240
  Args:
241
241
  metadata: Shallow custom metadata object.
242
242
 
243
+ mobile_instance_id: Optional app-install scoped identifier for native mobile anti-fraud. Recommended
244
+ for mobile participant creation and mobile participant token flows.
245
+
243
246
  referred_by: Referrer participant ID or email address.
244
247
 
245
248
  extra_headers: Send extra headers
@@ -262,6 +265,7 @@ class ParticipantResource(SyncAPIResource):
262
265
  "ip_address": ip_address,
263
266
  "last_name": last_name,
264
267
  "metadata": metadata,
268
+ "mobile_instance_id": mobile_instance_id,
265
269
  "referral_status": referral_status,
266
270
  "referred_by": referred_by,
267
271
  },
@@ -273,50 +277,6 @@ class ParticipantResource(SyncAPIResource):
273
277
  cast_to=Participant,
274
278
  )
275
279
 
276
- def create_mobile_token(
277
- self,
278
- participant_id_or_email: str,
279
- *,
280
- id: str,
281
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
282
- # The extra values given here take precedence over values defined on the client or passed to this method.
283
- extra_headers: Headers | None = None,
284
- extra_query: Query | None = None,
285
- extra_body: Body | None = None,
286
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
287
- ) -> ParticipantCreateMobileTokenResponse:
288
- """Creates a participant-scoped token for GrowSurf mobile SDK participant
289
- endpoints.
290
-
291
- The program must have mobile SDK access enabled.
292
-
293
- Args:
294
- extra_headers: Send extra headers
295
-
296
- extra_query: Add additional query parameters to the request
297
-
298
- extra_body: Add additional JSON properties to the request
299
-
300
- timeout: Override the client-level default timeout for this request, in seconds
301
- """
302
- if not id:
303
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
304
- if not participant_id_or_email:
305
- raise ValueError(
306
- f"Expected a non-empty value for `participant_id_or_email` but received {participant_id_or_email!r}"
307
- )
308
- return self._post(
309
- path_template(
310
- "/campaign/{id}/participant/{participant_id_or_email}/mobile-token",
311
- id=id,
312
- participant_id_or_email=participant_id_or_email,
313
- ),
314
- options=make_request_options(
315
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
316
- ),
317
- cast_to=ParticipantCreateMobileTokenResponse,
318
- )
319
-
320
280
  def list_commissions(
321
281
  self,
322
282
  participant_id_or_email: str,
@@ -961,6 +921,7 @@ class AsyncParticipantResource(AsyncAPIResource):
961
921
  ip_address: str | Omit = omit,
962
922
  last_name: str | Omit = omit,
963
923
  metadata: Dict[str, object] | Omit = omit,
924
+ mobile_instance_id: str | Omit = omit,
964
925
  referral_status: Literal["CREDIT_PENDING", "CREDIT_AWARDED"] | Omit = omit,
965
926
  referred_by: str | Omit = omit,
966
927
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -978,6 +939,9 @@ class AsyncParticipantResource(AsyncAPIResource):
978
939
  Args:
979
940
  metadata: Shallow custom metadata object.
980
941
 
942
+ mobile_instance_id: Optional app-install scoped identifier for native mobile anti-fraud. Recommended
943
+ for mobile participant creation and mobile participant token flows.
944
+
981
945
  referred_by: Referrer participant ID or email address.
982
946
 
983
947
  extra_headers: Send extra headers
@@ -1000,6 +964,7 @@ class AsyncParticipantResource(AsyncAPIResource):
1000
964
  "ip_address": ip_address,
1001
965
  "last_name": last_name,
1002
966
  "metadata": metadata,
967
+ "mobile_instance_id": mobile_instance_id,
1003
968
  "referral_status": referral_status,
1004
969
  "referred_by": referred_by,
1005
970
  },
@@ -1011,50 +976,6 @@ class AsyncParticipantResource(AsyncAPIResource):
1011
976
  cast_to=Participant,
1012
977
  )
1013
978
 
1014
- async def create_mobile_token(
1015
- self,
1016
- participant_id_or_email: str,
1017
- *,
1018
- id: str,
1019
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1020
- # The extra values given here take precedence over values defined on the client or passed to this method.
1021
- extra_headers: Headers | None = None,
1022
- extra_query: Query | None = None,
1023
- extra_body: Body | None = None,
1024
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
1025
- ) -> ParticipantCreateMobileTokenResponse:
1026
- """Creates a participant-scoped token for GrowSurf mobile SDK participant
1027
- endpoints.
1028
-
1029
- The program must have mobile SDK access enabled.
1030
-
1031
- Args:
1032
- extra_headers: Send extra headers
1033
-
1034
- extra_query: Add additional query parameters to the request
1035
-
1036
- extra_body: Add additional JSON properties to the request
1037
-
1038
- timeout: Override the client-level default timeout for this request, in seconds
1039
- """
1040
- if not id:
1041
- raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
1042
- if not participant_id_or_email:
1043
- raise ValueError(
1044
- f"Expected a non-empty value for `participant_id_or_email` but received {participant_id_or_email!r}"
1045
- )
1046
- return await self._post(
1047
- path_template(
1048
- "/campaign/{id}/participant/{participant_id_or_email}/mobile-token",
1049
- id=id,
1050
- participant_id_or_email=participant_id_or_email,
1051
- ),
1052
- options=make_request_options(
1053
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
1054
- ),
1055
- cast_to=ParticipantCreateMobileTokenResponse,
1056
- )
1057
-
1058
979
  async def list_commissions(
1059
980
  self,
1060
981
  participant_id_or_email: str,
@@ -1536,9 +1457,6 @@ class ParticipantResourceWithRawResponse:
1536
1457
  self.add = to_raw_response_wrapper(
1537
1458
  participant.add,
1538
1459
  )
1539
- self.create_mobile_token = to_raw_response_wrapper(
1540
- participant.create_mobile_token,
1541
- )
1542
1460
  self.list_commissions = to_raw_response_wrapper(
1543
1461
  participant.list_commissions,
1544
1462
  )
@@ -1578,9 +1496,6 @@ class AsyncParticipantResourceWithRawResponse:
1578
1496
  self.add = async_to_raw_response_wrapper(
1579
1497
  participant.add,
1580
1498
  )
1581
- self.create_mobile_token = async_to_raw_response_wrapper(
1582
- participant.create_mobile_token,
1583
- )
1584
1499
  self.list_commissions = async_to_raw_response_wrapper(
1585
1500
  participant.list_commissions,
1586
1501
  )
@@ -1620,9 +1535,6 @@ class ParticipantResourceWithStreamingResponse:
1620
1535
  self.add = to_streamed_response_wrapper(
1621
1536
  participant.add,
1622
1537
  )
1623
- self.create_mobile_token = to_streamed_response_wrapper(
1624
- participant.create_mobile_token,
1625
- )
1626
1538
  self.list_commissions = to_streamed_response_wrapper(
1627
1539
  participant.list_commissions,
1628
1540
  )
@@ -1662,9 +1574,6 @@ class AsyncParticipantResourceWithStreamingResponse:
1662
1574
  self.add = async_to_streamed_response_wrapper(
1663
1575
  participant.add,
1664
1576
  )
1665
- self.create_mobile_token = async_to_streamed_response_wrapper(
1666
- participant.create_mobile_token,
1667
- )
1668
1577
  self.list_commissions = async_to_streamed_response_wrapper(
1669
1578
  participant.list_commissions,
1670
1579
  )
@@ -16,3 +16,9 @@ from .campaign_list_leaderboard_params import CampaignListLeaderboardParams as C
16
16
  from .campaign_list_participants_params import CampaignListParticipantsParams as CampaignListParticipantsParams
17
17
  from .campaign_retrieve_analytics_params import CampaignRetrieveAnalyticsParams as CampaignRetrieveAnalyticsParams
18
18
  from .campaign_retrieve_analytics_response import CampaignRetrieveAnalyticsResponse as CampaignRetrieveAnalyticsResponse
19
+ from .campaign_create_mobile_participant_token_params import (
20
+ CampaignCreateMobileParticipantTokenParams as CampaignCreateMobileParticipantTokenParams,
21
+ )
22
+ from .campaign_create_mobile_participant_token_response import (
23
+ CampaignCreateMobileParticipantTokenResponse as CampaignCreateMobileParticipantTokenResponse,
24
+ )
@@ -33,6 +33,3 @@ from .participant_trigger_referral_response import (
33
33
  from .participant_record_transaction_response import (
34
34
  ParticipantRecordTransactionResponse as ParticipantRecordTransactionResponse,
35
35
  )
36
- from .participant_create_mobile_token_response import (
37
- ParticipantCreateMobileTokenResponse as ParticipantCreateMobileTokenResponse,
38
- )
@@ -114,6 +114,12 @@ class Participant(BaseModel):
114
114
  metadata: Optional[Dict[str, object]] = None
115
115
  """Shallow custom metadata object."""
116
116
 
117
+ mobile_instance_id: Optional[str] = FieldInfo(alias="mobileInstanceId", default=None)
118
+ """
119
+ App-install scoped mobile identifier used for anti-fraud matching when provided
120
+ by native mobile apps. Not stored when strict GDPR/CCPA mode is enabled.
121
+ """
122
+
117
123
  monthly_referrals: Optional[List[str]] = FieldInfo(alias="monthlyReferrals", default=None)
118
124
 
119
125
  notes: Optional[str] = None
@@ -24,6 +24,12 @@ class ParticipantAddParams(TypedDict, total=False):
24
24
  metadata: Dict[str, object]
25
25
  """Shallow custom metadata object."""
26
26
 
27
+ mobile_instance_id: Annotated[str, PropertyInfo(alias="mobileInstanceId")]
28
+ """Optional app-install scoped identifier for native mobile anti-fraud.
29
+
30
+ Recommended for mobile participant creation and mobile participant token flows.
31
+ """
32
+
27
33
  referral_status: Annotated[Literal["CREDIT_PENDING", "CREDIT_AWARDED"], PropertyInfo(alias="referralStatus")]
28
34
 
29
35
  referred_by: Annotated[str, PropertyInfo(alias="referredBy")]
@@ -0,0 +1,36 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict
6
+ from typing_extensions import Literal, Required, Annotated, TypedDict
7
+
8
+ from .._utils import PropertyInfo
9
+
10
+ __all__ = ["CampaignCreateMobileParticipantTokenParams"]
11
+
12
+
13
+ class CampaignCreateMobileParticipantTokenParams(TypedDict, total=False):
14
+ email: Required[str]
15
+
16
+ fingerprint: str
17
+
18
+ first_name: Annotated[str, PropertyInfo(alias="firstName")]
19
+
20
+ ip_address: Annotated[str, PropertyInfo(alias="ipAddress")]
21
+
22
+ last_name: Annotated[str, PropertyInfo(alias="lastName")]
23
+
24
+ metadata: Dict[str, object]
25
+ """Shallow custom metadata object."""
26
+
27
+ mobile_instance_id: Annotated[str, PropertyInfo(alias="mobileInstanceId")]
28
+ """Optional app-install scoped identifier for native mobile anti-fraud.
29
+
30
+ Recommended for mobile participant creation and mobile participant token flows.
31
+ """
32
+
33
+ referral_status: Annotated[Literal["CREDIT_PENDING", "CREDIT_AWARDED"], PropertyInfo(alias="referralStatus")]
34
+
35
+ referred_by: Annotated[str, PropertyInfo(alias="referredBy")]
36
+ """Referrer participant ID or email address."""
@@ -0,0 +1,24 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from pydantic import Field as FieldInfo
4
+
5
+ from .._models import BaseModel
6
+ from .campaign.participant import Participant
7
+
8
+ __all__ = ["CampaignCreateMobileParticipantTokenResponse"]
9
+
10
+
11
+ class CampaignCreateMobileParticipantTokenResponse(BaseModel):
12
+ expires_in: int = FieldInfo(alias="expiresIn")
13
+ """Token lifetime in seconds."""
14
+
15
+ is_new: bool = FieldInfo(alias="isNew")
16
+ """Whether this request created a new participant.
17
+
18
+ Returns false when the participant already existed.
19
+ """
20
+
21
+ participant: Participant
22
+
23
+ participant_token: str = FieldInfo(alias="participantToken")
24
+ """Participant-scoped bearer token for GrowSurf mobile SDK participant endpoints."""