lark-billing 0.0.7 → 0.0.8
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/README.md +1 -1
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +7 -2
- package/dist/cjs/api/resources/checkout/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/checkout/client/Client.js +1 -1
- package/dist/cjs/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.d.ts +5 -2
- package/dist/cjs/api/resources/index.d.ts +4 -1
- package/dist/cjs/api/resources/index.js +5 -2
- package/dist/cjs/api/resources/invoices/client/Client.d.ts +50 -0
- package/dist/cjs/api/resources/invoices/client/Client.js +135 -0
- package/dist/cjs/api/resources/invoices/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/invoices/client/index.js +17 -0
- package/dist/cjs/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.d.ts +17 -0
- package/dist/cjs/api/resources/invoices/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/invoices/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/invoices/index.d.ts +1 -0
- package/dist/cjs/api/resources/invoices/index.js +17 -0
- package/dist/cjs/api/resources/pricingMetrics/client/Client.d.ts +13 -0
- package/dist/cjs/api/resources/pricingMetrics/client/Client.js +64 -0
- package/dist/cjs/api/resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.d.ts +12 -0
- package/dist/cjs/api/resources/pricingMetrics/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/rateCards/client/requests/CreateRateCardRequest.d.ts +2 -2
- package/dist/cjs/api/resources/rateCards/index.d.ts +1 -0
- package/dist/cjs/api/resources/rateCards/index.js +1 -0
- package/dist/cjs/api/resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.d.ts +10 -0
- package/dist/cjs/api/resources/rateCards/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/rateCards/types/index.js +17 -0
- package/dist/cjs/api/resources/subjects/client/requests/CreateSubjectRequest.d.ts +4 -0
- package/dist/cjs/api/resources/subjects/client/requests/UpdateSubjectRequest.d.ts +3 -1
- package/dist/cjs/api/resources/subscriptions/client/Client.d.ts +28 -2
- package/dist/cjs/api/resources/subscriptions/client/Client.js +126 -2
- package/dist/cjs/api/resources/subscriptions/client/requests/CancelSubscriptionRequest.d.ts +13 -0
- package/dist/cjs/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.ts +12 -0
- package/dist/cjs/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.d.ts +6 -3
- package/dist/cjs/api/resources/subscriptions/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/types/Aggregation.d.ts +1 -10
- package/dist/cjs/api/types/{CreateFixedRateInterface.d.ts → CreateFixedRateRequest.d.ts} +1 -1
- package/dist/cjs/api/types/CreateFixedRateRequest.js +5 -0
- package/dist/cjs/api/types/{CreateSimpleUsageBasedRateInterface.d.ts → CreateSimpleUsageBasedRateRequest.d.ts} +2 -2
- package/dist/cjs/api/types/CreateSimpleUsageBasedRateRequest.js +5 -0
- package/dist/cjs/api/types/CreateSubjectResponse.d.ts +6 -0
- package/dist/cjs/api/types/InvoiceLineItemResource.d.ts +10 -0
- package/dist/cjs/api/types/InvoiceLineItemResource.js +5 -0
- package/dist/cjs/api/types/InvoiceResource.d.ts +25 -0
- package/dist/cjs/api/types/InvoiceResource.js +16 -0
- package/dist/cjs/api/types/ListInvoicesResponse.d.ts +8 -0
- package/dist/cjs/api/types/ListInvoicesResponse.js +5 -0
- package/dist/cjs/api/types/ListPricingMetricsResponse.d.ts +8 -0
- package/dist/cjs/api/types/ListPricingMetricsResponse.js +5 -0
- package/dist/cjs/api/types/PeriodResource.d.ts +9 -0
- package/dist/cjs/api/types/PeriodResource.js +5 -0
- package/dist/cjs/api/types/PricingMetricResource.d.ts +11 -0
- package/dist/cjs/api/types/PricingMetricResource.js +5 -0
- package/dist/cjs/api/types/SimpleUsageBasedRateInterface.d.ts +0 -2
- package/dist/cjs/api/types/SubjectResource.d.ts +6 -0
- package/dist/cjs/api/types/SubscriptionResource.d.ts +6 -2
- package/dist/cjs/api/types/SubscriptionResource.js +1 -0
- package/dist/cjs/api/types/index.d.ts +8 -5
- package/dist/cjs/api/types/index.js +8 -5
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +7 -2
- package/dist/esm/api/resources/checkout/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/checkout/client/Client.mjs +1 -1
- package/dist/esm/api/resources/checkout/client/requests/CreateSubscriptionCheckoutSessionRequest.d.mts +5 -2
- package/dist/esm/api/resources/index.d.mts +4 -1
- package/dist/esm/api/resources/index.mjs +4 -1
- package/dist/esm/api/resources/invoices/client/Client.d.mts +50 -0
- package/dist/esm/api/resources/invoices/client/Client.mjs +98 -0
- package/dist/esm/api/resources/invoices/client/index.d.mts +2 -0
- package/dist/esm/api/resources/invoices/client/index.mjs +1 -0
- package/dist/esm/api/resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.d.mts +17 -0
- package/dist/esm/api/resources/invoices/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/invoices/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/invoices/index.d.mts +1 -0
- package/dist/esm/api/resources/invoices/index.mjs +1 -0
- package/dist/esm/api/resources/pricingMetrics/client/Client.d.mts +13 -0
- package/dist/esm/api/resources/pricingMetrics/client/Client.mjs +64 -0
- package/dist/esm/api/resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.d.mts +12 -0
- package/dist/esm/api/resources/pricingMetrics/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/rateCards/client/requests/CreateRateCardRequest.d.mts +2 -2
- package/dist/esm/api/resources/rateCards/index.d.mts +1 -0
- package/dist/esm/api/resources/rateCards/index.mjs +1 -0
- package/dist/esm/api/resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.d.mts +10 -0
- package/dist/esm/api/resources/rateCards/types/index.d.mts +1 -0
- package/dist/esm/api/resources/rateCards/types/index.mjs +1 -0
- package/dist/esm/api/resources/subjects/client/requests/CreateSubjectRequest.d.mts +4 -0
- package/dist/esm/api/resources/subjects/client/requests/UpdateSubjectRequest.d.mts +3 -1
- package/dist/esm/api/resources/subscriptions/client/Client.d.mts +28 -2
- package/dist/esm/api/resources/subscriptions/client/Client.mjs +126 -2
- package/dist/esm/api/resources/subscriptions/client/requests/CancelSubscriptionRequest.d.mts +13 -0
- package/dist/esm/api/resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.d.mts +12 -0
- package/dist/esm/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.d.mts +6 -3
- package/dist/esm/api/resources/subscriptions/client/requests/index.d.mts +2 -0
- package/dist/esm/api/types/Aggregation.d.mts +1 -10
- package/dist/esm/api/types/{CreateFixedRateInterface.d.mts → CreateFixedRateRequest.d.mts} +1 -1
- package/dist/esm/api/types/CreateFixedRateRequest.mjs +4 -0
- package/dist/esm/api/types/{CreateSimpleUsageBasedRateInterface.d.mts → CreateSimpleUsageBasedRateRequest.d.mts} +2 -2
- package/dist/esm/api/types/CreateSimpleUsageBasedRateRequest.mjs +4 -0
- package/dist/esm/api/types/CreateSubjectResponse.d.mts +6 -0
- package/dist/esm/api/types/InvoiceLineItemResource.d.mts +10 -0
- package/dist/esm/api/types/InvoiceLineItemResource.mjs +4 -0
- package/dist/esm/api/types/InvoiceResource.d.mts +25 -0
- package/dist/esm/api/types/InvoiceResource.mjs +13 -0
- package/dist/esm/api/types/ListInvoicesResponse.d.mts +8 -0
- package/dist/esm/api/types/ListInvoicesResponse.mjs +4 -0
- package/dist/esm/api/types/ListPricingMetricsResponse.d.mts +8 -0
- package/dist/esm/api/types/ListPricingMetricsResponse.mjs +4 -0
- package/dist/esm/api/types/PeriodResource.d.mts +9 -0
- package/dist/esm/api/types/PeriodResource.mjs +4 -0
- package/dist/esm/api/types/PricingMetricResource.d.mts +11 -0
- package/dist/esm/api/types/PricingMetricResource.mjs +4 -0
- package/dist/esm/api/types/SimpleUsageBasedRateInterface.d.mts +0 -2
- package/dist/esm/api/types/SubjectResource.d.mts +6 -0
- package/dist/esm/api/types/SubscriptionResource.d.mts +6 -2
- package/dist/esm/api/types/SubscriptionResource.mjs +1 -0
- package/dist/esm/api/types/index.d.mts +8 -5
- package/dist/esm/api/types/index.mjs +8 -5
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +221 -3
- package/dist/cjs/api/types/CustomPricingMetricResource.d.ts +0 -6
- package/dist/cjs/api/types/LastAggregationPricingMetricResource.d.ts +0 -6
- package/dist/cjs/api/types/MaxAggregationPricingMetricResource.d.ts +0 -6
- package/dist/esm/api/types/CustomPricingMetricResource.d.mts +0 -6
- package/dist/esm/api/types/LastAggregationPricingMetricResource.d.mts +0 -6
- package/dist/esm/api/types/MaxAggregationPricingMetricResource.d.mts +0 -6
- /package/dist/cjs/api/{types/CreateFixedRateInterface.js → resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.js} +0 -0
- /package/dist/cjs/api/{types/CreateSimpleUsageBasedRateInterface.js → resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.js} +0 -0
- /package/dist/cjs/api/{types/CustomPricingMetricResource.js → resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.js} +0 -0
- /package/dist/cjs/api/{types/LastAggregationPricingMetricResource.js → resources/subscriptions/client/requests/CancelSubscriptionRequest.js} +0 -0
- /package/dist/cjs/api/{types/MaxAggregationPricingMetricResource.js → resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.js} +0 -0
- /package/dist/esm/api/{types/CreateFixedRateInterface.mjs → resources/invoices/client/requests/ListInvoicesInvoicesGetRequest.mjs} +0 -0
- /package/dist/esm/api/{types/CreateSimpleUsageBasedRateInterface.mjs → resources/pricingMetrics/client/requests/ListPricingMetricsPricingMetricsGetRequest.mjs} +0 -0
- /package/dist/esm/api/{types/CustomPricingMetricResource.mjs → resources/rateCards/types/CreateRateCardRequestUsageBasedRatesItem.mjs} +0 -0
- /package/dist/esm/api/{types/LastAggregationPricingMetricResource.mjs → resources/subscriptions/client/requests/CancelSubscriptionRequest.mjs} +0 -0
- /package/dist/esm/api/{types/MaxAggregationPricingMetricResource.mjs → resources/subscriptions/client/requests/ChangeSubscriptionRateCardRequest.mjs} +0 -0
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
export * as rateCards from "./rateCards/index.mjs";
|
|
2
|
+
export * from "./rateCards/types/index.mjs";
|
|
1
3
|
export * as pricingMetrics from "./pricingMetrics/index.mjs";
|
|
2
4
|
export * from "./pricingMetrics/types/index.mjs";
|
|
3
5
|
export * as checkout from "./checkout/index.mjs";
|
|
4
6
|
export * as customerPortal from "./customerPortal/index.mjs";
|
|
5
|
-
export * as rateCards from "./rateCards/index.mjs";
|
|
6
7
|
export * as usageEvents from "./usageEvents/index.mjs";
|
|
7
8
|
export * as subscriptions from "./subscriptions/index.mjs";
|
|
8
9
|
export * as subjects from "./subjects/index.mjs";
|
|
9
10
|
export * as customerAccess from "./customerAccess/index.mjs";
|
|
11
|
+
export * as invoices from "./invoices/index.mjs";
|
|
10
12
|
export * from "./checkout/client/requests/index.mjs";
|
|
11
13
|
export * from "./customerPortal/client/requests/index.mjs";
|
|
12
14
|
export * from "./rateCards/client/requests/index.mjs";
|
|
@@ -14,3 +16,4 @@ export * from "./usageEvents/client/requests/index.mjs";
|
|
|
14
16
|
export * from "./subscriptions/client/requests/index.mjs";
|
|
15
17
|
export * from "./subjects/client/requests/index.mjs";
|
|
16
18
|
export * from "./pricingMetrics/client/requests/index.mjs";
|
|
19
|
+
export * from "./invoices/client/requests/index.mjs";
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
export * as rateCards from "./rateCards/index.mjs";
|
|
2
|
+
export * from "./rateCards/types/index.mjs";
|
|
1
3
|
export * as pricingMetrics from "./pricingMetrics/index.mjs";
|
|
2
4
|
export * from "./pricingMetrics/types/index.mjs";
|
|
3
5
|
export * as checkout from "./checkout/index.mjs";
|
|
4
6
|
export * as customerPortal from "./customerPortal/index.mjs";
|
|
5
|
-
export * as rateCards from "./rateCards/index.mjs";
|
|
6
7
|
export * as usageEvents from "./usageEvents/index.mjs";
|
|
7
8
|
export * as subscriptions from "./subscriptions/index.mjs";
|
|
8
9
|
export * as subjects from "./subjects/index.mjs";
|
|
9
10
|
export * as customerAccess from "./customerAccess/index.mjs";
|
|
11
|
+
export * as invoices from "./invoices/index.mjs";
|
|
10
12
|
export * from "./checkout/client/requests/index.mjs";
|
|
11
13
|
export * from "./customerPortal/client/requests/index.mjs";
|
|
12
14
|
export * from "./rateCards/client/requests/index.mjs";
|
|
@@ -14,3 +16,4 @@ export * from "./usageEvents/client/requests/index.mjs";
|
|
|
14
16
|
export * from "./subscriptions/client/requests/index.mjs";
|
|
15
17
|
export * from "./subjects/client/requests/index.mjs";
|
|
16
18
|
export * from "./pricingMetrics/client/requests/index.mjs";
|
|
19
|
+
export * from "./invoices/client/requests/index.mjs";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments.mjs";
|
|
5
|
+
import * as core from "../../../../core/index.mjs";
|
|
6
|
+
import * as Lark from "../../../index.mjs";
|
|
7
|
+
export declare namespace Invoices {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.LarkEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
apiKey: core.Supplier<string>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
15
|
+
}
|
|
16
|
+
interface RequestOptions {
|
|
17
|
+
/** The maximum time to wait for a response in seconds. */
|
|
18
|
+
timeoutInSeconds?: number;
|
|
19
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
20
|
+
maxRetries?: number;
|
|
21
|
+
/** A hook to abort the request. */
|
|
22
|
+
abortSignal?: AbortSignal;
|
|
23
|
+
/** Additional query string parameters to include in the request. */
|
|
24
|
+
queryParams?: Record<string, unknown>;
|
|
25
|
+
/** Additional headers to include in the request. */
|
|
26
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export declare class Invoices {
|
|
30
|
+
protected readonly _options: Invoices.Options;
|
|
31
|
+
constructor(_options: Invoices.Options);
|
|
32
|
+
/**
|
|
33
|
+
* @param {Lark.ListInvoicesInvoicesGetRequest} request
|
|
34
|
+
* @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @throws {@link Lark.UnprocessableEntityError}
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.invoices.listInvoices({
|
|
40
|
+
* subject_id: "subject_id",
|
|
41
|
+
* limit: 1,
|
|
42
|
+
* offset: 1
|
|
43
|
+
* })
|
|
44
|
+
*/
|
|
45
|
+
listInvoices(request: Lark.ListInvoicesInvoicesGetRequest, requestOptions?: Invoices.RequestOptions): core.HttpResponsePromise<Lark.ListInvoicesResponse>;
|
|
46
|
+
private __listInvoices;
|
|
47
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
48
|
+
"X-API-Key": string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import * as environments from "../../../../environments.mjs";
|
|
14
|
+
import * as core from "../../../../core/index.mjs";
|
|
15
|
+
import * as Lark from "../../../index.mjs";
|
|
16
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
17
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
18
|
+
export class Invoices {
|
|
19
|
+
constructor(_options) {
|
|
20
|
+
this._options = _options;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @param {Lark.ListInvoicesInvoicesGetRequest} request
|
|
24
|
+
* @param {Invoices.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
|
+
*
|
|
26
|
+
* @throws {@link Lark.UnprocessableEntityError}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* await client.invoices.listInvoices({
|
|
30
|
+
* subject_id: "subject_id",
|
|
31
|
+
* limit: 1,
|
|
32
|
+
* offset: 1
|
|
33
|
+
* })
|
|
34
|
+
*/
|
|
35
|
+
listInvoices(request, requestOptions) {
|
|
36
|
+
return core.HttpResponsePromise.fromPromise(this.__listInvoices(request, requestOptions));
|
|
37
|
+
}
|
|
38
|
+
__listInvoices(request, requestOptions) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
var _a, _b, _c;
|
|
41
|
+
const { subject_id: subjectId, limit, offset } = request;
|
|
42
|
+
const _queryParams = {};
|
|
43
|
+
_queryParams["subject_id"] = subjectId;
|
|
44
|
+
if (limit != null) {
|
|
45
|
+
_queryParams["limit"] = limit.toString();
|
|
46
|
+
}
|
|
47
|
+
if (offset != null) {
|
|
48
|
+
_queryParams["offset"] = offset.toString();
|
|
49
|
+
}
|
|
50
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
51
|
+
const _response = yield core.fetcher({
|
|
52
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LarkEnvironment.Default, "invoices"),
|
|
53
|
+
method: "GET",
|
|
54
|
+
headers: _headers,
|
|
55
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
56
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
57
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
58
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
59
|
+
});
|
|
60
|
+
if (_response.ok) {
|
|
61
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
62
|
+
}
|
|
63
|
+
if (_response.error.reason === "status-code") {
|
|
64
|
+
switch (_response.error.statusCode) {
|
|
65
|
+
case 422:
|
|
66
|
+
throw new Lark.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
67
|
+
default:
|
|
68
|
+
throw new errors.LarkError({
|
|
69
|
+
statusCode: _response.error.statusCode,
|
|
70
|
+
body: _response.error.body,
|
|
71
|
+
rawResponse: _response.rawResponse,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
switch (_response.error.reason) {
|
|
76
|
+
case "non-json":
|
|
77
|
+
throw new errors.LarkError({
|
|
78
|
+
statusCode: _response.error.statusCode,
|
|
79
|
+
body: _response.error.rawBody,
|
|
80
|
+
rawResponse: _response.rawResponse,
|
|
81
|
+
});
|
|
82
|
+
case "timeout":
|
|
83
|
+
throw new errors.LarkTimeoutError("Timeout exceeded when calling GET /invoices.");
|
|
84
|
+
case "unknown":
|
|
85
|
+
throw new errors.LarkError({
|
|
86
|
+
message: _response.error.errorMessage,
|
|
87
|
+
rawResponse: _response.rawResponse,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
_getCustomAuthorizationHeaders() {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
95
|
+
return { "X-API-Key": apiKeyValue };
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* subject_id: "subject_id",
|
|
8
|
+
* limit: 1,
|
|
9
|
+
* offset: 1
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export interface ListInvoicesInvoicesGetRequest {
|
|
13
|
+
/** The ID of the subject to list invoices for. */
|
|
14
|
+
subject_id: string;
|
|
15
|
+
limit?: number;
|
|
16
|
+
offset?: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type ListInvoicesInvoicesGetRequest } from "./ListInvoicesInvoicesGetRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -29,6 +29,19 @@ export declare namespace PricingMetrics {
|
|
|
29
29
|
export declare class PricingMetrics {
|
|
30
30
|
protected readonly _options: PricingMetrics.Options;
|
|
31
31
|
constructor(_options: PricingMetrics.Options);
|
|
32
|
+
/**
|
|
33
|
+
* @param {Lark.ListPricingMetricsPricingMetricsGetRequest} request
|
|
34
|
+
* @param {PricingMetrics.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @throws {@link Lark.UnprocessableEntityError}
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.pricingMetrics.listPricingMetrics({
|
|
40
|
+
* limit: 1
|
|
41
|
+
* })
|
|
42
|
+
*/
|
|
43
|
+
listPricingMetrics(request?: Lark.ListPricingMetricsPricingMetricsGetRequest, requestOptions?: PricingMetrics.RequestOptions): core.HttpResponsePromise<Lark.ListPricingMetricsResponse>;
|
|
44
|
+
private __listPricingMetrics;
|
|
32
45
|
/**
|
|
33
46
|
* @param {Lark.CreatePricingMetricRequest} request
|
|
34
47
|
* @param {PricingMetrics.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -19,6 +19,70 @@ export class PricingMetrics {
|
|
|
19
19
|
constructor(_options) {
|
|
20
20
|
this._options = _options;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* @param {Lark.ListPricingMetricsPricingMetricsGetRequest} request
|
|
24
|
+
* @param {PricingMetrics.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
|
+
*
|
|
26
|
+
* @throws {@link Lark.UnprocessableEntityError}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* await client.pricingMetrics.listPricingMetrics({
|
|
30
|
+
* limit: 1
|
|
31
|
+
* })
|
|
32
|
+
*/
|
|
33
|
+
listPricingMetrics(request = {}, requestOptions) {
|
|
34
|
+
return core.HttpResponsePromise.fromPromise(this.__listPricingMetrics(request, requestOptions));
|
|
35
|
+
}
|
|
36
|
+
__listPricingMetrics() {
|
|
37
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
38
|
+
var _a, _b, _c;
|
|
39
|
+
const { limit } = request;
|
|
40
|
+
const _queryParams = {};
|
|
41
|
+
if (limit != null) {
|
|
42
|
+
_queryParams["limit"] = limit.toString();
|
|
43
|
+
}
|
|
44
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
45
|
+
const _response = yield core.fetcher({
|
|
46
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LarkEnvironment.Default, "pricing-metrics"),
|
|
47
|
+
method: "GET",
|
|
48
|
+
headers: _headers,
|
|
49
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
50
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
51
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
52
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
53
|
+
});
|
|
54
|
+
if (_response.ok) {
|
|
55
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
56
|
+
}
|
|
57
|
+
if (_response.error.reason === "status-code") {
|
|
58
|
+
switch (_response.error.statusCode) {
|
|
59
|
+
case 422:
|
|
60
|
+
throw new Lark.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
61
|
+
default:
|
|
62
|
+
throw new errors.LarkError({
|
|
63
|
+
statusCode: _response.error.statusCode,
|
|
64
|
+
body: _response.error.body,
|
|
65
|
+
rawResponse: _response.rawResponse,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
switch (_response.error.reason) {
|
|
70
|
+
case "non-json":
|
|
71
|
+
throw new errors.LarkError({
|
|
72
|
+
statusCode: _response.error.statusCode,
|
|
73
|
+
body: _response.error.rawBody,
|
|
74
|
+
rawResponse: _response.rawResponse,
|
|
75
|
+
});
|
|
76
|
+
case "timeout":
|
|
77
|
+
throw new errors.LarkTimeoutError("Timeout exceeded when calling GET /pricing-metrics.");
|
|
78
|
+
case "unknown":
|
|
79
|
+
throw new errors.LarkError({
|
|
80
|
+
message: _response.error.errorMessage,
|
|
81
|
+
rawResponse: _response.rawResponse,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
22
86
|
/**
|
|
23
87
|
* @param {Lark.CreatePricingMetricRequest} request
|
|
24
88
|
* @param {PricingMetrics.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -12,8 +12,8 @@ import * as Lark from "../../../../index.mjs";
|
|
|
12
12
|
export interface CreateRateCardRequest {
|
|
13
13
|
name: string;
|
|
14
14
|
description?: string;
|
|
15
|
-
usage_based_rates?: Lark.
|
|
16
|
-
fixed_rates?: Lark.
|
|
15
|
+
usage_based_rates?: Lark.CreateRateCardRequestUsageBasedRatesItem[];
|
|
16
|
+
fixed_rates?: Lark.CreateFixedRateRequest[];
|
|
17
17
|
billing_interval: CreateRateCardRequest.BillingInterval;
|
|
18
18
|
metadata?: Record<string, string>;
|
|
19
19
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Lark from "../../../index.mjs";
|
|
5
|
+
export type CreateRateCardRequestUsageBasedRatesItem = Lark.CreateRateCardRequestUsageBasedRatesItem.Simple;
|
|
6
|
+
export declare namespace CreateRateCardRequestUsageBasedRatesItem {
|
|
7
|
+
interface Simple extends Lark.CreateSimpleUsageBasedRateRequest {
|
|
8
|
+
usage_based_rate_type: "simple";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./CreateRateCardRequestUsageBasedRatesItem.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./CreateRateCardRequestUsageBasedRatesItem.mjs";
|
|
@@ -6,8 +6,12 @@
|
|
|
6
6
|
* {}
|
|
7
7
|
*/
|
|
8
8
|
export interface CreateSubjectRequest {
|
|
9
|
+
/** The ID of the subject in your system. If provided, you may use pass it to the API in place of the subject ID. Must be unique. */
|
|
9
10
|
external_id?: string;
|
|
11
|
+
/** The name of the subject. Used for display in the dashboard. */
|
|
10
12
|
name?: string;
|
|
13
|
+
/** The email of the subject. Must be a valid email address. */
|
|
11
14
|
email?: string;
|
|
15
|
+
/** Additional metadata about the subject. You may use this to store any custom data about the subject. */
|
|
12
16
|
metadata?: Record<string, string>;
|
|
13
17
|
}
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
* {}
|
|
7
7
|
*/
|
|
8
8
|
export interface UpdateSubjectRequest {
|
|
9
|
-
|
|
9
|
+
/** The name of the subject. Used for display in the dashboard. */
|
|
10
10
|
name?: string;
|
|
11
|
+
/** The email of the subject. Must be a valid email address. */
|
|
11
12
|
email?: string;
|
|
13
|
+
/** Additional metadata about the subject. You may use this to store any custom data about the subject. */
|
|
12
14
|
metadata?: Record<string, string | undefined>;
|
|
13
15
|
}
|
|
@@ -52,8 +52,8 @@ export declare class Subscriptions {
|
|
|
52
52
|
*
|
|
53
53
|
* @example
|
|
54
54
|
* await client.subscriptions.createSubscription({
|
|
55
|
-
* rate_card_id: "
|
|
56
|
-
* subject_id: "
|
|
55
|
+
* rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
|
|
56
|
+
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE"
|
|
57
57
|
* })
|
|
58
58
|
*/
|
|
59
59
|
createSubscription(request: Lark.CreateSubscriptionRequest, requestOptions?: Subscriptions.RequestOptions): core.HttpResponsePromise<Lark.SubscriptionResource>;
|
|
@@ -69,6 +69,32 @@ export declare class Subscriptions {
|
|
|
69
69
|
*/
|
|
70
70
|
getSubscription(subscriptionId: string, requestOptions?: Subscriptions.RequestOptions): core.HttpResponsePromise<Lark.SubscriptionResource>;
|
|
71
71
|
private __getSubscription;
|
|
72
|
+
/**
|
|
73
|
+
* @param {string} subscriptionId
|
|
74
|
+
* @param {Lark.CancelSubscriptionRequest} request
|
|
75
|
+
* @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration.
|
|
76
|
+
*
|
|
77
|
+
* @throws {@link Lark.UnprocessableEntityError}
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* await client.subscriptions.cancelSubscription("subscription_id")
|
|
81
|
+
*/
|
|
82
|
+
cancelSubscription(subscriptionId: string, request?: Lark.CancelSubscriptionRequest, requestOptions?: Subscriptions.RequestOptions): core.HttpResponsePromise<Lark.SubscriptionResource>;
|
|
83
|
+
private __cancelSubscription;
|
|
84
|
+
/**
|
|
85
|
+
* @param {string} subscriptionId
|
|
86
|
+
* @param {Lark.ChangeSubscriptionRateCardRequest} request
|
|
87
|
+
* @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration.
|
|
88
|
+
*
|
|
89
|
+
* @throws {@link Lark.UnprocessableEntityError}
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* await client.subscriptions.changeSubscriptionRateCard("subscription_id", {
|
|
93
|
+
* rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB"
|
|
94
|
+
* })
|
|
95
|
+
*/
|
|
96
|
+
changeSubscriptionRateCard(subscriptionId: string, request: Lark.ChangeSubscriptionRateCardRequest, requestOptions?: Subscriptions.RequestOptions): core.HttpResponsePromise<Lark.SubscriptionResource>;
|
|
97
|
+
private __changeSubscriptionRateCard;
|
|
72
98
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
73
99
|
"X-API-Key": string;
|
|
74
100
|
}>;
|
|
@@ -99,8 +99,8 @@ export class Subscriptions {
|
|
|
99
99
|
*
|
|
100
100
|
* @example
|
|
101
101
|
* await client.subscriptions.createSubscription({
|
|
102
|
-
* rate_card_id: "
|
|
103
|
-
* subject_id: "
|
|
102
|
+
* rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
|
|
103
|
+
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE"
|
|
104
104
|
* })
|
|
105
105
|
*/
|
|
106
106
|
createSubscription(request, requestOptions) {
|
|
@@ -211,6 +211,130 @@ export class Subscriptions {
|
|
|
211
211
|
}
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* @param {string} subscriptionId
|
|
216
|
+
* @param {Lark.CancelSubscriptionRequest} request
|
|
217
|
+
* @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration.
|
|
218
|
+
*
|
|
219
|
+
* @throws {@link Lark.UnprocessableEntityError}
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* await client.subscriptions.cancelSubscription("subscription_id")
|
|
223
|
+
*/
|
|
224
|
+
cancelSubscription(subscriptionId, request = {}, requestOptions) {
|
|
225
|
+
return core.HttpResponsePromise.fromPromise(this.__cancelSubscription(subscriptionId, request, requestOptions));
|
|
226
|
+
}
|
|
227
|
+
__cancelSubscription(subscriptionId_1) {
|
|
228
|
+
return __awaiter(this, arguments, void 0, function* (subscriptionId, request = {}, requestOptions) {
|
|
229
|
+
var _a, _b, _c;
|
|
230
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
231
|
+
const _response = yield core.fetcher({
|
|
232
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LarkEnvironment.Default, `subscriptions/${encodeURIComponent(subscriptionId)}/cancel`),
|
|
233
|
+
method: "POST",
|
|
234
|
+
headers: _headers,
|
|
235
|
+
contentType: "application/json",
|
|
236
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
237
|
+
requestType: "json",
|
|
238
|
+
body: request,
|
|
239
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
240
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
241
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
242
|
+
});
|
|
243
|
+
if (_response.ok) {
|
|
244
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
245
|
+
}
|
|
246
|
+
if (_response.error.reason === "status-code") {
|
|
247
|
+
switch (_response.error.statusCode) {
|
|
248
|
+
case 422:
|
|
249
|
+
throw new Lark.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
250
|
+
default:
|
|
251
|
+
throw new errors.LarkError({
|
|
252
|
+
statusCode: _response.error.statusCode,
|
|
253
|
+
body: _response.error.body,
|
|
254
|
+
rawResponse: _response.rawResponse,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
switch (_response.error.reason) {
|
|
259
|
+
case "non-json":
|
|
260
|
+
throw new errors.LarkError({
|
|
261
|
+
statusCode: _response.error.statusCode,
|
|
262
|
+
body: _response.error.rawBody,
|
|
263
|
+
rawResponse: _response.rawResponse,
|
|
264
|
+
});
|
|
265
|
+
case "timeout":
|
|
266
|
+
throw new errors.LarkTimeoutError("Timeout exceeded when calling POST /subscriptions/{subscription_id}/cancel.");
|
|
267
|
+
case "unknown":
|
|
268
|
+
throw new errors.LarkError({
|
|
269
|
+
message: _response.error.errorMessage,
|
|
270
|
+
rawResponse: _response.rawResponse,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* @param {string} subscriptionId
|
|
277
|
+
* @param {Lark.ChangeSubscriptionRateCardRequest} request
|
|
278
|
+
* @param {Subscriptions.RequestOptions} requestOptions - Request-specific configuration.
|
|
279
|
+
*
|
|
280
|
+
* @throws {@link Lark.UnprocessableEntityError}
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* await client.subscriptions.changeSubscriptionRateCard("subscription_id", {
|
|
284
|
+
* rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB"
|
|
285
|
+
* })
|
|
286
|
+
*/
|
|
287
|
+
changeSubscriptionRateCard(subscriptionId, request, requestOptions) {
|
|
288
|
+
return core.HttpResponsePromise.fromPromise(this.__changeSubscriptionRateCard(subscriptionId, request, requestOptions));
|
|
289
|
+
}
|
|
290
|
+
__changeSubscriptionRateCard(subscriptionId, request, requestOptions) {
|
|
291
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
292
|
+
var _a, _b, _c;
|
|
293
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
294
|
+
const _response = yield core.fetcher({
|
|
295
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LarkEnvironment.Default, `subscriptions/${encodeURIComponent(subscriptionId)}/change-rate-card`),
|
|
296
|
+
method: "POST",
|
|
297
|
+
headers: _headers,
|
|
298
|
+
contentType: "application/json",
|
|
299
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
300
|
+
requestType: "json",
|
|
301
|
+
body: request,
|
|
302
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
303
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
304
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
305
|
+
});
|
|
306
|
+
if (_response.ok) {
|
|
307
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
308
|
+
}
|
|
309
|
+
if (_response.error.reason === "status-code") {
|
|
310
|
+
switch (_response.error.statusCode) {
|
|
311
|
+
case 422:
|
|
312
|
+
throw new Lark.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
313
|
+
default:
|
|
314
|
+
throw new errors.LarkError({
|
|
315
|
+
statusCode: _response.error.statusCode,
|
|
316
|
+
body: _response.error.body,
|
|
317
|
+
rawResponse: _response.rawResponse,
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
switch (_response.error.reason) {
|
|
322
|
+
case "non-json":
|
|
323
|
+
throw new errors.LarkError({
|
|
324
|
+
statusCode: _response.error.statusCode,
|
|
325
|
+
body: _response.error.rawBody,
|
|
326
|
+
rawResponse: _response.rawResponse,
|
|
327
|
+
});
|
|
328
|
+
case "timeout":
|
|
329
|
+
throw new errors.LarkTimeoutError("Timeout exceeded when calling POST /subscriptions/{subscription_id}/change-rate-card.");
|
|
330
|
+
case "unknown":
|
|
331
|
+
throw new errors.LarkError({
|
|
332
|
+
message: _response.error.errorMessage,
|
|
333
|
+
rawResponse: _response.rawResponse,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
}
|
|
214
338
|
_getCustomAuthorizationHeaders() {
|
|
215
339
|
return __awaiter(this, void 0, void 0, function* () {
|
|
216
340
|
const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {}
|
|
7
|
+
*/
|
|
8
|
+
export interface CancelSubscriptionRequest {
|
|
9
|
+
/** The reason for cancelling the subscription. */
|
|
10
|
+
reason?: string;
|
|
11
|
+
/** Whether to cancel the subscription at end of cycle. */
|
|
12
|
+
cancel_at_end_of_cycle?: boolean;
|
|
13
|
+
}
|
package/dist/esm/api/resources/subscriptions/client/requests/CreateSubscriptionRequest.d.mts
CHANGED
|
@@ -4,12 +4,15 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
|
-
* rate_card_id: "
|
|
8
|
-
* subject_id: "
|
|
7
|
+
* rate_card_id: "rc_AJWMxR81jxoRlli6p13uf3JB",
|
|
8
|
+
* subject_id: "subj_VyX6Q96h5avMho8O7QWlKeXE"
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface CreateSubscriptionRequest {
|
|
12
|
+
/** The ID of the rate card to use for the subscription. */
|
|
12
13
|
rate_card_id: string;
|
|
14
|
+
/** The ID of the subject to create the subscription for. */
|
|
13
15
|
subject_id: string;
|
|
14
|
-
metadata
|
|
16
|
+
/** Additional metadata about the subscription. You may use this to store any custom data about the subscription. */
|
|
17
|
+
metadata?: Record<string, string>;
|
|
15
18
|
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { type ListSubscriptionsSubscriptionsGetRequest } from "./ListSubscriptionsSubscriptionsGetRequest.mjs";
|
|
2
2
|
export { type CreateSubscriptionRequest } from "./CreateSubscriptionRequest.mjs";
|
|
3
|
+
export { type CancelSubscriptionRequest } from "./CancelSubscriptionRequest.mjs";
|
|
4
|
+
export { type ChangeSubscriptionRateCardRequest } from "./ChangeSubscriptionRateCardRequest.mjs";
|