export type AiGatewayCaptureDeleteRequestDataAttributesMode = 'metadata_only' | 'full_capture'; export type AiGatewayCaptureDeleteRequestDataAttributesOperation = 'create' | 'replace' | 'delete'; export type AiGatewayCaptureScope = {tags?: {[key: string]: string} | undefined, team_id?: string | undefined, user_id?: string | undefined}; export type AiGatewayCaptureDeleteRequestDataAttributes = {configuration_revision: string, confirm_full_capture?: boolean | undefined, mode?: AiGatewayCaptureDeleteRequestDataAttributesMode | undefined, name?: string | undefined, operation?: AiGatewayCaptureDeleteRequestDataAttributesOperation | undefined, revision: number, scope?: AiGatewayCaptureScope | undefined}; export type AiGatewayCaptureDeleteRequestDataType = 'data-capture-overrides'; export type AiGatewayCaptureDeleteRequestData = {attributes: AiGatewayCaptureDeleteRequestDataAttributes, id: string, type: AiGatewayCaptureDeleteRequestDataType}; export type AiGatewayCaptureDeleteRequest = {data: AiGatewayCaptureDeleteRequestData}; export type DeleteApiApiV2DataCaptureOverridesIdArgs = {id: string, body: AiGatewayCaptureDeleteRequest}; export type DeleteApiApiV2DataCaptureOverridesIdOptions = {baseUrl?: string | undefined, apiKeyAuth?: string | undefined, appKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an AI Gateway data capture override * * DELETE /api/v2/data-capture/overrides/{id} * * Also accepts auth: AuthZ */ export const deleteApiApiV2DataCaptureOverridesId = async (args: DeleteApiApiV2DataCaptureOverridesIdArgs, options?: DeleteApiApiV2DataCaptureOverridesIdOptions) => { const {baseUrl = "https://api.datadoghq.com", fetch: fetchFn = fetch, apiKeyAuth, appKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKeyAuth !== undefined) headers.set("DD-API-KEY", apiKeyAuth) if (appKeyAuth !== undefined) headers.set("DD-APPLICATION-KEY", appKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/data-capture/overrides/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };