/* tslint:disable */ /* eslint-disable */ /** * My API * API documentation for my Laravel app * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime'; import type { AttachSuppliersToStoreRequest, CreateStoreRequest, DetachSuppliersFromStoreRequest, GenericResponse, PaginatedStoreListResourceResponse, SearchAllStoresRequest, SearchStoresRequest, StoreListResourceArrayResponse, StoreResource, StoreSpecialDateRequest, StoreSpecialDateResource, UpdateStoreRequest, } from '../models/index'; import { AttachSuppliersToStoreRequestFromJSON, AttachSuppliersToStoreRequestToJSON, CreateStoreRequestFromJSON, CreateStoreRequestToJSON, DetachSuppliersFromStoreRequestFromJSON, DetachSuppliersFromStoreRequestToJSON, GenericResponseFromJSON, GenericResponseToJSON, PaginatedStoreListResourceResponseFromJSON, PaginatedStoreListResourceResponseToJSON, SearchAllStoresRequestFromJSON, SearchAllStoresRequestToJSON, SearchStoresRequestFromJSON, SearchStoresRequestToJSON, StoreListResourceArrayResponseFromJSON, StoreListResourceArrayResponseToJSON, StoreResourceFromJSON, StoreResourceToJSON, StoreSpecialDateRequestFromJSON, StoreSpecialDateRequestToJSON, StoreSpecialDateResourceFromJSON, StoreSpecialDateResourceToJSON, UpdateStoreRequestFromJSON, UpdateStoreRequestToJSON, } from '../models/index'; export interface AttachSuppliersStoreRequest { store: number; attachSuppliersToStoreRequest?: AttachSuppliersToStoreRequest; } export interface DestroyStoreRequest { store: number; } export interface DestroyStoreSpecialDateRequest { store: number; storeSpecialDate: number; } export interface DetachSuppliersStoreRequest { store: number; detachSuppliersFromStoreRequest?: DetachSuppliersFromStoreRequest; } export interface GetAllStoreRequest { searchAllStoresRequest?: SearchAllStoresRequest; } export interface IndexStoreRequest { searchStoresRequest?: SearchStoresRequest; } export interface ShowStoreRequest { store: number; } export interface StoreStoreRequest { createStoreRequest?: CreateStoreRequest; } export interface StoreStoreSpecialDateRequest { store: number; storeSpecialDateRequest?: StoreSpecialDateRequest; } export interface UpdateStoreOperationRequest { store: number; updateStoreRequest?: UpdateStoreRequest; } export interface UpdateStoreSpecialDateRequest { store: number; storeSpecialDate: number; storeSpecialDateRequest?: StoreSpecialDateRequest; } /** * */ export class StoreApi extends runtime.BaseAPI { /** * Auto-generated: attachSuppliersStore */ async attachSuppliersStoreRaw(requestParameters: AttachSuppliersStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['store'] == null) { throw new runtime.RequiredError( 'store', 'Required parameter "store" was null or undefined when calling attachSuppliersStore().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/store/{store}/attach-suppliers`; urlPath = urlPath.replace(`{${"store"}}`, encodeURIComponent(String(requestParameters['store']))); const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: AttachSuppliersToStoreRequestToJSON(requestParameters['attachSuppliersToStoreRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => StoreResourceFromJSON(jsonValue)); } /** * Auto-generated: attachSuppliersStore */ async attachSuppliersStore(requestParameters: AttachSuppliersStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.attachSuppliersStoreRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: destroyStore */ async destroyStoreRaw(requestParameters: DestroyStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['store'] == null) { throw new runtime.RequiredError( 'store', 'Required parameter "store" was null or undefined when calling destroyStore().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; let urlPath = `/admin-api/store/{store}/delete`; urlPath = urlPath.replace(`{${"store"}}`, encodeURIComponent(String(requestParameters['store']))); const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => GenericResponseFromJSON(jsonValue)); } /** * Auto-generated: destroyStore */ async destroyStore(requestParameters: DestroyStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.destroyStoreRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: destroyStoreSpecialDate */ async destroyStoreSpecialDateRaw(requestParameters: DestroyStoreSpecialDateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['store'] == null) { throw new runtime.RequiredError( 'store', 'Required parameter "store" was null or undefined when calling destroyStoreSpecialDate().' ); } if (requestParameters['storeSpecialDate'] == null) { throw new runtime.RequiredError( 'storeSpecialDate', 'Required parameter "storeSpecialDate" was null or undefined when calling destroyStoreSpecialDate().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; let urlPath = `/admin-api/store/{store}/special-dates/{storeSpecialDate}`; urlPath = urlPath.replace(`{${"store"}}`, encodeURIComponent(String(requestParameters['store']))); urlPath = urlPath.replace(`{${"storeSpecialDate"}}`, encodeURIComponent(String(requestParameters['storeSpecialDate']))); const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => GenericResponseFromJSON(jsonValue)); } /** * Auto-generated: destroyStoreSpecialDate */ async destroyStoreSpecialDate(requestParameters: DestroyStoreSpecialDateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.destroyStoreSpecialDateRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: detachSuppliersStore */ async detachSuppliersStoreRaw(requestParameters: DetachSuppliersStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['store'] == null) { throw new runtime.RequiredError( 'store', 'Required parameter "store" was null or undefined when calling detachSuppliersStore().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/store/{store}/detach-suppliers`; urlPath = urlPath.replace(`{${"store"}}`, encodeURIComponent(String(requestParameters['store']))); const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: DetachSuppliersFromStoreRequestToJSON(requestParameters['detachSuppliersFromStoreRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => StoreResourceFromJSON(jsonValue)); } /** * Auto-generated: detachSuppliersStore */ async detachSuppliersStore(requestParameters: DetachSuppliersStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.detachSuppliersStoreRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: getAllStore */ async getAllStoreRaw(requestParameters: GetAllStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/store/all`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: SearchAllStoresRequestToJSON(requestParameters['searchAllStoresRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => StoreListResourceArrayResponseFromJSON(jsonValue)); } /** * Auto-generated: getAllStore */ async getAllStore(requestParameters: GetAllStoreRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.getAllStoreRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: indexStore */ async indexStoreRaw(requestParameters: IndexStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/store/list`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: SearchStoresRequestToJSON(requestParameters['searchStoresRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedStoreListResourceResponseFromJSON(jsonValue)); } /** * Auto-generated: indexStore */ async indexStore(requestParameters: IndexStoreRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.indexStoreRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: showStore */ async showStoreRaw(requestParameters: ShowStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['store'] == null) { throw new runtime.RequiredError( 'store', 'Required parameter "store" was null or undefined when calling showStore().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; let urlPath = `/admin-api/store/{store}`; urlPath = urlPath.replace(`{${"store"}}`, encodeURIComponent(String(requestParameters['store']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => StoreResourceFromJSON(jsonValue)); } /** * Auto-generated: showStore */ async showStore(requestParameters: ShowStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.showStoreRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: storeStore */ async storeStoreRaw(requestParameters: StoreStoreRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/store/create`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: CreateStoreRequestToJSON(requestParameters['createStoreRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => StoreResourceFromJSON(jsonValue)); } /** * Auto-generated: storeStore */ async storeStore(requestParameters: StoreStoreRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.storeStoreRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: storeStoreSpecialDate */ async storeStoreSpecialDateRaw(requestParameters: StoreStoreSpecialDateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['store'] == null) { throw new runtime.RequiredError( 'store', 'Required parameter "store" was null or undefined when calling storeStoreSpecialDate().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/store/{store}/special-dates`; urlPath = urlPath.replace(`{${"store"}}`, encodeURIComponent(String(requestParameters['store']))); const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: StoreSpecialDateRequestToJSON(requestParameters['storeSpecialDateRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => StoreSpecialDateResourceFromJSON(jsonValue)); } /** * Auto-generated: storeStoreSpecialDate */ async storeStoreSpecialDate(requestParameters: StoreStoreSpecialDateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.storeStoreSpecialDateRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: updateStore */ async updateStoreRaw(requestParameters: UpdateStoreOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['store'] == null) { throw new runtime.RequiredError( 'store', 'Required parameter "store" was null or undefined when calling updateStore().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/store/{store}/update`; urlPath = urlPath.replace(`{${"store"}}`, encodeURIComponent(String(requestParameters['store']))); const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: UpdateStoreRequestToJSON(requestParameters['updateStoreRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => StoreResourceFromJSON(jsonValue)); } /** * Auto-generated: updateStore */ async updateStore(requestParameters: UpdateStoreOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.updateStoreRaw(requestParameters, initOverrides); return await response.value(); } /** * Auto-generated: updateStoreSpecialDate */ async updateStoreSpecialDateRaw(requestParameters: UpdateStoreSpecialDateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['store'] == null) { throw new runtime.RequiredError( 'store', 'Required parameter "store" was null or undefined when calling updateStoreSpecialDate().' ); } if (requestParameters['storeSpecialDate'] == null) { throw new runtime.RequiredError( 'storeSpecialDate', 'Required parameter "storeSpecialDate" was null or undefined when calling updateStoreSpecialDate().' ); } const queryParameters: any = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; let urlPath = `/admin-api/store/{store}/special-dates/{storeSpecialDate}`; urlPath = urlPath.replace(`{${"store"}}`, encodeURIComponent(String(requestParameters['store']))); urlPath = urlPath.replace(`{${"storeSpecialDate"}}`, encodeURIComponent(String(requestParameters['storeSpecialDate']))); const response = await this.request({ path: urlPath, method: 'PUT', headers: headerParameters, query: queryParameters, body: StoreSpecialDateRequestToJSON(requestParameters['storeSpecialDateRequest']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => StoreSpecialDateResourceFromJSON(jsonValue)); } /** * Auto-generated: updateStoreSpecialDate */ async updateStoreSpecialDate(requestParameters: UpdateStoreSpecialDateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.updateStoreSpecialDateRaw(requestParameters, initOverrides); return await response.value(); } }