@@ -22,33 +22,6 @@ public String getBasePath() {
22
22
return basePath ;
23
23
}
24
24
25
- public void uploadFile (String additionalMetadata , File body ) throws ApiException {
26
- // create path and map variables
27
- String path = "/pet/uploadImage" .replaceAll ("\\ {format\\ }" ,"json" );
28
-
29
- // query params
30
- Map <String , String > queryParams = new HashMap <String , String >();
31
- Map <String , String > headerParams = new HashMap <String , String >();
32
-
33
- String contentType = "application/json" ;
34
-
35
- try {
36
- String response = apiInvoker .invokeAPI (basePath , path , "POST" , queryParams , body , headerParams , contentType );
37
- if (response != null ){
38
- return ;
39
- }
40
- else {
41
- return ;
42
- }
43
- } catch (ApiException ex ) {
44
- if (ex .getCode () == 404 ) {
45
- return ;
46
- }
47
- else {
48
- throw ex ;
49
- }
50
- }
51
- }
52
25
public Pet getPetById (Long petId ) throws ApiException {
53
26
// verify required params are set
54
27
if (petId == null ) {
@@ -60,11 +33,15 @@ public Pet getPetById (Long petId) throws ApiException {
60
33
// query params
61
34
Map <String , String > queryParams = new HashMap <String , String >();
62
35
Map <String , String > headerParams = new HashMap <String , String >();
36
+ Map <String , String > formParams = new HashMap <String , String >();
63
37
64
- String contentType = "application/json" ;
38
+ String [] contentTypes = {
39
+ "application/json" };
40
+
41
+ String contentType = contentTypes .length > 0 ? contentTypes [0 ] : "application/json" ;
65
42
66
43
try {
67
- String response = apiInvoker .invokeAPI (basePath , path , "GET" , queryParams , null , headerParams , contentType );
44
+ String response = apiInvoker .invokeAPI (basePath , path , "GET" , queryParams , null , headerParams , formParams , contentType );
68
45
if (response != null ){
69
46
return (Pet ) ApiInvoker .deserialize (response , "" , Pet .class );
70
47
}
@@ -91,11 +68,15 @@ public void deletePet (String petId) throws ApiException {
91
68
// query params
92
69
Map <String , String > queryParams = new HashMap <String , String >();
93
70
Map <String , String > headerParams = new HashMap <String , String >();
71
+ Map <String , String > formParams = new HashMap <String , String >();
72
+
73
+ String [] contentTypes = {
74
+ "application/json" };
94
75
95
- String contentType = "application/json" ;
76
+ String contentType = contentTypes . length > 0 ? contentTypes [ 0 ] : "application/json" ;
96
77
97
78
try {
98
- String response = apiInvoker .invokeAPI (basePath , path , "DELETE" , queryParams , null , headerParams , contentType );
79
+ String response = apiInvoker .invokeAPI (basePath , path , "DELETE" , queryParams , null , headerParams , formParams , contentType );
99
80
if (response != null ){
100
81
return ;
101
82
}
@@ -122,11 +103,15 @@ public List<Pet> partialUpdate (String petId, Pet body) throws ApiException {
122
103
// query params
123
104
Map <String , String > queryParams = new HashMap <String , String >();
124
105
Map <String , String > headerParams = new HashMap <String , String >();
106
+ Map <String , String > formParams = new HashMap <String , String >();
125
107
126
- String contentType = "application/json" ;
108
+ String [] contentTypes = {
109
+ "application/json" ,"application/xml" };
110
+
111
+ String contentType = contentTypes .length > 0 ? contentTypes [0 ] : "application/json" ;
127
112
128
113
try {
129
- String response = apiInvoker .invokeAPI (basePath , path , "PATCH" , queryParams , body , headerParams , contentType );
114
+ String response = apiInvoker .invokeAPI (basePath , path , "PATCH" , queryParams , body , headerParams , formParams , contentType );
130
115
if (response != null ){
131
116
return (List <Pet >) ApiInvoker .deserialize (response , "Array" , Pet .class );
132
117
}
@@ -153,11 +138,49 @@ public void updatePetWithForm (String petId, String name, String status) throws
153
138
// query params
154
139
Map <String , String > queryParams = new HashMap <String , String >();
155
140
Map <String , String > headerParams = new HashMap <String , String >();
141
+ Map <String , String > formParams = new HashMap <String , String >();
142
+
143
+ formParams .put ("name" , name );
144
+ formParams .put ("status" , status );
145
+ String [] contentTypes = {
146
+ "application/x-www-form-urlencoded" };
156
147
157
- String contentType = "application/json" ;
148
+ String contentType = contentTypes . length > 0 ? contentTypes [ 0 ] : "application/json" ;
158
149
159
150
try {
160
- String response = apiInvoker .invokeAPI (basePath , path , "POST" , queryParams , null , headerParams , contentType );
151
+ String response = apiInvoker .invokeAPI (basePath , path , "POST" , queryParams , null , headerParams , formParams , contentType );
152
+ if (response != null ){
153
+ return ;
154
+ }
155
+ else {
156
+ return ;
157
+ }
158
+ } catch (ApiException ex ) {
159
+ if (ex .getCode () == 404 ) {
160
+ return ;
161
+ }
162
+ else {
163
+ throw ex ;
164
+ }
165
+ }
166
+ }
167
+ public void uploadFile (String additionalMetadata , File body ) throws ApiException {
168
+ // create path and map variables
169
+ String path = "/pet/uploadImage" .replaceAll ("\\ {format\\ }" ,"json" );
170
+
171
+ // query params
172
+ Map <String , String > queryParams = new HashMap <String , String >();
173
+ Map <String , String > headerParams = new HashMap <String , String >();
174
+ Map <String , String > formParams = new HashMap <String , String >();
175
+
176
+ formParams .put ("additionalMetadata" , additionalMetadata );
177
+ String [] contentTypes = {
178
+ "multipart/form-data" };
179
+
180
+ String contentType = contentTypes .length > 0 ? contentTypes [0 ] : "application/json" ;
181
+
182
+ try {
183
+ String response = apiInvoker .invokeAPI (basePath , path , "POST" , queryParams , body , headerParams , formParams , contentType );
161
184
if (response != null ){
162
185
return ;
163
186
}
@@ -184,11 +207,15 @@ public void addPet (Pet body) throws ApiException {
184
207
// query params
185
208
Map <String , String > queryParams = new HashMap <String , String >();
186
209
Map <String , String > headerParams = new HashMap <String , String >();
210
+ Map <String , String > formParams = new HashMap <String , String >();
211
+
212
+ String [] contentTypes = {
213
+ "application/json" ,"application/xml" };
187
214
188
- String contentType = "application/json" ;
215
+ String contentType = contentTypes . length > 0 ? contentTypes [ 0 ] : "application/json" ;
189
216
190
217
try {
191
- String response = apiInvoker .invokeAPI (basePath , path , "POST" , queryParams , body , headerParams , contentType );
218
+ String response = apiInvoker .invokeAPI (basePath , path , "POST" , queryParams , body , headerParams , formParams , contentType );
192
219
if (response != null ){
193
220
return ;
194
221
}
@@ -215,11 +242,15 @@ public void updatePet (Pet body) throws ApiException {
215
242
// query params
216
243
Map <String , String > queryParams = new HashMap <String , String >();
217
244
Map <String , String > headerParams = new HashMap <String , String >();
245
+ Map <String , String > formParams = new HashMap <String , String >();
218
246
219
- String contentType = "application/json" ;
247
+ String [] contentTypes = {
248
+ "application/json" };
249
+
250
+ String contentType = contentTypes .length > 0 ? contentTypes [0 ] : "application/json" ;
220
251
221
252
try {
222
- String response = apiInvoker .invokeAPI (basePath , path , "PUT" , queryParams , body , headerParams , contentType );
253
+ String response = apiInvoker .invokeAPI (basePath , path , "PUT" , queryParams , body , headerParams , formParams , contentType );
223
254
if (response != null ){
224
255
return ;
225
256
}
@@ -246,13 +277,17 @@ public List<Pet> findPetsByStatus (String status) throws ApiException {
246
277
// query params
247
278
Map <String , String > queryParams = new HashMap <String , String >();
248
279
Map <String , String > headerParams = new HashMap <String , String >();
280
+ Map <String , String > formParams = new HashMap <String , String >();
249
281
250
282
if (!"null" .equals (String .valueOf (status )))
251
283
queryParams .put ("status" , String .valueOf (status ));
252
- String contentType = "application/json" ;
284
+ String [] contentTypes = {
285
+ "application/json" };
286
+
287
+ String contentType = contentTypes .length > 0 ? contentTypes [0 ] : "application/json" ;
253
288
254
289
try {
255
- String response = apiInvoker .invokeAPI (basePath , path , "GET" , queryParams , null , headerParams , contentType );
290
+ String response = apiInvoker .invokeAPI (basePath , path , "GET" , queryParams , null , headerParams , formParams , contentType );
256
291
if (response != null ){
257
292
return (List <Pet >) ApiInvoker .deserialize (response , "Array" , Pet .class );
258
293
}
@@ -279,13 +314,17 @@ public List<Pet> findPetsByTags (String tags) throws ApiException {
279
314
// query params
280
315
Map <String , String > queryParams = new HashMap <String , String >();
281
316
Map <String , String > headerParams = new HashMap <String , String >();
317
+ Map <String , String > formParams = new HashMap <String , String >();
282
318
283
319
if (!"null" .equals (String .valueOf (tags )))
284
320
queryParams .put ("tags" , String .valueOf (tags ));
285
- String contentType = "application/json" ;
321
+ String [] contentTypes = {
322
+ "application/json" };
323
+
324
+ String contentType = contentTypes .length > 0 ? contentTypes [0 ] : "application/json" ;
286
325
287
326
try {
288
- String response = apiInvoker .invokeAPI (basePath , path , "GET" , queryParams , null , headerParams , contentType );
327
+ String response = apiInvoker .invokeAPI (basePath , path , "GET" , queryParams , null , headerParams , formParams , contentType );
289
328
if (response != null ){
290
329
return (List <Pet >) ApiInvoker .deserialize (response , "Array" , Pet .class );
291
330
}
0 commit comments