diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4a601edb..93345cb6 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.48.0" + ".": "5.49.0" } diff --git a/.stats.yml b/.stats.yml index e1694adf..87a29a7d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 139 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-1ca41c4b1d872cf2a198c8cf5edeeeddac012259a7cf211b102bf137c05b8240.yml -openapi_spec_hash: 955066d4865fc42440cd81e40f5f79cd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-2b77f13a159cf689a3bba6ac5ff03b6c0df62b772e2da04aff52be86710ca4d4.yml +openapi_spec_hash: 28a3f685403d98ddd68b427d92ed28fb config_hash: c01c1191b1cd696c7ca855ff6d28a8df diff --git a/CHANGELOG.md b/CHANGELOG.md index a9e37046..19592b49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## 5.49.0 (2026-04-11) + +Full Changelog: [v5.48.0...v5.49.0](https://github.com/orbcorp/orb-node/compare/v5.48.0...v5.49.0) + +### Features + +* **api:** api update ([2745374](https://github.com/orbcorp/orb-node/commit/2745374c941524c812f8b1aff91159b406f04d47)) + + +### Chores + +* **internal:** codegen related update ([fbcbfe3](https://github.com/orbcorp/orb-node/commit/fbcbfe3ff0ea0836bbea11fdec50f47f786cc088)) + + +### Documentation + +* update examples ([7df8be5](https://github.com/orbcorp/orb-node/commit/7df8be59d5a426a2eeb1e6503b5c81c9f5eaee21)) + ## 5.48.0 (2026-04-03) Full Changelog: [v5.47.0...v5.48.0](https://github.com/orbcorp/orb-node/compare/v5.47.0...v5.48.0) diff --git a/package.json b/package.json index 8889f48f..f7b3cc10 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orb-billing", - "version": "5.48.0", + "version": "5.49.0", "description": "The official TypeScript library for the Orb API", "author": "Orb ", "types": "dist/index.d.ts", diff --git a/src/core.ts b/src/core.ts index c18ac5c4..adacf2ba 100644 --- a/src/core.ts +++ b/src/core.ts @@ -1053,10 +1053,10 @@ export const ensurePresent = (value: T | null | undefined): T => { */ export const readEnv = (env: string): string | undefined => { if (typeof process !== 'undefined') { - return process.env?.[env]?.trim() ?? undefined; + return process.env?.[env]?.trim() || undefined; } if (typeof Deno !== 'undefined') { - return Deno.env?.get?.(env)?.trim(); + return Deno.env?.get?.(env)?.trim() || undefined; } return undefined; }; diff --git a/src/resources/coupons/coupons.ts b/src/resources/coupons/coupons.ts index 4bcb57de..a8dcd966 100644 --- a/src/resources/coupons/coupons.ts +++ b/src/resources/coupons/coupons.ts @@ -17,6 +17,17 @@ export class Coupons extends APIResource { /** * This endpoint allows the creation of coupons, which can then be redeemed at * subscription creation or plan change. + * + * @example + * ```ts + * const coupon = await client.coupons.create({ + * discount: { + * discount_type: 'percentage', + * percentage_discount: 0, + * }, + * redemption_code: 'HALFOFF', + * }); + * ``` */ create(body: CouponCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/coupons', { body, ...options }); @@ -28,6 +39,14 @@ export class Coupons extends APIResource { * The list of coupons is ordered starting from the most recently created coupon. * The response also includes `pagination_metadata`, which lets the caller retrieve * the next page of results if they exist. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const coupon of client.coupons.list()) { + * // ... + * } + * ``` */ list(query?: CouponListParams, options?: Core.RequestOptions): Core.PagePromise; list(options?: Core.RequestOptions): Core.PagePromise; @@ -45,6 +64,11 @@ export class Coupons extends APIResource { * This endpoint allows a coupon to be archived. Archived coupons can no longer be * redeemed, and will be hidden from lists of active coupons. Additionally, once a * coupon is archived, its redemption code can be reused for a different coupon. + * + * @example + * ```ts + * const coupon = await client.coupons.archive('coupon_id'); + * ``` */ archive(couponId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.post(`/coupons/${couponId}/archive`, options); @@ -54,6 +78,11 @@ export class Coupons extends APIResource { * This endpoint retrieves a coupon by its ID. To fetch coupons by their redemption * code, use the [List coupons](list-coupons) endpoint with the redemption_code * parameter. + * + * @example + * ```ts + * const coupon = await client.coupons.fetch('coupon_id'); + * ``` */ fetch(couponId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/coupons/${couponId}`, options); diff --git a/src/resources/coupons/subscriptions.ts b/src/resources/coupons/subscriptions.ts index a9328087..4d5ad909 100644 --- a/src/resources/coupons/subscriptions.ts +++ b/src/resources/coupons/subscriptions.ts @@ -16,6 +16,16 @@ export class Subscriptions extends APIResource { * coupon as a [paginated](/api-reference/pagination) list, ordered starting from * the most recently created subscription. For a full discussion of the * subscription resource, see [Subscription](/core-concepts#subscription). + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const subscription of client.coupons.subscriptions.list( + * 'coupon_id', + * )) { + * // ... + * } + * ``` */ list( couponId: string, diff --git a/src/resources/credit-blocks.ts b/src/resources/credit-blocks.ts index 1af96b1f..330cec8d 100644 --- a/src/resources/credit-blocks.ts +++ b/src/resources/credit-blocks.ts @@ -42,14 +42,17 @@ export class CreditBlocks extends APIResource { /** * This endpoint returns the credit block and its associated purchasing invoices. * - * If a credit block was purchased (as opposed to being manually added or allocated - * from a subscription), this endpoint returns the invoices that were created to - * charge the customer for the credit block. For credit blocks with payment - * schedules spanning multiple periods (e.g., monthly payments over 12 months), - * multiple invoices will be returned. + * If a credit block was purchased (as opposed to being manually added), this + * endpoint returns the invoices that were created to charge the customer for the + * credit block. For credit blocks with payment schedules spanning multiple periods + * (e.g., monthly payments over 12 months), multiple invoices will be returned. * - * If the credit block was not purchased (e.g., manual increment, allocation), an - * empty invoices list is returned. + * For credit blocks created by subscription allocation prices, this endpoint + * returns the subscription invoice containing the allocation line item that + * created the block. + * + * If the credit block was not purchased (e.g., manual increment), an empty + * invoices list is returned. * * **Note: This endpoint is currently experimental and its interface may change in * future releases. Please contact support before building production integrations diff --git a/src/resources/credit-notes.ts b/src/resources/credit-notes.ts index 2563ce7b..e4e766d7 100644 --- a/src/resources/credit-notes.ts +++ b/src/resources/credit-notes.ts @@ -40,6 +40,19 @@ export class CreditNotes extends APIResource { * Note: Both start_date and end_date are inclusive - the service period will cover * both the start date and end date completely (from start of start_date to end of * end_date). + * + * @example + * ```ts + * const creditNote = await client.creditNotes.create({ + * line_items: [ + * { + * amount: 'amount', + * invoice_line_item_id: '4khy3nwzktxv7', + * }, + * ], + * reason: 'duplicate', + * }); + * ``` */ create(body: CreditNoteCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/credit_notes', { body, ...options }); @@ -49,6 +62,14 @@ export class CreditNotes extends APIResource { * Get a paginated list of CreditNotes. Users can also filter by customer_id, * subscription_id, or external_customer_id. The credit notes will be returned in * reverse chronological order by `creation_time`. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const creditNote of client.creditNotes.list()) { + * // ... + * } + * ``` */ list( query?: CreditNoteListParams, @@ -68,6 +89,13 @@ export class CreditNotes extends APIResource { /** * This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes) * given an identifier. + * + * @example + * ```ts + * const creditNote = await client.creditNotes.fetch( + * 'credit_note_id', + * ); + * ``` */ fetch(creditNoteId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/credit_notes/${creditNoteId}`, options); diff --git a/src/resources/dimensional-price-groups/dimensional-price-groups.ts b/src/resources/dimensional-price-groups/dimensional-price-groups.ts index 5d92106b..dc409bd9 100644 --- a/src/resources/dimensional-price-groups/dimensional-price-groups.ts +++ b/src/resources/dimensional-price-groups/dimensional-price-groups.ts @@ -24,6 +24,16 @@ export class DimensionalPriceGroups extends APIResource { * widgets used and we want to charge differently depending on the color of the * widget. We can create a price group with a dimension "color" and two prices: one * that charges \$10 per red widget and one that charges \$20 per blue widget. + * + * @example + * ```ts + * const dimensionalPriceGroup = + * await client.dimensionalPriceGroups.create({ + * billable_metric_id: 'billable_metric_id', + * dimensions: ['region', 'instance_type'], + * name: 'name', + * }); + * ``` */ create( body: DimensionalPriceGroupCreateParams, @@ -34,6 +44,14 @@ export class DimensionalPriceGroups extends APIResource { /** * Fetch dimensional price group + * + * @example + * ```ts + * const dimensionalPriceGroup = + * await client.dimensionalPriceGroups.retrieve( + * 'dimensional_price_group_id', + * ); + * ``` */ retrieve( dimensionalPriceGroupId: string, @@ -46,6 +64,14 @@ export class DimensionalPriceGroups extends APIResource { * This endpoint can be used to update the `external_dimensional_price_group_id` * and `metadata` of an existing dimensional price group. Other fields on a * dimensional price group are currently immutable. + * + * @example + * ```ts + * const dimensionalPriceGroup = + * await client.dimensionalPriceGroups.update( + * 'dimensional_price_group_id', + * ); + * ``` */ update( dimensionalPriceGroupId: string, @@ -57,6 +83,14 @@ export class DimensionalPriceGroups extends APIResource { /** * List dimensional price groups + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const dimensionalPriceGroup of client.dimensionalPriceGroups.list()) { + * // ... + * } + * ``` */ list( query?: DimensionalPriceGroupListParams, diff --git a/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts b/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts index f720a9bd..c5d5b231 100644 --- a/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +++ b/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts @@ -7,6 +7,14 @@ import * as DimensionalPriceGroupsAPI from './dimensional-price-groups'; export class ExternalDimensionalPriceGroupID extends APIResource { /** * Fetch dimensional price group by external ID + * + * @example + * ```ts + * const dimensionalPriceGroup = + * await client.dimensionalPriceGroups.externalDimensionalPriceGroupId.retrieve( + * 'external_dimensional_price_group_id', + * ); + * ``` */ retrieve( externalDimensionalPriceGroupId: string, @@ -22,6 +30,14 @@ export class ExternalDimensionalPriceGroupID extends APIResource { * This endpoint can be used to update the `external_dimensional_price_group_id` * and `metadata` of an existing dimensional price group. Other fields on a * dimensional price group are currently immutable. + * + * @example + * ```ts + * const dimensionalPriceGroup = + * await client.dimensionalPriceGroups.externalDimensionalPriceGroupId.update( + * 'external_dimensional_price_group_id', + * ); + * ``` */ update( externalDimensionalPriceGroupId: string, diff --git a/src/resources/events/backfills.ts b/src/resources/events/backfills.ts index 06298cb4..3ead484d 100644 --- a/src/resources/events/backfills.ts +++ b/src/resources/events/backfills.ts @@ -52,6 +52,14 @@ export class Backfills extends APIResource { * * You may not have multiple backfills in a pending or pending_revert state with * overlapping timeframes. + * + * @example + * ```ts + * const backfill = await client.events.backfills.create({ + * timeframe_end: '2019-12-27T18:11:19.117Z', + * timeframe_start: '2019-12-27T18:11:19.117Z', + * }); + * ``` */ create(body: BackfillCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/events/backfills', { body, ...options }); @@ -64,6 +72,14 @@ export class Backfills extends APIResource { * backfill. The response also includes * [`pagination_metadata`](/api-reference/pagination), which lets the caller * retrieve the next page of results if they exist. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const backfillListResponse of client.events.backfills.list()) { + * // ... + * } + * ``` */ list( query?: BackfillListParams, @@ -85,6 +101,13 @@ export class Backfills extends APIResource { * backfill, Orb will asynchronously reflect the updated usage in invoice amounts * and usage graphs. Once all of the updates are complete, the backfill's status * will transition to `reflected`. + * + * @example + * ```ts + * const response = await client.events.backfills.close( + * 'backfill_id', + * ); + * ``` */ close(backfillId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.post(`/events/backfills/${backfillId}/close`, options); @@ -92,6 +115,13 @@ export class Backfills extends APIResource { /** * This endpoint is used to fetch a backfill given an identifier. + * + * @example + * ```ts + * const response = await client.events.backfills.fetch( + * 'backfill_id', + * ); + * ``` */ fetch(backfillId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/events/backfills/${backfillId}`, options); @@ -105,6 +135,13 @@ export class Backfills extends APIResource { * * If a backfill is reverted before its closed, no usage will be updated as a * result of the backfill and it will immediately transition to `reverted`. + * + * @example + * ```ts + * const response = await client.events.backfills.revert( + * 'backfill_id', + * ); + * ``` */ revert(backfillId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.post(`/events/backfills/${backfillId}/revert`, options); diff --git a/src/resources/events/events.ts b/src/resources/events/events.ts index eda982d8..ce28c62e 100644 --- a/src/resources/events/events.ts +++ b/src/resources/events/events.ts @@ -72,6 +72,15 @@ export class Events extends APIResource { * - By default, no more than 100 events can be amended for a single customer in a * 100 day period. For higher volume updates, consider using the * [event backfill](create-backfill) endpoint. + * + * @example + * ```ts + * const event = await client.events.update('event_id', { + * event_name: 'event_name', + * properties: { foo: 'bar' }, + * timestamp: '2020-12-09T16:09:53Z', + * }); + * ``` */ update( eventId: string, @@ -122,6 +131,11 @@ export class Events extends APIResource { * - By default, no more than 100 events can be deprecated for a single customer in * a 100 day period. For higher volume updates, consider using the * [event backfill](create-backfill) endpoint. + * + * @example + * ```ts + * const response = await client.events.deprecate('event_id'); + * ``` */ deprecate(eventId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.put(`/events/${eventId}/deprecate`, options); @@ -332,6 +346,20 @@ export class Events extends APIResource { * "validation_failed": [] * } * ``` + * + * @example + * ```ts + * const response = await client.events.ingest({ + * events: [ + * { + * event_name: 'event_name', + * idempotency_key: 'idempotency_key', + * properties: { foo: 'bar' }, + * timestamp: '2020-12-09T16:09:53Z', + * }, + * ], + * }); + * ``` */ ingest(params: EventIngestParams, options?: Core.RequestOptions): Core.APIPromise { const { backfill_id, debug, ...body } = params; @@ -354,6 +382,13 @@ export class Events extends APIResource { * * By default, Orb will not throw a `404` if no events matched, Orb will return an * empty array for `data` instead. + * + * @example + * ```ts + * const response = await client.events.search({ + * event_ids: ['string'], + * }); + * ``` */ search(body: EventSearchParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/events/search', { body, ...options }); diff --git a/src/resources/events/volume.ts b/src/resources/events/volume.ts index b70b7646..dbc207f7 100644 --- a/src/resources/events/volume.ts +++ b/src/resources/events/volume.ts @@ -23,6 +23,13 @@ export class Volume extends APIResource { * where the start and end time are hour-aligned and in UTC. When a specific * timestamp is passed in for either start or end time, the response includes the * hours the timestamp falls in. + * + * @example + * ```ts + * const eventVolumes = await client.events.volume.list({ + * timeframe_start: '2019-12-27T18:11:19.117Z', + * }); + * ``` */ list(query: VolumeListParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.get('/events/volume', { query, ...options }); diff --git a/src/resources/invoice-line-items.ts b/src/resources/invoice-line-items.ts index bc7b1917..ea7b68a0 100644 --- a/src/resources/invoice-line-items.ts +++ b/src/resources/invoice-line-items.ts @@ -25,6 +25,18 @@ export class InvoiceLineItems extends APIResource { * - If both `item_id` and `name` are provided: The item is looked up by ID for * association, but the provided `name` is used for the line item (not the item's * name). + * + * @example + * ```ts + * const invoiceLineItem = + * await client.invoiceLineItems.create({ + * amount: '12.00', + * end_date: '2023-09-22', + * invoice_id: '4khy3nwzktxv7', + * quantity: 1, + * start_date: '2023-09-22', + * }); + * ``` */ create( body: InvoiceLineItemCreateParams, diff --git a/src/resources/invoices.ts b/src/resources/invoices.ts index d28e6469..7729643b 100644 --- a/src/resources/invoices.ts +++ b/src/resources/invoices.ts @@ -16,6 +16,25 @@ import { Page, type PageParams } from '../pagination'; export class Invoices extends APIResource { /** * This endpoint is used to create a one-off invoice for a customer. + * + * @example + * ```ts + * const invoice = await client.invoices.create({ + * currency: 'USD', + * invoice_date: '2019-12-27T18:11:19.117Z', + * line_items: [ + * { + * end_date: '2023-09-22', + * item_id: '4khy3nwzktxv7', + * model_type: 'unit', + * name: 'Line Item Name', + * quantity: 1, + * start_date: '2023-09-22', + * unit_config: { unit_amount: 'unit_amount' }, + * }, + * ], + * }); + * ``` */ create(body: InvoiceCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/invoices', { body, ...options }); @@ -30,6 +49,11 @@ export class Invoices extends APIResource { * `invoice_date`, and `auto_collection` can only be modified if the invoice is in * a `draft` state. `invoice_date` can only be modified for non-subscription * invoices. + * + * @example + * ```ts + * const invoice = await client.invoices.update('invoice_id'); + * ``` */ update( invoiceId: string, @@ -53,6 +77,14 @@ export class Invoices extends APIResource { * When fetching any `draft` invoices, this returns the last-computed invoice * values for each draft invoice, which may not always be up-to-date since Orb * regularly refreshes invoices asynchronously. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const invoice of client.invoices.list()) { + * // ... + * } + * ``` */ list( query?: InvoiceListParams, @@ -75,6 +107,14 @@ export class Invoices extends APIResource { * This endpoint only allows deletion of one-off line items (not subscription-based * line items). The invoice must be in a draft status for this operation to * succeed. + * + * @example + * ```ts + * await client.invoices.deleteLineItem( + * 'invoice_id', + * 'line_item_id', + * ); + * ``` */ deleteLineItem( invoiceId: string, @@ -90,6 +130,11 @@ export class Invoices extends APIResource { /** * This endpoint is used to fetch an [`Invoice`](/core-concepts#invoice) given an * identifier. + * + * @example + * ```ts + * const invoice = await client.invoices.fetch('invoice_id'); + * ``` */ fetch(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/invoices/${invoiceId}`, options); @@ -99,6 +144,13 @@ export class Invoices extends APIResource { * This endpoint can be used to fetch the upcoming * [invoice](/core-concepts#invoice) for the current billing period given a * subscription. + * + * @example + * ```ts + * const response = await client.invoices.fetchUpcoming({ + * subscription_id: 'subscription_id', + * }); + * ``` */ fetchUpcoming( query: InvoiceFetchUpcomingParams, @@ -114,6 +166,11 @@ export class Invoices extends APIResource { * possibly trigger side effects, some of which could be customer-visible (e.g. * sending emails, auto-collecting payment, syncing the invoice to external * providers, etc). + * + * @example + * ```ts + * const invoice = await client.invoices.issue('invoice_id'); + * ``` */ issue( invoiceId: string, @@ -142,6 +199,13 @@ export class Invoices extends APIResource { * * This is a lighter-weight alternative to the issue invoice endpoint, returning an * invoice summary without any line item details. + * + * @example + * ```ts + * const response = await client.invoices.issueSummary( + * 'invoice_id', + * ); + * ``` */ issueSummary( invoiceId: string, @@ -180,6 +244,14 @@ export class Invoices extends APIResource { * When fetching any `draft` invoices, this returns the last-computed invoice * values for each draft invoice, which may not always be up-to-date since Orb * regularly refreshes invoices asynchronously. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const invoiceListSummaryResponse of client.invoices.listSummary()) { + * // ... + * } + * ``` */ listSummary( query?: InvoiceListSummaryParams, @@ -204,6 +276,14 @@ export class Invoices extends APIResource { /** * This endpoint allows an invoice's status to be set to the `paid` status. This * can only be done to invoices that are in the `issued` or `synced` status. + * + * @example + * ```ts + * const invoice = await client.invoices.markPaid( + * 'invoice_id', + * { payment_received_date: '2023-09-22' }, + * ); + * ``` */ markPaid( invoiceId: string, @@ -218,6 +298,13 @@ export class Invoices extends APIResource { * customer's default payment method. Optionally, a shared payment token (SPT) can * be provided to pay using agent-granted credentials instead. This action can only * be taken on invoices with status "issued". + * + * @example + * ```ts + * const invoice = await client.invoices.pay('invoice_id', { + * shared_payment_token_id: 'shared_payment_token_id', + * }); + * ``` */ pay( invoiceId: string, @@ -239,6 +326,11 @@ export class Invoices extends APIResource { * If the invoice was used to purchase a credit block, but the invoice is not yet * paid, the credit block will be voided. If the invoice was created due to a * top-up, the top-up will be disabled. + * + * @example + * ```ts + * const invoice = await client.invoices.void('invoice_id'); + * ``` */ void(invoiceId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.post(`/invoices/${invoiceId}/void`, options); diff --git a/src/resources/items.ts b/src/resources/items.ts index 5d42e7e2..fab74494 100644 --- a/src/resources/items.ts +++ b/src/resources/items.ts @@ -12,6 +12,13 @@ import { Page, type PageParams } from '../pagination'; export class Items extends APIResource { /** * This endpoint is used to create an [Item](/core-concepts#item). + * + * @example + * ```ts + * const item = await client.items.create({ + * name: 'API requests', + * }); + * ``` */ create(body: ItemCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/items', { body, ...options }); @@ -19,6 +26,11 @@ export class Items extends APIResource { /** * This endpoint can be used to update properties on the Item. + * + * @example + * ```ts + * const item = await client.items.update('item_id'); + * ``` */ update(itemId: string, body: ItemUpdateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.put(`/items/${itemId}`, { body, ...options }); @@ -27,6 +39,14 @@ export class Items extends APIResource { /** * This endpoint returns a list of all Items, ordered in descending order by * creation time. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const item of client.items.list()) { + * // ... + * } + * ``` */ list(query?: ItemListParams, options?: Core.RequestOptions): Core.PagePromise; list(options?: Core.RequestOptions): Core.PagePromise; @@ -42,6 +62,11 @@ export class Items extends APIResource { /** * Archive item + * + * @example + * ```ts + * const item = await client.items.archive('item_id'); + * ``` */ archive(itemId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.post(`/items/${itemId}/archive`, options); @@ -49,6 +74,11 @@ export class Items extends APIResource { /** * This endpoint returns an item identified by its item_id. + * + * @example + * ```ts + * const item = await client.items.fetch('item_id'); + * ``` */ fetch(itemId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/items/${itemId}`, options); diff --git a/src/resources/licenses/external-licenses.ts b/src/resources/licenses/external-licenses.ts index 6b3f7e88..44516158 100644 --- a/src/resources/licenses/external-licenses.ts +++ b/src/resources/licenses/external-licenses.ts @@ -10,6 +10,18 @@ export class ExternalLicenses extends APIResource { * license ID. * * Date range defaults to the current billing period if not specified. + * + * @example + * ```ts + * const response = + * await client.licenses.externalLicenses.getUsage( + * 'external_license_id', + * { + * license_type_id: 'license_type_id', + * subscription_id: 'subscription_id', + * }, + * ); + * ``` */ getUsage( externalLicenseId: string, diff --git a/src/resources/licenses/licenses.ts b/src/resources/licenses/licenses.ts index 885bd221..d05e835e 100644 --- a/src/resources/licenses/licenses.ts +++ b/src/resources/licenses/licenses.ts @@ -30,6 +30,15 @@ export class Licenses extends APIResource { * If a start date is provided, the license will be activated at the **start** of * the specified date in the customer's timezone. Otherwise, the activation time * will default to the **start** of the current day in the customer's timezone. + * + * @example + * ```ts + * const license = await client.licenses.create({ + * external_license_id: 'external_license_id', + * license_type_id: 'license_type_id', + * subscription_id: 'subscription_id', + * }); + * ``` */ create(body: LicenseCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/licenses', { body, ...options }); @@ -37,6 +46,13 @@ export class Licenses extends APIResource { /** * This endpoint is used to fetch a license given an identifier. + * + * @example + * ```ts + * const license = await client.licenses.retrieve( + * 'license_id', + * ); + * ``` */ retrieve(licenseId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/licenses/${licenseId}`, options); @@ -44,6 +60,16 @@ export class Licenses extends APIResource { /** * This endpoint returns a list of all licenses for a subscription. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const licenseListResponse of client.licenses.list( + * { subscription_id: 'subscription_id' }, + * )) { + * // ... + * } + * ``` */ list( query: LicenseListParams, @@ -58,6 +84,13 @@ export class Licenses extends APIResource { * If an end date is provided, the license will be deactivated at the **start** of * the specified date in the customer's timezone. Otherwise, the deactivation time * will default to the **end** of the current day in the customer's timezone. + * + * @example + * ```ts + * const response = await client.licenses.deactivate( + * 'license_id', + * ); + * ``` */ deactivate( licenseId: string, @@ -69,6 +102,17 @@ export class Licenses extends APIResource { /** * This endpoint is used to fetch a license given an external license identifier. + * + * @example + * ```ts + * const response = await client.licenses.retrieveByExternalId( + * 'external_license_id', + * { + * license_type_id: 'license_type_id', + * subscription_id: 'subscription_id', + * }, + * ); + * ``` */ retrieveByExternalId( externalLicenseId: string, diff --git a/src/resources/licenses/usage.ts b/src/resources/licenses/usage.ts index f3230fe9..de78f098 100644 --- a/src/resources/licenses/usage.ts +++ b/src/resources/licenses/usage.ts @@ -11,6 +11,14 @@ export class Usage extends APIResource { * subscription. * * Date range defaults to the current billing period if not specified. + * + * @example + * ```ts + * const response = await client.licenses.usage.getAllUsage({ + * license_type_id: 'license_type_id', + * subscription_id: 'subscription_id', + * }); + * ``` */ getAllUsage( query: UsageGetAllUsageParams, @@ -23,6 +31,13 @@ export class Usage extends APIResource { * Returns usage and remaining credits for a specific license over a date range. * * Date range defaults to the current billing period if not specified. + * + * @example + * ```ts + * const response = await client.licenses.usage.getUsage( + * 'license_id', + * ); + * ``` */ getUsage( licenseId: string, diff --git a/src/resources/metrics.ts b/src/resources/metrics.ts index 3a7b2c58..e306dc3b 100644 --- a/src/resources/metrics.ts +++ b/src/resources/metrics.ts @@ -15,6 +15,16 @@ export class Metrics extends APIResource { * This endpoint is used to create a [metric](/core-concepts###metric) using a SQL * string. See [SQL support](/extensibility/advanced-metrics#sql-support) for a * description of constructing SQL queries with examples. + * + * @example + * ```ts + * const billableMetric = await client.metrics.create({ + * description: 'Sum of bytes downloaded in fast mode', + * item_id: 'item_id', + * name: 'Bytes downloaded', + * sql: "SELECT sum(bytes_downloaded) FROM events WHERE download_speed = 'fast'", + * }); + * ``` */ create(body: MetricCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/metrics', { body, ...options }); @@ -24,6 +34,13 @@ export class Metrics extends APIResource { * This endpoint allows you to update the `metadata` property on a metric. If you * pass `null` for the metadata value, it will clear any existing metadata for that * invoice. + * + * @example + * ```ts + * const billableMetric = await client.metrics.update( + * 'metric_id', + * ); + * ``` */ update( metricId: string, @@ -37,6 +54,14 @@ export class Metrics extends APIResource { * This endpoint is used to fetch [metric](/core-concepts##metric) details given a * metric identifier. It returns information about the metrics including its name, * description, and item. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const billableMetric of client.metrics.list()) { + * // ... + * } + * ``` */ list( query?: MetricListParams, @@ -56,6 +81,13 @@ export class Metrics extends APIResource { /** * This endpoint is used to list [metrics](/core-concepts#metric). It returns * information about the metrics including its name, description, and item. + * + * @example + * ```ts + * const billableMetric = await client.metrics.fetch( + * 'metric_id', + * ); + * ``` */ fetch(metricId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/metrics/${metricId}`, options); diff --git a/src/resources/prices/external-price-id.ts b/src/resources/prices/external-price-id.ts index 22f3de47..8a2a5d86 100644 --- a/src/resources/prices/external-price-id.ts +++ b/src/resources/prices/external-price-id.ts @@ -18,6 +18,13 @@ export class ExternalPriceID extends APIResource { * This endpoint allows you to update the `metadata` property on a price. If you * pass null for the metadata value, it will clear any existing metadata for that * price. + * + * @example + * ```ts + * const price = await client.prices.externalPriceId.update( + * 'external_price_id', + * ); + * ``` */ update( externalPriceId: string, @@ -31,6 +38,13 @@ export class ExternalPriceID extends APIResource { * This endpoint returns a price given an external price id. See the * [price creation API](/api-reference/price/create-price) for more information * about external price aliases. + * + * @example + * ```ts + * const price = await client.prices.externalPriceId.fetch( + * 'external_price_id', + * ); + * ``` */ fetch(externalPriceId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/prices/external_price_id/${externalPriceId}`, options); diff --git a/src/resources/prices/prices.ts b/src/resources/prices/prices.ts index 65f8a8d6..275e7a28 100644 --- a/src/resources/prices/prices.ts +++ b/src/resources/prices/prices.ts @@ -33,6 +33,18 @@ export class Prices extends APIResource { * * See the [Price resource](/product-catalog/price-configuration) for the * specification of different price model configurations possible in this endpoint. + * + * @example + * ```ts + * const price = await client.prices.create({ + * cadence: 'annual', + * currency: 'currency', + * item_id: 'item_id', + * model_type: 'unit', + * name: 'Annual fee', + * unit_config: { unit_amount: 'unit_amount' }, + * }); + * ``` */ create(body: PriceCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/prices', { body, ...options }); @@ -42,6 +54,11 @@ export class Prices extends APIResource { * This endpoint allows you to update the `metadata` property on a price. If you * pass null for the metadata value, it will clear any existing metadata for that * price. + * + * @example + * ```ts + * const price = await client.prices.update('price_id'); + * ``` */ update( priceId: string, @@ -54,6 +71,14 @@ export class Prices extends APIResource { /** * This endpoint is used to list all add-on prices created using the * [price creation endpoint](/api-reference/price/create-price). + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const price of client.prices.list()) { + * // ... + * } + * ``` */ list(query?: PriceListParams, options?: Core.RequestOptions): Core.PagePromise; list(options?: Core.RequestOptions): Core.PagePromise; @@ -93,6 +118,14 @@ export class Prices extends APIResource { * the length of the results must be no greater than 1000. Note that this is a POST * endpoint rather than a GET endpoint because it employs a JSON body rather than * query parameters. + * + * @example + * ```ts + * const response = await client.prices.evaluate('price_id', { + * timeframe_end: '2019-12-27T18:11:19.117Z', + * timeframe_start: '2019-12-27T18:11:19.117Z', + * }); + * ``` */ evaluate( priceId: string, @@ -132,6 +165,14 @@ export class Prices extends APIResource { * * Note that this is a POST endpoint rather than a GET endpoint because it employs * a JSON body rather than query parameters. + * + * @example + * ```ts + * const response = await client.prices.evaluateMultiple({ + * timeframe_end: '2019-12-27T18:11:19.117Z', + * timeframe_start: '2019-12-27T18:11:19.117Z', + * }); + * ``` */ evaluateMultiple( body: PriceEvaluateMultipleParams, @@ -159,6 +200,14 @@ export class Prices extends APIResource { * * Note that this is a POST endpoint rather than a GET endpoint because it employs * a JSON body rather than query parameters. + * + * @example + * ```ts + * const response = await client.prices.evaluatePreviewEvents({ + * timeframe_end: '2019-12-27T18:11:19.117Z', + * timeframe_start: '2019-12-27T18:11:19.117Z', + * }); + * ``` */ evaluatePreviewEvents( body: PriceEvaluatePreviewEventsParams, @@ -169,6 +218,11 @@ export class Prices extends APIResource { /** * This endpoint returns a price given an identifier. + * + * @example + * ```ts + * const price = await client.prices.fetch('price_id'); + * ``` */ fetch(priceId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/prices/${priceId}`, options); diff --git a/src/resources/shared.ts b/src/resources/shared.ts index a42081fd..5a671561 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -10127,6 +10127,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -10269,6 +10271,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -10416,6 +10420,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -10558,6 +10564,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -10742,6 +10750,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -10884,6 +10894,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -11026,6 +11038,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -11198,6 +11212,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -11369,6 +11385,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -11553,6 +11571,8 @@ export namespace Price { */ grouped_tiered_config: GroupedTieredPrice.GroupedTieredConfig; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -11720,6 +11740,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -11888,6 +11910,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -12041,6 +12065,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -12198,6 +12224,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -12340,6 +12368,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -12510,6 +12540,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -12667,6 +12699,8 @@ export namespace Price { */ grouped_allocation_config: GroupedAllocationPrice.GroupedAllocationConfig; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -12829,6 +12863,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -12998,6 +13034,8 @@ export namespace Price { */ grouped_with_prorated_minimum_config: GroupedWithProratedMinimumPrice.GroupedWithProratedMinimumConfig; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -13160,6 +13198,8 @@ export namespace Price { */ grouped_with_metered_minimum_config: GroupedWithMeteredMinimumPrice.GroupedWithMeteredMinimumConfig; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -13362,6 +13402,8 @@ export namespace Price { */ grouped_with_min_max_thresholds_config: GroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -13524,6 +13566,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -13708,6 +13752,8 @@ export namespace Price { */ grouped_tiered_package_config: GroupedTieredPackagePrice.GroupedTieredPackageConfig; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -13877,6 +13923,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -14050,6 +14098,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -14240,6 +14290,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -14431,6 +14483,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -14607,6 +14661,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -14769,6 +14825,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -14926,6 +14984,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** @@ -15083,6 +15143,8 @@ export namespace Price { fixed_price_quantity: number | null; + invoice_grouping_key: string | null; + invoicing_cycle_configuration: Shared.BillingCycleConfiguration | null; /** diff --git a/src/resources/subscriptions.ts b/src/resources/subscriptions.ts index 116a9d40..27fea925 100644 --- a/src/resources/subscriptions.ts +++ b/src/resources/subscriptions.ts @@ -272,6 +272,12 @@ export class Subscriptions extends APIResource { * ## Limits * * By default, Orb limits the number of subscriptions per customer to 100. + * + * @example + * ```ts + * const mutatedSubscription = + * await client.subscriptions.create(); + * ``` */ create( body: SubscriptionCreateParams, @@ -284,6 +290,13 @@ export class Subscriptions extends APIResource { * This endpoint can be used to update the `metadata`, `net terms`, * `auto_collection`, `invoicing_threshold`, and `default_invoice_memo` properties * on a subscription. + * + * @example + * ```ts + * const subscription = await client.subscriptions.update( + * 'subscription_id', + * ); + * ``` */ update( subscriptionId: string, @@ -303,6 +316,14 @@ export class Subscriptions extends APIResource { * customer_id or external_customer_id query parameters. To filter subscriptions * for multiple customers, use the customer_id[] or external_customer_id[] query * parameters. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const subscription of client.subscriptions.list()) { + * // ... + * } + * ``` */ list( query?: SubscriptionListParams, @@ -381,6 +402,14 @@ export class Subscriptions extends APIResource { * Orb will void the intervening invoice and generate a new one based on the new * dates for the subscription. See the section on * [cancellation behaviors](/product-catalog/creating-subscriptions#cancellation-behaviors). + * + * @example + * ```ts + * const mutatedSubscription = + * await client.subscriptions.cancel('subscription_id', { + * cancel_option: 'end_of_subscription_term', + * }); + * ``` */ cancel( subscriptionId: string, @@ -393,6 +422,13 @@ export class Subscriptions extends APIResource { /** * This endpoint is used to fetch a [Subscription](/core-concepts##subscription) * given an identifier. + * + * @example + * ```ts + * const subscription = await client.subscriptions.fetch( + * 'subscription_id', + * ); + * ``` */ fetch(subscriptionId: string, options?: Core.RequestOptions): Core.APIPromise { return this._client.get(`/subscriptions/${subscriptionId}`, options); @@ -409,6 +445,13 @@ export class Subscriptions extends APIResource { * this endpoint to limit your analysis of costs to a specific subscription for the * customer (e.g. to de-aggregate costs when a customer's subscription has started * and stopped on the same day). + * + * @example + * ```ts + * const response = await client.subscriptions.fetchCosts( + * 'subscription_id', + * ); + * ``` */ fetchCosts( subscriptionId: string, @@ -435,6 +478,16 @@ export class Subscriptions extends APIResource { * associated with a subscription along with their start and end dates. This list * contains the subscription's initial plan along with past and future plan * changes. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const subscriptionFetchScheduleResponse of client.subscriptions.fetchSchedule( + * 'subscription_id', + * )) { + * // ... + * } + * ``` */ fetchSchedule( subscriptionId: string, @@ -655,6 +708,12 @@ export class Subscriptions extends APIResource { * - `first_dimension_value`: `us-east-1` * - `second_dimension_key`: `provider` * - `second_dimension_value`: `aws` + * + * @example + * ```ts + * const subscriptionUsage = + * await client.subscriptions.fetchUsage('subscription_id'); + * ``` */ fetchUsage( subscriptionId: string, @@ -746,6 +805,14 @@ export class Subscriptions extends APIResource { * existing list of transitions can be retrieved using the * `fixed_fee_quantity_transitions` property on a subscription’s serialized price * intervals. + * + * @example + * ```ts + * const mutatedSubscription = + * await client.subscriptions.priceIntervals( + * 'subscription_id', + * ); + * ``` */ priceIntervals( subscriptionId: string, @@ -757,6 +824,15 @@ export class Subscriptions extends APIResource { /** * Redeem a coupon effective at a given time. + * + * @example + * ```ts + * const mutatedSubscription = + * await client.subscriptions.redeemCoupon( + * 'subscription_id', + * { change_option: 'requested_date' }, + * ); + * ``` */ redeemCoupon( subscriptionId: string, @@ -950,6 +1026,15 @@ export class Subscriptions extends APIResource { * a plan change, adjusting the customer balance as needed. For details on this * behavior, see * [Modifying subscriptions](/product-catalog/modifying-subscriptions#prorations-for-in-advance-fees). + * + * @example + * ```ts + * const mutatedSubscription = + * await client.subscriptions.schedulePlanChange( + * 'subscription_id', + * { change_option: 'requested_date' }, + * ); + * ``` */ schedulePlanChange( subscriptionId: string, @@ -962,6 +1047,14 @@ export class Subscriptions extends APIResource { /** * Manually trigger a phase, effective the given date (or the current time, if not * specified). + * + * @example + * ```ts + * const mutatedSubscription = + * await client.subscriptions.triggerPhase( + * 'subscription_id', + * ); + * ``` */ triggerPhase( subscriptionId: string, @@ -978,6 +1071,14 @@ export class Subscriptions extends APIResource { * To be eligible, the subscription must currently be active and have a future * cancellation. This operation will turn on auto-renew, ensuring that the * subscription does not end at the currently scheduled cancellation time. + * + * @example + * ```ts + * const mutatedSubscription = + * await client.subscriptions.unscheduleCancellation( + * 'subscription_id', + * ); + * ``` */ unscheduleCancellation( subscriptionId: string, @@ -992,6 +1093,15 @@ export class Subscriptions extends APIResource { * * If there are no updates scheduled, a request validation error will be returned * with a 400 status code. + * + * @example + * ```ts + * const mutatedSubscription = + * await client.subscriptions.unscheduleFixedFeeQuantityUpdates( + * 'subscription_id', + * { price_id: 'price_id' }, + * ); + * ``` */ unscheduleFixedFeeQuantityUpdates( subscriptionId: string, @@ -1007,6 +1117,14 @@ export class Subscriptions extends APIResource { /** * This endpoint can be used to unschedule any pending plan changes on an existing * subscription. When called, all upcoming plan changes will be unscheduled. + * + * @example + * ```ts + * const mutatedSubscription = + * await client.subscriptions.unschedulePendingPlanChanges( + * 'subscription_id', + * ); + * ``` */ unschedulePendingPlanChanges( subscriptionId: string, @@ -1030,6 +1148,15 @@ export class Subscriptions extends APIResource { * * If the fee is an in-advance fixed fee, it will also issue an immediate invoice * for the difference for the remainder of the billing period. + * + * @example + * ```ts + * const mutatedSubscription = + * await client.subscriptions.updateFixedFeeQuantity( + * 'subscription_id', + * { price_id: 'price_id', quantity: 0 }, + * ); + * ``` */ updateFixedFeeQuantity( subscriptionId: string, @@ -1061,6 +1188,15 @@ export class Subscriptions extends APIResource { * end date shift (so, e.g., if a plan change is scheduled or an add-on price was * added, that change will be pushed back by the same amount of time the trial is * extended). + * + * @example + * ```ts + * const mutatedSubscription = + * await client.subscriptions.updateTrial( + * 'subscription_id', + * { trial_end_date: '2017-07-21T17:32:28Z' }, + * ); + * ``` */ updateTrial( subscriptionId: string, diff --git a/src/version.ts b/src/version.ts index 0c94f6ec..3fa287f0 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '5.48.0'; // x-release-please-version +export const VERSION = '5.49.0'; // x-release-please-version