@paygentic/sdk 0.9.18 → 0.10.0
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 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/authorizationdenialreason.d.ts +17 -0
- package/dist/commonjs/models/authorizationdenialreason.d.ts.map +1 -0
- package/dist/commonjs/models/authorizationdenialreason.js +51 -0
- package/dist/commonjs/models/authorizationdenialreason.js.map +1 -0
- package/dist/commonjs/models/errors/error.d.ts +17 -0
- package/dist/commonjs/models/errors/error.d.ts.map +1 -1
- package/dist/commonjs/models/errors/error.js +8 -0
- package/dist/commonjs/models/errors/error.js.map +1 -1
- package/dist/commonjs/models/errors/recordinvoicepayment.d.ts +16 -0
- package/dist/commonjs/models/errors/recordinvoicepayment.d.ts.map +1 -1
- package/dist/commonjs/models/errors/recordinvoicepayment.js +7 -0
- package/dist/commonjs/models/errors/recordinvoicepayment.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +15 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +15 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/invoicelineitem.d.ts +5 -0
- package/dist/commonjs/models/invoicelineitem.d.ts.map +1 -1
- package/dist/commonjs/models/invoicelineitem.js +2 -0
- package/dist/commonjs/models/invoicelineitem.js.map +1 -1
- package/dist/commonjs/models/linecalculationcontribution.d.ts +12 -0
- package/dist/commonjs/models/linecalculationcontribution.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationcontribution.js +52 -0
- package/dist/commonjs/models/linecalculationcontribution.js.map +1 -0
- package/dist/commonjs/models/linecalculationgiven.d.ts +20 -0
- package/dist/commonjs/models/linecalculationgiven.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationgiven.js +51 -0
- package/dist/commonjs/models/linecalculationgiven.js.map +1 -0
- package/dist/commonjs/models/linecalculationinputprice.d.ts +21 -0
- package/dist/commonjs/models/linecalculationinputprice.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationinputprice.js +52 -0
- package/dist/commonjs/models/linecalculationinputprice.js.map +1 -0
- package/dist/commonjs/models/linecalculationinputs.d.ts +34 -0
- package/dist/commonjs/models/linecalculationinputs.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationinputs.js +56 -0
- package/dist/commonjs/models/linecalculationinputs.js.map +1 -0
- package/dist/commonjs/models/linecalculationnotapplied.d.ts +20 -0
- package/dist/commonjs/models/linecalculationnotapplied.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationnotapplied.js +51 -0
- package/dist/commonjs/models/linecalculationnotapplied.js.map +1 -0
- package/dist/commonjs/models/linecalculationperiod.d.ts +14 -0
- package/dist/commonjs/models/linecalculationperiod.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationperiod.js +51 -0
- package/dist/commonjs/models/linecalculationperiod.js.map +1 -0
- package/dist/commonjs/models/linecalculationprecision.d.ts +14 -0
- package/dist/commonjs/models/linecalculationprecision.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationprecision.js +51 -0
- package/dist/commonjs/models/linecalculationprecision.js.map +1 -0
- package/dist/commonjs/models/linecalculationpriceband.d.ts +11 -0
- package/dist/commonjs/models/linecalculationpriceband.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationpriceband.js +51 -0
- package/dist/commonjs/models/linecalculationpriceband.js.map +1 -0
- package/dist/commonjs/models/linecalculationpricefn.d.ts +40 -0
- package/dist/commonjs/models/linecalculationpricefn.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationpricefn.js +56 -0
- package/dist/commonjs/models/linecalculationpricefn.js.map +1 -0
- package/dist/commonjs/models/linecalculationresult.d.ts +24 -0
- package/dist/commonjs/models/linecalculationresult.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationresult.js +52 -0
- package/dist/commonjs/models/linecalculationresult.js.map +1 -0
- package/dist/commonjs/models/linecalculationsource.d.ts +32 -0
- package/dist/commonjs/models/linecalculationsource.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationsource.js +53 -0
- package/dist/commonjs/models/linecalculationsource.js.map +1 -0
- package/dist/commonjs/models/linecalculationstep.d.ts +50 -0
- package/dist/commonjs/models/linecalculationstep.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationstep.js +59 -0
- package/dist/commonjs/models/linecalculationstep.js.map +1 -0
- package/dist/commonjs/models/linecalculationvalue.d.ts +12 -0
- package/dist/commonjs/models/linecalculationvalue.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationvalue.js +49 -0
- package/dist/commonjs/models/linecalculationvalue.js.map +1 -0
- package/dist/commonjs/models/lineitem.d.ts +5 -0
- package/dist/commonjs/models/lineitem.d.ts.map +1 -1
- package/dist/commonjs/models/lineitem.js +2 -0
- package/dist/commonjs/models/lineitem.js.map +1 -1
- package/dist/commonjs/models/lineprovenance.d.ts +69 -0
- package/dist/commonjs/models/lineprovenance.d.ts.map +1 -0
- package/dist/commonjs/models/lineprovenance.js +68 -0
- package/dist/commonjs/models/lineprovenance.js.map +1 -0
- package/dist/commonjs/models/operations/getinvoice.d.ts +1 -1
- package/dist/commonjs/models/operations/getinvoicelineitems.d.ts +1 -1
- package/dist/commonjs/models/operations/listlineitems.d.ts +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/authorizationdenialreason.d.ts +17 -0
- package/dist/esm/models/authorizationdenialreason.d.ts.map +1 -0
- package/dist/esm/models/authorizationdenialreason.js +15 -0
- package/dist/esm/models/authorizationdenialreason.js.map +1 -0
- package/dist/esm/models/errors/error.d.ts +17 -0
- package/dist/esm/models/errors/error.d.ts.map +1 -1
- package/dist/esm/models/errors/error.js +8 -0
- package/dist/esm/models/errors/error.js.map +1 -1
- package/dist/esm/models/errors/recordinvoicepayment.d.ts +16 -0
- package/dist/esm/models/errors/recordinvoicepayment.d.ts.map +1 -1
- package/dist/esm/models/errors/recordinvoicepayment.js +7 -0
- package/dist/esm/models/errors/recordinvoicepayment.js.map +1 -1
- package/dist/esm/models/index.d.ts +15 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +15 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/invoicelineitem.d.ts +5 -0
- package/dist/esm/models/invoicelineitem.d.ts.map +1 -1
- package/dist/esm/models/invoicelineitem.js +2 -0
- package/dist/esm/models/invoicelineitem.js.map +1 -1
- package/dist/esm/models/linecalculationcontribution.d.ts +12 -0
- package/dist/esm/models/linecalculationcontribution.d.ts.map +1 -0
- package/dist/esm/models/linecalculationcontribution.js +15 -0
- package/dist/esm/models/linecalculationcontribution.js.map +1 -0
- package/dist/esm/models/linecalculationgiven.d.ts +20 -0
- package/dist/esm/models/linecalculationgiven.d.ts.map +1 -0
- package/dist/esm/models/linecalculationgiven.js +14 -0
- package/dist/esm/models/linecalculationgiven.js.map +1 -0
- package/dist/esm/models/linecalculationinputprice.d.ts +21 -0
- package/dist/esm/models/linecalculationinputprice.d.ts.map +1 -0
- package/dist/esm/models/linecalculationinputprice.js +15 -0
- package/dist/esm/models/linecalculationinputprice.js.map +1 -0
- package/dist/esm/models/linecalculationinputs.d.ts +34 -0
- package/dist/esm/models/linecalculationinputs.d.ts.map +1 -0
- package/dist/esm/models/linecalculationinputs.js +19 -0
- package/dist/esm/models/linecalculationinputs.js.map +1 -0
- package/dist/esm/models/linecalculationnotapplied.d.ts +20 -0
- package/dist/esm/models/linecalculationnotapplied.d.ts.map +1 -0
- package/dist/esm/models/linecalculationnotapplied.js +14 -0
- package/dist/esm/models/linecalculationnotapplied.js.map +1 -0
- package/dist/esm/models/linecalculationperiod.d.ts +14 -0
- package/dist/esm/models/linecalculationperiod.d.ts.map +1 -0
- package/dist/esm/models/linecalculationperiod.js +14 -0
- package/dist/esm/models/linecalculationperiod.js.map +1 -0
- package/dist/esm/models/linecalculationprecision.d.ts +14 -0
- package/dist/esm/models/linecalculationprecision.d.ts.map +1 -0
- package/dist/esm/models/linecalculationprecision.js +14 -0
- package/dist/esm/models/linecalculationprecision.js.map +1 -0
- package/dist/esm/models/linecalculationpriceband.d.ts +11 -0
- package/dist/esm/models/linecalculationpriceband.d.ts.map +1 -0
- package/dist/esm/models/linecalculationpriceband.js +14 -0
- package/dist/esm/models/linecalculationpriceband.js.map +1 -0
- package/dist/esm/models/linecalculationpricefn.d.ts +40 -0
- package/dist/esm/models/linecalculationpricefn.d.ts.map +1 -0
- package/dist/esm/models/linecalculationpricefn.js +19 -0
- package/dist/esm/models/linecalculationpricefn.js.map +1 -0
- package/dist/esm/models/linecalculationresult.d.ts +24 -0
- package/dist/esm/models/linecalculationresult.d.ts.map +1 -0
- package/dist/esm/models/linecalculationresult.js +15 -0
- package/dist/esm/models/linecalculationresult.js.map +1 -0
- package/dist/esm/models/linecalculationsource.d.ts +32 -0
- package/dist/esm/models/linecalculationsource.d.ts.map +1 -0
- package/dist/esm/models/linecalculationsource.js +16 -0
- package/dist/esm/models/linecalculationsource.js.map +1 -0
- package/dist/esm/models/linecalculationstep.d.ts +50 -0
- package/dist/esm/models/linecalculationstep.d.ts.map +1 -0
- package/dist/esm/models/linecalculationstep.js +22 -0
- package/dist/esm/models/linecalculationstep.js.map +1 -0
- package/dist/esm/models/linecalculationvalue.d.ts +12 -0
- package/dist/esm/models/linecalculationvalue.d.ts.map +1 -0
- package/dist/esm/models/linecalculationvalue.js +12 -0
- package/dist/esm/models/linecalculationvalue.js.map +1 -0
- package/dist/esm/models/lineitem.d.ts +5 -0
- package/dist/esm/models/lineitem.d.ts.map +1 -1
- package/dist/esm/models/lineitem.js +2 -0
- package/dist/esm/models/lineitem.js.map +1 -1
- package/dist/esm/models/lineprovenance.d.ts +69 -0
- package/dist/esm/models/lineprovenance.d.ts.map +1 -0
- package/dist/esm/models/lineprovenance.js +31 -0
- package/dist/esm/models/lineprovenance.js.map +1 -0
- package/dist/esm/models/operations/getinvoice.d.ts +1 -1
- package/dist/esm/models/operations/getinvoicelineitems.d.ts +1 -1
- package/dist/esm/models/operations/listlineitems.d.ts +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/authorizationdenialreason.ts +26 -0
- package/src/models/errors/error.ts +23 -0
- package/src/models/errors/recordinvoicepayment.ts +22 -0
- package/src/models/index.ts +15 -0
- package/src/models/invoicelineitem.ts +9 -0
- package/src/models/linecalculationcontribution.ts +35 -0
- package/src/models/linecalculationgiven.ts +42 -0
- package/src/models/linecalculationinputprice.ts +46 -0
- package/src/models/linecalculationinputs.ts +65 -0
- package/src/models/linecalculationnotapplied.ts +42 -0
- package/src/models/linecalculationperiod.ts +36 -0
- package/src/models/linecalculationprecision.ts +36 -0
- package/src/models/linecalculationpriceband.ts +33 -0
- package/src/models/linecalculationpricefn.ts +74 -0
- package/src/models/linecalculationresult.ts +47 -0
- package/src/models/linecalculationsource.ts +52 -0
- package/src/models/linecalculationstep.ts +80 -0
- package/src/models/linecalculationvalue.ts +34 -0
- package/src/models/lineitem.ts +9 -0
- package/src/models/lineprovenance.ts +122 -0
- package/src/models/operations/getinvoice.ts +1 -1
- package/src/models/operations/getinvoicelineitems.ts +1 -1
- package/src/models/operations/listlineitems.ts +1 -1
|
@@ -5,7 +5,7 @@ export type GetInvoiceRequest = {
|
|
|
5
5
|
*/
|
|
6
6
|
id: string;
|
|
7
7
|
/**
|
|
8
|
-
* Comma-separated list of fields to expand. Supports: lineItems, items. `items` resolves each returned line's item and its external accounting codes into an `items` collection inside the lineItems block; because those ids come from the lines, requesting `items` also expands `lineItems` on its default paging.
|
|
8
|
+
* Comma-separated list of fields to expand. Supports: lineItems, items, lineProvenance. `items` resolves each returned line's item and its external accounting codes into an `items` collection inside the lineItems block; because those ids come from the lines, requesting `items` also expands `lineItems` on its default paging. `lineProvenance` adds `provenance` to each returned line: how its amount before tax was calculated. It also expands `lineItems`.
|
|
9
9
|
*/
|
|
10
10
|
expand?: string | undefined;
|
|
11
11
|
/**
|
|
@@ -13,7 +13,7 @@ export type GetInvoiceLineItemsRequest = {
|
|
|
13
13
|
*/
|
|
14
14
|
pageToken?: string | undefined;
|
|
15
15
|
/**
|
|
16
|
-
* Comma-separated list of fields to expand. Supports: items
|
|
16
|
+
* Comma-separated list of fields to expand. Supports: items, lineProvenance. `items` resolves each returned line's item and that item's external accounting codes into an `items` collection, so a line can be translated to a GL/SKU code without a second call. `lineProvenance` adds `provenance` to each returned line: how its amount before tax was calculated.
|
|
17
17
|
*/
|
|
18
18
|
expand?: string | undefined;
|
|
19
19
|
/**
|
|
@@ -25,7 +25,7 @@ export type ListLineItemsRequest = {
|
|
|
25
25
|
*/
|
|
26
26
|
invoiceId?: string | undefined;
|
|
27
27
|
/**
|
|
28
|
-
* Comma-separated list of fields to expand. Supports: items
|
|
28
|
+
* Comma-separated list of fields to expand. Supports: items, lineProvenance. `items` resolves each returned line's item and that item's external accounting codes into an `items` collection, so a line can be translated to a GL/SKU code without a second call. `lineProvenance` adds `provenance` to each returned line: how its amount before tax was calculated.
|
|
29
29
|
*/
|
|
30
30
|
expand?: string | undefined;
|
|
31
31
|
/**
|
package/jsr.json
CHANGED
package/package.json
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "0.1.0",
|
|
68
|
-
sdkVersion: "0.
|
|
68
|
+
sdkVersion: "0.10.0",
|
|
69
69
|
genVersion: "2.879.13",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.10.0 2.879.13 0.1.0 @paygentic/sdk",
|
|
71
71
|
} as const;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
|
|
10
|
+
*/
|
|
11
|
+
export const AuthorizationDenialReason = {
|
|
12
|
+
NoPermission: "no_permission",
|
|
13
|
+
InsufficientScope: "insufficient_scope",
|
|
14
|
+
NotMember: "not_member",
|
|
15
|
+
} as const;
|
|
16
|
+
/**
|
|
17
|
+
* Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
|
|
18
|
+
*/
|
|
19
|
+
export type AuthorizationDenialReason = ClosedEnum<
|
|
20
|
+
typeof AuthorizationDenialReason
|
|
21
|
+
>;
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const AuthorizationDenialReason$inboundSchema: z.ZodNativeEnum<
|
|
25
|
+
typeof AuthorizationDenialReason
|
|
26
|
+
> = z.nativeEnum(AuthorizationDenialReason);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
+
import * as models from "../index.js";
|
|
6
7
|
import { PaygenticError } from "./paygenticerror.js";
|
|
7
8
|
|
|
8
9
|
export type ErrorTData = {
|
|
@@ -22,6 +23,14 @@ export type ErrorTData = {
|
|
|
22
23
|
* Additional error details
|
|
23
24
|
*/
|
|
24
25
|
details?: { [k: string]: any } | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
|
|
28
|
+
*/
|
|
29
|
+
reason?: models.AuthorizationDenialReason | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Present on a 403 from the authorization check. The permissions the caller needs for this request.
|
|
32
|
+
*/
|
|
33
|
+
requiredPermissions?: Array<string> | undefined;
|
|
25
34
|
};
|
|
26
35
|
|
|
27
36
|
export class ErrorT extends PaygenticError {
|
|
@@ -37,6 +46,14 @@ export class ErrorT extends PaygenticError {
|
|
|
37
46
|
* Additional error details
|
|
38
47
|
*/
|
|
39
48
|
details?: { [k: string]: any } | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
|
|
51
|
+
*/
|
|
52
|
+
reason?: models.AuthorizationDenialReason | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Present on a 403 from the authorization check. The permissions the caller needs for this request.
|
|
55
|
+
*/
|
|
56
|
+
requiredPermissions?: Array<string> | undefined;
|
|
40
57
|
|
|
41
58
|
/** The original data that was passed to this error instance. */
|
|
42
59
|
data$: ErrorTData;
|
|
@@ -51,6 +68,10 @@ export class ErrorT extends PaygenticError {
|
|
|
51
68
|
if (err.error != null) this.error = err.error;
|
|
52
69
|
if (err.code != null) this.code = err.code;
|
|
53
70
|
if (err.details != null) this.details = err.details;
|
|
71
|
+
if (err.reason != null) this.reason = err.reason;
|
|
72
|
+
if (err.requiredPermissions != null) {
|
|
73
|
+
this.requiredPermissions = err.requiredPermissions;
|
|
74
|
+
}
|
|
54
75
|
|
|
55
76
|
this.name = "ErrorT";
|
|
56
77
|
}
|
|
@@ -63,6 +84,8 @@ export const ErrorT$inboundSchema: z.ZodType<ErrorT, z.ZodTypeDef, unknown> = z
|
|
|
63
84
|
message: z.string(),
|
|
64
85
|
code: z.string().optional(),
|
|
65
86
|
details: z.record(z.any()).optional(),
|
|
87
|
+
reason: models.AuthorizationDenialReason$inboundSchema.optional(),
|
|
88
|
+
requiredPermissions: z.array(z.string()).optional(),
|
|
66
89
|
request$: z.instanceof(Request),
|
|
67
90
|
response$: z.instanceof(Response),
|
|
68
91
|
body$: z.string(),
|
|
@@ -26,6 +26,14 @@ export type UnprocessableEntityErrorData = {
|
|
|
26
26
|
* Additional error details
|
|
27
27
|
*/
|
|
28
28
|
details?: { [k: string]: any } | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
|
|
31
|
+
*/
|
|
32
|
+
reason?: models.AuthorizationDenialReason | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Present on a 403 from the authorization check. The permissions the caller needs for this request.
|
|
35
|
+
*/
|
|
36
|
+
requiredPermissions?: Array<string> | undefined;
|
|
29
37
|
};
|
|
30
38
|
|
|
31
39
|
/**
|
|
@@ -44,6 +52,14 @@ export class UnprocessableEntityError extends PaygenticError {
|
|
|
44
52
|
* Additional error details
|
|
45
53
|
*/
|
|
46
54
|
details?: { [k: string]: any } | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
|
|
57
|
+
*/
|
|
58
|
+
reason?: models.AuthorizationDenialReason | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Present on a 403 from the authorization check. The permissions the caller needs for this request.
|
|
61
|
+
*/
|
|
62
|
+
requiredPermissions?: Array<string> | undefined;
|
|
47
63
|
|
|
48
64
|
/** The original data that was passed to this error instance. */
|
|
49
65
|
data$: UnprocessableEntityErrorData;
|
|
@@ -58,6 +74,10 @@ export class UnprocessableEntityError extends PaygenticError {
|
|
|
58
74
|
this.error = err.error;
|
|
59
75
|
this.code = err.code;
|
|
60
76
|
if (err.details != null) this.details = err.details;
|
|
77
|
+
if (err.reason != null) this.reason = err.reason;
|
|
78
|
+
if (err.requiredPermissions != null) {
|
|
79
|
+
this.requiredPermissions = err.requiredPermissions;
|
|
80
|
+
}
|
|
61
81
|
|
|
62
82
|
this.name = "UnprocessableEntityError";
|
|
63
83
|
}
|
|
@@ -73,6 +93,8 @@ export const UnprocessableEntityError$inboundSchema: z.ZodType<
|
|
|
73
93
|
message: z.string(),
|
|
74
94
|
code: models.InvoicePaymentLinkErrorCode$inboundSchema,
|
|
75
95
|
details: z.record(z.any()).optional(),
|
|
96
|
+
reason: models.AuthorizationDenialReason$inboundSchema.optional(),
|
|
97
|
+
requiredPermissions: z.array(z.string()).optional(),
|
|
76
98
|
request$: z.instanceof(Request),
|
|
77
99
|
response$: z.instanceof(Response),
|
|
78
100
|
body$: z.string(),
|
package/src/models/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./accountfigure.js";
|
|
|
6
6
|
export * from "./address.js";
|
|
7
7
|
export * from "./approval.js";
|
|
8
8
|
export * from "./approvallist.js";
|
|
9
|
+
export * from "./authorizationdenialreason.js";
|
|
9
10
|
export * from "./billablemetric.js";
|
|
10
11
|
export * from "./billingschedule.js";
|
|
11
12
|
export * from "./booleanentitlementdetail.js";
|
|
@@ -61,9 +62,23 @@ export * from "./invoicerefundlist.js";
|
|
|
61
62
|
export * from "./invoicesummary.js";
|
|
62
63
|
export * from "./issueentitlementrequest.js";
|
|
63
64
|
export * from "./item.js";
|
|
65
|
+
export * from "./linecalculationcontribution.js";
|
|
66
|
+
export * from "./linecalculationgiven.js";
|
|
67
|
+
export * from "./linecalculationinputprice.js";
|
|
68
|
+
export * from "./linecalculationinputs.js";
|
|
69
|
+
export * from "./linecalculationnotapplied.js";
|
|
70
|
+
export * from "./linecalculationperiod.js";
|
|
71
|
+
export * from "./linecalculationprecision.js";
|
|
72
|
+
export * from "./linecalculationpriceband.js";
|
|
73
|
+
export * from "./linecalculationpricefn.js";
|
|
74
|
+
export * from "./linecalculationresult.js";
|
|
75
|
+
export * from "./linecalculationsource.js";
|
|
76
|
+
export * from "./linecalculationstep.js";
|
|
77
|
+
export * from "./linecalculationvalue.js";
|
|
64
78
|
export * from "./lineitem.js";
|
|
65
79
|
export * from "./lineitemsresponse.js";
|
|
66
80
|
export * from "./lineitemssummary.js";
|
|
81
|
+
export * from "./lineprovenance.js";
|
|
67
82
|
export * from "./mappingcapabilities.js";
|
|
68
83
|
export * from "./merchantintegration.js";
|
|
69
84
|
export * from "./merchantintegrationprovider.js";
|
|
@@ -7,6 +7,10 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
7
7
|
import { ClosedEnum } from "../types/enums.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
LineProvenance,
|
|
12
|
+
LineProvenance$inboundSchema,
|
|
13
|
+
} from "./lineprovenance.js";
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
16
|
* Type of event: 'usage' for billable metric events, 'fee' for fee events, 'discount' for grant discount line items (subtotal/total are negative, representing a credit)
|
|
@@ -134,6 +138,10 @@ export type InvoiceLineItem = {
|
|
|
134
138
|
* Unit price in decimal dollars
|
|
135
139
|
*/
|
|
136
140
|
unitPrice: string;
|
|
141
|
+
/**
|
|
142
|
+
* How the line's amount before tax was calculated: a trace of one evaluation, saved when the invoice was calculated and fixed once it is issued. Returned only with `expand=lineProvenance`. Every field but `status` is present when `status` is `recorded`. Every number is a plain decimal string.
|
|
143
|
+
*/
|
|
144
|
+
provenance?: LineProvenance | undefined;
|
|
137
145
|
};
|
|
138
146
|
|
|
139
147
|
/** @internal */
|
|
@@ -179,6 +187,7 @@ export const InvoiceLineItem$inboundSchema: z.ZodType<
|
|
|
179
187
|
totalPrice: z.string(),
|
|
180
188
|
totalTax: z.string(),
|
|
181
189
|
unitPrice: z.string(),
|
|
190
|
+
provenance: LineProvenance$inboundSchema.optional(),
|
|
182
191
|
});
|
|
183
192
|
|
|
184
193
|
export function invoiceLineItemFromJSON(
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type LineCalculationContribution = {
|
|
11
|
+
lineItemId: string;
|
|
12
|
+
value: string;
|
|
13
|
+
share: string | null;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const LineCalculationContribution$inboundSchema: z.ZodType<
|
|
18
|
+
LineCalculationContribution,
|
|
19
|
+
z.ZodTypeDef,
|
|
20
|
+
unknown
|
|
21
|
+
> = z.object({
|
|
22
|
+
lineItemId: z.string(),
|
|
23
|
+
value: z.string(),
|
|
24
|
+
share: z.nullable(z.string()),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export function lineCalculationContributionFromJSON(
|
|
28
|
+
jsonString: string,
|
|
29
|
+
): SafeParseResult<LineCalculationContribution, SDKValidationError> {
|
|
30
|
+
return safeParse(
|
|
31
|
+
jsonString,
|
|
32
|
+
(x) => LineCalculationContribution$inboundSchema.parse(JSON.parse(x)),
|
|
33
|
+
`Failed to parse 'LineCalculationContribution' from JSON`,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A value the evaluation started from, and its source.
|
|
12
|
+
*/
|
|
13
|
+
export type LineCalculationGiven = {
|
|
14
|
+
/**
|
|
15
|
+
* The value.
|
|
16
|
+
*/
|
|
17
|
+
value: string;
|
|
18
|
+
/**
|
|
19
|
+
* The key of the source in `sources` that stated it.
|
|
20
|
+
*/
|
|
21
|
+
source: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const LineCalculationGiven$inboundSchema: z.ZodType<
|
|
26
|
+
LineCalculationGiven,
|
|
27
|
+
z.ZodTypeDef,
|
|
28
|
+
unknown
|
|
29
|
+
> = z.object({
|
|
30
|
+
value: z.string(),
|
|
31
|
+
source: z.string(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export function lineCalculationGivenFromJSON(
|
|
35
|
+
jsonString: string,
|
|
36
|
+
): SafeParseResult<LineCalculationGiven, SDKValidationError> {
|
|
37
|
+
return safeParse(
|
|
38
|
+
jsonString,
|
|
39
|
+
(x) => LineCalculationGiven$inboundSchema.parse(JSON.parse(x)),
|
|
40
|
+
`Failed to parse 'LineCalculationGiven' from JSON`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
LineCalculationPriceFn,
|
|
11
|
+
LineCalculationPriceFn$inboundSchema,
|
|
12
|
+
} from "./linecalculationpricefn.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* `priced` only: the price as a function, and its source.
|
|
16
|
+
*/
|
|
17
|
+
export type LineCalculationInputPrice = {
|
|
18
|
+
/**
|
|
19
|
+
* A price as a function from quantity to money. A new model may carry fields not listed here.
|
|
20
|
+
*/
|
|
21
|
+
fn: LineCalculationPriceFn;
|
|
22
|
+
/**
|
|
23
|
+
* The key of the source in `sources` that stated the price.
|
|
24
|
+
*/
|
|
25
|
+
source: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const LineCalculationInputPrice$inboundSchema: z.ZodType<
|
|
30
|
+
LineCalculationInputPrice,
|
|
31
|
+
z.ZodTypeDef,
|
|
32
|
+
unknown
|
|
33
|
+
> = z.object({
|
|
34
|
+
fn: LineCalculationPriceFn$inboundSchema,
|
|
35
|
+
source: z.string(),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export function lineCalculationInputPriceFromJSON(
|
|
39
|
+
jsonString: string,
|
|
40
|
+
): SafeParseResult<LineCalculationInputPrice, SDKValidationError> {
|
|
41
|
+
return safeParse(
|
|
42
|
+
jsonString,
|
|
43
|
+
(x) => LineCalculationInputPrice$inboundSchema.parse(JSON.parse(x)),
|
|
44
|
+
`Failed to parse 'LineCalculationInputPrice' from JSON`,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
LineCalculationGiven,
|
|
11
|
+
LineCalculationGiven$inboundSchema,
|
|
12
|
+
} from "./linecalculationgiven.js";
|
|
13
|
+
import {
|
|
14
|
+
LineCalculationInputPrice,
|
|
15
|
+
LineCalculationInputPrice$inboundSchema,
|
|
16
|
+
} from "./linecalculationinputprice.js";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The values the evaluation started from.
|
|
20
|
+
*/
|
|
21
|
+
export type LineCalculationInputs = {
|
|
22
|
+
/**
|
|
23
|
+
* `priced`: a charge from a price, with `quantity`, `selector` and `price`. `fromLine`: a line whose base is another line's amount, with `amount`. `given`: an amount nobody priced on this run, with `amount`. An open set, so it is a string rather than an enum: known values are `priced`, `fromLine`, `given`, and new values may be added.
|
|
24
|
+
*/
|
|
25
|
+
kind: string;
|
|
26
|
+
/**
|
|
27
|
+
* A value the evaluation started from, and its source.
|
|
28
|
+
*/
|
|
29
|
+
quantity?: LineCalculationGiven | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* A value the evaluation started from, and its source.
|
|
32
|
+
*/
|
|
33
|
+
selector?: LineCalculationGiven | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* `priced` only: the price as a function, and its source.
|
|
36
|
+
*/
|
|
37
|
+
price?: LineCalculationInputPrice | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* A value the evaluation started from, and its source.
|
|
40
|
+
*/
|
|
41
|
+
amount?: LineCalculationGiven | undefined;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const LineCalculationInputs$inboundSchema: z.ZodType<
|
|
46
|
+
LineCalculationInputs,
|
|
47
|
+
z.ZodTypeDef,
|
|
48
|
+
unknown
|
|
49
|
+
> = z.object({
|
|
50
|
+
kind: z.string(),
|
|
51
|
+
quantity: LineCalculationGiven$inboundSchema.optional(),
|
|
52
|
+
selector: LineCalculationGiven$inboundSchema.optional(),
|
|
53
|
+
price: LineCalculationInputPrice$inboundSchema.optional(),
|
|
54
|
+
amount: LineCalculationGiven$inboundSchema.optional(),
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export function lineCalculationInputsFromJSON(
|
|
58
|
+
jsonString: string,
|
|
59
|
+
): SafeParseResult<LineCalculationInputs, SDKValidationError> {
|
|
60
|
+
return safeParse(
|
|
61
|
+
jsonString,
|
|
62
|
+
(x) => LineCalculationInputs$inboundSchema.parse(JSON.parse(x)),
|
|
63
|
+
`Failed to parse 'LineCalculationInputs' from JSON`,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A rule in force for the line that did not change it.
|
|
12
|
+
*/
|
|
13
|
+
export type LineCalculationNotApplied = {
|
|
14
|
+
/**
|
|
15
|
+
* The key of the rule's source in `sources`.
|
|
16
|
+
*/
|
|
17
|
+
source: string;
|
|
18
|
+
/**
|
|
19
|
+
* Why the rule did not change the line, for example `within` or `notBinding`.
|
|
20
|
+
*/
|
|
21
|
+
reason: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const LineCalculationNotApplied$inboundSchema: z.ZodType<
|
|
26
|
+
LineCalculationNotApplied,
|
|
27
|
+
z.ZodTypeDef,
|
|
28
|
+
unknown
|
|
29
|
+
> = z.object({
|
|
30
|
+
source: z.string(),
|
|
31
|
+
reason: z.string(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export function lineCalculationNotAppliedFromJSON(
|
|
35
|
+
jsonString: string,
|
|
36
|
+
): SafeParseResult<LineCalculationNotApplied, SDKValidationError> {
|
|
37
|
+
return safeParse(
|
|
38
|
+
jsonString,
|
|
39
|
+
(x) => LineCalculationNotApplied$inboundSchema.parse(JSON.parse(x)),
|
|
40
|
+
`Failed to parse 'LineCalculationNotApplied' from JSON`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The period the line bills.
|
|
12
|
+
*/
|
|
13
|
+
export type LineCalculationPeriod = {
|
|
14
|
+
start: Date;
|
|
15
|
+
end: Date;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const LineCalculationPeriod$inboundSchema: z.ZodType<
|
|
20
|
+
LineCalculationPeriod,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
start: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
25
|
+
end: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export function lineCalculationPeriodFromJSON(
|
|
29
|
+
jsonString: string,
|
|
30
|
+
): SafeParseResult<LineCalculationPeriod, SDKValidationError> {
|
|
31
|
+
return safeParse(
|
|
32
|
+
jsonString,
|
|
33
|
+
(x) => LineCalculationPeriod$inboundSchema.parse(JSON.parse(x)),
|
|
34
|
+
`Failed to parse 'LineCalculationPeriod' from JSON`,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The default arithmetic of every step. Any other rounding is an explicit `round` step.
|
|
12
|
+
*/
|
|
13
|
+
export type LineCalculationPrecision = {
|
|
14
|
+
significantDigits: number;
|
|
15
|
+
rounding: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const LineCalculationPrecision$inboundSchema: z.ZodType<
|
|
20
|
+
LineCalculationPrecision,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
significantDigits: z.number().int(),
|
|
25
|
+
rounding: z.string(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export function lineCalculationPrecisionFromJSON(
|
|
29
|
+
jsonString: string,
|
|
30
|
+
): SafeParseResult<LineCalculationPrecision, SDKValidationError> {
|
|
31
|
+
return safeParse(
|
|
32
|
+
jsonString,
|
|
33
|
+
(x) => LineCalculationPrecision$inboundSchema.parse(JSON.parse(x)),
|
|
34
|
+
`Failed to parse 'LineCalculationPrecision' from JSON`,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type LineCalculationPriceBand = {
|
|
11
|
+
upTo: string | null;
|
|
12
|
+
rate: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const LineCalculationPriceBand$inboundSchema: z.ZodType<
|
|
17
|
+
LineCalculationPriceBand,
|
|
18
|
+
z.ZodTypeDef,
|
|
19
|
+
unknown
|
|
20
|
+
> = z.object({
|
|
21
|
+
upTo: z.nullable(z.string()),
|
|
22
|
+
rate: z.string(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export function lineCalculationPriceBandFromJSON(
|
|
26
|
+
jsonString: string,
|
|
27
|
+
): SafeParseResult<LineCalculationPriceBand, SDKValidationError> {
|
|
28
|
+
return safeParse(
|
|
29
|
+
jsonString,
|
|
30
|
+
(x) => LineCalculationPriceBand$inboundSchema.parse(JSON.parse(x)),
|
|
31
|
+
`Failed to parse 'LineCalculationPriceBand' from JSON`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import {
|
|
7
|
+
collectExtraKeys as collectExtraKeys$,
|
|
8
|
+
safeParse,
|
|
9
|
+
} from "../lib/schemas.js";
|
|
10
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
11
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
12
|
+
import {
|
|
13
|
+
LineCalculationPriceBand,
|
|
14
|
+
LineCalculationPriceBand$inboundSchema,
|
|
15
|
+
} from "./linecalculationpriceband.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A price as a function from quantity to money. A new model may carry fields not listed here.
|
|
19
|
+
*/
|
|
20
|
+
export type LineCalculationPriceFn = {
|
|
21
|
+
/**
|
|
22
|
+
* `unit`: `rate` per unit. `volume`: `bands`, each with `upTo` (null for the open band) and `rate`; one band prices every unit. `percentage`: `rate` as a fraction, with `min` and `max` charge or null. `flat`: one `amount`. `dynamic`: the quantity is already money. An open set, so it is a string rather than an enum: known values are `unit`, `volume`, `percentage`, `flat`, `dynamic`, and new values may be added.
|
|
23
|
+
*/
|
|
24
|
+
model: string;
|
|
25
|
+
/**
|
|
26
|
+
* `unit`, `percentage`: the rate.
|
|
27
|
+
*/
|
|
28
|
+
rate?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* `volume` only: the bands in ascending order.
|
|
31
|
+
*/
|
|
32
|
+
bands?: Array<LineCalculationPriceBand> | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* `percentage` only: the minimum charge, or null.
|
|
35
|
+
*/
|
|
36
|
+
min?: string | null | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* `percentage` only: the maximum charge, or null.
|
|
39
|
+
*/
|
|
40
|
+
max?: string | null | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* `flat` only: the amount for the period.
|
|
43
|
+
*/
|
|
44
|
+
amount?: string | undefined;
|
|
45
|
+
additionalProperties?: { [k: string]: any } | undefined;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const LineCalculationPriceFn$inboundSchema: z.ZodType<
|
|
50
|
+
LineCalculationPriceFn,
|
|
51
|
+
z.ZodTypeDef,
|
|
52
|
+
unknown
|
|
53
|
+
> = collectExtraKeys$(
|
|
54
|
+
z.object({
|
|
55
|
+
model: z.string(),
|
|
56
|
+
rate: z.string().optional(),
|
|
57
|
+
bands: z.array(LineCalculationPriceBand$inboundSchema).optional(),
|
|
58
|
+
min: z.nullable(z.string()).optional(),
|
|
59
|
+
max: z.nullable(z.string()).optional(),
|
|
60
|
+
amount: z.string().optional(),
|
|
61
|
+
}).catchall(z.any()),
|
|
62
|
+
"additionalProperties",
|
|
63
|
+
true,
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
export function lineCalculationPriceFnFromJSON(
|
|
67
|
+
jsonString: string,
|
|
68
|
+
): SafeParseResult<LineCalculationPriceFn, SDKValidationError> {
|
|
69
|
+
return safeParse(
|
|
70
|
+
jsonString,
|
|
71
|
+
(x) => LineCalculationPriceFn$inboundSchema.parse(JSON.parse(x)),
|
|
72
|
+
`Failed to parse 'LineCalculationPriceFn' from JSON`,
|
|
73
|
+
);
|
|
74
|
+
}
|