Class: GrowsurfRuby::Resources::Team
- Inherits:
-
Object
- Object
- GrowsurfRuby::Resources::Team
- Defined in:
- lib/growsurf_ruby/resources/team.rb,
sig/growsurf_ruby/resources/team.rbs
Instance Method Summary collapse
-
#initialize(client:) ⇒ Team
constructor
private
A new instance of Team.
-
#request_verification(request_options: {}) ⇒ GrowsurfRuby::Models::Team
Requests GrowSurf to verify the bound team (required before a program can email its participants).
-
#resend_owner_verification_email(request_options: {}) ⇒ GrowsurfRuby::Models::TeamResendOwnerVerificationEmailResponse
Resends the email-verification message to the bound team's owner.
-
#retrieve(request_options: {}) ⇒ GrowsurfRuby::Models::Team
Retrieves the team bound to the API key or OAuth connection.
-
#rotate_api_key(request_options: {}) ⇒ GrowsurfRuby::Models::TeamRotateAPIKeyResponse
Generates a new API key and makes the key used on this request stop working when rotation succeeds.
-
#update(name:, request_options: {}) ⇒ GrowsurfRuby::Models::Team
Updates the name of the team bound to the API key or OAuth connection.
Constructor Details
#initialize(client:) ⇒ Team
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Team.
113 114 115 |
# File 'lib/growsurf_ruby/resources/team.rb', line 113 def initialize(client:) @client = client end |
Instance Method Details
#request_verification(request_options: {}) ⇒ GrowsurfRuby::Models::Team
Requests GrowSurf to verify the bound team (required before a program can email
its participants). Idempotent — calling it again while a request is pending does
not create a duplicate. Returns the team with its updated verificationStatus.
81 82 83 84 85 86 87 88 |
# File 'lib/growsurf_ruby/resources/team.rb', line 81 def request_verification(params = {}) @client.request( method: :post, path: "team/verification-request", model: GrowsurfRuby::Models::Team, options: params[:request_options] ) end |
#resend_owner_verification_email(request_options: {}) ⇒ GrowsurfRuby::Models::TeamResendOwnerVerificationEmailResponse
Resends the email-verification message to the bound team's owner. The response
never reveals the owner's email address. A 200 with status: SENT is returned
only when an email was actually dispatched. Returns 400 if the email is
already verified, and 429 if a verification email was sent too recently — wait
a moment, then retry.
101 102 103 104 105 106 107 108 |
# File 'lib/growsurf_ruby/resources/team.rb', line 101 def resend_owner_verification_email(params = {}) @client.request( method: :post, path: "team/owner/verification-email", model: GrowsurfRuby::Models::TeamResendOwnerVerificationEmailResponse, options: params[:request_options] ) end |
#retrieve(request_options: {}) ⇒ GrowsurfRuby::Models::Team
Retrieves the team bound to the API key or OAuth connection.
verificationStatus is VERIFIED once GrowSurf has verified the team, which is
required before a program can send participant emails.
15 16 17 18 19 20 21 22 |
# File 'lib/growsurf_ruby/resources/team.rb', line 15 def retrieve(params = {}) @client.request( method: :get, path: "team", model: GrowsurfRuby::Models::Team, options: params[:request_options] ) end |
#rotate_api_key(request_options: {}) ⇒ GrowsurfRuby::Models::TeamRotateAPIKeyResponse
Generates a new API key and makes the key used on this request stop working when
rotation succeeds. Send a unique, random Idempotency-Key. If the response is
interrupted, immediately retry with the original API key and the same
Idempotency-Key to receive the same new key. Update every integration that
used the old key. The team owner is notified by email whenever the key is
rotated. GrowSurf SDKs generate the idempotency key automatically. This endpoint
accepts an API key with api_key:rotate. If this scope is unavailable, rotate
the key in the authenticated dashboard instead. This operation is available only
through the REST API or a GrowSurf API SDK, not through MCP.
63 64 65 66 67 68 69 70 |
# File 'lib/growsurf_ruby/resources/team.rb', line 63 def rotate_api_key(params = {}) @client.request( method: :post, path: "api-key/rotate", model: GrowsurfRuby::Models::TeamRotateAPIKeyResponse, options: params[:request_options] ) end |
#update(name:, request_options: {}) ⇒ GrowsurfRuby::Models::Team
Updates the name of the team bound to the API key or OAuth connection. Any other
property is rejected with a 400. Personal profiles, billing, and team
ownership are not editable here.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/growsurf_ruby/resources/team.rb', line 37 def update(params) parsed, = GrowsurfRuby::TeamUpdateParams.dump_request(params) @client.request( method: :patch, path: "team", body: parsed, model: GrowsurfRuby::Models::Team, options: ) end |