/** * 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 { CatalogInventoryDataStockItemInterface } from '../model/catalogInventoryDataStockItemInterface'; import { CatalogInventoryDataStockStatusCollectionInterface } from '../model/catalogInventoryDataStockStatusCollectionInterface'; import { CatalogInventoryDataStockStatusInterface } from '../model/catalogInventoryDataStockStatusInterface'; import { CatalogInventoryStockRegistryV1UpdateStockItemBySkuPutBody } from '../model/catalogInventoryStockRegistryV1UpdateStockItemBySkuPutBody'; import { ErrorResponse } from '../model/errorResponse'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; @Injectable() export class CatalogInventoryStockRegistryV1Service { 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; } /** * * Retrieves a list of SKU's with low inventory qty * @param scopeId * @param qty * @param currentPage * @param pageSize * @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 catalogInventoryStockRegistryV1GetLowStockItemsGet(scopeId: number, qty: number, currentPage?: number, pageSize?: number, observe?: 'body', reportProgress?: boolean): Observable; public catalogInventoryStockRegistryV1GetLowStockItemsGet(scopeId: number, qty: number, currentPage?: number, pageSize?: number, observe?: 'response', reportProgress?: boolean): Observable>; public catalogInventoryStockRegistryV1GetLowStockItemsGet(scopeId: number, qty: number, currentPage?: number, pageSize?: number, observe?: 'events', reportProgress?: boolean): Observable>; public catalogInventoryStockRegistryV1GetLowStockItemsGet(scopeId: number, qty: number, currentPage?: number, pageSize?: number, observe: any = 'body', reportProgress: boolean = false ): Observable { if (scopeId === null || scopeId === undefined) { throw new Error('Required parameter scopeId was null or undefined when calling catalogInventoryStockRegistryV1GetLowStockItemsGet.'); } if (qty === null || qty === undefined) { throw new Error('Required parameter qty was null or undefined when calling catalogInventoryStockRegistryV1GetLowStockItemsGet.'); } let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); if (scopeId !== undefined) { queryParameters = queryParameters.set('scopeId', scopeId); } if (qty !== undefined) { queryParameters = queryParameters.set('qty', qty); } if (currentPage !== undefined) { queryParameters = queryParameters.set('currentPage', currentPage); } if (pageSize !== undefined) { queryParameters = queryParameters.set('pageSize', pageSize); } 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/stockItems/lowStock/`, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * * @param productSku * @param scopeId * @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 catalogInventoryStockRegistryV1GetStockItemBySkuGet(productSku: string, scopeId?: number, observe?: 'body', reportProgress?: boolean): Observable; public catalogInventoryStockRegistryV1GetStockItemBySkuGet(productSku: string, scopeId?: number, observe?: 'response', reportProgress?: boolean): Observable>; public catalogInventoryStockRegistryV1GetStockItemBySkuGet(productSku: string, scopeId?: number, observe?: 'events', reportProgress?: boolean): Observable>; public catalogInventoryStockRegistryV1GetStockItemBySkuGet(productSku: string, scopeId?: number, observe: any = 'body', reportProgress: boolean = false ): Observable { if (productSku === null || productSku === undefined) { throw new Error('Required parameter productSku was null or undefined when calling catalogInventoryStockRegistryV1GetStockItemBySkuGet.'); } let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); if (scopeId !== undefined) { queryParameters = queryParameters.set('scopeId', scopeId); } 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/stockItems/${encodeURIComponent(String(productSku))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * * @param productSku * @param scopeId * @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 catalogInventoryStockRegistryV1GetStockStatusBySkuGet(productSku: string, scopeId?: number, observe?: 'body', reportProgress?: boolean): Observable; public catalogInventoryStockRegistryV1GetStockStatusBySkuGet(productSku: string, scopeId?: number, observe?: 'response', reportProgress?: boolean): Observable>; public catalogInventoryStockRegistryV1GetStockStatusBySkuGet(productSku: string, scopeId?: number, observe?: 'events', reportProgress?: boolean): Observable>; public catalogInventoryStockRegistryV1GetStockStatusBySkuGet(productSku: string, scopeId?: number, observe: any = 'body', reportProgress: boolean = false ): Observable { if (productSku === null || productSku === undefined) { throw new Error('Required parameter productSku was null or undefined when calling catalogInventoryStockRegistryV1GetStockStatusBySkuGet.'); } let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); if (scopeId !== undefined) { queryParameters = queryParameters.set('scopeId', scopeId); } 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/stockStatuses/${encodeURIComponent(String(productSku))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * * @param productSku * @param itemId * @param catalogInventoryStockRegistryV1UpdateStockItemBySkuPutBody * @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 catalogInventoryStockRegistryV1UpdateStockItemBySkuPut(productSku: string, itemId: string, catalogInventoryStockRegistryV1UpdateStockItemBySkuPutBody?: CatalogInventoryStockRegistryV1UpdateStockItemBySkuPutBody, observe?: 'body', reportProgress?: boolean): Observable; public catalogInventoryStockRegistryV1UpdateStockItemBySkuPut(productSku: string, itemId: string, catalogInventoryStockRegistryV1UpdateStockItemBySkuPutBody?: CatalogInventoryStockRegistryV1UpdateStockItemBySkuPutBody, observe?: 'response', reportProgress?: boolean): Observable>; public catalogInventoryStockRegistryV1UpdateStockItemBySkuPut(productSku: string, itemId: string, catalogInventoryStockRegistryV1UpdateStockItemBySkuPutBody?: CatalogInventoryStockRegistryV1UpdateStockItemBySkuPutBody, observe?: 'events', reportProgress?: boolean): Observable>; public catalogInventoryStockRegistryV1UpdateStockItemBySkuPut(productSku: string, itemId: string, catalogInventoryStockRegistryV1UpdateStockItemBySkuPutBody?: CatalogInventoryStockRegistryV1UpdateStockItemBySkuPutBody, observe: any = 'body', reportProgress: boolean = false ): Observable { if (productSku === null || productSku === undefined) { throw new Error('Required parameter productSku was null or undefined when calling catalogInventoryStockRegistryV1UpdateStockItemBySkuPut.'); } if (itemId === null || itemId === undefined) { throw new Error('Required parameter itemId was null or undefined when calling catalogInventoryStockRegistryV1UpdateStockItemBySkuPut.'); } 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/${encodeURIComponent(String(productSku))}/stockItems/${encodeURIComponent(String(itemId))}`, catalogInventoryStockRegistryV1UpdateStockItemBySkuPutBody, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } }