/**
 * FooByNameAndTypeResource 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 {Entry} from "./Entry";
import {EntryMessage} from "./EntryMessage";

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

    private name: string;
    private type: string;

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

        this.name = name;
        this.type = type;

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

    /**
     * Returns a collection
     *
     * @param {Entry | EntryMessage} data
     * @returns {Promise<AxiosResponse<Entry | EntryMessage>>}
     */
    public async postEntryOrMessage(data: Entry | EntryMessage): Promise<AxiosResponse<Entry | EntryMessage>> {
        let params: AxiosRequestConfig = {
            method: 'POST',
        };

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

}
