protected function modifySeatsRequest()

in lib/Api/InteractiveApi.php [1157:1221]


    protected function modifySeatsRequest($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 modifySeats'
            );
        }
        // verify the required parameter 'operator' is set
        if ($varForms['operator'] === null || (is_array($varForms['operator']) && count($varForms['operator']) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $varForms[\'operator\'] when calling modifySeats'
            );
        }
        // verify the required parameter 'modify_seats' is set
        if ($varForms['modify_seats'] === null || (is_array($varForms['modify_seats']) && count($varForms['modify_seats']) === 0)) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $varForms[\'modify_seats\'] when calling modifySeats'
            );
        }

        $resourcePath = '/interactive/modifySeats';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';

        // form params
        $formParams['partyId'] = ObjectSerializer::toFormValue($varForms['party_id']);
        $formParams['operator'] = ObjectSerializer::toFormValue($varForms['operator']);
        $formParams['modifySeats'] = ObjectSerializer::toFormValue($varForms['modify_seats']);

        $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
        );
    }