(
baseUrl: string,
requestOptions: OpenApiRequestOptions = {},
)
| 54 | } |
| 55 | |
| 56 | export async function getRegion( |
| 57 | baseUrl: string, |
| 58 | requestOptions: OpenApiRequestOptions = {}, |
| 59 | ): Promise<ReturnType<typeof handleOpenApiResponseWithBody<Region>>> { |
| 60 | const { headers, ...options } = requestOptions; |
| 61 | const client = |
| 62 | apiClient.type === "cloud" |
| 63 | ? createClient<paths>({ |
| 64 | baseUrl, |
| 65 | fetch: apiClient.cloudApiFetch, |
| 66 | }) |
| 67 | : null; |
| 68 | |
| 69 | if (client === null) { |
| 70 | throw new Error(NOT_SUPPORTED_MESSAGE); |
| 71 | } |
| 72 | const { data, response } = await client.GET("/api/region", { |
| 73 | headers, |
| 74 | ...options, |
| 75 | }); |
| 76 | if (response.status === 204) { |
| 77 | return { data: { regionState: "disabled" as const }, ...response }; |
| 78 | } |
| 79 | return handleOpenApiResponseWithBody(data, response); |
| 80 | } |
no test coverage detected