/**
 * FooResource automatically generated by SDKgen please do not edit this file manually
 * {@link https://sdkgen.app}
 */

import {AxiosInstance, AxiosRequestConfig, AxiosResponse} from "axios";
import {ResourceAbstract} from "sdkgen-client"
import {EntryCollection} from "./EntryCollection";
import {EntryCreate} from "./EntryCreate";
import {EntryMessage} from "./EntryMessage";

export default class FooResource extends ResourceAbstract {
    private url: string;


    public constructor(baseUrl: string, httpClient: AxiosInstance) {
        super(baseUrl, httpClient);


        this.url = baseUrl + "/foo";
    }

    /**
     * Returns a collection
     *
     * @returns {Promise<AxiosResponse<EntryCollection>>}
     */
    public async get(): Promise<AxiosResponse<EntryCollection>> {
        let params: AxiosRequestConfig = {
            method: 'GET',
        };

        return this.httpClient.get<EntryCollection>(this.url, params);
    }

    /**
     * @param {EntryCreate} data
     * @returns {Promise<AxiosResponse<EntryMessage>>}
     */
    public async post(data: EntryCreate): Promise<AxiosResponse<EntryMessage>> {
        let params: AxiosRequestConfig = {
            method: 'POST',
        };

        return this.httpClient.post<EntryMessage>(this.url, data, params);
    }

}
