/** * Generated by orval v8.2.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 { GatewayCommandsApiV1GatewayCommandsGet200, GatewayStatusApiV1GatewayStatusGet200, GatewayStatusApiV1GatewayStatusGetParams, GetGatewaySessionApiV1GatewaySessionsSessionIdGet200, GetGatewaySessionApiV1GatewaySessionsSessionIdGetParams, GetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet200, GetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetParams, HTTPValidationError, ListSessionsApiV1GatewaySessionsGet200, ListSessionsApiV1GatewaySessionsGetParams, SendSessionMessageApiV1GatewaySessionsSessionIdMessagePost200, SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostBody, SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostParams, } from ".././model"; import { customFetch } from "../../mutator"; type SecondParameter unknown> = Parameters[1]; /** * @summary Gateway Status */ export type gatewayStatusApiV1GatewayStatusGetResponse200 = { data: GatewayStatusApiV1GatewayStatusGet200; status: 200; }; export type gatewayStatusApiV1GatewayStatusGetResponse422 = { data: HTTPValidationError; status: 422; }; export type gatewayStatusApiV1GatewayStatusGetResponseSuccess = gatewayStatusApiV1GatewayStatusGetResponse200 & { headers: Headers; }; export type gatewayStatusApiV1GatewayStatusGetResponseError = gatewayStatusApiV1GatewayStatusGetResponse422 & { headers: Headers; }; export type gatewayStatusApiV1GatewayStatusGetResponse = | gatewayStatusApiV1GatewayStatusGetResponseSuccess | gatewayStatusApiV1GatewayStatusGetResponseError; export const getGatewayStatusApiV1GatewayStatusGetUrl = ( params?: GatewayStatusApiV1GatewayStatusGetParams, ) => { const normalizedParams = new URLSearchParams(); Object.entries(params || {}).forEach(([key, value]) => { if (value !== undefined) { normalizedParams.append(key, value === null ? "null" : value.toString()); } }); const stringifiedParams = normalizedParams.toString(); return stringifiedParams.length > 0 ? `/api/v1/gateways/status?${stringifiedParams}` : `/api/v1/gateways/status`; }; export const gatewayStatusApiV1GatewayStatusGet = async ( params?: GatewayStatusApiV1GatewayStatusGetParams, options?: RequestInit, ): Promise => { return customFetch( getGatewayStatusApiV1GatewayStatusGetUrl(params), { ...options, method: "GET", }, ); }; export const getGatewayStatusApiV1GatewayStatusGetQueryKey = ( params?: GatewayStatusApiV1GatewayStatusGetParams, ) => { return [`/api/v1/gateways/status`, ...(params ? [params] : [])] as const; }; export const getGatewayStatusApiV1GatewayStatusGetQueryOptions = < TData = Awaited>, TError = HTTPValidationError, >( params?: GatewayStatusApiV1GatewayStatusGetParams, options?: { query?: Partial< UseQueryOptions< Awaited>, TError, TData > >; request?: SecondParameter; }, ) => { const { query: queryOptions, request: requestOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGatewayStatusApiV1GatewayStatusGetQueryKey(params); const queryFn: QueryFunction< Awaited> > = ({ signal }) => gatewayStatusApiV1GatewayStatusGet(params, { signal, ...requestOptions }); return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, TError, TData > & { queryKey: DataTag }; }; export type GatewayStatusApiV1GatewayStatusGetQueryResult = NonNullable< Awaited> >; export type GatewayStatusApiV1GatewayStatusGetQueryError = HTTPValidationError; export function useGatewayStatusApiV1GatewayStatusGet< TData = Awaited>, TError = HTTPValidationError, >( params: undefined | GatewayStatusApiV1GatewayStatusGetParams, options: { query: Partial< UseQueryOptions< Awaited>, TError, TData > > & Pick< DefinedInitialDataOptions< Awaited>, TError, Awaited> >, "initialData" >; request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { queryKey: DataTag; }; export function useGatewayStatusApiV1GatewayStatusGet< TData = Awaited>, TError = HTTPValidationError, >( params?: GatewayStatusApiV1GatewayStatusGetParams, options?: { query?: Partial< UseQueryOptions< Awaited>, TError, TData > > & Pick< UndefinedInitialDataOptions< Awaited>, TError, Awaited> >, "initialData" >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; }; export function useGatewayStatusApiV1GatewayStatusGet< TData = Awaited>, TError = HTTPValidationError, >( params?: GatewayStatusApiV1GatewayStatusGetParams, options?: { query?: Partial< UseQueryOptions< Awaited>, TError, TData > >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; }; /** * @summary Gateway Status */ export function useGatewayStatusApiV1GatewayStatusGet< TData = Awaited>, TError = HTTPValidationError, >( params?: GatewayStatusApiV1GatewayStatusGetParams, options?: { query?: Partial< UseQueryOptions< Awaited>, TError, TData > >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; } { const queryOptions = getGatewayStatusApiV1GatewayStatusGetQueryOptions( params, options, ); const query = useQuery(queryOptions, queryClient) as UseQueryResult< TData, TError > & { queryKey: DataTag }; return { ...query, queryKey: queryOptions.queryKey }; } /** * @summary List Sessions */ export type listSessionsApiV1GatewaySessionsGetResponse200 = { data: ListSessionsApiV1GatewaySessionsGet200; status: 200; }; export type listSessionsApiV1GatewaySessionsGetResponse422 = { data: HTTPValidationError; status: 422; }; export type listSessionsApiV1GatewaySessionsGetResponseSuccess = listSessionsApiV1GatewaySessionsGetResponse200 & { headers: Headers; }; export type listSessionsApiV1GatewaySessionsGetResponseError = listSessionsApiV1GatewaySessionsGetResponse422 & { headers: Headers; }; export type listSessionsApiV1GatewaySessionsGetResponse = | listSessionsApiV1GatewaySessionsGetResponseSuccess | listSessionsApiV1GatewaySessionsGetResponseError; export const getListSessionsApiV1GatewaySessionsGetUrl = ( params?: ListSessionsApiV1GatewaySessionsGetParams, ) => { const normalizedParams = new URLSearchParams(); Object.entries(params || {}).forEach(([key, value]) => { if (value !== undefined) { normalizedParams.append(key, value === null ? "null" : value.toString()); } }); const stringifiedParams = normalizedParams.toString(); return stringifiedParams.length > 0 ? `/api/v1/gateways/sessions?${stringifiedParams}` : `/api/v1/gateways/sessions`; }; export const listSessionsApiV1GatewaySessionsGet = async ( params?: ListSessionsApiV1GatewaySessionsGetParams, options?: RequestInit, ): Promise => { return customFetch( getListSessionsApiV1GatewaySessionsGetUrl(params), { ...options, method: "GET", }, ); }; export const getListSessionsApiV1GatewaySessionsGetQueryKey = ( params?: ListSessionsApiV1GatewaySessionsGetParams, ) => { return [`/api/v1/gateways/sessions`, ...(params ? [params] : [])] as const; }; export const getListSessionsApiV1GatewaySessionsGetQueryOptions = < TData = Awaited>, TError = HTTPValidationError, >( params?: ListSessionsApiV1GatewaySessionsGetParams, options?: { query?: Partial< UseQueryOptions< Awaited>, TError, TData > >; request?: SecondParameter; }, ) => { const { query: queryOptions, request: requestOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getListSessionsApiV1GatewaySessionsGetQueryKey(params); const queryFn: QueryFunction< Awaited> > = ({ signal }) => listSessionsApiV1GatewaySessionsGet(params, { signal, ...requestOptions }); return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, TError, TData > & { queryKey: DataTag }; }; export type ListSessionsApiV1GatewaySessionsGetQueryResult = NonNullable< Awaited> >; export type ListSessionsApiV1GatewaySessionsGetQueryError = HTTPValidationError; export function useListSessionsApiV1GatewaySessionsGet< TData = Awaited>, TError = HTTPValidationError, >( params: undefined | ListSessionsApiV1GatewaySessionsGetParams, options: { query: Partial< UseQueryOptions< Awaited>, TError, TData > > & Pick< DefinedInitialDataOptions< Awaited>, TError, Awaited> >, "initialData" >; request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { queryKey: DataTag; }; export function useListSessionsApiV1GatewaySessionsGet< TData = Awaited>, TError = HTTPValidationError, >( params?: ListSessionsApiV1GatewaySessionsGetParams, options?: { query?: Partial< UseQueryOptions< Awaited>, TError, TData > > & Pick< UndefinedInitialDataOptions< Awaited>, TError, Awaited> >, "initialData" >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; }; export function useListSessionsApiV1GatewaySessionsGet< TData = Awaited>, TError = HTTPValidationError, >( params?: ListSessionsApiV1GatewaySessionsGetParams, options?: { query?: Partial< UseQueryOptions< Awaited>, TError, TData > >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; }; /** * @summary List Sessions */ export function useListSessionsApiV1GatewaySessionsGet< TData = Awaited>, TError = HTTPValidationError, >( params?: ListSessionsApiV1GatewaySessionsGetParams, options?: { query?: Partial< UseQueryOptions< Awaited>, TError, TData > >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; } { const queryOptions = getListSessionsApiV1GatewaySessionsGetQueryOptions( params, options, ); const query = useQuery(queryOptions, queryClient) as UseQueryResult< TData, TError > & { queryKey: DataTag }; return { ...query, queryKey: queryOptions.queryKey }; } /** * @summary Get Gateway Session */ export type getGatewaySessionApiV1GatewaySessionsSessionIdGetResponse200 = { data: GetGatewaySessionApiV1GatewaySessionsSessionIdGet200; status: 200; }; export type getGatewaySessionApiV1GatewaySessionsSessionIdGetResponse422 = { data: HTTPValidationError; status: 422; }; export type getGatewaySessionApiV1GatewaySessionsSessionIdGetResponseSuccess = getGatewaySessionApiV1GatewaySessionsSessionIdGetResponse200 & { headers: Headers; }; export type getGatewaySessionApiV1GatewaySessionsSessionIdGetResponseError = getGatewaySessionApiV1GatewaySessionsSessionIdGetResponse422 & { headers: Headers; }; export type getGatewaySessionApiV1GatewaySessionsSessionIdGetResponse = | getGatewaySessionApiV1GatewaySessionsSessionIdGetResponseSuccess | getGatewaySessionApiV1GatewaySessionsSessionIdGetResponseError; export const getGetGatewaySessionApiV1GatewaySessionsSessionIdGetUrl = ( sessionId: string, params?: GetGatewaySessionApiV1GatewaySessionsSessionIdGetParams, ) => { const normalizedParams = new URLSearchParams(); Object.entries(params || {}).forEach(([key, value]) => { if (value !== undefined) { normalizedParams.append(key, value === null ? "null" : value.toString()); } }); const stringifiedParams = normalizedParams.toString(); return stringifiedParams.length > 0 ? `/api/v1/gateways/sessions/${sessionId}?${stringifiedParams}` : `/api/v1/gateways/sessions/${sessionId}`; }; export const getGatewaySessionApiV1GatewaySessionsSessionIdGet = async ( sessionId: string, params?: GetGatewaySessionApiV1GatewaySessionsSessionIdGetParams, options?: RequestInit, ): Promise => { return customFetch( getGetGatewaySessionApiV1GatewaySessionsSessionIdGetUrl(sessionId, params), { ...options, method: "GET", }, ); }; export const getGetGatewaySessionApiV1GatewaySessionsSessionIdGetQueryKey = ( sessionId: string, params?: GetGatewaySessionApiV1GatewaySessionsSessionIdGetParams, ) => { return [ `/api/v1/gateways/sessions/${sessionId}`, ...(params ? [params] : []), ] as const; }; export const getGetGatewaySessionApiV1GatewaySessionsSessionIdGetQueryOptions = < TData = Awaited< ReturnType >, TError = HTTPValidationError, >( sessionId: string, params?: GetGatewaySessionApiV1GatewaySessionsSessionIdGetParams, options?: { query?: Partial< UseQueryOptions< Awaited< ReturnType >, TError, TData > >; request?: SecondParameter; }, ) => { const { query: queryOptions, request: requestOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetGatewaySessionApiV1GatewaySessionsSessionIdGetQueryKey( sessionId, params, ); const queryFn: QueryFunction< Awaited< ReturnType > > = ({ signal }) => getGatewaySessionApiV1GatewaySessionsSessionIdGet(sessionId, params, { signal, ...requestOptions, }); return { queryKey, queryFn, enabled: !!sessionId, ...queryOptions, } as UseQueryOptions< Awaited< ReturnType >, TError, TData > & { queryKey: DataTag }; }; export type GetGatewaySessionApiV1GatewaySessionsSessionIdGetQueryResult = NonNullable< Awaited< ReturnType > >; export type GetGatewaySessionApiV1GatewaySessionsSessionIdGetQueryError = HTTPValidationError; export function useGetGatewaySessionApiV1GatewaySessionsSessionIdGet< TData = Awaited< ReturnType >, TError = HTTPValidationError, >( sessionId: string, params: undefined | GetGatewaySessionApiV1GatewaySessionsSessionIdGetParams, options: { query: Partial< UseQueryOptions< Awaited< ReturnType >, TError, TData > > & Pick< DefinedInitialDataOptions< Awaited< ReturnType >, TError, Awaited< ReturnType > >, "initialData" >; request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { queryKey: DataTag; }; export function useGetGatewaySessionApiV1GatewaySessionsSessionIdGet< TData = Awaited< ReturnType >, TError = HTTPValidationError, >( sessionId: string, params?: GetGatewaySessionApiV1GatewaySessionsSessionIdGetParams, options?: { query?: Partial< UseQueryOptions< Awaited< ReturnType >, TError, TData > > & Pick< UndefinedInitialDataOptions< Awaited< ReturnType >, TError, Awaited< ReturnType > >, "initialData" >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; }; export function useGetGatewaySessionApiV1GatewaySessionsSessionIdGet< TData = Awaited< ReturnType >, TError = HTTPValidationError, >( sessionId: string, params?: GetGatewaySessionApiV1GatewaySessionsSessionIdGetParams, options?: { query?: Partial< UseQueryOptions< Awaited< ReturnType >, TError, TData > >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; }; /** * @summary Get Gateway Session */ export function useGetGatewaySessionApiV1GatewaySessionsSessionIdGet< TData = Awaited< ReturnType >, TError = HTTPValidationError, >( sessionId: string, params?: GetGatewaySessionApiV1GatewaySessionsSessionIdGetParams, options?: { query?: Partial< UseQueryOptions< Awaited< ReturnType >, TError, TData > >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; } { const queryOptions = getGetGatewaySessionApiV1GatewaySessionsSessionIdGetQueryOptions( sessionId, params, options, ); const query = useQuery(queryOptions, queryClient) as UseQueryResult< TData, TError > & { queryKey: DataTag }; return { ...query, queryKey: queryOptions.queryKey }; } /** * @summary Get Session History */ export type getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetResponse200 = { data: GetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet200; status: 200; }; export type getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetResponse422 = { data: HTTPValidationError; status: 422; }; export type getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetResponseSuccess = getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetResponse200 & { headers: Headers; }; export type getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetResponseError = getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetResponse422 & { headers: Headers; }; export type getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetResponse = | getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetResponseSuccess | getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetResponseError; export const getGetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetUrl = ( sessionId: string, params?: GetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetParams, ) => { const normalizedParams = new URLSearchParams(); Object.entries(params || {}).forEach(([key, value]) => { if (value !== undefined) { normalizedParams.append(key, value === null ? "null" : value.toString()); } }); const stringifiedParams = normalizedParams.toString(); return stringifiedParams.length > 0 ? `/api/v1/gateways/sessions/${sessionId}/history?${stringifiedParams}` : `/api/v1/gateways/sessions/${sessionId}/history`; }; export const getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet = async ( sessionId: string, params?: GetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetParams, options?: RequestInit, ): Promise => { return customFetch( getGetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetUrl( sessionId, params, ), { ...options, method: "GET", }, ); }; export const getGetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetQueryKey = ( sessionId: string, params?: GetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetParams, ) => { return [ `/api/v1/gateways/sessions/${sessionId}/history`, ...(params ? [params] : []), ] as const; }; export const getGetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetQueryOptions = < TData = Awaited< ReturnType< typeof getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet > >, TError = HTTPValidationError, >( sessionId: string, params?: GetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetParams, options?: { query?: Partial< UseQueryOptions< Awaited< ReturnType< typeof getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet > >, TError, TData > >; request?: SecondParameter; }, ) => { const { query: queryOptions, request: requestOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetQueryKey( sessionId, params, ); const queryFn: QueryFunction< Awaited< ReturnType< typeof getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet > > > = ({ signal }) => getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet( sessionId, params, { signal, ...requestOptions }, ); return { queryKey, queryFn, enabled: !!sessionId, ...queryOptions, } as UseQueryOptions< Awaited< ReturnType< typeof getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet > >, TError, TData > & { queryKey: DataTag }; }; export type GetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetQueryResult = NonNullable< Awaited< ReturnType< typeof getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet > > >; export type GetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetQueryError = HTTPValidationError; export function useGetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet< TData = Awaited< ReturnType >, TError = HTTPValidationError, >( sessionId: string, params: | undefined | GetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetParams, options: { query: Partial< UseQueryOptions< Awaited< ReturnType< typeof getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet > >, TError, TData > > & Pick< DefinedInitialDataOptions< Awaited< ReturnType< typeof getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet > >, TError, Awaited< ReturnType< typeof getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet > > >, "initialData" >; request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { queryKey: DataTag; }; export function useGetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet< TData = Awaited< ReturnType >, TError = HTTPValidationError, >( sessionId: string, params?: GetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetParams, options?: { query?: Partial< UseQueryOptions< Awaited< ReturnType< typeof getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet > >, TError, TData > > & Pick< UndefinedInitialDataOptions< Awaited< ReturnType< typeof getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet > >, TError, Awaited< ReturnType< typeof getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet > > >, "initialData" >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; }; export function useGetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet< TData = Awaited< ReturnType >, TError = HTTPValidationError, >( sessionId: string, params?: GetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetParams, options?: { query?: Partial< UseQueryOptions< Awaited< ReturnType< typeof getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet > >, TError, TData > >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; }; /** * @summary Get Session History */ export function useGetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet< TData = Awaited< ReturnType >, TError = HTTPValidationError, >( sessionId: string, params?: GetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetParams, options?: { query?: Partial< UseQueryOptions< Awaited< ReturnType< typeof getSessionHistoryApiV1GatewaySessionsSessionIdHistoryGet > >, TError, TData > >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; } { const queryOptions = getGetSessionHistoryApiV1GatewaySessionsSessionIdHistoryGetQueryOptions( sessionId, params, options, ); const query = useQuery(queryOptions, queryClient) as UseQueryResult< TData, TError > & { queryKey: DataTag }; return { ...query, queryKey: queryOptions.queryKey }; } /** * @summary Send Session Message */ export type sendSessionMessageApiV1GatewaySessionsSessionIdMessagePostResponse200 = { data: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePost200; status: 200; }; export type sendSessionMessageApiV1GatewaySessionsSessionIdMessagePostResponse422 = { data: HTTPValidationError; status: 422; }; export type sendSessionMessageApiV1GatewaySessionsSessionIdMessagePostResponseSuccess = sendSessionMessageApiV1GatewaySessionsSessionIdMessagePostResponse200 & { headers: Headers; }; export type sendSessionMessageApiV1GatewaySessionsSessionIdMessagePostResponseError = sendSessionMessageApiV1GatewaySessionsSessionIdMessagePostResponse422 & { headers: Headers; }; export type sendSessionMessageApiV1GatewaySessionsSessionIdMessagePostResponse = | sendSessionMessageApiV1GatewaySessionsSessionIdMessagePostResponseSuccess | sendSessionMessageApiV1GatewaySessionsSessionIdMessagePostResponseError; export const getSendSessionMessageApiV1GatewaySessionsSessionIdMessagePostUrl = ( sessionId: string, params?: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostParams, ) => { const normalizedParams = new URLSearchParams(); Object.entries(params || {}).forEach(([key, value]) => { if (value !== undefined) { normalizedParams.append( key, value === null ? "null" : value.toString(), ); } }); const stringifiedParams = normalizedParams.toString(); return stringifiedParams.length > 0 ? `/api/v1/gateways/sessions/${sessionId}/message?${stringifiedParams}` : `/api/v1/gateways/sessions/${sessionId}/message`; }; export const sendSessionMessageApiV1GatewaySessionsSessionIdMessagePost = async ( sessionId: string, sendSessionMessageApiV1GatewaySessionsSessionIdMessagePostBody: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostBody, params?: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostParams, options?: RequestInit, ): Promise => { return customFetch( getSendSessionMessageApiV1GatewaySessionsSessionIdMessagePostUrl( sessionId, params, ), { ...options, method: "POST", headers: { "Content-Type": "application/json", ...options?.headers }, body: JSON.stringify( sendSessionMessageApiV1GatewaySessionsSessionIdMessagePostBody, ), }, ); }; export const getSendSessionMessageApiV1GatewaySessionsSessionIdMessagePostMutationOptions = (options?: { mutation?: UseMutationOptions< Awaited< ReturnType< typeof sendSessionMessageApiV1GatewaySessionsSessionIdMessagePost > >, TError, { sessionId: string; data: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostBody; params?: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostParams; }, TContext >; request?: SecondParameter; }): UseMutationOptions< Awaited< ReturnType< typeof sendSessionMessageApiV1GatewaySessionsSessionIdMessagePost > >, TError, { sessionId: string; data: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostBody; params?: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostParams; }, TContext > => { const mutationKey = [ "sendSessionMessageApiV1GatewaySessionsSessionIdMessagePost", ]; 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 sendSessionMessageApiV1GatewaySessionsSessionIdMessagePost > >, { sessionId: string; data: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostBody; params?: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostParams; } > = (props) => { const { sessionId, data, params } = props ?? {}; return sendSessionMessageApiV1GatewaySessionsSessionIdMessagePost( sessionId, data, params, requestOptions, ); }; return { mutationFn, ...mutationOptions }; }; export type SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostMutationResult = NonNullable< Awaited< ReturnType< typeof sendSessionMessageApiV1GatewaySessionsSessionIdMessagePost > > >; export type SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostMutationBody = SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostBody; export type SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostMutationError = HTTPValidationError; /** * @summary Send Session Message */ export const useSendSessionMessageApiV1GatewaySessionsSessionIdMessagePost = < TError = HTTPValidationError, TContext = unknown, >( options?: { mutation?: UseMutationOptions< Awaited< ReturnType< typeof sendSessionMessageApiV1GatewaySessionsSessionIdMessagePost > >, TError, { sessionId: string; data: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostBody; params?: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostParams; }, TContext >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseMutationResult< Awaited< ReturnType< typeof sendSessionMessageApiV1GatewaySessionsSessionIdMessagePost > >, TError, { sessionId: string; data: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostBody; params?: SendSessionMessageApiV1GatewaySessionsSessionIdMessagePostParams; }, TContext > => { return useMutation( getSendSessionMessageApiV1GatewaySessionsSessionIdMessagePostMutationOptions( options, ), queryClient, ); }; /** * @summary Gateway Commands */ export type gatewayCommandsApiV1GatewayCommandsGetResponse200 = { data: GatewayCommandsApiV1GatewayCommandsGet200; status: 200; }; export type gatewayCommandsApiV1GatewayCommandsGetResponseSuccess = gatewayCommandsApiV1GatewayCommandsGetResponse200 & { headers: Headers; }; export type gatewayCommandsApiV1GatewayCommandsGetResponse = gatewayCommandsApiV1GatewayCommandsGetResponseSuccess; export const getGatewayCommandsApiV1GatewayCommandsGetUrl = () => { return `/api/v1/gateways/commands`; }; export const gatewayCommandsApiV1GatewayCommandsGet = async ( options?: RequestInit, ): Promise => { return customFetch( getGatewayCommandsApiV1GatewayCommandsGetUrl(), { ...options, method: "GET", }, ); }; export const getGatewayCommandsApiV1GatewayCommandsGetQueryKey = () => { return [`/api/v1/gateways/commands`] as const; }; export const getGatewayCommandsApiV1GatewayCommandsGetQueryOptions = < TData = Awaited>, TError = unknown, >(options?: { query?: Partial< UseQueryOptions< Awaited>, TError, TData > >; request?: SecondParameter; }) => { const { query: queryOptions, request: requestOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGatewayCommandsApiV1GatewayCommandsGetQueryKey(); const queryFn: QueryFunction< Awaited> > = ({ signal }) => gatewayCommandsApiV1GatewayCommandsGet({ signal, ...requestOptions }); return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, TError, TData > & { queryKey: DataTag }; }; export type GatewayCommandsApiV1GatewayCommandsGetQueryResult = NonNullable< Awaited> >; export type GatewayCommandsApiV1GatewayCommandsGetQueryError = unknown; export function useGatewayCommandsApiV1GatewayCommandsGet< TData = Awaited>, TError = unknown, >( options: { query: Partial< UseQueryOptions< Awaited>, TError, TData > > & Pick< DefinedInitialDataOptions< Awaited>, TError, Awaited> >, "initialData" >; request?: SecondParameter; }, queryClient?: QueryClient, ): DefinedUseQueryResult & { queryKey: DataTag; }; export function useGatewayCommandsApiV1GatewayCommandsGet< TData = Awaited>, TError = unknown, >( options?: { query?: Partial< UseQueryOptions< Awaited>, TError, TData > > & Pick< UndefinedInitialDataOptions< Awaited>, TError, Awaited> >, "initialData" >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; }; export function useGatewayCommandsApiV1GatewayCommandsGet< TData = Awaited>, TError = unknown, >( options?: { query?: Partial< UseQueryOptions< Awaited>, TError, TData > >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; }; /** * @summary Gateway Commands */ export function useGatewayCommandsApiV1GatewayCommandsGet< TData = Awaited>, TError = unknown, >( options?: { query?: Partial< UseQueryOptions< Awaited>, TError, TData > >; request?: SecondParameter; }, queryClient?: QueryClient, ): UseQueryResult & { queryKey: DataTag; } { const queryOptions = getGatewayCommandsApiV1GatewayCommandsGetQueryOptions(options); const query = useQuery(queryOptions, queryClient) as UseQueryResult< TData, TError > & { queryKey: DataTag }; return { ...query, queryKey: queryOptions.queryKey }; }