in lib/Api/DispatchApi.php [239:312]
protected function batchStopGameRequest($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 batchStopGame'
);
}
// verify the required parameter 'app_key' is set
if ($varForms['app_key'] === null || (is_array($varForms['app_key']) && count($varForms['app_key']) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $varForms[\'app_key\'] when calling batchStopGame'
);
}
// verify the required parameter 'token' is set
if ($varForms['token'] === null || (is_array($varForms['token']) && count($varForms['token']) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $varForms[\'token\'] when calling batchStopGame'
);
}
$resourcePath = '/batchStopGame';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
// form params
$formParams['gameId'] = ObjectSerializer::toFormValue($varForms['game_id']);
$formParams['appKey'] = ObjectSerializer::toFormValue($varForms['app_key']);
$formParams['token'] = ObjectSerializer::toFormValue($varForms['token']);
if ($varForms['reason'] !== null) {
$formParams['reason'] = ObjectSerializer::toFormValue($varForms['reason']);
}
if ($varForms['track_info'] !== null) {
$formParams['trackInfo'] = ObjectSerializer::toFormValue($varForms['track_info']);
}
if ($varForms['tags'] !== null) {
$formParams['tags'] = ObjectSerializer::toFormValue($varForms['tags']);
}
$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
);
}