From 6c0797f5b6acc5390861f673f048be8cdb9f0b5a Mon Sep 17 00:00:00 2001 From: John Vu Date: Fri, 4 Mar 2022 14:31:56 -0800 Subject: [PATCH] Generated from OpenAPI --- VERSION | 2 +- samples/ProjectTemplatesSample.yaml | 41 ++++++++++++ samples/ProjectsSample.yaml | 10 +++ .../Resources/Gen/ProjectTemplatesBase.php | 64 +++++++++++++++++++ src/Asana/Resources/Gen/ProjectsBase.php | 13 ++++ 5 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 samples/ProjectTemplatesSample.yaml create mode 100644 src/Asana/Resources/Gen/ProjectTemplatesBase.php diff --git a/VERSION b/VERSION index a988815..933f18d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.10.7 \ No newline at end of file +0.10.8 \ No newline at end of file diff --git a/samples/ProjectTemplatesSample.yaml b/samples/ProjectTemplatesSample.yaml new file mode 100644 index 0000000..7ddf947 --- /dev/null +++ b/samples/ProjectTemplatesSample.yaml @@ -0,0 +1,41 @@ +projecttemplates: + getProjectTemplate: >- + projecttemplates->getProjectTemplate($project_template_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true')) + getProjectTemplates: >- + projecttemplates->getProjectTemplates(array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true')) + getProjectTemplatesForTeam: >- + projecttemplates->getProjectTemplatesForTeam($team_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true')) + instantiateProject: >- + projecttemplates->instantiateProject($project_template_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true')) diff --git a/samples/ProjectsSample.yaml b/samples/ProjectsSample.yaml index a3d10ce..e736a11 100644 --- a/samples/ProjectsSample.yaml +++ b/samples/ProjectsSample.yaml @@ -139,6 +139,16 @@ projects: $result = $client->projects->getTaskCountsForProject($project_gid, array('param' => 'value', 'param' => 'value'), array('opt_pretty' => 'true')) + projectSaveAsTemplate: >- + projects->projectSaveAsTemplate($project_gid, array('field' => 'value', 'field' => 'value'), array('opt_pretty' => 'true')) removeCustomFieldSettingForProject: >- 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); + } +} diff --git a/src/Asana/Resources/Gen/ProjectsBase.php b/src/Asana/Resources/Gen/ProjectsBase.php index 2b5063c..bc6bf2d 100644 --- a/src/Asana/Resources/Gen/ProjectsBase.php +++ b/src/Asana/Resources/Gen/ProjectsBase.php @@ -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.