Class: Basecamp::Services::AccountService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/basecamp/generated/services/account_service.rb

Overview

Service for Account operations

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Basecamp::Services::BaseService

Instance Method Details

#get_accountHash

Get the account for the current access token

Returns:

  • (Hash)

    response data



12
13
14
15
16
# File 'lib/basecamp/generated/services/account_service.rb', line 12

def ()
  with_operation(service: "account", operation: "get_account", is_mutation: false) do
    http_get("/account.json").json
  end
end

#remove_account_logovoid

This method returns an undefined value.

Remove the account logo. Only administrators and account owners can use this endpoint.



32
33
34
35
36
37
# File 'lib/basecamp/generated/services/account_service.rb', line 32

def ()
  with_operation(service: "account", operation: "remove_account_logo", is_mutation: true) do
    http_delete("/account/logo.json")
    nil
  end
end

#update_account_logo(io:, filename:, content_type:) ⇒ void

This method returns an undefined value.

Upload or replace the account logo.

Parameters:

  • io (IO, String)

    File data to upload (IO object or string)

  • filename (String)

    Display name for the uploaded file

  • content_type (String)

    MIME type of the file (e.g., "image/png")



23
24
25
26
27
28
# File 'lib/basecamp/generated/services/account_service.rb', line 23

def (io:, filename:, content_type:)
  with_operation(service: "account", operation: "update_account_logo", is_mutation: true) do
    http_put_multipart("/account/logo.json", io: io, filename: filename, content_type: content_type, field: "logo")
    nil
  end
end

#update_account_name(name:) ⇒ Hash

Rename the current account. Only account owners can use this endpoint.

Parameters:

  • name (String)

    name

Returns:

  • (Hash)

    response data



42
43
44
45
46
# File 'lib/basecamp/generated/services/account_service.rb', line 42

def (name:)
  with_operation(service: "account", operation: "update_account_name", is_mutation: true) do
    http_put("/account/name.json", body: compact_params(name: name)).json
  end
end