Skip to content

Commit

Permalink
Merge pull request #109 from Asana/openapi-sync
Browse files Browse the repository at this point in the history
Add memberships endpoints
  • Loading branch information
jv-asana authored Mar 3, 2023
2 parents 60713e3 + 984381d commit e04d3a0
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
41 changes: 41 additions & 0 deletions samples/MembershipsSample.yaml
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'))
62 changes: 62 additions & 0 deletions src/Asana/Resources/Gen/MembershipsBase.php
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);
}
}
9 changes: 9 additions & 0 deletions src/Asana/Resources/Memberships.php
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
{
}

0 comments on commit e04d3a0

Please sign in to comment.