export type GetApiSpaceIdAccountsIdWebsitesArgs = {spaceId: string, id: string}; export type GetApiSpaceIdAccountsIdWebsitesOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * List the websites associated with an Azure account. * * GET /{spaceId}/accounts/{id}/websites * * Also accepts auth: APIKeyQuery, NugetApiKeyHeader */ export const getApiSpaceIdAccountsIdWebsites = async (args: GetApiSpaceIdAccountsIdWebsitesArgs, options?: GetApiSpaceIdAccountsIdWebsitesOptions) => { const {baseUrl = "https://demo.octopus.app/api", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKeyHeader !== undefined) headers.set("X-Octopus-ApiKey", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(String(args.spaceId))}/accounts/${encodeURIComponent(String(args.id))}/websites${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 };