/* tslint:disable */
/* eslint-disable */
/**
 * OmsorgCore.Api
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


import * as runtime from '../runtime';
import type {
  PasswordResetTemplateResponse,
  SendTestEmailRequest,
} from '../models/index';
import {
    PasswordResetTemplateResponseFromJSON,
    PasswordResetTemplateResponseToJSON,
    SendTestEmailRequestFromJSON,
    SendTestEmailRequestToJSON,
} from '../models/index';

export interface ApiAdminEmailTestSendPostRequest {
    sendTestEmailRequest?: SendTestEmailRequest;
}

/**
 * 
 */
export class AdminEmailApi extends runtime.BaseAPI {

    /**
     */
    async apiAdminEmailPasswordResetTemplateGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PasswordResetTemplateResponse>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("Bearer", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/api/admin/email/password-reset-template`;

        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => PasswordResetTemplateResponseFromJSON(jsonValue));
    }

    /**
     */
    async apiAdminEmailPasswordResetTemplateGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PasswordResetTemplateResponse> {
        const response = await this.apiAdminEmailPasswordResetTemplateGetRaw(initOverrides);
        return await response.value();
    }

    /**
     */
    async apiAdminEmailTestSendPostRaw(requestParameters: ApiAdminEmailTestSendPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("Bearer", []);

            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }

        let urlPath = `/api/admin/email/test-send`;

        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: SendTestEmailRequestToJSON(requestParameters['sendTestEmailRequest']),
        }, initOverrides);

        return new runtime.VoidApiResponse(response);
    }

    /**
     */
    async apiAdminEmailTestSendPost(requestParameters: ApiAdminEmailTestSendPostRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
        await this.apiAdminEmailTestSendPostRaw(requestParameters, initOverrides);
    }

}
