in lib/Api/InteractiveApi.php [933:993]
protected function kickOutUserRequest($varForms)
{
// verify the required parameter 'party_id' is set
if ($varForms['party_id'] === null || (is_array($varForms['party_id']) && count($varForms['party_id']) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $varForms[\'party_id\'] when calling kickOutUser'
);
}
// verify the required parameter 'user_id' is set
if ($varForms['user_id'] === null || (is_array($varForms['user_id']) && count($varForms['user_id']) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $varForms[\'user_id\'] when calling kickOutUser'
);
}
$resourcePath = '/interactive/kickOutUser';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
// form params
$formParams['partyId'] = ObjectSerializer::toFormValue($varForms['party_id']);
$formParams['userId'] = ObjectSerializer::toFormValue($varForms['user_id']);
if ($varForms['kick_out_reason'] !== null) {
$formParams['kickOutReason'] = ObjectSerializer::toFormValue($varForms['kick_out_reason']);
}
$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
);
}