export type GetApiSkeV2alpha1Thr1PremiumWorkspacesWorkspaceUUIDMachinesResourceIdArgs = {resourceId: string, workspaceUUID: string}; export type GetApiSkeV2alpha1Thr1PremiumWorkspacesWorkspaceUUIDMachinesResourceIdOptions = {baseUrl: string, BearerToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get Machine * * GET /ske/v2alpha1/thr1-premium/workspaces/{workspaceUUID}/machines/{resourceId} */ export const getApiSkeV2alpha1Thr1PremiumWorkspacesWorkspaceUUIDMachinesResourceId = async (args: GetApiSkeV2alpha1Thr1PremiumWorkspacesWorkspaceUUIDMachinesResourceIdArgs, options: GetApiSkeV2alpha1Thr1PremiumWorkspacesWorkspaceUUIDMachinesResourceIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, BearerToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerToken !== undefined) headers.set('authorization', `Bearer ${BearerToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/ske/v2alpha1/thr1-premium/workspaces/${encodeURIComponent(String(args.workspaceUUID))}/machines/${encodeURIComponent(String(args.resourceId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };