growsurf-ruby 1.0.0 → 1.1.1

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 (134) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/growsurf_ruby/client.rb +4 -0
  5. data/lib/growsurf_ruby/models/account.rb +90 -0
  6. data/lib/growsurf_ruby/models/account_create_params.rb +46 -0
  7. data/lib/growsurf_ruby/models/account_create_response.rb +64 -0
  8. data/lib/growsurf_ruby/models/account_resend_verification_email_response.rb +33 -0
  9. data/lib/growsurf_ruby/models/account_rotate_api_key_response.rb +17 -0
  10. data/lib/growsurf_ruby/models/account_update_params.rb +35 -0
  11. data/lib/growsurf_ruby/models/campaign/campaign_reward_list_response.rb +2 -2
  12. data/lib/growsurf_ruby/models/campaign/create.rb +5 -1
  13. data/lib/growsurf_ruby/models/campaign/participant_activity_logs_response.rb +65 -0
  14. data/lib/growsurf_ruby/models/campaign/participant_analytics_response.rb +421 -0
  15. data/lib/growsurf_ruby/models/campaign/participant_bulk_delete_params.rb +35 -0
  16. data/lib/growsurf_ruby/models/campaign/participant_bulk_delete_response.rb +151 -0
  17. data/lib/growsurf_ruby/models/campaign/participant_email_params.rb +76 -0
  18. data/lib/growsurf_ruby/models/campaign/participant_email_response.rb +38 -0
  19. data/lib/growsurf_ruby/models/campaign/participant_list_activity_logs_params.rb +46 -0
  20. data/lib/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rb +98 -0
  21. data/lib/growsurf_ruby/models/campaign/participant_update_params.rb +21 -1
  22. data/lib/growsurf_ruby/models/campaign/reward.rb +17 -6
  23. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +25 -15
  24. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +25 -15
  25. data/lib/growsurf_ruby/models/campaign/webhook.rb +72 -0
  26. data/lib/growsurf_ruby/models/campaign/webhook_create_params.rb +52 -0
  27. data/lib/growsurf_ruby/models/campaign/webhook_delete_params.rb +28 -0
  28. data/lib/growsurf_ruby/models/campaign/webhook_delete_response.rb +24 -0
  29. data/lib/growsurf_ruby/models/campaign/webhook_event.rb +23 -0
  30. data/lib/growsurf_ruby/models/campaign/webhook_list_response.rb +18 -0
  31. data/lib/growsurf_ruby/models/campaign/webhook_test_params.rb +42 -0
  32. data/lib/growsurf_ruby/models/campaign/webhook_test_response.rb +50 -0
  33. data/lib/growsurf_ruby/models/campaign/webhook_update_params.rb +59 -0
  34. data/lib/growsurf_ruby/models/campaign.rb +17 -6
  35. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_params.rb +36 -1
  36. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +538 -1
  37. data/lib/growsurf_ruby/models/campaign_update_params.rb +0 -3
  38. data/lib/growsurf_ruby/models/commission_structure.rb +8 -2
  39. data/lib/growsurf_ruby/models.rb +6 -0
  40. data/lib/growsurf_ruby/resources/account.rb +159 -0
  41. data/lib/growsurf_ruby/resources/campaign/design.rb +9 -7
  42. data/lib/growsurf_ruby/resources/campaign/emails.rb +8 -5
  43. data/lib/growsurf_ruby/resources/campaign/installation.rb +8 -6
  44. data/lib/growsurf_ruby/resources/campaign/options.rb +8 -5
  45. data/lib/growsurf_ruby/resources/campaign/participant.rb +170 -2
  46. data/lib/growsurf_ruby/resources/campaign/rewards.rb +17 -21
  47. data/lib/growsurf_ruby/resources/campaign/webhooks.rb +157 -0
  48. data/lib/growsurf_ruby/resources/campaign.rb +11 -2
  49. data/lib/growsurf_ruby/version.rb +1 -1
  50. data/lib/growsurf_ruby.rb +25 -0
  51. data/rbi/growsurf_ruby/client.rbi +3 -0
  52. data/rbi/growsurf_ruby/models/account.rbi +125 -0
  53. data/rbi/growsurf_ruby/models/account_create_params.rbi +73 -0
  54. data/rbi/growsurf_ruby/models/account_create_response.rbi +115 -0
  55. data/rbi/growsurf_ruby/models/account_resend_verification_email_response.rbi +76 -0
  56. data/rbi/growsurf_ruby/models/account_rotate_api_key_response.rbi +30 -0
  57. data/rbi/growsurf_ruby/models/account_update_params.rbi +65 -0
  58. data/rbi/growsurf_ruby/models/campaign/campaign_reward_list_response.rbi +2 -2
  59. data/rbi/growsurf_ruby/models/campaign/create.rbi +8 -0
  60. data/rbi/growsurf_ruby/models/campaign/participant_activity_logs_response.rbi +111 -0
  61. data/rbi/growsurf_ruby/models/campaign/participant_analytics_response.rbi +630 -0
  62. data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_params.rbi +56 -0
  63. data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbi +285 -0
  64. data/rbi/growsurf_ruby/models/campaign/participant_email_params.rbi +118 -0
  65. data/rbi/growsurf_ruby/models/campaign/participant_email_response.rbi +84 -0
  66. data/rbi/growsurf_ruby/models/campaign/participant_list_activity_logs_params.rbi +74 -0
  67. data/rbi/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbi +207 -0
  68. data/rbi/growsurf_ruby/models/campaign/participant_update_params.rbi +24 -0
  69. data/rbi/growsurf_ruby/models/campaign/reward.rbi +25 -4
  70. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +34 -9
  71. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +34 -9
  72. data/rbi/growsurf_ruby/models/campaign/webhook.rbi +93 -0
  73. data/rbi/growsurf_ruby/models/campaign/webhook_create_params.rbi +91 -0
  74. data/rbi/growsurf_ruby/models/campaign/webhook_delete_params.rbi +48 -0
  75. data/rbi/growsurf_ruby/models/campaign/webhook_delete_response.rbi +33 -0
  76. data/rbi/growsurf_ruby/models/campaign/webhook_event.rbi +60 -0
  77. data/rbi/growsurf_ruby/models/campaign/webhook_list_response.rbi +36 -0
  78. data/rbi/growsurf_ruby/models/campaign/webhook_test_params.rbi +69 -0
  79. data/rbi/growsurf_ruby/models/campaign/webhook_test_response.rbi +102 -0
  80. data/rbi/growsurf_ruby/models/campaign/webhook_update_params.rbi +98 -0
  81. data/rbi/growsurf_ruby/models/campaign.rbi +25 -4
  82. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_params.rbi +91 -0
  83. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +1011 -3
  84. data/rbi/growsurf_ruby/models/campaign_update_params.rbi +0 -15
  85. data/rbi/growsurf_ruby/models/commission_structure.rbi +8 -2
  86. data/rbi/growsurf_ruby/models.rbi +6 -0
  87. data/rbi/growsurf_ruby/resources/account.rbi +112 -0
  88. data/rbi/growsurf_ruby/resources/campaign/design.rbi +7 -5
  89. data/rbi/growsurf_ruby/resources/campaign/emails.rbi +7 -5
  90. data/rbi/growsurf_ruby/resources/campaign/installation.rbi +7 -4
  91. data/rbi/growsurf_ruby/resources/campaign/options.rbi +7 -5
  92. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +160 -0
  93. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +37 -21
  94. data/rbi/growsurf_ruby/resources/campaign/webhooks.rbi +123 -0
  95. data/rbi/growsurf_ruby/resources/campaign.rbi +18 -2
  96. data/sig/growsurf_ruby/client.rbs +2 -0
  97. data/sig/growsurf_ruby/models/account.rbs +67 -0
  98. data/sig/growsurf_ruby/models/account_create_params.rbs +42 -0
  99. data/sig/growsurf_ruby/models/account_create_response.rbs +47 -0
  100. data/sig/growsurf_ruby/models/account_resend_verification_email_response.rbs +35 -0
  101. data/sig/growsurf_ruby/models/account_rotate_api_key_response.rbs +13 -0
  102. data/sig/growsurf_ruby/models/account_update_params.rbs +42 -0
  103. data/sig/growsurf_ruby/models/campaign/participant_activity_logs_response.rbs +59 -0
  104. data/sig/growsurf_ruby/models/campaign/participant_analytics_response.rbs +407 -0
  105. data/sig/growsurf_ruby/models/campaign/participant_bulk_delete_params.rbs +30 -0
  106. data/sig/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbs +125 -0
  107. data/sig/growsurf_ruby/models/campaign/participant_email_params.rbs +61 -0
  108. data/sig/growsurf_ruby/models/campaign/participant_email_response.rbs +37 -0
  109. data/sig/growsurf_ruby/models/campaign/participant_list_activity_logs_params.rbs +47 -0
  110. data/sig/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbs +90 -0
  111. data/sig/growsurf_ruby/models/campaign/participant_update_params.rbs +14 -0
  112. data/sig/growsurf_ruby/models/campaign/reward_create_params.rbs +0 -7
  113. data/sig/growsurf_ruby/models/campaign/reward_update_params.rbs +0 -7
  114. data/sig/growsurf_ruby/models/campaign/webhook.rbs +52 -0
  115. data/sig/growsurf_ruby/models/campaign/webhook_create_params.rbs +51 -0
  116. data/sig/growsurf_ruby/models/campaign/webhook_delete_params.rbs +30 -0
  117. data/sig/growsurf_ruby/models/campaign/webhook_delete_response.rbs +17 -0
  118. data/sig/growsurf_ruby/models/campaign/webhook_event.rbs +28 -0
  119. data/sig/growsurf_ruby/models/campaign/webhook_list_response.rbs +18 -0
  120. data/sig/growsurf_ruby/models/campaign/webhook_test_params.rbs +42 -0
  121. data/sig/growsurf_ruby/models/campaign/webhook_test_response.rbs +54 -0
  122. data/sig/growsurf_ruby/models/campaign/webhook_update_params.rbs +63 -0
  123. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_params.rbs +35 -1
  124. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +533 -3
  125. data/sig/growsurf_ruby/models/campaign_update_params.rbs +1 -4
  126. data/sig/growsurf_ruby/models/commission_structure.rbs +7 -2
  127. data/sig/growsurf_ruby/models/reward_tax_valuation.rbs +4 -1
  128. data/sig/growsurf_ruby/models.rbs +6 -0
  129. data/sig/growsurf_ruby/resources/account.rbs +38 -0
  130. data/sig/growsurf_ruby/resources/campaign/participant.rbs +37 -0
  131. data/sig/growsurf_ruby/resources/campaign/rewards.rbs +0 -2
  132. data/sig/growsurf_ruby/resources/campaign/webhooks.rbs +46 -0
  133. data/sig/growsurf_ruby/resources/campaign.rbs +4 -0
  134. metadata +77 -2
@@ -0,0 +1,157 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Resources
5
+ class Campaign
6
+ class Webhooks
7
+ # Lists a program's webhooks (secrets are never returned).
8
+ #
9
+ # @overload list(id, request_options: {})
10
+ #
11
+ # @param id [String] GrowSurf program ID.
12
+ #
13
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
14
+ #
15
+ # @return [GrowsurfRuby::Models::Campaign::WebhookListResponse]
16
+ def list(id, params = {})
17
+ @client.request(
18
+ method: :get,
19
+ path: ["campaign/%1$s/webhooks", id],
20
+ model: GrowsurfRuby::Models::Campaign::WebhookListResponse,
21
+ options: params[:request_options]
22
+ )
23
+ end
24
+
25
+ # Adds a webhook to the program.
26
+ #
27
+ # @overload create(id, payload_url:, events: nil, is_enabled: nil, secret: nil, request_options: {})
28
+ #
29
+ # @param id [String] Path param: GrowSurf program ID.
30
+ #
31
+ # @param payload_url [String] Body param: The URL that receives webhook deliveries.
32
+ #
33
+ # @param events [Array<Symbol, GrowsurfRuby::Models::Campaign::WebhookEvent>] Body param: The events this webhook is subscribed to. When omitted, it is subscri
34
+ #
35
+ # @param is_enabled [Boolean] Body param
36
+ #
37
+ # @param secret [String] Body param: Write-only. Used to sign deliveries (the `GrowSurf-Signature` HMAC hea
38
+ #
39
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
40
+ #
41
+ # @return [GrowsurfRuby::Models::Campaign::Webhook]
42
+ #
43
+ # @see GrowsurfRuby::Models::Campaign::WebhookCreateParams
44
+ def create(id, params)
45
+ parsed, options = GrowsurfRuby::Campaign::WebhookCreateParams.dump_request(params)
46
+ @client.request(
47
+ method: :post,
48
+ path: ["campaign/%1$s/webhooks", id],
49
+ body: parsed,
50
+ model: GrowsurfRuby::Models::Campaign::Webhook,
51
+ options: options
52
+ )
53
+ end
54
+
55
+ # Updates a webhook by id.
56
+ #
57
+ # @overload update(webhook_id, id:, events: nil, is_enabled: nil, payload_url: nil, secret: nil, request_options: {})
58
+ #
59
+ # @param webhook_id [String] Path param: The webhook id (`primary` for the program's primary webhook).
60
+ #
61
+ # @param id [String] Path param: GrowSurf program ID.
62
+ #
63
+ # @param events [Array<Symbol, GrowsurfRuby::Models::Campaign::WebhookEvent>] Body param
64
+ #
65
+ # @param is_enabled [Boolean] Body param
66
+ #
67
+ # @param payload_url [String] Body param
68
+ #
69
+ # @param secret [String] Body param: Write-only.
70
+ #
71
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
72
+ #
73
+ # @return [GrowsurfRuby::Models::Campaign::Webhook]
74
+ #
75
+ # @see GrowsurfRuby::Models::Campaign::WebhookUpdateParams
76
+ def update(webhook_id, params)
77
+ parsed, options = GrowsurfRuby::Campaign::WebhookUpdateParams.dump_request(params)
78
+ id =
79
+ parsed.delete(:id) do
80
+ raise ArgumentError.new("missing required path argument #{_1}")
81
+ end
82
+ @client.request(
83
+ method: :patch,
84
+ path: ["campaign/%1$s/webhooks/%2$s", id, webhook_id],
85
+ body: parsed,
86
+ model: GrowsurfRuby::Models::Campaign::Webhook,
87
+ options: options
88
+ )
89
+ end
90
+
91
+ # Removes a webhook by id.
92
+ #
93
+ # @overload delete(webhook_id, id:, request_options: {})
94
+ #
95
+ # @param webhook_id [String] The webhook id (`primary` for the program's primary webhook).
96
+ #
97
+ # @param id [String] GrowSurf program ID.
98
+ #
99
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
100
+ #
101
+ # @return [GrowsurfRuby::Models::Campaign::WebhookDeleteResponse]
102
+ #
103
+ # @see GrowsurfRuby::Models::Campaign::WebhookDeleteParams
104
+ def delete(webhook_id, params)
105
+ parsed, options = GrowsurfRuby::Campaign::WebhookDeleteParams.dump_request(params)
106
+ id =
107
+ parsed.delete(:id) do
108
+ raise ArgumentError.new("missing required path argument #{_1}")
109
+ end
110
+ @client.request(
111
+ method: :delete,
112
+ path: ["campaign/%1$s/webhooks/%2$s", id, webhook_id],
113
+ model: GrowsurfRuby::Models::Campaign::WebhookDeleteResponse,
114
+ options: options
115
+ )
116
+ end
117
+
118
+ # Sends a live test event to a webhook using its stored URL and secret.
119
+ #
120
+ # @overload test(webhook_id, id:, event: nil, request_options: {})
121
+ #
122
+ # @param webhook_id [String] Path param: The webhook id (`primary` for the program's primary webhook).
123
+ #
124
+ # @param id [String] Path param: GrowSurf program ID.
125
+ #
126
+ # @param event [Symbol, GrowsurfRuby::Models::Campaign::WebhookEvent] Body param: The event to simulate. When omitted, the webhook's first enabled even
127
+ #
128
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
129
+ #
130
+ # @return [GrowsurfRuby::Models::Campaign::WebhookTestResponse]
131
+ #
132
+ # @see GrowsurfRuby::Models::Campaign::WebhookTestParams
133
+ def test(webhook_id, params)
134
+ parsed, options = GrowsurfRuby::Campaign::WebhookTestParams.dump_request(params)
135
+ id =
136
+ parsed.delete(:id) do
137
+ raise ArgumentError.new("missing required path argument #{_1}")
138
+ end
139
+ @client.request(
140
+ method: :post,
141
+ path: ["campaign/%1$s/webhooks/%2$s/test", id, webhook_id],
142
+ body: parsed,
143
+ model: GrowsurfRuby::Models::Campaign::WebhookTestResponse,
144
+ options: options
145
+ )
146
+ end
147
+
148
+ # @api private
149
+ #
150
+ # @param client [GrowsurfRuby::Client]
151
+ def initialize(client:)
152
+ @client = client
153
+ end
154
+ end
155
+ end
156
+ end
157
+ end
@@ -34,6 +34,10 @@ module GrowsurfRuby
34
34
  # @return [GrowsurfRuby::Resources::Campaign::Installation]
35
35
  attr_reader :installation
36
36
 
37
+ # Program webhook configuration operations.
38
+ # @return [GrowsurfRuby::Resources::Campaign::Webhooks]
39
+ attr_reader :webhooks
40
+
37
41
  # Retrieves a program for the given program ID.
38
42
  #
39
43
  # @overload retrieve(id, request_options: {})
@@ -123,7 +127,7 @@ module GrowsurfRuby
123
127
  #
124
128
  # @param name [String] Body param
125
129
  #
126
- # @param status [Symbol, GrowsurfRuby::Models::CampaignUpdateParams::Status] Body param: The program status. Transitions are validated; DELETED is not allowe
130
+ # @param status [Symbol, GrowsurfRuby::Models::CampaignUpdateParams::Status] Body param: The requested program status. `IN_PROGRESS` publishes or resumes the
127
131
  #
128
132
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
129
133
  #
@@ -379,7 +383,7 @@ module GrowsurfRuby
379
383
  #
380
384
  # Retrieves analytics for a program.
381
385
  #
382
- # @overload retrieve_analytics(id, days: nil, end_date: nil, start_date: nil, request_options: {})
386
+ # @overload retrieve_analytics(id, days: nil, end_date: nil, include: nil, interval: nil, start_date: nil, request_options: {})
383
387
  #
384
388
  # @param id [String] GrowSurf program ID.
385
389
  #
@@ -387,6 +391,10 @@ module GrowsurfRuby
387
391
  #
388
392
  # @param end_date [Integer] End date of the analytics timeframe as a Unix timestamp in milliseconds. Require
389
393
  #
394
+ # @param include [String] Comma-separated list of optional enrichments (opt-in to keep the default response
395
+ #
396
+ # @param interval [Symbol, GrowsurfRuby::Models::CampaignRetrieveAnalyticsParams::Interval] When set to `day`, `week`, or `month`, the response also includes a `series` array
397
+ #
390
398
  # @param start_date [Integer] Start date of the analytics timeframe as a Unix timestamp in milliseconds. Requi
391
399
  #
392
400
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -419,6 +427,7 @@ module GrowsurfRuby
419
427
  @emails = GrowsurfRuby::Resources::Campaign::Emails.new(client: client)
420
428
  @options = GrowsurfRuby::Resources::Campaign::Options.new(client: client)
421
429
  @installation = GrowsurfRuby::Resources::Campaign::Installation.new(client: client)
430
+ @webhooks = GrowsurfRuby::Resources::Campaign::Webhooks.new(client: client)
422
431
  end
423
432
  end
424
433
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GrowsurfRuby
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.1"
5
5
  end
data/lib/growsurf_ruby.rb CHANGED
@@ -61,11 +61,18 @@ require_relative "growsurf_ruby/models/campaign/commission_delete_params"
61
61
  require_relative "growsurf_ruby/models/campaign/commission_delete_response"
62
62
  require_relative "growsurf_ruby/models/campaign/delete_reward_response"
63
63
  require_relative "growsurf_ruby/models/campaign/fraud_risk_level"
64
+ require_relative "growsurf_ruby/models/campaign/participant_activity_logs_response"
64
65
  require_relative "growsurf_ruby/models/campaign/participant_add_params"
66
+ require_relative "growsurf_ruby/models/campaign/participant_analytics_response"
67
+ require_relative "growsurf_ruby/models/campaign/participant_bulk_delete_params"
68
+ require_relative "growsurf_ruby/models/campaign/participant_bulk_delete_response"
65
69
  require_relative "growsurf_ruby/models/campaign/participant_cancel_delayed_referral_params"
66
70
  require_relative "growsurf_ruby/models/campaign/participant_cancel_delayed_referral_response"
67
71
  require_relative "growsurf_ruby/models/campaign/participant_delete_params"
68
72
  require_relative "growsurf_ruby/models/campaign/participant_delete_response"
73
+ require_relative "growsurf_ruby/models/campaign/participant_email_params"
74
+ require_relative "growsurf_ruby/models/campaign/participant_email_response"
75
+ require_relative "growsurf_ruby/models/campaign/participant_list_activity_logs_params"
69
76
  require_relative "growsurf_ruby/models/campaign/participant_list_commissions_params"
70
77
  require_relative "growsurf_ruby/models/campaign/participant_list_payouts_params"
71
78
  require_relative "growsurf_ruby/models/campaign/participant_list_referrals_params"
@@ -75,6 +82,7 @@ require_relative "growsurf_ruby/models/campaign/participant_record_transaction_p
75
82
  require_relative "growsurf_ruby/models/campaign/participant_record_transaction_response"
76
83
  require_relative "growsurf_ruby/models/campaign/participant_refund_transaction_params"
77
84
  require_relative "growsurf_ruby/models/campaign/participant_refund_transaction_response"
85
+ require_relative "growsurf_ruby/models/campaign/participant_retrieve_analytics_params"
78
86
  require_relative "growsurf_ruby/models/campaign/participant_retrieve_params"
79
87
  require_relative "growsurf_ruby/models/campaign/participant_reward"
80
88
  require_relative "growsurf_ruby/models/campaign/participant_send_invites_params"
@@ -93,6 +101,21 @@ require_relative "growsurf_ruby/models/campaign/reward_delete_response"
93
101
  require_relative "growsurf_ruby/models/campaign/reward_fulfill_params"
94
102
  require_relative "growsurf_ruby/models/campaign/reward_fulfill_response"
95
103
  require_relative "growsurf_ruby/models/campaign/reward_update_params"
104
+ require_relative "growsurf_ruby/models/campaign/webhook"
105
+ require_relative "growsurf_ruby/models/campaign/webhook_create_params"
106
+ require_relative "growsurf_ruby/models/campaign/webhook_delete_params"
107
+ require_relative "growsurf_ruby/models/campaign/webhook_delete_response"
108
+ require_relative "growsurf_ruby/models/campaign/webhook_event"
109
+ require_relative "growsurf_ruby/models/campaign/webhook_list_response"
110
+ require_relative "growsurf_ruby/models/campaign/webhook_test_params"
111
+ require_relative "growsurf_ruby/models/campaign/webhook_test_response"
112
+ require_relative "growsurf_ruby/models/campaign/webhook_update_params"
113
+ require_relative "growsurf_ruby/models/account"
114
+ require_relative "growsurf_ruby/models/account_create_params"
115
+ require_relative "growsurf_ruby/models/account_create_response"
116
+ require_relative "growsurf_ruby/models/account_resend_verification_email_response"
117
+ require_relative "growsurf_ruby/models/account_rotate_api_key_response"
118
+ require_relative "growsurf_ruby/models/account_update_params"
96
119
  require_relative "growsurf_ruby/models/campaign"
97
120
  require_relative "growsurf_ruby/models/campaign_create_mobile_participant_token_params"
98
121
  require_relative "growsurf_ruby/models/campaign_create_mobile_participant_token_response"
@@ -115,6 +138,7 @@ require_relative "growsurf_ruby/models/participant_payout_list"
115
138
  require_relative "growsurf_ruby/models/referral_list"
116
139
  require_relative "growsurf_ruby/models/reward_tax_valuation"
117
140
  require_relative "growsurf_ruby/models"
141
+ require_relative "growsurf_ruby/resources/account"
118
142
  require_relative "growsurf_ruby/resources/campaign"
119
143
  require_relative "growsurf_ruby/resources/campaign/commission"
120
144
  require_relative "growsurf_ruby/resources/campaign/design"
@@ -124,3 +148,4 @@ require_relative "growsurf_ruby/resources/campaign/options"
124
148
  require_relative "growsurf_ruby/resources/campaign/participant"
125
149
  require_relative "growsurf_ruby/resources/campaign/reward"
126
150
  require_relative "growsurf_ruby/resources/campaign/rewards"
151
+ require_relative "growsurf_ruby/resources/campaign/webhooks"
@@ -14,6 +14,9 @@ module GrowsurfRuby
14
14
  sig { returns(String) }
15
15
  attr_reader :api_key
16
16
 
17
+ sig { returns(GrowsurfRuby::Resources::Account) }
18
+ attr_reader :account
19
+
17
20
  sig { returns(GrowsurfRuby::Resources::Campaign) }
18
21
  attr_reader :campaign
19
22
 
@@ -0,0 +1,125 @@
1
+ # typed: strong
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ class Account < GrowsurfRuby::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(GrowsurfRuby::Account, GrowsurfRuby::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(String) }
12
+ attr_accessor :email
13
+
14
+ # The account's unique identifier.
15
+ sig { returns(String) }
16
+ attr_accessor :id
17
+
18
+ # GrowSurf-team verification state. `VERIFIED` is required before a program can
19
+ # send participant emails.
20
+ sig { returns(GrowsurfRuby::Account::VerificationStatus::OrSymbol) }
21
+ attr_accessor :verification_status
22
+
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :company
25
+
26
+ # When the account was created, as a Unix timestamp in milliseconds.
27
+ sig { returns(T.nilable(Integer)) }
28
+ attr_accessor :created_at
29
+
30
+ sig { returns(T.nilable(String)) }
31
+ attr_accessor :first_name
32
+
33
+ sig { returns(T.nilable(String)) }
34
+ attr_accessor :last_name
35
+
36
+ # When team verification was last requested, as a Unix timestamp in milliseconds.
37
+ sig { returns(T.nilable(Integer)) }
38
+ attr_accessor :verification_requested_at
39
+
40
+ sig do
41
+ params(
42
+ email: String,
43
+ id: String,
44
+ verification_status:
45
+ GrowsurfRuby::Account::VerificationStatus::OrSymbol,
46
+ company: T.nilable(String),
47
+ created_at: T.nilable(Integer),
48
+ first_name: T.nilable(String),
49
+ last_name: T.nilable(String),
50
+ verification_requested_at: T.nilable(Integer)
51
+ ).returns(T.attached_class)
52
+ end
53
+ def self.new(
54
+ email:,
55
+ # The account's unique identifier.
56
+ id:,
57
+ # GrowSurf-team verification state. `VERIFIED` is required before a program can
58
+ # send participant emails.
59
+ verification_status:,
60
+ company: nil,
61
+ # When the account was created, as a Unix timestamp in milliseconds.
62
+ created_at: nil,
63
+ first_name: nil,
64
+ last_name: nil,
65
+ # When team verification was last requested, as a Unix timestamp in milliseconds.
66
+ verification_requested_at: nil
67
+ )
68
+ end
69
+
70
+ sig do
71
+ override.returns(
72
+ {
73
+ email: String,
74
+ id: String,
75
+ verification_status:
76
+ GrowsurfRuby::Account::VerificationStatus::TaggedSymbol,
77
+ company: T.nilable(String),
78
+ created_at: T.nilable(Integer),
79
+ first_name: T.nilable(String),
80
+ last_name: T.nilable(String),
81
+ verification_requested_at: T.nilable(Integer)
82
+ }
83
+ )
84
+ end
85
+ def to_hash
86
+ end
87
+
88
+ # GrowSurf-team verification state. `VERIFIED` is required before a program can
89
+ # send participant emails.
90
+ module VerificationStatus
91
+ extend GrowsurfRuby::Internal::Type::Enum
92
+
93
+ TaggedSymbol =
94
+ T.type_alias do
95
+ T.all(Symbol, GrowsurfRuby::Account::VerificationStatus)
96
+ end
97
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
98
+
99
+ NOT_REQUESTED =
100
+ T.let(
101
+ :NOT_REQUESTED,
102
+ GrowsurfRuby::Account::VerificationStatus::TaggedSymbol
103
+ )
104
+ REQUESTED =
105
+ T.let(
106
+ :REQUESTED,
107
+ GrowsurfRuby::Account::VerificationStatus::TaggedSymbol
108
+ )
109
+ VERIFIED =
110
+ T.let(
111
+ :VERIFIED,
112
+ GrowsurfRuby::Account::VerificationStatus::TaggedSymbol
113
+ )
114
+
115
+ sig do
116
+ override.returns(
117
+ T::Array[GrowsurfRuby::Account::VerificationStatus::TaggedSymbol]
118
+ )
119
+ end
120
+ def self.values
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,73 @@
1
+ # typed: strong
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ class AccountCreateParams < GrowsurfRuby::Internal::Type::BaseModel
6
+ extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
7
+ include GrowsurfRuby::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ GrowsurfRuby::AccountCreateParams,
13
+ GrowsurfRuby::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # The email address for the new account. Personal emails and disposable email addresses are not accepted.
18
+ sig { returns(String) }
19
+ attr_accessor :email
20
+
21
+ sig { returns(T.nilable(String)) }
22
+ attr_reader :company
23
+
24
+ sig { params(company: String).void }
25
+ attr_writer :company
26
+
27
+ sig { returns(T.nilable(String)) }
28
+ attr_reader :first_name
29
+
30
+ sig { params(first_name: String).void }
31
+ attr_writer :first_name
32
+
33
+ sig { returns(T.nilable(String)) }
34
+ attr_reader :last_name
35
+
36
+ sig { params(last_name: String).void }
37
+ attr_writer :last_name
38
+
39
+ sig do
40
+ params(
41
+ email: String,
42
+ company: String,
43
+ first_name: String,
44
+ last_name: String,
45
+ request_options: GrowsurfRuby::RequestOptions::OrHash
46
+ ).returns(T.attached_class)
47
+ end
48
+ def self.new(
49
+ # The email address for the new account. Personal emails and disposable email addresses are not accepted.
50
+ email:,
51
+ company: nil,
52
+ first_name: nil,
53
+ last_name: nil,
54
+ request_options: {}
55
+ )
56
+ end
57
+
58
+ sig do
59
+ override.returns(
60
+ {
61
+ email: String,
62
+ company: String,
63
+ first_name: String,
64
+ last_name: String,
65
+ request_options: GrowsurfRuby::RequestOptions
66
+ }
67
+ )
68
+ end
69
+ def to_hash
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,115 @@
1
+ # typed: strong
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ class AccountCreateResponse < GrowsurfRuby::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ GrowsurfRuby::Models::AccountCreateResponse,
10
+ GrowsurfRuby::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # An API key for the new account. Use it as the `Bearer` token on subsequent
15
+ # requests. Locked (`403` `EMAIL_NOT_VERIFIED_ERROR`) until the account's email
16
+ # is verified, and rotated when the account owner first signs in to the GrowSurf
17
+ # dashboard.
18
+ sig { returns(String) }
19
+ attr_accessor :api_key
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :email
23
+
24
+ # The new account's unique identifier.
25
+ sig { returns(String) }
26
+ attr_accessor :id
27
+
28
+ # GrowSurf account verification state. `VERIFIED` is required before a program
29
+ # can send participant emails.
30
+ sig do
31
+ returns(
32
+ GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus::TaggedSymbol
33
+ )
34
+ end
35
+ attr_accessor :verification_status
36
+
37
+ sig do
38
+ params(
39
+ api_key: String,
40
+ email: String,
41
+ id: String,
42
+ verification_status:
43
+ GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus::OrSymbol
44
+ ).returns(T.attached_class)
45
+ end
46
+ def self.new(
47
+ # An API key for the new account. Use it as the `Bearer` token on subsequent
48
+ # requests. Locked (`403` `EMAIL_NOT_VERIFIED_ERROR`) until the account's email
49
+ # is verified, and rotated when the account owner first signs in to the GrowSurf
50
+ # dashboard.
51
+ api_key:,
52
+ email:,
53
+ # The new account's unique identifier.
54
+ id:,
55
+ # GrowSurf account verification state. `VERIFIED` is required before a program
56
+ # can send participant emails.
57
+ verification_status:
58
+ )
59
+ end
60
+
61
+ sig do
62
+ override.returns(
63
+ {
64
+ api_key: String,
65
+ email: String,
66
+ id: String,
67
+ verification_status:
68
+ GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus::TaggedSymbol
69
+ }
70
+ )
71
+ end
72
+ def to_hash
73
+ end
74
+
75
+ module VerificationStatus
76
+ extend GrowsurfRuby::Internal::Type::Enum
77
+
78
+ TaggedSymbol =
79
+ T.type_alias do
80
+ T.all(
81
+ Symbol,
82
+ GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus
83
+ )
84
+ end
85
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
86
+
87
+ NOT_REQUESTED =
88
+ T.let(
89
+ :NOT_REQUESTED,
90
+ GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus::TaggedSymbol
91
+ )
92
+ REQUESTED =
93
+ T.let(
94
+ :REQUESTED,
95
+ GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus::TaggedSymbol
96
+ )
97
+ VERIFIED =
98
+ T.let(
99
+ :VERIFIED,
100
+ GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus::TaggedSymbol
101
+ )
102
+
103
+ sig do
104
+ override.returns(
105
+ T::Array[
106
+ GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus::TaggedSymbol
107
+ ]
108
+ )
109
+ end
110
+ def self.values
111
+ end
112
+ end
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,76 @@
1
+ # typed: strong
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ class AccountResendVerificationEmailResponse < GrowsurfRuby::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ GrowsurfRuby::Models::AccountResendVerificationEmailResponse,
10
+ GrowsurfRuby::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig do
15
+ returns(
16
+ GrowsurfRuby::Models::AccountResendVerificationEmailResponse::Status::TaggedSymbol
17
+ )
18
+ end
19
+ attr_accessor :status
20
+
21
+ sig { returns(T::Boolean) }
22
+ attr_accessor :success
23
+
24
+ sig do
25
+ params(
26
+ status:
27
+ GrowsurfRuby::Models::AccountResendVerificationEmailResponse::Status::OrSymbol,
28
+ success: T::Boolean
29
+ ).returns(T.attached_class)
30
+ end
31
+ def self.new(status:, success:)
32
+ end
33
+
34
+ sig do
35
+ override.returns(
36
+ {
37
+ status:
38
+ GrowsurfRuby::Models::AccountResendVerificationEmailResponse::Status::TaggedSymbol,
39
+ success: T::Boolean
40
+ }
41
+ )
42
+ end
43
+ def to_hash
44
+ end
45
+
46
+ module Status
47
+ extend GrowsurfRuby::Internal::Type::Enum
48
+
49
+ TaggedSymbol =
50
+ T.type_alias do
51
+ T.all(
52
+ Symbol,
53
+ GrowsurfRuby::Models::AccountResendVerificationEmailResponse::Status
54
+ )
55
+ end
56
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
57
+
58
+ SENT =
59
+ T.let(
60
+ :SENT,
61
+ GrowsurfRuby::Models::AccountResendVerificationEmailResponse::Status::TaggedSymbol
62
+ )
63
+
64
+ sig do
65
+ override.returns(
66
+ T::Array[
67
+ GrowsurfRuby::Models::AccountResendVerificationEmailResponse::Status::TaggedSymbol
68
+ ]
69
+ )
70
+ end
71
+ def self.values
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end