growsurf-ruby 0.8.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 (151) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -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 +43 -5
  23. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +48 -15
  24. data/lib/growsurf_ruby/models/campaign/reward_delete_params.rb +4 -4
  25. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +51 -18
  26. data/lib/growsurf_ruby/models/campaign/webhook.rb +72 -0
  27. data/lib/growsurf_ruby/models/campaign/webhook_create_params.rb +52 -0
  28. data/lib/growsurf_ruby/models/campaign/webhook_delete_params.rb +28 -0
  29. data/lib/growsurf_ruby/models/campaign/webhook_delete_response.rb +24 -0
  30. data/lib/growsurf_ruby/models/campaign/webhook_event.rb +23 -0
  31. data/lib/growsurf_ruby/models/campaign/webhook_list_response.rb +18 -0
  32. data/lib/growsurf_ruby/models/campaign/webhook_test_params.rb +42 -0
  33. data/lib/growsurf_ruby/models/campaign/webhook_test_response.rb +50 -0
  34. data/lib/growsurf_ruby/models/campaign/webhook_update_params.rb +59 -0
  35. data/lib/growsurf_ruby/models/campaign.rb +43 -5
  36. data/lib/growsurf_ruby/models/campaign_create_params.rb +1 -15
  37. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_params.rb +36 -1
  38. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +538 -1
  39. data/lib/growsurf_ruby/models/campaign_update_params.rb +1 -53
  40. data/lib/growsurf_ruby/models/commission_structure.rb +8 -2
  41. data/lib/growsurf_ruby/models/referral_flow_screenshots_response.rb +72 -0
  42. data/lib/growsurf_ruby/models/reward_tax_valuation.rb +35 -0
  43. data/lib/growsurf_ruby/models.rb +10 -0
  44. data/lib/growsurf_ruby/resources/account.rb +159 -0
  45. data/lib/growsurf_ruby/resources/campaign/design.rb +68 -0
  46. data/lib/growsurf_ruby/resources/campaign/emails.rb +66 -0
  47. data/lib/growsurf_ruby/resources/campaign/installation.rb +67 -0
  48. data/lib/growsurf_ruby/resources/campaign/options.rb +66 -0
  49. data/lib/growsurf_ruby/resources/campaign/participant.rb +170 -2
  50. data/lib/growsurf_ruby/resources/campaign/rewards.rb +36 -32
  51. data/lib/growsurf_ruby/resources/campaign/webhooks.rb +157 -0
  52. data/lib/growsurf_ruby/resources/campaign.rb +62 -27
  53. data/lib/growsurf_ruby/version.rb +1 -1
  54. data/lib/growsurf_ruby.rb +31 -0
  55. data/rbi/growsurf_ruby/client.rbi +3 -0
  56. data/rbi/growsurf_ruby/models/account.rbi +125 -0
  57. data/rbi/growsurf_ruby/models/account_create_params.rbi +73 -0
  58. data/rbi/growsurf_ruby/models/account_create_response.rbi +115 -0
  59. data/rbi/growsurf_ruby/models/account_resend_verification_email_response.rbi +76 -0
  60. data/rbi/growsurf_ruby/models/account_rotate_api_key_response.rbi +30 -0
  61. data/rbi/growsurf_ruby/models/account_update_params.rbi +65 -0
  62. data/rbi/growsurf_ruby/models/campaign/campaign_reward_list_response.rbi +2 -2
  63. data/rbi/growsurf_ruby/models/campaign/create.rbi +8 -0
  64. data/rbi/growsurf_ruby/models/campaign/participant_activity_logs_response.rbi +111 -0
  65. data/rbi/growsurf_ruby/models/campaign/participant_analytics_response.rbi +630 -0
  66. data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_params.rbi +56 -0
  67. data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbi +285 -0
  68. data/rbi/growsurf_ruby/models/campaign/participant_email_params.rbi +118 -0
  69. data/rbi/growsurf_ruby/models/campaign/participant_email_response.rbi +84 -0
  70. data/rbi/growsurf_ruby/models/campaign/participant_list_activity_logs_params.rbi +74 -0
  71. data/rbi/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbi +207 -0
  72. data/rbi/growsurf_ruby/models/campaign/participant_update_params.rbi +24 -0
  73. data/rbi/growsurf_ruby/models/campaign/reward.rbi +63 -3
  74. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +62 -9
  75. data/rbi/growsurf_ruby/models/campaign/reward_delete_params.rbi +4 -4
  76. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +66 -13
  77. data/rbi/growsurf_ruby/models/campaign/webhook.rbi +93 -0
  78. data/rbi/growsurf_ruby/models/campaign/webhook_create_params.rbi +91 -0
  79. data/rbi/growsurf_ruby/models/campaign/webhook_delete_params.rbi +48 -0
  80. data/rbi/growsurf_ruby/models/campaign/webhook_delete_response.rbi +33 -0
  81. data/rbi/growsurf_ruby/models/campaign/webhook_event.rbi +60 -0
  82. data/rbi/growsurf_ruby/models/campaign/webhook_list_response.rbi +36 -0
  83. data/rbi/growsurf_ruby/models/campaign/webhook_test_params.rbi +69 -0
  84. data/rbi/growsurf_ruby/models/campaign/webhook_test_response.rbi +102 -0
  85. data/rbi/growsurf_ruby/models/campaign/webhook_update_params.rbi +98 -0
  86. data/rbi/growsurf_ruby/models/campaign.rbi +63 -3
  87. data/rbi/growsurf_ruby/models/campaign_create_params.rbi +0 -18
  88. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_params.rbi +91 -0
  89. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +1011 -3
  90. data/rbi/growsurf_ruby/models/campaign_update_params.rbi +0 -78
  91. data/rbi/growsurf_ruby/models/commission_structure.rbi +8 -2
  92. data/rbi/growsurf_ruby/models/referral_flow_screenshots_response.rbi +94 -0
  93. data/rbi/growsurf_ruby/models/reward_tax_valuation.rbi +56 -0
  94. data/rbi/growsurf_ruby/models.rbi +11 -0
  95. data/rbi/growsurf_ruby/resources/account.rbi +112 -0
  96. data/rbi/growsurf_ruby/resources/campaign/design.rbi +52 -0
  97. data/rbi/growsurf_ruby/resources/campaign/emails.rbi +51 -0
  98. data/rbi/growsurf_ruby/resources/campaign/installation.rbi +53 -0
  99. data/rbi/growsurf_ruby/resources/campaign/options.rbi +51 -0
  100. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +160 -0
  101. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +61 -29
  102. data/rbi/growsurf_ruby/resources/campaign/webhooks.rbi +123 -0
  103. data/rbi/growsurf_ruby/resources/campaign.rbi +58 -32
  104. data/sig/growsurf_ruby/client.rbs +2 -0
  105. data/sig/growsurf_ruby/models/account.rbs +67 -0
  106. data/sig/growsurf_ruby/models/account_create_params.rbs +42 -0
  107. data/sig/growsurf_ruby/models/account_create_response.rbs +47 -0
  108. data/sig/growsurf_ruby/models/account_resend_verification_email_response.rbs +35 -0
  109. data/sig/growsurf_ruby/models/account_rotate_api_key_response.rbs +13 -0
  110. data/sig/growsurf_ruby/models/account_update_params.rbs +42 -0
  111. data/sig/growsurf_ruby/models/campaign/participant_activity_logs_response.rbs +59 -0
  112. data/sig/growsurf_ruby/models/campaign/participant_analytics_response.rbs +407 -0
  113. data/sig/growsurf_ruby/models/campaign/participant_bulk_delete_params.rbs +30 -0
  114. data/sig/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbs +125 -0
  115. data/sig/growsurf_ruby/models/campaign/participant_email_params.rbs +61 -0
  116. data/sig/growsurf_ruby/models/campaign/participant_email_response.rbs +37 -0
  117. data/sig/growsurf_ruby/models/campaign/participant_list_activity_logs_params.rbs +47 -0
  118. data/sig/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbs +90 -0
  119. data/sig/growsurf_ruby/models/campaign/participant_update_params.rbs +14 -0
  120. data/sig/growsurf_ruby/models/campaign/reward.rbs +18 -3
  121. data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +19 -8
  122. data/sig/growsurf_ruby/models/campaign/reward_delete_params.rbs +4 -4
  123. data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +23 -12
  124. data/sig/growsurf_ruby/models/campaign/webhook.rbs +52 -0
  125. data/sig/growsurf_ruby/models/campaign/webhook_create_params.rbs +51 -0
  126. data/sig/growsurf_ruby/models/campaign/webhook_delete_params.rbs +30 -0
  127. data/sig/growsurf_ruby/models/campaign/webhook_delete_response.rbs +17 -0
  128. data/sig/growsurf_ruby/models/campaign/webhook_event.rbs +28 -0
  129. data/sig/growsurf_ruby/models/campaign/webhook_list_response.rbs +18 -0
  130. data/sig/growsurf_ruby/models/campaign/webhook_test_params.rbs +42 -0
  131. data/sig/growsurf_ruby/models/campaign/webhook_test_response.rbs +54 -0
  132. data/sig/growsurf_ruby/models/campaign/webhook_update_params.rbs +63 -0
  133. data/sig/growsurf_ruby/models/campaign.rbs +18 -3
  134. data/sig/growsurf_ruby/models/campaign_create_params.rbs +0 -14
  135. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_params.rbs +35 -1
  136. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +533 -3
  137. data/sig/growsurf_ruby/models/campaign_update_params.rbs +1 -53
  138. data/sig/growsurf_ruby/models/commission_structure.rbs +7 -2
  139. data/sig/growsurf_ruby/models/referral_flow_screenshots_response.rbs +54 -0
  140. data/sig/growsurf_ruby/models/reward_tax_valuation.rbs +22 -0
  141. data/sig/growsurf_ruby/models.rbs +10 -0
  142. data/sig/growsurf_ruby/resources/account.rbs +38 -0
  143. data/sig/growsurf_ruby/resources/campaign/design.rbs +20 -0
  144. data/sig/growsurf_ruby/resources/campaign/emails.rbs +20 -0
  145. data/sig/growsurf_ruby/resources/campaign/installation.rbs +20 -0
  146. data/sig/growsurf_ruby/resources/campaign/options.rbs +20 -0
  147. data/sig/growsurf_ruby/resources/campaign/participant.rbs +37 -0
  148. data/sig/growsurf_ruby/resources/campaign/rewards.rbs +6 -4
  149. data/sig/growsurf_ruby/resources/campaign/webhooks.rbs +46 -0
  150. data/sig/growsurf_ruby/resources/campaign.rbs +17 -9
  151. metadata +95 -2
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ # @see GrowsurfRuby::Resources::Campaign#get_referral_flow_screenshots
6
+ class ReferralFlowScreenshotsResponse < GrowsurfRuby::Internal::Type::BaseModel
7
+ # @!attribute referrer
8
+ # Screenshot of the referral flow as a signed-in referrer sees it.
9
+ #
10
+ # @return [GrowsurfRuby::Models::ReferralFlowScreenshotsResponse::ReferralFlowScreenshot]
11
+ required :referrer, -> { GrowsurfRuby::Models::ReferralFlowScreenshotsResponse::ReferralFlowScreenshot }
12
+
13
+ # @!attribute referred_friend
14
+ # Screenshot of the referral flow as the referred friend sees it.
15
+ #
16
+ # @return [GrowsurfRuby::Models::ReferralFlowScreenshotsResponse::ReferralFlowScreenshot]
17
+ required :referred_friend,
18
+ -> { GrowsurfRuby::Models::ReferralFlowScreenshotsResponse::ReferralFlowScreenshot },
19
+ api_name: :referredFriend
20
+
21
+ # @!attribute generated_at
22
+ # When the screenshots were generated, as a Unix timestamp in milliseconds.
23
+ #
24
+ # @return [Integer]
25
+ required :generated_at, Integer, api_name: :generatedAt
26
+
27
+ # @!method initialize(referrer:, referred_friend:, generated_at:)
28
+ #
29
+ # @param referrer [GrowsurfRuby::Models::ReferralFlowScreenshotsResponse::ReferralFlowScreenshot] Screenshot of the referral flow as a signed-in referrer sees it.
30
+ #
31
+ # @param referred_friend [GrowsurfRuby::Models::ReferralFlowScreenshotsResponse::ReferralFlowScreenshot] Screenshot of the referral flow as the referred friend sees it.
32
+ #
33
+ # @param generated_at [Integer] When the screenshots were generated, as a Unix timestamp in milliseconds.
34
+
35
+ class ReferralFlowScreenshot < GrowsurfRuby::Internal::Type::BaseModel
36
+ # @!attribute view
37
+ # The referral-flow view captured in this screenshot.
38
+ #
39
+ # @return [String]
40
+ required :view, String
41
+
42
+ # @!attribute url
43
+ # Image URL for the generated screenshot.
44
+ #
45
+ # @return [String]
46
+ required :url, String
47
+
48
+ # @!attribute width
49
+ # Screenshot viewport width in CSS pixels.
50
+ #
51
+ # @return [Integer]
52
+ required :width, Integer
53
+
54
+ # @!attribute height
55
+ # Screenshot viewport height in CSS pixels.
56
+ #
57
+ # @return [Integer]
58
+ required :height, Integer
59
+
60
+ # @!method initialize(view:, url:, width:, height:)
61
+ #
62
+ # @param view [String] The referral-flow view captured in this screenshot.
63
+ #
64
+ # @param url [String] Image URL for the generated screenshot.
65
+ #
66
+ # @param width [Integer] Screenshot viewport width in CSS pixels.
67
+ #
68
+ # @param height [Integer] Screenshot viewport height in CSS pixels.
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ class RewardTaxValuation < GrowsurfRuby::Internal::Type::BaseModel
6
+ # @!attribute fair_market_value_usd
7
+ # Manual fair-market value in USD (major units) used as the fallback when the
8
+ # reward value cannot be resolved automatically. `null` = no manual value.
9
+ #
10
+ # @return [Float, nil]
11
+ optional :fair_market_value_usd, Float, api_name: :fairMarketValueUSD, nil?: true
12
+
13
+ # @!attribute is_tax_reportable
14
+ # Whether the reward's value counts toward 1099 thresholds/totals. `null` = use
15
+ # the smart default for the reward's source.
16
+ #
17
+ # @return [Boolean, nil]
18
+ optional :is_tax_reportable,
19
+ GrowsurfRuby::Internal::Type::Boolean,
20
+ api_name: :isTaxReportable,
21
+ nil?: true
22
+
23
+ # @!method initialize(fair_market_value_usd: nil, is_tax_reportable: nil)
24
+ # Some parameter documentations has been truncated, see
25
+ # {GrowsurfRuby::Models::RewardTaxValuation} for more details.
26
+ #
27
+ # Tax valuation settings for a reward. Only relevant when the program collects
28
+ # tax documentation.
29
+ #
30
+ # @param fair_market_value_usd [Float, nil] Manual fair-market value in USD (major units) used as the fallback when the rewa
31
+ #
32
+ # @param is_tax_reportable [Boolean, nil] Whether the reward's value counts toward 1099 thresholds/totals. `null` = use th
33
+ end
34
+ end
35
+ end
@@ -39,6 +39,12 @@ module GrowsurfRuby
39
39
  mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
40
40
  end
41
41
 
42
+ Account = GrowsurfRuby::Models::Account
43
+
44
+ AccountCreateParams = GrowsurfRuby::Models::AccountCreateParams
45
+
46
+ AccountUpdateParams = GrowsurfRuby::Models::AccountUpdateParams
47
+
42
48
  Campaign = GrowsurfRuby::Models::Campaign
43
49
 
44
50
  CampaignAPI = GrowsurfRuby::Models::CampaignAPI
@@ -75,4 +81,8 @@ module GrowsurfRuby
75
81
  ParticipantPayoutList = GrowsurfRuby::Models::ParticipantPayoutList
76
82
 
77
83
  ReferralList = GrowsurfRuby::Models::ReferralList
84
+
85
+ ReferralFlowScreenshotsResponse = GrowsurfRuby::Models::ReferralFlowScreenshotsResponse
86
+
87
+ RewardTaxValuation = GrowsurfRuby::Models::RewardTaxValuation
78
88
  end
@@ -0,0 +1,159 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Resources
5
+ class Account
6
+ # Creates a new GrowSurf account. This is the only endpoint that does not require
7
+ # an API key. The response includes an API key for the new account, but the key is
8
+ # locked until the account's email address is verified: authenticated endpoints
9
+ # outside the `Accounts` group return a `403` with error code
10
+ # `EMAIL_NOT_VERIFIED_ERROR` until then (resend the email via `POST
11
+ # /account/verification-email`, then retry). A welcome email is sent to the
12
+ # address with the verification link and a set-password link for dashboard
13
+ # access. Accounts whose email is never verified are deleted automatically after
14
+ # 7 days. For security, the API key is rotated the first time the account owner
15
+ # signs in to the GrowSurf dashboard. Some actions (such as emailing
16
+ # participants) additionally require the GrowSurf team to verify the account
17
+ # first. By creating an account you agree, on behalf of the account holder, to
18
+ # GrowSurf's [Terms of Service](https://growsurf.com/terms) and
19
+ # [Privacy Policy](https://growsurf.com/privacy).
20
+ #
21
+ # @overload create(email:, company: nil, first_name: nil, last_name: nil, request_options: {})
22
+ #
23
+ # @param email [String] The email address for the new account. Personal emails and disposable email addresses are not accepted.
24
+ #
25
+ # @param company [String]
26
+ #
27
+ # @param first_name [String]
28
+ #
29
+ # @param last_name [String]
30
+ #
31
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
32
+ #
33
+ # @return [GrowsurfRuby::Models::AccountCreateResponse]
34
+ #
35
+ # @see GrowsurfRuby::Models::AccountCreateParams
36
+ def create(params)
37
+ parsed, options = GrowsurfRuby::AccountCreateParams.dump_request(params)
38
+ @client.request(
39
+ method: :post,
40
+ path: "accounts",
41
+ body: parsed,
42
+ model: GrowsurfRuby::Models::AccountCreateResponse,
43
+ options: options
44
+ )
45
+ end
46
+
47
+ # Retrieves the account that owns the API key: profile and GrowSurf-team
48
+ # verification state.
49
+ # `verificationStatus` is `VERIFIED` once the GrowSurf team has verified the account
50
+ # — this is required before you can send participant emails from a program.
51
+ #
52
+ # @overload retrieve(request_options: {})
53
+ #
54
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
55
+ #
56
+ # @return [GrowsurfRuby::Models::Account]
57
+ def retrieve(params = {})
58
+ @client.request(
59
+ method: :get,
60
+ path: "account",
61
+ model: GrowsurfRuby::Account,
62
+ options: params[:request_options]
63
+ )
64
+ end
65
+
66
+ # Updates your own account profile (`firstName`, `lastName`, `company`). Any other
67
+ # property is rejected with a `400` — in particular, the account `email` cannot be
68
+ # changed via the API, and billing/subscription is not editable here.
69
+ #
70
+ # @overload update(company: nil, first_name: nil, last_name: nil, request_options: {})
71
+ #
72
+ # @param company [String]
73
+ #
74
+ # @param first_name [String]
75
+ #
76
+ # @param last_name [String]
77
+ #
78
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
79
+ #
80
+ # @return [GrowsurfRuby::Models::Account]
81
+ #
82
+ # @see GrowsurfRuby::Models::AccountUpdateParams
83
+ def update(params = {})
84
+ parsed, options = GrowsurfRuby::AccountUpdateParams.dump_request(params)
85
+ @client.request(
86
+ method: :patch,
87
+ path: "account",
88
+ body: parsed,
89
+ model: GrowsurfRuby::Account,
90
+ options: options
91
+ )
92
+ end
93
+
94
+ # Generates a new API key and immediately revokes the old one. The key used to make
95
+ # this request stops working as soon as the response is returned — update every
96
+ # integration that used the old key with the new one. The account owner is
97
+ # notified by email whenever the key is rotated.
98
+ #
99
+ # @overload rotate_api_key(request_options: {})
100
+ #
101
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
102
+ #
103
+ # @return [GrowsurfRuby::Models::AccountRotateAPIKeyResponse]
104
+ def rotate_api_key(params = {})
105
+ @client.request(
106
+ method: :post,
107
+ path: "account/api-key",
108
+ model: GrowsurfRuby::Models::AccountRotateAPIKeyResponse,
109
+ options: params[:request_options]
110
+ )
111
+ end
112
+
113
+ # Requests GrowSurf-team verification of your account (required before a program can
114
+ # email its participants). Idempotent — calling it again while a request is pending
115
+ # does not create a duplicate. Returns the account with its updated
116
+ # `verificationStatus`.
117
+ #
118
+ # @overload request_verification(request_options: {})
119
+ #
120
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
121
+ #
122
+ # @return [GrowsurfRuby::Models::Account]
123
+ def request_verification(params = {})
124
+ @client.request(
125
+ method: :post,
126
+ path: "account/verification-request",
127
+ model: GrowsurfRuby::Account,
128
+ options: params[:request_options]
129
+ )
130
+ end
131
+
132
+ # Resends the email-verification email to the account's email address. A `200`
133
+ # with `status: SENT` is only returned when an email was actually dispatched.
134
+ # Returns a `400` if the email is already verified, or a `429` if a verification
135
+ # email was sent too recently — wait a moment, then retry.
136
+ #
137
+ # @overload resend_verification_email(request_options: {})
138
+ #
139
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
140
+ #
141
+ # @return [GrowsurfRuby::Models::AccountResendVerificationEmailResponse]
142
+ def resend_verification_email(params = {})
143
+ @client.request(
144
+ method: :post,
145
+ path: "account/verification-email",
146
+ model: GrowsurfRuby::Models::AccountResendVerificationEmailResponse,
147
+ options: params[:request_options]
148
+ )
149
+ end
150
+
151
+ # @api private
152
+ #
153
+ # @param client [GrowsurfRuby::Client]
154
+ def initialize(client:)
155
+ @client = client
156
+ end
157
+ end
158
+ end
159
+ end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Resources
5
+ class Campaign
6
+ class Design
7
+ # Retrieves a program's design configuration — the same surface as the dashboard
8
+ # Program Editor's **Design** tab (window layout, header, share channels, signup
9
+ # form, portal/landing pages, theme styling, and summary/status sections).
10
+ #
11
+ # This is a large, deeply nested object whose available fields depend on the
12
+ # program type; the response includes every field and its current value, which
13
+ # is the same shape you send back on update.
14
+ #
15
+ # @overload retrieve(id, request_options: {})
16
+ #
17
+ # @param id [String] GrowSurf program ID.
18
+ #
19
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
20
+ #
21
+ # @return [Hash{Symbol=>Object}]
22
+ def retrieve(id, params = {})
23
+ @client.request(
24
+ method: :get,
25
+ path: ["campaign/%1$s/design", id],
26
+ model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
27
+ options: params[:request_options]
28
+ )
29
+ end
30
+
31
+ # Updates a program's design configuration. Only the fields you send are changed;
32
+ # anything you leave out is untouched (arrays such as `signup.fields` replace
33
+ # wholesale). Unknown fields, fields not available for the program type, and
34
+ # invalid values return a `400`.
35
+ #
36
+ # The request body is a partial {CampaignDesign} object. To see the full object
37
+ # with every field and its current value, `GET` this resource, then `PATCH` back
38
+ # only the fields you want to change.
39
+ #
40
+ # @overload update(id, body, request_options: {})
41
+ #
42
+ # @param id [String] GrowSurf program ID.
43
+ #
44
+ # @param body [Hash{Symbol=>Object}] Partial design configuration to merge.
45
+ #
46
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
47
+ #
48
+ # @return [Hash{Symbol=>Object}]
49
+ def update(id, body, params = {})
50
+ @client.request(
51
+ method: :patch,
52
+ path: ["campaign/%1$s/design", id],
53
+ body: body,
54
+ model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
55
+ options: params[:request_options]
56
+ )
57
+ end
58
+
59
+ # @api private
60
+ #
61
+ # @param client [GrowsurfRuby::Client]
62
+ def initialize(client:)
63
+ @client = client
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Resources
5
+ class Campaign
6
+ class Emails
7
+ # Retrieves a program's email configuration — the same surface as the dashboard
8
+ # Program Editor's **Emails** tab (per-email templates plus sender, contact, and
9
+ # design settings).
10
+ #
11
+ # To see the full object with every field and its current value, `GET` this
12
+ # resource, then `PATCH` back only the fields you want to change.
13
+ #
14
+ # @overload retrieve(id, request_options: {})
15
+ #
16
+ # @param id [String] GrowSurf program ID.
17
+ #
18
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
19
+ #
20
+ # @return [Hash{Symbol=>Object}]
21
+ def retrieve(id, params = {})
22
+ @client.request(
23
+ method: :get,
24
+ path: ["campaign/%1$s/emails", id],
25
+ model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
26
+ options: params[:request_options]
27
+ )
28
+ end
29
+
30
+ # Updates a program's email configuration. Only the fields you send are changed;
31
+ # anything you leave out is untouched. Unknown fields and invalid values return a
32
+ # `400`.
33
+ #
34
+ # The request body is a partial {CampaignEmails} object. To see the full object
35
+ # with every field and its current value, `GET` this resource, then `PATCH` back
36
+ # only the fields you want to change.
37
+ #
38
+ # @overload update(id, body, request_options: {})
39
+ #
40
+ # @param id [String] GrowSurf program ID.
41
+ #
42
+ # @param body [Hash{Symbol=>Object}] Partial email configuration to merge.
43
+ #
44
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
45
+ #
46
+ # @return [Hash{Symbol=>Object}]
47
+ def update(id, body, params = {})
48
+ @client.request(
49
+ method: :patch,
50
+ path: ["campaign/%1$s/emails", id],
51
+ body: body,
52
+ model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
53
+ options: params[:request_options]
54
+ )
55
+ end
56
+
57
+ # @api private
58
+ #
59
+ # @param client [GrowsurfRuby::Client]
60
+ def initialize(client:)
61
+ @client = client
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Resources
5
+ class Campaign
6
+ class Installation
7
+ # Retrieves a program's installation configuration — the same surface as the
8
+ # dashboard Program Editor's **Installation** tab (signup and mobile SDK
9
+ # installation settings).
10
+ #
11
+ # This is a nested object whose available fields depend on the program type. To
12
+ # see the full object with every field and its current value, `GET` this
13
+ # resource, then `PATCH` back only the fields you want to change.
14
+ #
15
+ # @overload retrieve(id, request_options: {})
16
+ #
17
+ # @param id [String] GrowSurf program ID.
18
+ #
19
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
20
+ #
21
+ # @return [Hash{Symbol=>Object}]
22
+ def retrieve(id, params = {})
23
+ @client.request(
24
+ method: :get,
25
+ path: ["campaign/%1$s/installation", id],
26
+ model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
27
+ options: params[:request_options]
28
+ )
29
+ end
30
+
31
+ # Updates a program's installation configuration. Only the fields you send are
32
+ # changed; anything you leave out is untouched. Unknown fields, fields not
33
+ # available for the program type, and invalid values return a `400`.
34
+ #
35
+ # The request body is a partial {CampaignInstallation} object. To see the full
36
+ # object with every field and its current value, `GET` this resource, then
37
+ # `PATCH` back only the fields you want to change.
38
+ #
39
+ # @overload update(id, body, request_options: {})
40
+ #
41
+ # @param id [String] GrowSurf program ID.
42
+ #
43
+ # @param body [Hash{Symbol=>Object}] Partial installation configuration to merge.
44
+ #
45
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
46
+ #
47
+ # @return [Hash{Symbol=>Object}]
48
+ def update(id, body, params = {})
49
+ @client.request(
50
+ method: :patch,
51
+ path: ["campaign/%1$s/installation", id],
52
+ body: body,
53
+ model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
54
+ options: params[:request_options]
55
+ )
56
+ end
57
+
58
+ # @api private
59
+ #
60
+ # @param client [GrowsurfRuby::Client]
61
+ def initialize(client:)
62
+ @client = client
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,66 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Resources
5
+ class Campaign
6
+ class Options
7
+ # Retrieves a program's options configuration — the same surface as the dashboard
8
+ # Program Editor's **Options** tab (fraud/reCAPTCHA, tax documentation,
9
+ # notification emails, and other program settings).
10
+ #
11
+ # To see the full object with every field and its current value, `GET` this
12
+ # resource, then `PATCH` back only the fields you want to change.
13
+ #
14
+ # @overload retrieve(id, request_options: {})
15
+ #
16
+ # @param id [String] GrowSurf program ID.
17
+ #
18
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
19
+ #
20
+ # @return [Hash{Symbol=>Object}]
21
+ def retrieve(id, params = {})
22
+ @client.request(
23
+ method: :get,
24
+ path: ["campaign/%1$s/options", id],
25
+ model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
26
+ options: params[:request_options]
27
+ )
28
+ end
29
+
30
+ # Updates a program's options configuration. Only the fields you send are changed;
31
+ # anything you leave out is untouched. Unknown fields and invalid values return a
32
+ # `400`.
33
+ #
34
+ # The request body is a partial {CampaignOptions} object. To see the full object
35
+ # with every field and its current value, `GET` this resource, then `PATCH` back
36
+ # only the fields you want to change.
37
+ #
38
+ # @overload update(id, body, request_options: {})
39
+ #
40
+ # @param id [String] GrowSurf program ID.
41
+ #
42
+ # @param body [Hash{Symbol=>Object}] Partial options configuration to merge.
43
+ #
44
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
45
+ #
46
+ # @return [Hash{Symbol=>Object}]
47
+ def update(id, body, params = {})
48
+ @client.request(
49
+ method: :patch,
50
+ path: ["campaign/%1$s/options", id],
51
+ body: body,
52
+ model: GrowsurfRuby::Internal::Type::HashOf[GrowsurfRuby::Internal::Type::Unknown],
53
+ options: params[:request_options]
54
+ )
55
+ end
56
+
57
+ # @api private
58
+ #
59
+ # @param client [GrowsurfRuby::Client]
60
+ def initialize(client:)
61
+ @client = client
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end