export type CompellingEvidence = {merchandise_or_service: string, merchandise_or_service_desc: string, merchandise_or_service_provided_date: string, shipping_delivery_status?: string | undefined, tracking_information?: string | undefined, user_id?: string | undefined, ip_address?: string | undefined, device_id?: string | undefined, shipping_address?: ({address: string, address2?: string | undefined, city: string, state_region?: string | undefined, postal_code: string, country: string}) | undefined, historical_transactions: Array<{historical_arn: string, merchandise_or_service_desc: string}>}; export type ProvideEvidenceRequest = {proof_of_delivery_or_service_file?: string | undefined, proof_of_delivery_or_service_text?: string | undefined, proof_of_delivery_or_service_date_file?: string | undefined, proof_of_delivery_or_service_date_text?: string | undefined, invoice_or_receipt_file?: string | undefined, invoice_or_receipt_text?: string | undefined, invoice_showing_distinct_transactions_file?: string | undefined, invoice_showing_distinct_transactions_text?: string | undefined, customer_communication_file?: string | undefined, customer_communication_text?: string | undefined, refund_or_cancellation_policy_file?: string | undefined, refund_or_cancellation_policy_text?: string | undefined, recurring_transaction_agreement_file?: string | undefined, recurring_transaction_agreement_text?: string | undefined, additional_evidence_file?: string | undefined, additional_evidence_text?: string | undefined, arbitration_no_review_files?: Array | undefined, arbitration_no_review_text?: string | undefined, arbitration_review_required_files?: Array | undefined, arbitration_review_required_text?: string | undefined, compelling_evidence?: CompellingEvidence | undefined, _links?: ({self?: ({href?: string | undefined}) | undefined, parent?: ({href?: string | undefined}) | undefined}) | undefined}; export type UpdateApiDisputesDisputeIdEvidenceArgs = {dispute_id: string, body: ProvideEvidenceRequest}; export type UpdateApiDisputesDisputeIdEvidenceOptions = {baseUrl: string, OAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Provide dispute evidence * * PUT /disputes/{dispute_id}/evidence * * Also accepts auth: ApiSecretKey */ export const updateApiDisputesDisputeIdEvidence = async (args: UpdateApiDisputesDisputeIdEvidenceArgs, options: UpdateApiDisputesDisputeIdEvidenceOptions) => { const {baseUrl, fetch: fetchFn = fetch, OAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (OAuth !== undefined) headers.set('authorization', `Bearer ${OAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/disputes/${encodeURIComponent(String(args.dispute_id))}/evidence${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };