-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisputes.ts
113 lines (95 loc) · 2.96 KB
/
disputes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import { isRequestOptions } from '../core';
import * as Core from '../core';
import { DefaultPageNumberPagination, type DefaultPageNumberPaginationParams } from '../pagination';
export class Disputes extends APIResource {
retrieve(disputeId: string, options?: Core.RequestOptions): Core.APIPromise<Dispute> {
return this._client.get(`/disputes/${disputeId}`, options);
}
list(
query?: DisputeListParams,
options?: Core.RequestOptions,
): Core.PagePromise<DisputesDefaultPageNumberPagination, Dispute>;
list(options?: Core.RequestOptions): Core.PagePromise<DisputesDefaultPageNumberPagination, Dispute>;
list(
query: DisputeListParams | Core.RequestOptions = {},
options?: Core.RequestOptions,
): Core.PagePromise<DisputesDefaultPageNumberPagination, Dispute> {
if (isRequestOptions(query)) {
return this.list({}, query);
}
return this._client.getAPIList('/disputes', DisputesDefaultPageNumberPagination, { query, ...options });
}
}
export class DisputesDefaultPageNumberPagination extends DefaultPageNumberPagination<Dispute> {}
export interface Dispute {
/**
* The amount involved in the dispute, represented as a string to accommodate
* precision.
*/
amount: string;
/**
* The unique identifier of the business involved in the dispute.
*/
business_id: string;
/**
* The timestamp of when the dispute was created, in UTC.
*/
created_at: string;
/**
* The currency of the disputed amount, represented as an ISO 4217 currency code.
*/
currency: string;
/**
* The unique identifier of the dispute.
*/
dispute_id: string;
dispute_stage: 'pre_dispute' | 'dispute' | 'pre_arbitration';
dispute_status:
| 'dispute_opened'
| 'dispute_expired'
| 'dispute_accepted'
| 'dispute_cancelled'
| 'dispute_challenged'
| 'dispute_won'
| 'dispute_lost';
/**
* The unique identifier of the payment associated with the dispute.
*/
payment_id: string;
}
export interface DisputeListParams extends DefaultPageNumberPaginationParams {
/**
* Get events after this created time
*/
created_at_gte?: string | null;
/**
* Get events created before this time
*/
created_at_lte?: string | null;
/**
* Filter by dispute stage
*/
dispute_stage?: 'pre_dispute' | 'dispute' | 'pre_arbitration' | null;
/**
* Filter by dispute status
*/
dispute_status?:
| 'dispute_opened'
| 'dispute_expired'
| 'dispute_accepted'
| 'dispute_cancelled'
| 'dispute_challenged'
| 'dispute_won'
| 'dispute_lost'
| null;
}
Disputes.DisputesDefaultPageNumberPagination = DisputesDefaultPageNumberPagination;
export declare namespace Disputes {
export {
type Dispute as Dispute,
DisputesDefaultPageNumberPagination as DisputesDefaultPageNumberPagination,
type DisputeListParams as DisputeListParams,
};
}