Skip to content

Commit

Permalink
updates samples
Browse files Browse the repository at this point in the history
  • Loading branch information
dage authored and dage committed Nov 13, 2019
1 parent 7a1bc48 commit 8c5bfd9
Show file tree
Hide file tree
Showing 63 changed files with 814 additions and 455 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables'
import { Configuration } from '../configuration';



@Injectable()
export class PetService {

Expand Down Expand Up @@ -64,10 +65,11 @@ export class PetService {
/**
*
* @summary Add a new pet to the store
* @param body Pet object that needs to be added to the store
* @param pet Pet object that needs to be added to the store
*/
public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
return this.addPetWithHttpInfo(body, extraHttpRequestParams)
public addPet(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
return this.addPetWithHttpInfo(pet, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
return undefined;
Expand All @@ -80,6 +82,7 @@ export class PetService {
/**
*
* @summary Deletes a pet
* @param petId Pet id to delete
* @param apiKey
*/
Expand All @@ -97,6 +100,7 @@ export class PetService {
/**
* Multiple status values can be provided with comma separated strings
* @summary Finds Pets by status
* @param status Status values that need to be considered for filter
*/
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable<Array<Pet>> {
Expand All @@ -113,6 +117,7 @@ export class PetService {
/**
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* @param tags Tags to filter by
*/
public findPetsByTags(tags: Array<string>, extraHttpRequestParams?: RequestOptionsArgs): Observable<Array<Pet>> {
Expand All @@ -129,6 +134,7 @@ export class PetService {
/**
* Returns a single pet
* @summary Find pet by ID
* @param petId ID of pet to return
*/
public getPetById(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable<Pet> {
Expand All @@ -145,10 +151,11 @@ export class PetService {
/**
*
* @summary Update an existing pet
* @param body Pet object that needs to be added to the store
* @param pet Pet object that needs to be added to the store
*/
public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
return this.updatePetWithHttpInfo(body, extraHttpRequestParams)
public updatePet(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
return this.updatePetWithHttpInfo(pet, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
return undefined;
Expand All @@ -161,6 +168,7 @@ export class PetService {
/**
*
* @summary Updates a pet in the store with form data
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet
* @param status Updated status of the pet
Expand All @@ -179,6 +187,7 @@ export class PetService {
/**
*
* @summary uploads an image
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
Expand All @@ -197,12 +206,11 @@ export class PetService {

/**
* Add a new pet to the store
* @param body Pet object that needs to be added to the store
* @param pet Pet object that needs to be added to the store
*/
public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling addPet.');
public addPetWithHttpInfo(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (pet === null || pet === undefined) {
throw new Error('Required parameter pet was null or undefined when calling addPet.');
}

let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
Expand Down Expand Up @@ -237,7 +245,7 @@ export class PetService {
let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Post,
headers: headers,
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
body: pet == null ? '' : JSON.stringify(pet), // https://github.com/angular/angular/issues/10612
withCredentials:this.configuration.withCredentials
});
// issues#4037
Expand All @@ -252,7 +260,6 @@ export class PetService {
* Deletes a pet
* @param petId Pet id to delete
* @param apiKey
*/
public deletePetWithHttpInfo(petId: number, apiKey?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (petId === null || petId === undefined) {
Expand Down Expand Up @@ -298,7 +305,6 @@ export class PetService {
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter
*/
public findPetsByStatusWithHttpInfo(status: Array<'available' | 'pending' | 'sold'>, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (status === null || status === undefined) {
Expand Down Expand Up @@ -349,7 +355,6 @@ export class PetService {
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by
*/
public findPetsByTagsWithHttpInfo(tags: Array<string>, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (tags === null || tags === undefined) {
Expand Down Expand Up @@ -400,7 +405,6 @@ export class PetService {
* Find pet by ID
* Returns a single pet
* @param petId ID of pet to return
*/
public getPetByIdWithHttpInfo(petId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (petId === null || petId === undefined) {
Expand Down Expand Up @@ -440,12 +444,11 @@ export class PetService {

/**
* Update an existing pet
* @param body Pet object that needs to be added to the store
* @param pet Pet object that needs to be added to the store
*/
public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling updatePet.');
public updatePetWithHttpInfo(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (pet === null || pet === undefined) {
throw new Error('Required parameter pet was null or undefined when calling updatePet.');
}

let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
Expand Down Expand Up @@ -480,7 +483,7 @@ export class PetService {
let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Put,
headers: headers,
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
body: pet == null ? '' : JSON.stringify(pet), // https://github.com/angular/angular/issues/10612
withCredentials:this.configuration.withCredentials
});
// issues#4037
Expand All @@ -496,7 +499,6 @@ export class PetService {
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet
* @param status Updated status of the pet
*/
public updatePetWithFormWithHttpInfo(petId: number, name?: string, status?: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (petId === null || petId === undefined) {
Expand Down Expand Up @@ -567,7 +569,6 @@ export class PetService {
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server
* @param file file to upload
*/
public uploadFileWithHttpInfo(petId: number, additionalMetadata?: string, file?: Blob, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (petId === null || petId === undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { BASE_PATH, COLLECTION_FORMATS } from '../variables'
import { Configuration } from '../configuration';



@Injectable()
export class StoreService {

Expand All @@ -50,6 +51,7 @@ export class StoreService {
/**
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
* @summary Delete purchase order by ID
* @param orderId ID of the order that needs to be deleted
*/
public deleteOrder(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
Expand All @@ -66,6 +68,7 @@ export class StoreService {
/**
* Returns a map of status codes to quantities
* @summary Returns pet inventories by status
*/
public getInventory(extraHttpRequestParams?: RequestOptionsArgs): Observable<{ [key: string]: number; }> {
return this.getInventoryWithHttpInfo(extraHttpRequestParams)
Expand All @@ -81,6 +84,7 @@ export class StoreService {
/**
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
* @summary Find purchase order by ID
* @param orderId ID of pet that needs to be fetched
*/
public getOrderById(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable<Order> {
Expand All @@ -97,10 +101,11 @@ export class StoreService {
/**
*
* @summary Place an order for a pet
* @param body order placed for purchasing the pet
* @param order order placed for purchasing the pet
*/
public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable<Order> {
return this.placeOrderWithHttpInfo(body, extraHttpRequestParams)
public placeOrder(order: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable<Order> {
return this.placeOrderWithHttpInfo(order, extraHttpRequestParams)
.map((response: Response) => {
if (response.status === 204) {
return undefined;
Expand All @@ -115,7 +120,6 @@ export class StoreService {
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted
*/
public deleteOrderWithHttpInfo(orderId: string, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (orderId === null || orderId === undefined) {
Expand Down Expand Up @@ -149,7 +153,6 @@ export class StoreService {
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
*/
public getInventoryWithHttpInfo(extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {

Expand Down Expand Up @@ -187,7 +190,6 @@ export class StoreService {
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched
*/
public getOrderByIdWithHttpInfo(orderId: number, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (orderId === null || orderId === undefined) {
Expand Down Expand Up @@ -222,12 +224,11 @@ export class StoreService {

/**
* Place an order for a pet
* @param body order placed for purchasing the pet
* @param order order placed for purchasing the pet
*/
public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling placeOrder.');
public placeOrderWithHttpInfo(order: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
if (order === null || order === undefined) {
throw new Error('Required parameter order was null or undefined when calling placeOrder.');
}

let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
Expand All @@ -245,6 +246,7 @@ export class StoreService {

// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
Expand All @@ -254,7 +256,7 @@ export class StoreService {
let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Post,
headers: headers,
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
body: order == null ? '' : JSON.stringify(order), // https://github.com/angular/angular/issues/10612
withCredentials:this.configuration.withCredentials
});
// issues#4037
Expand Down
Loading

0 comments on commit 8c5bfd9

Please sign in to comment.