-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from Asana/openapi-sync
Add memberships endpoints
- Loading branch information
Showing
3 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
memberships: | ||
createMembership: >- | ||
<?php | ||
require 'php-asana/vendor/autoload.php'; | ||
$client = Asana\Client::accessToken('PERSONAL_ACCESS_TOKEN'); | ||
$result = $client->memberships->createMembership(array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true')) | ||
deleteMembership: >- | ||
<?php | ||
require 'php-asana/vendor/autoload.php'; | ||
$client = Asana\Client::accessToken('PERSONAL_ACCESS_TOKEN'); | ||
$result = $client->memberships->deleteMembership($membership_gid, array('opt_pretty' => 'true')) | ||
getMemberships: >- | ||
<?php | ||
require 'php-asana/vendor/autoload.php'; | ||
$client = Asana\Client::accessToken('PERSONAL_ACCESS_TOKEN'); | ||
$result = $client->memberships->getMemberships(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true')) | ||
updateMembership: >- | ||
<?php | ||
require 'php-asana/vendor/autoload.php'; | ||
$client = Asana\Client::accessToken('PERSONAL_ACCESS_TOKEN'); | ||
$result = $client->memberships->updateMembership($membership_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
namespace Asana\Resources\Gen; | ||
|
||
class MembershipsBase { | ||
|
||
/** | ||
* @param Asana/Client client The client instance | ||
*/ | ||
public function __construct($client) | ||
{ | ||
$this->client = $client; | ||
} | ||
|
||
/** Create a membership | ||
* | ||
* @param array $params | ||
* @param array $options | ||
* @return response | ||
*/ | ||
public function createMembership($params = array(), $options = array()) { | ||
$path = "/memberships"; | ||
return $this->client->post($path, $params, $options); | ||
} | ||
|
||
/** Delete a membership | ||
* | ||
* @param string $membership_gid (required) Globally unique identifier for the membership. | ||
* @param array $params | ||
* @param array $options | ||
* @return response | ||
*/ | ||
public function deleteMembership($membership_gid, $params = array(), $options = array()) { | ||
$path = "/memberships/{membership_gid}"; | ||
$path = str_replace("{membership_gid}", $membership_gid, $path); | ||
return $this->client->delete($path, $params, $options); | ||
} | ||
|
||
/** Get multiple memberships | ||
* | ||
* @param array $params | ||
* @param array $options | ||
* @return response | ||
*/ | ||
public function getMemberships($params = array(), $options = array()) { | ||
$path = "/memberships"; | ||
return $this->client->getCollection($path, $params, $options); | ||
} | ||
|
||
/** Update a membership | ||
* | ||
* @param string $membership_gid (required) Globally unique identifier for the membership. | ||
* @param array $params | ||
* @param array $options | ||
* @return response | ||
*/ | ||
public function updateMembership($membership_gid, $params = array(), $options = array()) { | ||
$path = "/memberships/{membership_gid}"; | ||
$path = str_replace("{membership_gid}", $membership_gid, $path); | ||
return $this->client->put($path, $params, $options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace Asana\Resources; | ||
|
||
use Asana\Resources\Gen\MembershipsBase; | ||
|
||
class Memberships extends MembershipsBase | ||
{ | ||
} |