@stigg/typescript 0.1.0-beta.64 → 0.1.0-beta.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/package.json +1 -1
- package/resources/v1/addons/addons.d.mts +59 -0
- package/resources/v1/addons/addons.d.mts.map +1 -1
- package/resources/v1/addons/addons.d.ts +59 -0
- package/resources/v1/addons/addons.d.ts.map +1 -1
- package/resources/v1/addons/addons.js +59 -0
- package/resources/v1/addons/addons.js.map +1 -1
- package/resources/v1/addons/addons.mjs +59 -0
- package/resources/v1/addons/addons.mjs.map +1 -1
- package/resources/v1/addons/entitlements.d.mts +31 -0
- package/resources/v1/addons/entitlements.d.mts.map +1 -1
- package/resources/v1/addons/entitlements.d.ts +31 -0
- package/resources/v1/addons/entitlements.d.ts.map +1 -1
- package/resources/v1/addons/entitlements.js +31 -0
- package/resources/v1/addons/entitlements.js.map +1 -1
- package/resources/v1/addons/entitlements.mjs +31 -0
- package/resources/v1/addons/entitlements.mjs.map +1 -1
- package/resources/v1/contracts.d.mts +30 -0
- package/resources/v1/contracts.d.mts.map +1 -1
- package/resources/v1/contracts.d.ts +30 -0
- package/resources/v1/contracts.d.ts.map +1 -1
- package/resources/v1/contracts.js +30 -0
- package/resources/v1/contracts.js.map +1 -1
- package/resources/v1/contracts.mjs +30 -0
- package/resources/v1/contracts.mjs.map +1 -1
- package/resources/v1/coupons.d.mts +36 -0
- package/resources/v1/coupons.d.mts.map +1 -1
- package/resources/v1/coupons.d.ts +36 -0
- package/resources/v1/coupons.d.ts.map +1 -1
- package/resources/v1/coupons.js +36 -0
- package/resources/v1/coupons.js.map +1 -1
- package/resources/v1/coupons.mjs +36 -0
- package/resources/v1/coupons.mjs.map +1 -1
- package/resources/v1/credits/consumption.d.mts +26 -0
- package/resources/v1/credits/consumption.d.mts.map +1 -1
- package/resources/v1/credits/consumption.d.ts +26 -0
- package/resources/v1/credits/consumption.d.ts.map +1 -1
- package/resources/v1/credits/consumption.js +26 -0
- package/resources/v1/credits/consumption.js.map +1 -1
- package/resources/v1/credits/consumption.mjs +26 -0
- package/resources/v1/credits/consumption.mjs.map +1 -1
- package/resources/v1/credits/credits.d.mts +25 -0
- package/resources/v1/credits/credits.d.mts.map +1 -1
- package/resources/v1/credits/credits.d.ts +25 -0
- package/resources/v1/credits/credits.d.ts.map +1 -1
- package/resources/v1/credits/credits.js +25 -0
- package/resources/v1/credits/credits.js.map +1 -1
- package/resources/v1/credits/credits.mjs +25 -0
- package/resources/v1/credits/credits.mjs.map +1 -1
- package/resources/v1/credits/custom-currencies.d.mts +49 -0
- package/resources/v1/credits/custom-currencies.d.mts.map +1 -1
- package/resources/v1/credits/custom-currencies.d.ts +49 -0
- package/resources/v1/credits/custom-currencies.d.ts.map +1 -1
- package/resources/v1/credits/custom-currencies.js +49 -0
- package/resources/v1/credits/custom-currencies.js.map +1 -1
- package/resources/v1/credits/custom-currencies.mjs +49 -0
- package/resources/v1/credits/custom-currencies.mjs.map +1 -1
- package/resources/v1/credits/grants.d.mts +28 -0
- package/resources/v1/credits/grants.d.mts.map +1 -1
- package/resources/v1/credits/grants.d.ts +28 -0
- package/resources/v1/credits/grants.d.ts.map +1 -1
- package/resources/v1/credits/grants.js +28 -0
- package/resources/v1/credits/grants.js.map +1 -1
- package/resources/v1/credits/grants.mjs +28 -0
- package/resources/v1/credits/grants.mjs.map +1 -1
- package/resources/v1/credits/reservations.d.mts +10 -0
- package/resources/v1/credits/reservations.d.mts.map +1 -1
- package/resources/v1/credits/reservations.d.ts +10 -0
- package/resources/v1/credits/reservations.d.ts.map +1 -1
- package/resources/v1/credits/reservations.js +10 -0
- package/resources/v1/credits/reservations.js.map +1 -1
- package/resources/v1/credits/reservations.mjs +10 -0
- package/resources/v1/credits/reservations.mjs.map +1 -1
- package/resources/v1/customers/customers.d.mts +198 -7
- package/resources/v1/customers/customers.d.mts.map +1 -1
- package/resources/v1/customers/customers.d.ts +198 -7
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +106 -6
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +106 -6
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/entities/entities.d.mts +332 -0
- package/resources/v1/customers/entities/entities.d.mts.map +1 -0
- package/resources/v1/customers/entities/entities.d.ts +332 -0
- package/resources/v1/customers/entities/entities.d.ts.map +1 -0
- package/resources/v1/customers/entities/entities.js +139 -0
- package/resources/v1/customers/entities/entities.js.map +1 -0
- package/resources/v1/customers/entities/entities.mjs +134 -0
- package/resources/v1/customers/entities/entities.mjs.map +1 -0
- package/resources/v1/customers/entities/entitlements.d.mts +260 -0
- package/resources/v1/customers/entities/entitlements.d.mts.map +1 -0
- package/resources/v1/customers/entities/entitlements.d.ts +260 -0
- package/resources/v1/customers/entities/entitlements.d.ts.map +1 -0
- package/resources/v1/customers/entities/entitlements.js +87 -0
- package/resources/v1/customers/entities/entitlements.js.map +1 -0
- package/resources/v1/customers/entities/entitlements.mjs +83 -0
- package/resources/v1/customers/entities/entitlements.mjs.map +1 -0
- package/resources/v1/customers/entities/index.d.mts +3 -0
- package/resources/v1/customers/entities/index.d.mts.map +1 -0
- package/resources/v1/customers/entities/index.d.ts +3 -0
- package/resources/v1/customers/entities/index.d.ts.map +1 -0
- package/resources/v1/customers/entities/index.js +9 -0
- package/resources/v1/customers/entities/index.js.map +1 -0
- package/resources/v1/customers/entities/index.mjs +4 -0
- package/resources/v1/customers/entities/index.mjs.map +1 -0
- package/resources/v1/customers/entities.d.mts +2 -0
- package/resources/v1/customers/entities.d.mts.map +1 -0
- package/resources/v1/customers/entities.d.ts +2 -0
- package/resources/v1/customers/entities.d.ts.map +1 -0
- package/resources/v1/customers/entities.js +6 -0
- package/resources/v1/customers/entities.js.map +1 -0
- package/resources/v1/customers/entities.mjs +3 -0
- package/resources/v1/customers/entities.mjs.map +1 -0
- package/resources/v1/customers/index.d.mts +1 -0
- package/resources/v1/customers/index.d.mts.map +1 -1
- package/resources/v1/customers/index.d.ts +1 -0
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js +3 -1
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs +1 -0
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/integrations.d.mts +47 -0
- package/resources/v1/customers/integrations.d.mts.map +1 -1
- package/resources/v1/customers/integrations.d.ts +47 -0
- package/resources/v1/customers/integrations.d.ts.map +1 -1
- package/resources/v1/customers/integrations.js +47 -0
- package/resources/v1/customers/integrations.js.map +1 -1
- package/resources/v1/customers/integrations.mjs +47 -0
- package/resources/v1/customers/integrations.mjs.map +1 -1
- package/resources/v1/customers/payment-method.d.mts +16 -0
- package/resources/v1/customers/payment-method.d.mts.map +1 -1
- package/resources/v1/customers/payment-method.d.ts +16 -0
- package/resources/v1/customers/payment-method.d.ts.map +1 -1
- package/resources/v1/customers/payment-method.js +16 -0
- package/resources/v1/customers/payment-method.js.map +1 -1
- package/resources/v1/customers/payment-method.mjs +16 -0
- package/resources/v1/customers/payment-method.mjs.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.mts +51 -0
- package/resources/v1/customers/promotional-entitlements.d.mts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.d.ts +51 -0
- package/resources/v1/customers/promotional-entitlements.d.ts.map +1 -1
- package/resources/v1/customers/promotional-entitlements.js +51 -0
- package/resources/v1/customers/promotional-entitlements.js.map +1 -1
- package/resources/v1/customers/promotional-entitlements.mjs +51 -0
- package/resources/v1/customers/promotional-entitlements.mjs.map +1 -1
- package/resources/v1/entity-types.d.mts +291 -0
- package/resources/v1/entity-types.d.mts.map +1 -0
- package/resources/v1/entity-types.d.ts +291 -0
- package/resources/v1/entity-types.d.ts.map +1 -0
- package/resources/v1/entity-types.js +128 -0
- package/resources/v1/entity-types.js.map +1 -0
- package/resources/v1/entity-types.mjs +124 -0
- package/resources/v1/entity-types.mjs.map +1 -0
- package/resources/v1/events/beta/customers.d.mts +8 -0
- package/resources/v1/events/beta/customers.d.mts.map +1 -1
- package/resources/v1/events/beta/customers.d.ts +8 -0
- package/resources/v1/events/beta/customers.d.ts.map +1 -1
- package/resources/v1/events/beta/customers.js +8 -0
- package/resources/v1/events/beta/customers.js.map +1 -1
- package/resources/v1/events/beta/customers.mjs +8 -0
- package/resources/v1/events/beta/customers.mjs.map +1 -1
- package/resources/v1/events/data-export/data-export.d.mts +12 -0
- package/resources/v1/events/data-export/data-export.d.mts.map +1 -1
- package/resources/v1/events/data-export/data-export.d.ts +12 -0
- package/resources/v1/events/data-export/data-export.d.ts.map +1 -1
- package/resources/v1/events/data-export/data-export.js +12 -0
- package/resources/v1/events/data-export/data-export.js.map +1 -1
- package/resources/v1/events/data-export/data-export.mjs +12 -0
- package/resources/v1/events/data-export/data-export.mjs.map +1 -1
- package/resources/v1/events/data-export/destinations.d.mts +26 -0
- package/resources/v1/events/data-export/destinations.d.mts.map +1 -1
- package/resources/v1/events/data-export/destinations.d.ts +26 -0
- package/resources/v1/events/data-export/destinations.d.ts.map +1 -1
- package/resources/v1/events/data-export/destinations.js +26 -0
- package/resources/v1/events/data-export/destinations.js.map +1 -1
- package/resources/v1/events/data-export/destinations.mjs +26 -0
- package/resources/v1/events/data-export/destinations.mjs.map +1 -1
- package/resources/v1/events/events.d.mts +21 -0
- package/resources/v1/events/events.d.mts.map +1 -1
- package/resources/v1/events/events.d.ts +21 -0
- package/resources/v1/events/events.d.ts.map +1 -1
- package/resources/v1/events/events.js +21 -0
- package/resources/v1/events/events.js.map +1 -1
- package/resources/v1/events/events.mjs +21 -0
- package/resources/v1/events/events.mjs.map +1 -1
- package/resources/v1/features.d.mts +43 -0
- package/resources/v1/features.d.mts.map +1 -1
- package/resources/v1/features.d.ts +43 -0
- package/resources/v1/features.d.ts.map +1 -1
- package/resources/v1/features.js +43 -0
- package/resources/v1/features.js.map +1 -1
- package/resources/v1/features.mjs +43 -0
- package/resources/v1/features.mjs.map +1 -1
- package/resources/v1/index.d.mts +1 -0
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +1 -0
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -0
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/plans/entitlements.d.mts +31 -0
- package/resources/v1/plans/entitlements.d.mts.map +1 -1
- package/resources/v1/plans/entitlements.d.ts +31 -0
- package/resources/v1/plans/entitlements.d.ts.map +1 -1
- package/resources/v1/plans/entitlements.js +31 -0
- package/resources/v1/plans/entitlements.js.map +1 -1
- package/resources/v1/plans/entitlements.mjs +31 -0
- package/resources/v1/plans/entitlements.mjs.map +1 -1
- package/resources/v1/plans/plans.d.mts +69 -0
- package/resources/v1/plans/plans.d.mts.map +1 -1
- package/resources/v1/plans/plans.d.ts +69 -0
- package/resources/v1/plans/plans.d.ts.map +1 -1
- package/resources/v1/plans/plans.js +69 -0
- package/resources/v1/plans/plans.js.map +1 -1
- package/resources/v1/plans/plans.mjs +69 -0
- package/resources/v1/plans/plans.mjs.map +1 -1
- package/resources/v1/products.d.mts +43 -0
- package/resources/v1/products.d.mts.map +1 -1
- package/resources/v1/products.d.ts +43 -0
- package/resources/v1/products.d.ts.map +1 -1
- package/resources/v1/products.js +43 -0
- package/resources/v1/products.js.map +1 -1
- package/resources/v1/products.mjs +43 -0
- package/resources/v1/products.mjs.map +1 -1
- package/resources/v1/subscriptions/future-update.d.mts +16 -0
- package/resources/v1/subscriptions/future-update.d.mts.map +1 -1
- package/resources/v1/subscriptions/future-update.d.ts +16 -0
- package/resources/v1/subscriptions/future-update.d.ts.map +1 -1
- package/resources/v1/subscriptions/future-update.js +16 -0
- package/resources/v1/subscriptions/future-update.js.map +1 -1
- package/resources/v1/subscriptions/future-update.mjs +16 -0
- package/resources/v1/subscriptions/future-update.mjs.map +1 -1
- package/resources/v1/subscriptions/invoice.d.mts +6 -0
- package/resources/v1/subscriptions/invoice.d.mts.map +1 -1
- package/resources/v1/subscriptions/invoice.d.ts +6 -0
- package/resources/v1/subscriptions/invoice.d.ts.map +1 -1
- package/resources/v1/subscriptions/invoice.js +6 -0
- package/resources/v1/subscriptions/invoice.js.map +1 -1
- package/resources/v1/subscriptions/invoice.mjs +6 -0
- package/resources/v1/subscriptions/invoice.mjs.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.mts +81 -0
- package/resources/v1/subscriptions/subscriptions.d.mts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.d.ts +81 -0
- package/resources/v1/subscriptions/subscriptions.d.ts.map +1 -1
- package/resources/v1/subscriptions/subscriptions.js +81 -0
- package/resources/v1/subscriptions/subscriptions.js.map +1 -1
- package/resources/v1/subscriptions/subscriptions.mjs +81 -0
- package/resources/v1/subscriptions/subscriptions.mjs.map +1 -1
- package/resources/v1/subscriptions/usage.d.mts +13 -0
- package/resources/v1/subscriptions/usage.d.mts.map +1 -1
- package/resources/v1/subscriptions/usage.d.ts +13 -0
- package/resources/v1/subscriptions/usage.d.ts.map +1 -1
- package/resources/v1/subscriptions/usage.js +13 -0
- package/resources/v1/subscriptions/usage.js.map +1 -1
- package/resources/v1/subscriptions/usage.mjs +13 -0
- package/resources/v1/subscriptions/usage.mjs.map +1 -1
- package/resources/v1/usage.d.mts +20 -0
- package/resources/v1/usage.d.mts.map +1 -1
- package/resources/v1/usage.d.ts +20 -0
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +20 -0
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +20 -0
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.mts +4 -0
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +4 -0
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -0
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -0
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v1-beta/customers/assignments.d.mts +12 -33
- package/resources/v1-beta/customers/assignments.d.mts.map +1 -1
- package/resources/v1-beta/customers/assignments.d.ts +12 -33
- package/resources/v1-beta/customers/assignments.d.ts.map +1 -1
- package/resources/v1-beta/customers/assignments.js +7 -33
- package/resources/v1-beta/customers/assignments.js.map +1 -1
- package/resources/v1-beta/customers/assignments.mjs +7 -33
- package/resources/v1-beta/customers/assignments.mjs.map +1 -1
- package/resources/v1-beta/customers/entities.d.mts +18 -55
- package/resources/v1-beta/customers/entities.d.mts.map +1 -1
- package/resources/v1-beta/customers/entities.d.ts +18 -55
- package/resources/v1-beta/customers/entities.d.ts.map +1 -1
- package/resources/v1-beta/customers/entities.js +18 -55
- package/resources/v1-beta/customers/entities.js.map +1 -1
- package/resources/v1-beta/customers/entities.mjs +18 -55
- package/resources/v1-beta/customers/entities.mjs.map +1 -1
- package/resources/v1-beta/customers/entitlements.d.mts +7 -10
- package/resources/v1-beta/customers/entitlements.d.mts.map +1 -1
- package/resources/v1-beta/customers/entitlements.d.ts +7 -10
- package/resources/v1-beta/customers/entitlements.d.ts.map +1 -1
- package/resources/v1-beta/customers/entitlements.js +2 -5
- package/resources/v1-beta/customers/entitlements.js.map +1 -1
- package/resources/v1-beta/customers/entitlements.mjs +2 -5
- package/resources/v1-beta/customers/entitlements.mjs.map +1 -1
- package/resources/v1-beta/entity-types.d.mts +18 -28
- package/resources/v1-beta/entity-types.d.mts.map +1 -1
- package/resources/v1-beta/entity-types.d.ts +18 -28
- package/resources/v1-beta/entity-types.d.ts.map +1 -1
- package/resources/v1-beta/entity-types.js +6 -28
- package/resources/v1-beta/entity-types.js.map +1 -1
- package/resources/v1-beta/entity-types.mjs +6 -28
- package/resources/v1-beta/entity-types.mjs.map +1 -1
- package/src/resources/v1/addons/addons.ts +59 -0
- package/src/resources/v1/addons/entitlements.ts +31 -0
- package/src/resources/v1/contracts.ts +30 -0
- package/src/resources/v1/coupons.ts +36 -0
- package/src/resources/v1/credits/consumption.ts +26 -0
- package/src/resources/v1/credits/credits.ts +25 -0
- package/src/resources/v1/credits/custom-currencies.ts +49 -0
- package/src/resources/v1/credits/grants.ts +28 -0
- package/src/resources/v1/credits/reservations.ts +10 -0
- package/src/resources/v1/customers/customers.ts +237 -7
- package/src/resources/v1/customers/entities/entities.ts +470 -0
- package/src/resources/v1/customers/entities/entitlements.ts +347 -0
- package/src/resources/v1/customers/entities/index.ts +22 -0
- package/src/resources/v1/customers/entities.ts +3 -0
- package/src/resources/v1/customers/index.ts +12 -0
- package/src/resources/v1/customers/integrations.ts +47 -0
- package/src/resources/v1/customers/payment-method.ts +16 -0
- package/src/resources/v1/customers/promotional-entitlements.ts +51 -0
- package/src/resources/v1/entity-types.ts +402 -0
- package/src/resources/v1/events/beta/customers.ts +8 -0
- package/src/resources/v1/events/data-export/data-export.ts +12 -0
- package/src/resources/v1/events/data-export/destinations.ts +26 -0
- package/src/resources/v1/events/events.ts +21 -0
- package/src/resources/v1/features.ts +43 -0
- package/src/resources/v1/index.ts +12 -0
- package/src/resources/v1/plans/entitlements.ts +31 -0
- package/src/resources/v1/plans/plans.ts +69 -0
- package/src/resources/v1/products.ts +43 -0
- package/src/resources/v1/subscriptions/future-update.ts +16 -0
- package/src/resources/v1/subscriptions/invoice.ts +6 -0
- package/src/resources/v1/subscriptions/subscriptions.ts +81 -0
- package/src/resources/v1/subscriptions/usage.ts +13 -0
- package/src/resources/v1/usage.ts +20 -0
- package/src/resources/v1/v1.ts +28 -0
- package/src/resources/v1-beta/customers/assignments.ts +12 -33
- package/src/resources/v1-beta/customers/entities.ts +18 -55
- package/src/resources/v1-beta/customers/entitlements.ts +7 -10
- package/src/resources/v1-beta/entity-types.ts +21 -28
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { MyCursorIDPage, type MyCursorIDPageParams, PagePromise } from '../../core/pagination';
|
|
6
|
+
import { buildHeaders } from '../../internal/headers';
|
|
7
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
8
|
+
import { path } from '../../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class EntityTypes extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Returns a cursor-paginated list of entity types defined in the environment.
|
|
13
|
+
* Entity types are vendor-defined categories of resource that can be governed
|
|
14
|
+
* (e.g. Org, Team, User). Archived entity types are excluded unless
|
|
15
|
+
* includeArchived=true.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* // Automatically fetches more pages as needed.
|
|
20
|
+
* for await (const entityTypeListResponse of client.v1.entityTypes.list()) {
|
|
21
|
+
* // ...
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
list(
|
|
26
|
+
params: EntityTypeListParams | null | undefined = {},
|
|
27
|
+
options?: RequestOptions,
|
|
28
|
+
): PagePromise<EntityTypeListResponsesMyCursorIDPage, EntityTypeListResponse> {
|
|
29
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...query } = params ?? {};
|
|
30
|
+
return this._client.getAPIList('/api/v1/entity-types', MyCursorIDPage<EntityTypeListResponse>, {
|
|
31
|
+
query,
|
|
32
|
+
...options,
|
|
33
|
+
headers: buildHeaders([
|
|
34
|
+
{
|
|
35
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
36
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
37
|
+
},
|
|
38
|
+
options?.headers,
|
|
39
|
+
]),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Archives entity types in bulk by id. An entity type with active entities cannot
|
|
45
|
+
* be archived: archive its entities first, or the whole request fails with 400.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const response = await client.v1.entityTypes.archive({
|
|
50
|
+
* ids: ['team'],
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
archive(params: EntityTypeArchiveParams, options?: RequestOptions): APIPromise<EntityTypeArchiveResponse> {
|
|
55
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
56
|
+
return this._client.post('/api/v1/entity-types/archive', {
|
|
57
|
+
body,
|
|
58
|
+
...options,
|
|
59
|
+
headers: buildHeaders([
|
|
60
|
+
{
|
|
61
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
62
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
63
|
+
},
|
|
64
|
+
options?.headers,
|
|
65
|
+
]),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Returns whether any active entity of this entity type exists, across every
|
|
71
|
+
* customer. An entity type can be archived only when this is false. An unknown
|
|
72
|
+
* entity type returns false.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const response =
|
|
77
|
+
* await client.v1.entityTypes.checkActiveEntities('id');
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
checkActiveEntities(
|
|
81
|
+
id: string,
|
|
82
|
+
params: EntityTypeCheckActiveEntitiesParams | null | undefined = {},
|
|
83
|
+
options?: RequestOptions,
|
|
84
|
+
): APIPromise<EntityTypeCheckActiveEntitiesResponse> {
|
|
85
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params ?? {};
|
|
86
|
+
return this._client.get(path`/api/v1/entity-types/${id}/has-active-entities`, {
|
|
87
|
+
...options,
|
|
88
|
+
headers: buildHeaders([
|
|
89
|
+
{
|
|
90
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
91
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
92
|
+
},
|
|
93
|
+
options?.headers,
|
|
94
|
+
]),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Batched create-or-update of entity types. Existing types matched by id are
|
|
100
|
+
* updated; new ids are created. Idempotent — re-submitting the same payload
|
|
101
|
+
* converges to the same state. An upsert of an archived entity type restores it.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* const response = await client.v1.entityTypes.upsert({
|
|
106
|
+
* types: [
|
|
107
|
+
* {
|
|
108
|
+
* id: 'org',
|
|
109
|
+
* displayName: 'Organization',
|
|
110
|
+
* description:
|
|
111
|
+
* 'A customer organization — the top of the hierarchy, holding the account-wide budget.',
|
|
112
|
+
* attributionKeys: ['organizationId'],
|
|
113
|
+
* },
|
|
114
|
+
* {
|
|
115
|
+
* id: 'team',
|
|
116
|
+
* displayName: 'Team',
|
|
117
|
+
* attributionKeys: ['teamId'],
|
|
118
|
+
* },
|
|
119
|
+
* ],
|
|
120
|
+
* });
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
upsert(params: EntityTypeUpsertParams, options?: RequestOptions): APIPromise<EntityTypeUpsertResponse> {
|
|
124
|
+
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
125
|
+
return this._client.put('/api/v1/entity-types', {
|
|
126
|
+
body,
|
|
127
|
+
...options,
|
|
128
|
+
headers: buildHeaders([
|
|
129
|
+
{
|
|
130
|
+
...(xAccountID != null ? { 'X-ACCOUNT-ID': xAccountID } : undefined),
|
|
131
|
+
...(xEnvironmentID != null ? { 'X-ENVIRONMENT-ID': xEnvironmentID } : undefined),
|
|
132
|
+
},
|
|
133
|
+
options?.headers,
|
|
134
|
+
]),
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export type EntityTypeListResponsesMyCursorIDPage = MyCursorIDPage<EntityTypeListResponse>;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* A vendor-defined category of resource that can be governed (e.g. Org, Team,
|
|
143
|
+
* User). Vendors define entity types once per environment; their customers create
|
|
144
|
+
* instances (entities) of these types and the governance engine tracks usage and
|
|
145
|
+
* enforces limits per instance.
|
|
146
|
+
*/
|
|
147
|
+
export interface EntityTypeListResponse {
|
|
148
|
+
/**
|
|
149
|
+
* The unique identifier for the entity
|
|
150
|
+
*/
|
|
151
|
+
id: string;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Timestamp of when the record was deleted
|
|
155
|
+
*/
|
|
156
|
+
archivedAt: string | null;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Dimension keys used to attribute usage events to instances of this type (e.g.
|
|
160
|
+
* ["orgId"]). Empty array means no attribution.
|
|
161
|
+
*/
|
|
162
|
+
attributionKeys: Array<string>;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Timestamp of when the record was created
|
|
166
|
+
*/
|
|
167
|
+
createdAt: string;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* What this entity type represents and what it is for governing, or null when none
|
|
171
|
+
* is set
|
|
172
|
+
*/
|
|
173
|
+
description: string | null;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The display name for the entity type
|
|
177
|
+
*/
|
|
178
|
+
displayName: string;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Timestamp of when the record was last updated
|
|
182
|
+
*/
|
|
183
|
+
updatedAt: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Wrapped response echoing the entity type ids that were acted on by an archive
|
|
188
|
+
* call
|
|
189
|
+
*/
|
|
190
|
+
export interface EntityTypeArchiveResponse {
|
|
191
|
+
/**
|
|
192
|
+
* List of entity type identifiers that were acted on
|
|
193
|
+
*/
|
|
194
|
+
data: EntityTypeArchiveResponse.Data;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export namespace EntityTypeArchiveResponse {
|
|
198
|
+
/**
|
|
199
|
+
* List of entity type identifiers that were acted on
|
|
200
|
+
*/
|
|
201
|
+
export interface Data {
|
|
202
|
+
/**
|
|
203
|
+
* Entity type identifiers to act on
|
|
204
|
+
*/
|
|
205
|
+
ids: Array<string>;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Wrapped response with whether an entity type has active entities
|
|
211
|
+
*/
|
|
212
|
+
export interface EntityTypeCheckActiveEntitiesResponse {
|
|
213
|
+
/**
|
|
214
|
+
* Whether an entity type has active entities
|
|
215
|
+
*/
|
|
216
|
+
data: EntityTypeCheckActiveEntitiesResponse.Data;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export namespace EntityTypeCheckActiveEntitiesResponse {
|
|
220
|
+
/**
|
|
221
|
+
* Whether an entity type has active entities
|
|
222
|
+
*/
|
|
223
|
+
export interface Data {
|
|
224
|
+
/**
|
|
225
|
+
* Whether at least one active (non-archived) entity of the entity type exists,
|
|
226
|
+
* across every customer
|
|
227
|
+
*/
|
|
228
|
+
hasActiveEntities: boolean;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Entity types after upsert.
|
|
234
|
+
*/
|
|
235
|
+
export interface EntityTypeUpsertResponse {
|
|
236
|
+
data: Array<EntityTypeUpsertResponse.Data>;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export namespace EntityTypeUpsertResponse {
|
|
240
|
+
/**
|
|
241
|
+
* A vendor-defined category of resource that can be governed (e.g. Org, Team,
|
|
242
|
+
* User). Vendors define entity types once per environment; their customers create
|
|
243
|
+
* instances (entities) of these types and the governance engine tracks usage and
|
|
244
|
+
* enforces limits per instance.
|
|
245
|
+
*/
|
|
246
|
+
export interface Data {
|
|
247
|
+
/**
|
|
248
|
+
* The unique identifier for the entity
|
|
249
|
+
*/
|
|
250
|
+
id: string;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Timestamp of when the record was deleted
|
|
254
|
+
*/
|
|
255
|
+
archivedAt: string | null;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Dimension keys used to attribute usage events to instances of this type (e.g.
|
|
259
|
+
* ["orgId"]). Empty array means no attribution.
|
|
260
|
+
*/
|
|
261
|
+
attributionKeys: Array<string>;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Timestamp of when the record was created
|
|
265
|
+
*/
|
|
266
|
+
createdAt: string;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* What this entity type represents and what it is for governing, or null when none
|
|
270
|
+
* is set
|
|
271
|
+
*/
|
|
272
|
+
description: string | null;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* The display name for the entity type
|
|
276
|
+
*/
|
|
277
|
+
displayName: string;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Timestamp of when the record was last updated
|
|
281
|
+
*/
|
|
282
|
+
updatedAt: string;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export interface EntityTypeListParams extends MyCursorIDPageParams {
|
|
287
|
+
/**
|
|
288
|
+
* Query param: Whether to include archived entity types. One of: true, false
|
|
289
|
+
*/
|
|
290
|
+
includeArchived?: 'true' | 'false';
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
294
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
295
|
+
*/
|
|
296
|
+
'X-ACCOUNT-ID'?: string;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
300
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
301
|
+
* intrinsic to the key).
|
|
302
|
+
*/
|
|
303
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export interface EntityTypeArchiveParams {
|
|
307
|
+
/**
|
|
308
|
+
* Body param: Entity type identifiers to act on
|
|
309
|
+
*/
|
|
310
|
+
ids: Array<string>;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
314
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
315
|
+
*/
|
|
316
|
+
'X-ACCOUNT-ID'?: string;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
320
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
321
|
+
* intrinsic to the key).
|
|
322
|
+
*/
|
|
323
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export interface EntityTypeCheckActiveEntitiesParams {
|
|
327
|
+
/**
|
|
328
|
+
* Account ID — optional when authenticating with a user JWT (Bearer token); falls
|
|
329
|
+
* back to the user's first membership. Ignored for API-key auth.
|
|
330
|
+
*/
|
|
331
|
+
'X-ACCOUNT-ID'?: string;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Environment ID — required when authenticating with a user JWT (Bearer token) on
|
|
335
|
+
* environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the
|
|
336
|
+
* key).
|
|
337
|
+
*/
|
|
338
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export interface EntityTypeUpsertParams {
|
|
342
|
+
/**
|
|
343
|
+
* Body param: Entity types to upsert (1–100 per request)
|
|
344
|
+
*/
|
|
345
|
+
types: Array<EntityTypeUpsertParams.Type>;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Header param: Account ID — optional when authenticating with a user JWT (Bearer
|
|
349
|
+
* token); falls back to the user's first membership. Ignored for API-key auth.
|
|
350
|
+
*/
|
|
351
|
+
'X-ACCOUNT-ID'?: string;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Header param: Environment ID — required when authenticating with a user JWT
|
|
355
|
+
* (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is
|
|
356
|
+
* intrinsic to the key).
|
|
357
|
+
*/
|
|
358
|
+
'X-ENVIRONMENT-ID'?: string;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export namespace EntityTypeUpsertParams {
|
|
362
|
+
/**
|
|
363
|
+
* A single entity type definition.
|
|
364
|
+
*/
|
|
365
|
+
export interface Type {
|
|
366
|
+
/**
|
|
367
|
+
* The unique identifier for the entity
|
|
368
|
+
*/
|
|
369
|
+
id: string;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Dimension keys used to attribute usage events to instances of this type (e.g.
|
|
373
|
+
* ["orgId"]). Empty array means no attribution.
|
|
374
|
+
*/
|
|
375
|
+
attributionKeys: Array<string>;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* The display name for the entity type
|
|
379
|
+
*/
|
|
380
|
+
displayName: string;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* What this entity type represents and what it is for governing. Omit to preserve
|
|
384
|
+
* the stored value, or send an empty string or null to clear it.
|
|
385
|
+
*/
|
|
386
|
+
description?: string | null;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export declare namespace EntityTypes {
|
|
391
|
+
export {
|
|
392
|
+
type EntityTypeListResponse as EntityTypeListResponse,
|
|
393
|
+
type EntityTypeArchiveResponse as EntityTypeArchiveResponse,
|
|
394
|
+
type EntityTypeCheckActiveEntitiesResponse as EntityTypeCheckActiveEntitiesResponse,
|
|
395
|
+
type EntityTypeUpsertResponse as EntityTypeUpsertResponse,
|
|
396
|
+
type EntityTypeListResponsesMyCursorIDPage as EntityTypeListResponsesMyCursorIDPage,
|
|
397
|
+
type EntityTypeListParams as EntityTypeListParams,
|
|
398
|
+
type EntityTypeArchiveParams as EntityTypeArchiveParams,
|
|
399
|
+
type EntityTypeCheckActiveEntitiesParams as EntityTypeCheckActiveEntitiesParams,
|
|
400
|
+
type EntityTypeUpsertParams as EntityTypeUpsertParams,
|
|
401
|
+
};
|
|
402
|
+
}
|
|
@@ -13,6 +13,14 @@ export class Customers extends APIResource {
|
|
|
13
13
|
* usage, sortable and filterable by usage. Each node carries `parentId` so the
|
|
14
14
|
* tree can be rebuilt client-side. Usage is read from a periodically-refreshed
|
|
15
15
|
* read model and never gates access.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const response =
|
|
20
|
+
* await client.v1.events.beta.customers.retrieveGovernance(
|
|
21
|
+
* 'id',
|
|
22
|
+
* );
|
|
23
|
+
* ```
|
|
16
24
|
*/
|
|
17
25
|
retrieveGovernance(
|
|
18
26
|
id: string,
|
|
@@ -21,6 +21,12 @@ export class DataExport extends APIResource {
|
|
|
21
21
|
/**
|
|
22
22
|
* List the catalog of data-export models the customer can opt into when connecting
|
|
23
23
|
* a destination.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const response =
|
|
28
|
+
* await client.v1.events.dataExport.listModels();
|
|
29
|
+
* ```
|
|
24
30
|
*/
|
|
25
31
|
listModels(
|
|
26
32
|
params: DataExportListModelsParams | null | undefined = {},
|
|
@@ -42,6 +48,12 @@ export class DataExport extends APIResource {
|
|
|
42
48
|
/**
|
|
43
49
|
* Trigger a sync for one destination or all destinations under the provider
|
|
44
50
|
* entity.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const response =
|
|
55
|
+
* await client.v1.events.dataExport.triggerSync();
|
|
56
|
+
* ```
|
|
45
57
|
*/
|
|
46
58
|
triggerSync(
|
|
47
59
|
params: DataExportTriggerSyncParams,
|
|
@@ -11,6 +11,15 @@ export class Destinations extends APIResource {
|
|
|
11
11
|
* Register a destination on the environment's DATA_EXPORT integration.
|
|
12
12
|
* Lazy-creates the integration row + provider recipient on first call. Idempotent
|
|
13
13
|
* on destinationId.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const destination =
|
|
18
|
+
* await client.v1.events.dataExport.destinations.create({
|
|
19
|
+
* destinationId: 'x',
|
|
20
|
+
* destinationType: 'x',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
14
23
|
*/
|
|
15
24
|
create(params: DestinationCreateParams, options?: RequestOptions): APIPromise<DestinationCreateResponse> {
|
|
16
25
|
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
@@ -31,6 +40,14 @@ export class Destinations extends APIResource {
|
|
|
31
40
|
* Disconnect a destination: stops the provider sync (deletes the provider
|
|
32
41
|
* destination) and removes it from the DATA_EXPORT integration. Non-destructive —
|
|
33
42
|
* the warehouse table is left intact. Idempotent.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const destination =
|
|
47
|
+
* await client.v1.events.dataExport.destinations.delete(
|
|
48
|
+
* 'x',
|
|
49
|
+
* );
|
|
50
|
+
* ```
|
|
34
51
|
*/
|
|
35
52
|
delete(
|
|
36
53
|
destinationID: string,
|
|
@@ -54,6 +71,15 @@ export class Destinations extends APIResource {
|
|
|
54
71
|
* Update a destination's entity selection. Pushes the new enabled_models to the
|
|
55
72
|
* provider first, then persists the selection. Applies on the next scheduled
|
|
56
73
|
* transfer.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const response =
|
|
78
|
+
* await client.v1.events.dataExport.destinations.updateSelection(
|
|
79
|
+
* 'x',
|
|
80
|
+
* { enabledModels: ['x'], integrationId: 'x' },
|
|
81
|
+
* );
|
|
82
|
+
* ```
|
|
57
83
|
*/
|
|
58
84
|
updateSelection(
|
|
59
85
|
destinationID: string,
|
|
@@ -26,6 +26,14 @@ export class Events extends APIResource {
|
|
|
26
26
|
* Estimates the credit cost of a usage event without ingesting it. Returns the
|
|
27
27
|
* estimated cost per credit currency, the current balance, and the balance after
|
|
28
28
|
* the estimated consumption.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const response = await client.v1.events.estimate({
|
|
33
|
+
* customerId: 'customerId',
|
|
34
|
+
* eventName: 'x',
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
29
37
|
*/
|
|
30
38
|
estimate(params: EventEstimateParams, options?: RequestOptions): APIPromise<EventEstimateResponse> {
|
|
31
39
|
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
@@ -45,6 +53,19 @@ export class Events extends APIResource {
|
|
|
45
53
|
/**
|
|
46
54
|
* Reports raw usage events for event-based metering. Events are validated and
|
|
47
55
|
* stored synchronously, then aggregated into usage totals asynchronously.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const response = await client.v1.events.report({
|
|
60
|
+
* events: [
|
|
61
|
+
* {
|
|
62
|
+
* customerId: 'customerId',
|
|
63
|
+
* eventName: 'x',
|
|
64
|
+
* idempotencyKey: 'x',
|
|
65
|
+
* },
|
|
66
|
+
* ],
|
|
67
|
+
* });
|
|
68
|
+
* ```
|
|
48
69
|
*/
|
|
49
70
|
report(params: EventReportParams, options?: RequestOptions): APIPromise<EventReportResponse> {
|
|
50
71
|
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
@@ -13,6 +13,13 @@ import { path } from '../../internal/utils/path';
|
|
|
13
13
|
export class Features extends APIResource {
|
|
14
14
|
/**
|
|
15
15
|
* Archives a feature, preventing it from being used in new entitlements.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const feature = await client.v1.features.archiveFeature(
|
|
20
|
+
* 'x',
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
16
23
|
*/
|
|
17
24
|
archiveFeature(
|
|
18
25
|
id: string,
|
|
@@ -34,6 +41,15 @@ export class Features extends APIResource {
|
|
|
34
41
|
|
|
35
42
|
/**
|
|
36
43
|
* Creates a new feature with the specified type, metering, and configuration.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const feature = await client.v1.features.createFeature({
|
|
48
|
+
* id: 'id',
|
|
49
|
+
* displayName: 'displayName',
|
|
50
|
+
* featureType: 'BOOLEAN',
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
37
53
|
*/
|
|
38
54
|
createFeature(params: FeatureCreateFeatureParams, options?: RequestOptions): APIPromise<Feature> {
|
|
39
55
|
const { 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
@@ -52,6 +68,14 @@ export class Features extends APIResource {
|
|
|
52
68
|
|
|
53
69
|
/**
|
|
54
70
|
* Retrieves a paginated list of features in the environment.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* // Automatically fetches more pages as needed.
|
|
75
|
+
* for await (const featureListFeaturesResponse of client.v1.features.listFeatures()) {
|
|
76
|
+
* // ...
|
|
77
|
+
* }
|
|
78
|
+
* ```
|
|
55
79
|
*/
|
|
56
80
|
listFeatures(
|
|
57
81
|
params: FeatureListFeaturesParams | null | undefined = {},
|
|
@@ -73,6 +97,13 @@ export class Features extends APIResource {
|
|
|
73
97
|
|
|
74
98
|
/**
|
|
75
99
|
* Retrieves a feature by its unique identifier.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* const feature = await client.v1.features.retrieveFeature(
|
|
104
|
+
* 'x',
|
|
105
|
+
* );
|
|
106
|
+
* ```
|
|
76
107
|
*/
|
|
77
108
|
retrieveFeature(
|
|
78
109
|
id: string,
|
|
@@ -94,6 +125,13 @@ export class Features extends APIResource {
|
|
|
94
125
|
|
|
95
126
|
/**
|
|
96
127
|
* Restores an archived feature, allowing it to be used in entitlements again.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* const feature = await client.v1.features.unarchiveFeature(
|
|
132
|
+
* 'x',
|
|
133
|
+
* );
|
|
134
|
+
* ```
|
|
97
135
|
*/
|
|
98
136
|
unarchiveFeature(
|
|
99
137
|
id: string,
|
|
@@ -116,6 +154,11 @@ export class Features extends APIResource {
|
|
|
116
154
|
/**
|
|
117
155
|
* Updates an existing feature's properties such as display name, description, and
|
|
118
156
|
* configuration.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```ts
|
|
160
|
+
* const feature = await client.v1.features.updateFeature('x');
|
|
161
|
+
* ```
|
|
119
162
|
*/
|
|
120
163
|
updateFeature(
|
|
121
164
|
id: string,
|
|
@@ -81,6 +81,18 @@ export {
|
|
|
81
81
|
type CustomerListInvoicesResponsesMyCursorIDPage,
|
|
82
82
|
type CustomerListResourcesResponsesMyCursorIDPage,
|
|
83
83
|
} from './customers/index';
|
|
84
|
+
export {
|
|
85
|
+
EntityTypes,
|
|
86
|
+
type EntityTypeListResponse,
|
|
87
|
+
type EntityTypeArchiveResponse,
|
|
88
|
+
type EntityTypeCheckActiveEntitiesResponse,
|
|
89
|
+
type EntityTypeUpsertResponse,
|
|
90
|
+
type EntityTypeListParams,
|
|
91
|
+
type EntityTypeArchiveParams,
|
|
92
|
+
type EntityTypeCheckActiveEntitiesParams,
|
|
93
|
+
type EntityTypeUpsertParams,
|
|
94
|
+
type EntityTypeListResponsesMyCursorIDPage,
|
|
95
|
+
} from './entity-types';
|
|
84
96
|
export {
|
|
85
97
|
Events,
|
|
86
98
|
type EventEstimateResponse,
|
|
@@ -9,6 +9,14 @@ import { path } from '../../../internal/utils/path';
|
|
|
9
9
|
export class Entitlements extends APIResource {
|
|
10
10
|
/**
|
|
11
11
|
* Creates one or more entitlements (feature or credit) on a draft plan.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const entitlement =
|
|
16
|
+
* await client.v1.plans.entitlements.create('planId', {
|
|
17
|
+
* entitlements: [{ id: 'id', type: 'FEATURE' }],
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
12
20
|
*/
|
|
13
21
|
create(
|
|
14
22
|
planID: string,
|
|
@@ -31,6 +39,15 @@ export class Entitlements extends APIResource {
|
|
|
31
39
|
|
|
32
40
|
/**
|
|
33
41
|
* Updates an existing entitlement on a draft plan.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const planEntitlement =
|
|
46
|
+
* await client.v1.plans.entitlements.update('id', {
|
|
47
|
+
* planId: 'planId',
|
|
48
|
+
* type: 'FEATURE',
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
34
51
|
*/
|
|
35
52
|
update(id: string, params: EntitlementUpdateParams, options?: RequestOptions): APIPromise<PlanEntitlement> {
|
|
36
53
|
const { planId, 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID, ...body } = params;
|
|
@@ -49,6 +66,12 @@ export class Entitlements extends APIResource {
|
|
|
49
66
|
|
|
50
67
|
/**
|
|
51
68
|
* Retrieves a list of entitlements for a plan.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const entitlements =
|
|
73
|
+
* await client.v1.plans.entitlements.list('planId');
|
|
74
|
+
* ```
|
|
52
75
|
*/
|
|
53
76
|
list(
|
|
54
77
|
planID: string,
|
|
@@ -70,6 +93,14 @@ export class Entitlements extends APIResource {
|
|
|
70
93
|
|
|
71
94
|
/**
|
|
72
95
|
* Deletes an entitlement from a draft plan.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* const planEntitlement =
|
|
100
|
+
* await client.v1.plans.entitlements.delete('id', {
|
|
101
|
+
* planId: 'planId',
|
|
102
|
+
* });
|
|
103
|
+
* ```
|
|
73
104
|
*/
|
|
74
105
|
delete(id: string, params: EntitlementDeleteParams, options?: RequestOptions): APIPromise<PlanEntitlement> {
|
|
75
106
|
const { planId, 'X-ACCOUNT-ID': xAccountID, 'X-ENVIRONMENT-ID': xEnvironmentID } = params;
|