@@ -126,7 +126,7 @@ module {{moduleName}}
126
126
local_var_path = '{ {{path} }}'{ {#pathParams} }.sub('{ ' + ' {{baseName} }' + '}', { {paramName} }.to_s){ {/pathParams} }
127
127
128
128
# query parameters
129
- query_params = { }
129
+ query_params = opts[:query_params] || { }
130
130
{ {#queryParams} }
131
131
{ {#required} }
132
132
query_params[:'{ {{baseName} }}'] = { {#collectionFormat} }@api_client.build_collection_param({ {{paramName} }}, :{ {{collectionFormat} }}){ {/collectionFormat} }{ {^collectionFormat} }{ {{paramName} }}{ {/collectionFormat} }
@@ -139,7 +139,7 @@ module {{moduleName}}
139
139
{ {/queryParams} }
140
140
141
141
# header parameters
142
- header_params = { }
142
+ header_params = opts[:header_params] || { }
143
143
{ {#hasProduces} }
144
144
# HTTP header 'Accept' (if needed)
145
145
header_params['Accept'] = @api_client.select_header_accept([{ {#produces} }'{ {{mediaType} }}'{ {#hasMore} }, { {/hasMore} }{ {/produces} }])
@@ -160,7 +160,7 @@ module {{moduleName}}
160
160
{ {/headerParams} }
161
161
162
162
# form parameters
163
- form_params = { }
163
+ form_params = opts[:form_params] || { }
164
164
{ {#formParams} }
165
165
{ {#required} }
166
166
form_params['{ {baseName} }'] = { {#collectionFormat} }@api_client.build_collection_param({ {{paramName} }}, :{ {{collectionFormat} }}){ {/collectionFormat} }{ {^collectionFormat} }{ {{paramName} }}{ {/collectionFormat} }
@@ -173,20 +173,24 @@ module {{moduleName}}
173
173
{ {/formParams} }
174
174
175
175
# http body (model)
176
- { {^bodyParam} }
177
- post_body = nil
178
- { {/bodyParam} }
179
- { {#bodyParam} }
180
- post_body = @api_client.object_to_http_body({ {#required} }{ {{paramName} }}{ {/required} }{ {^required} }opts[:'{ {{paramName} }}']{ {/required} })
181
- { {/bodyParam} }
182
- auth_names = [{ {#authMethods} }'{ {name} }'{ {#hasMore} }, { {/hasMore} }{ {/authMethods} }]
183
- data, status_code, headers = @api_client.call_api(:{ {httpMethod} }, local_var_path,
176
+ post_body = opts[:body] { {#bodyParam} }|| @api_client.object_to_http_body({ {#required} }{ {{paramName} }}{ {/required} }{ {^required} }opts[:'{ {{paramName} }}']{ {/required} }) { {/bodyParam} }
177
+
178
+ # return_type
179
+ return_type = opts[:return_type] { {#returnType} }|| '{ {{returnType} }}' { {/returnType} }
180
+
181
+ # auth_names
182
+ auth_names = opts[:auth_names] || [{ {#authMethods} }'{ {name} }'{ {#hasMore} }, { {/hasMore} }{ {/authMethods} }]
183
+
184
+ new_options = opts.merge(
184
185
:header_params => header_params,
185
186
:query_params => query_params,
186
187
:form_params => form_params,
187
188
:body => post_body,
188
- :auth_names => auth_names{ {#returnType} },
189
- :return_type => '{ {{returnType} }}'{ {/returnType} })
189
+ :auth_names => auth_names,
190
+ :return_type => return_type
191
+ )
192
+
193
+ data, status_code, headers = @api_client.call_api(:{ {httpMethod} }, local_var_path, new_options)
190
194
if @api_client.config.debugging
191
195
@api_client.config.logger.debug "API called: { {classname} }#{ {operationId} }\nData: #{ data.inspect} \nStatus code: #{ status_code} \nHeaders: #{ headers} "
192
196
end
0 commit comments