-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathcard-programs.ts
More file actions
97 lines (83 loc) · 2.52 KB
/
card-programs.ts
File metadata and controls
97 lines (83 loc) · 2.52 KB
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
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
import { RequestOptions } from '../internal/request-options';
import { path } from '../internal/utils/path';
export class CardPrograms extends APIResource {
/**
* Get card program.
*
* @example
* ```ts
* const cardProgram = await client.cardPrograms.retrieve(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* );
* ```
*/
retrieve(cardProgramToken: string, options?: RequestOptions): APIPromise<CardProgram> {
return this._client.get(path`/v1/card_programs/${cardProgramToken}`, options);
}
/**
* List card programs.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const cardProgram of client.cardPrograms.list()) {
* // ...
* }
* ```
*/
list(
query: CardProgramListParams | null | undefined = {},
options?: RequestOptions,
): PagePromise<CardProgramsCursorPage, CardProgram> {
return this._client.getAPIList('/v1/card_programs', CursorPage<CardProgram>, { query, ...options });
}
}
export type CardProgramsCursorPage = CursorPage<CardProgram>;
export interface CardProgram {
/**
* Globally unique identifier.
*/
token: string;
/**
* Whether the card program is participating in Account Level Management. Currently
* applicable to Visa card programs only.
*/
account_level_management_enabled: boolean;
/**
* Timestamp of when the card program was created.
*/
created: string;
/**
* The name of the card program.
*/
name: string;
/**
* The first digits of the card number that this card program ends with.
*/
pan_range_end: string;
/**
* The first digits of the card number that this card program starts with.
*/
pan_range_start: string;
/**
* 3-character alphabetic ISO 4217 code for the currency of the cardholder.
*/
cardholder_currency?: string;
/**
* List of 3-character alphabetic ISO 4217 codes for the currencies that the card
* program supports for settlement.
*/
settlement_currencies?: Array<string>;
}
export interface CardProgramListParams extends CursorPageParams {}
export declare namespace CardPrograms {
export {
type CardProgram as CardProgram,
type CardProgramsCursorPage as CardProgramsCursorPage,
type CardProgramListParams as CardProgramListParams,
};
}