/**
 * Generated by orval v8.3.0 🍺
 * Do not edit manually.
 * Mission Control API
 * OpenAPI spec version: 0.1.0
 */
import { useMutation, useQuery } from "@tanstack/react-query";
import type {
  DataTag,
  DefinedInitialDataOptions,
  DefinedUseQueryResult,
  MutationFunction,
  QueryClient,
  QueryFunction,
  QueryKey,
  UndefinedInitialDataOptions,
  UseMutationOptions,
  UseMutationResult,
  UseQueryOptions,
  UseQueryResult,
} from "@tanstack/react-query";

import type {
  HTTPValidationError,
  OkResponse,
  TaskCustomFieldDefinitionCreate,
  TaskCustomFieldDefinitionRead,
  TaskCustomFieldDefinitionUpdate,
} from ".././model";

import { customFetch } from "../../mutator";

type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];

/**
 * List task custom field definitions for the authenticated organization.
 * @summary List Org Custom Fields
 */
export type listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetResponse200 =
  {
    data: TaskCustomFieldDefinitionRead[];
    status: 200;
  };

export type listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetResponseSuccess =
  listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetResponse200 & {
    headers: Headers;
  };
export type listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetResponse =
  listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetResponseSuccess;

export const getListOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetUrl =
  () => {
    return `/api/v1/organizations/me/custom-fields`;
  };

export const listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet = async (
  options?: RequestInit,
): Promise<listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetResponse> => {
  return customFetch<listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetResponse>(
    getListOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetUrl(),
    {
      ...options,
      method: "GET",
    },
  );
};

export const getListOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetQueryKey =
  () => {
    return [`/api/v1/organizations/me/custom-fields`] as const;
  };

export const getListOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetQueryOptions =
  <
    TData = Awaited<
      ReturnType<typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet>
    >,
    TError = unknown,
  >(options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<
            typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet
          >
        >,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customFetch>;
  }) => {
    const { query: queryOptions, request: requestOptions } = options ?? {};

    const queryKey =
      queryOptions?.queryKey ??
      getListOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetQueryKey();

    const queryFn: QueryFunction<
      Awaited<
        ReturnType<
          typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet
        >
      >
    > = ({ signal }) =>
      listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet({
        signal,
        ...requestOptions,
      });

    return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
      Awaited<
        ReturnType<
          typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet
        >
      >,
      TError,
      TData
    > & { queryKey: DataTag<QueryKey, TData, TError> };
  };

export type ListOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetQueryResult =
  NonNullable<
    Awaited<
      ReturnType<typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet>
    >
  >;
export type ListOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetQueryError =
  unknown;

export function useListOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet<
  TData = Awaited<
    ReturnType<typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet>
  >,
  TError = unknown,
>(
  options: {
    query: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<
            typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet
          >
        >,
        TError,
        TData
      >
    > &
      Pick<
        DefinedInitialDataOptions<
          Awaited<
            ReturnType<
              typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet
            >
          >,
          TError,
          Awaited<
            ReturnType<
              typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet
            >
          >
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): DefinedUseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useListOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet<
  TData = Awaited<
    ReturnType<typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet>
  >,
  TError = unknown,
>(
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<
            typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet
          >
        >,
        TError,
        TData
      >
    > &
      Pick<
        UndefinedInitialDataOptions<
          Awaited<
            ReturnType<
              typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet
            >
          >,
          TError,
          Awaited<
            ReturnType<
              typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet
            >
          >
        >,
        "initialData"
      >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
export function useListOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet<
  TData = Awaited<
    ReturnType<typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet>
  >,
  TError = unknown,
>(
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<
            typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet
          >
        >,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
};
/**
 * @summary List Org Custom Fields
 */

export function useListOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet<
  TData = Awaited<
    ReturnType<typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet>
  >,
  TError = unknown,
>(
  options?: {
    query?: Partial<
      UseQueryOptions<
        Awaited<
          ReturnType<
            typeof listOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGet
          >
        >,
        TError,
        TData
      >
    >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseQueryResult<TData, TError> & {
  queryKey: DataTag<QueryKey, TData, TError>;
} {
  const queryOptions =
    getListOrgCustomFieldsApiV1OrganizationsMeCustomFieldsGetQueryOptions(
      options,
    );

  const query = useQuery(queryOptions, queryClient) as UseQueryResult<
    TData,
    TError
  > & { queryKey: DataTag<QueryKey, TData, TError> };

  return { ...query, queryKey: queryOptions.queryKey };
}

/**
 * Create an organization-level task custom field definition.
 * @summary Create Org Custom Field
 */
export type createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostResponse200 =
  {
    data: TaskCustomFieldDefinitionRead;
    status: 200;
  };

export type createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostResponse422 =
  {
    data: HTTPValidationError;
    status: 422;
  };

export type createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostResponseSuccess =
  createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostResponse200 & {
    headers: Headers;
  };
export type createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostResponseError =
  createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostResponse422 & {
    headers: Headers;
  };

export type createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostResponse =
  | createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostResponseSuccess
  | createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostResponseError;

export const getCreateOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostUrl =
  () => {
    return `/api/v1/organizations/me/custom-fields`;
  };

export const createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPost = async (
  taskCustomFieldDefinitionCreate: TaskCustomFieldDefinitionCreate,
  options?: RequestInit,
): Promise<createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostResponse> => {
  return customFetch<createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostResponse>(
    getCreateOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostUrl(),
    {
      ...options,
      method: "POST",
      headers: { "Content-Type": "application/json", ...options?.headers },
      body: JSON.stringify(taskCustomFieldDefinitionCreate),
    },
  );
};

export const getCreateOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostMutationOptions =
  <TError = HTTPValidationError, TContext = unknown>(options?: {
    mutation?: UseMutationOptions<
      Awaited<
        ReturnType<
          typeof createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPost
        >
      >,
      TError,
      { data: TaskCustomFieldDefinitionCreate },
      TContext
    >;
    request?: SecondParameter<typeof customFetch>;
  }): UseMutationOptions<
    Awaited<
      ReturnType<
        typeof createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPost
      >
    >,
    TError,
    { data: TaskCustomFieldDefinitionCreate },
    TContext
  > => {
    const mutationKey = [
      "createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPost",
    ];
    const { mutation: mutationOptions, request: requestOptions } = options
      ? options.mutation &&
        "mutationKey" in options.mutation &&
        options.mutation.mutationKey
        ? options
        : { ...options, mutation: { ...options.mutation, mutationKey } }
      : { mutation: { mutationKey }, request: undefined };

    const mutationFn: MutationFunction<
      Awaited<
        ReturnType<
          typeof createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPost
        >
      >,
      { data: TaskCustomFieldDefinitionCreate }
    > = (props) => {
      const { data } = props ?? {};

      return createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPost(
        data,
        requestOptions,
      );
    };

    return { mutationFn, ...mutationOptions };
  };

export type CreateOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostMutationResult =
  NonNullable<
    Awaited<
      ReturnType<
        typeof createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPost
      >
    >
  >;
export type CreateOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostMutationBody =
  TaskCustomFieldDefinitionCreate;
export type CreateOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostMutationError =
  HTTPValidationError;

/**
 * @summary Create Org Custom Field
 */
export const useCreateOrgCustomFieldApiV1OrganizationsMeCustomFieldsPost = <
  TError = HTTPValidationError,
  TContext = unknown,
>(
  options?: {
    mutation?: UseMutationOptions<
      Awaited<
        ReturnType<
          typeof createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPost
        >
      >,
      TError,
      { data: TaskCustomFieldDefinitionCreate },
      TContext
    >;
    request?: SecondParameter<typeof customFetch>;
  },
  queryClient?: QueryClient,
): UseMutationResult<
  Awaited<
    ReturnType<typeof createOrgCustomFieldApiV1OrganizationsMeCustomFieldsPost>
  >,
  TError,
  { data: TaskCustomFieldDefinitionCreate },
  TContext
> => {
  return useMutation(
    getCreateOrgCustomFieldApiV1OrganizationsMeCustomFieldsPostMutationOptions(
      options,
    ),
    queryClient,
  );
};
/**
 * Delete an org-level definition when it has no persisted task values.
 * @summary Delete Org Custom Field
 */
export type deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteResponse200 =
  {
    data: OkResponse;
    status: 200;
  };

export type deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteResponse422 =
  {
    data: HTTPValidationError;
    status: 422;
  };

export type deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteResponseSuccess =
  deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteResponse200 & {
    headers: Headers;
  };
export type deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteResponseError =
  deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteResponse422 & {
    headers: Headers;
  };

export type deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteResponse =

    | deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteResponseSuccess
    | deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteResponseError;

export const getDeleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteUrl =
  (taskCustomFieldDefinitionId: string) => {
    return `/api/v1/organizations/me/custom-fields/${taskCustomFieldDefinitionId}`;
  };

export const deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDelete =
  async (
    taskCustomFieldDefinitionId: string,
    options?: RequestInit,
  ): Promise<deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteResponse> => {
    return customFetch<deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteResponse>(
      getDeleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteUrl(
        taskCustomFieldDefinitionId,
      ),
      {
        ...options,
        method: "DELETE",
      },
    );
  };

export const getDeleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteMutationOptions =
  <TError = HTTPValidationError, TContext = unknown>(options?: {
    mutation?: UseMutationOptions<
      Awaited<
        ReturnType<
          typeof deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDelete
        >
      >,
      TError,
      { taskCustomFieldDefinitionId: string },
      TContext
    >;
    request?: SecondParameter<typeof customFetch>;
  }): UseMutationOptions<
    Awaited<
      ReturnType<
        typeof deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDelete
      >
    >,
    TError,
    { taskCustomFieldDefinitionId: string },
    TContext
  > => {
    const mutationKey = [
      "deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDelete",
    ];
    const { mutation: mutationOptions, request: requestOptions } = options
      ? options.mutation &&
        "mutationKey" in options.mutation &&
        options.mutation.mutationKey
        ? options
        : { ...options, mutation: { ...options.mutation, mutationKey } }
      : { mutation: { mutationKey }, request: undefined };

    const mutationFn: MutationFunction<
      Awaited<
        ReturnType<
          typeof deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDelete
        >
      >,
      { taskCustomFieldDefinitionId: string }
    > = (props) => {
      const { taskCustomFieldDefinitionId } = props ?? {};

      return deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDelete(
        taskCustomFieldDefinitionId,
        requestOptions,
      );
    };

    return { mutationFn, ...mutationOptions };
  };

export type DeleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteMutationResult =
  NonNullable<
    Awaited<
      ReturnType<
        typeof deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDelete
      >
    >
  >;

export type DeleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteMutationError =
  HTTPValidationError;

/**
 * @summary Delete Org Custom Field
 */
export const useDeleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDelete =
  <TError = HTTPValidationError, TContext = unknown>(
    options?: {
      mutation?: UseMutationOptions<
        Awaited<
          ReturnType<
            typeof deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDelete
          >
        >,
        TError,
        { taskCustomFieldDefinitionId: string },
        TContext
      >;
      request?: SecondParameter<typeof customFetch>;
    },
    queryClient?: QueryClient,
  ): UseMutationResult<
    Awaited<
      ReturnType<
        typeof deleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDelete
      >
    >,
    TError,
    { taskCustomFieldDefinitionId: string },
    TContext
  > => {
    return useMutation(
      getDeleteOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdDeleteMutationOptions(
        options,
      ),
      queryClient,
    );
  };
/**
 * Update an organization-level task custom field definition.
 * @summary Update Org Custom Field
 */
export type updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchResponse200 =
  {
    data: TaskCustomFieldDefinitionRead;
    status: 200;
  };

export type updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchResponse422 =
  {
    data: HTTPValidationError;
    status: 422;
  };

export type updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchResponseSuccess =
  updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchResponse200 & {
    headers: Headers;
  };
export type updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchResponseError =
  updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchResponse422 & {
    headers: Headers;
  };

export type updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchResponse =

    | updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchResponseSuccess
    | updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchResponseError;

export const getUpdateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchUrl =
  (taskCustomFieldDefinitionId: string) => {
    return `/api/v1/organizations/me/custom-fields/${taskCustomFieldDefinitionId}`;
  };

export const updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatch =
  async (
    taskCustomFieldDefinitionId: string,
    taskCustomFieldDefinitionUpdate: TaskCustomFieldDefinitionUpdate,
    options?: RequestInit,
  ): Promise<updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchResponse> => {
    return customFetch<updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchResponse>(
      getUpdateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchUrl(
        taskCustomFieldDefinitionId,
      ),
      {
        ...options,
        method: "PATCH",
        headers: { "Content-Type": "application/json", ...options?.headers },
        body: JSON.stringify(taskCustomFieldDefinitionUpdate),
      },
    );
  };

export const getUpdateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchMutationOptions =
  <TError = HTTPValidationError, TContext = unknown>(options?: {
    mutation?: UseMutationOptions<
      Awaited<
        ReturnType<
          typeof updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatch
        >
      >,
      TError,
      {
        taskCustomFieldDefinitionId: string;
        data: TaskCustomFieldDefinitionUpdate;
      },
      TContext
    >;
    request?: SecondParameter<typeof customFetch>;
  }): UseMutationOptions<
    Awaited<
      ReturnType<
        typeof updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatch
      >
    >,
    TError,
    {
      taskCustomFieldDefinitionId: string;
      data: TaskCustomFieldDefinitionUpdate;
    },
    TContext
  > => {
    const mutationKey = [
      "updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatch",
    ];
    const { mutation: mutationOptions, request: requestOptions } = options
      ? options.mutation &&
        "mutationKey" in options.mutation &&
        options.mutation.mutationKey
        ? options
        : { ...options, mutation: { ...options.mutation, mutationKey } }
      : { mutation: { mutationKey }, request: undefined };

    const mutationFn: MutationFunction<
      Awaited<
        ReturnType<
          typeof updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatch
        >
      >,
      {
        taskCustomFieldDefinitionId: string;
        data: TaskCustomFieldDefinitionUpdate;
      }
    > = (props) => {
      const { taskCustomFieldDefinitionId, data } = props ?? {};

      return updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatch(
        taskCustomFieldDefinitionId,
        data,
        requestOptions,
      );
    };

    return { mutationFn, ...mutationOptions };
  };

export type UpdateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchMutationResult =
  NonNullable<
    Awaited<
      ReturnType<
        typeof updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatch
      >
    >
  >;
export type UpdateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchMutationBody =
  TaskCustomFieldDefinitionUpdate;
export type UpdateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchMutationError =
  HTTPValidationError;

/**
 * @summary Update Org Custom Field
 */
export const useUpdateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatch =
  <TError = HTTPValidationError, TContext = unknown>(
    options?: {
      mutation?: UseMutationOptions<
        Awaited<
          ReturnType<
            typeof updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatch
          >
        >,
        TError,
        {
          taskCustomFieldDefinitionId: string;
          data: TaskCustomFieldDefinitionUpdate;
        },
        TContext
      >;
      request?: SecondParameter<typeof customFetch>;
    },
    queryClient?: QueryClient,
  ): UseMutationResult<
    Awaited<
      ReturnType<
        typeof updateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatch
      >
    >,
    TError,
    {
      taskCustomFieldDefinitionId: string;
      data: TaskCustomFieldDefinitionUpdate;
    },
    TContext
  > => {
    return useMutation(
      getUpdateOrgCustomFieldApiV1OrganizationsMeCustomFieldsTaskCustomFieldDefinitionIdPatchMutationOptions(
        options,
      ),
      queryClient,
    );
  };
