22
22
{ {#operations} }
23
23
class { {classname} } {
24
24
25
- function __construct($apiClient ) {
26
- $this -> apiClient = $apiClient ;
27
- }
25
+ function __construct($apiClient ) {
26
+ $this -> apiClient = $apiClient ;
27
+ }
28
28
29
29
{ {#operation} }
30
- /**
31
- * { {{nickname} }}
30
+ /**
31
+ * { {{nickname} }}
32
32
*
33
- * { {{summary} }}
33
+ * { {{summary} }}
34
34
*
35
35
{ {#allParams} } * @param { {dataType} } ${ {paramName} } { {description} } { {^optional} }(required){ {/optional} }{ {#optional} }(optional){ {/optional} }
36
36
{ {/allParams} } * @return { {#returnType} }{ {{returnType} }}{ {/returnType} }{ {^returnType} }void{ {/returnType} }
37
- */
37
+ */
38
38
public function { {nickname} }({ {#allParams} }${ {paramName} }{ {#optional} }=null{ {/optional} }{ {#hasMore} }, { {/hasMore} }{ {/allParams} }) {
39
39
40
- // parse inputs
41
- $resourcePath = " {{path}}" ;
42
- $resourcePath = str_replace(" {format}" , " json" , $resourcePath );
43
- $method = " {{httpMethod}}" ;
40
+ // parse inputs
41
+ $resourcePath = " {{path}}" ;
42
+ $resourcePath = str_replace(" {format}" , " json" , $resourcePath );
43
+ $method = " {{httpMethod}}" ;
44
44
$queryParams = array();
45
45
$headerParams = array();
46
46
$formParams = array();
@@ -49,17 +49,17 @@ class {{classname}} {
49
49
50
50
{{#queryParams} }// query params
51
51
if(${ {paramName} } !== null) {
52
- $queryParams [' {{baseName}}' ] = $this -> apiClient -> toQueryValue (${{paramName} });
53
- }{ {/queryParams} }
52
+ $queryParams [' {{baseName}}' ] = $this -> apiClient -> toQueryValue (${{paramName} });
53
+ }{ {/queryParams} }
54
54
{ {#headerParams} }// header params
55
55
if(${ {paramName} } !== null) {
56
- $headerParams [' {{baseName}}' ] = $this -> apiClient -> toHeaderValue (${{paramName} });
57
- }{ {/headerParams} }
56
+ $headerParams [' {{baseName}}' ] = $this -> apiClient -> toHeaderValue (${{paramName} });
57
+ }{ {/headerParams} }
58
58
{ {#pathParams} }// path params
59
59
if(${ {paramName} } !== null) {
60
- $resourcePath = str_replace(" {" . " {{baseName}}" . " }" ,
61
- $this -> apiClient -> toPathValue (${{paramName} }), $resourcePath);
62
- }{ {/pathParams} }
60
+ $resourcePath = str_replace(" {" . " {{baseName}}" . " }" ,
61
+ $this -> apiClient -> toPathValue (${{paramName} }), $resourcePath);
62
+ }{ {/pathParams} }
63
63
{ {#formParams} }// form params
64
64
if (${ {paramName} } !== null) {
65
65
$formParams [' {{baseName}}' ] = {{#isFile} }'@' . { {/isFile} }$this->apiClient->toFormValue(${ {paramName} });
@@ -77,10 +77,10 @@ class {{classname}} {
77
77
$body = http_build_query($body );
78
78
}
79
79
80
- // make the API Call
81
- $response = $this->apiClient->callAPI($resourcePath, $method,
82
- $queryParams, $body,
83
- $headerParams);
80
+ // make the API Call
81
+ $response = $this->apiClient->callAPI($resourcePath, $method,
82
+ $queryParams, $body,
83
+ $headerParams);
84
84
85
85
{ {#returnType} }if(! $response) {
86
86
return null;
0 commit comments