growsurf-ruby 1.2.1 → 1.4.0

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 (131) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/LICENSE +201 -0
  4. data/README.md +1 -1
  5. data/lib/growsurf_ruby/internal/transport/base_client.rb +21 -4
  6. data/lib/growsurf_ruby/models/affiliate_application.rb +249 -0
  7. data/lib/growsurf_ruby/models/affiliate_application_list_response.rb +42 -0
  8. data/lib/growsurf_ruby/models/affiliate_invite.rb +109 -0
  9. data/lib/growsurf_ruby/models/affiliate_invite_list_response.rb +41 -0
  10. data/lib/growsurf_ruby/models/campaign/create.rb +12 -1
  11. data/lib/growsurf_ruby/models/campaign/participant.rb +79 -4
  12. data/lib/growsurf_ruby/models/campaign/participant_analytics_response.rb +28 -17
  13. data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rb +28 -0
  14. data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rb +126 -0
  15. data/lib/growsurf_ruby/models/campaign/participant_list_payouts_params.rb +1 -0
  16. data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rb +50 -0
  17. data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rb +56 -0
  18. data/lib/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rb +25 -25
  19. data/lib/growsurf_ruby/models/campaign/participant_reward.rb +1 -0
  20. data/lib/growsurf_ruby/models/campaign/participant_update_params.rb +25 -9
  21. data/lib/growsurf_ruby/models/campaign/referral_source.rb +3 -0
  22. data/lib/growsurf_ruby/models/campaign/reward.rb +41 -3
  23. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +26 -4
  24. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +26 -4
  25. data/lib/growsurf_ruby/models/campaign.rb +24 -3
  26. data/lib/growsurf_ruby/models/campaign_create_affiliate_invite_params.rb +45 -0
  27. data/lib/growsurf_ruby/models/campaign_list_affiliate_applications_params.rb +57 -0
  28. data/lib/growsurf_ruby/models/campaign_list_affiliate_invites_params.rb +58 -0
  29. data/lib/growsurf_ruby/models/campaign_list_payouts_params.rb +1 -0
  30. data/lib/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rb +26 -0
  31. data/lib/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rb +26 -0
  32. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_params.rb +9 -6
  33. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +59 -11
  34. data/lib/growsurf_ruby/models/campaign_review_affiliate_application_params.rb +94 -0
  35. data/lib/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rb +26 -0
  36. data/lib/growsurf_ruby/models/commission_structure.rb +16 -3
  37. data/lib/growsurf_ruby/models/email_analytics.rb +41 -0
  38. data/lib/growsurf_ruby/models/participant_commission_list.rb +19 -1
  39. data/lib/growsurf_ruby/models/participant_payout_list.rb +8 -1
  40. data/lib/growsurf_ruby/models/reward_tax_valuation.rb +24 -9
  41. data/lib/growsurf_ruby/models.rb +19 -0
  42. data/lib/growsurf_ruby/resources/campaign/design.rb +14 -12
  43. data/lib/growsurf_ruby/resources/campaign/options.rb +7 -7
  44. data/lib/growsurf_ruby/resources/campaign/participant.rb +101 -14
  45. data/lib/growsurf_ruby/resources/campaign/rewards.rb +8 -4
  46. data/lib/growsurf_ruby/resources/campaign.rb +231 -4
  47. data/lib/growsurf_ruby/version.rb +1 -1
  48. data/lib/growsurf_ruby.rb +16 -0
  49. data/rbi/growsurf_ruby/models/affiliate_application.rbi +431 -0
  50. data/rbi/growsurf_ruby/models/affiliate_application_list_response.rbi +70 -0
  51. data/rbi/growsurf_ruby/models/affiliate_invite.rbi +167 -0
  52. data/rbi/growsurf_ruby/models/affiliate_invite_list_response.rbi +70 -0
  53. data/rbi/growsurf_ruby/models/campaign/create.rbi +17 -0
  54. data/rbi/growsurf_ruby/models/campaign/participant.rbi +169 -3
  55. data/rbi/growsurf_ruby/models/campaign/participant_activity_logs_response.rbi +3 -5
  56. data/rbi/growsurf_ruby/models/campaign/participant_analytics_response.rbi +35 -20
  57. data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbi +3 -1
  58. data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rbi +48 -0
  59. data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbi +243 -0
  60. data/rbi/growsurf_ruby/models/campaign/participant_list_payouts_params.rbi +5 -0
  61. data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rbi +100 -0
  62. data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbi +118 -0
  63. data/rbi/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbi +38 -62
  64. data/rbi/growsurf_ruby/models/campaign/participant_reward.rbi +5 -0
  65. data/rbi/growsurf_ruby/models/campaign/participant_update_params.rbi +67 -11
  66. data/rbi/growsurf_ruby/models/campaign/referral_source.rbi +9 -0
  67. data/rbi/growsurf_ruby/models/campaign/reward.rbi +78 -2
  68. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +68 -4
  69. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +68 -4
  70. data/rbi/growsurf_ruby/models/campaign.rbi +48 -2
  71. data/rbi/growsurf_ruby/models/campaign_create_affiliate_invite_params.rbi +74 -0
  72. data/rbi/growsurf_ruby/models/campaign_list_affiliate_applications_params.rbi +130 -0
  73. data/rbi/growsurf_ruby/models/campaign_list_affiliate_invites_params.rbi +135 -0
  74. data/rbi/growsurf_ruby/models/campaign_list_payouts_params.rbi +5 -0
  75. data/rbi/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rbi +46 -0
  76. data/rbi/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rbi +46 -0
  77. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_params.rbi +15 -10
  78. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +68 -18
  79. data/rbi/growsurf_ruby/models/campaign_review_affiliate_application_params.rbi +167 -0
  80. data/rbi/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rbi +46 -0
  81. data/rbi/growsurf_ruby/models/commission_structure.rbi +34 -3
  82. data/rbi/growsurf_ruby/models/email_analytics.rbi +200 -0
  83. data/rbi/growsurf_ruby/models/participant_commission_list.rbi +48 -0
  84. data/rbi/growsurf_ruby/models/participant_payout_list.rbi +17 -3
  85. data/rbi/growsurf_ruby/models/reward_tax_valuation.rbi +66 -9
  86. data/rbi/growsurf_ruby/models.rbi +25 -0
  87. data/rbi/growsurf_ruby/resources/campaign/design.rbi +9 -8
  88. data/rbi/growsurf_ruby/resources/campaign/options.rbi +7 -7
  89. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +99 -18
  90. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +18 -4
  91. data/rbi/growsurf_ruby/resources/campaign.rbi +188 -10
  92. data/sig/growsurf_ruby/models/affiliate_application.rbs +192 -0
  93. data/sig/growsurf_ruby/models/affiliate_application_list_response.rbs +39 -0
  94. data/sig/growsurf_ruby/models/affiliate_invite.rbs +92 -0
  95. data/sig/growsurf_ruby/models/affiliate_invite_list_response.rbs +39 -0
  96. data/sig/growsurf_ruby/models/campaign/create.rbs +7 -0
  97. data/sig/growsurf_ruby/models/campaign/participant.rbs +62 -2
  98. data/sig/growsurf_ruby/models/campaign/participant_activity_logs_response.rbs +2 -11
  99. data/sig/growsurf_ruby/models/campaign/participant_analytics_response.rbs +12 -12
  100. data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rbs +30 -0
  101. data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbs +107 -0
  102. data/sig/growsurf_ruby/models/campaign/participant_list_payouts_params.rbs +2 -1
  103. data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rbs +49 -0
  104. data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbs +57 -0
  105. data/sig/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbs +5 -13
  106. data/sig/growsurf_ruby/models/campaign/participant_reward.rbs +2 -1
  107. data/sig/growsurf_ruby/models/campaign/participant_update_params.rbs +21 -7
  108. data/sig/growsurf_ruby/models/campaign/referral_source.rbs +4 -1
  109. data/sig/growsurf_ruby/models/campaign/reward.rbs +28 -0
  110. data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +20 -0
  111. data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +20 -0
  112. data/sig/growsurf_ruby/models/campaign.rbs +16 -0
  113. data/sig/growsurf_ruby/models/campaign_create_affiliate_invite_params.rbs +40 -0
  114. data/sig/growsurf_ruby/models/campaign_list_affiliate_applications_params.rbs +61 -0
  115. data/sig/growsurf_ruby/models/campaign_list_affiliate_invites_params.rbs +62 -0
  116. data/sig/growsurf_ruby/models/campaign_list_payouts_params.rbs +2 -1
  117. data/sig/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rbs +28 -0
  118. data/sig/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rbs +28 -0
  119. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +36 -16
  120. data/sig/growsurf_ruby/models/campaign_review_affiliate_application_params.rbs +79 -0
  121. data/sig/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rbs +28 -0
  122. data/sig/growsurf_ruby/models/commission_structure.rbs +16 -4
  123. data/sig/growsurf_ruby/models/email_analytics.rbs +92 -0
  124. data/sig/growsurf_ruby/models/participant_commission_list.rbs +16 -0
  125. data/sig/growsurf_ruby/models/participant_payout_list.rbs +12 -4
  126. data/sig/growsurf_ruby/models/reward_tax_valuation.rbs +26 -4
  127. data/sig/growsurf_ruby/models.rbs +18 -0
  128. data/sig/growsurf_ruby/resources/campaign/participant.rbs +16 -2
  129. data/sig/growsurf_ruby/resources/campaign/rewards.rbs +2 -0
  130. data/sig/growsurf_ruby/resources/campaign.rbs +53 -0
  131. metadata +54 -3
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ # @see GrowsurfRuby::Resources::Campaign#list_affiliate_invites
6
+ class CampaignListAffiliateInvitesParams < GrowsurfRuby::Internal::Type::BaseModel
7
+ extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
8
+ include GrowsurfRuby::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!attribute limit
16
+ # How many invites to return per page (1-100).
17
+ #
18
+ # @return [Integer, nil]
19
+ optional :limit, Integer
20
+
21
+ # @!attribute offset
22
+ # Offset number used to skip through a result set.
23
+ #
24
+ # @return [Integer, nil]
25
+ optional :offset, Integer
26
+
27
+ # @!attribute status
28
+ # Only return invites with this status.
29
+ #
30
+ # @return [Symbol, GrowsurfRuby::Models::CampaignListAffiliateInvitesParams::Status, nil]
31
+ optional :status, enum: -> { GrowsurfRuby::CampaignListAffiliateInvitesParams::Status }
32
+
33
+ # @!method initialize(id:, limit: nil, offset: nil, status: nil, request_options: {})
34
+ # @param id [String]
35
+ #
36
+ # @param limit [Integer] How many invites to return per page (1-100).
37
+ #
38
+ # @param offset [Integer] Offset number used to skip through a result set.
39
+ #
40
+ # @param status [Symbol, GrowsurfRuby::Models::CampaignListAffiliateInvitesParams::Status] Only return invites with this status.
41
+ #
42
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
43
+
44
+ # Only return invites with this status.
45
+ module Status
46
+ extend GrowsurfRuby::Internal::Type::Enum
47
+
48
+ PENDING = :PENDING
49
+ ACCEPTED = :ACCEPTED
50
+ EXPIRED = :EXPIRED
51
+ REVOKED = :REVOKED
52
+
53
+ # @!method self.values
54
+ # @return [Array<Symbol>]
55
+ end
56
+ end
57
+ end
58
+ end
@@ -49,6 +49,7 @@ module GrowsurfRuby
49
49
  QUEUED = :QUEUED
50
50
  ISSUED = :ISSUED
51
51
  FAILED = :FAILED
52
+ REVERSED = :REVERSED
52
53
 
53
54
  # @!method self.values
54
55
  # @return [Array<Symbol>]
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ # @see GrowsurfRuby::Resources::Campaign#resend_affiliate_invite
6
+ class CampaignResendAffiliateInviteParams < GrowsurfRuby::Internal::Type::BaseModel
7
+ extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
8
+ include GrowsurfRuby::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!attribute invite_id
16
+ #
17
+ # @return [String]
18
+ required :invite_id, String
19
+
20
+ # @!method initialize(id:, invite_id:, request_options: {})
21
+ # @param id [String]
22
+ # @param invite_id [String]
23
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ # @see GrowsurfRuby::Resources::Campaign#retrieve_affiliate_application
6
+ class CampaignRetrieveAffiliateApplicationParams < GrowsurfRuby::Internal::Type::BaseModel
7
+ extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
8
+ include GrowsurfRuby::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!attribute application_id
16
+ #
17
+ # @return [String]
18
+ required :application_id, String
19
+
20
+ # @!method initialize(id:, application_id:, request_options: {})
21
+ # @param id [String]
22
+ # @param application_id [String]
23
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
24
+ end
25
+ end
26
+ end
@@ -26,11 +26,14 @@ module GrowsurfRuby
26
26
  optional :end_date, Integer
27
27
 
28
28
  # @!attribute include
29
- # Comma-separated list of optional enrichments (opt-in to keep the default response
30
- # lean): `previousPeriod` adds totals for the equal-length window immediately before
31
- # the requested one; `statusCounts` adds reward (and, for affiliate programs,
32
- # affiliate/commission/payout) status breakdowns; `rates` adds derived referral
33
- # rates.
29
+ # Comma-separated list of optional data to include: `previousPeriod` adds totals for
30
+ # the equal-length window immediately before the requested one; `statusCounts` adds
31
+ # reward (and, for affiliate programs, affiliate/commission/payout) status breakdowns;
32
+ # `rates` adds derived referral rates; `email` adds `sent`, `delivered`, `opened`,
33
+ # `clicked`, `bounced`, `spamComplaints`, and per-email-type metrics. When `email` and
34
+ # an interval are both requested, each `series` item also contains counts for emails
35
+ # sent during that period. Combine `email` with `previousPeriod` to include the same
36
+ # email metrics in both windows.
34
37
  #
35
38
  # @return [String, nil]
36
39
  optional :include, String
@@ -59,7 +62,7 @@ module GrowsurfRuby
59
62
  #
60
63
  # @param end_date [Integer] End date of the analytics timeframe as a Unix timestamp in milliseconds. Require
61
64
  #
62
- # @param include [String] Comma-separated list of optional enrichments (opt-in to keep the default response
65
+ # @param include [String] Comma-separated list of optional data to include: `previousPeriod` adds totals for
63
66
  #
64
67
  # @param interval [Symbol, GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams::Interval] When set to `day`, `week`, or `month`, the response also includes a `series` array
65
68
  #
@@ -19,6 +19,9 @@ module GrowsurfRuby
19
19
  # @return [Integer]
20
20
  required :start_date, Integer, api_name: :startDate
21
21
 
22
+ # Present only when `include` contains `email`.
23
+ optional :email, -> { GrowsurfRuby::Models::EmailAnalytics }
24
+
22
25
  # @!attribute previous_period
23
26
  # Present only when `include` contains `previousPeriod`.
24
27
  #
@@ -199,6 +202,13 @@ module GrowsurfRuby
199
202
  # @return [Integer, nil]
200
203
  optional :twitter_shares, Integer, api_name: :twitterShares
201
204
 
205
+ # @!attribute unique_commission_referrals
206
+ # Affiliate programs only. Number of unique referred participants represented by
207
+ # commissions in the requested timeframe.
208
+ #
209
+ # @return [Integer, nil]
210
+ optional :unique_commission_referrals, Integer, api_name: :uniqueCommissionReferrals
211
+
202
212
  # @!attribute unique_impressions
203
213
  #
204
214
  # @return [Integer, nil]
@@ -214,7 +224,7 @@ module GrowsurfRuby
214
224
  # @return [Integer, nil]
215
225
  optional :whats_app_shares, Integer, api_name: :whatsAppShares
216
226
 
217
- # @!method initialize(android_native_shares: nil, bluesky_shares: nil, copy_ref_link_shares: nil, email_shares: nil, facebook_shares: nil, impressions: nil, invites: nil, ios_native_shares: nil, linked_in_shares: nil, messenger_shares: nil, participants: nil, pinterest_shares: nil, qrcode_shares: nil, reddit_shares: nil, referral_credit_expireds: nil, referral_credit_pendings: nil, referrals: nil, sms_shares: nil, telegram_shares: nil, threads_shares: nil, total_commission_count: nil, total_commissions: nil, total_revenue: nil, tumblr_shares: nil, twitter_shares: nil, unique_impressions: nil, wechat_shares: nil, whats_app_shares: nil)
227
+ # @!method initialize(android_native_shares: nil, bluesky_shares: nil, copy_ref_link_shares: nil, email_shares: nil, facebook_shares: nil, impressions: nil, invites: nil, ios_native_shares: nil, linked_in_shares: nil, messenger_shares: nil, participants: nil, pinterest_shares: nil, qrcode_shares: nil, reddit_shares: nil, referral_credit_expireds: nil, referral_credit_pendings: nil, referrals: nil, sms_shares: nil, telegram_shares: nil, threads_shares: nil, total_commission_count: nil, total_commissions: nil, total_revenue: nil, tumblr_shares: nil, twitter_shares: nil, unique_commission_referrals: nil, unique_impressions: nil, wechat_shares: nil, whats_app_shares: nil)
218
228
  # Some parameter documentations has been truncated, see
219
229
  # {GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::Analytics} for more
220
230
  # details.
@@ -269,6 +279,8 @@ module GrowsurfRuby
269
279
  #
270
280
  # @param twitter_shares [Integer]
271
281
  #
282
+ # @param unique_commission_referrals [Integer] Affiliate programs only. Number of unique referred participants represented by commissions in the requested timeframe.
283
+ #
272
284
  # @param unique_impressions [Integer]
273
285
  #
274
286
  # @param wechat_shares [Integer]
@@ -283,6 +295,9 @@ module GrowsurfRuby
283
295
  # @return [GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::Analytics]
284
296
  required :analytics, -> { GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::Analytics }
285
297
 
298
+ # Present when the parent request includes both `previousPeriod` and `email`.
299
+ optional :email, -> { GrowsurfRuby::Models::EmailAnalytics }
300
+
286
301
  # @!attribute end_date
287
302
  #
288
303
  # @return [Integer]
@@ -355,6 +370,9 @@ module GrowsurfRuby
355
370
  # @return [Integer, nil]
356
371
  optional :email_shares, Integer, api_name: :emailShares
357
372
 
373
+ # Per-period email counts. Present only when `include` contains `email`.
374
+ optional :email, -> { GrowsurfRuby::Models::EmailAnalytics::Counts }
375
+
358
376
  # @!attribute facebook_shares
359
377
  #
360
378
  # @return [Integer, nil]
@@ -470,6 +488,13 @@ module GrowsurfRuby
470
488
  # @return [Integer, nil]
471
489
  optional :twitter_shares, Integer, api_name: :twitterShares
472
490
 
491
+ # @!attribute unique_commission_referrals
492
+ # Affiliate programs only. Number of unique referred participants represented by
493
+ # commissions in the requested timeframe.
494
+ #
495
+ # @return [Integer, nil]
496
+ optional :unique_commission_referrals, Integer, api_name: :uniqueCommissionReferrals
497
+
473
498
  # @!attribute unique_impressions
474
499
  #
475
500
  # @return [Integer, nil]
@@ -485,7 +510,7 @@ module GrowsurfRuby
485
510
  # @return [Integer, nil]
486
511
  optional :whats_app_shares, Integer, api_name: :whatsAppShares
487
512
 
488
- # @!method initialize(android_native_shares: nil, bluesky_shares: nil, copy_ref_link_shares: nil, email_shares: nil, facebook_shares: nil, impressions: nil, invites: nil, ios_native_shares: nil, linked_in_shares: nil, messenger_shares: nil, participants: nil, period_start: nil, pinterest_shares: nil, qrcode_shares: nil, reddit_shares: nil, referral_credit_expireds: nil, referral_credit_pendings: nil, referrals: nil, sms_shares: nil, telegram_shares: nil, threads_shares: nil, total_commission_count: nil, total_commissions: nil, total_revenue: nil, tumblr_shares: nil, twitter_shares: nil, unique_impressions: nil, wechat_shares: nil, whats_app_shares: nil)
513
+ # @!method initialize(android_native_shares: nil, bluesky_shares: nil, copy_ref_link_shares: nil, email_shares: nil, facebook_shares: nil, impressions: nil, invites: nil, ios_native_shares: nil, linked_in_shares: nil, messenger_shares: nil, participants: nil, period_start: nil, pinterest_shares: nil, qrcode_shares: nil, reddit_shares: nil, referral_credit_expireds: nil, referral_credit_pendings: nil, referrals: nil, sms_shares: nil, telegram_shares: nil, threads_shares: nil, total_commission_count: nil, total_commissions: nil, total_revenue: nil, tumblr_shares: nil, twitter_shares: nil, unique_commission_referrals: nil, unique_impressions: nil, wechat_shares: nil, whats_app_shares: nil)
489
514
  # Some parameter documentations has been truncated, see
490
515
  # {GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::Series} for more
491
516
  # details.
@@ -542,6 +567,8 @@ module GrowsurfRuby
542
567
  #
543
568
  # @param twitter_shares [Integer]
544
569
  #
570
+ # @param unique_commission_referrals [Integer] Affiliate programs only. Number of unique referred participants represented by commissions in the requested timeframe.
571
+ #
545
572
  # @param unique_impressions [Integer]
546
573
  #
547
574
  # @param wechat_shares [Integer]
@@ -711,6 +738,14 @@ module GrowsurfRuby
711
738
  GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric
712
739
  }
713
740
 
741
+ # @!attribute reversed
742
+ #
743
+ # @return [GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric, nil]
744
+ optional :reversed,
745
+ -> {
746
+ GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric
747
+ }
748
+
714
749
  # @!attribute upcoming
715
750
  #
716
751
  # @return [GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric, nil]
@@ -719,7 +754,7 @@ module GrowsurfRuby
719
754
  GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric
720
755
  }
721
756
 
722
- # @!method initialize(failed: nil, issued: nil, queued: nil, upcoming: nil)
757
+ # @!method initialize(failed: nil, issued: nil, queued: nil, reversed: nil, upcoming: nil)
723
758
  # Affiliate only. Payout counts and amounts by status.
724
759
  #
725
760
  # @param failed [GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric]
@@ -728,6 +763,8 @@ module GrowsurfRuby
728
763
  #
729
764
  # @param queued [GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric]
730
765
  #
766
+ # @param reversed [GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric]
767
+ #
731
768
  # @param upcoming [GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts::PayoutStatus::PayoutStatusMetric]
732
769
 
733
770
  class PayoutStatusMetric < GrowsurfRuby::Internal::Type::BaseModel
@@ -751,21 +788,32 @@ module GrowsurfRuby
751
788
 
752
789
  # @see GrowsurfRuby::Models::CampaignRetrieveAnalyticsResponse::StatusCounts#reward_status
753
790
  class RewardStatus < GrowsurfRuby::Internal::Type::BaseModel
754
- # @!attribute approved
791
+ # @!attribute completed
792
+ # Approved rewards that are fulfilled.
755
793
  #
756
794
  # @return [Integer, nil]
757
- optional :approved, Integer
795
+ optional :completed, Integer
758
796
 
759
- # @!attribute pending
760
- # Unapproved rewards awaiting fulfillment.
797
+ # @!attribute unapproved
798
+ # Unapproved rewards awaiting review.
799
+ #
800
+ # @return [Integer, nil]
801
+ optional :unapproved, Integer
802
+
803
+ # @!attribute unfulfilled
804
+ # Rewards that are approved but not fulfilled.
761
805
  #
762
806
  # @return [Integer, nil]
763
- optional :pending, Integer
807
+ optional :unfulfilled, Integer
764
808
 
765
- # @!method initialize(approved: nil, pending: nil)
766
- # @param approved [Integer]
809
+ # @!method initialize(completed: nil, unapproved: nil, unfulfilled: nil)
810
+ # Reward counts grouped by review and fulfillment status.
811
+ #
812
+ # @param completed [Integer] Approved rewards that are fulfilled.
813
+ #
814
+ # @param unapproved [Integer] Unapproved rewards awaiting review.
767
815
  #
768
- # @param pending [Integer] Unapproved rewards awaiting fulfillment.
816
+ # @param unfulfilled [Integer] Rewards that are approved but not fulfilled.
769
817
  end
770
818
  end
771
819
  end
@@ -0,0 +1,94 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ # @see GrowsurfRuby::Resources::Campaign#review_affiliate_application
6
+ # Either decide a pending application with `status`, or move a denied application's
7
+ # reapplication window with `reapply_allowed_at`. Provide exactly one of those
8
+ # fields.
9
+ class CampaignReviewAffiliateApplicationParams < GrowsurfRuby::Internal::Type::BaseModel
10
+ extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
11
+ include GrowsurfRuby::Internal::Type::RequestParameters
12
+
13
+ # @!attribute id
14
+ #
15
+ # @return [String]
16
+ required :id, String
17
+
18
+ # @!attribute application_id
19
+ #
20
+ # @return [String]
21
+ required :application_id, String
22
+
23
+ # @!attribute allow_immediate_reapply
24
+ # When denying, let the applicant reapply right away instead of waiting out the
25
+ # program's reapplication cooldown. Only valid when `status` is `DENIED`.
26
+ #
27
+ # @return [Boolean, nil]
28
+ optional :allow_immediate_reapply,
29
+ GrowsurfRuby::Internal::Type::Boolean,
30
+ api_name: :allowImmediateReapply
31
+
32
+ # @!attribute reapply_allowed_at
33
+ # For an already-denied application, move the reapplication window to this earlier
34
+ # time, in Unix milliseconds. Send without `status`.
35
+ #
36
+ # @return [Integer, nil]
37
+ optional :reapply_allowed_at, Integer, api_name: :reapplyAllowedAt
38
+
39
+ # @!attribute rejection_reason
40
+ # Short reason recorded with a denial. Only valid when `status` is `DENIED`.
41
+ # Maximum 255 characters.
42
+ #
43
+ # @return [String, nil]
44
+ optional :rejection_reason, String, api_name: :rejectionReason
45
+
46
+ # @!attribute review_note
47
+ # Private note recorded with a denial. Only valid when `status` is `DENIED`; never
48
+ # shown to the applicant. Maximum 500 characters.
49
+ #
50
+ # @return [String, nil]
51
+ optional :review_note, String, api_name: :reviewNote
52
+
53
+ # @!attribute status
54
+ # The decision. `APPROVED` enrolls the applicant as an affiliate; `DENIED` closes
55
+ # the application.
56
+ #
57
+ # @return [Symbol, GrowsurfRuby::Models::CampaignReviewAffiliateApplicationParams::Status, nil]
58
+ optional :status, enum: -> { GrowsurfRuby::CampaignReviewAffiliateApplicationParams::Status }
59
+
60
+ # @!method initialize(id:, application_id:, allow_immediate_reapply: nil, reapply_allowed_at: nil, rejection_reason: nil, review_note: nil, status: nil, request_options: {})
61
+ # Some parameter documentations has been truncated, see
62
+ # {GrowsurfRuby::Models::CampaignReviewAffiliateApplicationParams} for more
63
+ # details.
64
+ #
65
+ # @param id [String]
66
+ #
67
+ # @param application_id [String]
68
+ #
69
+ # @param allow_immediate_reapply [Boolean] When denying, let the applicant reapply right away instead of waiting out the
70
+ #
71
+ # @param reapply_allowed_at [Integer] For an already-denied application, move the reapplication window to this earlier
72
+ #
73
+ # @param rejection_reason [String] Short reason recorded with a denial. Only valid when `status` is `DENIED`.
74
+ #
75
+ # @param review_note [String] Private note recorded with a denial. Only valid when `status` is `DENIED`;
76
+ #
77
+ # @param status [Symbol, GrowsurfRuby::Models::CampaignReviewAffiliateApplicationParams::Status] The decision. `APPROVED` enrolls the applicant as an affiliate; `DENIED` closes
78
+ #
79
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
80
+
81
+ # The decision. `APPROVED` enrolls the applicant as an affiliate; `DENIED` closes
82
+ # the application.
83
+ module Status
84
+ extend GrowsurfRuby::Internal::Type::Enum
85
+
86
+ APPROVED = :APPROVED
87
+ DENIED = :DENIED
88
+
89
+ # @!method self.values
90
+ # @return [Array<Symbol>]
91
+ end
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ # @see GrowsurfRuby::Resources::Campaign#revoke_affiliate_invite
6
+ class CampaignRevokeAffiliateInviteParams < GrowsurfRuby::Internal::Type::BaseModel
7
+ extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
8
+ include GrowsurfRuby::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!attribute invite_id
16
+ #
17
+ # @return [String]
18
+ required :invite_id, String
19
+
20
+ # @!method initialize(id:, invite_id:, request_options: {})
21
+ # @param id [String]
22
+ # @param invite_id [String]
23
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
24
+ end
25
+ end
26
+ end
@@ -32,9 +32,10 @@ module GrowsurfRuby
32
32
  optional :duration_in_months, Integer, api_name: :durationInMonths, nil?: true
33
33
 
34
34
  # @!attribute event
35
+ # The event that generates a commission. Missing legacy values read as `SALE`.
35
36
  #
36
- # @return [String, nil]
37
- optional :event, String, nil?: true
37
+ # @return [Symbol, GrowsurfRuby::Models::CommissionStructure::Event, nil]
38
+ optional :event, enum: -> { GrowsurfRuby::CommissionStructure::Event }, nil?: true
38
39
 
39
40
  # @!attribute has_intro
40
41
  #
@@ -112,7 +113,7 @@ module GrowsurfRuby
112
113
  # @param approval_required [Boolean, nil]
113
114
  # @param duration [String, nil]
114
115
  # @param duration_in_months [Integer, nil]
115
- # @param event [String, nil]
116
+ # @param event [Symbol, GrowsurfRuby::Models::CommissionStructure::Event, nil]
116
117
  # @param has_intro [Boolean, nil]
117
118
  # @param has_max_amount [Boolean, nil]
118
119
  # @param hold_duration [Integer, nil]
@@ -128,6 +129,18 @@ module GrowsurfRuby
128
129
  # @param percent [Float, nil]
129
130
  # @param type [Symbol, GrowsurfRuby::Models::CommissionStructure::Type, nil]
130
131
 
132
+ # @see GrowsurfRuby::Models::CommissionStructure#event
133
+ module Event
134
+ extend GrowsurfRuby::Internal::Type::Enum
135
+
136
+ CLICK = :CLICK
137
+ LEAD = :LEAD
138
+ SALE = :SALE
139
+
140
+ # @!method self.values
141
+ # @return [Array<Symbol>]
142
+ end
143
+
131
144
  # @see GrowsurfRuby::Models::CommissionStructure#type
132
145
  module Type
133
146
  extend GrowsurfRuby::Internal::Type::Enum
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ # Accepted-send and lifecycle metrics for program emails in a requested window.
6
+ class EmailAnalytics < GrowsurfRuby::Internal::Type::BaseModel
7
+ required :sent, Integer
8
+ required :delivered, Integer
9
+ required :opened, Integer
10
+ required :clicked, Integer
11
+ required :bounced, Integer
12
+ required :spam_complaints, Integer, api_name: :spamComplaints
13
+ required :delivery_rate, Float, api_name: :deliveryRate
14
+ required :open_rate, Float, api_name: :openRate
15
+ required :click_rate, Float, api_name: :clickRate
16
+ required :bounce_rate, Float, api_name: :bounceRate
17
+ required :by_type,
18
+ -> { GrowsurfRuby::Internal::Type::ArrayOf[GrowsurfRuby::Models::EmailAnalytics::ByType] },
19
+ api_name: :byType
20
+ required :coverage_start_date, Integer, api_name: :coverageStartDate, nil?: true
21
+ required :is_partial, GrowsurfRuby::Internal::Type::Boolean, api_name: :isPartial
22
+
23
+ class Counts < GrowsurfRuby::Internal::Type::BaseModel
24
+ required :sent, Integer
25
+ required :delivered, Integer
26
+ required :opened, Integer
27
+ required :clicked, Integer
28
+ required :bounced, Integer
29
+ required :spam_complaints, Integer, api_name: :spamComplaints
30
+ end
31
+
32
+ class ByType < Counts
33
+ required :email_type, String, api_name: :emailType
34
+ required :delivery_rate, Float, api_name: :deliveryRate
35
+ required :open_rate, Float, api_name: :openRate
36
+ required :click_rate, Float, api_name: :clickRate
37
+ required :bounce_rate, Float, api_name: :bounceRate
38
+ end
39
+ end
40
+ end
41
+ end
@@ -46,6 +46,12 @@ module GrowsurfRuby
46
46
  # @return [String]
47
47
  required :currency_iso, String, api_name: :currencyISO
48
48
 
49
+ # @!attribute event
50
+ # The event that generated this commission. Legacy commissions return `SALE`.
51
+ #
52
+ # @return [Symbol, GrowsurfRuby::Models::ParticipantCommissionList::Commission::Event]
53
+ required :event, enum: -> { GrowsurfRuby::ParticipantCommissionList::Commission::Event }
54
+
49
55
  # @!attribute referred_id
50
56
  #
51
57
  # @return [String]
@@ -129,11 +135,12 @@ module GrowsurfRuby
129
135
  api_name: :saleAmountInCampaignCurrency,
130
136
  nil?: true
131
137
 
132
- # @!method initialize(id:, amount:, created_at:, currency_iso:, referred_id:, referrer_id:, sale_amount:, status:, amount_in_campaign_currency: nil, approved_at: nil, campaign_currency_iso: nil, exchange_rate: nil, exchange_rate_at: nil, fx_error: nil, hold_duration: nil, paid_at: nil, payout_queued_at: nil, provider: nil, reversed_at: nil, sale_amount_in_campaign_currency: nil)
138
+ # @!method initialize(id:, amount:, created_at:, currency_iso:, event:, referred_id:, referrer_id:, sale_amount:, status:, amount_in_campaign_currency: nil, approved_at: nil, campaign_currency_iso: nil, exchange_rate: nil, exchange_rate_at: nil, fx_error: nil, hold_duration: nil, paid_at: nil, payout_queued_at: nil, provider: nil, reversed_at: nil, sale_amount_in_campaign_currency: nil)
133
139
  # @param id [String]
134
140
  # @param amount [Integer, nil]
135
141
  # @param created_at [Integer]
136
142
  # @param currency_iso [String]
143
+ # @param event [Symbol, GrowsurfRuby::Models::ParticipantCommissionList::Commission::Event] The event that generated this commission. Legacy commissions return `SALE`.
137
144
  # @param referred_id [String]
138
145
  # @param referrer_id [String]
139
146
  # @param sale_amount [Integer, nil]
@@ -151,6 +158,17 @@ module GrowsurfRuby
151
158
  # @param reversed_at [Integer]
152
159
  # @param sale_amount_in_campaign_currency [Integer, nil]
153
160
 
161
+ # @see GrowsurfRuby::Models::ParticipantCommissionList::Commission#event
162
+ module Event
163
+ extend GrowsurfRuby::Internal::Type::Enum
164
+
165
+ LEAD = :LEAD
166
+ SALE = :SALE
167
+
168
+ # @!method self.values
169
+ # @return [Array<Symbol>]
170
+ end
171
+
154
172
  # @see GrowsurfRuby::Models::ParticipantCommissionList::Commission#status
155
173
  module Status
156
174
  extend GrowsurfRuby::Internal::Type::Enum
@@ -106,7 +106,12 @@ module GrowsurfRuby
106
106
  # @return [Integer, nil]
107
107
  optional :queued_at, Integer, api_name: :queuedAt
108
108
 
109
- # @!method initialize(id:, amount:, commission_ids:, created_at:, currency_iso:, participant_id:, status:, amount_in_campaign_currency: nil, campaign_currency_iso: nil, exchange_rate: nil, exchange_rate_at: nil, failed_at: nil, fx_error: nil, issued_at: nil, provider: nil, queued_at: nil)
109
+ # @!attribute reversed_at
110
+ #
111
+ # @return [Integer, nil]
112
+ optional :reversed_at, Integer, api_name: :reversedAt
113
+
114
+ # @!method initialize(id:, amount:, commission_ids:, created_at:, currency_iso:, participant_id:, status:, amount_in_campaign_currency: nil, campaign_currency_iso: nil, exchange_rate: nil, exchange_rate_at: nil, failed_at: nil, fx_error: nil, issued_at: nil, provider: nil, queued_at: nil, reversed_at: nil)
110
115
  # @param id [String]
111
116
  # @param amount [Integer]
112
117
  # @param commission_ids [Array<String>]
@@ -123,6 +128,7 @@ module GrowsurfRuby
123
128
  # @param issued_at [Integer]
124
129
  # @param provider [String, nil]
125
130
  # @param queued_at [Integer]
131
+ # @param reversed_at [Integer]
126
132
 
127
133
  # @see GrowsurfRuby::Models::ParticipantPayoutList::Payout#status
128
134
  module Status
@@ -132,6 +138,7 @@ module GrowsurfRuby
132
138
  QUEUED = :QUEUED
133
139
  ISSUED = :ISSUED
134
140
  FAILED = :FAILED
141
+ REVERSED = :REVERSED
135
142
 
136
143
  # @!method self.values
137
144
  # @return [Array<Symbol>]
@@ -10,17 +10,18 @@ module GrowsurfRuby
10
10
  # @return [Float, nil]
11
11
  optional :fair_market_value_usd, Float, api_name: :fairMarketValueUSD, nil?: true
12
12
 
13
- # @!attribute is_tax_reportable
14
- # Whether the reward's value counts toward 1099 thresholds/totals. `null` = use
15
- # the smart default for the reward's source.
13
+ # @!attribute tax_character
14
+ # The reason the recipient earns this reward. `null` inherits the program's
15
+ # confirmed tax treatment for configurable non-commission rewards. Commission
16
+ # rewards always use `NONEMPLOYEE_SERVICES`.
16
17
  #
17
- # @return [Boolean, nil]
18
- optional :is_tax_reportable,
19
- GrowsurfRuby::Internal::Type::Boolean,
20
- api_name: :isTaxReportable,
18
+ # @return [Symbol, GrowsurfRuby::Models::RewardTaxValuation::TaxCharacter, nil]
19
+ optional :tax_character,
20
+ enum: -> { GrowsurfRuby::RewardTaxValuation::TaxCharacter },
21
+ api_name: :taxCharacter,
21
22
  nil?: true
22
23
 
23
- # @!method initialize(fair_market_value_usd: nil, is_tax_reportable: nil)
24
+ # @!method initialize(fair_market_value_usd: nil, tax_character: nil)
24
25
  # Some parameter documentations has been truncated, see
25
26
  # {GrowsurfRuby::Models::RewardTaxValuation} for more details.
26
27
  #
@@ -29,7 +30,21 @@ module GrowsurfRuby
29
30
  #
30
31
  # @param fair_market_value_usd [Float, nil] Manual fair-market value in USD (major units) used as the fallback when the rewa
31
32
  #
32
- # @param is_tax_reportable [Boolean, nil] Whether the reward's value counts toward 1099 thresholds/totals. `null` = use th
33
+ # @param tax_character [Symbol, GrowsurfRuby::Models::RewardTaxValuation::TaxCharacter, nil] The reason the recipient earns this reward. `null` inherits the program's
34
+
35
+ # The U.S. federal tax character of a reward.
36
+ module TaxCharacter
37
+ extend GrowsurfRuby::Internal::Type::Enum
38
+
39
+ NONEMPLOYEE_SERVICES = :NONEMPLOYEE_SERVICES
40
+ PRIZE_OR_AWARD = :PRIZE_OR_AWARD
41
+ PURCHASE_REBATE = :PURCHASE_REBATE
42
+ OTHER_INCOME = :OTHER_INCOME
43
+ REVIEW_REQUIRED = :REVIEW_REQUIRED
44
+
45
+ # @!method self.values
46
+ # @return [Array<Symbol>]
47
+ end
33
48
  end
34
49
  end
35
50
  end