in lib/Api/ConsoleAdminApi.php [4818:4896]
protected function submitDeploymentRequest($varForms)
{
// verify the required parameter 'game_id' is set
if ($varForms['game_id'] === null || (is_array($varForms['game_id']) && count($varForms['game_id']) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $varForms[\'game_id\'] when calling submitDeployment'
);
}
// verify the required parameter 'project_id' is set
if ($varForms['project_id'] === null || (is_array($varForms['project_id']) && count($varForms['project_id']) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $varForms[\'project_id\'] when calling submitDeployment'
);
}
// verify the required parameter 'version_id' is set
if ($varForms['version_id'] === null || (is_array($varForms['version_id']) && count($varForms['version_id']) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $varForms[\'version_id\'] when calling submitDeployment'
);
}
// verify the required parameter 'cloud_game_instance_ids' is set
if ($varForms['cloud_game_instance_ids'] === null || (is_array($varForms['cloud_game_instance_ids']) && count($varForms['cloud_game_instance_ids']) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $varForms[\'cloud_game_instance_ids\'] when calling submitDeployment'
);
}
// verify the required parameter 'operation_type' is set
if ($varForms['operation_type'] === null || (is_array($varForms['operation_type']) && count($varForms['operation_type']) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $varForms[\'operation_type\'] when calling submitDeployment'
);
}
$resourcePath = '/consoleAdmin/submitDeployment';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
// form params
$formParams['gameId'] = ObjectSerializer::toFormValue($varForms['game_id']);
$formParams['projectId'] = ObjectSerializer::toFormValue($varForms['project_id']);
$formParams['versionId'] = ObjectSerializer::toFormValue($varForms['version_id']);
$formParams['cloudGameInstanceIds'] = ObjectSerializer::toFormValue($varForms['cloud_game_instance_ids']);
$formParams['operationType'] = ObjectSerializer::toFormValue($varForms['operation_type']);
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/x-www-form-urlencoded']
);
// for model (json/xml)
if (count($formParams) > 0) {
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
$signHeaders = $this->headerSelector->prepareSignHeader($formParams, $queryParams, 'POST', $this->config);
$headers = array_merge(
['User-Agent' => 'cgw-client/1.0.0/php'],
$signHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'POST',
$this->config->getScheme() . '://' . $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
}