Class: Fopost::Resources::Accounts

Inherits:
Base
  • Object
show all
Defined in:
lib/fopost/resources/accounts.rb

Overview

client.accounts — the social accounts connected to a workspace.

Instance Method Summary collapse

Methods inherited from Base

#initialize

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()
  SocialAccount.new(unwrap(http.get("/accounts/#{}")))
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()
  as_hash(unwrap(http.get("/accounts/#{}/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