3
3
* Do not edit this file by hand or your changes will be lost next time it is
4
4
* generated.
5
5
*
6
- * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key ` special-key` to test the authorization filters.
6
+ * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key ` special-key` to test the authorization filters.
7
7
* Version: 1.0.0
8
- * Generated at: 2016-04-16T18:02:07.029+08:00
8
+ * Generated at: 2016-04-28T06:15:51.482Z
9
9
* Generated by: class io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen
10
10
*/
11
11
/**
@@ -40,86 +40,87 @@ API.Client.PetApi = function($http, $httpParamSerializer, $injector) {
40
40
/** @private {!angular.$http} */
41
41
this . http_ = $http ;
42
42
43
- /** @private {!Object} */
44
- this . httpParamSerializer_ = $injector . get ( '$httpParamSerializer' ) ;
43
+ /** @package {!Object} */
44
+ this . httpParamSerializer = $injector . get ( '$httpParamSerializer' ) ;
45
45
}
46
46
API . Client . PetApi . $inject = [ '$http' , '$httpParamSerializer' , '$injector' ] ;
47
47
48
48
/**
49
- * Add a new pet to the store
49
+ * Update an existing pet
50
50
*
51
51
* @param {!Pet } body Pet object that needs to be added to the store
52
52
* @param {!angular.$http.Config= } opt_extraHttpRequestParams Extra HTTP parameters to send.
53
53
* @return {!angular.$q.Promise }
54
54
*/
55
- API . Client . PetApi . prototype . addPet = function ( body , opt_extraHttpRequestParams ) {
55
+ API . Client . PetApi . prototype . updatePet = function ( body , opt_extraHttpRequestParams ) {
56
56
/** @const {string} */
57
57
var path = this . basePath_ + '/pet' ;
58
58
59
59
/** @type {!Object } */
60
60
var queryParameters = { } ;
61
61
62
62
/** @type {!Object } */
63
- var headerParams = angular . extend ( { } , this . defaultHeaders ) ;
63
+ var headerParams = angular . extend ( { } , this . defaultHeaders_ ) ;
64
64
// verify required parameter 'body' is set
65
65
if ( ! body ) {
66
- throw new Error ( 'Missing required parameter body when calling addPet ' ) ;
66
+ throw new Error ( 'Missing required parameter body when calling updatePet ' ) ;
67
67
}
68
68
/** @type {!Object } */
69
69
var httpRequestParams = {
70
- method : 'POST ' ,
70
+ method : 'PUT ' ,
71
71
url : path ,
72
72
json : true ,
73
73
data : body ,
74
- params : queryParameters ,
74
+
75
+
76
+ params : queryParameters ,
75
77
headers : headerParams
76
78
} ;
77
79
78
80
if ( opt_extraHttpRequestParams ) {
79
81
httpRequestParams = angular . extend ( httpRequestParams , opt_extraHttpRequestParams ) ;
80
82
}
81
83
82
- return this . http_ ( httpRequestParams ) ;
84
+ return ( /** @type { ? } */ ( this . http_ ) ) ( httpRequestParams ) ;
83
85
}
84
86
85
87
/**
86
- * Deletes a pet
88
+ * Add a new pet to the store
87
89
*
88
- * @param {!number } petId Pet id to delete
89
- * @param {!string= } opt_apiKey
90
+ * @param {!Pet } body Pet object that needs to be added to the store
90
91
* @param {!angular.$http.Config= } opt_extraHttpRequestParams Extra HTTP parameters to send.
91
92
* @return {!angular.$q.Promise }
92
93
*/
93
- API . Client . PetApi . prototype . deletePet = function ( petId , opt_apiKey , opt_extraHttpRequestParams ) {
94
+ API . Client . PetApi . prototype . addPet = function ( body , opt_extraHttpRequestParams ) {
94
95
/** @const {string} */
95
- var path = this . basePath_ + '/pet/{petId}'
96
- . replace ( '{' + 'petId' + '}' , String ( petId ) ) ;
96
+ var path = this . basePath_ + '/pet' ;
97
97
98
98
/** @type {!Object } */
99
99
var queryParameters = { } ;
100
100
101
101
/** @type {!Object } */
102
- var headerParams = angular . extend ( { } , this . defaultHeaders ) ;
103
- // verify required parameter 'petId ' is set
104
- if ( ! petId ) {
105
- throw new Error ( 'Missing required parameter petId when calling deletePet ' ) ;
102
+ var headerParams = angular . extend ( { } , this . defaultHeaders_ ) ;
103
+ // verify required parameter 'body ' is set
104
+ if ( ! body ) {
105
+ throw new Error ( 'Missing required parameter body when calling addPet ' ) ;
106
106
}
107
- headerParams [ 'api_key' ] = opt_apiKey ;
108
-
109
107
/** @type {!Object } */
110
108
var httpRequestParams = {
111
- method : 'DELETE ' ,
109
+ method : 'POST ' ,
112
110
url : path ,
113
111
json : true ,
114
- params : queryParameters ,
112
+ data : body ,
113
+
114
+
115
+ params : queryParameters ,
115
116
headers : headerParams
116
117
} ;
117
118
118
119
if ( opt_extraHttpRequestParams ) {
119
120
httpRequestParams = angular . extend ( httpRequestParams , opt_extraHttpRequestParams ) ;
120
121
}
121
122
122
- return this . http_ ( httpRequestParams ) ;
123
+ return ( /** @type { ? } */ ( this . http_ ) ) ( httpRequestParams ) ;
123
124
}
124
125
125
126
/**
@@ -137,7 +138,7 @@ API.Client.PetApi.prototype.findPetsByStatus = function(status, opt_extraHttpReq
137
138
var queryParameters = { } ;
138
139
139
140
/** @type {!Object } */
140
- var headerParams = angular . extend ( { } , this . defaultHeaders ) ;
141
+ var headerParams = angular . extend ( { } , this . defaultHeaders_ ) ;
141
142
// verify required parameter 'status' is set
142
143
if ( ! status ) {
143
144
throw new Error ( 'Missing required parameter status when calling findPetsByStatus' ) ;
@@ -151,15 +152,17 @@ API.Client.PetApi.prototype.findPetsByStatus = function(status, opt_extraHttpReq
151
152
method : 'GET' ,
152
153
url : path ,
153
154
json : true ,
154
- params : queryParameters ,
155
+
156
+
157
+ params : queryParameters ,
155
158
headers : headerParams
156
159
} ;
157
160
158
161
if ( opt_extraHttpRequestParams ) {
159
162
httpRequestParams = angular . extend ( httpRequestParams , opt_extraHttpRequestParams ) ;
160
163
}
161
164
162
- return this . http_ ( httpRequestParams ) ;
165
+ return ( /** @type { ? } */ ( this . http_ ) ) ( httpRequestParams ) ;
163
166
}
164
167
165
168
/**
@@ -177,7 +180,7 @@ API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_extraHttpRequest
177
180
var queryParameters = { } ;
178
181
179
182
/** @type {!Object } */
180
- var headerParams = angular . extend ( { } , this . defaultHeaders ) ;
183
+ var headerParams = angular . extend ( { } , this . defaultHeaders_ ) ;
181
184
// verify required parameter 'tags' is set
182
185
if ( ! tags ) {
183
186
throw new Error ( 'Missing required parameter tags when calling findPetsByTags' ) ;
@@ -191,15 +194,17 @@ API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_extraHttpRequest
191
194
method : 'GET' ,
192
195
url : path ,
193
196
json : true ,
194
- params : queryParameters ,
197
+
198
+
199
+ params : queryParameters ,
195
200
headers : headerParams
196
201
} ;
197
202
198
203
if ( opt_extraHttpRequestParams ) {
199
204
httpRequestParams = angular . extend ( httpRequestParams , opt_extraHttpRequestParams ) ;
200
205
}
201
206
202
- return this . http_ ( httpRequestParams ) ;
207
+ return ( /** @type { ? } */ ( this . http_ ) ) ( httpRequestParams ) ;
203
208
}
204
209
205
210
/**
@@ -218,7 +223,7 @@ API.Client.PetApi.prototype.getPetById = function(petId, opt_extraHttpRequestPar
218
223
var queryParameters = { } ;
219
224
220
225
/** @type {!Object } */
221
- var headerParams = angular . extend ( { } , this . defaultHeaders ) ;
226
+ var headerParams = angular . extend ( { } , this . defaultHeaders_ ) ;
222
227
// verify required parameter 'petId' is set
223
228
if ( ! petId ) {
224
229
throw new Error ( 'Missing required parameter petId when calling getPetById' ) ;
@@ -228,64 +233,79 @@ API.Client.PetApi.prototype.getPetById = function(petId, opt_extraHttpRequestPar
228
233
method : 'GET' ,
229
234
url : path ,
230
235
json : true ,
231
- params : queryParameters ,
236
+
237
+
238
+ params : queryParameters ,
232
239
headers : headerParams
233
240
} ;
234
241
235
242
if ( opt_extraHttpRequestParams ) {
236
243
httpRequestParams = angular . extend ( httpRequestParams , opt_extraHttpRequestParams ) ;
237
244
}
238
245
239
- return this . http_ ( httpRequestParams ) ;
246
+ return ( /** @type { ? } */ ( this . http_ ) ) ( httpRequestParams ) ;
240
247
}
241
248
242
249
/**
243
- * Update an existing pet
250
+ * Updates a pet in the store with form data
244
251
*
245
- * @param {!Pet } body Pet object that needs to be added to the store
252
+ * @param {!number } petId ID of pet that needs to be updated
253
+ * @param {!string= } opt_name Updated name of the pet
254
+ * @param {!string= } opt_status Updated status of the pet
246
255
* @param {!angular.$http.Config= } opt_extraHttpRequestParams Extra HTTP parameters to send.
247
256
* @return {!angular.$q.Promise }
248
257
*/
249
- API . Client . PetApi . prototype . updatePet = function ( body , opt_extraHttpRequestParams ) {
258
+ API . Client . PetApi . prototype . updatePetWithForm = function ( petId , opt_name , opt_status , opt_extraHttpRequestParams ) {
250
259
/** @const {string} */
251
- var path = this . basePath_ + '/pet' ;
260
+ var path = this . basePath_ + '/pet/{petId}'
261
+ . replace ( '{' + 'petId' + '}' , String ( petId ) ) ;
252
262
253
263
/** @type {!Object } */
254
264
var queryParameters = { } ;
255
265
256
266
/** @type {!Object } */
257
- var headerParams = angular . extend ( { } , this . defaultHeaders ) ;
258
- // verify required parameter 'body' is set
259
- if ( ! body ) {
260
- throw new Error ( 'Missing required parameter body when calling updatePet' ) ;
267
+ var headerParams = angular . extend ( { } , this . defaultHeaders_ ) ;
268
+ /** @type {!Object } */
269
+ var formParams = { } ;
270
+
271
+ // verify required parameter 'petId' is set
272
+ if ( ! petId ) {
273
+ throw new Error ( 'Missing required parameter petId when calling updatePetWithForm' ) ;
261
274
}
275
+ headerParams [ 'Content-Type' ] = 'application/x-www-form-urlencoded' ;
276
+
277
+ formParams [ 'name' ] = opt_name ;
278
+
279
+ formParams [ 'status' ] = opt_status ;
280
+
262
281
/** @type {!Object } */
263
282
var httpRequestParams = {
264
- method : 'PUT ' ,
283
+ method : 'POST ' ,
265
284
url : path ,
266
- json : true ,
267
- data : body ,
268
- params : queryParameters ,
285
+ json : false ,
286
+
287
+ data : this . httpParamSerializer ( formParams ) ,
288
+
289
+ params : queryParameters ,
269
290
headers : headerParams
270
291
} ;
271
292
272
293
if ( opt_extraHttpRequestParams ) {
273
294
httpRequestParams = angular . extend ( httpRequestParams , opt_extraHttpRequestParams ) ;
274
295
}
275
296
276
- return this . http_ ( httpRequestParams ) ;
297
+ return ( /** @type { ? } */ ( this . http_ ) ) ( httpRequestParams ) ;
277
298
}
278
299
279
300
/**
280
- * Updates a pet in the store with form data
301
+ * Deletes a pet
281
302
*
282
- * @param {!number } petId ID of pet that needs to be updated
283
- * @param {!string= } opt_name Updated name of the pet
284
- * @param {!string= } opt_status Updated status of the pet
303
+ * @param {!number } petId Pet id to delete
304
+ * @param {!string= } opt_apiKey
285
305
* @param {!angular.$http.Config= } opt_extraHttpRequestParams Extra HTTP parameters to send.
286
306
* @return {!angular.$q.Promise }
287
307
*/
288
- API . Client . PetApi . prototype . updatePetWithForm = function ( petId , opt_name , opt_status , opt_extraHttpRequestParams ) {
308
+ API . Client . PetApi . prototype . deletePet = function ( petId , opt_apiKey , opt_extraHttpRequestParams ) {
289
309
/** @const {string} */
290
310
var path = this . basePath_ + '/pet/{petId}'
291
311
. replace ( '{' + 'petId' + '}' , String ( petId ) ) ;
@@ -294,26 +314,20 @@ API.Client.PetApi.prototype.updatePetWithForm = function(petId, opt_name, opt_st
294
314
var queryParameters = { } ;
295
315
296
316
/** @type {!Object } */
297
- var headerParams = angular . extend ( { } , this . defaultHeaders ) ;
298
- /** @type {!Object } */
299
- var formParams = { } ;
300
-
317
+ var headerParams = angular . extend ( { } , this . defaultHeaders_ ) ;
301
318
// verify required parameter 'petId' is set
302
319
if ( ! petId ) {
303
- throw new Error ( 'Missing required parameter petId when calling updatePetWithForm ' ) ;
320
+ throw new Error ( 'Missing required parameter petId when calling deletePet ' ) ;
304
321
}
305
- headerParams [ 'Content-Type' ] = 'application/x-www-form-urlencoded' ;
306
-
307
- formParams [ 'name' ] = opt_name ;
308
-
309
- formParams [ 'status' ] = opt_status ;
322
+ headerParams [ 'api_key' ] = opt_apiKey ;
310
323
311
324
/** @type {!Object } */
312
325
var httpRequestParams = {
313
- method : 'POST ' ,
326
+ method : 'DELETE ' ,
314
327
url : path ,
315
- json : false ,
316
- data : this . httpParamSerializer_ ( formParams ) ,
328
+ json : true ,
329
+
330
+
317
331
params : queryParameters ,
318
332
headers : headerParams
319
333
} ;
@@ -322,7 +336,7 @@ API.Client.PetApi.prototype.updatePetWithForm = function(petId, opt_name, opt_st
322
336
httpRequestParams = angular . extend ( httpRequestParams , opt_extraHttpRequestParams ) ;
323
337
}
324
338
325
- return this . http_ ( httpRequestParams ) ;
339
+ return ( /** @type { ? } */ ( this . http_ ) ) ( httpRequestParams ) ;
326
340
}
327
341
328
342
/**
@@ -343,7 +357,7 @@ API.Client.PetApi.prototype.uploadFile = function(petId, opt_additionalMetadata,
343
357
var queryParameters = { } ;
344
358
345
359
/** @type {!Object } */
346
- var headerParams = angular . extend ( { } , this . defaultHeaders ) ;
360
+ var headerParams = angular . extend ( { } , this . defaultHeaders_ ) ;
347
361
/** @type {!Object } */
348
362
var formParams = { } ;
349
363
@@ -362,7 +376,9 @@ API.Client.PetApi.prototype.uploadFile = function(petId, opt_additionalMetadata,
362
376
method : 'POST' ,
363
377
url : path ,
364
378
json : false ,
365
- data : this . httpParamSerializer_ ( formParams ) ,
379
+
380
+ data : this . httpParamSerializer ( formParams ) ,
381
+
366
382
params : queryParameters ,
367
383
headers : headerParams
368
384
} ;
@@ -371,5 +387,5 @@ API.Client.PetApi.prototype.uploadFile = function(petId, opt_additionalMetadata,
371
387
httpRequestParams = angular . extend ( httpRequestParams , opt_extraHttpRequestParams ) ;
372
388
}
373
389
374
- return this . http_ ( httpRequestParams ) ;
390
+ return ( /** @type { ? } */ ( this . http_ ) ) ( httpRequestParams ) ;
375
391
}
0 commit comments