growsurf-ruby 1.17.0 → 1.19.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 (92) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/README.md +1 -1
  4. data/lib/growsurf_ruby/client.rb +0 -4
  5. data/lib/growsurf_ruby/errors.rb +128 -0
  6. data/lib/growsurf_ruby/models/campaign/campaign_custom_domain.rb +109 -0
  7. data/lib/growsurf_ruby/models/campaign/create.rb +18 -4
  8. data/lib/growsurf_ruby/models/campaign/custom_domain_set_params.rb +25 -0
  9. data/lib/growsurf_ruby/models/campaign/delete_campaign_custom_domain_response.rb +27 -0
  10. data/lib/growsurf_ruby/models/campaign/participant.rb +15 -215
  11. data/lib/growsurf_ruby/models/campaign/participant_email_params.rb +12 -8
  12. data/lib/growsurf_ruby/models/campaign/participant_list_referrals_params.rb +0 -3
  13. data/lib/growsurf_ruby/models/campaign/participant_record_transaction_params.rb +16 -2
  14. data/lib/growsurf_ruby/models/campaign/participant_refund_transaction_params.rb +16 -2
  15. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +20 -0
  16. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +20 -0
  17. data/lib/growsurf_ruby/models/campaign/webhook_create_params.rb +10 -3
  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/models.rb +0 -2
  24. data/lib/growsurf_ruby/resources/campaign/custom_domain.rb +111 -0
  25. data/lib/growsurf_ruby/resources/campaign/design.rb +3 -3
  26. data/lib/growsurf_ruby/resources/campaign/emails.rb +1 -2
  27. data/lib/growsurf_ruby/resources/campaign/installation.rb +1 -2
  28. data/lib/growsurf_ruby/resources/campaign/options.rb +4 -5
  29. data/lib/growsurf_ruby/resources/campaign/participant.rb +9 -4
  30. data/lib/growsurf_ruby/resources/campaign/program_resources.rb +1 -0
  31. data/lib/growsurf_ruby/resources/campaign/rewards.rb +17 -2
  32. data/lib/growsurf_ruby/resources/campaign/webhooks.rb +13 -3
  33. data/lib/growsurf_ruby/resources/campaign.rb +15 -9
  34. data/lib/growsurf_ruby/version.rb +1 -1
  35. data/lib/growsurf_ruby.rb +4 -3
  36. data/rbi/growsurf_ruby/client.rbi +0 -3
  37. data/rbi/growsurf_ruby/errors.rbi +64 -0
  38. data/rbi/growsurf_ruby/models/campaign/campaign_custom_domain.rbi +193 -0
  39. data/rbi/growsurf_ruby/models/campaign/create.rbi +24 -4
  40. data/rbi/growsurf_ruby/models/campaign/custom_domain_set_params.rbi +47 -0
  41. data/rbi/growsurf_ruby/models/campaign/delete_campaign_custom_domain_response.rbi +40 -0
  42. data/rbi/growsurf_ruby/models/campaign/participant.rbi +15 -292
  43. data/rbi/growsurf_ruby/models/campaign/participant_email_params.rbi +23 -16
  44. data/rbi/growsurf_ruby/models/campaign/participant_list_referrals_params.rbi +0 -15
  45. data/rbi/growsurf_ruby/models/campaign/participant_record_transaction_params.rbi +23 -4
  46. data/rbi/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbi +23 -4
  47. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +24 -0
  48. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +24 -0
  49. data/rbi/growsurf_ruby/models/campaign/webhook_create_params.rbi +18 -4
  50. data/rbi/growsurf_ruby/models/campaign_create_params.rbi +6 -12
  51. data/rbi/growsurf_ruby/models/campaign_list_referrals_params.rbi +0 -15
  52. data/rbi/growsurf_ruby/models/campaign_update_params.rbi +6 -12
  53. data/rbi/growsurf_ruby/models/commission_structure.rbi +3 -0
  54. data/rbi/growsurf_ruby/models/referral_list.rbi +19 -3
  55. data/rbi/growsurf_ruby/models.rbi +0 -2
  56. data/rbi/growsurf_ruby/resources/campaign/custom_domain.rbi +91 -0
  57. data/rbi/growsurf_ruby/resources/campaign/design.rbi +3 -3
  58. data/rbi/growsurf_ruby/resources/campaign/emails.rbi +1 -2
  59. data/rbi/growsurf_ruby/resources/campaign/installation.rbi +1 -2
  60. data/rbi/growsurf_ruby/resources/campaign/options.rbi +4 -5
  61. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +30 -15
  62. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +25 -2
  63. data/rbi/growsurf_ruby/resources/campaign/webhooks.rbi +21 -4
  64. data/rbi/growsurf_ruby/resources/campaign.rbi +21 -9
  65. data/sig/growsurf_ruby/client.rbs +0 -2
  66. data/sig/growsurf_ruby/errors.rbs +40 -0
  67. data/sig/growsurf_ruby/models/campaign/campaign_custom_domain.rbs +84 -0
  68. data/sig/growsurf_ruby/models/campaign/create.rbs +5 -0
  69. data/sig/growsurf_ruby/models/campaign/custom_domain_set_params.rbs +25 -0
  70. data/sig/growsurf_ruby/models/campaign/delete_campaign_custom_domain_response.rbs +18 -0
  71. data/sig/growsurf_ruby/models/campaign/participant.rbs +7 -205
  72. data/sig/growsurf_ruby/models/campaign/participant_list_referrals_params.rbs +0 -6
  73. data/sig/growsurf_ruby/models/campaign/participant_record_transaction_params.rbs +19 -5
  74. data/sig/growsurf_ruby/models/campaign/participant_refund_transaction_params.rbs +19 -5
  75. data/sig/growsurf_ruby/models/campaign_create_params.rbs +8 -12
  76. data/sig/growsurf_ruby/models/campaign_list_referrals_params.rbs +0 -6
  77. data/sig/growsurf_ruby/models/campaign_update_params.rbs +8 -12
  78. data/sig/growsurf_ruby/models/referral_list.rbs +13 -3
  79. data/sig/growsurf_ruby/models.rbs +0 -2
  80. data/sig/growsurf_ruby/resources/campaign/custom_domain.rbs +30 -0
  81. data/sig/growsurf_ruby/resources/campaign/participant.rbs +3 -2
  82. data/sig/growsurf_ruby/resources/campaign.rbs +7 -4
  83. metadata +14 -11
  84. data/lib/growsurf_ruby/models/account_create_params.rb +0 -46
  85. data/lib/growsurf_ruby/models/account_create_response.rb +0 -57
  86. data/lib/growsurf_ruby/resources/account.rb +0 -66
  87. data/rbi/growsurf_ruby/models/account_create_params.rbi +0 -73
  88. data/rbi/growsurf_ruby/models/account_create_response.rbi +0 -107
  89. data/rbi/growsurf_ruby/resources/account.rbi +0 -46
  90. data/sig/growsurf_ruby/models/account_create_params.rbs +0 -42
  91. data/sig/growsurf_ruby/models/account_create_response.rbs +0 -42
  92. data/sig/growsurf_ruby/resources/account.rbs +0 -15
@@ -0,0 +1,111 @@
1
+ # frozen_string_literal: true
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
+ #
12
+ # @overload retrieve(id, request_options: {})
13
+ #
14
+ # @param id [String] GrowSurf program ID.
15
+ #
16
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
17
+ #
18
+ # @return [GrowsurfRuby::Models::Campaign::CampaignCustomDomain]
19
+ def retrieve(id, params = {})
20
+ @client.request(
21
+ method: :get,
22
+ path: ["campaign/%1$s/custom-domain", id],
23
+ model: GrowsurfRuby::Models::Campaign::CampaignCustomDomain,
24
+ options: params[:request_options]
25
+ )
26
+ end
27
+
28
+ # Sets the custom domain for a program's landing pages, or replaces the current one.
29
+ # Send a hostname such as `refer.piedpiper.com`; `https://` is added if you leave it
30
+ # out. Paths, ports, queries and `http://` return a `400`.
31
+ # Replacing a domain removes the old one right away, and its pages stop loading
32
+ # there. Sending the current domain again changes nothing. A domain used by another
33
+ # program returns a `409`.
34
+ # A new domain starts unverified. Point a `CNAME` record from the hostname to the
35
+ # `dns_record.value` in the response, then call {#verify}.
36
+ #
37
+ # @overload set(id, domain:, request_options: {})
38
+ #
39
+ # @param id [String] Path param: GrowSurf program ID.
40
+ #
41
+ # @param domain [String] Body param: The hostname to serve the program's landing pages from, with or without `https://`.
42
+ #
43
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
44
+ #
45
+ # @return [GrowsurfRuby::Models::Campaign::CampaignCustomDomain]
46
+ #
47
+ # @see GrowsurfRuby::Models::Campaign::CustomDomainSetParams
48
+ def set(id, params)
49
+ parsed, options = GrowsurfRuby::Campaign::CustomDomainSetParams.dump_request(params)
50
+ @client.request(
51
+ method: :put,
52
+ path: ["campaign/%1$s/custom-domain", id],
53
+ body: parsed,
54
+ model: GrowsurfRuby::Models::Campaign::CampaignCustomDomain,
55
+ options: options
56
+ )
57
+ end
58
+
59
+ # Checks the custom domain's DNS now and returns the result in `is_verified`. The
60
+ # first time the check passes, GrowSurf sets up the domain's SSL certificate; pages
61
+ # can take a few minutes to load over `https://` after that. If the record is wrong
62
+ # or has not propagated yet, `is_verified` stays `false`; call again later. More than
63
+ # one `CNAME` record on the hostname returns a `400`. Returns a `404` when no custom
64
+ # domain is set. A domain that is already verified is returned as is, without a new
65
+ # check.
66
+ #
67
+ # @overload verify(id, request_options: {})
68
+ #
69
+ # @param id [String] GrowSurf program ID.
70
+ #
71
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
72
+ #
73
+ # @return [GrowsurfRuby::Models::Campaign::CampaignCustomDomain]
74
+ def verify(id, params = {})
75
+ @client.request(
76
+ method: :post,
77
+ path: ["campaign/%1$s/custom-domain/verify", id],
78
+ model: GrowsurfRuby::Models::Campaign::CampaignCustomDomain,
79
+ options: params[:request_options]
80
+ )
81
+ end
82
+
83
+ # Removes a program's custom domain. Its landing pages go back to their GrowSurf
84
+ # URL. Returns a `404` when no custom domain is set.
85
+ #
86
+ # @overload delete(id, request_options: {})
87
+ #
88
+ # @param id [String] GrowSurf program ID.
89
+ #
90
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
91
+ #
92
+ # @return [GrowsurfRuby::Models::Campaign::DeleteCampaignCustomDomainResponse]
93
+ def delete(id, params = {})
94
+ @client.request(
95
+ method: :delete,
96
+ path: ["campaign/%1$s/custom-domain", id],
97
+ model: GrowsurfRuby::Models::Campaign::DeleteCampaignCustomDomainResponse,
98
+ options: params[:request_options]
99
+ )
100
+ end
101
+
102
+ # @api private
103
+ #
104
+ # @param client [GrowsurfRuby::Client]
105
+ def initialize(client:)
106
+ @client = client
107
+ end
108
+ end
109
+ end
110
+ end
111
+ end
@@ -16,7 +16,8 @@ module GrowsurfRuby
16
16
  # programs and hidden for referral programs, and `GET` returns every setting with its
17
17
  # default copy.
18
18
  # `participantAvatarStyle` is `CHARACTERS`, `INITIALS`, `ANIMALS`, or `GRADIENT`; missing or
19
- # unknown values mean `INITIALS`.
19
+ # unknown values mean `INITIALS`. `visualStyle` is `GLOW`, `CLEAN`, `FLAT`, `ROUND`, `TINT`,
20
+ # or `GLASS`, and is omitted when the program has no saved Style.
20
21
  # `payoutDestinationConfirmation` is omitted when no confirmation fields are stored. Stored
21
22
  # `null` fields are returned as `null`; omitted and `null` fields use localized defaults.
22
23
  #
@@ -45,8 +46,7 @@ module GrowsurfRuby
45
46
  # Unknown fields, fields not available for the program type, and invalid values return a
46
47
  # `400`. Landing-page custom code and JavaScript are not editable via the API.
47
48
  # Changes to participant email content are checked before saving. Rejected content
48
- # returns `400`; if the check is unavailable, `503` asks you to retry. Neither
49
- # response saves the change. A concurrent edit can return `409`; reload the
49
+ # returns `400` and is not saved. A concurrent edit can return `409`; reload the
50
50
  # program before retrying.
51
51
  #
52
52
  # @overload update(id, body, request_options: {})
@@ -40,8 +40,7 @@ module GrowsurfRuby
40
40
  # (`settings.sender.fromEmail`, whose custom value requires dashboard domain
41
41
  # verification).
42
42
  # Changes to participant email content are checked before saving. Rejected content
43
- # returns `400`; if the check is unavailable, `503` asks you to retry. Neither
44
- # response saves the change. A concurrent edit can return `409`; reload the
43
+ # returns `400` and is not saved. A concurrent edit can return `409`; reload the
45
44
  # program before retrying.
46
45
  #
47
46
  # @overload update(id, body, request_options: {})
@@ -33,8 +33,7 @@ module GrowsurfRuby
33
33
  # redirect destinations, which may take a moment to complete. URLs must include an
34
34
  # explicit `http://` or `https://` scheme.
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
  #
40
39
  # @overload update(id, body, request_options: {})
@@ -33,12 +33,11 @@ module GrowsurfRuby
33
33
  # and `payoutThreshold`/`taxDocumentation` are affiliate-only, and affiliate
34
34
  # programs require `requireParticipantAuth: true`). `fraud.recaptcha.secretKey`
35
35
  # is write-only. `referralCreditWindowDays: null` means "never expires".
36
- # Turning on `languages.additionalLanguages` requires the Business plan or
37
- # higher. While any are on, every `languages` change, including turning them
38
- # off, requires it too (`403` otherwise).
36
+ # Turning on `languages.additionalLanguages` returns `403` if your account does
37
+ # not include additional languages. While any are on, every `languages` change,
38
+ # including turning them off, returns the same `403`.
39
39
  # Changes to participant email content are checked before saving. Rejected content
40
- # returns `400`; if the check is unavailable, `503` asks you to retry. Neither
41
- # response saves the change. A concurrent edit can return `409`; reload the
40
+ # returns `400` and is not saved. A concurrent edit can return `409`; reload the
42
41
  # program before retrying.
43
42
  #
44
43
  # @overload update(id, body, request_options: {})
@@ -147,7 +147,10 @@ module GrowsurfRuby
147
147
  # {GrowsurfRuby::Models::Campaign::ParticipantAddParams} for more details.
148
148
  #
149
149
  # Adds a new participant to the program. If the email already exists, the existing
150
- # participant is returned unchanged. For affiliate programs, set `isAffiliate` to
150
+ # participant is returned unchanged. One exception: if that participant claimed an
151
+ # offer in the Claim Offer Popup and the signup is not complete yet, this call completes
152
+ # the signup with the original referrer and saves any non-blank `firstName`,
153
+ # `lastName`, and `metadata` you send. For affiliate programs, set `isAffiliate` to
151
154
  # `true` to enroll a new participant as an approved affiliate or `false` to create
152
155
  # a non-affiliate. If you omit `isAffiliate`, a valid `referredBy` creates a
153
156
  # referred non-affiliate; without a valid referrer, the new participant is enrolled
@@ -155,7 +158,7 @@ module GrowsurfRuby
155
158
  # `isAffiliate: true` to keep the referral attribution and enroll the participant
156
159
  # as an affiliate.
157
160
  #
158
- # @overload add(id, email:, fingerprint: nil, first_name: nil, ip_address: nil, is_affiliate: nil, language: nil, last_name: nil, metadata: nil, mobile_instance_id: nil, referral_status: nil, referred_by: nil, request_options: {})
161
+ # @overload add(id, email:, fingerprint: nil, first_name: nil, ip_address: nil, is_affiliate: nil, language: nil, last_name: nil, metadata: nil, mobile_instance_id: nil, referral_status: nil, referred_at: nil, referred_by: nil, request_options: {})
159
162
  #
160
163
  # @param id [String] GrowSurf program ID.
161
164
  #
@@ -169,7 +172,7 @@ module GrowsurfRuby
169
172
  #
170
173
  # @param is_affiliate [Boolean] Affiliate programs only. Controls affiliate enrollment for a new participant. `true` enrolls the participant with `affiliateStatus: APPROVED`; `false` creates a non-affiliate without `affiliateStatus`. Existing participants are returned unchanged.
171
174
  #
172
- # @param language [Symbol, GrowsurfRuby::Models::Campaign::Language] The language of the participant's portal and program emails. Must be one of the program's languages. Applied only when this request creates the participant.
175
+ # @param language [Symbol, GrowsurfRuby::Models::Campaign::Language] The language of the participant's portal and program emails. Stored when it is one of the program's languages. A regional tag maps to its language (for example, `es-MX` is stored as `es`). Any other value is ignored and the program's base language applies. Applied only when this request creates the participant.
173
176
  #
174
177
  # @param last_name [String]
175
178
  #
@@ -179,6 +182,8 @@ module GrowsurfRuby
179
182
  #
180
183
  # @param referral_status [Symbol, GrowsurfRuby::Models::Campaign::Create::ReferralStatus] The referral credit status; only meaningful when `referred_by` resolves to a ref
181
184
  #
185
+ # @param referred_at [Integer, nil] When the participant was referred, in Unix milliseconds. Used only with a valid `referredBy`. If you omit `referralStatus`, GrowSurf compares this time with the program's referral credit window to set it. Defaults to the time of the request.
186
+ #
182
187
  # @param referred_by [String] Referrer participant ID or email address.
183
188
  #
184
189
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -620,7 +625,7 @@ module GrowsurfRuby
620
625
  #
621
626
  # @param body [String] Body param: HTML body for a free-form email. You can personalize it with dynamic text, inserting `{{...}}` tokens like `{{firstName}}` or `{{shareUrl}}`. See [Guide to using dynamic text in GrowSurf emails](https://support.growsurf.com/article/213-guide-to-using-dynamic-text-in-growsurf-emails).
622
627
  #
623
- # @param email_type [String] Body param: The program email template to send (template mode). Send the camelCase
628
+ # @param email_type [String] Body param: The program email template to trigger (template mode). Send the camelC
624
629
  #
625
630
  # @param preheader [String] Body param: Optional preheader text for a free-form email.
626
631
  #
@@ -96,6 +96,7 @@ module GrowsurfRuby
96
96
  raise ArgumentError.new("send content fields for only one Program Resource type") if supplied_types.length > 1
97
97
 
98
98
  type = params[:type]
99
+ type = type.to_sym if type.is_a?(String)
99
100
  if supplied_types.any? && !type.nil? && supplied_types.first != type
100
101
  raise ArgumentError.new("content fields must match the selected Program Resource type")
101
102
  end
@@ -63,6 +63,14 @@ module GrowsurfRuby
63
63
  #
64
64
  # @param metadata [Hash{Symbol=>Object}] Body param: Custom key/value metadata (single-level; values are stored as string
65
65
  #
66
+ # For `DOUBLE_SIDED` rewards in referral programs, `rewardAmount` is the
67
+ # referrer’s amount and `referredRewardAmount` is the friend’s amount. If
68
+ # `referredRewardAmount` is absent, both use `rewardAmount`. New or changed positive
69
+ # numeric amounts must use whole units for currencies without decimals, such as JPY, and
70
+ # no more than two decimal places for other currencies, including USD and KWD. Excess
71
+ # precision is rejected rather than rounded, including when you clone a program. Existing
72
+ # unchanged amounts and earned rewards keep their saved values.
73
+ #
66
74
  # @param next_milestone_prefix [String] Body param: Text shown before a participant's referral count in milestone-prog
67
75
  #
68
76
  # @param next_milestone_suffix [String] Body param: Text shown after a participant's referral count in milestone-progr
@@ -106,8 +114,7 @@ module GrowsurfRuby
106
114
  # the referencing fields. For an affiliate reward, `commissionStructure.event:
107
115
  # LEAD` requires a `FIXED` commission with a positive `amount`.
108
116
  # Changes to participant email content are checked before saving. Rejected content
109
- # returns `400`; if the check is unavailable, `503` asks you to retry. Neither
110
- # response saves the change. A concurrent edit can return `409`; reload the
117
+ # returns `400` and is not saved. A concurrent edit can return `409`; reload the
111
118
  # program before retrying.
112
119
  #
113
120
  # @overload update(campaign_reward_id, id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, event: nil, image_url: nil, image_icon_key: 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,6 +147,14 @@ module GrowsurfRuby
140
147
  #
141
148
  # @param metadata [Hash{Symbol=>Object}] Body param: Custom key/value metadata (single-level; values are stored as string
142
149
  #
150
+ # For `DOUBLE_SIDED` rewards in referral programs, `rewardAmount` is the
151
+ # referrer’s amount and `referredRewardAmount` is the friend’s amount. If
152
+ # `referredRewardAmount` is absent, both use `rewardAmount`. New or changed positive
153
+ # numeric amounts must use whole units for currencies without decimals, such as JPY, and
154
+ # no more than two decimal places for other currencies, including USD and KWD. Excess
155
+ # precision is rejected rather than rounded, including when you clone a program. Existing
156
+ # unchanged amounts and earned rewards keep their saved values.
157
+ #
143
158
  # @param next_milestone_prefix [String] Body param: Text shown before a participant's referral count in milestone-prog
144
159
  #
145
160
  # @param next_milestone_suffix [String] Body param: Text shown after a participant's referral count in milestone-progr
@@ -22,7 +22,13 @@ module GrowsurfRuby
22
22
  )
23
23
  end
24
24
 
25
- # Adds a webhook to the program.
25
+ # Adds a webhook to the program. A program can have only one saved Bask Health
26
+ # webhook across all `bask.ninja` hosts and paths, including disabled webhooks. A
27
+ # second Bask Health webhook returns `400`.
28
+ # A program can have up to 5 webhooks, counting the primary webhook slot, so you
29
+ # can create up to 4. Creating another returns `400`.
30
+ # A concurrent change to webhook settings can return `409`; reload the webhooks
31
+ # before retrying.
26
32
  #
27
33
  # @overload create(id, payload_url:, events: nil, is_enabled: nil, secret: nil, request_options: {})
28
34
  #
@@ -30,7 +36,7 @@ module GrowsurfRuby
30
36
  #
31
37
  # @param payload_url [String] Body param: The URL that receives webhook deliveries.
32
38
  #
33
- # @param events [Array<Symbol, GrowsurfRuby::Models::Campaign::WebhookEvent>] Body param: The events this webhook is subscribed to. When omitted, it is subscri
39
+ # @param events [Array<Symbol, GrowsurfRuby::Models::Campaign::WebhookEvent>] Body param: The events this webhook is subscribed to. When omitted, the webhook i
34
40
  #
35
41
  # @param is_enabled [Boolean] Body param
36
42
  #
@@ -52,7 +58,11 @@ module GrowsurfRuby
52
58
  )
53
59
  end
54
60
 
55
- # Updates a webhook by id.
61
+ # Updates a webhook by id. A program can have only one saved Bask Health webhook
62
+ # across all `bask.ninja` hosts and paths, including disabled webhooks. An update
63
+ # that leaves more than one Bask Health webhook returns `400`.
64
+ # A concurrent change to webhook settings can return `409`; reload the webhooks
65
+ # before retrying.
56
66
  #
57
67
  # @overload update(webhook_id, id:, events: nil, is_enabled: nil, payload_url: nil, secret: nil, request_options: {})
58
68
  #
@@ -26,6 +26,10 @@ module GrowsurfRuby
26
26
  # @return [GrowsurfRuby::Resources::Campaign::Design]
27
27
  attr_reader :design
28
28
 
29
+ # Custom domain operations for a program's landing pages.
30
+ # @return [GrowsurfRuby::Resources::Campaign::CustomDomain]
31
+ attr_reader :custom_domain
32
+
29
33
  # Program Editor "Emails" tab configuration operations.
30
34
  # @return [GrowsurfRuby::Resources::Campaign::Emails]
31
35
  attr_reader :emails
@@ -91,9 +95,9 @@ module GrowsurfRuby
91
95
  #
92
96
  # @param type [Symbol, GrowsurfRuby::Models::CampaignCreateParams::Type] The program type. Immutable after creation.
93
97
  #
94
- # @param company_logo_image_url [String]
98
+ # @param company_logo_image_url [String, nil]
95
99
  #
96
- # @param company_name [String]
100
+ # @param company_name [String, nil]
97
101
  #
98
102
  # @param currency_iso [String] ISO 4217 currency code. Defaults to USD. Chosen when the program is created and immutable afterward — it cannot be changed on update.
99
103
  #
@@ -125,17 +129,16 @@ module GrowsurfRuby
125
129
  # dedicated config sub-resources, not here. The program cannot be deleted via this
126
130
  # endpoint.
127
131
  # Changes to participant email content are checked before saving. Rejected content
128
- # returns `400`; if the check is unavailable, `503` asks you to retry. Neither
129
- # response saves the change. A concurrent edit can return `409`; reload the program
130
- # before retrying.
132
+ # returns `400` and is not saved. A concurrent edit can return `409`; reload the
133
+ # program before retrying.
131
134
  #
132
135
  # @overload update(id, company_logo_image_url: nil, company_name: nil, name: nil, status: nil, request_options: {})
133
136
  #
134
137
  # @param id [String] Path param: GrowSurf program ID.
135
138
  #
136
- # @param company_logo_image_url [String] Body param
139
+ # @param company_logo_image_url [String, nil] Body param
137
140
  #
138
- # @param company_name [String] Body param
141
+ # @param company_name [String, nil] Body param
139
142
  #
140
143
  # @param name [String] Body param
141
144
  #
@@ -240,7 +243,7 @@ module GrowsurfRuby
240
243
  # participant endpoints. Use this endpoint from your backend after your mobile app
241
244
  # authenticates a signed-in user. The program must have mobile SDK access enabled.
242
245
  #
243
- # @overload create_mobile_participant_token(id, email:, fingerprint: nil, first_name: nil, ip_address: nil, language: nil, last_name: nil, metadata: nil, mobile_instance_id: nil, referral_status: nil, referred_by: nil, request_options: {})
246
+ # @overload create_mobile_participant_token(id, email:, fingerprint: nil, first_name: nil, ip_address: nil, language: nil, last_name: nil, metadata: nil, mobile_instance_id: nil, referral_status: nil, referred_at: nil, referred_by: nil, request_options: {})
244
247
  #
245
248
  # @param id [String] GrowSurf program ID.
246
249
  #
@@ -252,7 +255,7 @@ module GrowsurfRuby
252
255
  #
253
256
  # @param ip_address [String]
254
257
  #
255
- # @param language [Symbol, GrowsurfRuby::Models::Campaign::Language] The language of the participant's portal and program emails. Must be one of the program's languages. Applied only when this request creates the participant.
258
+ # @param language [Symbol, GrowsurfRuby::Models::Campaign::Language] The language of the participant's portal and program emails. Stored when it is one of the program's languages. A regional tag maps to its language (for example, `es-MX` is stored as `es`). Any other value is ignored and the program's base language applies. Applied only when this request creates the participant.
256
259
  #
257
260
  # @param last_name [String]
258
261
  #
@@ -262,6 +265,8 @@ module GrowsurfRuby
262
265
  #
263
266
  # @param referral_status [Symbol, GrowsurfRuby::Models::Campaign::Create::ReferralStatus]
264
267
  #
268
+ # @param referred_at [Integer, nil] When the participant was referred, in Unix milliseconds. Used only with a valid `referredBy`. If you omit `referralStatus`, GrowSurf compares this time with the program's referral credit window to set it. Defaults to the time of the request.
269
+ #
265
270
  # @param referred_by [String] Referrer participant ID or email address.
266
271
  #
267
272
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -732,6 +737,7 @@ module GrowsurfRuby
732
737
  @rewards = GrowsurfRuby::Resources::Campaign::Rewards.new(client: client)
733
738
  @resources = GrowsurfRuby::Resources::Campaign::ProgramResources.new(client: client)
734
739
  @design = GrowsurfRuby::Resources::Campaign::Design.new(client: client)
740
+ @custom_domain = GrowsurfRuby::Resources::Campaign::CustomDomain.new(client: client)
735
741
  @emails = GrowsurfRuby::Resources::Campaign::Emails.new(client: client)
736
742
  @options = GrowsurfRuby::Resources::Campaign::Options.new(client: client)
737
743
  @installation = GrowsurfRuby::Resources::Campaign::Installation.new(client: client)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GrowsurfRuby
4
- VERSION = "1.17.0"
4
+ VERSION = "1.19.0"
5
5
  end
data/lib/growsurf_ruby.rb CHANGED
@@ -59,6 +59,9 @@ require_relative "growsurf_ruby/models/campaign_engagement_analytics"
59
59
  require_relative "growsurf_ruby/models/campaign/create"
60
60
  require_relative "growsurf_ruby/models/campaign/participant"
61
61
  require_relative "growsurf_ruby/models/campaign/campaign_reward_list_response"
62
+ require_relative "growsurf_ruby/models/campaign/campaign_custom_domain"
63
+ require_relative "growsurf_ruby/models/campaign/custom_domain_set_params"
64
+ require_relative "growsurf_ruby/models/campaign/delete_campaign_custom_domain_response"
62
65
  require_relative "growsurf_ruby/models/campaign/commission_approve_params"
63
66
  require_relative "growsurf_ruby/models/campaign/commission_approve_response"
64
67
  require_relative "growsurf_ruby/models/campaign/commission_delete_params"
@@ -133,8 +136,6 @@ require_relative "growsurf_ruby/models/campaign/webhook_list_response"
133
136
  require_relative "growsurf_ruby/models/campaign/webhook_test_params"
134
137
  require_relative "growsurf_ruby/models/campaign/webhook_test_response"
135
138
  require_relative "growsurf_ruby/models/campaign/webhook_update_params"
136
- require_relative "growsurf_ruby/models/account_create_params"
137
- require_relative "growsurf_ruby/models/account_create_response"
138
139
  require_relative "growsurf_ruby/models/affiliate_application"
139
140
  require_relative "growsurf_ruby/models/affiliate_application_list_response"
140
141
  require_relative "growsurf_ruby/models/affiliate_invite"
@@ -174,10 +175,10 @@ require_relative "growsurf_ruby/models/participant_payout_list"
174
175
  require_relative "growsurf_ruby/models/referral_list"
175
176
  require_relative "growsurf_ruby/models/reward_tax_valuation"
176
177
  require_relative "growsurf_ruby/models"
177
- require_relative "growsurf_ruby/resources/account"
178
178
  require_relative "growsurf_ruby/resources/team"
179
179
  require_relative "growsurf_ruby/resources/campaign"
180
180
  require_relative "growsurf_ruby/resources/campaign/commission"
181
+ require_relative "growsurf_ruby/resources/campaign/custom_domain"
181
182
  require_relative "growsurf_ruby/resources/campaign/design"
182
183
  require_relative "growsurf_ruby/resources/campaign/emails"
183
184
  require_relative "growsurf_ruby/resources/campaign/installation"
@@ -14,9 +14,6 @@ module GrowsurfRuby
14
14
  sig { returns(T.nilable(String)) }
15
15
  attr_reader :api_key
16
16
 
17
- sig { returns(GrowsurfRuby::Resources::Account) }
18
- attr_reader :account
19
-
20
17
  sig { returns(GrowsurfRuby::Resources::Team) }
21
18
  attr_reader :team
22
19
 
@@ -146,6 +146,70 @@ module GrowsurfRuby
146
146
  sig { returns(Integer) }
147
147
  attr_accessor :status
148
148
 
149
+ # Error name returned for the failed request.
150
+ sig { returns(T.nilable(String)) }
151
+ attr_reader :error_name
152
+
153
+ # Stable machine-readable error code.
154
+ sig { returns(T.nilable(String)) }
155
+ attr_reader :error_code
156
+
157
+ # Human-readable error message.
158
+ sig { returns(T.nilable(String)) }
159
+ attr_reader :error_message
160
+
161
+ # Optional validation details for specific request fields.
162
+ sig { returns(T.nilable(T::Array[T::Hash[Symbol, T.anything]])) }
163
+ attr_reader :errors
164
+
165
+ # Support URL related to the error, when available.
166
+ sig { returns(T.nilable(String)) }
167
+ attr_reader :support_url
168
+
169
+ # Rate-limit policy name for `429` errors, when available.
170
+ sig { returns(T.nilable(String)) }
171
+ attr_reader :policy_name
172
+
173
+ # Error severity level, when available.
174
+ sig { returns(T.nilable(String)) }
175
+ attr_reader :level
176
+
177
+ # When the error response was created.
178
+ sig { returns(T.nilable(String)) }
179
+ attr_reader :timestamp
180
+
181
+ # Fraud risk level assigned to the blocked signup.
182
+ sig { returns(T.nilable(String)) }
183
+ attr_reader :fraud_risk_level
184
+
185
+ # Machine-readable reason code for the fraud decision.
186
+ sig { returns(T.nilable(String)) }
187
+ attr_reader :fraud_reason_code
188
+
189
+ # Existing participant IDs related to the fraud match.
190
+ sig { returns(T.nilable(T::Array[String])) }
191
+ attr_reader :matched_participant_ids
192
+
193
+ # Email address from the blocked signup attempt.
194
+ sig { returns(T.nilable(String)) }
195
+ attr_reader :email
196
+
197
+ # Referrer participant ID supplied with the blocked signup, or `null`.
198
+ sig { returns(T.nilable(String)) }
199
+ attr_reader :referrer_id
200
+
201
+ # IP address supplied with the blocked signup, or `null`.
202
+ sig { returns(T.nilable(String)) }
203
+ attr_reader :ip_address
204
+
205
+ # Browser fingerprint supplied with the blocked signup, or `null`.
206
+ sig { returns(T.nilable(String)) }
207
+ attr_reader :fingerprint
208
+
209
+ # When the signup was blocked.
210
+ sig { returns(T.nilable(String)) }
211
+ attr_reader :blocked_at
212
+
149
213
  # @api private
150
214
  sig do
151
215
  params(