apiClient = $apiClient; } {{#operation}} /** * {{{nickname}}} * * {{{summary}}} * {{#allParams}} * @param {{dataType}} ${{paramName}} {{description}} {{^optional}}(required){{/optional}}{{#optional}}(optional){{/optional}} {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} */ public function {{nickname}}({{#allParams}}${{paramName}}{{#optional}}=null{{/optional}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { // parse inputs $resourcePath = "{{path}}"; $resourcePath = str_replace("{format}", "json", $resourcePath); $method = "{{httpMethod}}"; $httpBody = ''; $queryParams = array(); $headerParams = array(); $formParams = array(); $_header_accept = '{{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}'; if ($_header_accept !== '') { $headerParams['Accept'] = $_header_accept; } $_header_content_type = array({{#consumes}}'{{mediaType}}'{{#hasMore}},{{/hasMore}}{{/consumes}}); $headerParams['Content-Type'] = count($_header_content_type) > 0 ? $_header_content_type[0] : 'application/json'; {{#queryParams}}// query params if(${{paramName}} !== null) { $queryParams['{{baseName}}'] = $this->apiClient->toQueryValue(${{paramName}}); }{{/queryParams}} {{#headerParams}}// header params if(${{paramName}} !== null) { $headerParams['{{baseName}}'] = $this->apiClient->toHeaderValue(${{paramName}}); }{{/headerParams}} {{#pathParams}}// path params if(${{paramName}} !== null) { $resourcePath = str_replace("{" . "{{baseName}}" . "}", $this->apiClient->toPathValue(${{paramName}}), $resourcePath); }{{/pathParams}} {{#formParams}}// form params if (${{paramName}} !== null) { $formParams['{{baseName}}'] = {{#isFile}}'@' . {{/isFile}}$this->apiClient->toFormValue(${{paramName}}); }{{/formParams}} {{#bodyParams}}// body params $body = null; if (isset(${{paramName}})) { $body = ${{paramName}}; }{{/bodyParams}} // for model (json/xml) if (isset($body)) { $httpBody = $body; // $body is the method argument, if present } // for HTTP post (form) if (strpos($headerParams['Content-Type'], "application/x-www-form-urlencoded") > -1) { $httpBody = http_build_query($formParams); } // make the API Call $response = $this->apiClient->callAPI($resourcePath, $method, $queryParams, $httpBody, $headerParams); {{#returnType}}if(! $response) { return null; } $responseObject = $this->apiClient->deserialize($response, '{{returnType}}'); return $responseObject;{{/returnType}} } {{/operation}} {{newline}} {{/operations}} }