Class: GrowsurfRuby::Resources::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/growsurf_ruby/resources/account.rb,
sig/growsurf_ruby/resources/account.rbs

Instance Method Summary collapse

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.

Parameters:



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.

Parameters:

  • email (String)

    The email address for the new GrowSurf account. Personal emails and disposable email addresses are not accepted.

  • company (String)

    Company name for the new account.

  • first_name (String)

    First name for the new account owner.

  • last_name (String)

    Last name for the new account owner.

  • request_options (GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/growsurf_ruby/resources/account.rb', line 26

def create(params)
  parsed, options = GrowsurfRuby::AccountCreateParams.dump_request(params)
  options[:extra_headers] = options[:extra_headers].to_h.merge("authorization" => nil)
  @client.request(
    method: :post,
    path: "accounts",
    body: parsed,
    model: GrowsurfRuby::Models::AccountCreateResponse,
    options: options
  )
end