Skip to content

Commit 4a98e3d

Browse files
ralphdoefrantuma
authored andcommitted
samples updates - samples/client/petstore/typescript-angular-v2/with-interfaces
1 parent cc84aa6 commit 4a98e3d

File tree

7 files changed

+71
-0
lines changed

7 files changed

+71
-0
lines changed

samples/client/petstore/typescript-angular-v2/default/package-lock.json

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ export class PetService implements PetServiceInterface {
200200
201201
*/
202202
public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
203+
203204
if (body === null || body === undefined) {
204205
throw new Error('Required parameter body was null or undefined when calling addPet.');
205206
}
@@ -256,10 +257,12 @@ export class PetService implements PetServiceInterface {
256257
257258
*/
258259
public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
260+
259261
if (petId === null || petId === undefined) {
260262
throw new Error('Required parameter petId was null or undefined when calling deletePet.');
261263
}
262264

265+
263266
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
264267
if (apiKey !== undefined && apiKey !== null) {
265268
headers.set('api_key', String(apiKey));
@@ -307,6 +310,7 @@ export class PetService implements PetServiceInterface {
307310
308311
*/
309312
public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
313+
310314
if (status === null || status === undefined) {
311315
throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.');
312316
}
@@ -361,6 +365,7 @@ export class PetService implements PetServiceInterface {
361365
362366
*/
363367
public findPetsByTagsWithHttpInfo(tags: Array<string>, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
368+
364369
if (tags === null || tags === undefined) {
365370
throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.');
366371
}
@@ -415,6 +420,7 @@ export class PetService implements PetServiceInterface {
415420
416421
*/
417422
public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
423+
418424
if (petId === null || petId === undefined) {
419425
throw new Error('Required parameter petId was null or undefined when calling getPetById.');
420426
}
@@ -460,6 +466,7 @@ export class PetService implements PetServiceInterface {
460466
461467
*/
462468
public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
469+
463470
if (body === null || body === undefined) {
464471
throw new Error('Required parameter body was null or undefined when calling updatePet.');
465472
}
@@ -517,10 +524,13 @@ export class PetService implements PetServiceInterface {
517524
518525
*/
519526
public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
527+
520528
if (petId === null || petId === undefined) {
521529
throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.');
522530
}
523531

532+
533+
524534
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
525535

526536
// authentication (petstore_auth) required
@@ -591,10 +601,13 @@ export class PetService implements PetServiceInterface {
591601
592602
*/
593603
public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
604+
594605
if (petId === null || petId === undefined) {
595606
throw new Error('Required parameter petId was null or undefined when calling uploadFile.');
596607
}
597608

609+
610+
598611
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
599612

600613
// authentication (petstore_auth) required

samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export class StoreService implements StoreServiceInterface {
129129
130130
*/
131131
public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
132+
132133
if (orderId === null || orderId === undefined) {
133134
throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.');
134135
}
@@ -209,6 +210,7 @@ export class StoreService implements StoreServiceInterface {
209210
210211
*/
211212
public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
213+
212214
if (orderId === null || orderId === undefined) {
213215
throw new Error('Required parameter orderId was null or undefined when calling getOrderById.');
214216
}
@@ -249,6 +251,7 @@ export class StoreService implements StoreServiceInterface {
249251
250252
*/
251253
public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
254+
252255
if (body === null || body === undefined) {
253256
throw new Error('Required parameter body was null or undefined when calling placeOrder.');
254257
}

samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ export class UserService implements UserServiceInterface {
195195
196196
*/
197197
public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
198+
198199
if (body === null || body === undefined) {
199200
throw new Error('Required parameter body was null or undefined when calling createUser.');
200201
}
@@ -240,6 +241,7 @@ export class UserService implements UserServiceInterface {
240241
241242
*/
242243
public createUsersWithArrayInputWithHttpInfo(body: Array<User>, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
244+
243245
if (body === null || body === undefined) {
244246
throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.');
245247
}
@@ -285,6 +287,7 @@ export class UserService implements UserServiceInterface {
285287
286288
*/
287289
public createUsersWithListInputWithHttpInfo(body: Array<User>, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
290+
288291
if (body === null || body === undefined) {
289292
throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.');
290293
}
@@ -330,6 +333,7 @@ export class UserService implements UserServiceInterface {
330333
331334
*/
332335
public deleteUserWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
336+
333337
if (username === null || username === undefined) {
334338
throw new Error('Required parameter username was null or undefined when calling deleteUser.');
335339
}
@@ -370,6 +374,7 @@ export class UserService implements UserServiceInterface {
370374
371375
*/
372376
public getUserByNameWithHttpInfo(username: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
377+
373378
if (username === null || username === undefined) {
374379
throw new Error('Required parameter username was null or undefined when calling getUserByName.');
375380
}
@@ -411,9 +416,11 @@ export class UserService implements UserServiceInterface {
411416
412417
*/
413418
public loginUserWithHttpInfo(username: string, password: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
419+
414420
if (username === null || username === undefined) {
415421
throw new Error('Required parameter username was null or undefined when calling loginUser.');
416422
}
423+
417424
if (password === null || password === undefined) {
418425
throw new Error('Required parameter password was null or undefined when calling loginUser.');
419426
}
@@ -500,9 +507,11 @@ export class UserService implements UserServiceInterface {
500507
501508
*/
502509
public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
510+
503511
if (username === null || username === undefined) {
504512
throw new Error('Required parameter username was null or undefined when calling updateUser.');
505513
}
514+
506515
if (body === null || body === undefined) {
507516
throw new Error('Required parameter body was null or undefined when calling updateUser.');
508517
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Swagger Petstore
3+
* 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.
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
import { Currency } from './currency';
13+
14+
15+
/**
16+
* some description
17+
*/
18+
export interface Amount {
19+
/**
20+
* some description
21+
*/
22+
value: number;
23+
currency: Currency;
24+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Swagger Petstore
3+
* 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.
4+
*
5+
* OpenAPI spec version: 1.0.0
6+
* Contact: [email protected]
7+
*
8+
* NOTE: This class is auto generated by the swagger code generator program.
9+
* https://github.com/swagger-api/swagger-codegen.git
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
/**
15+
* some description
16+
*/
17+
export type Currency = string;

samples/client/petstore/typescript-angular-v2/with-interfaces/model/models.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
export * from './amount';
12
export * from './apiResponse';
23
export * from './category';
4+
export * from './currency';
35
export * from './order';
46
export * from './pet';
57
export * from './tag';

0 commit comments

Comments
 (0)