/** * 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 { CustomerDataGroupInterface } from '../model/customerDataGroupInterface'; import { CustomerDataGroupSearchResultsInterface } from '../model/customerDataGroupSearchResultsInterface'; import { CustomerGroupRepositoryV1SavePostBody } from '../model/customerGroupRepositoryV1SavePostBody'; import { CustomerGroupRepositoryV1SavePutBody } from '../model/customerGroupRepositoryV1SavePutBody'; import { ErrorResponse } from '../model/errorResponse'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; @Injectable() export class CustomerGroupRepositoryV1Service { 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 customer group by ID. * @param 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 customerGroupRepositoryV1DeleteByIdDelete(id: number, observe?: 'body', reportProgress?: boolean): Observable; public customerGroupRepositoryV1DeleteByIdDelete(id: number, observe?: 'response', reportProgress?: boolean): Observable>; public customerGroupRepositoryV1DeleteByIdDelete(id: number, observe?: 'events', reportProgress?: boolean): Observable>; public customerGroupRepositoryV1DeleteByIdDelete(id: number, observe: any = 'body', reportProgress: boolean = false ): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling customerGroupRepositoryV1DeleteByIdDelete.'); } 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/customerGroups/${encodeURIComponent(String(id))}`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Get customer group by group ID. * @param 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 customerGroupRepositoryV1GetByIdGet(id: number, observe?: 'body', reportProgress?: boolean): Observable; public customerGroupRepositoryV1GetByIdGet(id: number, observe?: 'response', reportProgress?: boolean): Observable>; public customerGroupRepositoryV1GetByIdGet(id: number, observe?: 'events', reportProgress?: boolean): Observable>; public customerGroupRepositoryV1GetByIdGet(id: number, observe: any = 'body', reportProgress: boolean = false ): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling customerGroupRepositoryV1GetByIdGet.'); } 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/customerGroups/${encodeURIComponent(String(id))}`, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Retrieve customer groups. The list of groups can be filtered to exclude the NOT_LOGGED_IN group using the first parameter and/or it can be filtered by tax class. This call returns an array of objects, but detailed information about each object’s attributes might not be included. See http://devdocs.magento.com/codelinks/attributes.html#GroupRepositoryInterface to determine which call to use to get detailed information about all attributes for an object. * @param searchCriteriaFilterGroupsFiltersField Field * @param searchCriteriaFilterGroupsFiltersValue Value * @param searchCriteriaFilterGroupsFiltersConditionType Condition type * @param searchCriteriaSortOrdersField Sorting field. * @param searchCriteriaSortOrdersDirection Sorting direction. * @param searchCriteriaPageSize Page size. * @param searchCriteriaCurrentPage Current page. * @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 customerGroupRepositoryV1GetListGet(searchCriteriaFilterGroupsFiltersField?: string, searchCriteriaFilterGroupsFiltersValue?: string, searchCriteriaFilterGroupsFiltersConditionType?: string, searchCriteriaSortOrdersField?: string, searchCriteriaSortOrdersDirection?: string, searchCriteriaPageSize?: number, searchCriteriaCurrentPage?: number, observe?: 'body', reportProgress?: boolean): Observable; public customerGroupRepositoryV1GetListGet(searchCriteriaFilterGroupsFiltersField?: string, searchCriteriaFilterGroupsFiltersValue?: string, searchCriteriaFilterGroupsFiltersConditionType?: string, searchCriteriaSortOrdersField?: string, searchCriteriaSortOrdersDirection?: string, searchCriteriaPageSize?: number, searchCriteriaCurrentPage?: number, observe?: 'response', reportProgress?: boolean): Observable>; public customerGroupRepositoryV1GetListGet(searchCriteriaFilterGroupsFiltersField?: string, searchCriteriaFilterGroupsFiltersValue?: string, searchCriteriaFilterGroupsFiltersConditionType?: string, searchCriteriaSortOrdersField?: string, searchCriteriaSortOrdersDirection?: string, searchCriteriaPageSize?: number, searchCriteriaCurrentPage?: number, observe?: 'events', reportProgress?: boolean): Observable>; public customerGroupRepositoryV1GetListGet(searchCriteriaFilterGroupsFiltersField?: string, searchCriteriaFilterGroupsFiltersValue?: string, searchCriteriaFilterGroupsFiltersConditionType?: string, searchCriteriaSortOrdersField?: string, searchCriteriaSortOrdersDirection?: string, searchCriteriaPageSize?: number, searchCriteriaCurrentPage?: number, observe: any = 'body', reportProgress: boolean = false ): Observable { let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); if (searchCriteriaFilterGroupsFiltersField !== undefined) { queryParameters = queryParameters.set('searchCriteria[filterGroups][][filters][][field]', searchCriteriaFilterGroupsFiltersField); } if (searchCriteriaFilterGroupsFiltersValue !== undefined) { queryParameters = queryParameters.set('searchCriteria[filterGroups][][filters][][value]', searchCriteriaFilterGroupsFiltersValue); } if (searchCriteriaFilterGroupsFiltersConditionType !== undefined) { queryParameters = queryParameters.set('searchCriteria[filterGroups][][filters][][conditionType]', searchCriteriaFilterGroupsFiltersConditionType); } if (searchCriteriaSortOrdersField !== undefined) { queryParameters = queryParameters.set('searchCriteria[sortOrders][][field]', searchCriteriaSortOrdersField); } if (searchCriteriaSortOrdersDirection !== undefined) { queryParameters = queryParameters.set('searchCriteria[sortOrders][][direction]', searchCriteriaSortOrdersDirection); } if (searchCriteriaPageSize !== undefined) { queryParameters = queryParameters.set('searchCriteria[pageSize]', searchCriteriaPageSize); } if (searchCriteriaCurrentPage !== undefined) { queryParameters = queryParameters.set('searchCriteria[currentPage]', searchCriteriaCurrentPage); } 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/customerGroups/search`, { params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Save customer group. * @param customerGroupRepositoryV1SavePostBody * @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 customerGroupRepositoryV1SavePost(customerGroupRepositoryV1SavePostBody?: CustomerGroupRepositoryV1SavePostBody, observe?: 'body', reportProgress?: boolean): Observable; public customerGroupRepositoryV1SavePost(customerGroupRepositoryV1SavePostBody?: CustomerGroupRepositoryV1SavePostBody, observe?: 'response', reportProgress?: boolean): Observable>; public customerGroupRepositoryV1SavePost(customerGroupRepositoryV1SavePostBody?: CustomerGroupRepositoryV1SavePostBody, observe?: 'events', reportProgress?: boolean): Observable>; public customerGroupRepositoryV1SavePost(customerGroupRepositoryV1SavePostBody?: CustomerGroupRepositoryV1SavePostBody, 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/customerGroups`, customerGroupRepositoryV1SavePostBody, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } /** * * Save customer group. * @param id * @param customerGroupRepositoryV1SavePutBody * @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 customerGroupRepositoryV1SavePut(id: string, customerGroupRepositoryV1SavePutBody?: CustomerGroupRepositoryV1SavePutBody, observe?: 'body', reportProgress?: boolean): Observable; public customerGroupRepositoryV1SavePut(id: string, customerGroupRepositoryV1SavePutBody?: CustomerGroupRepositoryV1SavePutBody, observe?: 'response', reportProgress?: boolean): Observable>; public customerGroupRepositoryV1SavePut(id: string, customerGroupRepositoryV1SavePutBody?: CustomerGroupRepositoryV1SavePutBody, observe?: 'events', reportProgress?: boolean): Observable>; public customerGroupRepositoryV1SavePut(id: string, customerGroupRepositoryV1SavePutBody?: CustomerGroupRepositoryV1SavePutBody, observe: any = 'body', reportProgress: boolean = false ): Observable { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling customerGroupRepositoryV1SavePut.'); } 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/customerGroups/${encodeURIComponent(String(id))}`, customerGroupRepositoryV1SavePutBody, { withCredentials: this.configuration.withCredentials, headers: headers, observe: observe, reportProgress: reportProgress } ); } }