Skip to content

Commit

Permalink
Simplify code generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Aug 25, 2024
1 parent fa48e26 commit 901ae10
Show file tree
Hide file tree
Showing 24 changed files with 1,689 additions and 4,754 deletions.
696 changes: 197 additions & 499 deletions lib/Api/AppsApi.php

Large diffs are not rendered by default.

470 changes: 138 additions & 332 deletions lib/Api/AssetsApi.php

Large diffs are not rendered by default.

110 changes: 44 additions & 66 deletions lib/Api/BackupsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,23 +368,15 @@ function ($exception) {
public function getBackupContentRequest($id, string $contentType = self::contentTypes['getBackupContent'][0])
{

// verify the required parameter 'app' is set
$app = $this->config->getAppName();
if ($app === null || (is_array($app) && count($app) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $app when calling '
);
}

// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $id when calling '
'Missing the required parameter $id when calling backupContentGetBackupContent'
);
}


$resourcePath = '/api/apps/{app}/backups/{id}';
$resourcePath = '/api/apps/$app$/backups/{id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
Expand All @@ -393,14 +385,6 @@ public function getBackupContentRequest($id, string $contentType = self::content



// path params
if ($app !== null) {
$resourcePath = str_replace(
'{' . 'app' . '}',
ObjectSerializer::toPathValue($app),
$resourcePath
);
}
// path params
if ($id !== null) {
$resourcePath = str_replace(
Expand All @@ -409,6 +393,12 @@ public function getBackupContentRequest($id, string $contentType = self::content
$resourcePath
);
}
$app = $this->config->getAppName();
$resourcePath = str_replace(
'$app$',
ObjectSerializer::toPathValue($app),
$resourcePath
);


$headers = $this->headerSelector->selectHeaders(
Expand Down Expand Up @@ -708,7 +698,7 @@ public function getBackupContentV2Request($id, $app_id = null, $app = '', string
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $id when calling '
'Missing the required parameter $id when calling backupContentGetBackupContentV2'
);
}

Expand Down Expand Up @@ -750,6 +740,12 @@ public function getBackupContentV2Request($id, $app_id = null, $app = '', string
$resourcePath
);
}
$app = $this->config->getAppName();
$resourcePath = str_replace(
'$app$',
ObjectSerializer::toPathValue($app),
$resourcePath
);


$headers = $this->headerSelector->selectHeaders(
Expand Down Expand Up @@ -975,23 +971,15 @@ function ($exception) {
public function deleteBackupRequest($id, string $contentType = self::contentTypes['deleteBackup'][0])
{

// verify the required parameter 'app' is set
$app = $this->config->getAppName();
if ($app === null || (is_array($app) && count($app) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $app when calling '
);
}

// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $id when calling '
'Missing the required parameter $id when calling backupsDeleteBackup'
);
}


$resourcePath = '/api/apps/{app}/backups/{id}';
$resourcePath = '/api/apps/$app$/backups/{id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
Expand All @@ -1000,14 +988,6 @@ public function deleteBackupRequest($id, string $contentType = self::contentType



// path params
if ($app !== null) {
$resourcePath = str_replace(
'{' . 'app' . '}',
ObjectSerializer::toPathValue($app),
$resourcePath
);
}
// path params
if ($id !== null) {
$resourcePath = str_replace(
Expand All @@ -1016,6 +996,12 @@ public function deleteBackupRequest($id, string $contentType = self::contentType
$resourcePath
);
}
$app = $this->config->getAppName();
$resourcePath = str_replace(
'$app$',
ObjectSerializer::toPathValue($app),
$resourcePath
);


$headers = $this->headerSelector->selectHeaders(
Expand Down Expand Up @@ -1297,16 +1283,8 @@ function ($exception) {
public function getBackupsRequest(string $contentType = self::contentTypes['getBackups'][0])
{

// verify the required parameter 'app' is set
$app = $this->config->getAppName();
if ($app === null || (is_array($app) && count($app) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $app when calling '
);
}


$resourcePath = '/api/apps/{app}/backups';
$resourcePath = '/api/apps/$app$/backups';
$formParams = [];
$queryParams = [];
$headerParams = [];
Expand All @@ -1315,14 +1293,12 @@ public function getBackupsRequest(string $contentType = self::contentTypes['getB



// path params
if ($app !== null) {
$resourcePath = str_replace(
'{' . 'app' . '}',
$app = $this->config->getAppName();
$resourcePath = str_replace(
'$app$',
ObjectSerializer::toPathValue($app),
$resourcePath
);
}


$headers = $this->headerSelector->selectHeaders(
Expand Down Expand Up @@ -1538,16 +1514,8 @@ function ($exception) {
public function postBackupRequest(string $contentType = self::contentTypes['postBackup'][0])
{

// verify the required parameter 'app' is set
$app = $this->config->getAppName();
if ($app === null || (is_array($app) && count($app) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $app when calling '
);
}


$resourcePath = '/api/apps/{app}/backups';
$resourcePath = '/api/apps/$app$/backups';
$formParams = [];
$queryParams = [];
$headerParams = [];
Expand All @@ -1556,14 +1524,12 @@ public function postBackupRequest(string $contentType = self::contentTypes['post



// path params
if ($app !== null) {
$resourcePath = str_replace(
'{' . 'app' . '}',
$app = $this->config->getAppName();
$resourcePath = str_replace(
'$app$',
ObjectSerializer::toPathValue($app),
$resourcePath
);
}


$headers = $this->headerSelector->selectHeaders(
Expand Down Expand Up @@ -1850,6 +1816,12 @@ public function getRestoreJobRequest(string $contentType = self::contentTypes['g



$app = $this->config->getAppName();
$resourcePath = str_replace(
'$app$',
ObjectSerializer::toPathValue($app),
$resourcePath
);


$headers = $this->headerSelector->selectHeaders(
Expand Down Expand Up @@ -2073,7 +2045,7 @@ public function postRestoreJobRequest($restore_request_dto, string $contentType
// verify the required parameter 'restore_request_dto' is set
if ($restore_request_dto === null || (is_array($restore_request_dto) && count($restore_request_dto) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $restore_request_dto when calling '
'Missing the required parameter $restore_request_dto when calling restorePostRestoreJob'
);
}

Expand All @@ -2087,6 +2059,12 @@ public function postRestoreJobRequest($restore_request_dto, string $contentType



$app = $this->config->getAppName();
$resourcePath = str_replace(
'$app$',
ObjectSerializer::toPathValue($app),
$resourcePath
);


$headers = $this->headerSelector->selectHeaders(
Expand Down
Loading

0 comments on commit 901ae10

Please sign in to comment.