From ba195d14131ed68585e6ae52d6ad1e261f92f4fc Mon Sep 17 00:00:00 2001 From: morita Date: Tue, 24 Mar 2020 14:43:32 +0900 Subject: [PATCH] fix createFolderAPI(postFolder) unset project_id of URI --- docs/Api/FoldersApi.md | 5 +++-- lib/Api/FoldersApi.php | 19 ++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/docs/Api/FoldersApi.md b/docs/Api/FoldersApi.md index dba95e8..f5808b9 100644 --- a/docs/Api/FoldersApi.md +++ b/docs/Api/FoldersApi.md @@ -275,7 +275,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) # **postFolder** -> postFolder($body) +> postFolder($project_id, $body) @@ -290,7 +290,7 @@ $apiInstance = new Autodesk\Forge\Client\Api\FoldersApi($authObject); $body = new \Autodesk\Forge\Client\Model\CreateFolder(); // \Autodesk\Forge\Client\Model\CreateFolder | describe the folder to be created try { - $apiInstance->postFolder($body); + $apiInstance->postFolder($project_id, $body); } catch (Exception $e) { echo 'Exception when calling FoldersApi->postFolder: ', $e->getMessage(), PHP_EOL; } @@ -301,6 +301,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **project_id** | **string**| the `project id` | **body** | [**\Autodesk\Forge\Client\Model\CreateFolder**](../Model/\Autodesk\Forge\Client\Model\CreateFolder.md)| describe the folder to be created | ### Return type diff --git a/lib/Api/FoldersApi.php b/lib/Api/FoldersApi.php index 818e6bb..e44e853 100644 --- a/lib/Api/FoldersApi.php +++ b/lib/Api/FoldersApi.php @@ -732,9 +732,9 @@ public function getFolderRelationshipsRefsWithHttpInfo($project_id, $folder_id, * @throws \Autodesk\Forge\Client\ApiException on non-2xx response * @return void */ - public function postFolder($body) + public function postFolder($project_id, $body) { - list($response) = $this->postFolderWithHttpInfo($body); + list($response) = $this->postFolderWithHttpInfo($project_id, $body); return $response; } @@ -747,8 +747,12 @@ public function postFolder($body) * @throws \Autodesk\Forge\Client\ApiException on non-2xx response * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function postFolderWithHttpInfo($body) + public function postFolderWithHttpInfo($project_id, $body) { + // verify the required parameter 'project_id' is set + if ($project_id === null) { + throw new \InvalidArgumentException('Missing the required parameter $project_id when calling postFolder'); + } // verify the required parameter 'body' is set if ($body === null) { throw new \InvalidArgumentException('Missing the required parameter $body when calling postFolder'); @@ -765,6 +769,15 @@ public function postFolderWithHttpInfo($body) } $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/vnd.api+json']); + // path params + if ($project_id !== null) { + $resourcePath = str_replace( + "{" . "project_id" . "}", + $this->apiClient->getSerializer()->toPathValue($project_id), + $resourcePath + ); + } + // default format to json $resourcePath = str_replace("{format}", "json", $resourcePath);