API access.
Protected Properties | |
string string | $token |
string | $workspace = null |
Public Methods | |
__construct (string $token, Pool $pool=null) | |
null array | call (string $method, string $path, array $curlOpts=[]) |
cURL transport. More... | |
void | delete (string $path) |
HTTP DELETE More... | |
T | factory (string $class,... $args) |
The central point of object creation. More... | |
null array | get (string $path, array $query=[]) |
HTTP GET for data within a single result. More... | |
null Attachment | getAttachment (string $gid) |
Loads an Attachment. More... | |
null CustomField | getCustomField (string $gid) |
Loads a CustomField. More... | |
Generator< array > | getEach (string $path, array $query=[]) |
HTTP GET for multiple results, with auto-pagination. More... | |
null Job | getJob (string $gid) |
null LoggerInterface | getLog () |
User | getMe () |
null OrganizationExport | getOrganizationExport (string $gid) |
Pool | getPool () |
null Portfolio | getPortfolio (string $gid) |
Loads a Portfolio. More... | |
null Project | getProject (string $gid) |
Loads a Project. More... | |
null ProjectTemplate | getProjectTemplate (string $gid) |
null ProjectWebhook | getProjectWebhook (string $gid) |
null Section | getSection (string $gid) |
Loads a Section. More... | |
null Story | getStory (string $gid) |
Loads a Story. More... | |
null Tag | getTag (string $gid) |
Loads a Tag. More... | |
null Task | getTask (string $gid) |
Loads a Task. More... | |
null TaskList | getTaskList (string $gid) |
Loads a TaskList. More... | |
null TaskWebhook | getTaskWebhook (string $gid) |
null Team | getTeam (string $gid) |
Loads a Team. More... | |
null User | getUser (string $gid) |
Loads a User. More... | |
null User | getUserByEmail (string $email) |
Gets a user in the default workspace by email. More... | |
Event | getWebhookEvent (array $data) |
Expands received webhook data as a full event object. More... | |
null Workspace | getWorkspace (string $gid=null) |
Loads a Workspace. More... | |
null T | load ($caller, string $class, string $path, array $query=[]) |
Loads the entity found at the given path + query. More... | |
T[] | loadAll ($caller, string $class, string $path, array $query=[]) |
All results from loadEach(). More... | |
Generator< T > | loadEach ($caller, string $class, string $path, array $query=[]) |
Loads and yields each entity found at the given path + query. More... | |
null array | post (string $path, array $data=[], array $options=[]) |
HTTP POST More... | |
null array | put (string $path, array $data=[], array $options=[]) |
HTTP PUT More... | |
$this | setLog (?LoggerInterface $log) |
$this | setWorkspace (?string $gid) |
null array call | ( | string | $method, |
string | $path, | ||
array | $curlOpts = [] |
||
) |
cURL transport.
string | $method | |
string | $path | |
array | $curlOpts |
AsanaError |
void delete | ( | string | $path | ) |
HTTP DELETE
string | $path |
T factory | ( | string | $class, |
$args | |||
) |
The central point of object creation.
This can be overridden to return custom extensions.
@template T
class-string<T> | $class |
mixed | ...$args |
null array get | ( | string | $path, |
array | $query = [] |
||
) |
HTTP GET
for data
within a single result.
string | $path | |
array | $query |
null Attachment getAttachment | ( | string | $gid | ) |
null CustomField getCustomField | ( | string | $gid | ) |
Generator<array> getEach | ( | string | $path, |
array | $query = [] |
||
) |
HTTP GET
for multiple results, with auto-pagination.
string | $path | |
array | $query |
null Job getJob | ( | string | $gid | ) |
string | $gid |
null LoggerInterface getLog | ( | ) |
null OrganizationExport getOrganizationExport | ( | string | $gid | ) |
string | $gid |
null Portfolio getPortfolio | ( | string | $gid | ) |
null ProjectTemplate getProjectTemplate | ( | string | $gid | ) |
string | $gid |
null ProjectWebhook getProjectWebhook | ( | string | $gid | ) |
string | $gid |
null TaskList getTaskList | ( | string | $gid | ) |
null TaskWebhook getTaskWebhook | ( | string | $gid | ) |
string | $gid |
null User getUserByEmail | ( | string | ) |
Gets a user in the default workspace by email.
string |
Event getWebhookEvent | ( | array | $data | ) |
null Workspace getWorkspace | ( | string | $gid = null | ) |
Loads a Workspace.
null | string | $gid | Defaults to $workspace or the API user's first-known workspace. |
null T load | ( | $caller, | |
string | $class, | ||
string | $path, | ||
array | $query = [] |
||
) |
Loads the entity found at the given path + query.
@template T of AbstractEntity
Api | Data | $caller | |
class-string<T> | $class | |
string | $path | |
array | $query |
T [] loadAll | ( | $caller, | |
string | $class, | ||
string | $path, | ||
array | $query = [] |
||
) |
All results from loadEach().
@template T of AbstractEntity
Api | Data | $caller | |
class-string<T> | $class | |
string | $path | |
array | $query |
Generator<T> loadEach | ( | $caller, | |
string | $class, | ||
string | $path, | ||
array | $query = [] |
||
) |
Loads and yields each entity found at the given path + query.
The result-set is not pooled, but individual entities are.
@template T of AbstractEntity
Api | Data | $caller | |
class-string<T> | $class | |
string | $path | |
array | $query | limit can exceed 100 here. |
null array post | ( | string | $path, |
array | $data = [] , |
||
array | $options = [] |
||
) |
HTTP POST
string | $path | |
array | $data | |
array | $options |
null array put | ( | string | $path, |
array | $data = [] , |
||
array | $options = [] |
||
) |
HTTP PUT
string | $path | |
array | $data | |
array | $options |
|
final |
null | LoggerInterface | $log |
|
final |
null | string | $gid |