MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / getRegion

Function getRegion

console/src/api/cloudRegionApi.ts:56–80  ·  view source on GitHub ↗
(
  baseUrl: string,
  requestOptions: OpenApiRequestOptions = {},
)

Source from the content-addressed store, hash-verified

54}
55
56export 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}

Callers 2

genFunction · 0.85

Calls 1

Tested by

no test coverage detected