/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import type { Observable } from 'rxjs';
import type { Body_login_for_access_token_api_token_post } from '../models/Body_login_for_access_token_api_token_post';
import type { BootstrapData } from '../models/BootstrapData';
import type { CategoryRead } from '../models/CategoryRead';
import type { DataProvider } from '../models/DataProvider';
import type { FeatureInfo } from '../models/FeatureInfo';
import type { Project } from '../models/Project';
import type { RoleRead } from '../models/RoleRead';
import type { Store } from '../models/Store';
import type { SurveyMeta } from '../models/SurveyMeta';
import type { Token } from '../models/Token';
import type { UserRead } from '../models/UserRead';
import type { UserRoleLink } from '../models/UserRoleLink';
import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request';
@Injectable({
    providedIn: 'root',
})
export class ApiService {
    constructor(public readonly http: HttpClient) {}
    /**
     * Bootstrap
     * @returns BootstrapData Successful Response
     * @throws ApiError
     */
    public bootstrapApiBootstrapGet(): Observable<BootstrapData> {
        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({
        formData,
    }: {
        formData: Body_login_for_access_token_api_token_post,
    }): Observable<Token> {
        return __request(OpenAPI, this.http, {
            method: 'POST',
            url: '/api/token',
            formData: formData,
            mediaType: 'application/x-www-form-urlencoded',
            errors: {
                404: `Not found`,
                422: `Validation Error`,
            },
        });
    }
    /**
     * Get Users
     * @returns UserRead Successful Response
     * @throws ApiError
     */
    public getUsersApiUsersGet(): Observable<Array<UserRead>> {
        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<Array<RoleRead>> {
        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<Array<UserRoleLink>> {
        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<Array<CategoryRead>> {
        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<Array<CategoryRead>> {
        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<Array<DataProvider>> {
        return __request(OpenAPI, this.http, {
            method: 'GET',
            url: '/api/data-providers',
            errors: {
                404: `Not found`,
            },
        });
    }
    /**
     * Get Stores
     * @returns Store Successful Response
     * @throws ApiError
     */
    public getStoresApiStoresGet(): Observable<Array<Store>> {
        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<Array<Project>> {
        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<SurveyMeta> {
        return __request(OpenAPI, this.http, {
            method: 'GET',
            url: '/api/survey_meta',
            errors: {
                404: `Not found`,
            },
        });
    }
    /**
     * Get Feature Info
     * @returns FeatureInfo Successful Response
     * @throws ApiError
     */
    public getFeatureInfoApiFeatureInfoStoreIdGet({
        store,
        id,
    }: {
        store: string,
        id: string,
    }): Observable<FeatureInfo> {
        return __request(OpenAPI, this.http, {
            method: 'GET',
            url: '/api/feature-info/{store}/{id}',
            path: {
                'store': store,
                'id': id,
            },
            errors: {
                404: `Not found`,
                422: `Validation Error`,
            },
        });
    }
}
