Skip to content

Commit 90df339

Browse files
ralphdoefrantuma
authored andcommitted
samples updates - samples/client/petstore/typescript-angular-v5/with-interfaces
1 parent ebe44a2 commit 90df339

File tree

9 files changed

+68
-3
lines changed

9 files changed

+68
-3
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export class PetService implements PetServiceInterface {
6969
public addPet(body: Pet, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
7070
public addPet(body: Pet, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
7171
public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
72+
7273
if (body === null || body === undefined) {
7374
throw new Error('Required parameter body was null or undefined when calling addPet.');
7475
}
@@ -126,10 +127,12 @@ export class PetService implements PetServiceInterface {
126127
public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
127128
public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
128129
public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
130+
129131
if (petId === null || petId === undefined) {
130132
throw new Error('Required parameter petId was null or undefined when calling deletePet.');
131133
}
132134

135+
133136
let headers = this.defaultHeaders;
134137
if (apiKey !== undefined && apiKey !== null) {
135138
headers = headers.set('api_key', String(apiKey));
@@ -178,6 +181,7 @@ export class PetService implements PetServiceInterface {
178181
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Array<Pet>>>;
179182
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Array<Pet>>>;
180183
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
184+
181185
if (status === null || status === undefined) {
182186
throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.');
183187
}
@@ -233,6 +237,7 @@ export class PetService implements PetServiceInterface {
233237
public findPetsByTags(tags: Array<string>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Array<Pet>>>;
234238
public findPetsByTags(tags: Array<string>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Array<Pet>>>;
235239
public findPetsByTags(tags: Array<string>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
240+
236241
if (tags === null || tags === undefined) {
237242
throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.');
238243
}
@@ -288,6 +293,7 @@ export class PetService implements PetServiceInterface {
288293
public getPetById(petId: number, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Pet>>;
289294
public getPetById(petId: number, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Pet>>;
290295
public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
296+
291297
if (petId === null || petId === undefined) {
292298
throw new Error('Required parameter petId was null or undefined when calling getPetById.');
293299
}
@@ -334,6 +340,7 @@ export class PetService implements PetServiceInterface {
334340
public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
335341
public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
336342
public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
343+
337344
if (body === null || body === undefined) {
338345
throw new Error('Required parameter body was null or undefined when calling updatePet.');
339346
}
@@ -392,10 +399,13 @@ export class PetService implements PetServiceInterface {
392399
public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
393400
public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
394401
public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
402+
395403
if (petId === null || petId === undefined) {
396404
throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.');
397405
}
398406

407+
408+
399409
let headers = this.defaultHeaders;
400410

401411
// authentication (petstore_auth) required
@@ -463,10 +473,13 @@ export class PetService implements PetServiceInterface {
463473
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<ApiResponse>>;
464474
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<ApiResponse>>;
465475
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
476+
466477
if (petId === null || petId === undefined) {
467478
throw new Error('Required parameter petId was null or undefined when calling uploadFile.');
468479
}
469480

481+
482+
470483
let headers = this.defaultHeaders;
471484

472485
// authentication (petstore_auth) required

samples/client/petstore/typescript-angular-v5/with-interfaces/api/pet.serviceInterface.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { HttpHeaders } from '@angular/comm
1313

1414
import { Observable } from 'rxjs/Observable';
1515

16-
1716
import { ApiResponse } from '../model/apiResponse';
1817
import { Pet } from '../model/pet';
1918

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class StoreService implements StoreServiceInterface {
6868
public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
6969
public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
7070
public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
71+
7172
if (orderId === null || orderId === undefined) {
7273
throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.');
7374
}
@@ -150,6 +151,7 @@ export class StoreService implements StoreServiceInterface {
150151
public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Order>>;
151152
public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Order>>;
152153
public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
154+
153155
if (orderId === null || orderId === undefined) {
154156
throw new Error('Required parameter orderId was null or undefined when calling getOrderById.');
155157
}
@@ -191,6 +193,7 @@ export class StoreService implements StoreServiceInterface {
191193
public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Order>>;
192194
public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Order>>;
193195
public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
196+
194197
if (body === null || body === undefined) {
195198
throw new Error('Required parameter body was null or undefined when calling placeOrder.');
196199
}

samples/client/petstore/typescript-angular-v5/with-interfaces/api/store.serviceInterface.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { HttpHeaders } from '@angular/comm
1313

1414
import { Observable } from 'rxjs/Observable';
1515

16-
1716
import { Order } from '../model/order';
1817

1918

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class UserService implements UserServiceInterface {
6868
public createUser(body: User, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
6969
public createUser(body: User, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
7070
public createUser(body: User, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
71+
7172
if (body === null || body === undefined) {
7273
throw new Error('Required parameter body was null or undefined when calling createUser.');
7374
}
@@ -114,6 +115,7 @@ export class UserService implements UserServiceInterface {
114115
public createUsersWithArrayInput(body: Array<User>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
115116
public createUsersWithArrayInput(body: Array<User>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
116117
public createUsersWithArrayInput(body: Array<User>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
118+
117119
if (body === null || body === undefined) {
118120
throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.');
119121
}
@@ -160,6 +162,7 @@ export class UserService implements UserServiceInterface {
160162
public createUsersWithListInput(body: Array<User>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
161163
public createUsersWithListInput(body: Array<User>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
162164
public createUsersWithListInput(body: Array<User>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
165+
163166
if (body === null || body === undefined) {
164167
throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.');
165168
}
@@ -206,6 +209,7 @@ export class UserService implements UserServiceInterface {
206209
public deleteUser(username: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
207210
public deleteUser(username: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
208211
public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
212+
209213
if (username === null || username === undefined) {
210214
throw new Error('Required parameter username was null or undefined when calling deleteUser.');
211215
}
@@ -247,6 +251,7 @@ export class UserService implements UserServiceInterface {
247251
public getUserByName(username: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<User>>;
248252
public getUserByName(username: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<User>>;
249253
public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
254+
250255
if (username === null || username === undefined) {
251256
throw new Error('Required parameter username was null or undefined when calling getUserByName.');
252257
}
@@ -289,9 +294,11 @@ export class UserService implements UserServiceInterface {
289294
public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<string>>;
290295
public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<string>>;
291296
public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
297+
292298
if (username === null || username === undefined) {
293299
throw new Error('Required parameter username was null or undefined when calling loginUser.');
294300
}
301+
295302
if (password === null || password === undefined) {
296303
throw new Error('Required parameter password was null or undefined when calling loginUser.');
297304
}
@@ -380,9 +387,11 @@ export class UserService implements UserServiceInterface {
380387
public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
381388
public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
382389
public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
390+
383391
if (username === null || username === undefined) {
384392
throw new Error('Required parameter username was null or undefined when calling updateUser.');
385393
}
394+
386395
if (body === null || body === undefined) {
387396
throw new Error('Required parameter body was null or undefined when calling updateUser.');
388397
}

samples/client/petstore/typescript-angular-v5/with-interfaces/api/user.serviceInterface.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { HttpHeaders } from '@angular/comm
1313

1414
import { Observable } from 'rxjs/Observable';
1515

16-
1716
import { User } from '../model/user';
1817

1918

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-v5/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)