/** * 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 { CatalogDataPriceUpdateResultInterface } from '../model/catalogDataPriceUpdateResultInterface'; import { CatalogDataTierPriceInterface } from '../model/catalogDataTierPriceInterface'; import { CatalogTierPriceStorageV1DeletePostBody } from '../model/catalogTierPriceStorageV1DeletePostBody'; import { CatalogTierPriceStorageV1GetPostBody } from '../model/catalogTierPriceStorageV1GetPostBody'; import { CatalogTierPriceStorageV1ReplacePutBody } from '../model/catalogTierPriceStorageV1ReplacePutBody'; import { CatalogTierPriceStorageV1UpdatePostBody } from '../model/catalogTierPriceStorageV1UpdatePostBody'; import { ErrorResponse } from '../model/errorResponse'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; @Injectable() export class CatalogTierPriceStorageV1Service { 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; } /** * * Delete product tier prices. If any items will have invalid price, price type, website id, sku, customer group or quantity, they will be marked as failed and excluded from delete list and \\Magento\\Catalog\\Api\\Data\\PriceUpdateResultInterface[] with problem description will be returned. If there were no failed items during update empty array will be returned. If error occurred during the update exception will be thrown. * @param catalogTierPriceStorageV1DeletePostBody * @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 catalogTierPriceStorageV1DeletePost(catalogTierPriceStorageV1DeletePostBody?: CatalogTierPriceStorageV1DeletePostBody, observe?: 'body', reportProgress?: boolean): Observable>; public catalogTierPriceStorageV1DeletePost(catalogTierPriceStorageV1DeletePostBody?: CatalogTierPriceStorageV1DeletePostBody, observe?: 'response', reportProgress?: boolean): Observable>>; public catalogTierPriceStorageV1DeletePost(catalogTierPriceStorageV1DeletePostBody?: CatalogTierPriceStorageV1DeletePostBody, observe?: 'events', reportProgress?: boolean): Observable>>; public catalogTierPriceStorageV1DeletePost(catalogTierPriceStorageV1DeletePostBody?: CatalogTierPriceStorageV1DeletePostBody, 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/products/tier-prices-delete`, catalogTierPriceStorageV1DeletePostBody, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Return product prices. In case of at least one of skus is not found exception will be thrown. * @param catalogTierPriceStorageV1GetPostBody * @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 catalogTierPriceStorageV1GetPost(catalogTierPriceStorageV1GetPostBody?: CatalogTierPriceStorageV1GetPostBody, observe?: 'body', reportProgress?: boolean): Observable>; public catalogTierPriceStorageV1GetPost(catalogTierPriceStorageV1GetPostBody?: CatalogTierPriceStorageV1GetPostBody, observe?: 'response', reportProgress?: boolean): Observable>>; public catalogTierPriceStorageV1GetPost(catalogTierPriceStorageV1GetPostBody?: CatalogTierPriceStorageV1GetPostBody, observe?: 'events', reportProgress?: boolean): Observable>>; public catalogTierPriceStorageV1GetPost(catalogTierPriceStorageV1GetPostBody?: CatalogTierPriceStorageV1GetPostBody, 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/products/tier-prices-information`, catalogTierPriceStorageV1GetPostBody, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Remove existing tier prices and replace them with the new ones. If any items will have invalid price, price type, website id, sku, customer group or quantity, they will be marked as failed and excluded from replace list and \\Magento\\Catalog\\Api\\Data\\PriceUpdateResultInterface[] with problem description will be returned. If there were no failed items during update empty array will be returned. If error occurred during the update exception will be thrown. * @param catalogTierPriceStorageV1ReplacePutBody * @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 catalogTierPriceStorageV1ReplacePut(catalogTierPriceStorageV1ReplacePutBody?: CatalogTierPriceStorageV1ReplacePutBody, observe?: 'body', reportProgress?: boolean): Observable>; public catalogTierPriceStorageV1ReplacePut(catalogTierPriceStorageV1ReplacePutBody?: CatalogTierPriceStorageV1ReplacePutBody, observe?: 'response', reportProgress?: boolean): Observable>>; public catalogTierPriceStorageV1ReplacePut(catalogTierPriceStorageV1ReplacePutBody?: CatalogTierPriceStorageV1ReplacePutBody, observe?: 'events', reportProgress?: boolean): Observable>>; public catalogTierPriceStorageV1ReplacePut(catalogTierPriceStorageV1ReplacePutBody?: CatalogTierPriceStorageV1ReplacePutBody, 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.put>(`${this.basePath}/V1/products/tier-prices`, catalogTierPriceStorageV1ReplacePutBody, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Add or update product prices. If any items will have invalid price, price type, website id, sku, customer group or quantity, they will be marked as failed and excluded from update list and \\Magento\\Catalog\\Api\\Data\\PriceUpdateResultInterface[] with problem description will be returned. If there were no failed items during update empty array will be returned. If error occurred during the update exception will be thrown. * @param catalogTierPriceStorageV1UpdatePostBody * @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 catalogTierPriceStorageV1UpdatePost(catalogTierPriceStorageV1UpdatePostBody?: CatalogTierPriceStorageV1UpdatePostBody, observe?: 'body', reportProgress?: boolean): Observable>; public catalogTierPriceStorageV1UpdatePost(catalogTierPriceStorageV1UpdatePostBody?: CatalogTierPriceStorageV1UpdatePostBody, observe?: 'response', reportProgress?: boolean): Observable>>; public catalogTierPriceStorageV1UpdatePost(catalogTierPriceStorageV1UpdatePostBody?: CatalogTierPriceStorageV1UpdatePostBody, observe?: 'events', reportProgress?: boolean): Observable>>; public catalogTierPriceStorageV1UpdatePost(catalogTierPriceStorageV1UpdatePostBody?: CatalogTierPriceStorageV1UpdatePostBody, 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/products/tier-prices`, catalogTierPriceStorageV1UpdatePostBody, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } }