Skip to content

Commit bdaaa9a

Browse files
feat(api): manual updates
1 parent 8d3f059 commit bdaaa9a

File tree

14 files changed

+1117
-3
lines changed

14 files changed

+1117
-3
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 118
1+
configured_endpoints: 126
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-a5a28a58483355d3cc3da7ac5c452d548ee17183324318198052968121ca7dba.yml
33
openapi_spec_hash: a317931a99e6d4a122919135a0363e40
4-
config_hash: 05c94c0e6dbeab2c9b554c2e0d6371a0
4+
config_hash: bcf82bddb691f6be773ac6cae8c03b9a

api.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,18 @@ Methods:
355355
Types:
356356

357357
- <code><a href="./src/resources/invoices.ts">InvoiceFetchUpcomingResponse</a></code>
358+
- <code><a href="./src/resources/invoices.ts">InvoiceListSummaryResponse</a></code>
358359

359360
Methods:
360361

361362
- <code title="post /invoices">client.invoices.<a href="./src/resources/invoices.ts">create</a>({ ...params }) -> Invoice</code>
362363
- <code title="put /invoices/{invoice_id}">client.invoices.<a href="./src/resources/invoices.ts">update</a>(invoiceId, { ...params }) -> Invoice</code>
363364
- <code title="get /invoices">client.invoices.<a href="./src/resources/invoices.ts">list</a>({ ...params }) -> InvoicesPage</code>
365+
- <code title="delete /invoices/{invoice_id}/invoice_line_items/{line_item_id}">client.invoices.<a href="./src/resources/invoices.ts">deleteLineItem</a>(invoiceId, lineItemId) -> void</code>
364366
- <code title="get /invoices/{invoice_id}">client.invoices.<a href="./src/resources/invoices.ts">fetch</a>(invoiceId) -> Invoice</code>
365367
- <code title="get /invoices/upcoming">client.invoices.<a href="./src/resources/invoices.ts">fetchUpcoming</a>({ ...params }) -> InvoiceFetchUpcomingResponse</code>
366368
- <code title="post /invoices/{invoice_id}/issue">client.invoices.<a href="./src/resources/invoices.ts">issue</a>(invoiceId, { ...params }) -> Invoice</code>
369+
- <code title="get /invoices/summary">client.invoices.<a href="./src/resources/invoices.ts">listSummary</a>({ ...params }) -> InvoiceListSummaryResponsesPage</code>
367370
- <code title="post /invoices/{invoice_id}/mark_paid">client.invoices.<a href="./src/resources/invoices.ts">markPaid</a>(invoiceId, { ...params }) -> Invoice</code>
368371
- <code title="post /invoices/{invoice_id}/pay">client.invoices.<a href="./src/resources/invoices.ts">pay</a>(invoiceId) -> Invoice</code>
369372
- <code title="post /invoices/{invoice_id}/void">client.invoices.<a href="./src/resources/invoices.ts">void</a>(invoiceId) -> Invoice</code>
@@ -415,6 +418,20 @@ Methods:
415418
- <code title="put /plans/external_plan_id/{external_plan_id}">client.plans.externalPlanId.<a href="./src/resources/plans/external-plan-id.ts">update</a>(otherExternalPlanId, { ...params }) -> Plan</code>
416419
- <code title="get /plans/external_plan_id/{external_plan_id}">client.plans.externalPlanId.<a href="./src/resources/plans/external-plan-id.ts">fetch</a>(externalPlanId) -> Plan</code>
417420

421+
## Migrations
422+
423+
Types:
424+
425+
- <code><a href="./src/resources/plans/migrations.ts">MigrationRetrieveResponse</a></code>
426+
- <code><a href="./src/resources/plans/migrations.ts">MigrationListResponse</a></code>
427+
- <code><a href="./src/resources/plans/migrations.ts">MigrationCancelResponse</a></code>
428+
429+
Methods:
430+
431+
- <code title="get /plans/{plan_id}/migrations/{migration_id}">client.plans.migrations.<a href="./src/resources/plans/migrations.ts">retrieve</a>(planId, migrationId) -> MigrationRetrieveResponse</code>
432+
- <code title="get /plans/{plan_id}/migrations">client.plans.migrations.<a href="./src/resources/plans/migrations.ts">list</a>(planId, { ...params }) -> MigrationListResponsesPage</code>
433+
- <code title="post /plans/{plan_id}/migrations/{migration_id}/cancel">client.plans.migrations.<a href="./src/resources/plans/migrations.ts">cancel</a>(planId, migrationId) -> MigrationCancelResponse</code>
434+
418435
# Prices
419436

420437
Types:
@@ -542,11 +559,24 @@ Types:
542559

543560
- <code><a href="./src/resources/subscription-changes.ts">MutatedSubscription</a></code>
544561
- <code><a href="./src/resources/subscription-changes.ts">SubscriptionChangeRetrieveResponse</a></code>
562+
- <code><a href="./src/resources/subscription-changes.ts">SubscriptionChangeListResponse</a></code>
545563
- <code><a href="./src/resources/subscription-changes.ts">SubscriptionChangeApplyResponse</a></code>
546564
- <code><a href="./src/resources/subscription-changes.ts">SubscriptionChangeCancelResponse</a></code>
547565

548566
Methods:
549567

550568
- <code title="get /subscription_changes/{subscription_change_id}">client.subscriptionChanges.<a href="./src/resources/subscription-changes.ts">retrieve</a>(subscriptionChangeId) -> SubscriptionChangeRetrieveResponse</code>
569+
- <code title="get /subscription_changes">client.subscriptionChanges.<a href="./src/resources/subscription-changes.ts">list</a>({ ...params }) -> SubscriptionChangeListResponsesPage</code>
551570
- <code title="post /subscription_changes/{subscription_change_id}/apply">client.subscriptionChanges.<a href="./src/resources/subscription-changes.ts">apply</a>(subscriptionChangeId, { ...params }) -> SubscriptionChangeApplyResponse</code>
552571
- <code title="post /subscription_changes/{subscription_change_id}/cancel">client.subscriptionChanges.<a href="./src/resources/subscription-changes.ts">cancel</a>(subscriptionChangeId) -> SubscriptionChangeCancelResponse</code>
572+
573+
# CreditBlocks
574+
575+
Types:
576+
577+
- <code><a href="./src/resources/credit-blocks.ts">CreditBlockRetrieveResponse</a></code>
578+
579+
Methods:
580+
581+
- <code title="get /credit_blocks/{block_id}">client.creditBlocks.<a href="./src/resources/credit-blocks.ts">retrieve</a>(blockId) -> CreditBlockRetrieveResponse</code>
582+
- <code title="delete /credit_blocks/{block_id}">client.creditBlocks.<a href="./src/resources/credit-blocks.ts">delete</a>(blockId) -> void</code>

src/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
AlertsPage,
2222
Threshold,
2323
} from './resources/alerts';
24+
import { CreditBlockRetrieveResponse, CreditBlocks } from './resources/credit-blocks';
2425
import { CreditNoteCreateParams, CreditNoteListParams, CreditNotes } from './resources/credit-notes';
2526
import {
2627
InvoiceLineItemCreateParams,
@@ -33,6 +34,9 @@ import {
3334
InvoiceFetchUpcomingResponse,
3435
InvoiceIssueParams,
3536
InvoiceListParams,
37+
InvoiceListSummaryParams,
38+
InvoiceListSummaryResponse,
39+
InvoiceListSummaryResponsesPage,
3640
InvoiceMarkPaidParams,
3741
InvoiceUpdateParams,
3842
Invoices,
@@ -58,6 +62,9 @@ import {
5862
SubscriptionChangeApplyParams,
5963
SubscriptionChangeApplyResponse,
6064
SubscriptionChangeCancelResponse,
65+
SubscriptionChangeListParams,
66+
SubscriptionChangeListResponse,
67+
SubscriptionChangeListResponsesPage,
6168
SubscriptionChangeRetrieveResponse,
6269
SubscriptionChanges,
6370
} from './resources/subscription-changes';
@@ -326,6 +333,7 @@ export class Orb extends Core.APIClient {
326333
alerts: API.Alerts = new API.Alerts(this);
327334
dimensionalPriceGroups: API.DimensionalPriceGroups = new API.DimensionalPriceGroups(this);
328335
subscriptionChanges: API.SubscriptionChanges = new API.SubscriptionChanges(this);
336+
creditBlocks: API.CreditBlocks = new API.CreditBlocks(this);
329337

330338
/**
331339
* Check whether the base URL is set to its default.
@@ -396,6 +404,7 @@ Orb.CustomersPage = CustomersPage;
396404
Orb.Events = Events;
397405
Orb.InvoiceLineItems = InvoiceLineItems;
398406
Orb.Invoices = Invoices;
407+
Orb.InvoiceListSummaryResponsesPage = InvoiceListSummaryResponsesPage;
399408
Orb.Items = Items;
400409
Orb.ItemsPage = ItemsPage;
401410
Orb.Metrics = Metrics;
@@ -409,6 +418,8 @@ Orb.Alerts = Alerts;
409418
Orb.AlertsPage = AlertsPage;
410419
Orb.DimensionalPriceGroupsPage = DimensionalPriceGroupsPage;
411420
Orb.SubscriptionChanges = SubscriptionChanges;
421+
Orb.SubscriptionChangeListResponsesPage = SubscriptionChangeListResponsesPage;
422+
Orb.CreditBlocks = CreditBlocks;
412423

413424
export declare namespace Orb {
414425
export type RequestOptions = Core.RequestOptions;
@@ -478,11 +489,14 @@ export declare namespace Orb {
478489
export {
479490
Invoices as Invoices,
480491
type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse,
492+
type InvoiceListSummaryResponse as InvoiceListSummaryResponse,
493+
InvoiceListSummaryResponsesPage as InvoiceListSummaryResponsesPage,
481494
type InvoiceCreateParams as InvoiceCreateParams,
482495
type InvoiceUpdateParams as InvoiceUpdateParams,
483496
type InvoiceListParams as InvoiceListParams,
484497
type InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams,
485498
type InvoiceIssueParams as InvoiceIssueParams,
499+
type InvoiceListSummaryParams as InvoiceListSummaryParams,
486500
type InvoiceMarkPaidParams as InvoiceMarkPaidParams,
487501
};
488502

@@ -604,11 +618,16 @@ export declare namespace Orb {
604618
SubscriptionChanges as SubscriptionChanges,
605619
type MutatedSubscription as MutatedSubscription,
606620
type SubscriptionChangeRetrieveResponse as SubscriptionChangeRetrieveResponse,
621+
type SubscriptionChangeListResponse as SubscriptionChangeListResponse,
607622
type SubscriptionChangeApplyResponse as SubscriptionChangeApplyResponse,
608623
type SubscriptionChangeCancelResponse as SubscriptionChangeCancelResponse,
624+
SubscriptionChangeListResponsesPage as SubscriptionChangeListResponsesPage,
625+
type SubscriptionChangeListParams as SubscriptionChangeListParams,
609626
type SubscriptionChangeApplyParams as SubscriptionChangeApplyParams,
610627
};
611628

629+
export { CreditBlocks as CreditBlocks, type CreditBlockRetrieveResponse as CreditBlockRetrieveResponse };
630+
612631
export type Address = API.Address;
613632
export type AdjustmentInterval = API.AdjustmentInterval;
614633
export type AggregatedCost = API.AggregatedCost;

src/resources/credit-blocks.ts

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../resource';
4+
import * as Core from '../core';
5+
6+
export class CreditBlocks extends APIResource {
7+
/**
8+
* This endpoint returns a credit block identified by its block_id.
9+
*/
10+
retrieve(blockId: string, options?: Core.RequestOptions): Core.APIPromise<CreditBlockRetrieveResponse> {
11+
return this._client.get(`/credit_blocks/${blockId}`, options);
12+
}
13+
14+
/**
15+
* This endpoint deletes a credit block by its ID.
16+
*
17+
* When a credit block is deleted:
18+
*
19+
* - The block is removed from the customer's credit ledger.
20+
* - Any usage of the credit block is reversed, and the ledger is replayed as if
21+
* the block never existed.
22+
* - If invoices were generated from the purchase of the credit block, they will be
23+
* deleted if in draft status, voided if issued, or a credit note will be issued
24+
* if the invoice is paid.
25+
*
26+
* <Note>
27+
* Issued invoices that had credits applied from this block will not be regenerated, but the ledger will
28+
* reflect the state as if credits from the deleted block were never applied.
29+
* </Note>
30+
*/
31+
delete(blockId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
32+
return this._client.delete(`/credit_blocks/${blockId}`, {
33+
...options,
34+
headers: { Accept: '*/*', ...options?.headers },
35+
});
36+
}
37+
}
38+
39+
/**
40+
* The Credit Block resource models prepaid credits within Orb.
41+
*/
42+
export interface CreditBlockRetrieveResponse {
43+
id: string;
44+
45+
balance: number;
46+
47+
effective_date: string | null;
48+
49+
expiry_date: string | null;
50+
51+
filters: Array<CreditBlockRetrieveResponse.Filter>;
52+
53+
maximum_initial_balance: number | null;
54+
55+
per_unit_cost_basis: string | null;
56+
57+
status: 'active' | 'pending_payment';
58+
}
59+
60+
export namespace CreditBlockRetrieveResponse {
61+
export interface Filter {
62+
/**
63+
* The property of the price to filter on.
64+
*/
65+
field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
66+
67+
/**
68+
* Should prices that match the filter be included or excluded.
69+
*/
70+
operator: 'includes' | 'excludes';
71+
72+
/**
73+
* The IDs or values that match this filter.
74+
*/
75+
values: Array<string>;
76+
}
77+
}
78+
79+
export declare namespace CreditBlocks {
80+
export { type CreditBlockRetrieveResponse as CreditBlockRetrieveResponse };
81+
}

src/resources/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export {
3636
type CouponCreateParams,
3737
type CouponListParams,
3838
} from './coupons/coupons';
39+
export { CreditBlocks, type CreditBlockRetrieveResponse } from './credit-blocks';
3940
export { CreditNotes, type CreditNoteCreateParams, type CreditNoteListParams } from './credit-notes';
4041
export {
4142
CustomersPage,
@@ -78,13 +79,16 @@ export {
7879
type InvoiceLineItemCreateParams,
7980
} from './invoice-line-items';
8081
export {
82+
InvoiceListSummaryResponsesPage,
8183
Invoices,
8284
type InvoiceFetchUpcomingResponse,
85+
type InvoiceListSummaryResponse,
8386
type InvoiceCreateParams,
8487
type InvoiceUpdateParams,
8588
type InvoiceListParams,
8689
type InvoiceFetchUpcomingParams,
8790
type InvoiceIssueParams,
91+
type InvoiceListSummaryParams,
8892
type InvoiceMarkPaidParams,
8993
} from './invoices';
9094
export {
@@ -117,11 +121,14 @@ export {
117121
type PriceEvaluatePreviewEventsParams,
118122
} from './prices/prices';
119123
export {
124+
SubscriptionChangeListResponsesPage,
120125
SubscriptionChanges,
121126
type MutatedSubscription,
122127
type SubscriptionChangeRetrieveResponse,
128+
type SubscriptionChangeListResponse,
123129
type SubscriptionChangeApplyResponse,
124130
type SubscriptionChangeCancelResponse,
131+
type SubscriptionChangeListParams,
125132
type SubscriptionChangeApplyParams,
126133
} from './subscription-changes';
127134
export {

0 commit comments

Comments
 (0)