Skip to content

Commit 1ddb26c

Browse files
feat(api): api update
1 parent 8128355 commit 1ddb26c

File tree

4 files changed

+60
-2
lines changed

4 files changed

+60
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 126
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-90b631890d57a96df99cc973fedfb48e6278b025dcb6262519eb064044d47efe.yml
3-
openapi_spec_hash: b17b00ef11d479516d6f1e5a323aef28
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-c92fb451e13f157b3735f188acc8d57aa3adfbaac1683645e1ba4f432dd7a4f8.yml
3+
openapi_spec_hash: dbcd87ecfbd3976eb3b99ec6f9fbc606
44
config_hash: bcf82bddb691f6be773ac6cae8c03b9a

src/resources/credit-blocks.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ export interface CreditBlockRetrieveResponse {
5252

5353
maximum_initial_balance: number | null;
5454

55+
/**
56+
* User specified key-value pairs for the resource. If not present, this defaults
57+
* to an empty dictionary. Individual keys can be removed by setting the value to
58+
* `null`, and the entire metadata mapping can be cleared by setting `metadata` to
59+
* `null`.
60+
*/
61+
metadata: { [key: string]: string };
62+
5563
per_unit_cost_basis: string | null;
5664

5765
status: 'active' | 'pending_payment';

src/resources/customers/credits/credits.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ export class Credits extends APIResource {
5454
*
5555
* Note that `currency` defaults to credits if not specified. To use a real world
5656
* currency, set `currency` to an ISO 4217 string.
57+
*
58+
* Results can be filtered by the block's `effective_date` using the
59+
* `effective_date[gte]`, `effective_date[gt]`, `effective_date[lt]`, and
60+
* `effective_date[lte]` query parameters. This filters on when the credit block
61+
* becomes effective, which may differ from creation time for backdated credits.
5762
*/
5863
list(
5964
customerId: string,
@@ -86,6 +91,11 @@ export class Credits extends APIResource {
8691
*
8792
* Note that `currency` defaults to credits if not specified. To use a real world
8893
* currency, set `currency` to an ISO 4217 string.
94+
*
95+
* Results can be filtered by the block's `effective_date` using the
96+
* `effective_date[gte]`, `effective_date[gt]`, `effective_date[lt]`, and
97+
* `effective_date[lte]` query parameters. This filters on when the credit block
98+
* becomes effective, which may differ from creation time for backdated credits.
8999
*/
90100
listByExternalId(
91101
externalCustomerId: string,
@@ -129,6 +139,14 @@ export interface CreditListResponse {
129139

130140
maximum_initial_balance: number | null;
131141

142+
/**
143+
* User specified key-value pairs for the resource. If not present, this defaults
144+
* to an empty dictionary. Individual keys can be removed by setting the value to
145+
* `null`, and the entire metadata mapping can be cleared by setting `metadata` to
146+
* `null`.
147+
*/
148+
metadata: { [key: string]: string };
149+
132150
per_unit_cost_basis: string | null;
133151

134152
status: 'active' | 'pending_payment';
@@ -169,6 +187,14 @@ export interface CreditListByExternalIDResponse {
169187

170188
maximum_initial_balance: number | null;
171189

190+
/**
191+
* User specified key-value pairs for the resource. If not present, this defaults
192+
* to an empty dictionary. Individual keys can be removed by setting the value to
193+
* `null`, and the entire metadata mapping can be cleared by setting `metadata` to
194+
* `null`.
195+
*/
196+
metadata: { [key: string]: string };
197+
172198
per_unit_cost_basis: string | null;
173199

174200
status: 'active' | 'pending_payment';
@@ -202,6 +228,14 @@ export interface CreditListParams extends PageParams {
202228
*/
203229
currency?: string | null;
204230

231+
'effective_date[gt]'?: string | null;
232+
233+
'effective_date[gte]'?: string | null;
234+
235+
'effective_date[lt]'?: string | null;
236+
237+
'effective_date[lte]'?: string | null;
238+
205239
/**
206240
* If set to True, all expired and depleted blocks, as well as active block will be
207241
* returned.
@@ -215,6 +249,14 @@ export interface CreditListByExternalIDParams extends PageParams {
215249
*/
216250
currency?: string | null;
217251

252+
'effective_date[gt]'?: string | null;
253+
254+
'effective_date[gte]'?: string | null;
255+
256+
'effective_date[lt]'?: string | null;
257+
258+
'effective_date[lte]'?: string | null;
259+
218260
/**
219261
* If set to True, all expired and depleted blocks, as well as active block will be
220262
* returned.

tests/api-resources/customers/credits/credits.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ describe('resource credits', () => {
3535
{
3636
currency: 'currency',
3737
cursor: 'cursor',
38+
'effective_date[gt]': '2019-12-27T18:11:19.117Z',
39+
'effective_date[gte]': '2019-12-27T18:11:19.117Z',
40+
'effective_date[lt]': '2019-12-27T18:11:19.117Z',
41+
'effective_date[lte]': '2019-12-27T18:11:19.117Z',
3842
include_all_blocks: true,
3943
limit: 1,
4044
},
@@ -69,6 +73,10 @@ describe('resource credits', () => {
6973
{
7074
currency: 'currency',
7175
cursor: 'cursor',
76+
'effective_date[gt]': '2019-12-27T18:11:19.117Z',
77+
'effective_date[gte]': '2019-12-27T18:11:19.117Z',
78+
'effective_date[lt]': '2019-12-27T18:11:19.117Z',
79+
'effective_date[lte]': '2019-12-27T18:11:19.117Z',
7280
include_all_blocks: true,
7381
limit: 1,
7482
},

0 commit comments

Comments
 (0)