/** * Magento Community * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) * * OpenAPI spec version: 2.2 * * * 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 { ErrorResponse } from '../model/errorResponse'; import { QuoteCartItemRepositoryV1SavePostBody } from '../model/quoteCartItemRepositoryV1SavePostBody'; import { QuoteCartItemRepositoryV1SavePostBody1 } from '../model/quoteCartItemRepositoryV1SavePostBody1'; import { QuoteCartItemRepositoryV1SavePutBody } from '../model/quoteCartItemRepositoryV1SavePutBody'; import { QuoteCartItemRepositoryV1SavePutBody1 } from '../model/quoteCartItemRepositoryV1SavePutBody1'; import { QuoteDataCartItemInterface } from '../model/quoteDataCartItemInterface'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; @Injectable() export class QuoteCartItemRepositoryV1Service { protected basePath = 'http://shop.sergiofabbri.com/rest'; 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; } /** * * Removes the specified item from the specified cart. * @param cartId The cart ID. * @param itemId The item ID of the item to be removed. * @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 quoteCartItemRepositoryV1DeleteByIdDelete(cartId: number, itemId: number, observe?: 'body', reportProgress?: boolean): Observable; public quoteCartItemRepositoryV1DeleteByIdDelete(cartId: number, itemId: number, observe?: 'response', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1DeleteByIdDelete(cartId: number, itemId: number, observe?: 'events', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1DeleteByIdDelete(cartId: number, itemId: number, observe: any = 'body', reportProgress: boolean = false ): Observable { if (cartId === null || cartId === undefined) { throw new Error('Required parameter cartId was null or undefined when calling quoteCartItemRepositoryV1DeleteByIdDelete.'); } if (itemId === null || itemId === undefined) { throw new Error('Required parameter itemId was null or undefined when calling quoteCartItemRepositoryV1DeleteByIdDelete.'); } let headers = this.defaultHeaders; // to determine the Accept header let httpHeaderAccepts: string[] = [ ]; 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.delete(`${this.basePath}/V1/carts/${encodeURIComponent(String(cartId))}/items/${encodeURIComponent(String(itemId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Removes the specified item from the specified cart. * @param itemId The item ID of the item to be removed. * @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 quoteCartItemRepositoryV1DeleteByIdDelete_1(itemId: number, observe?: 'body', reportProgress?: boolean): Observable; public quoteCartItemRepositoryV1DeleteByIdDelete_1(itemId: number, observe?: 'response', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1DeleteByIdDelete_1(itemId: number, observe?: 'events', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1DeleteByIdDelete_1(itemId: number, observe: any = 'body', reportProgress: boolean = false ): Observable { if (itemId === null || itemId === undefined) { throw new Error('Required parameter itemId was null or undefined when calling quoteCartItemRepositoryV1DeleteByIdDelete_1.'); } let headers = this.defaultHeaders; // to determine the Accept header let httpHeaderAccepts: string[] = [ ]; 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.delete(`${this.basePath}/V1/carts/mine/items/${encodeURIComponent(String(itemId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Lists items that are assigned to a specified cart. * @param cartId The cart ID. * @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 quoteCartItemRepositoryV1GetListGet(cartId: number, observe?: 'body', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1GetListGet(cartId: number, observe?: 'response', reportProgress?: boolean): Observable>>; public quoteCartItemRepositoryV1GetListGet(cartId: number, observe?: 'events', reportProgress?: boolean): Observable>>; public quoteCartItemRepositoryV1GetListGet(cartId: number, observe: any = 'body', reportProgress: boolean = false ): Observable { if (cartId === null || cartId === undefined) { throw new Error('Required parameter cartId was null or undefined when calling quoteCartItemRepositoryV1GetListGet.'); } let headers = this.defaultHeaders; // to determine the Accept header let httpHeaderAccepts: string[] = [ ]; 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}/V1/carts/${encodeURIComponent(String(cartId))}/items`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Lists items that are assigned to a specified cart. * @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 quoteCartItemRepositoryV1GetListGet_2(observe?: 'body', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1GetListGet_2(observe?: 'response', reportProgress?: boolean): Observable>>; public quoteCartItemRepositoryV1GetListGet_2(observe?: 'events', reportProgress?: boolean): Observable>>; public quoteCartItemRepositoryV1GetListGet_2(observe: any = 'body', reportProgress: boolean = false ): Observable { let headers = this.defaultHeaders; // to determine the Accept header let httpHeaderAccepts: string[] = [ ]; 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}/V1/carts/mine/items`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Add/update the specified cart item. * @param quoteId * @param quoteCartItemRepositoryV1SavePostBody * @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 quoteCartItemRepositoryV1SavePost(quoteId: string, quoteCartItemRepositoryV1SavePostBody?: QuoteCartItemRepositoryV1SavePostBody, observe?: 'body', reportProgress?: boolean): Observable; public quoteCartItemRepositoryV1SavePost(quoteId: string, quoteCartItemRepositoryV1SavePostBody?: QuoteCartItemRepositoryV1SavePostBody, observe?: 'response', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1SavePost(quoteId: string, quoteCartItemRepositoryV1SavePostBody?: QuoteCartItemRepositoryV1SavePostBody, observe?: 'events', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1SavePost(quoteId: string, quoteCartItemRepositoryV1SavePostBody?: QuoteCartItemRepositoryV1SavePostBody, observe: any = 'body', reportProgress: boolean = false ): Observable { if (quoteId === null || quoteId === undefined) { throw new Error('Required parameter quoteId was null or undefined when calling quoteCartItemRepositoryV1SavePost.'); } let headers = this.defaultHeaders; // to determine the Accept header let httpHeaderAccepts: string[] = [ ]; 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[] = [ ]; let httpContentTypeSelected:string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set("Content-Type", httpContentTypeSelected); } return this.httpClient.post(`${this.basePath}/V1/carts/${encodeURIComponent(String(quoteId))}/items`, quoteCartItemRepositoryV1SavePostBody, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Add/update the specified cart item. * @param quoteCartItemRepositoryV1SavePostBody * @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 quoteCartItemRepositoryV1SavePost_3(quoteCartItemRepositoryV1SavePostBody?: QuoteCartItemRepositoryV1SavePostBody1, observe?: 'body', reportProgress?: boolean): Observable; public quoteCartItemRepositoryV1SavePost_3(quoteCartItemRepositoryV1SavePostBody?: QuoteCartItemRepositoryV1SavePostBody1, observe?: 'response', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1SavePost_3(quoteCartItemRepositoryV1SavePostBody?: QuoteCartItemRepositoryV1SavePostBody1, observe?: 'events', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1SavePost_3(quoteCartItemRepositoryV1SavePostBody?: QuoteCartItemRepositoryV1SavePostBody1, observe: any = 'body', reportProgress: boolean = false ): Observable { let headers = this.defaultHeaders; // to determine the Accept header let httpHeaderAccepts: string[] = [ ]; 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[] = [ ]; let httpContentTypeSelected:string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set("Content-Type", httpContentTypeSelected); } return this.httpClient.post(`${this.basePath}/V1/carts/mine/items`, quoteCartItemRepositoryV1SavePostBody, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Add/update the specified cart item. * @param cartId * @param itemId * @param quoteCartItemRepositoryV1SavePutBody * @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 quoteCartItemRepositoryV1SavePut(cartId: string, itemId: string, quoteCartItemRepositoryV1SavePutBody?: QuoteCartItemRepositoryV1SavePutBody, observe?: 'body', reportProgress?: boolean): Observable; public quoteCartItemRepositoryV1SavePut(cartId: string, itemId: string, quoteCartItemRepositoryV1SavePutBody?: QuoteCartItemRepositoryV1SavePutBody, observe?: 'response', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1SavePut(cartId: string, itemId: string, quoteCartItemRepositoryV1SavePutBody?: QuoteCartItemRepositoryV1SavePutBody, observe?: 'events', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1SavePut(cartId: string, itemId: string, quoteCartItemRepositoryV1SavePutBody?: QuoteCartItemRepositoryV1SavePutBody, observe: any = 'body', reportProgress: boolean = false ): Observable { if (cartId === null || cartId === undefined) { throw new Error('Required parameter cartId was null or undefined when calling quoteCartItemRepositoryV1SavePut.'); } if (itemId === null || itemId === undefined) { throw new Error('Required parameter itemId was null or undefined when calling quoteCartItemRepositoryV1SavePut.'); } let headers = this.defaultHeaders; // to determine the Accept header let httpHeaderAccepts: string[] = [ ]; 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[] = [ ]; let httpContentTypeSelected:string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set("Content-Type", httpContentTypeSelected); } return this.httpClient.put(`${this.basePath}/V1/carts/${encodeURIComponent(String(cartId))}/items/${encodeURIComponent(String(itemId))}`, quoteCartItemRepositoryV1SavePutBody, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Add/update the specified cart item. * @param itemId * @param quoteCartItemRepositoryV1SavePutBody * @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 quoteCartItemRepositoryV1SavePut_4(itemId: string, quoteCartItemRepositoryV1SavePutBody?: QuoteCartItemRepositoryV1SavePutBody1, observe?: 'body', reportProgress?: boolean): Observable; public quoteCartItemRepositoryV1SavePut_4(itemId: string, quoteCartItemRepositoryV1SavePutBody?: QuoteCartItemRepositoryV1SavePutBody1, observe?: 'response', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1SavePut_4(itemId: string, quoteCartItemRepositoryV1SavePutBody?: QuoteCartItemRepositoryV1SavePutBody1, observe?: 'events', reportProgress?: boolean): Observable>; public quoteCartItemRepositoryV1SavePut_4(itemId: string, quoteCartItemRepositoryV1SavePutBody?: QuoteCartItemRepositoryV1SavePutBody1, observe: any = 'body', reportProgress: boolean = false ): Observable { if (itemId === null || itemId === undefined) { throw new Error('Required parameter itemId was null or undefined when calling quoteCartItemRepositoryV1SavePut_4.'); } let headers = this.defaultHeaders; // to determine the Accept header let httpHeaderAccepts: string[] = [ ]; 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[] = [ ]; let httpContentTypeSelected:string | undefined = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected != undefined) { headers = headers.set("Content-Type", httpContentTypeSelected); } return this.httpClient.put(`${this.basePath}/V1/carts/mine/items/${encodeURIComponent(String(itemId))}`, quoteCartItemRepositoryV1SavePutBody, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } }