growsurf-ruby 1.0.0 → 1.1.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 (137) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/growsurf_ruby/client.rb +4 -0
  5. data/lib/growsurf_ruby/models/account.rb +90 -0
  6. data/lib/growsurf_ruby/models/account_create_params.rb +46 -0
  7. data/lib/growsurf_ruby/models/account_create_response.rb +64 -0
  8. data/lib/growsurf_ruby/models/account_resend_verification_email_response.rb +33 -0
  9. data/lib/growsurf_ruby/models/account_rotate_api_key_response.rb +17 -0
  10. data/lib/growsurf_ruby/models/account_update_params.rb +35 -0
  11. data/lib/growsurf_ruby/models/campaign/campaign_reward_list_response.rb +2 -2
  12. data/lib/growsurf_ruby/models/campaign/create.rb +5 -1
  13. data/lib/growsurf_ruby/models/campaign/participant_activity_logs_response.rb +65 -0
  14. data/lib/growsurf_ruby/models/campaign/participant_analytics_response.rb +421 -0
  15. data/lib/growsurf_ruby/models/campaign/participant_bulk_delete_params.rb +35 -0
  16. data/lib/growsurf_ruby/models/campaign/participant_bulk_delete_response.rb +151 -0
  17. data/lib/growsurf_ruby/models/campaign/participant_email_params.rb +76 -0
  18. data/lib/growsurf_ruby/models/campaign/participant_email_response.rb +38 -0
  19. data/lib/growsurf_ruby/models/campaign/participant_list_activity_logs_params.rb +46 -0
  20. data/lib/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rb +98 -0
  21. data/lib/growsurf_ruby/models/campaign/participant_update_params.rb +21 -1
  22. data/lib/growsurf_ruby/models/campaign/reward.rb +17 -6
  23. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +25 -15
  24. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +25 -15
  25. data/lib/growsurf_ruby/models/campaign/webhook.rb +72 -0
  26. data/lib/growsurf_ruby/models/campaign/webhook_create_params.rb +52 -0
  27. data/lib/growsurf_ruby/models/campaign/webhook_delete_params.rb +28 -0
  28. data/lib/growsurf_ruby/models/campaign/webhook_delete_response.rb +24 -0
  29. data/lib/growsurf_ruby/models/campaign/webhook_event.rb +23 -0
  30. data/lib/growsurf_ruby/models/campaign/webhook_list_response.rb +18 -0
  31. data/lib/growsurf_ruby/models/campaign/webhook_test_params.rb +42 -0
  32. data/lib/growsurf_ruby/models/campaign/webhook_test_response.rb +50 -0
  33. data/lib/growsurf_ruby/models/campaign/webhook_update_params.rb +59 -0
  34. data/lib/growsurf_ruby/models/campaign.rb +17 -6
  35. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_params.rb +36 -1
  36. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +538 -1
  37. data/lib/growsurf_ruby/models/campaign_update_params.rb +0 -3
  38. data/lib/growsurf_ruby/models/commission_structure.rb +8 -2
  39. data/lib/growsurf_ruby/models/referral_flow_screenshots_response.rb +72 -0
  40. data/lib/growsurf_ruby/models.rb +8 -0
  41. data/lib/growsurf_ruby/resources/account.rb +159 -0
  42. data/lib/growsurf_ruby/resources/campaign/design.rb +9 -7
  43. data/lib/growsurf_ruby/resources/campaign/emails.rb +8 -5
  44. data/lib/growsurf_ruby/resources/campaign/installation.rb +8 -6
  45. data/lib/growsurf_ruby/resources/campaign/options.rb +8 -5
  46. data/lib/growsurf_ruby/resources/campaign/participant.rb +170 -2
  47. data/lib/growsurf_ruby/resources/campaign/rewards.rb +17 -21
  48. data/lib/growsurf_ruby/resources/campaign/webhooks.rb +157 -0
  49. data/lib/growsurf_ruby/resources/campaign.rb +30 -2
  50. data/lib/growsurf_ruby/version.rb +1 -1
  51. data/lib/growsurf_ruby.rb +26 -0
  52. data/rbi/growsurf_ruby/client.rbi +3 -0
  53. data/rbi/growsurf_ruby/models/account.rbi +125 -0
  54. data/rbi/growsurf_ruby/models/account_create_params.rbi +73 -0
  55. data/rbi/growsurf_ruby/models/account_create_response.rbi +115 -0
  56. data/rbi/growsurf_ruby/models/account_resend_verification_email_response.rbi +76 -0
  57. data/rbi/growsurf_ruby/models/account_rotate_api_key_response.rbi +30 -0
  58. data/rbi/growsurf_ruby/models/account_update_params.rbi +65 -0
  59. data/rbi/growsurf_ruby/models/campaign/campaign_reward_list_response.rbi +2 -2
  60. data/rbi/growsurf_ruby/models/campaign/create.rbi +8 -0
  61. data/rbi/growsurf_ruby/models/campaign/participant_activity_logs_response.rbi +111 -0
  62. data/rbi/growsurf_ruby/models/campaign/participant_analytics_response.rbi +630 -0
  63. data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_params.rbi +56 -0
  64. data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbi +285 -0
  65. data/rbi/growsurf_ruby/models/campaign/participant_email_params.rbi +118 -0
  66. data/rbi/growsurf_ruby/models/campaign/participant_email_response.rbi +84 -0
  67. data/rbi/growsurf_ruby/models/campaign/participant_list_activity_logs_params.rbi +74 -0
  68. data/rbi/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbi +207 -0
  69. data/rbi/growsurf_ruby/models/campaign/participant_update_params.rbi +24 -0
  70. data/rbi/growsurf_ruby/models/campaign/reward.rbi +25 -4
  71. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +34 -9
  72. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +34 -9
  73. data/rbi/growsurf_ruby/models/campaign/webhook.rbi +93 -0
  74. data/rbi/growsurf_ruby/models/campaign/webhook_create_params.rbi +91 -0
  75. data/rbi/growsurf_ruby/models/campaign/webhook_delete_params.rbi +48 -0
  76. data/rbi/growsurf_ruby/models/campaign/webhook_delete_response.rbi +33 -0
  77. data/rbi/growsurf_ruby/models/campaign/webhook_event.rbi +60 -0
  78. data/rbi/growsurf_ruby/models/campaign/webhook_list_response.rbi +36 -0
  79. data/rbi/growsurf_ruby/models/campaign/webhook_test_params.rbi +69 -0
  80. data/rbi/growsurf_ruby/models/campaign/webhook_test_response.rbi +102 -0
  81. data/rbi/growsurf_ruby/models/campaign/webhook_update_params.rbi +98 -0
  82. data/rbi/growsurf_ruby/models/campaign.rbi +25 -4
  83. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_params.rbi +91 -0
  84. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +1011 -3
  85. data/rbi/growsurf_ruby/models/campaign_update_params.rbi +0 -15
  86. data/rbi/growsurf_ruby/models/commission_structure.rbi +8 -2
  87. data/rbi/growsurf_ruby/models/referral_flow_screenshots_response.rbi +94 -0
  88. data/rbi/growsurf_ruby/models.rbi +9 -0
  89. data/rbi/growsurf_ruby/resources/account.rbi +112 -0
  90. data/rbi/growsurf_ruby/resources/campaign/design.rbi +7 -5
  91. data/rbi/growsurf_ruby/resources/campaign/emails.rbi +7 -5
  92. data/rbi/growsurf_ruby/resources/campaign/installation.rbi +7 -4
  93. data/rbi/growsurf_ruby/resources/campaign/options.rbi +7 -5
  94. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +160 -0
  95. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +37 -21
  96. data/rbi/growsurf_ruby/resources/campaign/webhooks.rbi +123 -0
  97. data/rbi/growsurf_ruby/resources/campaign.rbi +33 -2
  98. data/sig/growsurf_ruby/client.rbs +2 -0
  99. data/sig/growsurf_ruby/models/account.rbs +67 -0
  100. data/sig/growsurf_ruby/models/account_create_params.rbs +42 -0
  101. data/sig/growsurf_ruby/models/account_create_response.rbs +47 -0
  102. data/sig/growsurf_ruby/models/account_resend_verification_email_response.rbs +35 -0
  103. data/sig/growsurf_ruby/models/account_rotate_api_key_response.rbs +13 -0
  104. data/sig/growsurf_ruby/models/account_update_params.rbs +42 -0
  105. data/sig/growsurf_ruby/models/campaign/participant_activity_logs_response.rbs +59 -0
  106. data/sig/growsurf_ruby/models/campaign/participant_analytics_response.rbs +407 -0
  107. data/sig/growsurf_ruby/models/campaign/participant_bulk_delete_params.rbs +30 -0
  108. data/sig/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbs +125 -0
  109. data/sig/growsurf_ruby/models/campaign/participant_email_params.rbs +61 -0
  110. data/sig/growsurf_ruby/models/campaign/participant_email_response.rbs +37 -0
  111. data/sig/growsurf_ruby/models/campaign/participant_list_activity_logs_params.rbs +47 -0
  112. data/sig/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbs +90 -0
  113. data/sig/growsurf_ruby/models/campaign/participant_update_params.rbs +14 -0
  114. data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +0 -7
  115. data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +0 -7
  116. data/sig/growsurf_ruby/models/campaign/webhook.rbs +52 -0
  117. data/sig/growsurf_ruby/models/campaign/webhook_create_params.rbs +51 -0
  118. data/sig/growsurf_ruby/models/campaign/webhook_delete_params.rbs +30 -0
  119. data/sig/growsurf_ruby/models/campaign/webhook_delete_response.rbs +17 -0
  120. data/sig/growsurf_ruby/models/campaign/webhook_event.rbs +28 -0
  121. data/sig/growsurf_ruby/models/campaign/webhook_list_response.rbs +18 -0
  122. data/sig/growsurf_ruby/models/campaign/webhook_test_params.rbs +42 -0
  123. data/sig/growsurf_ruby/models/campaign/webhook_test_response.rbs +54 -0
  124. data/sig/growsurf_ruby/models/campaign/webhook_update_params.rbs +63 -0
  125. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_params.rbs +35 -1
  126. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +533 -3
  127. data/sig/growsurf_ruby/models/campaign_update_params.rbs +1 -4
  128. data/sig/growsurf_ruby/models/commission_structure.rbs +7 -2
  129. data/sig/growsurf_ruby/models/referral_flow_screenshots_response.rbs +54 -0
  130. data/sig/growsurf_ruby/models/reward_tax_valuation.rbs +4 -1
  131. data/sig/growsurf_ruby/models.rbs +8 -0
  132. data/sig/growsurf_ruby/resources/account.rbs +38 -0
  133. data/sig/growsurf_ruby/resources/campaign/participant.rbs +37 -0
  134. data/sig/growsurf_ruby/resources/campaign/rewards.rbs +0 -2
  135. data/sig/growsurf_ruby/resources/campaign/webhooks.rbs +46 -0
  136. data/sig/growsurf_ruby/resources/campaign.rbs +9 -0
  137. metadata +80 -2
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ module Campaign
6
+ # @see GrowsurfRuby::Resources::Campaign::Participant#email
7
+ class ParticipantEmailResponse < GrowsurfRuby::Internal::Type::BaseModel
8
+ # @!attribute status
9
+ # The email was accepted for delivery.
10
+ #
11
+ # @return [Symbol, GrowsurfRuby::Models::Campaign::ParticipantEmailResponse::Status]
12
+ required :status, enum: -> { GrowsurfRuby::Campaign::ParticipantEmailResponse::Status }
13
+
14
+ # @!attribute success
15
+ #
16
+ # @return [Boolean]
17
+ required :success, GrowsurfRuby::Internal::Type::Boolean
18
+
19
+ # @!method initialize(status:, success:)
20
+ # @param status [Symbol, GrowsurfRuby::Models::Campaign::ParticipantEmailResponse::Status] The email was accepted for delivery.
21
+ #
22
+ # @param success [Boolean]
23
+
24
+ # The email was accepted for delivery.
25
+ #
26
+ # @see GrowsurfRuby::Models::Campaign::ParticipantEmailResponse#status
27
+ module Status
28
+ extend GrowsurfRuby::Internal::Type::Enum
29
+
30
+ QUEUED = :queued
31
+
32
+ # @!method self.values
33
+ # @return [Array<Symbol>]
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ module Campaign
6
+ # @see GrowsurfRuby::Resources::Campaign::Participant#list_activity_logs
7
+ class ParticipantListActivityLogsParams < GrowsurfRuby::Internal::Type::BaseModel
8
+ extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
9
+ include GrowsurfRuby::Internal::Type::RequestParameters
10
+
11
+ # @!attribute id
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!attribute participant_id_or_email
17
+ #
18
+ # @return [String]
19
+ required :participant_id_or_email, String
20
+
21
+ # @!attribute limit
22
+ # Number of logs to return (1–100, default 20).
23
+ #
24
+ # @return [Integer, nil]
25
+ optional :limit, Integer
26
+
27
+ # @!attribute offset
28
+ # Number of logs to skip.
29
+ #
30
+ # @return [Integer, nil]
31
+ optional :offset, Integer
32
+
33
+ # @!method initialize(id:, participant_id_or_email:, limit: nil, offset: nil, request_options: {})
34
+ # @param id [String]
35
+ #
36
+ # @param participant_id_or_email [String]
37
+ #
38
+ # @param limit [Integer] Number of logs to return (1–100, default 20).
39
+ #
40
+ # @param offset [Integer] Number of logs to skip.
41
+ #
42
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,98 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ module Campaign
6
+ # @see GrowsurfRuby::Resources::Campaign::Participant#retrieve_analytics
7
+ class ParticipantRetrieveAnalyticsParams < GrowsurfRuby::Internal::Type::BaseModel
8
+ extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
9
+ include GrowsurfRuby::Internal::Type::RequestParameters
10
+
11
+ # @!attribute id
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!attribute participant_id_or_email
17
+ #
18
+ # @return [String]
19
+ required :participant_id_or_email, String
20
+
21
+ # @!attribute days
22
+ # Last number of days to retrieve analytics for. Defaults to 365. Maximum 1825.
23
+ #
24
+ # @return [Integer, nil]
25
+ optional :days, Integer
26
+
27
+ # @!attribute end_date
28
+ # End date of the analytics timeframe as a Unix timestamp in milliseconds.
29
+ # Required if `days` is not set.
30
+ #
31
+ # @return [Integer, nil]
32
+ optional :end_date, Integer
33
+
34
+ # @!attribute include
35
+ # Set to `series` to also return this participant's own activity per period.
36
+ #
37
+ # @return [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams::Include, nil]
38
+ optional :include, enum: -> { GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Include }
39
+
40
+ # @!attribute interval
41
+ # Bucket size for the `series` (only used with `include=series`). Defaults to `day`.
42
+ #
43
+ # @return [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams::Interval, nil]
44
+ optional :interval, enum: -> { GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Interval }
45
+
46
+ # @!attribute start_date
47
+ # Start date of the analytics timeframe as a Unix timestamp in milliseconds.
48
+ # Required if `days` is not set.
49
+ #
50
+ # @return [Integer, nil]
51
+ optional :start_date, Integer
52
+
53
+ # @!method initialize(id:, participant_id_or_email:, days: nil, end_date: nil, include: nil, interval: nil, start_date: nil, request_options: {})
54
+ # Some parameter documentations has been truncated, see
55
+ # {GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams} for more
56
+ # details.
57
+ #
58
+ # @param id [String]
59
+ #
60
+ # @param participant_id_or_email [String]
61
+ #
62
+ # @param days [Integer] Last number of days to retrieve analytics for. Defaults to 365. Maximum 1825.
63
+ #
64
+ # @param end_date [Integer] End date of the analytics timeframe as a Unix timestamp in milliseconds. Require
65
+ #
66
+ # @param include [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams::Include] Set to `series` to also return this participant's own activity per period.
67
+ #
68
+ # @param interval [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams::Interval] Bucket size for the `series` (only used with `include=series`). Defaults to `day`.
69
+ #
70
+ # @param start_date [Integer] Start date of the analytics timeframe as a Unix timestamp in milliseconds. Requi
71
+ #
72
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
73
+
74
+ # Set to `series` to also return this participant's own activity per period.
75
+ module Include
76
+ extend GrowsurfRuby::Internal::Type::Enum
77
+
78
+ SERIES = :series
79
+
80
+ # @!method self.values
81
+ # @return [Array<Symbol>]
82
+ end
83
+
84
+ # Bucket size for the `series` (only used with `include=series`). Defaults to `day`.
85
+ module Interval
86
+ extend GrowsurfRuby::Internal::Type::Enum
87
+
88
+ DAY = :day
89
+ WEEK = :week
90
+ MONTH = :month
91
+
92
+ # @!method self.values
93
+ # @return [Array<Symbol>]
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
@@ -39,6 +39,19 @@ module GrowsurfRuby
39
39
  # @return [Hash{Symbol=>Object}, nil]
40
40
  optional :metadata, GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown]
41
41
 
42
+ # @!attribute notes
43
+ # Freeform internal notes about the participant (internal only, never exposed to
44
+ # participants).
45
+ #
46
+ # @return [String, nil]
47
+ optional :notes, String
48
+
49
+ # @!attribute paypal_email
50
+ # The participant's PayPal email address, used for affiliate payouts.
51
+ #
52
+ # @return [String, nil]
53
+ optional :paypal_email, String, api_name: :paypalEmail
54
+
42
55
  # @!attribute referral_status
43
56
  #
44
57
  # @return [Symbol, GrowsurfRuby::Models::Campaign::ParticipantUpdateParams::ReferralStatus, nil]
@@ -61,7 +74,10 @@ module GrowsurfRuby
61
74
  # @return [Array<String>, nil]
62
75
  optional :vanity_keys, GrowsurfRuby::Internal::Type::ArrayOf[String], api_name: :vanityKeys
63
76
 
64
- # @!method initialize(id:, participant_id_or_email:, email: nil, first_name: nil, last_name: nil, metadata: nil, referral_status: nil, referred_by: nil, unsubscribed: nil, vanity_keys: nil, request_options: {})
77
+ # @!method initialize(id:, participant_id_or_email:, email: nil, first_name: nil, last_name: nil, metadata: nil, notes: nil, paypal_email: nil, referral_status: nil, referred_by: nil, unsubscribed: nil, vanity_keys: nil, request_options: {})
78
+ # Some parameter documentations has been truncated, see
79
+ # {GrowsurfRuby::Models::Campaign::ParticipantUpdateParams} for more details.
80
+ #
65
81
  # @param id [String]
66
82
  #
67
83
  # @param participant_id_or_email [String]
@@ -74,6 +90,10 @@ module GrowsurfRuby
74
90
  #
75
91
  # @param metadata [Hash{Symbol=>Object}] Shallow custom metadata object.
76
92
  #
93
+ # @param notes [String] Freeform internal notes about the participant (internal only, never exposed to pa
94
+ #
95
+ # @param paypal_email [String] The participant's PayPal email address, used for affiliate payouts.
96
+ #
77
97
  # @param referral_status [Symbol, GrowsurfRuby::Models::Campaign::ParticipantUpdateParams::ReferralStatus]
78
98
  #
79
99
  # @param referred_by [String]
@@ -40,6 +40,9 @@ module GrowsurfRuby
40
40
  optional :conversions_required, Integer, api_name: :conversionsRequired, nil?: true
41
41
 
42
42
  # @!attribute coupon_code
43
+ # Legacy static coupon code shown to the referrer in the reward-won email and
44
+ # webhook. Display text only; superseded by a connected billing integration's
45
+ # issued coupon when one exists.
43
46
  #
44
47
  # @return [String, nil]
45
48
  optional :coupon_code, String, api_name: :couponCode, nil?: true
@@ -69,16 +72,22 @@ module GrowsurfRuby
69
72
  nil?: true
70
73
 
71
74
  # @!attribute next_milestone_prefix
75
+ # Text shown before a participant's referral count in milestone-progress copy.
76
+ # Applies to `MILESTONE` rewards.
72
77
  #
73
78
  # @return [String, nil]
74
79
  optional :next_milestone_prefix, String, api_name: :nextMilestonePrefix, nil?: true
75
80
 
76
81
  # @!attribute next_milestone_suffix
82
+ # Text shown after a participant's referral count in milestone-progress copy.
83
+ # Applies to `MILESTONE` rewards.
77
84
  #
78
85
  # @return [String, nil]
79
86
  optional :next_milestone_suffix, String, api_name: :nextMilestoneSuffix, nil?: true
80
87
 
81
88
  # @!attribute number_of_winners
89
+ # The number of winners (`LEADERBOARD` rewards only). With `limitDuration`
90
+ # `PER_MONTH` this many win each month, otherwise this many win in total.
82
91
  #
83
92
  # @return [Integer, nil]
84
93
  optional :number_of_winners, Integer, api_name: :numberOfWinners, nil?: true
@@ -89,7 +98,9 @@ module GrowsurfRuby
89
98
  optional :order, Integer, nil?: true
90
99
 
91
100
  # @!attribute referral_coupon_code
92
- # The coupon code delivered to the referred friend (double-sided rewards).
101
+ # Legacy static coupon code shown to the referred friend (double-sided rewards)
102
+ # in the reward-won email and webhook. Display text only; superseded by a
103
+ # connected billing integration's issued coupon when one exists.
93
104
  #
94
105
  # @return [String, nil]
95
106
  optional :referral_coupon_code, String, api_name: :referralCouponCode, nil?: true
@@ -134,7 +145,7 @@ module GrowsurfRuby
134
145
  #
135
146
  # @param conversions_required [Integer, nil]
136
147
  #
137
- # @param coupon_code [String, nil]
148
+ # @param coupon_code [String, nil] Legacy static coupon code shown to the referrer in the reward-won email and web
138
149
  #
139
150
  # @param description [String, nil]
140
151
  #
@@ -144,15 +155,15 @@ module GrowsurfRuby
144
155
  #
145
156
  # @param limit_duration [Symbol, GrowsurfRuby::Models::Campaign::Reward::LimitDuration, nil]
146
157
  #
147
- # @param next_milestone_prefix [String, nil]
158
+ # @param next_milestone_prefix [String, nil] Text shown before a participant's referral count in milestone-progress copy. App
148
159
  #
149
- # @param next_milestone_suffix [String, nil]
160
+ # @param next_milestone_suffix [String, nil] Text shown after a participant's referral count in milestone-progress copy. Appl
150
161
  #
151
- # @param number_of_winners [Integer, nil]
162
+ # @param number_of_winners [Integer, nil] The number of winners (`LEADERBOARD` rewards only). With `limitDuration` `PER_MO
152
163
  #
153
164
  # @param order [Integer, nil]
154
165
  #
155
- # @param referral_coupon_code [String, nil] The coupon code delivered to the referred friend (double-sided rewards).
166
+ # @param referral_coupon_code [String, nil] Legacy static coupon code shown to the referred friend (double-sided rewards) in
156
167
  #
157
168
  # @param referral_description [String, nil]
158
169
  #
@@ -26,6 +26,9 @@ module GrowsurfRuby
26
26
  optional :conversions_required, Integer, api_name: :conversionsRequired
27
27
 
28
28
  # @!attribute coupon_code
29
+ # Legacy static coupon code shown to the referrer in the reward-won email and
30
+ # webhook. Display text only; superseded by a connected billing integration's
31
+ # issued coupon when one exists.
29
32
  #
30
33
  # @return [String, nil]
31
34
  optional :coupon_code, String, api_name: :couponCode
@@ -40,17 +43,16 @@ module GrowsurfRuby
40
43
  # @return [String, nil]
41
44
  optional :image_url, String, api_name: :imageUrl
42
45
 
43
- # @!attribute is_active
44
- #
45
- # @return [Boolean, nil]
46
- optional :is_active, GrowsurfRuby::Internal::Type::Boolean, api_name: :isActive
47
-
48
46
  # @!attribute is_unlimited
47
+ # Whether the reward can be earned an unlimited number of times. Defaults to
48
+ # `true`, except `MILESTONE` rewards, which can only be earned once.
49
49
  #
50
50
  # @return [Boolean, nil]
51
51
  optional :is_unlimited, GrowsurfRuby::Internal::Type::Boolean, api_name: :isUnlimited
52
52
 
53
53
  # @!attribute is_visible
54
+ # Whether the reward is enabled. When `false` the reward is disabled: hidden from
55
+ # participants and no longer awarded, including those who already earned it.
54
56
  #
55
57
  # @return [Boolean, nil]
56
58
  optional :is_visible, GrowsurfRuby::Internal::Type::Boolean, api_name: :isVisible
@@ -74,16 +76,23 @@ module GrowsurfRuby
74
76
  optional :metadata, GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown]
75
77
 
76
78
  # @!attribute next_milestone_prefix
79
+ # Text shown before a participant's referral count in milestone-progress copy.
80
+ # Applies to `MILESTONE` rewards.
77
81
  #
78
82
  # @return [String, nil]
79
83
  optional :next_milestone_prefix, String, api_name: :nextMilestonePrefix
80
84
 
81
85
  # @!attribute next_milestone_suffix
86
+ # Text shown after a participant's referral count in milestone-progress copy.
87
+ # Applies to `MILESTONE` rewards.
82
88
  #
83
89
  # @return [String, nil]
84
90
  optional :next_milestone_suffix, String, api_name: :nextMilestoneSuffix
85
91
 
86
92
  # @!attribute number_of_winners
93
+ # The number of winners (`LEADERBOARD` rewards only). With `limitDuration`
94
+ # `PER_MONTH` this many win each month, otherwise this many win in total;
95
+ # omitting it defaults to `3`.
87
96
  #
88
97
  # @return [Integer, nil]
89
98
  optional :number_of_winners, Integer, api_name: :numberOfWinners
@@ -94,6 +103,9 @@ module GrowsurfRuby
94
103
  optional :order, Integer
95
104
 
96
105
  # @!attribute referral_coupon_code
106
+ # Legacy static coupon code shown to the referred friend (double-sided rewards)
107
+ # in the reward-won email and webhook. Display text only; superseded by a
108
+ # connected billing integration's issued coupon when one exists.
97
109
  #
98
110
  # @return [String, nil]
99
111
  optional :referral_coupon_code, String, api_name: :referralCouponCode
@@ -131,7 +143,7 @@ module GrowsurfRuby
131
143
  # @return [GrowsurfRuby::Models::RewardTaxValuation, nil]
132
144
  optional :value, -> { GrowsurfRuby::RewardTaxValuation }
133
145
 
134
- # @!method initialize(type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_active: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
146
+ # @!method initialize(type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
135
147
  # Some parameter documentations has been truncated, see
136
148
  # {GrowsurfRuby::Models::Campaign::RewardCreateParams} for more details.
137
149
  #
@@ -141,17 +153,15 @@ module GrowsurfRuby
141
153
  #
142
154
  # @param conversions_required [Integer]
143
155
  #
144
- # @param coupon_code [String]
156
+ # @param coupon_code [String] Legacy static coupon code shown to the referrer in the reward-won email and web
145
157
  #
146
158
  # @param description [String]
147
159
  #
148
160
  # @param image_url [String]
149
161
  #
150
- # @param is_active [Boolean]
151
- #
152
- # @param is_unlimited [Boolean]
162
+ # @param is_unlimited [Boolean] Whether the reward can be earned an unlimited number of times. Defaults to `true
153
163
  #
154
- # @param is_visible [Boolean]
164
+ # @param is_visible [Boolean] Whether the reward is enabled. When `false` the reward is disabled: hidden from
155
165
  #
156
166
  # @param limit [Integer]
157
167
  #
@@ -159,15 +169,15 @@ module GrowsurfRuby
159
169
  #
160
170
  # @param metadata [Hash{Symbol=>Object}] Custom key/value metadata (single-level; values are stored as strings).
161
171
  #
162
- # @param next_milestone_prefix [String]
172
+ # @param next_milestone_prefix [String] Text shown before a participant's referral count in milestone-progress copy. App
163
173
  #
164
- # @param next_milestone_suffix [String]
174
+ # @param next_milestone_suffix [String] Text shown after a participant's referral count in milestone-progress copy. Appl
165
175
  #
166
- # @param number_of_winners [Integer]
176
+ # @param number_of_winners [Integer] The number of winners (`LEADERBOARD` rewards only). With `limitDuration` `PER_MO
167
177
  #
168
178
  # @param order [Integer]
169
179
  #
170
- # @param referral_coupon_code [String]
180
+ # @param referral_coupon_code [String] Legacy static coupon code shown to the referred friend (double-sided rewards) in
171
181
  #
172
182
  # @param referral_description [String]
173
183
  #
@@ -31,6 +31,9 @@ module GrowsurfRuby
31
31
  optional :conversions_required, Integer, api_name: :conversionsRequired
32
32
 
33
33
  # @!attribute coupon_code
34
+ # Legacy static coupon code shown to the referrer in the reward-won email and
35
+ # webhook. Display text only; superseded by a connected billing integration's
36
+ # issued coupon when one exists.
34
37
  #
35
38
  # @return [String, nil]
36
39
  optional :coupon_code, String, api_name: :couponCode
@@ -45,17 +48,16 @@ module GrowsurfRuby
45
48
  # @return [String, nil]
46
49
  optional :image_url, String, api_name: :imageUrl
47
50
 
48
- # @!attribute is_active
49
- #
50
- # @return [Boolean, nil]
51
- optional :is_active, GrowsurfRuby::Internal::Type::Boolean, api_name: :isActive
52
-
53
51
  # @!attribute is_unlimited
52
+ # Whether the reward can be earned an unlimited number of times. Defaults to
53
+ # `true`, except `MILESTONE` rewards, which can only be earned once.
54
54
  #
55
55
  # @return [Boolean, nil]
56
56
  optional :is_unlimited, GrowsurfRuby::Internal::Type::Boolean, api_name: :isUnlimited
57
57
 
58
58
  # @!attribute is_visible
59
+ # Whether the reward is enabled. When `false` the reward is disabled: hidden from
60
+ # participants and no longer awarded, including those who already earned it.
59
61
  #
60
62
  # @return [Boolean, nil]
61
63
  optional :is_visible, GrowsurfRuby::Internal::Type::Boolean, api_name: :isVisible
@@ -79,16 +81,23 @@ module GrowsurfRuby
79
81
  optional :metadata, GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown]
80
82
 
81
83
  # @!attribute next_milestone_prefix
84
+ # Text shown before a participant's referral count in milestone-progress copy.
85
+ # Applies to `MILESTONE` rewards.
82
86
  #
83
87
  # @return [String, nil]
84
88
  optional :next_milestone_prefix, String, api_name: :nextMilestonePrefix
85
89
 
86
90
  # @!attribute next_milestone_suffix
91
+ # Text shown after a participant's referral count in milestone-progress copy.
92
+ # Applies to `MILESTONE` rewards.
87
93
  #
88
94
  # @return [String, nil]
89
95
  optional :next_milestone_suffix, String, api_name: :nextMilestoneSuffix
90
96
 
91
97
  # @!attribute number_of_winners
98
+ # The number of winners (`LEADERBOARD` rewards only). With `limitDuration`
99
+ # `PER_MONTH` this many win each month, otherwise this many win in total;
100
+ # omitting it defaults to `3`.
92
101
  #
93
102
  # @return [Integer, nil]
94
103
  optional :number_of_winners, Integer, api_name: :numberOfWinners
@@ -99,6 +108,9 @@ module GrowsurfRuby
99
108
  optional :order, Integer
100
109
 
101
110
  # @!attribute referral_coupon_code
111
+ # Legacy static coupon code shown to the referred friend (double-sided rewards)
112
+ # in the reward-won email and webhook. Display text only; superseded by a
113
+ # connected billing integration's issued coupon when one exists.
102
114
  #
103
115
  # @return [String, nil]
104
116
  optional :referral_coupon_code, String, api_name: :referralCouponCode
@@ -136,7 +148,7 @@ module GrowsurfRuby
136
148
  # @return [GrowsurfRuby::Models::RewardTaxValuation, nil]
137
149
  optional :value, -> { GrowsurfRuby::RewardTaxValuation }
138
150
 
139
- # @!method initialize(id:, campaign_reward_id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_active: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
151
+ # @!method initialize(id:, campaign_reward_id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
140
152
  # Some parameter documentations has been truncated, see
141
153
  # {GrowsurfRuby::Models::Campaign::RewardUpdateParams} for more details.
142
154
  #
@@ -148,17 +160,15 @@ module GrowsurfRuby
148
160
  #
149
161
  # @param conversions_required [Integer]
150
162
  #
151
- # @param coupon_code [String]
163
+ # @param coupon_code [String] Legacy static coupon code shown to the referrer in the reward-won email and web
152
164
  #
153
165
  # @param description [String]
154
166
  #
155
167
  # @param image_url [String]
156
168
  #
157
- # @param is_active [Boolean]
158
- #
159
- # @param is_unlimited [Boolean]
169
+ # @param is_unlimited [Boolean] Whether the reward can be earned an unlimited number of times. Defaults to `true
160
170
  #
161
- # @param is_visible [Boolean]
171
+ # @param is_visible [Boolean] Whether the reward is enabled. When `false` the reward is disabled: hidden from
162
172
  #
163
173
  # @param limit [Integer]
164
174
  #
@@ -166,15 +176,15 @@ module GrowsurfRuby
166
176
  #
167
177
  # @param metadata [Hash{Symbol=>Object}] Custom key/value metadata (single-level; values are stored as strings).
168
178
  #
169
- # @param next_milestone_prefix [String]
179
+ # @param next_milestone_prefix [String] Text shown before a participant's referral count in milestone-progress copy. App
170
180
  #
171
- # @param next_milestone_suffix [String]
181
+ # @param next_milestone_suffix [String] Text shown after a participant's referral count in milestone-progress copy. Appl
172
182
  #
173
- # @param number_of_winners [Integer]
183
+ # @param number_of_winners [Integer] The number of winners (`LEADERBOARD` rewards only). With `limitDuration` `PER_MO
174
184
  #
175
185
  # @param order [Integer]
176
186
  #
177
- # @param referral_coupon_code [String]
187
+ # @param referral_coupon_code [String] Legacy static coupon code shown to the referred friend (double-sided rewards) in
178
188
  #
179
189
  # @param referral_description [String]
180
190
  #
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ module Campaign
6
+ # @see GrowsurfRuby::Resources::Campaign::Webhooks#create
7
+ class Webhook < GrowsurfRuby::Internal::Type::BaseModel
8
+ # @!attribute auto_disabled_due_to_failures
9
+ # Read-only. Whether GrowSurf auto-disabled this webhook after repeated delivery
10
+ # failures.
11
+ #
12
+ # @return [Boolean]
13
+ required :auto_disabled_due_to_failures,
14
+ GrowsurfRuby::Internal::Type::Boolean,
15
+ api_name: :autoDisabledDueToFailures
16
+
17
+ # @!attribute events
18
+ #
19
+ # @return [Array<Symbol, GrowsurfRuby::Models::Campaign::WebhookEvent>]
20
+ required :events, -> { GrowsurfRuby::Internal::Type::ArrayOf[enum: GrowsurfRuby::Campaign::WebhookEvent] }
21
+
22
+ # @!attribute failure_count
23
+ # Read-only. Consecutive delivery failures.
24
+ #
25
+ # @return [Integer]
26
+ required :failure_count, Integer, api_name: :failureCount
27
+
28
+ # @!attribute id
29
+ # The webhook id (`primary` for the program's primary webhook).
30
+ #
31
+ # @return [String]
32
+ required :id, String
33
+
34
+ # @!attribute is_enabled
35
+ #
36
+ # @return [Boolean]
37
+ required :is_enabled, GrowsurfRuby::Internal::Type::Boolean, api_name: :isEnabled
38
+
39
+ # @!attribute last_failure_at
40
+ # Read-only. When the last delivery failure occurred, as a Unix timestamp in
41
+ # milliseconds.
42
+ #
43
+ # @return [Integer, nil]
44
+ optional :last_failure_at, Integer, api_name: :lastFailureAt, nil?: true
45
+
46
+ # @!attribute payload_url
47
+ # The URL that receives webhook deliveries.
48
+ #
49
+ # @return [String, nil]
50
+ optional :payload_url, String, api_name: :payloadUrl, nil?: true
51
+
52
+ # @!method initialize(auto_disabled_due_to_failures:, events:, failure_count:, id:, is_enabled:, last_failure_at: nil, payload_url: nil)
53
+ # Some parameter documentations has been truncated, see
54
+ # {GrowsurfRuby::Models::Campaign::Webhook} for more details.
55
+ #
56
+ # @param auto_disabled_due_to_failures [Boolean] Read-only. Whether GrowSurf auto-disabled this webhook after repeated delivery fai
57
+ #
58
+ # @param events [Array<Symbol, GrowsurfRuby::Models::Campaign::WebhookEvent>]
59
+ #
60
+ # @param failure_count [Integer] Read-only. Consecutive delivery failures.
61
+ #
62
+ # @param id [String] The webhook id (`primary` for the program's primary webhook).
63
+ #
64
+ # @param is_enabled [Boolean]
65
+ #
66
+ # @param last_failure_at [Integer, nil] Read-only. When the last delivery failure occurred, as a Unix timestamp in millise
67
+ #
68
+ # @param payload_url [String, nil] The URL that receives webhook deliveries.
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ module Campaign
6
+ # @see GrowsurfRuby::Resources::Campaign::Webhooks#create
7
+ class WebhookCreateParams < GrowsurfRuby::Internal::Type::BaseModel
8
+ extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
9
+ include GrowsurfRuby::Internal::Type::RequestParameters
10
+
11
+ # @!attribute payload_url
12
+ # The URL that receives webhook deliveries.
13
+ #
14
+ # @return [String]
15
+ required :payload_url, String, api_name: :payloadUrl
16
+
17
+ # @!attribute events
18
+ # The events this webhook is subscribed to. When omitted, it is subscribed to no
19
+ # events.
20
+ #
21
+ # @return [Array<Symbol, GrowsurfRuby::Models::Campaign::WebhookEvent>, nil]
22
+ optional :events, -> { GrowsurfRuby::Internal::Type::ArrayOf[enum: GrowsurfRuby::Campaign::WebhookEvent] }
23
+
24
+ # @!attribute is_enabled
25
+ #
26
+ # @return [Boolean, nil]
27
+ optional :is_enabled, GrowsurfRuby::Internal::Type::Boolean, api_name: :isEnabled
28
+
29
+ # @!attribute secret
30
+ # Write-only. Used to sign deliveries (the `GrowSurf-Signature` HMAC header). Never
31
+ # returned.
32
+ #
33
+ # @return [String, nil]
34
+ optional :secret, String
35
+
36
+ # @!method initialize(payload_url:, events: nil, is_enabled: nil, secret: nil, request_options: {})
37
+ # Some parameter documentations has been truncated, see
38
+ # {GrowsurfRuby::Models::Campaign::WebhookCreateParams} for more details.
39
+ #
40
+ # @param payload_url [String] The URL that receives webhook deliveries.
41
+ #
42
+ # @param events [Array<Symbol, GrowsurfRuby::Models::Campaign::WebhookEvent>] The events this webhook is subscribed to. When omitted, it is subscribed to no e
43
+ #
44
+ # @param is_enabled [Boolean]
45
+ #
46
+ # @param secret [String] Write-only. Used to sign deliveries (the `GrowSurf-Signature` HMAC header). Never
47
+ #
48
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
49
+ end
50
+ end
51
+ end
52
+ end