// This file is auto-generated by @hey-api/openapi-ts


import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import type { Observable } from 'rxjs';
import { OpenAPI } from './core/OpenAPI';
import { request as __request } from './core/request';
import type { $OpenApiTs } from './types.gen';

@Injectable({
    providedIn: 'root'
})
export class ApiService {
    constructor(public readonly http: HttpClient) {
    }
    
    /**
 * Bootstrap
 * @returns BootstrapData Successful Response
 * @throws ApiError
 */
    public bootstrapApiBootstrapGet(): Observable<$OpenApiTs['/api/bootstrap']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/bootstrap',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Login For Access Token
 * @returns Token Successful Response
 * @throws ApiError
 */
    public loginForAccessTokenApiTokenPost(data: $OpenApiTs['/api/token']['post']['req']): Observable<$OpenApiTs['/api/token']['post']['res'][200]> {
        const { formData } = data;
        return __request(OpenAPI, this.http, {
    method: 'POST',
    url: '/api/token',
    formData,
    mediaType: 'application/x-www-form-urlencoded',
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
    /**
 * Logout
 * @returns unknown Successful Response
 * @throws ApiError
 */
    public logoutApiLogoutGet(): Observable<$OpenApiTs['/api/logout']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/logout',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Get Users
 * @returns UserRead Successful Response
 * @throws ApiError
 */
    public getUsersApiUsersGet(): Observable<$OpenApiTs['/api/users']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/users',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Get Roles
 * @returns RoleRead Successful Response
 * @throws ApiError
 */
    public getRolesApiRolesGet(): Observable<$OpenApiTs['/api/roles']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/roles',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Get Acls
 * New: ACLs returned as UserRoleLink
 * @returns UserRoleLink Successful Response
 * @throws ApiError
 */
    public getAclsApiAclsGet(): Observable<$OpenApiTs['/api/acls']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/acls',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Get Categories
 * @returns CategoryRead Successful Response
 * @throws ApiError
 */
    public getCategoriesApiCategoriesGet(): Observable<$OpenApiTs['/api/categories']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/categories',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Get Categories P
 * @returns CategoryRead Successful Response
 * @throws ApiError
 */
    public getCategoriesPApiCategoriesPandasGet(): Observable<$OpenApiTs['/api/categories_pandas']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/categories_pandas',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * List Data Providers
 * Return a list of data providers, for use with the api (graphs, etc)
 * :return:
 * @returns DataProvider Successful Response
 * @throws ApiError
 */
    public listDataProvidersApiDataProvidersGet(): Observable<$OpenApiTs['/api/data-providers']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/data-providers',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Get Model List
 * Json REST store API compatible with Flask Potion and Angular
 * Get the list of items (used for making the list of items in measures)
 * Filter only items with at least one measure
 * @returns MeasuresItem Successful Response
 * @throws ApiError
 */
    public getModelListApiDataProviderStoreGet(data: $OpenApiTs['/api/data-provider/{store}']['get']['req']): Observable<$OpenApiTs['/api/data-provider/{store}']['get']['res'][200]> {
        const { store } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/data-provider/{store}',
    path: {
        store
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
    /**
 * Get Model Values
 * Get values
 * @returns unknown Successful Response
 * @throws ApiError
 */
    public getModelValuesApiStoreNameValuesValueGet(data: $OpenApiTs['/api/{store_name}/values/{value}']['get']['req']): Observable<$OpenApiTs['/api/{store_name}/values/{value}']['get']['res'][200]> {
        const { storeName, value, where, resample } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/{store_name}/values/{value}',
    path: {
        store_name: storeName,
        value
    },
    query: {
        where,
        resample
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
    /**
 * Get Stores
 * @returns Store Successful Response
 * @throws ApiError
 */
    public getStoresApiStoresGet(): Observable<$OpenApiTs['/api/stores']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/stores',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Get Projects
 * @returns Project Successful Response
 * @throws ApiError
 */
    public getProjectsApiProjectsGet(): Observable<$OpenApiTs['/api/projects']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/projects',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Get Survey Meta
 * @returns SurveyMeta Successful Response
 * @throws ApiError
 */
    public getSurveyMetaApiSurveyMetaGet(): Observable<$OpenApiTs['/api/survey_meta']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/survey_meta',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Get Feature Info
 * @returns unknown Successful Response
 * @throws ApiError
 */
    public getFeatureInfoApiFeatureInfoStoreIdGet(data: $OpenApiTs['/api/feature-info/{store}/{id}']['get']['req']): Observable<$OpenApiTs['/api/feature-info/{store}/{id}']['get']['res'][200]> {
        const { store, id } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/feature-info/{store}/{id}',
    path: {
        store,
        id
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
    /**
 * Get Model Info
 * @returns ModelInfo Successful Response
 * @throws ApiError
 */
    public getModelInfoApiModelInfoStoreGet(data: $OpenApiTs['/api/model-info/{store}']['get']['req']): Observable<$OpenApiTs['/api/model-info/{store}']['get']['res'][200]> {
        const { store } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/model-info/{store}',
    path: {
        store
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
    /**
 * Get Plot Params
 * @returns PlotParams Successful Response
 * @throws ApiError
 */
    public getPlotParamsApiPlotParamsStoreGet(data: $OpenApiTs['/api/plot-params/{store}']['get']['req']): Observable<$OpenApiTs['/api/plot-params/{store}']['get']['res'][200]> {
        const { store, id, value } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/plot-params/{store}',
    path: {
        store
    },
    query: {
        id,
        value
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
    /**
 * Get Actions
 * @returns ActionsStore Successful Response
 * @throws ApiError
 */
    public getActionsApiActionsGet(): Observable<$OpenApiTs['/api/actions']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/actions',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Execute Tag Action
 * @returns ActionsResults Successful Response
 * @throws ApiError
 */
    public executeTagActionApiExecTagActionsPost(data: $OpenApiTs['/api/execTagActions']['post']['req']): Observable<$OpenApiTs['/api/execTagActions']['post']['res'][200]> {
        const { requestBody } = data;
        return __request(OpenAPI, this.http, {
    method: 'POST',
    url: '/api/execTagActions',
    body: requestBody,
    mediaType: 'application/json',
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
}

@Injectable({
    providedIn: 'root'
})
export class GeoapiService {
    constructor(public readonly http: HttpClient) {
    }
    
    /**
 * Get Geojson
 * Some REST stores coded manually (route prefixed with "gj": geojson).
 * :param store_name: name of the model
 * :return: json
 * @returns unknown Successful Response
 * @throws ApiError
 */
    public getGeojsonApiGjStoreNameGet(data: $OpenApiTs['/api/gj/{store_name}']['get']['req']): Observable<$OpenApiTs['/api/gj/{store_name}']['get']['res'][200]> {
        const { storeName, ifNoneMatch, simplify, preserveTopology } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/gj/{store_name}',
    path: {
        store_name: storeName
    },
    headers: {
        'If-None-Match': ifNoneMatch,
        simplify,
        preserveTopology
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
}

@Injectable({
    providedIn: 'root'
})
export class AdminService {
    constructor(public readonly http: HttpClient) {
    }
    
    /**
 * Get Baskets
 * @returns BasketNameOnly Successful Response
 * @throws ApiError
 */
    public getBasketsApiAdminBasketGet(): Observable<$OpenApiTs['/api/admin/basket']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/admin/basket',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Get Basket
 * @returns AdminBasket Successful Response
 * @throws ApiError
 */
    public getBasketApiAdminBasketNameGet(data: $OpenApiTs['/api/admin/basket/{name}']['get']['req']): Observable<$OpenApiTs['/api/admin/basket/{name}']['get']['res'][200]> {
        const { name } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/admin/basket/{name}',
    path: {
        name
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
    /**
 * Upload Basket File
 * @returns BasketImportResult Successful Response
 * @throws ApiError
 */
    public uploadBasketFileApiAdminBasketUploadNamePost(data: $OpenApiTs['/api/admin/basket/upload/{name}']['post']['req']): Observable<$OpenApiTs['/api/admin/basket/upload/{name}']['post']['res'][200]> {
        const { name, formData, projectId, surveyorId, equipmentId, autoImport } = data;
        return __request(OpenAPI, this.http, {
    method: 'POST',
    url: '/api/admin/basket/upload/{name}',
    path: {
        name
    },
    query: {
        project_id: projectId,
        surveyor_id: surveyorId,
        equipment_id: equipmentId,
        auto_import: autoImport
    },
    formData,
    mediaType: 'multipart/form-data',
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
    /**
 * Download Basket File
 * @returns unknown Successful Response
 * @throws ApiError
 */
    public downloadBasketFileApiAdminBasketDownloadNameFileIdFileNameGet(data: $OpenApiTs['/api/admin/basket/download/{name}/{file_id}/{file_name}']['get']['req']): Observable<$OpenApiTs['/api/admin/basket/download/{name}/{file_id}/{file_name}']['get']['res'][200]> {
        const { name, fileId, fileName } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/admin/basket/download/{name}/{file_id}/{file_name}',
    path: {
        name,
        file_id: fileId,
        file_name: fileName
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
    /**
 * Import Basket File
 * @returns BasketImportResult Successful Response
 * @throws ApiError
 */
    public importBasketFileApiAdminBasketImportBasketFileIdGet(data: $OpenApiTs['/api/admin/basket/import/{basket}/{file_id}']['get']['req']): Observable<$OpenApiTs['/api/admin/basket/import/{basket}/{file_id}']['get']['res'][200]> {
        const { basket, fileId, dryRun } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/admin/basket/import/{basket}/{file_id}',
    path: {
        basket,
        file_id: fileId
    },
    query: {
        dryRun
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
    /**
 * Delete Basket File
 * @returns unknown Successful Response
 * @throws ApiError
 */
    public deleteBasketFileApiAdminBasketDeleteBasketFileIdGet(data: $OpenApiTs['/api/admin/basket/delete/{basket}/{file_id}']['get']['req']): Observable<$OpenApiTs['/api/admin/basket/delete/{basket}/{file_id}']['get']['res'][200]> {
        const { basket, fileId } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/admin/basket/delete/{basket}/{file_id}',
    path: {
        basket,
        file_id: fileId
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
}

@Injectable({
    providedIn: 'root'
})
export class DashboardService {
    constructor(public readonly http: HttpClient) {
    }
    
    /**
 * Get Groups
 * @returns DashboardGroup Successful Response
 * @throws ApiError
 */
    public getGroupsApiDashboardGroupsGet(): Observable<$OpenApiTs['/api/dashboard/groups']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/dashboard/groups',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Get Home
 * @returns DashboardHome Successful Response
 * @throws ApiError
 */
    public getHomeApiDashboardHomeGet(): Observable<$OpenApiTs['/api/dashboard/home']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/dashboard/home',
    errors: {
        404: 'Not found'
    }
});
    }
    
    /**
 * Get Dashboard Page
 * @returns Dashboard Successful Response
 * @throws ApiError
 */
    public getDashboardPageApiDashboardPageGroupNameGet(data: $OpenApiTs['/api/dashboard/page/{group}/{name}']['get']['req']): Observable<$OpenApiTs['/api/dashboard/page/{group}/{name}']['get']['res'][200]> {
        const { group, name } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/dashboard/page/{group}/{name}',
    path: {
        group,
        name
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
}

@Injectable({
    providedIn: 'root'
})
export class MapService {
    constructor(public readonly http: HttpClient) {
    }
    
    /**
 * Get Init Data
 * @returns MapInitData Successful Response
 * @throws ApiError
 */
    public getInitDataApiMapInitDataGet(): Observable<$OpenApiTs['/api/map/init-data']['get']['res'][200]> {
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/map/init-data'
});
    }
    
    /**
 * Get Base Style
 * @returns BaseStyle Successful Response
 * @throws ApiError
 */
    public getBaseStyleApiMapBaseStyleNameGet(data: $OpenApiTs['/api/map/base_style/{name}']['get']['req']): Observable<$OpenApiTs['/api/map/base_style/{name}']['get']['res'][200]> {
        const { name } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/map/base_style/{name}',
    path: {
        name
    },
    errors: {
        422: 'Validation Error'
    }
});
    }
    
    /**
 * Get Layer Style
 * @returns unknown Successful Response
 * @throws ApiError
 */
    public getLayerStyleApiMapLayerStyleStoreGet(data: $OpenApiTs['/api/map/layer_style/{store}']['get']['req']): Observable<$OpenApiTs['/api/map/layer_style/{store}']['get']['res'][200]> {
        const { store } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/map/layer_style/{store}',
    path: {
        store
    },
    errors: {
        422: 'Validation Error'
    }
});
    }
    
}

@Injectable({
    providedIn: 'root'
})
export class DownloadService {
    constructor(public readonly http: HttpClient) {
    }
    
    /**
 * Download Csv
 * @returns unknown Successful Response
 * @throws ApiError
 */
    public downloadCsvApiDownloadCsvStoreModelIdValueResampleGet(data: $OpenApiTs['/api/download/csv/{store}/{model_id}/{value}/{resample}']['get']['req']): Observable<$OpenApiTs['/api/download/csv/{store}/{model_id}/{value}/{resample}']['get']['res'][200]> {
        const { store, modelId, value, resample } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/download/csv/{store}/{model_id}/{value}/{resample}',
    path: {
        store,
        model_id: modelId,
        value,
        resample
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
    /**
 * Download Geodata
 * @returns unknown Successful Response
 * @throws ApiError
 */
    public downloadGeodataApiDownloadGeodataStoresGet(data: $OpenApiTs['/api/download/geodata/{stores}']['get']['req']): Observable<$OpenApiTs['/api/download/geodata/{stores}']['get']['res'][200]> {
        const { stores, format, reproject } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/download/geodata/{stores}',
    path: {
        stores
    },
    query: {
        format,
        reproject
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
    /**
 * Execute Action
 * Download the result of an action
 * @returns unknown Successful Response
 * @throws ApiError
 */
    public executeActionApiDownloadPluginNameStoreIdGet(data: $OpenApiTs['/api/download/plugin/{name}/{store}/{id}']['get']['req']): Observable<$OpenApiTs['/api/download/plugin/{name}/{store}/{id}']['get']['res'][200]> {
        const { name, store, id } = data;
        return __request(OpenAPI, this.http, {
    method: 'GET',
    url: '/api/download/plugin/{name}/{store}/{id}',
    path: {
        name,
        store,
        id
    },
    errors: {
        404: 'Not found',
        422: 'Validation Error'
    }
});
    }
    
}