[Golang][client] fix undefined: localVarFile (#382)

* fix undefined: localVarFile

* add required formData file endpoints to 2.0 and 3.0 specs

* streamline api.mustache update

* update sampels

* update samples

* update samples

* update samples bin/jaxrs-cxf-client-petstore.sh

* update samples

* update samples

* update samples run-all-petstore

* update samples

* update samples

* Trigger CI due to race condition

* update samples

* update samples

* Trigger CI due to previous timeout

* Trigger CI due to previous Shippable timeout

* Trigger CI due to previous Shippable race condition
This commit is contained in:
John Wang
2018-07-01 01:58:45 -07:00
committed by William Cheng
parent 8bddf12e05
commit e960fe9512
109 changed files with 4209 additions and 48 deletions

View File

@@ -459,6 +459,72 @@ if (status != null)
if (additionalMetadata != null)
localVarFormParams.put("additionalMetadata", additionalMetadata);
if (file != null)
localVarFormParams.put("file", file);
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"multipart/form-data"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "petstore_auth" };
GenericType<ModelApiResponse> localVarReturnType = new GenericType<ModelApiResponse>() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
}
/**
* uploads an image
*
* @param petId ID of pet to update (required)
* @param file file to upload (required)
* @param additionalMetadata Additional data to pass to server (optional, default to null)
* @return ModelApiResponse
* @throws ApiException if fails to make API call
*/
public ModelApiResponse uploadFileWithRequiredFile(Long petId, File file, String additionalMetadata) throws ApiException {
return uploadFileWithRequiredFileWithHttpInfo(petId, file, additionalMetadata).getData();
}
/**
* uploads an image
*
* @param petId ID of pet to update (required)
* @param file file to upload (required)
* @param additionalMetadata Additional data to pass to server (optional, default to null)
* @return ApiResponse&lt;ModelApiResponse&gt;
* @throws ApiException if fails to make API call
*/
public ApiResponse<ModelApiResponse> uploadFileWithRequiredFileWithHttpInfo(Long petId, File file, String additionalMetadata) throws ApiException {
Object localVarPostBody = new Object();
// verify the required parameter 'petId' is set
if (petId == null) {
throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile");
}
// verify the required parameter 'file' is set
if (file == null) {
throw new ApiException(400, "Missing the required parameter 'file' when calling uploadFileWithRequiredFile");
}
// create path and map variables
String localVarPath = "/pet/{petId}/uploadImageWithRequiredFile"
.replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
if (additionalMetadata != null)
localVarFormParams.put("additionalMetadata", additionalMetadata);
if (file != null)