export type GetApiV1CloudProvidersPermissionsArgs = {provider?: ('aws' | 'aws-eusc' | 'gcp') | undefined, features?: (Array<'byoc' | 'byoc-static-egress' | 'byoc-custom-launch-templates' | 'byoc-custom-vpc' | 'byoc-logs' | 'cloudfront' | 'route53' | 'registry-pull' | 'registry-push' | 'opentofu' | 'workload-identity' | 'workload-identity-managed'>) | undefined}; export type GetApiV1CloudProvidersPermissionsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * List provider permissions * * GET /v1/cloud-providers/permissions */ export const getApiV1CloudProvidersPermissions = async (args: GetApiV1CloudProvidersPermissionsArgs, options?: GetApiV1CloudProvidersPermissionsOptions) => { const {baseUrl = "https://placeholder/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.provider != null) query.append("provider", String(args.provider)) for (const item of args.features ?? []) query.append("features", String(item)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/cloud-providers/permissions${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 };