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

import type { Client, Options as Options2, TDataShape } from './client';
import { client } from './client.gen';
import type { PostSecurityForgotPasswordData, PostSecurityForgotPasswordErrors, PostSecurityForgotPasswordResetData, PostSecurityForgotPasswordResetErrors, PostSecurityForgotPasswordResetResponses, PostSecurityForgotPasswordResponses, PostSecurityForgotPasswordVerifyData, PostSecurityForgotPasswordVerifyErrors, PostSecurityForgotPasswordVerifyResponses, PostUserInviteCreatePasswordData, PostUserInviteCreatePasswordErrors, PostUserInviteCreatePasswordResponses, PostUserInviteVerifyData, PostUserInviteVerifyErrors, PostUserInviteVerifyResponses } from './types.gen';

export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
    /**
     * You can provide a client instance returned by `createClient()` instead of
     * individual options. This might be also useful if you want to implement a
     * custom client.
     */
    client?: Client;
    /**
     * You can pass arbitrary values through the `meta` object. This can be
     * used to access values that aren't defined as part of the SDK function.
     */
    meta?: Record<string, unknown>;
};

export const postSecurityForgotPassword = <ThrowOnError extends boolean = false>(options?: Options<PostSecurityForgotPasswordData, ThrowOnError>) => {
    return (options?.client ?? client).post<PostSecurityForgotPasswordResponses, PostSecurityForgotPasswordErrors, ThrowOnError>({
        security: [
            {
                scheme: 'bearer',
                type: 'http'
            }
        ],
        url: '/umbraco/management/api/v1/security/forgot-password',
        ...options,
        headers: {
            'Content-Type': 'application/json',
            ...options?.headers
        }
    });
};

export const postSecurityForgotPasswordReset = <ThrowOnError extends boolean = false>(options?: Options<PostSecurityForgotPasswordResetData, ThrowOnError>) => {
    return (options?.client ?? client).post<PostSecurityForgotPasswordResetResponses, PostSecurityForgotPasswordResetErrors, ThrowOnError>({
        security: [
            {
                scheme: 'bearer',
                type: 'http'
            }
        ],
        url: '/umbraco/management/api/v1/security/forgot-password/reset',
        ...options,
        headers: {
            'Content-Type': 'application/json',
            ...options?.headers
        }
    });
};

export const postSecurityForgotPasswordVerify = <ThrowOnError extends boolean = false>(options?: Options<PostSecurityForgotPasswordVerifyData, ThrowOnError>) => {
    return (options?.client ?? client).post<PostSecurityForgotPasswordVerifyResponses, PostSecurityForgotPasswordVerifyErrors, ThrowOnError>({
        url: '/umbraco/management/api/v1/security/forgot-password/verify',
        ...options,
        headers: {
            'Content-Type': 'application/json',
            ...options?.headers
        }
    });
};

export const postUserInviteCreatePassword = <ThrowOnError extends boolean = false>(options?: Options<PostUserInviteCreatePasswordData, ThrowOnError>) => {
    return (options?.client ?? client).post<PostUserInviteCreatePasswordResponses, PostUserInviteCreatePasswordErrors, ThrowOnError>({
        url: '/umbraco/management/api/v1/user/invite/create-password',
        ...options,
        headers: {
            'Content-Type': 'application/json',
            ...options?.headers
        }
    });
};

export const postUserInviteVerify = <ThrowOnError extends boolean = false>(options?: Options<PostUserInviteVerifyData, ThrowOnError>) => {
    return (options?.client ?? client).post<PostUserInviteVerifyResponses, PostUserInviteVerifyErrors, ThrowOnError>({
        url: '/umbraco/management/api/v1/user/invite/verify',
        ...options,
        headers: {
            'Content-Type': 'application/json',
            ...options?.headers
        }
    });
};
