/** * Innertickets API * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: v1 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ /* tslint:disable:no-unused-variable member-ordering */ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, HttpResponse, HttpEvent } from '@angular/common/http'; import { CustomHttpUrlEncodingCodec } from '../encoder'; import { Observable } from 'rxjs/Observable'; import { BasketItemVM } from '../model/basketItemVM'; import { BasketVM } from '../model/basketVM'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; @Injectable() export class BasketItemService { protected basePath = 'https://api.innertickets.com'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { if (basePath) { this.basePath = basePath; } if (configuration) { this.configuration = configuration; this.basePath = basePath || configuration.basePath || this.basePath; } } /** * @param consumes string[] mime-types * @return true: consumes contains 'multipart/form-data', false: otherwise */ private canConsumeForm(consumes: string[]): boolean { const form = 'multipart/form-data'; for (let consume of consumes) { if (form === consume) { return true; } } return false; } /** * * * @param basketId * @param lineId * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public basketItemGetBasketItem(basketId: string, lineId: string, observe?: 'body', reportProgress?: boolean): Observable; public basketItemGetBasketItem(basketId: string, lineId: string, observe?: 'response', reportProgress?: boolean): Observable>; public basketItemGetBasketItem(basketId: string, lineId: string, observe?: 'events', reportProgress?: boolean): Observable>; public basketItemGetBasketItem(basketId: string, lineId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { if (basketId === null || basketId === undefined) { throw new Error('Required parameter basketId was null or undefined when calling basketItemGetBasketItem.'); } if (lineId === null || lineId === undefined) { throw new Error('Required parameter lineId was null or undefined when calling basketItemGetBasketItem.'); } let headers = this.defaultHeaders; // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/json', 'text/json', 'application/xml', 'text/xml' ]; let httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set("Accept", httpHeaderAcceptSelected); } // to determine the Content-Type header let consumes: string[] = [ ]; return this.httpClient.get(`${this.basePath}/account/basket/${encodeURIComponent(String(basketId))}/item/${encodeURIComponent(String(lineId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * * @param basketId * @param lineId * @param basketItem * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public basketItemPut(basketId: string, lineId: string, basketItem: BasketItemVM, observe?: 'body', reportProgress?: boolean): Observable; public basketItemPut(basketId: string, lineId: string, basketItem: BasketItemVM, observe?: 'response', reportProgress?: boolean): Observable>; public basketItemPut(basketId: string, lineId: string, basketItem: BasketItemVM, observe?: 'events', reportProgress?: boolean): Observable>; public basketItemPut(basketId: string, lineId: string, basketItem: BasketItemVM, observe: any = 'body', reportProgress: boolean = false ): Observable { if (basketId === null || basketId === undefined) { throw new Error('Required parameter basketId was null or undefined when calling basketItemPut.'); } if (lineId === null || lineId === undefined) { throw new Error('Required parameter lineId was null or undefined when calling basketItemPut.'); } if (basketItem === null || basketItem === undefined) { throw new Error('Required parameter basketItem was null or undefined when calling basketItemPut.'); } let headers = this.defaultHeaders; // to determine the Accept header let httpHeaderAccepts: string[] = [ 'application/json', 'text/json', 'application/xml', 'text/xml' ]; let httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); if (httpHeaderAcceptSelected != undefined) { headers = headers.set("Accept", httpHeaderAcceptSelected); } // to determine the Content-Type header let consumes: string[] = [ 'application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded' ]; let httpContentTypeSelected:string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set("Content-Type", httpContentTypeSelected); } return this.httpClient.put(`${this.basePath}/account/basket/${encodeURIComponent(String(basketId))}/item/${encodeURIComponent(String(lineId))}`, basketItem, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } }