@flexprice/sdk 2.1.49-dev.24 → 2.1.49-dev.26
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/docs/sdks/scheduledtasks/README.md +0 -143
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/sdk/models/index.d.ts +0 -2
- package/esm/sdk/models/index.d.ts.map +1 -1
- package/esm/sdk/models/index.js +0 -2
- package/esm/sdk/models/index.js.map +1 -1
- package/esm/sdk/scheduled-tasks.d.ts +0 -14
- package/esm/sdk/scheduled-tasks.d.ts.map +1 -1
- package/esm/sdk/scheduled-tasks.js +0 -20
- package/esm/sdk/scheduled-tasks.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/lib/config.ts +2 -2
- package/src/sdk/models/index.ts +0 -2
- package/src/sdk/scheduled-tasks.ts +0 -34
- package/docs/sdk/models/schedule-draft-finalization-response.md +0 -16
- package/docs/sdk/models/schedule-update-billing-period-request.md +0 -16
- package/docs/sdk/models/schedule-update-billing-period-response.md +0 -16
- package/esm/funcs/scheduled-tasks-schedule-draft-finalization.d.ts +0 -17
- package/esm/funcs/scheduled-tasks-schedule-draft-finalization.d.ts.map +0 -1
- package/esm/funcs/scheduled-tasks-schedule-draft-finalization.js +0 -72
- package/esm/funcs/scheduled-tasks-schedule-draft-finalization.js.map +0 -1
- package/esm/funcs/scheduled-tasks-schedule-update-billing-period.d.ts +0 -17
- package/esm/funcs/scheduled-tasks-schedule-update-billing-period.d.ts.map +0 -1
- package/esm/funcs/scheduled-tasks-schedule-update-billing-period.js +0 -73
- package/esm/funcs/scheduled-tasks-schedule-update-billing-period.js.map +0 -1
- package/esm/sdk/models/schedule-draft-finalization-op.d.ts +0 -11
- package/esm/sdk/models/schedule-draft-finalization-op.d.ts.map +0 -1
- package/esm/sdk/models/schedule-draft-finalization-op.js +0 -11
- package/esm/sdk/models/schedule-draft-finalization-op.js.map +0 -1
- package/esm/sdk/models/schedule-update-billing-period-op.d.ts +0 -20
- package/esm/sdk/models/schedule-update-billing-period-op.d.ts.map +0 -1
- package/esm/sdk/models/schedule-update-billing-period-op.js +0 -16
- package/esm/sdk/models/schedule-update-billing-period-op.js.map +0 -1
- package/src/funcs/scheduled-tasks-schedule-draft-finalization.ts +0 -153
- package/src/funcs/scheduled-tasks-schedule-update-billing-period.ts +0 -157
- package/src/sdk/models/schedule-draft-finalization-op.ts +0 -29
- package/src/sdk/models/schedule-update-billing-period-op.ts +0 -54
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# ScheduleUpdateBillingPeriodRequest
|
|
2
|
-
|
|
3
|
-
Schedule Update Billing Period Request
|
|
4
|
-
|
|
5
|
-
## Example Usage
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
import { ScheduleUpdateBillingPeriodRequest } from "@flexprice/sdk/sdk/models";
|
|
9
|
-
|
|
10
|
-
let value: ScheduleUpdateBillingPeriodRequest = {};
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Fields
|
|
14
|
-
|
|
15
|
-
| Field | Type | Required | Description |
|
|
16
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# ScheduleUpdateBillingPeriodResponse
|
|
2
|
-
|
|
3
|
-
OK
|
|
4
|
-
|
|
5
|
-
## Example Usage
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
import { ScheduleUpdateBillingPeriodResponse } from "@flexprice/sdk/sdk/models";
|
|
9
|
-
|
|
10
|
-
let value: ScheduleUpdateBillingPeriodResponse = {};
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Fields
|
|
14
|
-
|
|
15
|
-
| Field | Type | Required | Description |
|
|
16
|
-
| ----------- | ----------- | ----------- | ----------- |
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FlexpriceCore } from "../core.js";
|
|
2
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
-
import { FlexPriceError } from "../sdk/models/flex-price-error.js";
|
|
4
|
-
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../sdk/models/http-client-errors.js";
|
|
5
|
-
import * as models from "../sdk/models/index.js";
|
|
6
|
-
import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
|
|
7
|
-
import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
|
|
8
|
-
import { APIPromise } from "../types/async.js";
|
|
9
|
-
import { Result } from "../types/fp.js";
|
|
10
|
-
/**
|
|
11
|
-
* Schedule draft finalization
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* Triggers the draft invoice finalization workflow that scans computed draft invoices whose finalization delay has elapsed and finalizes them (assign invoice number, sync to vendors, attempt payment).
|
|
15
|
-
*/
|
|
16
|
-
export declare function scheduledTasksScheduleDraftFinalization(client: FlexpriceCore, options?: RequestOptions): APIPromise<Result<models.ScheduleDraftFinalizationResponse, models.ErrorsErrorResponse | FlexPriceError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
17
|
-
//# sourceMappingURL=scheduled-tasks-schedule-draft-finalization.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-tasks-schedule-draft-finalization.d.ts","sourceRoot":"","sources":["../../src/funcs/scheduled-tasks-schedule-draft-finalization.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI3C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,uCAAuC,CACrD,MAAM,EAAE,aAAa,EACrB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,MAAM,CAAC,iCAAiC,EACtC,MAAM,CAAC,mBAAmB,GAC1B,cAAc,GACd,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAKA"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { matchStatusCode } from "../lib/http.js";
|
|
5
|
-
import * as M from "../lib/matchers.js";
|
|
6
|
-
import { compactMap } from "../lib/primitives.js";
|
|
7
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
8
|
-
import { pathToFunc } from "../lib/url.js";
|
|
9
|
-
import * as models from "../sdk/models/index.js";
|
|
10
|
-
import { APIPromise } from "../types/async.js";
|
|
11
|
-
/**
|
|
12
|
-
* Schedule draft finalization
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
* Triggers the draft invoice finalization workflow that scans computed draft invoices whose finalization delay has elapsed and finalizes them (assign invoice number, sync to vendors, attempt payment).
|
|
16
|
-
*/
|
|
17
|
-
export function scheduledTasksScheduleDraftFinalization(client, options) {
|
|
18
|
-
return new APIPromise($do(client, options));
|
|
19
|
-
}
|
|
20
|
-
async function $do(client, options) {
|
|
21
|
-
const path = pathToFunc("/tasks/scheduled/schedule-draft-finalization")();
|
|
22
|
-
const headers = new Headers(compactMap({
|
|
23
|
-
Accept: "application/json",
|
|
24
|
-
}));
|
|
25
|
-
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
26
|
-
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
27
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
28
|
-
const context = {
|
|
29
|
-
options: client._options,
|
|
30
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
31
|
-
operationID: "scheduleDraftFinalization",
|
|
32
|
-
oAuth2Scopes: null,
|
|
33
|
-
resolvedSecurity: requestSecurity,
|
|
34
|
-
securitySource: client._options.apiKeyAuth,
|
|
35
|
-
retryConfig: options?.retries
|
|
36
|
-
|| client._options.retryConfig
|
|
37
|
-
|| { strategy: "none" },
|
|
38
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
39
|
-
};
|
|
40
|
-
const requestRes = client._createRequest(context, {
|
|
41
|
-
security: requestSecurity,
|
|
42
|
-
method: "POST",
|
|
43
|
-
baseURL: options?.serverURL,
|
|
44
|
-
path: path,
|
|
45
|
-
headers: headers,
|
|
46
|
-
userAgent: client._options.userAgent,
|
|
47
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
48
|
-
}, options);
|
|
49
|
-
if (!requestRes.ok) {
|
|
50
|
-
return [requestRes, { status: "invalid" }];
|
|
51
|
-
}
|
|
52
|
-
const req = requestRes.value;
|
|
53
|
-
const doResult = await client._do(req, {
|
|
54
|
-
context,
|
|
55
|
-
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
56
|
-
retryConfig: context.retryConfig,
|
|
57
|
-
retryCodes: context.retryCodes,
|
|
58
|
-
});
|
|
59
|
-
if (!doResult.ok) {
|
|
60
|
-
return [doResult, { status: "request-error", request: req }];
|
|
61
|
-
}
|
|
62
|
-
const response = doResult.value;
|
|
63
|
-
const responseFields = {
|
|
64
|
-
HttpMeta: { Response: response, Request: req },
|
|
65
|
-
};
|
|
66
|
-
const [result] = await M.match(M.json(200, models.ScheduleDraftFinalizationResponse$inboundSchema), M.jsonErr(400, models.ErrorsErrorResponse$inboundSchema), M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
67
|
-
if (!result.ok) {
|
|
68
|
-
return [result, { status: "complete", request: req, response }];
|
|
69
|
-
}
|
|
70
|
-
return [result, { status: "complete", request: req, response }];
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=scheduled-tasks-schedule-draft-finalization.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-tasks-schedule-draft-finalization.js","sourceRoot":"","sources":["../../src/funcs/scheduled-tasks-schedule-draft-finalization.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAS3C,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AAGjD,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGxD;;;;;GAKG;AACH,MAAM,UAAU,uCAAuC,CACrD,MAAqB,EACrB,OAAwB,EAcxB;IACA,OAAO,IAAI,UAAU,CAAC,GAAG,CACvB,MAAM,EACN,OAAO,CACR,CAAC,CAAC;AAAA,CACJ;AAED,KAAK,UAAU,GAAG,CAChB,MAAqB,EACrB,OAAwB,EAiBxB;IACA,MAAM,IAAI,GAAG,UAAU,CAAC,8CAA8C,CAAC,EAAE,CAAC;IAE1E,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;Q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OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAAA,CACjE"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FlexpriceCore } from "../core.js";
|
|
2
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
-
import { FlexPriceError } from "../sdk/models/flex-price-error.js";
|
|
4
|
-
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../sdk/models/http-client-errors.js";
|
|
5
|
-
import * as models from "../sdk/models/index.js";
|
|
6
|
-
import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
|
|
7
|
-
import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
|
|
8
|
-
import { APIPromise } from "../types/async.js";
|
|
9
|
-
import { Result } from "../types/fp.js";
|
|
10
|
-
/**
|
|
11
|
-
* Schedule update billing period
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* Use when you need to trigger a billing-period update workflow (e.g. to recalculate or sync billing windows).
|
|
15
|
-
*/
|
|
16
|
-
export declare function scheduledTasksScheduleUpdateBillingPeriod(client: FlexpriceCore, _request: models.ScheduleUpdateBillingPeriodRequest, options?: RequestOptions): APIPromise<Result<models.ScheduleUpdateBillingPeriodResponse, models.ErrorsErrorResponse | FlexPriceError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
17
|
-
//# sourceMappingURL=scheduled-tasks-schedule-update-billing-period.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-tasks-schedule-update-billing-period.d.ts","sourceRoot":"","sources":["../../src/funcs/scheduled-tasks-schedule-update-billing-period.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI3C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,yCAAyC,CACvD,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,MAAM,CAAC,kCAAkC,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,MAAM,CAAC,mCAAmC,EACxC,MAAM,CAAC,mBAAmB,GAC1B,cAAc,GACd,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { matchStatusCode } from "../lib/http.js";
|
|
5
|
-
import * as M from "../lib/matchers.js";
|
|
6
|
-
import { compactMap } from "../lib/primitives.js";
|
|
7
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
8
|
-
import { pathToFunc } from "../lib/url.js";
|
|
9
|
-
import * as models from "../sdk/models/index.js";
|
|
10
|
-
import { APIPromise } from "../types/async.js";
|
|
11
|
-
/**
|
|
12
|
-
* Schedule update billing period
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
* Use when you need to trigger a billing-period update workflow (e.g. to recalculate or sync billing windows).
|
|
16
|
-
*/
|
|
17
|
-
export function scheduledTasksScheduleUpdateBillingPeriod(client, _request, options) {
|
|
18
|
-
return new APIPromise($do(client, _request, options));
|
|
19
|
-
}
|
|
20
|
-
async function $do(client, _request, options) {
|
|
21
|
-
const path = pathToFunc("/tasks/scheduled/schedule-update-billing-period")();
|
|
22
|
-
const headers = new Headers(compactMap({
|
|
23
|
-
"Content-Type": "application/json",
|
|
24
|
-
Accept: "application/json",
|
|
25
|
-
}));
|
|
26
|
-
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
27
|
-
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
28
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
29
|
-
const context = {
|
|
30
|
-
options: client._options,
|
|
31
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
32
|
-
operationID: "scheduleUpdateBillingPeriod",
|
|
33
|
-
oAuth2Scopes: null,
|
|
34
|
-
resolvedSecurity: requestSecurity,
|
|
35
|
-
securitySource: client._options.apiKeyAuth,
|
|
36
|
-
retryConfig: options?.retries
|
|
37
|
-
|| client._options.retryConfig
|
|
38
|
-
|| { strategy: "none" },
|
|
39
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
40
|
-
};
|
|
41
|
-
const requestRes = client._createRequest(context, {
|
|
42
|
-
security: requestSecurity,
|
|
43
|
-
method: "POST",
|
|
44
|
-
baseURL: options?.serverURL,
|
|
45
|
-
path: path,
|
|
46
|
-
headers: headers,
|
|
47
|
-
userAgent: client._options.userAgent,
|
|
48
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
49
|
-
}, options);
|
|
50
|
-
if (!requestRes.ok) {
|
|
51
|
-
return [requestRes, { status: "invalid" }];
|
|
52
|
-
}
|
|
53
|
-
const req = requestRes.value;
|
|
54
|
-
const doResult = await client._do(req, {
|
|
55
|
-
context,
|
|
56
|
-
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
57
|
-
retryConfig: context.retryConfig,
|
|
58
|
-
retryCodes: context.retryCodes,
|
|
59
|
-
});
|
|
60
|
-
if (!doResult.ok) {
|
|
61
|
-
return [doResult, { status: "request-error", request: req }];
|
|
62
|
-
}
|
|
63
|
-
const response = doResult.value;
|
|
64
|
-
const responseFields = {
|
|
65
|
-
HttpMeta: { Response: response, Request: req },
|
|
66
|
-
};
|
|
67
|
-
const [result] = await M.match(M.json(200, models.ScheduleUpdateBillingPeriodResponse$inboundSchema), M.jsonErr(400, models.ErrorsErrorResponse$inboundSchema), M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
68
|
-
if (!result.ok) {
|
|
69
|
-
return [result, { status: "complete", request: req, response }];
|
|
70
|
-
}
|
|
71
|
-
return [result, { status: "complete", request: req, response }];
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=scheduled-tasks-schedule-update-billing-period.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-tasks-schedule-update-billing-period.js","sourceRoot":"","sources":["../../src/funcs/scheduled-tasks-schedule-update-billing-period.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAS3C,OAAO,KAAK,MAAM,MAAM,wB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CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAY5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,iDAAiD,CAAC,EACrE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,iCAAiC,CAAC,EACxD,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,iCAAiC,CAAC,EACxD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EACb,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAAA,CACjE"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4-mini";
|
|
2
|
-
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
|
-
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
4
|
-
/**
|
|
5
|
-
* OK
|
|
6
|
-
*/
|
|
7
|
-
export type ScheduleDraftFinalizationResponse = {};
|
|
8
|
-
/** @internal */
|
|
9
|
-
export declare const ScheduleDraftFinalizationResponse$inboundSchema: z.ZodMiniType<ScheduleDraftFinalizationResponse, unknown>;
|
|
10
|
-
export declare function scheduleDraftFinalizationResponseFromJSON(jsonString: string): SafeParseResult<ScheduleDraftFinalizationResponse, SDKValidationError>;
|
|
11
|
-
//# sourceMappingURL=schedule-draft-finalization-op.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schedule-draft-finalization-op.d.ts","sourceRoot":"","sources":["../../../src/sdk/models/schedule-draft-finalization-op.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,iCAAiC,GAAG,EAAE,CAAC;AAEnD,gBAAgB;AAChB,eAAO,MAAM,+CAA+C,EAAE,CAAC,CAAC,WAAW,CACzE,iCAAiC,EACjC,OAAO,CACO,CAAC;AAEjB,wBAAgB,yCAAyC,CACvD,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,iCAAiC,EAAE,kBAAkB,CAAC,CAMxE"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import * as z from "zod/v4-mini";
|
|
5
|
-
import { safeParse } from "../../lib/schemas.js";
|
|
6
|
-
/** @internal */
|
|
7
|
-
export const ScheduleDraftFinalizationResponse$inboundSchema = z.object({});
|
|
8
|
-
export function scheduleDraftFinalizationResponseFromJSON(jsonString) {
|
|
9
|
-
return safeParse(jsonString, (x) => ScheduleDraftFinalizationResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ScheduleDraftFinalizationResponse' from JSON`);
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=schedule-draft-finalization-op.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schedule-draft-finalization-op.js","sourceRoot":"","sources":["../../../src/sdk/models/schedule-draft-finalization-op.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AASjD,gBAAgB;AAChB,MAAM,CAAC,MAAM,+CAA+C,GAGxD,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAEjB,MAAM,UAAU,yCAAyC,CACvD,UAAkB,EACsD;IACxE,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,+CAA+C,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC3E,+DAA+D,CAChE,CAAC;AAAA,CACH"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as z from "zod/v4-mini";
|
|
2
|
-
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
|
-
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
4
|
-
/**
|
|
5
|
-
* Schedule Update Billing Period Request
|
|
6
|
-
*/
|
|
7
|
-
export type ScheduleUpdateBillingPeriodRequest = {};
|
|
8
|
-
/**
|
|
9
|
-
* OK
|
|
10
|
-
*/
|
|
11
|
-
export type ScheduleUpdateBillingPeriodResponse = {};
|
|
12
|
-
/** @internal */
|
|
13
|
-
export type ScheduleUpdateBillingPeriodRequest$Outbound = {};
|
|
14
|
-
/** @internal */
|
|
15
|
-
export declare const ScheduleUpdateBillingPeriodRequest$outboundSchema: z.ZodMiniType<ScheduleUpdateBillingPeriodRequest$Outbound, ScheduleUpdateBillingPeriodRequest>;
|
|
16
|
-
export declare function scheduleUpdateBillingPeriodRequestToJSON(scheduleUpdateBillingPeriodRequest: ScheduleUpdateBillingPeriodRequest): string;
|
|
17
|
-
/** @internal */
|
|
18
|
-
export declare const ScheduleUpdateBillingPeriodResponse$inboundSchema: z.ZodMiniType<ScheduleUpdateBillingPeriodResponse, unknown>;
|
|
19
|
-
export declare function scheduleUpdateBillingPeriodResponseFromJSON(jsonString: string): SafeParseResult<ScheduleUpdateBillingPeriodResponse, SDKValidationError>;
|
|
20
|
-
//# sourceMappingURL=schedule-update-billing-period-op.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schedule-update-billing-period-op.d.ts","sourceRoot":"","sources":["../../../src/sdk/models/schedule-update-billing-period-op.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAAG,EAAE,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,mCAAmC,GAAG,EAAE,CAAC;AAErD,gBAAgB;AAChB,MAAM,MAAM,2CAA2C,GAAG,EAAE,CAAC;AAE7D,gBAAgB;AAChB,eAAO,MAAM,iDAAiD,EAAE,CAAC,CAAC,WAAW,CAC3E,2CAA2C,EAC3C,kCAAkC,CACpB,CAAC;AAEjB,wBAAgB,wCAAwC,CACtD,kCAAkC,EAAE,kCAAkC,GACrE,MAAM,CAMR;AAED,gBAAgB;AAChB,eAAO,MAAM,iDAAiD,EAAE,CAAC,CAAC,WAAW,CAC3E,mCAAmC,EACnC,OAAO,CACO,CAAC;AAEjB,wBAAgB,2CAA2C,CACzD,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,mCAAmC,EAAE,kBAAkB,CAAC,CAO1E"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import * as z from "zod/v4-mini";
|
|
5
|
-
import { safeParse } from "../../lib/schemas.js";
|
|
6
|
-
/** @internal */
|
|
7
|
-
export const ScheduleUpdateBillingPeriodRequest$outboundSchema = z.object({});
|
|
8
|
-
export function scheduleUpdateBillingPeriodRequestToJSON(scheduleUpdateBillingPeriodRequest) {
|
|
9
|
-
return JSON.stringify(ScheduleUpdateBillingPeriodRequest$outboundSchema.parse(scheduleUpdateBillingPeriodRequest));
|
|
10
|
-
}
|
|
11
|
-
/** @internal */
|
|
12
|
-
export const ScheduleUpdateBillingPeriodResponse$inboundSchema = z.object({});
|
|
13
|
-
export function scheduleUpdateBillingPeriodResponseFromJSON(jsonString) {
|
|
14
|
-
return safeParse(jsonString, (x) => ScheduleUpdateBillingPeriodResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ScheduleUpdateBillingPeriodResponse' from JSON`);
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=schedule-update-billing-period-op.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schedule-update-billing-period-op.js","sourceRoot":"","sources":["../../../src/sdk/models/schedule-update-billing-period-op.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAiBjD,gBAAgB;AAChB,MAAM,CAAC,MAAM,iDAAiD,GAG1D,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAEjB,MAAM,UAAU,wCAAwC,CACtD,kCAAsE,EAC9D;IACR,OAAO,IAAI,CAAC,SAAS,CACnB,iDAAiD,CAAC,KAAK,CACrD,kCAAkC,CACnC,CACF,CAAC;AAAA,CACH;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,iDAAiD,GAG1D,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAEjB,MAAM,UAAU,2CAA2C,CACzD,UAAkB,EACwD;IAC1E,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CACJ,iDAAiD,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACxE,iEAAiE,CAClE,CAAC;AAAA,CACH"}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { FlexpriceCore } from "../core.js";
|
|
6
|
-
import { matchStatusCode } from "../lib/http.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
-
import { pathToFunc } from "../lib/url.js";
|
|
12
|
-
import { FlexPriceError } from "../sdk/models/flex-price-error.js";
|
|
13
|
-
import {
|
|
14
|
-
ConnectionError,
|
|
15
|
-
InvalidRequestError,
|
|
16
|
-
RequestAbortedError,
|
|
17
|
-
RequestTimeoutError,
|
|
18
|
-
UnexpectedClientError,
|
|
19
|
-
} from "../sdk/models/http-client-errors.js";
|
|
20
|
-
import * as models from "../sdk/models/index.js";
|
|
21
|
-
import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
|
|
22
|
-
import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
|
|
23
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
24
|
-
import { Result } from "../types/fp.js";
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Schedule draft finalization
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* Triggers the draft invoice finalization workflow that scans computed draft invoices whose finalization delay has elapsed and finalizes them (assign invoice number, sync to vendors, attempt payment).
|
|
31
|
-
*/
|
|
32
|
-
export function scheduledTasksScheduleDraftFinalization(
|
|
33
|
-
client: FlexpriceCore,
|
|
34
|
-
options?: RequestOptions,
|
|
35
|
-
): APIPromise<
|
|
36
|
-
Result<
|
|
37
|
-
models.ScheduleDraftFinalizationResponse,
|
|
38
|
-
| models.ErrorsErrorResponse
|
|
39
|
-
| FlexPriceError
|
|
40
|
-
| ResponseValidationError
|
|
41
|
-
| ConnectionError
|
|
42
|
-
| RequestAbortedError
|
|
43
|
-
| RequestTimeoutError
|
|
44
|
-
| InvalidRequestError
|
|
45
|
-
| UnexpectedClientError
|
|
46
|
-
| SDKValidationError
|
|
47
|
-
>
|
|
48
|
-
> {
|
|
49
|
-
return new APIPromise($do(
|
|
50
|
-
client,
|
|
51
|
-
options,
|
|
52
|
-
));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async function $do(
|
|
56
|
-
client: FlexpriceCore,
|
|
57
|
-
options?: RequestOptions,
|
|
58
|
-
): Promise<
|
|
59
|
-
[
|
|
60
|
-
Result<
|
|
61
|
-
models.ScheduleDraftFinalizationResponse,
|
|
62
|
-
| models.ErrorsErrorResponse
|
|
63
|
-
| FlexPriceError
|
|
64
|
-
| ResponseValidationError
|
|
65
|
-
| ConnectionError
|
|
66
|
-
| RequestAbortedError
|
|
67
|
-
| RequestTimeoutError
|
|
68
|
-
| InvalidRequestError
|
|
69
|
-
| UnexpectedClientError
|
|
70
|
-
| SDKValidationError
|
|
71
|
-
>,
|
|
72
|
-
APICall,
|
|
73
|
-
]
|
|
74
|
-
> {
|
|
75
|
-
const path = pathToFunc("/tasks/scheduled/schedule-draft-finalization")();
|
|
76
|
-
|
|
77
|
-
const headers = new Headers(compactMap({
|
|
78
|
-
Accept: "application/json",
|
|
79
|
-
}));
|
|
80
|
-
|
|
81
|
-
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
82
|
-
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
83
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
84
|
-
|
|
85
|
-
const context = {
|
|
86
|
-
options: client._options,
|
|
87
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
88
|
-
operationID: "scheduleDraftFinalization",
|
|
89
|
-
oAuth2Scopes: null,
|
|
90
|
-
|
|
91
|
-
resolvedSecurity: requestSecurity,
|
|
92
|
-
|
|
93
|
-
securitySource: client._options.apiKeyAuth,
|
|
94
|
-
retryConfig: options?.retries
|
|
95
|
-
|| client._options.retryConfig
|
|
96
|
-
|| { strategy: "none" },
|
|
97
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const requestRes = client._createRequest(context, {
|
|
101
|
-
security: requestSecurity,
|
|
102
|
-
method: "POST",
|
|
103
|
-
baseURL: options?.serverURL,
|
|
104
|
-
path: path,
|
|
105
|
-
headers: headers,
|
|
106
|
-
userAgent: client._options.userAgent,
|
|
107
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
108
|
-
}, options);
|
|
109
|
-
if (!requestRes.ok) {
|
|
110
|
-
return [requestRes, { status: "invalid" }];
|
|
111
|
-
}
|
|
112
|
-
const req = requestRes.value;
|
|
113
|
-
|
|
114
|
-
const doResult = await client._do(req, {
|
|
115
|
-
context,
|
|
116
|
-
isErrorStatusCode: (statusCode: number) =>
|
|
117
|
-
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
118
|
-
retryConfig: context.retryConfig,
|
|
119
|
-
retryCodes: context.retryCodes,
|
|
120
|
-
});
|
|
121
|
-
if (!doResult.ok) {
|
|
122
|
-
return [doResult, { status: "request-error", request: req }];
|
|
123
|
-
}
|
|
124
|
-
const response = doResult.value;
|
|
125
|
-
|
|
126
|
-
const responseFields = {
|
|
127
|
-
HttpMeta: { Response: response, Request: req },
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
const [result] = await M.match<
|
|
131
|
-
models.ScheduleDraftFinalizationResponse,
|
|
132
|
-
| models.ErrorsErrorResponse
|
|
133
|
-
| FlexPriceError
|
|
134
|
-
| ResponseValidationError
|
|
135
|
-
| ConnectionError
|
|
136
|
-
| RequestAbortedError
|
|
137
|
-
| RequestTimeoutError
|
|
138
|
-
| InvalidRequestError
|
|
139
|
-
| UnexpectedClientError
|
|
140
|
-
| SDKValidationError
|
|
141
|
-
>(
|
|
142
|
-
M.json(200, models.ScheduleDraftFinalizationResponse$inboundSchema),
|
|
143
|
-
M.jsonErr(400, models.ErrorsErrorResponse$inboundSchema),
|
|
144
|
-
M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema),
|
|
145
|
-
M.fail("4XX"),
|
|
146
|
-
M.fail("5XX"),
|
|
147
|
-
)(response, req, { extraFields: responseFields });
|
|
148
|
-
if (!result.ok) {
|
|
149
|
-
return [result, { status: "complete", request: req, response }];
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return [result, { status: "complete", request: req, response }];
|
|
153
|
-
}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { FlexpriceCore } from "../core.js";
|
|
6
|
-
import { matchStatusCode } from "../lib/http.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
-
import { pathToFunc } from "../lib/url.js";
|
|
12
|
-
import { FlexPriceError } from "../sdk/models/flex-price-error.js";
|
|
13
|
-
import {
|
|
14
|
-
ConnectionError,
|
|
15
|
-
InvalidRequestError,
|
|
16
|
-
RequestAbortedError,
|
|
17
|
-
RequestTimeoutError,
|
|
18
|
-
UnexpectedClientError,
|
|
19
|
-
} from "../sdk/models/http-client-errors.js";
|
|
20
|
-
import * as models from "../sdk/models/index.js";
|
|
21
|
-
import { ResponseValidationError } from "../sdk/models/response-validation-error.js";
|
|
22
|
-
import { SDKValidationError } from "../sdk/models/sdk-validation-error.js";
|
|
23
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
24
|
-
import { Result } from "../types/fp.js";
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Schedule update billing period
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* Use when you need to trigger a billing-period update workflow (e.g. to recalculate or sync billing windows).
|
|
31
|
-
*/
|
|
32
|
-
export function scheduledTasksScheduleUpdateBillingPeriod(
|
|
33
|
-
client: FlexpriceCore,
|
|
34
|
-
_request: models.ScheduleUpdateBillingPeriodRequest,
|
|
35
|
-
options?: RequestOptions,
|
|
36
|
-
): APIPromise<
|
|
37
|
-
Result<
|
|
38
|
-
models.ScheduleUpdateBillingPeriodResponse,
|
|
39
|
-
| models.ErrorsErrorResponse
|
|
40
|
-
| FlexPriceError
|
|
41
|
-
| ResponseValidationError
|
|
42
|
-
| ConnectionError
|
|
43
|
-
| RequestAbortedError
|
|
44
|
-
| RequestTimeoutError
|
|
45
|
-
| InvalidRequestError
|
|
46
|
-
| UnexpectedClientError
|
|
47
|
-
| SDKValidationError
|
|
48
|
-
>
|
|
49
|
-
> {
|
|
50
|
-
return new APIPromise($do(
|
|
51
|
-
client,
|
|
52
|
-
_request,
|
|
53
|
-
options,
|
|
54
|
-
));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async function $do(
|
|
58
|
-
client: FlexpriceCore,
|
|
59
|
-
_request: models.ScheduleUpdateBillingPeriodRequest,
|
|
60
|
-
options?: RequestOptions,
|
|
61
|
-
): Promise<
|
|
62
|
-
[
|
|
63
|
-
Result<
|
|
64
|
-
models.ScheduleUpdateBillingPeriodResponse,
|
|
65
|
-
| models.ErrorsErrorResponse
|
|
66
|
-
| FlexPriceError
|
|
67
|
-
| ResponseValidationError
|
|
68
|
-
| ConnectionError
|
|
69
|
-
| RequestAbortedError
|
|
70
|
-
| RequestTimeoutError
|
|
71
|
-
| InvalidRequestError
|
|
72
|
-
| UnexpectedClientError
|
|
73
|
-
| SDKValidationError
|
|
74
|
-
>,
|
|
75
|
-
APICall,
|
|
76
|
-
]
|
|
77
|
-
> {
|
|
78
|
-
const path = pathToFunc("/tasks/scheduled/schedule-update-billing-period")();
|
|
79
|
-
|
|
80
|
-
const headers = new Headers(compactMap({
|
|
81
|
-
"Content-Type": "application/json",
|
|
82
|
-
Accept: "application/json",
|
|
83
|
-
}));
|
|
84
|
-
|
|
85
|
-
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
86
|
-
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
87
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
88
|
-
|
|
89
|
-
const context = {
|
|
90
|
-
options: client._options,
|
|
91
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
92
|
-
operationID: "scheduleUpdateBillingPeriod",
|
|
93
|
-
oAuth2Scopes: null,
|
|
94
|
-
|
|
95
|
-
resolvedSecurity: requestSecurity,
|
|
96
|
-
|
|
97
|
-
securitySource: client._options.apiKeyAuth,
|
|
98
|
-
retryConfig: options?.retries
|
|
99
|
-
|| client._options.retryConfig
|
|
100
|
-
|| { strategy: "none" },
|
|
101
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
const requestRes = client._createRequest(context, {
|
|
105
|
-
security: requestSecurity,
|
|
106
|
-
method: "POST",
|
|
107
|
-
baseURL: options?.serverURL,
|
|
108
|
-
path: path,
|
|
109
|
-
headers: headers,
|
|
110
|
-
userAgent: client._options.userAgent,
|
|
111
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
112
|
-
}, options);
|
|
113
|
-
if (!requestRes.ok) {
|
|
114
|
-
return [requestRes, { status: "invalid" }];
|
|
115
|
-
}
|
|
116
|
-
const req = requestRes.value;
|
|
117
|
-
|
|
118
|
-
const doResult = await client._do(req, {
|
|
119
|
-
context,
|
|
120
|
-
isErrorStatusCode: (statusCode: number) =>
|
|
121
|
-
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
122
|
-
retryConfig: context.retryConfig,
|
|
123
|
-
retryCodes: context.retryCodes,
|
|
124
|
-
});
|
|
125
|
-
if (!doResult.ok) {
|
|
126
|
-
return [doResult, { status: "request-error", request: req }];
|
|
127
|
-
}
|
|
128
|
-
const response = doResult.value;
|
|
129
|
-
|
|
130
|
-
const responseFields = {
|
|
131
|
-
HttpMeta: { Response: response, Request: req },
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
const [result] = await M.match<
|
|
135
|
-
models.ScheduleUpdateBillingPeriodResponse,
|
|
136
|
-
| models.ErrorsErrorResponse
|
|
137
|
-
| FlexPriceError
|
|
138
|
-
| ResponseValidationError
|
|
139
|
-
| ConnectionError
|
|
140
|
-
| RequestAbortedError
|
|
141
|
-
| RequestTimeoutError
|
|
142
|
-
| InvalidRequestError
|
|
143
|
-
| UnexpectedClientError
|
|
144
|
-
| SDKValidationError
|
|
145
|
-
>(
|
|
146
|
-
M.json(200, models.ScheduleUpdateBillingPeriodResponse$inboundSchema),
|
|
147
|
-
M.jsonErr(400, models.ErrorsErrorResponse$inboundSchema),
|
|
148
|
-
M.jsonErr(500, models.ErrorsErrorResponse$inboundSchema),
|
|
149
|
-
M.fail("4XX"),
|
|
150
|
-
M.fail("5XX"),
|
|
151
|
-
)(response, req, { extraFields: responseFields });
|
|
152
|
-
if (!result.ok) {
|
|
153
|
-
return [result, { status: "complete", request: req, response }];
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return [result, { status: "complete", request: req, response }];
|
|
157
|
-
}
|