/**
 * Generated by orval v8.23.0 🍺
 * Do not edit manually.
 * FastAPI
 * OpenAPI spec version: v2.2.0
 */
import type {
  HTTPValidationError,
  SendPasswordChangeNotificationEmailPasswordChangeNotificationPostParams,
  SendVerificationCodeEmailVerificationCodePostParams
} from '../model';

import { customInstance } from '.././client';

export type sendVerificationCodeEmailVerificationCodePostResponse200 = {
  data: unknown
  status: 200
}

export type sendVerificationCodeEmailVerificationCodePostResponse422 = {
  data: HTTPValidationError
  status: 422
}

export type sendVerificationCodeEmailVerificationCodePostResponseSuccess = (sendVerificationCodeEmailVerificationCodePostResponse200) & {
  headers: Headers;
};
export type sendVerificationCodeEmailVerificationCodePostResponseError = (sendVerificationCodeEmailVerificationCodePostResponse422) & {
  headers: Headers;
};

export type sendVerificationCodeEmailVerificationCodePostResponse = (sendVerificationCodeEmailVerificationCodePostResponseSuccess | sendVerificationCodeEmailVerificationCodePostResponseError)

export const getSendVerificationCodeEmailVerificationCodePostUrl = (params: SendVerificationCodeEmailVerificationCodePostParams,) => {
  const normalizedParams = new URLSearchParams();

  Object.entries(params || {}).forEach(([key, value]) => {

    if (value !== undefined) {
      normalizedParams.append(key, value === null ? 'null' : String(value))
    }
  });

  const stringifiedParams = normalizedParams.toString();

  return stringifiedParams.length > 0 ? `/email/verification_code?${stringifiedParams}` : `/email/verification_code`
}

/**
 * Send a verification code to an email, using an email template
 *
 * Parameters:
 *     email (NameEmail): The email to send the verification code to
 *     code (int): The verification code to send
 *     style (Literal["verification_code", "forgot_password"]): The style of the email
 *
 * Returns:
 *     JSONResponse: A message indicating that the email has been sent
 * @summary Send Verification Code
 */
export const sendVerificationCodeEmailVerificationCodePost = async (params: SendVerificationCodeEmailVerificationCodePostParams, options?: Parameters<typeof customInstance>[1]): Promise<sendVerificationCodeEmailVerificationCodePostResponse> => {

  return customInstance<sendVerificationCodeEmailVerificationCodePostResponse>(getSendVerificationCodeEmailVerificationCodePostUrl(params),
  {
    ...options,
    method: 'POST'


  }
);}


export type sendPasswordChangeNotificationEmailPasswordChangeNotificationPostResponse200 = {
  data: unknown
  status: 200
}

export type sendPasswordChangeNotificationEmailPasswordChangeNotificationPostResponse422 = {
  data: HTTPValidationError
  status: 422
}

export type sendPasswordChangeNotificationEmailPasswordChangeNotificationPostResponseSuccess = (sendPasswordChangeNotificationEmailPasswordChangeNotificationPostResponse200) & {
  headers: Headers;
};
export type sendPasswordChangeNotificationEmailPasswordChangeNotificationPostResponseError = (sendPasswordChangeNotificationEmailPasswordChangeNotificationPostResponse422) & {
  headers: Headers;
};

export type sendPasswordChangeNotificationEmailPasswordChangeNotificationPostResponse = (sendPasswordChangeNotificationEmailPasswordChangeNotificationPostResponseSuccess | sendPasswordChangeNotificationEmailPasswordChangeNotificationPostResponseError)

export const getSendPasswordChangeNotificationEmailPasswordChangeNotificationPostUrl = (params: SendPasswordChangeNotificationEmailPasswordChangeNotificationPostParams,) => {
  const normalizedParams = new URLSearchParams();

  Object.entries(params || {}).forEach(([key, value]) => {

    if (value !== undefined) {
      normalizedParams.append(key, value === null ? 'null' : String(value))
    }
  });

  const stringifiedParams = normalizedParams.toString();

  return stringifiedParams.length > 0 ? `/email/password_change_notification?${stringifiedParams}` : `/email/password_change_notification`
}

/**
 * Send a password change notification to an email
 *
 * Parameters:
 *     email (NameEmail): The email to send the verification code to
 *     code (int): The verification code to send
 *
 * Returns:
 *     JSONResponse: A message indicating that the email has been sent
 * @summary Send Password Change Notification
 */
export const sendPasswordChangeNotificationEmailPasswordChangeNotificationPost = async (params: SendPasswordChangeNotificationEmailPasswordChangeNotificationPostParams, options?: Parameters<typeof customInstance>[1]): Promise<sendPasswordChangeNotificationEmailPasswordChangeNotificationPostResponse> => {

  return customInstance<sendPasswordChangeNotificationEmailPasswordChangeNotificationPostResponse>(getSendPasswordChangeNotificationEmailPasswordChangeNotificationPostUrl(params),
  {
    ...options,
    method: 'POST'


  }
);}


