Class: Fopost::Resources::Accounts
- Defined in:
- lib/fopost/resources/accounts.rb
Overview
client.accounts — the social accounts connected to a workspace.
Instance Method Summary collapse
- #get(account_id) ⇒ Object
-
#health(account_id) ⇒ Object
Token validity and last-check detail for one account.
-
#list(workspace_id: nil) ⇒ Object
Connected accounts, across every workspace unless one is named.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Fopost::Resources::Base
Instance Method Details
#get(account_id) ⇒ Object
13 14 15 |
# File 'lib/fopost/resources/accounts.rb', line 13 def get(account_id) SocialAccount.new(unwrap(http.get("/accounts/#{account_id}"))) end |
#health(account_id) ⇒ Object
Token validity and last-check detail for one account.
18 19 20 |
# File 'lib/fopost/resources/accounts.rb', line 18 def health(account_id) as_hash(unwrap(http.get("/accounts/#{account_id}/health"))) end |
#list(workspace_id: nil) ⇒ Object
Connected accounts, across every workspace unless one is named.
8 9 10 11 |
# File 'lib/fopost/resources/accounts.rb', line 8 def list(workspace_id: nil) # This endpoint reads a camelCase query param; posts and labels use snake. parse_list(SocialAccount, unwrap(http.get('/accounts', { 'workspaceId' => workspace_id }))) end |