growsurf-ruby 1.1.2 → 1.2.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 (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/growsurf_ruby/client.rb +5 -5
  5. data/lib/growsurf_ruby/models/account_create_response.rb +5 -12
  6. data/lib/growsurf_ruby/models/team.rb +48 -0
  7. data/lib/growsurf_ruby/models/team_resend_owner_verification_email_response.rb +34 -0
  8. data/lib/growsurf_ruby/models/{account_rotate_api_key_response.rb → team_rotate_api_key_response.rb} +3 -3
  9. data/lib/growsurf_ruby/models/team_update_params.rb +22 -0
  10. data/lib/growsurf_ruby/models.rb +3 -3
  11. data/lib/growsurf_ruby/resources/account.rb +9 -125
  12. data/lib/growsurf_ruby/resources/campaign/participant.rb +2 -2
  13. data/lib/growsurf_ruby/resources/campaign.rb +2 -2
  14. data/lib/growsurf_ruby/resources/team.rb +109 -0
  15. data/lib/growsurf_ruby/version.rb +1 -1
  16. data/lib/growsurf_ruby.rb +5 -4
  17. data/rbi/growsurf_ruby/client.rbi +4 -1
  18. data/rbi/growsurf_ruby/models/account_create_response.rbi +0 -8
  19. data/rbi/growsurf_ruby/models/team.rbi +65 -0
  20. data/rbi/growsurf_ruby/models/{account_resend_verification_email_response.rbi → team_resend_owner_verification_email_response.rbi} +8 -18
  21. data/rbi/growsurf_ruby/models/{account_rotate_api_key_response.rbi → team_rotate_api_key_response.rbi} +3 -7
  22. data/rbi/growsurf_ruby/models/team_update_params.rbi +35 -0
  23. data/rbi/growsurf_ruby/models.rbi +3 -3
  24. data/rbi/growsurf_ruby/resources/account.rbi +0 -86
  25. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +2 -2
  26. data/rbi/growsurf_ruby/resources/campaign.rbi +3 -2
  27. data/rbi/growsurf_ruby/resources/team.rbi +52 -0
  28. data/sig/growsurf_ruby/client.rbs +3 -1
  29. data/sig/growsurf_ruby/models/account_create_response.rbs +0 -5
  30. data/sig/growsurf_ruby/models/team.rbs +36 -0
  31. data/sig/growsurf_ruby/models/team_resend_owner_verification_email_response.rbs +31 -0
  32. data/sig/growsurf_ruby/models/{account_rotate_api_key_response.rbs → team_rotate_api_key_response.rbs} +2 -2
  33. data/sig/growsurf_ruby/models/team_update_params.rbs +23 -0
  34. data/sig/growsurf_ruby/models.rbs +3 -3
  35. data/sig/growsurf_ruby/resources/account.rbs +0 -23
  36. data/sig/growsurf_ruby/resources/team.rbs +28 -0
  37. metadata +17 -14
  38. data/lib/growsurf_ruby/models/account.rb +0 -90
  39. data/lib/growsurf_ruby/models/account_resend_verification_email_response.rb +0 -33
  40. data/lib/growsurf_ruby/models/account_update_params.rb +0 -35
  41. data/rbi/growsurf_ruby/models/account.rbi +0 -125
  42. data/rbi/growsurf_ruby/models/account_update_params.rbi +0 -65
  43. data/sig/growsurf_ruby/models/account.rbs +0 -67
  44. data/sig/growsurf_ruby/models/account_resend_verification_email_response.rbs +0 -35
  45. data/sig/growsurf_ruby/models/account_update_params.rbs +0 -42
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8076462c15a156d463bf26bb5f654d2baf7a6795204be7b8ef79a9dd2ae2053
4
- data.tar.gz: da320558ee220ff66aac11869a410cdcb402084b9563985763da99c47cce1755
3
+ metadata.gz: 42193bcccd25c0e13bb8fe762d66313d57b6c673b820322dc1a633dc8d3cd70e
4
+ data.tar.gz: 6280026d747b838e22cdf1db95a0f07eed13b0d049efca6af74d46e99f833f3a
5
5
  SHA512:
6
- metadata.gz: d5c1d9647d05936815ddae19a40e12a06cf4d1ed469f27c86dc03b543b3abd9895923e494c4bb0f7a28ba50c0c219bafa78276c0feb15d94f08b43d40b59f908
7
- data.tar.gz: fe5bcdf5683be8d8dbf038f33ca365d66d5959f5c3d3a5b7e9c8e9717e0970564d8d5ac9b6d625bbf1af24edda057405aacefd9f4a35e6cd7c48f2aac1023a51
6
+ metadata.gz: 7ec17bcbb93999329df4edd4c5d0e64e1385e9278c4168059d3f66817e49bf3e3463f0ab3c8cbef14742f9ee6bd3efc6461da26e53d11a4bced6120352da2c3f
7
+ data.tar.gz: cf651a17a07aa569619bc58d2e90c9d236ec8d7a2aebf9b10102d38dca72b120f2514d06eeb5853919235ab2e466e71db2c45cc937ae27b9cb7fbbe817922185
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.0](https://github.com/growsurf/growsurf-ruby/compare/v1.1.2...v1.2.0) (2026-07-13)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** add Team resource ([8b11d89](https://github.com/growsurf/growsurf-ruby/commit/8b11d89403a00bb2c381dd46295252d929d48370))
9
+
3
10
  ## [1.1.2](https://github.com/growsurf/growsurf-ruby/compare/v1.1.1...v1.1.2) (2026-07-11)
4
11
 
5
12
 
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "growsurf-ruby", "~> 1.1.2"
20
+ gem "growsurf-ruby", "~> 1.2.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -22,6 +22,9 @@ module GrowsurfRuby
22
22
  # @return [GrowsurfRuby::Resources::Account]
23
23
  attr_reader :account
24
24
 
25
+ # @return [GrowsurfRuby::Resources::Team]
26
+ attr_reader :team
27
+
25
28
  # @return [GrowsurfRuby::Resources::Campaign]
26
29
  attr_reader :campaign
27
30
 
@@ -59,10 +62,6 @@ module GrowsurfRuby
59
62
  )
60
63
  base_url ||= "https://api.growsurf.com/v2"
61
64
 
62
- if api_key.nil?
63
- raise ArgumentError.new("api_key is required, and can be set via environ: \"GROWSURF_API_KEY\"")
64
- end
65
-
66
65
  headers = {}
67
66
  custom_headers_env = ENV["GROWSURF_CUSTOM_HEADERS"]
68
67
  unless custom_headers_env.nil?
@@ -76,7 +75,7 @@ module GrowsurfRuby
76
75
  headers = parsed.merge(headers)
77
76
  end
78
77
 
79
- @api_key = api_key.to_s
78
+ @api_key = api_key&.to_s
80
79
 
81
80
  super(
82
81
  base_url: base_url,
@@ -89,6 +88,7 @@ module GrowsurfRuby
89
88
  )
90
89
 
91
90
  @account = GrowsurfRuby::Resources::Account.new(client: self)
91
+ @team = GrowsurfRuby::Resources::Team.new(client: self)
92
92
  @campaign = GrowsurfRuby::Resources::Campaign.new(client: self)
93
93
  end
94
94
  end
@@ -14,18 +14,13 @@ module GrowsurfRuby
14
14
  required :api_key, String, api_name: :apiKey
15
15
 
16
16
  # @!attribute email
17
+ # Email address for the new account.
17
18
  #
18
19
  # @return [String]
19
20
  required :email, String
20
21
 
21
- # @!attribute id
22
- # The new account's unique identifier.
23
- #
24
- # @return [String]
25
- required :id, String
26
-
27
22
  # @!attribute verification_status
28
- # GrowSurf account verification state. `VERIFIED` is required before a program
23
+ # GrowSurf team verification state. `VERIFIED` is required before a program
29
24
  # can send participant emails.
30
25
  #
31
26
  # @return [Symbol, GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus]
@@ -33,7 +28,7 @@ module GrowsurfRuby
33
28
  enum: -> { GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus },
34
29
  api_name: :verificationStatus
35
30
 
36
- # @!method initialize(api_key:, email:, id:, verification_status:)
31
+ # @!method initialize(api_key:, email:, verification_status:)
37
32
  # Some parameter documentations has been truncated, see
38
33
  # {GrowsurfRuby::Models::AccountCreateResponse} for more details.
39
34
  #
@@ -41,11 +36,9 @@ module GrowsurfRuby
41
36
  #
42
37
  # @param email [String]
43
38
  #
44
- # @param id [String] The new account's unique identifier.
45
- #
46
- # @param verification_status [Symbol, GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus] GrowSurf account verification state. `VERIFIED` is required before a program can
39
+ # @param verification_status [Symbol, GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus] GrowSurf team verification state. `VERIFIED` is required before a program can
47
40
 
48
- # GrowSurf account verification state. `VERIFIED` is required before a program
41
+ # GrowSurf team verification state. `VERIFIED` is required before a program
49
42
  # can send participant emails.
50
43
  #
51
44
  # @see GrowsurfRuby::Models::AccountCreateResponse#verification_status
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ # @see GrowsurfRuby::Resources::Team#retrieve
6
+ class Team < GrowsurfRuby::Internal::Type::BaseModel
7
+ # @!attribute name
8
+ # The team's display name.
9
+ #
10
+ # @return [String]
11
+ required :name, String
12
+
13
+ # @!attribute verification_status
14
+ # GrowSurf team verification state. `VERIFIED` is required before a program can
15
+ # send participant emails.
16
+ #
17
+ # @return [Symbol, GrowsurfRuby::Models::Team::VerificationStatus]
18
+ required :verification_status,
19
+ enum: -> { GrowsurfRuby::Models::Team::VerificationStatus },
20
+ api_name: :verificationStatus
21
+
22
+ # @!attribute verification_requested_at
23
+ # When team verification was last requested, as a Unix timestamp in milliseconds.
24
+ #
25
+ # @return [Integer, nil]
26
+ required :verification_requested_at, Integer, api_name: :verificationRequestedAt, nil?: true
27
+
28
+ # @!method initialize(name:, verification_status:, verification_requested_at:)
29
+ # @param name [String] The team's display name.
30
+ #
31
+ # @param verification_status [Symbol, GrowsurfRuby::Models::Team::VerificationStatus] GrowSurf team verification state.
32
+ #
33
+ # @param verification_requested_at [Integer, nil] When team verification was last requested, as a Unix timestamp in milliseconds.
34
+
35
+ # GrowSurf team verification state.
36
+ module VerificationStatus
37
+ extend GrowsurfRuby::Internal::Type::Enum
38
+
39
+ NOT_REQUESTED = :NOT_REQUESTED
40
+ REQUESTED = :REQUESTED
41
+ VERIFIED = :VERIFIED
42
+
43
+ # @!method self.values
44
+ # @return [Array<Symbol>]
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ # @see GrowsurfRuby::Resources::Team#resend_owner_verification_email
6
+ class TeamResendOwnerVerificationEmailResponse < GrowsurfRuby::Internal::Type::BaseModel
7
+ # @!attribute status
8
+ # Status of the verification email request.
9
+ #
10
+ # @return [Symbol, GrowsurfRuby::Models::TeamResendOwnerVerificationEmailResponse::Status]
11
+ required :status, enum: -> { GrowsurfRuby::Models::TeamResendOwnerVerificationEmailResponse::Status }
12
+
13
+ # @!attribute success
14
+ # Whether the verification email request was accepted.
15
+ #
16
+ # @return [Boolean]
17
+ required :success, GrowsurfRuby::Internal::Type::Boolean
18
+
19
+ # @!method initialize(status:, success:)
20
+ # @param status [Symbol, GrowsurfRuby::Models::TeamResendOwnerVerificationEmailResponse::Status]
21
+ #
22
+ # @param success [Boolean]
23
+
24
+ module Status
25
+ extend GrowsurfRuby::Internal::Type::Enum
26
+
27
+ SENT = :SENT
28
+
29
+ # @!method self.values
30
+ # @return [Array<Symbol>]
31
+ end
32
+ end
33
+ end
34
+ end
@@ -2,8 +2,8 @@
2
2
 
3
3
  module GrowsurfRuby
4
4
  module Models
5
- # @see GrowsurfRuby::Resources::Account#rotate_api_key
6
- class AccountRotateAPIKeyResponse < GrowsurfRuby::Internal::Type::BaseModel
5
+ # @see GrowsurfRuby::Resources::Team#rotate_api_key
6
+ class TeamRotateAPIKeyResponse < GrowsurfRuby::Internal::Type::BaseModel
7
7
  # @!attribute api_key
8
8
  # The new API key. Store it now; the key used for rotation stops working immediately.
9
9
  #
@@ -11,7 +11,7 @@ module GrowsurfRuby
11
11
  required :api_key, String, api_name: :apiKey
12
12
 
13
13
  # @!method initialize(api_key:)
14
- # @param api_key [String] The new API key. Store it now; the key used for rotation stops working immediately.
14
+ # @param api_key [String] The new API key.
15
15
  end
16
16
  end
17
17
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ # @see GrowsurfRuby::Resources::Team#update
6
+ class TeamUpdateParams < GrowsurfRuby::Internal::Type::BaseModel
7
+ extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
8
+ include GrowsurfRuby::Internal::Type::RequestParameters
9
+
10
+ # @!attribute name
11
+ # The team's display name.
12
+ #
13
+ # @return [String]
14
+ required :name, String
15
+
16
+ # @!method initialize(name:, request_options: {})
17
+ # @param name [String] The team's display name.
18
+ #
19
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}]
20
+ end
21
+ end
22
+ end
@@ -39,11 +39,11 @@ 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
42
  AccountCreateParams = GrowsurfRuby::Models::AccountCreateParams
45
43
 
46
- AccountUpdateParams = GrowsurfRuby::Models::AccountUpdateParams
44
+ Team = GrowsurfRuby::Models::Team
45
+
46
+ TeamUpdateParams = GrowsurfRuby::Models::TeamUpdateParams
47
47
 
48
48
  Campaign = GrowsurfRuby::Models::Campaign
49
49
 
@@ -3,31 +3,20 @@
3
3
  module GrowsurfRuby
4
4
  module Resources
5
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, shown once
8
- # in the response. The key is locked until the account's email address is
9
- # verified: authenticated endpoints outside the `Accounts` group return a `403`
10
- # with error code
11
- # `EMAIL_NOT_VERIFIED_ERROR` until then (resend the email via `POST
12
- # /account/verification-email`, then retry). A welcome email is sent to the
13
- # address with the verification link and a set-password link for dashboard
14
- # access. Accounts whose email is never verified are deleted automatically after
15
- # 7 days. For security, the API key is rotated the first time the account owner
16
- # signs in to the GrowSurf dashboard. Some actions (such as emailing
17
- # participants) additionally require the GrowSurf team to verify the account
18
- # first. By creating an account you agree, on behalf of the account holder, to
19
- # GrowSurf's [Terms of Service](https://growsurf.com/terms) and
20
- # [Privacy Policy](https://growsurf.com/privacy).
6
+ # Creates a new GrowSurf account and returns an API key shown once in the
7
+ # response. The key is locked until the team owner's email address is verified and
8
+ # rotates the first time the account owner signs in to the GrowSurf dashboard.
9
+ # Accounts whose email is never verified are deleted automatically after 7 days.
21
10
  #
22
11
  # @overload create(email:, company: nil, first_name: nil, last_name: nil, request_options: {})
23
12
  #
24
- # @param email [String] The email address for the new account. Personal emails and disposable email addresses are not accepted.
13
+ # @param email [String] The email address for the new GrowSurf account. Personal emails and disposable email addresses are not accepted.
25
14
  #
26
- # @param company [String]
15
+ # @param company [String] Company name for the new account.
27
16
  #
28
- # @param first_name [String]
17
+ # @param first_name [String] First name for the new account owner.
29
18
  #
30
- # @param last_name [String]
19
+ # @param last_name [String] Last name for the new account owner.
31
20
  #
32
21
  # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
33
22
  #
@@ -36,6 +25,7 @@ module GrowsurfRuby
36
25
  # @see GrowsurfRuby::Models::AccountCreateParams
37
26
  def create(params)
38
27
  parsed, options = GrowsurfRuby::AccountCreateParams.dump_request(params)
28
+ options[:extra_headers] = options[:extra_headers].to_h.merge("authorization" => nil)
39
29
  @client.request(
40
30
  method: :post,
41
31
  path: "accounts",
@@ -45,112 +35,6 @@ module GrowsurfRuby
45
35
  )
46
36
  end
47
37
 
48
- # Retrieves the account that owns the API key: profile and GrowSurf-team
49
- # verification state.
50
- # `verificationStatus` is `VERIFIED` once the GrowSurf team has verified the account
51
- # — this is required before you can send participant emails from a program.
52
- #
53
- # @overload retrieve(request_options: {})
54
- #
55
- # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
56
- #
57
- # @return [GrowsurfRuby::Models::Account]
58
- def retrieve(params = {})
59
- @client.request(
60
- method: :get,
61
- path: "account",
62
- model: GrowsurfRuby::Account,
63
- options: params[:request_options]
64
- )
65
- end
66
-
67
- # Updates your own account profile (`firstName`, `lastName`, `company`). Any other
68
- # property is rejected with a `400` — in particular, the account `email` cannot be
69
- # changed via the API, and billing/subscription is not editable here.
70
- #
71
- # @overload update(company: nil, first_name: nil, last_name: nil, request_options: {})
72
- #
73
- # @param company [String]
74
- #
75
- # @param first_name [String]
76
- #
77
- # @param last_name [String]
78
- #
79
- # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
80
- #
81
- # @return [GrowsurfRuby::Models::Account]
82
- #
83
- # @see GrowsurfRuby::Models::AccountUpdateParams
84
- def update(params = {})
85
- parsed, options = GrowsurfRuby::AccountUpdateParams.dump_request(params)
86
- @client.request(
87
- method: :patch,
88
- path: "account",
89
- body: parsed,
90
- model: GrowsurfRuby::Account,
91
- options: options
92
- )
93
- end
94
-
95
- # Generates a new API key and invalidates the key used for the request. The SDK
96
- # sends a retry-safe `Idempotency-Key`, so automatic retries return the same
97
- # replacement. Store the returned key, then update every integration that used
98
- # the old key. The account owner is notified by email whenever the key is rotated.
99
- # Requires an API key with `api_key:rotate`. This operation is available only through
100
- # the REST API or a GrowSurf API SDK, not through MCP.
101
- #
102
- # @overload rotate_api_key(request_options: {})
103
- #
104
- # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
105
- #
106
- # @return [GrowsurfRuby::Models::AccountRotateAPIKeyResponse]
107
- def rotate_api_key(params = {})
108
- @client.request(
109
- method: :post,
110
- path: "account/api-key",
111
- model: GrowsurfRuby::Models::AccountRotateAPIKeyResponse,
112
- options: params[:request_options]
113
- )
114
- end
115
-
116
- # Requests GrowSurf-team verification of your account (required before a program can
117
- # email its participants). Idempotent — calling it again while a request is pending
118
- # does not create a duplicate. Returns the account with its updated
119
- # `verificationStatus`.
120
- #
121
- # @overload request_verification(request_options: {})
122
- #
123
- # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
124
- #
125
- # @return [GrowsurfRuby::Models::Account]
126
- def request_verification(params = {})
127
- @client.request(
128
- method: :post,
129
- path: "account/verification-request",
130
- model: GrowsurfRuby::Account,
131
- options: params[:request_options]
132
- )
133
- end
134
-
135
- # Resends the email-verification email to the account's email address. A `200`
136
- # with `status: SENT` is only returned when an email was actually dispatched.
137
- # Returns a `400` if the email is already verified, or a `429` if a verification
138
- # email was sent too recently — wait a moment, then retry.
139
- #
140
- # @overload resend_verification_email(request_options: {})
141
- #
142
- # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
143
- #
144
- # @return [GrowsurfRuby::Models::AccountResendVerificationEmailResponse]
145
- def resend_verification_email(params = {})
146
- @client.request(
147
- method: :post,
148
- path: "account/verification-email",
149
- model: GrowsurfRuby::Models::AccountResendVerificationEmailResponse,
150
- options: params[:request_options]
151
- )
152
- end
153
-
154
38
  # @api private
155
39
  #
156
40
  # @param client [GrowsurfRuby::Client]
@@ -584,8 +584,8 @@ module GrowsurfRuby
584
584
  # program's configured email templates, OR `subject` + `body` for a free-form email.
585
585
  # Free-form emails are sent with the same compliance handling (company name,
586
586
  # postal address, and an unsubscribe link are added automatically, and unsubscribed
587
- # participants are suppressed). Sending requires the account to be verified by the
588
- # GrowSurf team. Requires a verified custom email domain on the program (set up
587
+ # participants are suppressed). Sending requires the team to be verified by
588
+ # GrowSurf. Requires a verified custom email domain on the program (set up
589
589
  # in Campaign Editor > 3. Emails > Email Settings). Returns `400` until one is
590
590
  # verified.
591
591
  # The email is accepted for delivery.
@@ -76,8 +76,8 @@ module GrowsurfRuby
76
76
  )
77
77
  end
78
78
 
79
- # Creates a program. Only `type` is required; everything else is
80
- # server-defaulted. Editor-tab configuration (design, emails, options,
79
+ # Creates a program owned by the API key's bound team. Only `type` is required;
80
+ # everything else is server-defaulted. Editor-tab configuration (design, emails, options,
81
81
  # installation) is not accepted here — configure it via the config sub-resources
82
82
  # (e.g. `campaign.options.update`) after the program is created.
83
83
  #
@@ -0,0 +1,109 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GrowsurfRuby
4
+ module Resources
5
+ class Team
6
+ # Retrieves the team bound to the API key or OAuth connection. A credential that
7
+ # can act across multiple teams cannot use this operation because it has no single
8
+ # Team resource.
9
+ #
10
+ # @overload retrieve(request_options: {})
11
+ #
12
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
13
+ #
14
+ # @return [GrowsurfRuby::Models::Team]
15
+ def retrieve(params = {})
16
+ @client.request(
17
+ method: :get,
18
+ path: "team",
19
+ model: GrowsurfRuby::Models::Team,
20
+ options: params[:request_options]
21
+ )
22
+ end
23
+
24
+ # Updates the name of the team bound to the API key or OAuth connection. Any
25
+ # other property is rejected with a `400`.
26
+ #
27
+ # @overload update(name:, request_options: {})
28
+ #
29
+ # @param name [String] The team's display name.
30
+ #
31
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
32
+ #
33
+ # @return [GrowsurfRuby::Models::Team]
34
+ #
35
+ # @see GrowsurfRuby::Models::TeamUpdateParams
36
+ def update(params)
37
+ parsed, options = GrowsurfRuby::TeamUpdateParams.dump_request(params)
38
+ @client.request(
39
+ method: :patch,
40
+ path: "team",
41
+ body: parsed,
42
+ model: GrowsurfRuby::Models::Team,
43
+ options: options
44
+ )
45
+ end
46
+
47
+ # Generates a new API key and makes the key used on this request stop working
48
+ # when rotation succeeds. The SDK sends a retry-safe `Idempotency-Key`, so
49
+ # automatic retries return the same replacement. Store the new key, then update
50
+ # every integration that used the old key. This operation is unavailable through
51
+ # MCP.
52
+ #
53
+ # @overload rotate_api_key(request_options: {})
54
+ #
55
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
56
+ #
57
+ # @return [GrowsurfRuby::Models::TeamRotateAPIKeyResponse]
58
+ def rotate_api_key(params = {})
59
+ @client.request(
60
+ method: :post,
61
+ path: "api-key/rotate",
62
+ model: GrowsurfRuby::Models::TeamRotateAPIKeyResponse,
63
+ options: params[:request_options]
64
+ )
65
+ end
66
+
67
+ # Requests GrowSurf verification for the bound team. Calling this again while a
68
+ # request is pending does not create a duplicate.
69
+ #
70
+ # @overload request_verification(request_options: {})
71
+ #
72
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
73
+ #
74
+ # @return [GrowsurfRuby::Models::Team]
75
+ def request_verification(params = {})
76
+ @client.request(
77
+ method: :post,
78
+ path: "team/verification-request",
79
+ model: GrowsurfRuby::Models::Team,
80
+ options: params[:request_options]
81
+ )
82
+ end
83
+
84
+ # Resends the email-verification message to the bound team's owner. The response
85
+ # never reveals the owner's email address.
86
+ #
87
+ # @overload resend_owner_verification_email(request_options: {})
88
+ #
89
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
90
+ #
91
+ # @return [GrowsurfRuby::Models::TeamResendOwnerVerificationEmailResponse]
92
+ def resend_owner_verification_email(params = {})
93
+ @client.request(
94
+ method: :post,
95
+ path: "team/owner/verification-email",
96
+ model: GrowsurfRuby::Models::TeamResendOwnerVerificationEmailResponse,
97
+ options: params[:request_options]
98
+ )
99
+ end
100
+
101
+ # @api private
102
+ #
103
+ # @param client [GrowsurfRuby::Client]
104
+ def initialize(client:)
105
+ @client = client
106
+ end
107
+ end
108
+ end
109
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GrowsurfRuby
4
- VERSION = "1.1.2"
4
+ VERSION = "1.2.0"
5
5
  end
data/lib/growsurf_ruby.rb CHANGED
@@ -110,12 +110,12 @@ require_relative "growsurf_ruby/models/campaign/webhook_list_response"
110
110
  require_relative "growsurf_ruby/models/campaign/webhook_test_params"
111
111
  require_relative "growsurf_ruby/models/campaign/webhook_test_response"
112
112
  require_relative "growsurf_ruby/models/campaign/webhook_update_params"
113
- require_relative "growsurf_ruby/models/account"
114
113
  require_relative "growsurf_ruby/models/account_create_params"
115
114
  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"
115
+ require_relative "growsurf_ruby/models/team"
116
+ require_relative "growsurf_ruby/models/team_resend_owner_verification_email_response"
117
+ require_relative "growsurf_ruby/models/team_rotate_api_key_response"
118
+ require_relative "growsurf_ruby/models/team_update_params"
119
119
  require_relative "growsurf_ruby/models/campaign"
120
120
  require_relative "growsurf_ruby/models/campaign_create_mobile_participant_token_params"
121
121
  require_relative "growsurf_ruby/models/campaign_create_mobile_participant_token_response"
@@ -139,6 +139,7 @@ require_relative "growsurf_ruby/models/referral_list"
139
139
  require_relative "growsurf_ruby/models/reward_tax_valuation"
140
140
  require_relative "growsurf_ruby/models"
141
141
  require_relative "growsurf_ruby/resources/account"
142
+ require_relative "growsurf_ruby/resources/team"
142
143
  require_relative "growsurf_ruby/resources/campaign"
143
144
  require_relative "growsurf_ruby/resources/campaign/commission"
144
145
  require_relative "growsurf_ruby/resources/campaign/design"
@@ -11,12 +11,15 @@ module GrowsurfRuby
11
11
  DEFAULT_MAX_RETRY_DELAY = T.let(8.0, Float)
12
12
 
13
13
  # GrowSurf REST API key supplied as `Authorization: Bearer <api_key>`.
14
- sig { returns(String) }
14
+ sig { returns(T.nilable(String)) }
15
15
  attr_reader :api_key
16
16
 
17
17
  sig { returns(GrowsurfRuby::Resources::Account) }
18
18
  attr_reader :account
19
19
 
20
+ sig { returns(GrowsurfRuby::Resources::Team) }
21
+ attr_reader :team
22
+
20
23
  sig { returns(GrowsurfRuby::Resources::Campaign) }
21
24
  attr_reader :campaign
22
25
 
@@ -21,10 +21,6 @@ module GrowsurfRuby
21
21
  sig { returns(String) }
22
22
  attr_accessor :email
23
23
 
24
- # The new account's unique identifier.
25
- sig { returns(String) }
26
- attr_accessor :id
27
-
28
24
  # GrowSurf account verification state. `VERIFIED` is required before a program
29
25
  # can send participant emails.
30
26
  sig do
@@ -38,7 +34,6 @@ module GrowsurfRuby
38
34
  params(
39
35
  api_key: String,
40
36
  email: String,
41
- id: String,
42
37
  verification_status:
43
38
  GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus::OrSymbol
44
39
  ).returns(T.attached_class)
@@ -50,8 +45,6 @@ module GrowsurfRuby
50
45
  # dashboard.
51
46
  api_key:,
52
47
  email:,
53
- # The new account's unique identifier.
54
- id:,
55
48
  # GrowSurf account verification state. `VERIFIED` is required before a program
56
49
  # can send participant emails.
57
50
  verification_status:
@@ -63,7 +56,6 @@ module GrowsurfRuby
63
56
  {
64
57
  api_key: String,
65
58
  email: String,
66
- id: String,
67
59
  verification_status:
68
60
  GrowsurfRuby::Models::AccountCreateResponse::VerificationStatus::TaggedSymbol
69
61
  }