growsurf-ruby 1.16.0 → 1.18.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 (80) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/README.md +1 -1
  4. data/lib/growsurf_ruby/errors.rb +128 -0
  5. data/lib/growsurf_ruby/models/campaign/campaign_custom_domain.rb +109 -0
  6. data/lib/growsurf_ruby/models/campaign/create.rb +18 -4
  7. data/lib/growsurf_ruby/models/campaign/custom_domain_set_params.rb +25 -0
  8. data/lib/growsurf_ruby/models/campaign/delete_campaign_custom_domain_response.rb +27 -0
  9. data/lib/growsurf_ruby/models/campaign/participant.rb +15 -215
  10. data/lib/growsurf_ruby/models/campaign/participant_email_params.rb +12 -8
  11. data/lib/growsurf_ruby/models/campaign/participant_list_referrals_params.rb +0 -3
  12. data/lib/growsurf_ruby/models/campaign/participant_record_transaction_params.rb +16 -2
  13. data/lib/growsurf_ruby/models/campaign/participant_refund_transaction_params.rb +16 -2
  14. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +20 -0
  15. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +20 -0
  16. data/lib/growsurf_ruby/models/campaign/webhook_create_params.rb +10 -3
  17. data/lib/growsurf_ruby/models/campaign.rb +1 -0
  18. data/lib/growsurf_ruby/models/campaign_create_params.rb +10 -5
  19. data/lib/growsurf_ruby/models/campaign_list_referrals_params.rb +0 -3
  20. data/lib/growsurf_ruby/models/campaign_update_params.rb +4 -4
  21. data/lib/growsurf_ruby/models/commission_structure.rb +3 -0
  22. data/lib/growsurf_ruby/models/referral_list.rb +17 -1
  23. data/lib/growsurf_ruby/resources/campaign/custom_domain.rb +111 -0
  24. data/lib/growsurf_ruby/resources/campaign/design.rb +3 -3
  25. data/lib/growsurf_ruby/resources/campaign/emails.rb +1 -2
  26. data/lib/growsurf_ruby/resources/campaign/installation.rb +1 -2
  27. data/lib/growsurf_ruby/resources/campaign/options.rb +4 -5
  28. data/lib/growsurf_ruby/resources/campaign/participant.rb +9 -4
  29. data/lib/growsurf_ruby/resources/campaign/program_resources.rb +1 -0
  30. data/lib/growsurf_ruby/resources/campaign/rewards.rb +17 -2
  31. data/lib/growsurf_ruby/resources/campaign/webhooks.rb +13 -3
  32. data/lib/growsurf_ruby/resources/campaign.rb +15 -9
  33. data/lib/growsurf_ruby/version.rb +1 -1
  34. data/lib/growsurf_ruby.rb +4 -0
  35. data/rbi/growsurf_ruby/errors.rbi +64 -0
  36. data/rbi/growsurf_ruby/models/campaign/campaign_custom_domain.rbi +193 -0
  37. data/rbi/growsurf_ruby/models/campaign/create.rbi +24 -4
  38. data/rbi/growsurf_ruby/models/campaign/custom_domain_set_params.rbi +47 -0
  39. data/rbi/growsurf_ruby/models/campaign/delete_campaign_custom_domain_response.rbi +40 -0
  40. data/rbi/growsurf_ruby/models/campaign/participant.rbi +15 -292
  41. data/rbi/growsurf_ruby/models/campaign/participant_email_params.rbi +23 -16
  42. data/rbi/growsurf_ruby/models/campaign/participant_list_referrals_params.rbi +0 -15
  43. data/rbi/growsurf_ruby/models/campaign/participant_record_transaction_params.rbi +23 -4
  44. data/rbi/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbi +23 -4
  45. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +24 -0
  46. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +24 -0
  47. data/rbi/growsurf_ruby/models/campaign/webhook_create_params.rbi +18 -4
  48. data/rbi/growsurf_ruby/models/campaign.rbi +5 -0
  49. data/rbi/growsurf_ruby/models/campaign_create_params.rbi +6 -12
  50. data/rbi/growsurf_ruby/models/campaign_list_referrals_params.rbi +0 -15
  51. data/rbi/growsurf_ruby/models/campaign_update_params.rbi +6 -12
  52. data/rbi/growsurf_ruby/models/commission_structure.rbi +3 -0
  53. data/rbi/growsurf_ruby/models/referral_list.rbi +19 -3
  54. data/rbi/growsurf_ruby/resources/campaign/custom_domain.rbi +91 -0
  55. data/rbi/growsurf_ruby/resources/campaign/design.rbi +3 -3
  56. data/rbi/growsurf_ruby/resources/campaign/emails.rbi +1 -2
  57. data/rbi/growsurf_ruby/resources/campaign/installation.rbi +1 -2
  58. data/rbi/growsurf_ruby/resources/campaign/options.rbi +4 -5
  59. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +30 -15
  60. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +25 -2
  61. data/rbi/growsurf_ruby/resources/campaign/webhooks.rbi +21 -4
  62. data/rbi/growsurf_ruby/resources/campaign.rbi +21 -9
  63. data/sig/growsurf_ruby/errors.rbs +40 -0
  64. data/sig/growsurf_ruby/models/campaign/campaign_custom_domain.rbs +84 -0
  65. data/sig/growsurf_ruby/models/campaign/create.rbs +5 -0
  66. data/sig/growsurf_ruby/models/campaign/custom_domain_set_params.rbs +25 -0
  67. data/sig/growsurf_ruby/models/campaign/delete_campaign_custom_domain_response.rbs +18 -0
  68. data/sig/growsurf_ruby/models/campaign/participant.rbs +7 -205
  69. data/sig/growsurf_ruby/models/campaign/participant_list_referrals_params.rbs +0 -6
  70. data/sig/growsurf_ruby/models/campaign/participant_record_transaction_params.rbs +19 -5
  71. data/sig/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbs +19 -5
  72. data/sig/growsurf_ruby/models/campaign.rbs +2 -1
  73. data/sig/growsurf_ruby/models/campaign_create_params.rbs +8 -12
  74. data/sig/growsurf_ruby/models/campaign_list_referrals_params.rbs +0 -6
  75. data/sig/growsurf_ruby/models/campaign_update_params.rbs +8 -12
  76. data/sig/growsurf_ruby/models/referral_list.rbs +13 -3
  77. data/sig/growsurf_ruby/resources/campaign/custom_domain.rbs +30 -0
  78. data/sig/growsurf_ruby/resources/campaign/participant.rbs +3 -2
  79. data/sig/growsurf_ruby/resources/campaign.rbs +7 -4
  80. metadata +14 -2
@@ -18,16 +18,10 @@ module GrowsurfRuby
18
18
  attr_accessor :type
19
19
 
20
20
  sig { returns(T.nilable(String)) }
21
- attr_reader :company_logo_image_url
22
-
23
- sig { params(company_logo_image_url: String).void }
24
- attr_writer :company_logo_image_url
21
+ attr_accessor :company_logo_image_url
25
22
 
26
23
  sig { returns(T.nilable(String)) }
27
- attr_reader :company_name
28
-
29
- sig { params(company_name: String).void }
30
- attr_writer :company_name
24
+ attr_accessor :company_name
31
25
 
32
26
  sig { returns(T.nilable(String)) }
33
27
  attr_reader :currency_iso
@@ -66,8 +60,8 @@ module GrowsurfRuby
66
60
  sig do
67
61
  params(
68
62
  type: GrowsurfRuby::CampaignCreateParams::Type::OrSymbol,
69
- company_logo_image_url: String,
70
- company_name: String,
63
+ company_logo_image_url: T.nilable(String),
64
+ company_name: T.nilable(String),
71
65
  currency_iso: String,
72
66
  goal: GrowsurfRuby::CampaignCreateParams::Goal::OrSymbol,
73
67
  name: String,
@@ -91,8 +85,8 @@ module GrowsurfRuby
91
85
  override.returns(
92
86
  {
93
87
  type: GrowsurfRuby::CampaignCreateParams::Type::OrSymbol,
94
- company_logo_image_url: String,
95
- company_name: String,
88
+ company_logo_image_url: T.nilable(String),
89
+ company_name: T.nilable(String),
96
90
  currency_iso: String,
97
91
  goal: GrowsurfRuby::CampaignCreateParams::Goal::OrSymbol,
98
92
  name: String,
@@ -177,21 +177,6 @@ module GrowsurfRuby
177
177
  :email,
178
178
  GrowsurfRuby::CampaignListReferralsParams::SortBy::TaggedSymbol
179
179
  )
180
- FIRST_NAME =
181
- T.let(
182
- :firstName,
183
- GrowsurfRuby::CampaignListReferralsParams::SortBy::TaggedSymbol
184
- )
185
- LAST_NAME =
186
- T.let(
187
- :lastName,
188
- GrowsurfRuby::CampaignListReferralsParams::SortBy::TaggedSymbol
189
- )
190
- REFERRAL_STATUS =
191
- T.let(
192
- :referralStatus,
193
- GrowsurfRuby::CampaignListReferralsParams::SortBy::TaggedSymbol
194
- )
195
180
  REFERRAL_TRIGGERED_AT =
196
181
  T.let(
197
182
  :referralTriggeredAt,
@@ -18,16 +18,10 @@ module GrowsurfRuby
18
18
  attr_accessor :id
19
19
 
20
20
  sig { returns(T.nilable(String)) }
21
- attr_reader :company_logo_image_url
22
-
23
- sig { params(company_logo_image_url: String).void }
24
- attr_writer :company_logo_image_url
21
+ attr_accessor :company_logo_image_url
25
22
 
26
23
  sig { returns(T.nilable(String)) }
27
- attr_reader :company_name
28
-
29
- sig { params(company_name: String).void }
30
- attr_writer :company_name
24
+ attr_accessor :company_name
31
25
 
32
26
  sig { returns(T.nilable(String)) }
33
27
  attr_reader :name
@@ -50,8 +44,8 @@ module GrowsurfRuby
50
44
  sig do
51
45
  params(
52
46
  id: String,
53
- company_logo_image_url: String,
54
- company_name: String,
47
+ company_logo_image_url: T.nilable(String),
48
+ company_name: T.nilable(String),
55
49
  name: String,
56
50
  status: GrowsurfRuby::CampaignUpdateParams::Status::OrSymbol,
57
51
  request_options: GrowsurfRuby::RequestOptions::OrHash
@@ -71,8 +65,8 @@ module GrowsurfRuby
71
65
  override.returns(
72
66
  {
73
67
  id: String,
74
- company_logo_image_url: String,
75
- company_name: String,
68
+ company_logo_image_url: T.nilable(String),
69
+ company_name: T.nilable(String),
76
70
  name: String,
77
71
  status: GrowsurfRuby::CampaignUpdateParams::Status::OrSymbol,
78
72
  request_options: GrowsurfRuby::RequestOptions
@@ -11,6 +11,9 @@ module GrowsurfRuby
11
11
  )
12
12
  end
13
13
 
14
+ # Fixed commission amount in the currency's smallest denomination, used when
15
+ # `type` is `FIXED`. The maximum is `100000000` (1,000,000.00) for USD, EUR, and
16
+ # GBP. `null` for percentage-based commissions.
14
17
  sig { returns(T.nilable(Integer)) }
15
18
  attr_accessor :amount
16
19
 
@@ -82,6 +82,14 @@ module GrowsurfRuby
82
82
  sig { returns(T.nilable(String)) }
83
83
  attr_accessor :last_name
84
84
 
85
+ # When the referrer's credit for this referral expired, as a Unix timestamp in milliseconds. `null` when the credit has not expired.
86
+ sig { returns(T.nilable(Integer)) }
87
+ attr_accessor :referral_credit_expired_at
88
+
89
+ # When the referral was triggered, as a Unix timestamp in milliseconds. `null` until the referral is triggered, and for invites.
90
+ sig { returns(T.nilable(Integer)) }
91
+ attr_accessor :referral_triggered_at
92
+
85
93
  sig do
86
94
  params(
87
95
  id: String,
@@ -91,7 +99,9 @@ module GrowsurfRuby
91
99
  referred_by: String,
92
100
  updated_at: Integer,
93
101
  first_name: T.nilable(String),
94
- last_name: T.nilable(String)
102
+ last_name: T.nilable(String),
103
+ referral_credit_expired_at: T.nilable(Integer),
104
+ referral_triggered_at: T.nilable(Integer)
95
105
  ).returns(T.attached_class)
96
106
  end
97
107
  def self.new(
@@ -102,7 +112,11 @@ module GrowsurfRuby
102
112
  referred_by:,
103
113
  updated_at:,
104
114
  first_name: nil,
105
- last_name: nil
115
+ last_name: nil,
116
+ # When the referrer's credit for this referral expired, as a Unix timestamp in milliseconds. `null` when the credit has not expired.
117
+ referral_credit_expired_at: nil,
118
+ # When the referral was triggered, as a Unix timestamp in milliseconds. `null` until the referral is triggered, and for invites.
119
+ referral_triggered_at: nil
106
120
  )
107
121
  end
108
122
 
@@ -117,7 +131,9 @@ module GrowsurfRuby
117
131
  referred_by: String,
118
132
  updated_at: Integer,
119
133
  first_name: T.nilable(String),
120
- last_name: T.nilable(String)
134
+ last_name: T.nilable(String),
135
+ referral_credit_expired_at: T.nilable(Integer),
136
+ referral_triggered_at: T.nilable(Integer)
121
137
  }
122
138
  )
123
139
  end
@@ -0,0 +1,91 @@
1
+ # typed: strong
2
+
3
+ module GrowsurfRuby
4
+ module Resources
5
+ class Campaign
6
+ # Custom domain operations: the custom domain that serves a program's landing pages.
7
+ class CustomDomain
8
+ # Retrieves the custom domain that serves a program's landing pages, and whether its
9
+ # DNS is verified. When no custom domain is set, `domain` is `null`. This call does
10
+ # not check DNS; use `verify` for a live check.
11
+ sig do
12
+ params(
13
+ id: String,
14
+ request_options: GrowsurfRuby::RequestOptions::OrHash
15
+ ).returns(GrowsurfRuby::Models::Campaign::CampaignCustomDomain)
16
+ end
17
+ def retrieve(
18
+ # GrowSurf program ID.
19
+ id,
20
+ request_options: {}
21
+ )
22
+ end
23
+
24
+ # Sets the custom domain for a program's landing pages, or replaces the current one.
25
+ # Send a hostname such as `refer.piedpiper.com`; `https://` is added if you leave it
26
+ # out. Paths, ports, queries and `http://` return a `400`.
27
+ # Replacing a domain removes the old one right away, and its pages stop loading
28
+ # there. Sending the current domain again changes nothing. A domain used by another
29
+ # program returns a `409`.
30
+ # A new domain starts unverified. Point a `CNAME` record from the hostname to the
31
+ # `dns_record.value` in the response, then call `verify`.
32
+ sig do
33
+ params(
34
+ id: String,
35
+ domain: String,
36
+ request_options: GrowsurfRuby::RequestOptions::OrHash
37
+ ).returns(GrowsurfRuby::Models::Campaign::CampaignCustomDomain)
38
+ end
39
+ def set(
40
+ # Path param: GrowSurf program ID.
41
+ id,
42
+ # Body param: The hostname to serve the program's landing pages from, with or
43
+ # without `https://`. Up to 255 characters.
44
+ domain:,
45
+ request_options: {}
46
+ )
47
+ end
48
+
49
+ # Checks the custom domain's DNS now and returns the result in `is_verified`. The
50
+ # first time the check passes, GrowSurf sets up the domain's SSL certificate; pages
51
+ # can take a few minutes to load over `https://` after that. If the record is wrong
52
+ # or has not propagated yet, `is_verified` stays `false`; call again later. More than
53
+ # one `CNAME` record on the hostname returns a `400`. Returns a `404` when no custom
54
+ # domain is set. A domain that is already verified is returned as is, without a new
55
+ # check.
56
+ sig do
57
+ params(
58
+ id: String,
59
+ request_options: GrowsurfRuby::RequestOptions::OrHash
60
+ ).returns(GrowsurfRuby::Models::Campaign::CampaignCustomDomain)
61
+ end
62
+ def verify(
63
+ # GrowSurf program ID.
64
+ id,
65
+ request_options: {}
66
+ )
67
+ end
68
+
69
+ # Removes a program's custom domain. Its landing pages go back to their GrowSurf
70
+ # URL. Returns a `404` when no custom domain is set.
71
+ sig do
72
+ params(
73
+ id: String,
74
+ request_options: GrowsurfRuby::RequestOptions::OrHash
75
+ ).returns(GrowsurfRuby::Models::Campaign::DeleteCampaignCustomDomainResponse)
76
+ end
77
+ def delete(
78
+ # GrowSurf program ID.
79
+ id,
80
+ request_options: {}
81
+ )
82
+ end
83
+
84
+ # @api private
85
+ sig { params(client: GrowsurfRuby::Client).returns(T.attached_class) }
86
+ def self.new(client:)
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -40,7 +40,8 @@ module GrowsurfRuby
40
40
  # programs and hidden for referral programs, and `GET` returns every setting with its
41
41
  # default copy.
42
42
  # `participantAvatarStyle` is `CHARACTERS`, `INITIALS`, `ANIMALS`, or `GRADIENT`; missing or
43
- # unknown values mean `INITIALS`.
43
+ # unknown values mean `INITIALS`. `visualStyle` is `GLOW`, `CLEAN`, `FLAT`, `ROUND`, `TINT`,
44
+ # or `GLASS`, and is omitted when the program has no saved Style.
44
45
  # `payoutDestinationConfirmation` is omitted when no confirmation fields are stored. Stored
45
46
  # `null` fields are returned as `null`; omitted and `null` fields use localized defaults.
46
47
  sig do
@@ -65,8 +66,7 @@ module GrowsurfRuby
65
66
  # values return a `400`. Landing-page custom code and JavaScript are not editable via the
66
67
  # API.
67
68
  # Changes to participant email content are checked before saving. Rejected content
68
- # returns `400`; if the check is unavailable, `503` asks you to retry. Neither
69
- # response saves the change. A concurrent edit can return `409`; reload the
69
+ # returns `400` and is not saved. A concurrent edit can return `409`; reload the
70
70
  # program before retrying.
71
71
  sig do
72
72
  params(
@@ -34,8 +34,7 @@ module GrowsurfRuby
34
34
  # (`settings.sender.fromEmail`, whose custom value requires dashboard domain
35
35
  # verification).
36
36
  # Changes to participant email content are checked before saving. Rejected content
37
- # returns `400`; if the check is unavailable, `503` asks you to retry. Neither
38
- # response saves the change. A concurrent edit can return `409`; reload the
37
+ # returns `400` and is not saved. A concurrent edit can return `409`; reload the
39
38
  # program before retrying.
40
39
  sig do
41
40
  params(
@@ -28,8 +28,7 @@ module GrowsurfRuby
28
28
  # redirect destinations, which may take a moment to complete. URLs must include an
29
29
  # explicit `http://` or `https://` scheme.
30
30
  # Changes to participant email content are checked before saving. Rejected content
31
- # returns `400`; if the check is unavailable, `503` asks you to retry. Neither
32
- # response saves the change. A concurrent edit can return `409`; reload the
31
+ # returns `400` and is not saved. A concurrent edit can return `409`; reload the
33
32
  # program before retrying.
34
33
  sig do
35
34
  params(
@@ -29,12 +29,11 @@ module GrowsurfRuby
29
29
  # and `payoutThreshold`/`taxDocumentation` are affiliate-only, and affiliate
30
30
  # programs require `requireParticipantAuth: true`). `fraud.recaptcha.secretKey`
31
31
  # is write-only. `referralCreditWindowDays: null` means "never expires".
32
- # Turning on `languages.additionalLanguages` requires the Business plan or
33
- # higher. While any are on, every `languages` change, including turning them
34
- # off, requires it too (`403` otherwise).
32
+ # Turning on `languages.additionalLanguages` returns `403` if your account does
33
+ # not include additional languages. While any are on, every `languages` change,
34
+ # including turning them off, returns the same `403`.
35
35
  # Changes to participant email content are checked before saving. Rejected content
36
- # returns `400`; if the check is unavailable, `503` asks you to retry. Neither
37
- # response saves the change. A concurrent edit can return `409`; reload the
36
+ # returns `400` and is not saved. A concurrent edit can return `409`; reload the
38
37
  # program before retrying.
39
38
  sig do
40
39
  params(
@@ -124,7 +124,10 @@ module GrowsurfRuby
124
124
  end
125
125
 
126
126
  # Adds a new participant to the program. If the email already exists, the existing
127
- # participant is returned unchanged. For affiliate programs, set `isAffiliate` to
127
+ # participant is returned unchanged. One exception: if that participant claimed an
128
+ # offer in the Claim Offer Popup and the signup is not complete yet, this call completes
129
+ # the signup with the original referrer and saves any non-blank `firstName`,
130
+ # `lastName`, and `metadata` you send. For affiliate programs, set `isAffiliate` to
128
131
  # `true` to enroll a new participant as an approved affiliate or `false` to create
129
132
  # a non-affiliate. If you omit `isAffiliate`, a valid `referredBy` creates a
130
133
  # referred non-affiliate; without a valid referrer, the new participant is enrolled
@@ -145,6 +148,7 @@ module GrowsurfRuby
145
148
  mobile_instance_id: String,
146
149
  referral_status:
147
150
  GrowsurfRuby::Campaign::Create::ReferralStatus::OrSymbol,
151
+ referred_at: T.nilable(Integer),
148
152
  referred_by: String,
149
153
  request_options: GrowsurfRuby::RequestOptions::OrHash
150
154
  ).returns(GrowsurfRuby::Campaign::CampaignParticipant)
@@ -161,8 +165,11 @@ module GrowsurfRuby
161
165
  # creates a non-affiliate without `affiliateStatus`. Existing participants are
162
166
  # returned unchanged.
163
167
  is_affiliate: nil,
164
- # The language of the participant's portal and program emails. Must be one of the
165
- # program's languages. Applied only when this request creates the participant.
168
+ # The language of the participant's portal and program emails. Stored when it is
169
+ # one of the program's languages. A regional tag maps to its language (for
170
+ # example, `es-MX` is stored as `es`). Any other value is ignored and the
171
+ # program's base language applies. Applied only when this request creates the
172
+ # participant.
166
173
  language: nil,
167
174
  last_name: nil,
168
175
  # Shallow custom metadata object.
@@ -176,6 +183,11 @@ module GrowsurfRuby
176
183
  # (`CREDIT_AWARDED`, `CREDIT_PENDING`, or `CREDIT_EXPIRED`); left unset when no
177
184
  # referrer resolves.
178
185
  referral_status: nil,
186
+ # When the participant was referred, in Unix milliseconds. Used only with a valid
187
+ # `referredBy`. If you omit `referralStatus`, GrowSurf compares this time with
188
+ # the program's referral credit window to set it. Defaults to the time of the
189
+ # request.
190
+ referred_at: nil,
179
191
  # Referrer participant ID or email address.
180
192
  referred_by: nil,
181
193
  request_options: {}
@@ -341,7 +353,7 @@ module GrowsurfRuby
341
353
  total_tax_amounts: T::Array[T::Hash[Symbol, T.anything]],
342
354
  total_taxes: T::Array[T::Hash[Symbol, T.anything]],
343
355
  transaction_id: String,
344
- payment_provider: String,
356
+ payment_provider: GrowsurfRuby::Campaign::ParticipantRecordTransactionParams::PaymentProvider::OrSymbol,
345
357
  test_mode: T::Boolean,
346
358
  request_options: GrowsurfRuby::RequestOptions::OrHash
347
359
  ).returns(
@@ -432,7 +444,7 @@ module GrowsurfRuby
432
444
  refund_id: String,
433
445
  refund_status: String,
434
446
  transaction_id: String,
435
- payment_provider: String,
447
+ payment_provider: GrowsurfRuby::Campaign::ParticipantRefundTransactionParams::PaymentProvider::OrSymbol,
436
448
  test_mode: T::Boolean,
437
449
  request_options: GrowsurfRuby::RequestOptions::OrHash
438
450
  ).returns(
@@ -591,16 +603,19 @@ module GrowsurfRuby
591
603
  # dynamic text, inserting `{{...}}` tokens like `{{firstName}}` or `{{shareUrl}}`.
592
604
  # See [Guide to using dynamic text in GrowSurf emails](https://support.growsurf.com/article/213-guide-to-using-dynamic-text-in-growsurf-emails).
593
605
  body: nil,
594
- # Body param: The program email template to send (template mode). Send the
595
- # camelCase key. The valid types depend on the program type; `isEnabled` only
596
- # controls automatic sends. Referral programs: `welcomeNonReferred`,
597
- # `referralLinkViewedFirstTime`, `referralLinkUsed`, `referredSignup`,
598
- # `welcomeReferred`, `goalAchieved`, `campaignEndedWinners`,
599
- # `campaignEndedNonWinners`, `progressUpdateMonthly`. Affiliate programs:
600
- # `welcomeNonReferred`, `referralLinkViewedFirstTime`, `referredSignup`,
601
- # `commissionGenerated`, `commissionAdjusted`, `payoutPending`,
602
- # `payoutSentSuccess`, `progressUpdateMonthly`. System/transactional types (login
603
- # link, PayPal confirmation, tax) and the invite email cannot be sent.
606
+ # Body param: The program email template to trigger (template mode). Send the
607
+ # camelCase email-type key. The available types depend on the program type;
608
+ # the template's `isEnabled` setting controls automatic sends only. This
609
+ # endpoint can trigger any sendable template. System and transactional types
610
+ # (login link, payout destination confirmation, tax notifications), the invite
611
+ # email, and the follow-up reminder cannot be sent. Referral programs:
612
+ # `welcomeNonReferred`, `referralLinkViewedFirstTime`, `referralLinkUsed`,
613
+ # `referredSignup`, `welcomeReferred`, `offerClaimed`, `goalAchieved`,
614
+ # `campaignEndedWinners`, `campaignEndedNonWinners`, `progressUpdateMonthly`.
615
+ # Affiliate programs: `welcomeNonReferred`, `referralLinkViewedFirstTime`,
616
+ # `referredSignup`, `offerClaimed`, `commissionGenerated`,
617
+ # `commissionAdjusted`, `payoutPending`, `payoutSentSuccess`,
618
+ # `progressUpdateMonthly`.
604
619
  email_type: nil,
605
620
  # Body param: Optional preheader text for a free-form email.
606
621
  preheader: nil,
@@ -105,6 +105,18 @@ module GrowsurfRuby
105
105
  limit_duration: nil,
106
106
  # Body param: Custom key/value metadata (single-level; values are stored as
107
107
  # strings).
108
+ # Each value must be a string, number, or boolean of up to 500 characters.
109
+ # Each key must have 1 to 40 characters once camelCased, and two keys that
110
+ # camelCase to the same key are rejected. Up to 50 keys. An entry that breaks
111
+ # these rules returns `400`.
112
+ #
113
+ # For `DOUBLE_SIDED` rewards in referral programs, `rewardAmount` is the
114
+ # referrer’s amount and `referredRewardAmount` is the friend’s amount. If
115
+ # `referredRewardAmount` is absent, both use `rewardAmount`. New or changed positive
116
+ # numeric amounts must use whole units for currencies without decimals, such as JPY, and
117
+ # no more than two decimal places for other currencies, including USD and KWD. Excess
118
+ # precision is rejected rather than rounded, including when you clone a program.
119
+ # Existing unchanged amounts and earned rewards keep their saved values.
108
120
  metadata: nil,
109
121
  # Body param: Text shown before a participant's referral count in
110
122
  # milestone-progress copy. Applies to `MILESTONE` rewards.
@@ -145,8 +157,7 @@ module GrowsurfRuby
145
157
  # the referencing fields. For an affiliate reward, `commissionStructure.event:
146
158
  # LEAD` requires a `FIXED` commission with a positive `amount`.
147
159
  # Changes to participant email content are checked before saving. Rejected content
148
- # returns `400`; if the check is unavailable, `503` asks you to retry. Neither
149
- # response saves the change. A concurrent edit can return `409`; reload the
160
+ # returns `400` and is not saved. A concurrent edit can return `409`; reload the
150
161
  # program before retrying.
151
162
  sig do
152
163
  params(
@@ -223,6 +234,18 @@ module GrowsurfRuby
223
234
  limit_duration: nil,
224
235
  # Body param: Custom key/value metadata (single-level; values are stored as
225
236
  # strings).
237
+ # Each value must be a string, number, or boolean of up to 500 characters.
238
+ # Each key must have 1 to 40 characters once camelCased, and two keys that
239
+ # camelCase to the same key are rejected. Up to 50 keys. An entry that breaks
240
+ # these rules returns `400`.
241
+ #
242
+ # For `DOUBLE_SIDED` rewards in referral programs, `rewardAmount` is the
243
+ # referrer’s amount and `referredRewardAmount` is the friend’s amount. If
244
+ # `referredRewardAmount` is absent, both use `rewardAmount`. New or changed positive
245
+ # numeric amounts must use whole units for currencies without decimals, such as JPY, and
246
+ # no more than two decimal places for other currencies, including USD and KWD. Excess
247
+ # precision is rejected rather than rounded, including when you clone a program.
248
+ # Existing unchanged amounts and earned rewards keep their saved values.
226
249
  metadata: nil,
227
250
  # Body param: Text shown before a participant's referral count in
228
251
  # milestone-progress copy. Applies to `MILESTONE` rewards.
@@ -18,7 +18,13 @@ module GrowsurfRuby
18
18
  )
19
19
  end
20
20
 
21
- # Adds a webhook to the program.
21
+ # Adds a webhook to the program. A program can have only one saved Bask Health
22
+ # webhook across all `bask.ninja` hosts and paths, including disabled webhooks. A
23
+ # second Bask Health webhook returns `400`.
24
+ # A program can have up to 5 webhooks, counting the primary webhook slot, so you
25
+ # can create up to 4. Creating another returns `400`.
26
+ # A concurrent change to webhook settings can return `409`; reload the webhooks
27
+ # before retrying.
22
28
  sig do
23
29
  params(
24
30
  id: String,
@@ -34,8 +40,15 @@ module GrowsurfRuby
34
40
  id,
35
41
  # Body param: The URL that receives webhook deliveries.
36
42
  payload_url:,
37
- # Body param: The events this webhook is subscribed to. When omitted, it is
38
- # subscribed to no events.
43
+ # Body param: The events this webhook is subscribed to. When omitted, the
44
+ # webhook is subscribed to every event its program type offers, like a webhook
45
+ # added in the dashboard: referral programs offer
46
+ # `PARTICIPANT_REACHED_A_GOAL`, `NEW_PARTICIPANT_ADDED`,
47
+ # `PARTICIPANT_FRAUD_STATUS_UPDATED`, and `CAMPAIGN_ENDED`; affiliate programs
48
+ # offer `NEW_COMMISSION_ADDED`, `COMMISSION_ADJUSTED`, `NEW_PAYOUT_ISSUED`,
49
+ # `NEW_PARTICIPANT_ADDED`, `PARTICIPANT_FRAUD_STATUS_UPDATED`, and
50
+ # `CAMPAIGN_ENDED`. Send `[]` to subscribe to no events. An event the program
51
+ # type does not offer returns `400`.
39
52
  events: nil,
40
53
  # Body param
41
54
  is_enabled: nil,
@@ -46,7 +59,11 @@ module GrowsurfRuby
46
59
  )
47
60
  end
48
61
 
49
- # Updates a webhook by id.
62
+ # Updates a webhook by id. A program can have only one saved Bask Health webhook
63
+ # across all `bask.ninja` hosts and paths, including disabled webhooks. An update
64
+ # that leaves more than one Bask Health webhook returns `400`.
65
+ # A concurrent change to webhook settings can return `409`; reload the webhooks
66
+ # before retrying.
50
67
  sig do
51
68
  params(
52
69
  webhook_id: String,
@@ -26,6 +26,10 @@ module GrowsurfRuby
26
26
  sig { returns(GrowsurfRuby::Resources::Campaign::Design) }
27
27
  attr_reader :design
28
28
 
29
+ # Custom domain operations for a program's landing pages.
30
+ sig { returns(GrowsurfRuby::Resources::Campaign::CustomDomain) }
31
+ attr_reader :custom_domain
32
+
29
33
  # Program Editor "Emails" tab configuration operations.
30
34
  sig { returns(GrowsurfRuby::Resources::Campaign::Emails) }
31
35
  attr_reader :emails
@@ -74,8 +78,8 @@ module GrowsurfRuby
74
78
  sig do
75
79
  params(
76
80
  type: GrowsurfRuby::CampaignCreateParams::Type::OrSymbol,
77
- company_logo_image_url: String,
78
- company_name: String,
81
+ company_logo_image_url: T.nilable(String),
82
+ company_name: T.nilable(String),
79
83
  currency_iso: String,
80
84
  goal: GrowsurfRuby::CampaignCreateParams::Goal::OrSymbol,
81
85
  name: String,
@@ -111,14 +115,13 @@ module GrowsurfRuby
111
115
  # dedicated config sub-resources, not here. The program cannot be deleted via this
112
116
  # endpoint.
113
117
  # Changes to participant email content are checked before saving. Rejected content
114
- # returns `400`; if the check is unavailable, `503` asks you to retry. Neither
115
- # response saves the change. A concurrent edit can return `409`; reload the program
116
- # before retrying.
118
+ # returns `400` and is not saved. A concurrent edit can return `409`; reload the
119
+ # program before retrying.
117
120
  sig do
118
121
  params(
119
122
  id: String,
120
- company_logo_image_url: String,
121
- company_name: String,
123
+ company_logo_image_url: T.nilable(String),
124
+ company_name: T.nilable(String),
122
125
  name: String,
123
126
  status: GrowsurfRuby::CampaignUpdateParams::Status::OrSymbol,
124
127
  request_options: GrowsurfRuby::RequestOptions::OrHash
@@ -220,6 +223,7 @@ module GrowsurfRuby
220
223
  mobile_instance_id: String,
221
224
  referral_status:
222
225
  GrowsurfRuby::Campaign::Create::ReferralStatus::OrSymbol,
226
+ referred_at: T.nilable(Integer),
223
227
  referred_by: String,
224
228
  request_options: GrowsurfRuby::RequestOptions::OrHash
225
229
  ).returns(
@@ -233,8 +237,11 @@ module GrowsurfRuby
233
237
  fingerprint: nil,
234
238
  first_name: nil,
235
239
  ip_address: nil,
236
- # The language of the participant's portal and program emails. Must be one of the
237
- # program's languages. Applied only when this request creates the participant.
240
+ # The language of the participant's portal and program emails. Stored when it is
241
+ # one of the program's languages. A regional tag maps to its language (for
242
+ # example, `es-MX` is stored as `es`). Any other value is ignored and the
243
+ # program's base language applies. Applied only when this request creates the
244
+ # participant.
238
245
  language: nil,
239
246
  last_name: nil,
240
247
  # Shallow custom metadata object.
@@ -244,6 +251,11 @@ module GrowsurfRuby
244
251
  # mobile SDKs generate this as a lowercase UUID.
245
252
  mobile_instance_id: nil,
246
253
  referral_status: nil,
254
+ # When the participant was referred, in Unix milliseconds. Used only with a valid
255
+ # `referredBy`. If you omit `referralStatus`, GrowSurf compares this time with
256
+ # the program's referral credit window to set it. Defaults to the time of the
257
+ # request.
258
+ referred_at: nil,
247
259
  # Referrer participant ID or email address.
248
260
  referred_by: nil,
249
261
  request_options: {}
@@ -71,6 +71,38 @@ module GrowsurfRuby
71
71
  ?message: String?
72
72
  ) -> instance
73
73
 
74
+ attr_reader error_name: String?
75
+
76
+ attr_reader error_code: String?
77
+
78
+ attr_reader error_message: String?
79
+
80
+ attr_reader errors: ::Array[::Hash[Symbol, top]]?
81
+
82
+ attr_reader support_url: String?
83
+
84
+ attr_reader policy_name: String?
85
+
86
+ attr_reader level: String?
87
+
88
+ attr_reader timestamp: String?
89
+
90
+ attr_reader fraud_risk_level: String?
91
+
92
+ attr_reader fraud_reason_code: String?
93
+
94
+ attr_reader matched_participant_ids: ::Array[String]?
95
+
96
+ attr_reader email: String?
97
+
98
+ attr_reader referrer_id: String?
99
+
100
+ attr_reader ip_address: String?
101
+
102
+ attr_reader fingerprint: String?
103
+
104
+ attr_reader blocked_at: String?
105
+
74
106
  def initialize: (
75
107
  url: URI::Generic,
76
108
  status: Integer,
@@ -80,6 +112,14 @@ module GrowsurfRuby
80
112
  response: nil,
81
113
  ?message: String?
82
114
  ) -> void
115
+
116
+ private
117
+
118
+ def string_or_nil: (top value) -> String?
119
+
120
+ def string_list_or_nil: (top value) -> ::Array[String]?
121
+
122
+ def hash_list_or_nil: (top value) -> ::Array[::Hash[Symbol, top]]?
83
123
  end
84
124
 
85
125
  class BadRequestError < GrowsurfRuby::Errors::APIStatusError