8
8
* NOTE: This class is auto generated by the swagger code generator program.
9
9
* https://github.com/swagger-api/swagger-codegen.git
10
10
* Do not edit the class manually.
11
- */
12
- /* tslint:disable:no-unused-variable member-ordering */
11
+ */ /* tslint:disable:no-unused-variable member-ordering */
13
12
14
13
import { Inject , Injectable , Optional } from '@angular/core' ;
15
14
import { Http , Headers , URLSearchParams } from '@angular/http' ;
@@ -62,7 +61,7 @@ export class StoreService {
62
61
* @summary Delete purchase order by ID
63
62
* @param orderId ID of the order that needs to be deleted
64
63
*/
65
- public deleteOrder ( orderId : stringextraHttpRequestParams ?: RequestOptionsArgs ) : Observable < { } > {
64
+ public deleteOrder ( orderId : string , extraHttpRequestParams ?: RequestOptionsArgs ) : Observable < { } > {
66
65
return this . deleteOrderWithHttpInfo ( orderId , extraHttpRequestParams )
67
66
. map ( ( response : Response ) => {
68
67
if ( response . status === 204 ) {
@@ -93,7 +92,7 @@ export class StoreService {
93
92
* @summary Find purchase order by ID
94
93
* @param orderId ID of pet that needs to be fetched
95
94
*/
96
- public getOrderById ( orderId : numberextraHttpRequestParams ?: RequestOptionsArgs ) : Observable < Order > {
95
+ public getOrderById ( orderId : number , extraHttpRequestParams ?: RequestOptionsArgs ) : Observable < Order > {
97
96
return this . getOrderByIdWithHttpInfo ( orderId , extraHttpRequestParams )
98
97
. map ( ( response : Response ) => {
99
98
if ( response . status === 204 ) {
@@ -109,7 +108,7 @@ export class StoreService {
109
108
* @summary Place an order for a pet
110
109
* @param body order placed for purchasing the pet
111
110
*/
112
- public placeOrder ( body : OrderextraHttpRequestParams ?: RequestOptionsArgs ) : Observable < Order > {
111
+ public placeOrder ( body : Order , extraHttpRequestParams ?: RequestOptionsArgs ) : Observable < Order > {
113
112
return this . placeOrderWithHttpInfo ( body , extraHttpRequestParams )
114
113
. map ( ( response : Response ) => {
115
114
if ( response . status === 204 ) {
@@ -128,6 +127,7 @@ export class StoreService {
128
127
129
128
*/
130
129
public deleteOrderWithHttpInfo ( orderId : string , extraHttpRequestParams ?: RequestOptionsArgs ) : Observable < Response > {
130
+
131
131
if ( orderId === null || orderId === undefined ) {
132
132
throw new Error ( 'Required parameter orderId was null or undefined when calling deleteOrder.' ) ;
133
133
}
@@ -147,9 +147,9 @@ export class StoreService {
147
147
] ;
148
148
149
149
let requestOptions : RequestOptionsArgs = new RequestOptions ( {
150
- method : RequestMethod . Delete ,
150
+ method : ' RequestMethod.Delete' ,
151
151
headers : headers ,
152
- withCredentials :this . configuration . withCredentials
152
+ withCredentials : this . configuration . withCredentials
153
153
} ) ;
154
154
// https://github.com/swagger-api/swagger-codegen/issues/4037
155
155
if ( extraHttpRequestParams ) {
@@ -169,6 +169,10 @@ export class StoreService {
169
169
let headers = new Headers ( this . defaultHeaders . toJSON ( ) ) ; // https://github.com/angular/angular/issues/6845
170
170
171
171
// authentication (api_key) required
172
+ if ( this . configuration . apiKeys && this . configuration . apiKeys [ "api_key" ] ) {
173
+ headers . set ( 'api_key' , this . configuration . apiKeys [ "api_key" ] ) ;
174
+ }
175
+
172
176
// to determine the Accept header
173
177
let httpHeaderAccepts : string [ ] = [
174
178
'application/json'
@@ -183,9 +187,9 @@ export class StoreService {
183
187
] ;
184
188
185
189
let requestOptions : RequestOptionsArgs = new RequestOptions ( {
186
- method : RequestMethod . Get ,
190
+ method : ' RequestMethod.Get' ,
187
191
headers : headers ,
188
- withCredentials :this . configuration . withCredentials
192
+ withCredentials : this . configuration . withCredentials
189
193
} ) ;
190
194
// https://github.com/swagger-api/swagger-codegen/issues/4037
191
195
if ( extraHttpRequestParams ) {
@@ -202,6 +206,7 @@ export class StoreService {
202
206
203
207
*/
204
208
public getOrderByIdWithHttpInfo ( orderId : number , extraHttpRequestParams ?: RequestOptionsArgs ) : Observable < Response > {
209
+
205
210
if ( orderId === null || orderId === undefined ) {
206
211
throw new Error ( 'Required parameter orderId was null or undefined when calling getOrderById.' ) ;
207
212
}
@@ -223,9 +228,9 @@ export class StoreService {
223
228
] ;
224
229
225
230
let requestOptions : RequestOptionsArgs = new RequestOptions ( {
226
- method : RequestMethod . Get ,
231
+ method : ' RequestMethod.Get' ,
227
232
headers : headers ,
228
- withCredentials :this . configuration . withCredentials
233
+ withCredentials : this . configuration . withCredentials
229
234
} ) ;
230
235
// https://github.com/swagger-api/swagger-codegen/issues/4037
231
236
if ( extraHttpRequestParams ) {
@@ -242,6 +247,7 @@ export class StoreService {
242
247
243
248
*/
244
249
public placeOrderWithHttpInfo ( body : Order , extraHttpRequestParams ?: RequestOptionsArgs ) : Observable < Response > {
250
+
245
251
if ( body === null || body === undefined ) {
246
252
throw new Error ( 'Required parameter body was null or undefined when calling placeOrder.' ) ;
247
253
}
@@ -260,18 +266,18 @@ export class StoreService {
260
266
261
267
// to determine the Content-Type header
262
268
const consumes : string [ ] = [
263
- '*/* '
269
+ 'application/json '
264
270
] ;
265
271
const httpContentTypeSelected : string | undefined = this . configuration . selectHeaderContentType ( consumes ) ;
266
272
if ( httpContentTypeSelected != undefined ) {
267
273
headers . set ( 'Content-Type' , httpContentTypeSelected ) ;
268
274
}
269
275
270
276
let requestOptions : RequestOptionsArgs = new RequestOptions ( {
271
- method : RequestMethod . Post ,
277
+ method : ' RequestMethod.Post' ,
272
278
headers : headers ,
273
279
body : body == null ? '' : JSON . stringify ( body ) , // https://github.com/angular/angular/issues/10612
274
- withCredentials :this . configuration . withCredentials
280
+ withCredentials : this . configuration . withCredentials
275
281
} ) ;
276
282
// https://github.com/swagger-api/swagger-codegen/issues/4037
277
283
if ( extraHttpRequestParams ) {
@@ -281,3 +287,4 @@ export class StoreService {
281
287
return this . http . request ( `${ this . basePath } /store/order` , requestOptions ) ;
282
288
}
283
289
290
+ }
0 commit comments