UNPKG

@veeroute/lss-agro-angular

Version:

OpenAPI client for @veeroute/lss-agro-angular

1,143 lines (1,117 loc) 53.8 kB
import * as i0 from '@angular/core'; import { InjectionToken, Optional, Inject, Injectable, SkipSelf, NgModule, makeEnvironmentProviders } from '@angular/core'; import * as i1 from '@angular/common/http'; import { HttpHeaders, HttpContext, HttpParams } from '@angular/common/http'; const BASE_PATH = new InjectionToken('basePath'); const COLLECTION_FORMATS = { 'csv': ',', 'tsv': ' ', 'ssv': ' ', 'pipes': '|' }; /** * Custom HttpParameterCodec * Workaround for https://github.com/angular/angular/issues/18261 */ class CustomHttpParameterCodec { encodeKey(k) { return encodeURIComponent(k); } encodeValue(v) { return encodeURIComponent(v); } decodeKey(k) { return decodeURIComponent(k); } decodeValue(v) { return decodeURIComponent(v); } } class Configuration { /** * @deprecated Since 5.0. Use credentials instead */ apiKeys; username; password; /** * @deprecated Since 5.0. Use credentials instead */ accessToken; basePath; withCredentials; /** * Takes care of encoding query- and form-parameters. */ encoder; /** * Encoding of various path parameter * <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values">styles</a>. * <p> * See {@link README.md} for more details * </p> */ encodeParam; /** * The keys are the names in the securitySchemes section of the OpenAPI * document. They should map to the value used for authentication * minus any standard prefixes such as 'Basic' or 'Bearer'. */ credentials; constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials } = {}) { if (apiKeys) { this.apiKeys = apiKeys; } if (username !== undefined) { this.username = username; } if (password !== undefined) { this.password = password; } if (accessToken !== undefined) { this.accessToken = accessToken; } if (basePath !== undefined) { this.basePath = basePath; } if (withCredentials !== undefined) { this.withCredentials = withCredentials; } if (encoder) { this.encoder = encoder; } this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); this.credentials = credentials ?? {}; // init default ApiKeyAuth credential if (!this.credentials['ApiKeyAuth']) { this.credentials['ApiKeyAuth'] = () => { return typeof this.accessToken === 'function' ? this.accessToken() : this.accessToken; }; } } /** * Select the correct content-type to use for a request. * Uses {@link Configuration#isJsonMime} to determine the correct content-type. * If no content type is found return the first found type if the contentTypes is not empty * @param contentTypes - the array of content types that are available for selection * @returns the selected content-type or <code>undefined</code> if no selection could be made. */ selectHeaderContentType(contentTypes) { if (contentTypes.length === 0) { return undefined; } const type = contentTypes.find((x) => this.isJsonMime(x)); if (type === undefined) { return contentTypes[0]; } return type; } /** * Select the correct accept content-type to use for a request. * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. * If no content type is found return the first found type if the contentTypes is not empty * @param accepts - the array of content types that are available for selection. * @returns the selected content-type or <code>undefined</code> if no selection could be made. */ selectHeaderAccept(accepts) { if (accepts.length === 0) { return undefined; } const type = accepts.find((x) => this.isJsonMime(x)); if (type === undefined) { return accepts[0]; } return type; } /** * Check if the given MIME is a JSON MIME. * JSON MIME examples: * application/json * application/json; charset=UTF8 * APPLICATION/JSON * application/vnd.company+json * @param mime - MIME (Multipurpose Internet Mail Extensions) * @return True if the given MIME is JSON, false otherwise. */ isJsonMime(mime) { const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); } lookupCredential(key) { const value = this.credentials[key]; return typeof value === 'function' ? value() : value; } addCredentialToHeaders(credentialKey, headerName, headers, prefix) { const value = this.lookupCredential(credentialKey); return value ? headers.set(headerName, (prefix ?? '') + value) : headers; } addCredentialToQuery(credentialKey, paramName, query) { const value = this.lookupCredential(credentialKey); return value ? query.set(paramName, value) : query; } defaultEncodeParam(param) { // This implementation exists as fallback for missing configuration // and for backwards compatibility to older typescript-angular generator versions. // It only works for the 'simple' parameter style. // Date-handling only works for the 'date-time' format. // All other styles and Date-formats are probably handled incorrectly. // // But: if that's all you need (i.e.: the most common use-case): no need for customization! const value = param.dataFormat === 'date-time' && param.value instanceof Date ? param.value.toISOString() : param.value; return encodeURIComponent(String(value)); } } /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ class BaseService { basePath = 'https://api.edge7.veeroute.cloud'; defaultHeaders = new HttpHeaders(); configuration; encoder; constructor(basePath, configuration) { this.configuration = configuration || new Configuration(); if (typeof this.configuration.basePath !== 'string') { const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; if (firstBasePath != undefined) { basePath = firstBasePath; } if (typeof basePath !== 'string') { basePath = this.basePath; } this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } canConsumeForm(consumes) { return consumes.indexOf('multipart/form-data') !== -1; } addToHttpParams(httpParams, value, key, isDeep = false) { // If the value is an object (but not a Date), recursively add its keys. if (typeof value === 'object' && !(value instanceof Date)) { return this.addToHttpParamsRecursive(httpParams, value, isDeep ? key : undefined, isDeep); } return this.addToHttpParamsRecursive(httpParams, value, key); } addToHttpParamsRecursive(httpParams, value, key, isDeep = false) { if (value === null || value === undefined) { return httpParams; } if (typeof value === 'object') { // If JSON format is preferred, key must be provided. if (key != null) { return isDeep ? Object.keys(value).reduce((hp, k) => hp.append(`${key}[${k}]`, value[k]), httpParams) : httpParams.append(key, JSON.stringify(value)); } // Otherwise, if it's an array, add each element. if (Array.isArray(value)) { value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); } else if (value instanceof Date) { if (key != null) { httpParams = httpParams.append(key, value.toISOString()); } else { throw Error("key may not be null if value is Date"); } } else { Object.keys(value).forEach(k => { const paramKey = key ? `${key}.${k}` : k; httpParams = this.addToHttpParamsRecursive(httpParams, value[k], paramKey); }); } return httpParams; } else if (key != null) { return httpParams.append(key, value); } throw Error("key may not be null if value is not object or array"); } } /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /* tslint:disable:no-unused-variable member-ordering */ class PlanService extends BaseService { httpClient; constructor(httpClient, basePath, configuration) { super(basePath, configuration); this.httpClient = httpClient; } cancelPlanCalculation(requestParameters, observe = 'body', reportProgress = false, options) { const processCode = requestParameters?.processCode; if (processCode === null || processCode === undefined) { throw new Error('Required parameter processCode was null or undefined when calling cancelPlanCalculation.'); } let localVarHeaders = this.defaultHeaders; // authentication (ApiKeyAuth) required localVarHeaders = this.configuration.addCredentialToHeaders('ApiKeyAuth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ 'application/json' ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext = options?.context ?? new HttpContext(); const localVarTransferCache = options?.transferCache ?? true; let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/agro/plan/calculation-async/${this.configuration.encodeParam({ name: "processCode", value: processCode, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } deletePlanResult(requestParameters, observe = 'body', reportProgress = false, options) { const processCode = requestParameters?.processCode; if (processCode === null || processCode === undefined) { throw new Error('Required parameter processCode was null or undefined when calling deletePlanResult.'); } let localVarHeaders = this.defaultHeaders; // authentication (ApiKeyAuth) required localVarHeaders = this.configuration.addCredentialToHeaders('ApiKeyAuth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ 'application/json' ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext = options?.context ?? new HttpContext(); const localVarTransferCache = options?.transferCache ?? true; let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/agro/plan/result/${this.configuration.encodeParam({ name: "processCode", value: processCode, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('delete', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } readAlgoData(requestParameters, observe = 'body', reportProgress = false, options) { const processCode = requestParameters?.processCode; if (processCode === null || processCode === undefined) { throw new Error('Required parameter processCode was null or undefined when calling readAlgoData.'); } const dataFlowType = requestParameters?.dataFlowType; let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, dataFlowType, 'data_flow_type'); let localVarHeaders = this.defaultHeaders; // authentication (ApiKeyAuth) required localVarHeaders = this.configuration.addCredentialToHeaders('ApiKeyAuth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ 'application/octet-stream', 'application/json' ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext = options?.context ?? new HttpContext(); const localVarTransferCache = options?.transferCache ?? true; let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/agro/plan/data/${this.configuration.encodeParam({ name: "processCode", value: processCode, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } readPlanResult(requestParameters, observe = 'body', reportProgress = false, options) { const processCode = requestParameters?.processCode; if (processCode === null || processCode === undefined) { throw new Error('Required parameter processCode was null or undefined when calling readPlanResult.'); } let localVarHeaders = this.defaultHeaders; // authentication (ApiKeyAuth) required localVarHeaders = this.configuration.addCredentialToHeaders('ApiKeyAuth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ 'application/json' ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext = options?.context ?? new HttpContext(); const localVarTransferCache = options?.transferCache ?? true; let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/agro/plan/result/${this.configuration.encodeParam({ name: "processCode", value: processCode, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } readPlanState(requestParameters, observe = 'body', reportProgress = false, options) { const processCode = requestParameters?.processCode; if (processCode === null || processCode === undefined) { throw new Error('Required parameter processCode was null or undefined when calling readPlanState.'); } let localVarHeaders = this.defaultHeaders; // authentication (ApiKeyAuth) required localVarHeaders = this.configuration.addCredentialToHeaders('ApiKeyAuth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ 'application/json' ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext = options?.context ?? new HttpContext(); const localVarTransferCache = options?.transferCache ?? true; let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/agro/plan/state/${this.configuration.encodeParam({ name: "processCode", value: processCode, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } runPlanCalculation(requestParameters, observe = 'body', reportProgress = false, options) { const agroPlanTaskAgro = requestParameters?.agroPlanTaskAgro; if (agroPlanTaskAgro === null || agroPlanTaskAgro === undefined) { throw new Error('Required parameter agroPlanTaskAgro was null or undefined when calling runPlanCalculation.'); } let localVarHeaders = this.defaultHeaders; // authentication (ApiKeyAuth) required localVarHeaders = this.configuration.addCredentialToHeaders('ApiKeyAuth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ 'application/json' ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext = options?.context ?? new HttpContext(); const localVarTransferCache = options?.transferCache ?? true; // to determine the Content-Type header const consumes = [ 'application/json' ]; const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/agro/plan/calculation`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: agroPlanTaskAgro, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } runPlanCalculationAsync(requestParameters, observe = 'body', reportProgress = false, options) { const agroPlanTaskAgro = requestParameters?.agroPlanTaskAgro; if (agroPlanTaskAgro === null || agroPlanTaskAgro === undefined) { throw new Error('Required parameter agroPlanTaskAgro was null or undefined when calling runPlanCalculationAsync.'); } let localVarHeaders = this.defaultHeaders; // authentication (ApiKeyAuth) required localVarHeaders = this.configuration.addCredentialToHeaders('ApiKeyAuth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ 'application/json' ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext = options?.context ?? new HttpContext(); const localVarTransferCache = options?.transferCache ?? true; // to determine the Content-Type header const consumes = [ 'application/json' ]; const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/agro/plan/calculation-async`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: agroPlanTaskAgro, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } runPlanClip(requestParameters, observe = 'body', reportProgress = false, options) { const clipKey = requestParameters?.clipKey; if (clipKey === null || clipKey === undefined) { throw new Error('Required parameter clipKey was null or undefined when calling runPlanClip.'); } const agroPlanTaskAgro = requestParameters?.agroPlanTaskAgro; if (agroPlanTaskAgro === null || agroPlanTaskAgro === undefined) { throw new Error('Required parameter agroPlanTaskAgro was null or undefined when calling runPlanClip.'); } const clipStrategy = requestParameters?.clipStrategy; let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, clipStrategy, 'clip_strategy'); let localVarHeaders = this.defaultHeaders; // authentication (ApiKeyAuth) required localVarHeaders = this.configuration.addCredentialToHeaders('ApiKeyAuth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ 'application/json' ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext = options?.context ?? new HttpContext(); const localVarTransferCache = options?.transferCache ?? true; // to determine the Content-Type header const consumes = [ 'application/json' ]; const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/agro/plan/clip/${this.configuration.encodeParam({ name: "clipKey", value: clipKey, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: agroPlanTaskAgro, params: localVarQueryParameters, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } runPlanValidation(requestParameters, observe = 'body', reportProgress = false, options) { const agroPlanTaskAgro = requestParameters?.agroPlanTaskAgro; if (agroPlanTaskAgro === null || agroPlanTaskAgro === undefined) { throw new Error('Required parameter agroPlanTaskAgro was null or undefined when calling runPlanValidation.'); } let localVarHeaders = this.defaultHeaders; // authentication (ApiKeyAuth) required localVarHeaders = this.configuration.addCredentialToHeaders('ApiKeyAuth', 'Authorization', localVarHeaders, 'Bearer '); const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ 'application/json' ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext = options?.context ?? new HttpContext(); const localVarTransferCache = options?.transferCache ?? true; // to determine the Content-Type header const consumes = [ 'application/json' ]; const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/agro/plan/validation`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('post', `${basePath}${localVarPath}`, { context: localVarHttpContext, body: agroPlanTaskAgro, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PlanService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH, optional: true }, { token: Configuration, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PlanService, providedIn: 'root' }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PlanService, decorators: [{ type: Injectable, args: [{ providedIn: 'root' }] }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [BASE_PATH] }] }, { type: Configuration, decorators: [{ type: Optional }] }] }); /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /* tslint:disable:no-unused-variable member-ordering */ class SystemService extends BaseService { httpClient; constructor(httpClient, basePath, configuration) { super(basePath, configuration); this.httpClient = httpClient; } check(observe = 'body', reportProgress = false, options) { let localVarHeaders = this.defaultHeaders; const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ 'application/json' ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext = options?.context ?? new HttpContext(); const localVarTransferCache = options?.transferCache ?? true; let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/agro/system/check`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } file(requestParameters, observe = 'body', reportProgress = false, options) { const filename = requestParameters?.filename; if (filename === null || filename === undefined) { throw new Error('Required parameter filename was null or undefined when calling file.'); } let localVarHeaders = this.defaultHeaders; const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ 'text/html', 'text/plain', 'application/json' ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext = options?.context ?? new HttpContext(); const localVarTransferCache = options?.transferCache ?? true; let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/agro/file/${this.configuration.encodeParam({ name: "filename", value: filename, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } version(observe = 'body', reportProgress = false, options) { let localVarHeaders = this.defaultHeaders; const localVarHttpHeaderAcceptSelected = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ 'application/json' ]); if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } const localVarHttpContext = options?.context ?? new HttpContext(); const localVarTransferCache = options?.transferCache ?? true; let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/agro/system/version`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SystemService, deps: [{ token: i1.HttpClient }, { token: BASE_PATH, optional: true }, { token: Configuration, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SystemService, providedIn: 'root' }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SystemService, decorators: [{ type: Injectable, args: [{ providedIn: 'root' }] }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [BASE_PATH] }] }, { type: Configuration, decorators: [{ type: Optional }] }] }); const APIS = [PlanService, SystemService]; /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * Error type: * `UNIQUE_IDS_VIOLATION` - all keys must be unique * `INCONSISTENT_REFERENCE` - bad reference key * `INVALID_TIMELINE` - time window crossing * `INVALID_DATEWINDOW` - window ends before it starts * `INVALID_LEFTOVER_AMOUNT` - the amount of grain indicated in the balance exceeds the allowable size of the grain location (field, storage, silo, dryer, bunker) on the specified date * `INVALID_LEFTOVER_PER_ONE_TARGET` - more than one residue is specified for one grain location * `INVALID_CHAMBER_VARIANTS` - more than one chamber variant set for the same crop */ var AgroEntityErrorTypeAgro; (function (AgroEntityErrorTypeAgro) { AgroEntityErrorTypeAgro["UNIQUE_IDS_VIOLATION"] = "UNIQUE_IDS_VIOLATION"; AgroEntityErrorTypeAgro["INCONSISTENT_REFERENCE"] = "INCONSISTENT_REFERENCE"; AgroEntityErrorTypeAgro["INVALID_TIMELINE"] = "INVALID_TIMELINE"; AgroEntityErrorTypeAgro["INVALID_DATEWINDOW"] = "INVALID_DATEWINDOW"; AgroEntityErrorTypeAgro["INVALID_LEFTOVER_AMOUNT"] = "INVALID_LEFTOVER_AMOUNT"; AgroEntityErrorTypeAgro["INVALID_LEFTOVER_PER_ONE_TARGET"] = "INVALID_LEFTOVER_PER_ONE_TARGET"; AgroEntityErrorTypeAgro["INVALID_CHAMBER_VARIANTS"] = "INVALID_CHAMBER_VARIANTS"; })(AgroEntityErrorTypeAgro || (AgroEntityErrorTypeAgro = {})); /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * Entity type. */ var AgroEntityTypeAgro; (function (AgroEntityTypeAgro) { AgroEntityTypeAgro["TASK"] = "TASK"; AgroEntityTypeAgro["SETTINGS"] = "SETTINGS"; AgroEntityTypeAgro["CROP"] = "CROP"; AgroEntityTypeAgro["FIELD"] = "FIELD"; AgroEntityTypeAgro["ELEVATOR"] = "ELEVATOR"; AgroEntityTypeAgro["FACTORY"] = "FACTORY"; AgroEntityTypeAgro["MARKET"] = "MARKET"; AgroEntityTypeAgro["STORAGE"] = "STORAGE"; AgroEntityTypeAgro["SILO"] = "SILO"; AgroEntityTypeAgro["BUNKER"] = "BUNKER"; AgroEntityTypeAgro["DRYER"] = "DRYER"; AgroEntityTypeAgro["GATE"] = "GATE"; AgroEntityTypeAgro["CONSUMER"] = "CONSUMER"; AgroEntityTypeAgro["LEFTOVER"] = "LEFTOVER"; AgroEntityTypeAgro["FORECAST_ELEMENT"] = "FORECAST_ELEMENT"; })(AgroEntityTypeAgro || (AgroEntityTypeAgro = {})); /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * Warning type: * `NO_COMPATIBLE_STORAGE` - no compatible storage locations * `NO_AVAILABLE_MOVEMENT` - the object is not in the movement matrix * `NO_AVAILABLE_CONSUMER` - there is no consumer for this type of culture */ var AgroEntityWarningTypeAgro; (function (AgroEntityWarningTypeAgro) { AgroEntityWarningTypeAgro["NO_COMPATIBLE_STORAGE"] = "NO_COMPATIBLE_STORAGE"; AgroEntityWarningTypeAgro["NO_AVAILABLE_MOVEMENT"] = "NO_AVAILABLE_MOVEMENT"; AgroEntityWarningTypeAgro["NO_AVAILABLE_CONSUMER"] = "NO_AVAILABLE_CONSUMER"; })(AgroEntityWarningTypeAgro || (AgroEntityWarningTypeAgro = {})); /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * Calculation status: * `WAITING` - the calculation is waiting to be launched. * `IN_PROGRESS` - calculation in progress. * `FINISHED_IN_TIME` - the calculation completed correctly before the specified maximum time. * `FINISHED_OUT_OF_TIME` - the calculation ended because the specified time for calculation has expired, which can affect the quality of the result for the worse. * `CANCELED` - the calculation was canceled because a cancel command was received. * `CANCELED_BY_TIMEOUT` - the calculation was canceled automatically because the waiting time in the queue was exceeded. * `CANCELED_BY_QUOTA` - the calculation was canceled because the quota for this calculation type was exceeded. * `FAILED` - calculation completed with an error. */ var CalculationStatusAgro; (function (CalculationStatusAgro) { CalculationStatusAgro["WAITING"] = "WAITING"; CalculationStatusAgro["IN_PROGRESS"] = "IN_PROGRESS"; CalculationStatusAgro["FINISHED_IN_TIME"] = "FINISHED_IN_TIME"; CalculationStatusAgro["FINISHED_OUT_OF_TIME"] = "FINISHED_OUT_OF_TIME"; CalculationStatusAgro["CANCELED"] = "CANCELED"; CalculationStatusAgro["CANCELED_BY_TIMEOUT"] = "CANCELED_BY_TIMEOUT"; CalculationStatusAgro["CANCELED_BY_QUOTA"] = "CANCELED_BY_QUOTA"; CalculationStatusAgro["FAILED"] = "FAILED"; })(CalculationStatusAgro || (CalculationStatusAgro = {})); /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * Contract type: * `SELL_WITH_DELIVERY` - Contract for the sale of grain by the market with delivery to the client (the price of moving from the market is included in the price). * `SELL` - Contract for the sale of grain by the market without delivery (the price of moving from the market is not included in the price). * `BUY_WITH_DELIVERY` - Contract for the purchase of grain by the market with delivery from the client (the price of moving to the market is included in the price). * `BUY` - Contract for the purchase of grain by the market without delivery (the price of moving to the market is not included in the price). */ var ContractTypeAgro; (function (ContractTypeAgro) { ContractTypeAgro["SELL_WITH_DELIVERY"] = "SELL_WITH_DELIVERY"; ContractTypeAgro["SELL"] = "SELL"; ContractTypeAgro["BUY_WITH_DELIVERY"] = "BUY_WITH_DELIVERY"; ContractTypeAgro["BUY"] = "BUY"; })(ContractTypeAgro || (ContractTypeAgro = {})); /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * Crop type. */ var CropTypeAgro; (function (CropTypeAgro) { CropTypeAgro["DRY"] = "DRY"; CropTypeAgro["WET"] = "WET"; })(CropTypeAgro || (CropTypeAgro = {})); /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * Data flow type. */ var FlowTypeAgro; (function (FlowTypeAgro) { FlowTypeAgro["INPUT"] = "INPUT"; FlowTypeAgro["OUTPUT"] = "OUTPUT"; })(FlowTypeAgro || (FlowTypeAgro = {})); /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * Object type. */ var ObjectTypeAgro; (function (ObjectTypeAgro) { ObjectTypeAgro["FIELD"] = "FIELD"; ObjectTypeAgro["ELEVATOR"] = "ELEVATOR"; ObjectTypeAgro["FACTORY"] = "FACTORY"; ObjectTypeAgro["MARKET"] = "MARKET"; })(ObjectTypeAgro || (ObjectTypeAgro = {})); /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * Type of [operation](#section/Description/Project): * `HARVEST` - Harvesting agricultural crops from the field to the production facility * `STORE` - Storing culture in a storage location * `DRY` - Drying the crop * `RELOCATE` - Transportation between production facilities (between gates) * `CONSUMPTION` - Consumption of crop by plant (from bunker, gate or dryer) * `LOAD` - Loading a culture into a storage location * `UNLOAD` - Unloading a culture from a storage location * `SELL` - Selling crops from the elevator to the market (under a specific contract) * `BUY` - Purchase of crops from the market to the plant (under a specific contract) */ var OperationTypeAgro; (function (OperationTypeAgro) { OperationTypeAgro["HARVEST"] = "HARVEST"; OperationTypeAgro["STORE"] = "STORE"; OperationTypeAgro["DRY"] = "DRY"; OperationTypeAgro["RELOCATE"] = "RELOCATE"; OperationTypeAgro["CONSUMPTION"] = "CONSUMPTION"; OperationTypeAgro["LOAD"] = "LOAD"; OperationTypeAgro["UNLOAD"] = "UNLOAD"; OperationTypeAgro["SELL"] = "SELL"; OperationTypeAgro["BUY"] = "BUY"; })(OperationTypeAgro || (OperationTypeAgro = {})); /** * VRt.Agro [AG] * * The version of the OpenAPI document: 7.33.3222 * Contact: support@veeroute.com * * NOTE: This class is auto generated by OpenAPI Generator. * Do not edit the class manually. */ /** * Target function type. */ var ProjectConfigurationAgro; (function (ProjectConfigurationAgro) { ProjectConfigurationAgro["OPTIMIZE_DISTANCE"] = "OPTIMIZE_DISTANCE"; ProjectConfigurationAgro["OPTIMIZE_COST"] = "OPTIMIZE_COST"; })(ProjectConfigurationAgro || (ProjectConfigurat