Skip to content

Commit

Permalink
Merge pull request #86 from Asana/openapi-sync
Browse files Browse the repository at this point in the history
Generated from OpenAPI
  • Loading branch information
jv-asana authored Mar 4, 2022
2 parents f088e2e + 6c0797f commit 1aeaf3a
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.7
0.10.8
41 changes: 41 additions & 0 deletions samples/ProjectTemplatesSample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
projecttemplates:
getProjectTemplate: >-
<?php
require 'php-asana/vendor/autoload.php';
$client = Asana\Client::accessToken('PERSONAL_ACCESS_TOKEN');
$result = $client->projecttemplates->getProjectTemplate($project_template_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))
getProjectTemplates: >-
<?php
require 'php-asana/vendor/autoload.php';
$client = Asana\Client::accessToken('PERSONAL_ACCESS_TOKEN');
$result = $client->projecttemplates->getProjectTemplates(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))
getProjectTemplatesForTeam: >-
<?php
require 'php-asana/vendor/autoload.php';
$client = Asana\Client::accessToken('PERSONAL_ACCESS_TOKEN');
$result = $client->projecttemplates->getProjectTemplatesForTeam($team_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))
instantiateProject: >-
<?php
require 'php-asana/vendor/autoload.php';
$client = Asana\Client::accessToken('PERSONAL_ACCESS_TOKEN');
$result = $client->projecttemplates->instantiateProject($project_template_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))
10 changes: 10 additions & 0 deletions samples/ProjectsSample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ projects:
$result = $client->projects->getTaskCountsForProject($project_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true'))
projectSaveAsTemplate: >-
<?php
require 'php-asana/vendor/autoload.php';
$client = Asana\Client::accessToken('PERSONAL_ACCESS_TOKEN');
$result = $client->projects->projectSaveAsTemplate($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true'))
removeCustomFieldSettingForProject: >-
<?php
Expand Down
64 changes: 64 additions & 0 deletions src/Asana/Resources/Gen/ProjectTemplatesBase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

namespace Asana\Resources\Gen;

class ProjectTemplatesBase {

/**
* @param Asana/Client client The client instance
*/
public function __construct($client)
{
$this->client = $client;
}

/** Get a project template
*
* @param string $project_template_gid (required) Globally unique identifier for the project template.
* @param array $params
* @param array $options
* @return response
*/
public function getProjectTemplate($project_template_gid, $params = array(), $options = array()) {
$path = "/project_templates/{project_template_gid}";
$path = str_replace("{project_template_gid}", $project_template_gid, $path);
return $this->client->get($path, $params, $options);
}

/** Get multiple project templates
*
* @param array $params
* @param array $options
* @return response
*/
public function getProjectTemplates($params = array(), $options = array()) {
$path = "/project_templates";
return $this->client->getCollection($path, $params, $options);
}

/** Get a team's project templates
*
* @param string $team_gid (required) Globally unique identifier for the team.
* @param array $params
* @param array $options
* @return response
*/
public function getProjectTemplatesForTeam($team_gid, $params = array(), $options = array()) {
$path = "/teams/{team_gid}/project_templates";
$path = str_replace("{team_gid}", $team_gid, $path);
return $this->client->getCollection($path, $params, $options);
}

/** Instantiate a project from a project template
*
* @param string $project_template_gid (required) Globally unique identifier for the project template.
* @param array $params
* @param array $options
* @return response
*/
public function instantiateProject($project_template_gid, $params = array(), $options = array()) {
$path = "/project_templates/{project_template_gid}/instantiateProject";
$path = str_replace("{project_template_gid}", $project_template_gid, $path);
return $this->client->post($path, $params, $options);
}
}
13 changes: 13 additions & 0 deletions src/Asana/Resources/Gen/ProjectsBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,19 @@ public function getTaskCountsForProject($project_gid, $params = array(), $option
return $this->client->get($path, $params, $options);
}

/** Create a project template from a project
*
* @param string $project_gid (required) Globally unique identifier for the project.
* @param array $params
* @param array $options
* @return response
*/
public function projectSaveAsTemplate($project_gid, $params = array(), $options = array()) {
$path = "/projects/{project_gid}/saveAsTemplate";
$path = str_replace("{project_gid}", $project_gid, $path);
return $this->client->post($path, $params, $options);
}

/** Remove a custom field from a project
*
* @param string $project_gid (required) Globally unique identifier for the project.
Expand Down

0 comments on commit 1aeaf3a

Please sign in to comment.