// @ts-nocheck
/**
 * This file was automatically generated by @cosmwasm/ts-codegen@0.33.0.
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
 * and run the @cosmwasm/ts-codegen generate command to regenerate this file.
 */

import { UseQueryOptions, useQuery, useMutation, UseMutationOptions } from '@tanstack/react-query'
import { ExecuteResult } from '@cosmjs/cosmwasm-stargate'
import { StdFee, Coin } from '@cosmjs/amino'
import {
  InstantiateMsg,
  ExecuteMsg,
  OwnerUpdate,
  QueryMsg,
  ActionKind,
  AccountKind,
  ConfigResponse,
  OwnerResponse,
  HealthState,
  Decimal,
  Uint128,
  HealthValuesResponse,
} from './MarsRoverHealthTypes.types'
import {
  MarsRoverHealthTypesQueryClient,
  MarsRoverHealthTypesClient,
} from './MarsRoverHealthTypes.client'
export const marsRoverHealthTypesQueryKeys = {
  contract: [
    {
      contract: 'marsRoverHealthTypes',
    },
  ] as const,
  address: (contractAddress: string | undefined) =>
    [{ ...marsRoverHealthTypesQueryKeys.contract[0], address: contractAddress }] as const,
  healthValues: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
    [
      {
        ...marsRoverHealthTypesQueryKeys.address(contractAddress)[0],
        method: 'health_values',
        args,
      },
    ] as const,
  healthState: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
    [
      {
        ...marsRoverHealthTypesQueryKeys.address(contractAddress)[0],
        method: 'health_state',
        args,
      },
    ] as const,
  config: (contractAddress: string | undefined, args?: Record<string, unknown>) =>
    [
      { ...marsRoverHealthTypesQueryKeys.address(contractAddress)[0], method: 'config', args },
    ] as const,
}
export interface MarsRoverHealthTypesReactQuery<TResponse, TData = TResponse> {
  client: MarsRoverHealthTypesQueryClient | undefined
  options?: Omit<
    UseQueryOptions<TResponse, Error, TData>,
    "'queryKey' | 'queryFn' | 'initialData'"
  > & {
    initialData?: undefined
  }
}
export interface MarsRoverHealthTypesConfigQuery<TData>
  extends MarsRoverHealthTypesReactQuery<ConfigResponse, TData> {}
export function useMarsRoverHealthTypesConfigQuery<TData = ConfigResponse>({
  client,
  options,
}: MarsRoverHealthTypesConfigQuery<TData>) {
  return useQuery<ConfigResponse, Error, TData>(
    marsRoverHealthTypesQueryKeys.config(client?.contractAddress),
    () => (client ? client.config() : Promise.reject(new Error('Invalid client'))),
    { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
  )
}
export interface MarsRoverHealthTypesHealthStateQuery<TData>
  extends MarsRoverHealthTypesReactQuery<HealthState, TData> {
  args: {
    accountId: string
    action: ActionKind
    kind: AccountKind
  }
}
export function useMarsRoverHealthTypesHealthStateQuery<TData = HealthState>({
  client,
  args,
  options,
}: MarsRoverHealthTypesHealthStateQuery<TData>) {
  return useQuery<HealthState, Error, TData>(
    marsRoverHealthTypesQueryKeys.healthState(client?.contractAddress, args),
    () =>
      client
        ? client.healthState({
            accountId: args.accountId,
            action: args.action,
            kind: args.kind,
          })
        : Promise.reject(new Error('Invalid client')),
    { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
  )
}
export interface MarsRoverHealthTypesHealthValuesQuery<TData>
  extends MarsRoverHealthTypesReactQuery<HealthValuesResponse, TData> {
  args: {
    accountId: string
    action: ActionKind
    kind: AccountKind
  }
}
export function useMarsRoverHealthTypesHealthValuesQuery<TData = HealthValuesResponse>({
  client,
  args,
  options,
}: MarsRoverHealthTypesHealthValuesQuery<TData>) {
  return useQuery<HealthValuesResponse, Error, TData>(
    marsRoverHealthTypesQueryKeys.healthValues(client?.contractAddress, args),
    () =>
      client
        ? client.healthValues({
            accountId: args.accountId,
            action: args.action,
            kind: args.kind,
          })
        : Promise.reject(new Error('Invalid client')),
    { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) },
  )
}
export interface MarsRoverHealthTypesUpdateConfigMutation {
  client: MarsRoverHealthTypesClient
  msg: {
    creditManager: string
  }
  args?: {
    fee?: number | StdFee | 'auto'
    memo?: string
    funds?: Coin[]
  }
}
export function useMarsRoverHealthTypesUpdateConfigMutation(
  options?: Omit<
    UseMutationOptions<ExecuteResult, Error, MarsRoverHealthTypesUpdateConfigMutation>,
    'mutationFn'
  >,
) {
  return useMutation<ExecuteResult, Error, MarsRoverHealthTypesUpdateConfigMutation>(
    ({ client, msg, args: { fee, memo, funds } = {} }) =>
      client.updateConfig(msg, fee, memo, funds),
    options,
  )
}
export interface MarsRoverHealthTypesUpdateOwnerMutation {
  client: MarsRoverHealthTypesClient
  msg: OwnerUpdate
  args?: {
    fee?: number | StdFee | 'auto'
    memo?: string
    funds?: Coin[]
  }
}
export function useMarsRoverHealthTypesUpdateOwnerMutation(
  options?: Omit<
    UseMutationOptions<ExecuteResult, Error, MarsRoverHealthTypesUpdateOwnerMutation>,
    'mutationFn'
  >,
) {
  return useMutation<ExecuteResult, Error, MarsRoverHealthTypesUpdateOwnerMutation>(
    ({ client, msg, args: { fee, memo, funds } = {} }) => client.updateOwner(msg, fee, memo, funds),
    options,
  )
}
