Class: GrowsurfRuby::Resources::Account
- Inherits:
-
Object
- Object
- GrowsurfRuby::Resources::Account
- Defined in:
- lib/growsurf_ruby/resources/account.rb,
sig/growsurf_ruby/resources/account.rbs
Instance Method Summary collapse
-
#create(email:, company: nil, first_name: nil, last_name: nil, request_options: {}) ⇒ GrowsurfRuby::Models::AccountCreateResponse
Creates a new GrowSurf account and returns an API key shown once in the response.
-
#initialize(client:) ⇒ Account
constructor
private
A new instance of Account.
Constructor Details
#initialize(client:) ⇒ Account
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 Account.
41 42 43 |
# File 'lib/growsurf_ruby/resources/account.rb', line 41 def initialize(client:) @client = client end |
Instance Method Details
#create(email:, company: nil, first_name: nil, last_name: nil, request_options: {}) ⇒ GrowsurfRuby::Models::AccountCreateResponse
Creates a new GrowSurf account and returns an API key shown once in the response. The key is locked until the team owner's email address is verified and rotates the first time the account owner signs in to the GrowSurf dashboard. Accounts whose email is never verified are deleted automatically after 7 days.
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/growsurf_ruby/resources/account.rb', line 26 def create(params) parsed, = GrowsurfRuby::AccountCreateParams.dump_request(params) [:extra_headers] = [:extra_headers].to_h.merge("authorization" => nil) @client.request( method: :post, path: "accounts", body: parsed, model: GrowsurfRuby::Models::AccountCreateResponse, options: ) end |