export type GetApiOauthDelegationsRevocationRequestsStatusArgs = {Accept: string, 'Content-Type': 'application/json', requested_at_end?: string | undefined}; export type GetApiOauthDelegationsRevocationRequestsStatusOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get OAuth delegations revocation requests status * * GET /oauth_delegations/revocation_requests/status */ export const getApiOauthDelegationsRevocationRequestsStatus = async (args: GetApiOauthDelegationsRevocationRequestsStatusArgs, options?: GetApiOauthDelegationsRevocationRequestsStatusOptions) => { const {baseUrl = "https://api.pagerduty.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (args.requested_at_end != null) query.append("requested_at_end", String(args.requested_at_end)) if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/oauth_delegations/revocation_requests/status${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 };