syllable-sdk 0.1.0-alpha.72 → 0.1.0-alpha.74
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 +28 -11
- package/docs/sdks/batches/README.md +30 -32
- package/docs/sdks/campaigns/README.md +11 -3
- package/docs/sdks/incidents/README.md +527 -0
- package/docs/sdks/insights/README.md +1 -1
- package/docs/sdks/syllablesdk/README.md +1 -1
- package/docs/sdks/syllablesdktools/README.md +82 -2
- package/docs/sdks/takeouts/README.md +11 -11
- package/docs/sdks/workflows/README.md +1 -1
- package/funcs/{outboundBatchesOutboundBatchRemove.d.ts → incidentsCreate.d.ts} +7 -4
- package/funcs/incidentsCreate.d.ts.map +1 -0
- package/funcs/incidentsCreate.js +102 -0
- package/funcs/incidentsCreate.js.map +1 -0
- package/funcs/incidentsDelete.d.ts +16 -0
- package/funcs/incidentsDelete.d.ts.map +1 -0
- package/funcs/incidentsDelete.js +112 -0
- package/funcs/incidentsDelete.js.map +1 -0
- package/funcs/incidentsGetById.d.ts +17 -0
- package/funcs/incidentsGetById.d.ts.map +1 -0
- package/funcs/incidentsGetById.js +108 -0
- package/funcs/incidentsGetById.js.map +1 -0
- package/funcs/incidentsIncidentGetOrganizations.d.ts +15 -0
- package/funcs/incidentsIncidentGetOrganizations.d.ts.map +1 -0
- package/funcs/incidentsIncidentGetOrganizations.js +89 -0
- package/funcs/incidentsIncidentGetOrganizations.js.map +1 -0
- package/funcs/incidentsList.d.ts +17 -0
- package/funcs/incidentsList.d.ts.map +1 -0
- package/funcs/incidentsList.js +114 -0
- package/funcs/incidentsList.js.map +1 -0
- package/funcs/incidentsUpdate.d.ts +16 -0
- package/funcs/incidentsUpdate.d.ts.map +1 -0
- package/funcs/incidentsUpdate.js +102 -0
- package/funcs/incidentsUpdate.js.map +1 -0
- package/funcs/insightsList.d.ts +1 -1
- package/funcs/insightsList.js +1 -1
- package/funcs/insightsToolsCreate.d.ts +1 -1
- package/funcs/insightsToolsCreate.js +3 -3
- package/funcs/insightsToolsCreate.js.map +1 -1
- package/funcs/insightsToolsInsightsToolTest.d.ts +16 -0
- package/funcs/insightsToolsInsightsToolTest.d.ts.map +1 -0
- package/funcs/insightsToolsInsightsToolTest.js +103 -0
- package/funcs/insightsToolsInsightsToolTest.js.map +1 -0
- package/funcs/insightsToolsUpdate.d.ts +1 -1
- package/funcs/insightsToolsUpdate.js +1 -1
- package/funcs/insightsWorkflowsQueueSessionsWorkflow.d.ts +1 -1
- package/funcs/insightsWorkflowsQueueSessionsWorkflow.js +1 -1
- package/funcs/{outboundBatchesOutboundBatchAdd.d.ts → outboundBatchesAdd.d.ts} +2 -2
- package/funcs/outboundBatchesAdd.d.ts.map +1 -0
- package/funcs/{outboundBatchesOutboundBatchAdd.js → outboundBatchesAdd.js} +3 -3
- package/funcs/outboundBatchesAdd.js.map +1 -0
- package/funcs/outboundBatchesList.d.ts +1 -1
- package/funcs/outboundBatchesList.d.ts.map +1 -1
- package/funcs/outboundBatchesList.js +1 -2
- package/funcs/outboundBatchesList.js.map +1 -1
- package/funcs/outboundBatchesRemove.d.ts +13 -0
- package/funcs/outboundBatchesRemove.d.ts.map +1 -0
- package/funcs/{outboundBatchesOutboundBatchRemove.js → outboundBatchesRemove.js} +3 -3
- package/funcs/outboundBatchesRemove.js.map +1 -0
- package/funcs/{outboundBatchesOutboundBatchResults.d.ts → outboundBatchesResults.d.ts} +2 -2
- package/funcs/outboundBatchesResults.d.ts.map +1 -0
- package/funcs/{outboundBatchesOutboundBatchResults.js → outboundBatchesResults.js} +8 -3
- package/funcs/outboundBatchesResults.js.map +1 -0
- package/funcs/outboundBatchesUpload.d.ts.map +1 -1
- package/funcs/outboundBatchesUpload.js +16 -12
- package/funcs/outboundBatchesUpload.js.map +1 -1
- package/funcs/outboundCampaignsList.d.ts +1 -1
- package/funcs/outboundCampaignsList.d.ts.map +1 -1
- package/funcs/outboundCampaignsList.js +1 -2
- package/funcs/outboundCampaignsList.js.map +1 -1
- package/funcs/{takeoutsCreateTakeoutApiV1TakeoutsCreatePost.d.ts → takeoutsCreate.d.ts} +2 -2
- package/funcs/takeoutsCreate.d.ts.map +1 -0
- package/funcs/{takeoutsCreateTakeoutApiV1TakeoutsCreatePost.js → takeoutsCreate.js} +4 -4
- package/funcs/takeoutsCreate.js.map +1 -0
- package/funcs/{takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.d.ts → takeoutsTakeoutsGetByJobId.d.ts} +2 -2
- package/funcs/takeoutsTakeoutsGetByJobId.d.ts.map +1 -0
- package/funcs/{takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.js → takeoutsTakeoutsGetByJobId.js} +5 -5
- package/funcs/takeoutsTakeoutsGetByJobId.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/bodyoutboundbatchdelete.d.ts +1 -1
- package/models/components/bodyoutboundbatchdelete.d.ts.map +1 -1
- package/models/components/bodyoutboundbatchdelete.js +10 -1
- package/models/components/bodyoutboundbatchdelete.js.map +1 -1
- package/models/components/bodyoutboundbatchupload.d.ts +2 -2
- package/models/components/bodyoutboundbatchupload.d.ts.map +1 -1
- package/models/components/bodyoutboundbatchupload.js +2 -2
- package/models/components/bodyoutboundbatchupload.js.map +1 -1
- package/models/components/communicationrequest.d.ts +0 -11
- package/models/components/communicationrequest.d.ts.map +1 -1
- package/models/components/communicationrequest.js +0 -9
- package/models/components/communicationrequest.js.map +1 -1
- package/models/components/communicationrequestresult.d.ts +39 -14
- package/models/components/communicationrequestresult.d.ts.map +1 -1
- package/models/components/communicationrequestresult.js +38 -14
- package/models/components/communicationrequestresult.js.map +1 -1
- package/models/components/conversation.d.ts +10 -0
- package/models/components/conversation.d.ts.map +1 -1
- package/models/components/conversation.js +8 -0
- package/models/components/conversation.js.map +1 -1
- package/models/components/incidentcreaterequest.d.ts +75 -0
- package/models/components/incidentcreaterequest.d.ts.map +1 -0
- package/models/components/incidentcreaterequest.js +96 -0
- package/models/components/incidentcreaterequest.js.map +1 -0
- package/models/components/incidentorganizationresponse.d.ts +33 -0
- package/models/components/incidentorganizationresponse.d.ts.map +1 -0
- package/models/components/incidentorganizationresponse.js +72 -0
- package/models/components/incidentorganizationresponse.js.map +1 -0
- package/models/components/incidentproperties.d.ts +64 -0
- package/models/components/incidentproperties.d.ts.map +1 -0
- package/models/components/{requeststatus.js → incidentproperties.js} +25 -19
- package/models/components/incidentproperties.js.map +1 -0
- package/models/components/incidentresponse.d.ts +90 -0
- package/models/components/incidentresponse.d.ts.map +1 -0
- package/models/components/incidentresponse.js +106 -0
- package/models/components/incidentresponse.js.map +1 -0
- package/models/components/incidentupdaterequest.d.ts +90 -0
- package/models/components/incidentupdaterequest.d.ts.map +1 -0
- package/models/components/incidentupdaterequest.js +106 -0
- package/models/components/incidentupdaterequest.js.map +1 -0
- package/models/components/index.d.ts +9 -1
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +9 -1
- package/models/components/index.js.map +1 -1
- package/models/components/insighttooltestinput.d.ts +40 -0
- package/models/components/insighttooltestinput.d.ts.map +1 -0
- package/models/components/insighttooltestinput.js +72 -0
- package/models/components/insighttooltestinput.js.map +1 -0
- package/models/components/listresponsecommunicationbatch.d.ts +53 -0
- package/models/components/listresponsecommunicationbatch.d.ts.map +1 -0
- package/models/components/listresponsecommunicationbatch.js +81 -0
- package/models/components/listresponsecommunicationbatch.js.map +1 -0
- package/models/components/listresponseincidentresponse.d.ts +53 -0
- package/models/components/listresponseincidentresponse.d.ts.map +1 -0
- package/models/components/listresponseincidentresponse.js +81 -0
- package/models/components/listresponseincidentresponse.js.map +1 -0
- package/models/components/listresponseoutboundcampaign.d.ts +53 -0
- package/models/components/listresponseoutboundcampaign.d.ts.map +1 -0
- package/models/components/listresponseoutboundcampaign.js +81 -0
- package/models/components/listresponseoutboundcampaign.js.map +1 -0
- package/models/components/outboundcampaign.d.ts +10 -0
- package/models/components/outboundcampaign.d.ts.map +1 -1
- package/models/components/outboundcampaign.js +4 -0
- package/models/components/outboundcampaign.js.map +1 -1
- package/models/components/outboundcampaigninput.d.ts +10 -0
- package/models/components/outboundcampaigninput.d.ts.map +1 -1
- package/models/components/outboundcampaigninput.js +4 -0
- package/models/components/outboundcampaigninput.js.map +1 -1
- package/models/components/promptcreaterequest.d.ts +1 -1
- package/models/components/promptupdaterequest.d.ts +1 -1
- package/models/operations/incidentdelete.d.ts +31 -0
- package/models/operations/incidentdelete.d.ts.map +1 -0
- package/models/operations/incidentdelete.js +70 -0
- package/models/operations/incidentdelete.js.map +1 -0
- package/models/operations/incidentgetbyid.d.ts +29 -0
- package/models/operations/incidentgetbyid.d.ts.map +1 -0
- package/models/operations/incidentgetbyid.js +68 -0
- package/models/operations/incidentgetbyid.js.map +1 -0
- package/models/operations/incidentlist.d.ts +73 -0
- package/models/operations/incidentlist.d.ts.map +1 -0
- package/models/operations/incidentlist.js +101 -0
- package/models/operations/incidentlist.js.map +1 -0
- package/models/operations/index.d.ts +4 -1
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +4 -1
- package/models/operations/index.js.map +1 -1
- package/models/operations/outboundbatchresults.d.ts +4 -0
- package/models/operations/outboundbatchresults.d.ts.map +1 -1
- package/models/operations/outboundbatchresults.js +6 -0
- package/models/operations/outboundbatchresults.js.map +1 -1
- package/models/operations/outboundbatchupload.d.ts +2 -2
- package/models/operations/outboundbatchupload.d.ts.map +1 -1
- package/models/operations/outboundbatchupload.js +4 -2
- package/models/operations/outboundbatchupload.js.map +1 -1
- package/models/operations/takeoutsgetbyjobid.d.ts +29 -0
- package/models/operations/takeoutsgetbyjobid.d.ts.map +1 -0
- package/models/operations/{gettakeoutapiv1takeoutsgetjobidget.js → takeoutsgetbyjobid.js} +17 -17
- package/models/operations/takeoutsgetbyjobid.js.map +1 -0
- package/openapi.json +1449 -224
- package/package.json +1 -1
- package/sdk/batches.d.ts +4 -4
- package/sdk/batches.d.ts.map +1 -1
- package/sdk/batches.js +9 -9
- package/sdk/batches.js.map +1 -1
- package/sdk/campaigns.d.ts +1 -1
- package/sdk/campaigns.d.ts.map +1 -1
- package/sdk/incidents.d.ts +48 -0
- package/sdk/incidents.d.ts.map +1 -0
- package/sdk/incidents.js +72 -0
- package/sdk/incidents.js.map +1 -0
- package/sdk/insights.d.ts +1 -1
- package/sdk/insights.js +1 -1
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/syllablesdktools.d.ts +9 -2
- package/sdk/syllablesdktools.d.ts.map +1 -1
- package/sdk/syllablesdktools.js +12 -2
- package/sdk/syllablesdktools.js.map +1 -1
- package/sdk/takeouts.d.ts +2 -2
- package/sdk/takeouts.d.ts.map +1 -1
- package/sdk/takeouts.js +6 -6
- package/sdk/takeouts.js.map +1 -1
- package/sdk/workflows.d.ts +1 -1
- package/sdk/workflows.js +1 -1
- package/src/funcs/incidentsCreate.ts +135 -0
- package/src/funcs/incidentsDelete.ts +147 -0
- package/src/funcs/incidentsGetById.ts +142 -0
- package/src/funcs/incidentsIncidentGetOrganizations.ts +112 -0
- package/src/funcs/incidentsList.ts +148 -0
- package/src/funcs/incidentsUpdate.ts +135 -0
- package/src/funcs/insightsList.ts +1 -1
- package/src/funcs/insightsToolsCreate.ts +4 -4
- package/src/funcs/insightsToolsInsightsToolTest.ts +136 -0
- package/src/funcs/insightsToolsUpdate.ts +1 -1
- package/src/funcs/insightsWorkflowsQueueSessionsWorkflow.ts +1 -1
- package/src/funcs/{outboundBatchesOutboundBatchAdd.ts → outboundBatchesAdd.ts} +1 -1
- package/src/funcs/outboundBatchesList.ts +3 -4
- package/src/funcs/{outboundBatchesOutboundBatchRemove.ts → outboundBatchesRemove.ts} +1 -1
- package/src/funcs/{outboundBatchesOutboundBatchResults.ts → outboundBatchesResults.ts} +8 -2
- package/src/funcs/outboundBatchesUpload.ts +23 -20
- package/src/funcs/outboundCampaignsList.ts +3 -4
- package/src/funcs/{takeoutsCreateTakeoutApiV1TakeoutsCreatePost.ts → takeoutsCreate.ts} +2 -2
- package/src/funcs/{takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.ts → takeoutsTakeoutsGetByJobId.ts} +4 -7
- package/src/lib/config.ts +2 -2
- package/src/models/components/bodyoutboundbatchdelete.ts +11 -2
- package/src/models/components/bodyoutboundbatchupload.ts +4 -4
- package/src/models/components/communicationrequest.ts +0 -23
- package/src/models/components/communicationrequestresult.ts +78 -30
- package/src/models/components/conversation.ts +18 -0
- package/src/models/components/incidentcreaterequest.ts +153 -0
- package/src/models/components/incidentorganizationresponse.ts +85 -0
- package/src/models/components/incidentproperties.ts +49 -0
- package/src/models/components/incidentresponse.ts +182 -0
- package/src/models/components/incidentupdaterequest.ts +182 -0
- package/src/models/components/index.ts +9 -1
- package/src/models/components/insighttooltestinput.ts +90 -0
- package/src/models/components/listresponsecommunicationbatch.ts +118 -0
- package/src/models/components/listresponseincidentresponse.ts +118 -0
- package/src/models/components/listresponseoutboundcampaign.ts +118 -0
- package/src/models/components/outboundcampaign.ts +14 -0
- package/src/models/components/outboundcampaigninput.ts +14 -0
- package/src/models/components/promptcreaterequest.ts +1 -1
- package/src/models/components/promptupdaterequest.ts +1 -1
- package/src/models/operations/incidentdelete.ts +79 -0
- package/src/models/operations/incidentgetbyid.ts +75 -0
- package/src/models/operations/incidentlist.ts +151 -0
- package/src/models/operations/index.ts +4 -1
- package/src/models/operations/outboundbatchresults.ts +10 -0
- package/src/models/operations/outboundbatchupload.ts +8 -4
- package/src/models/operations/takeoutsgetbyjobid.ts +75 -0
- package/src/sdk/batches.ts +10 -10
- package/src/sdk/campaigns.ts +1 -1
- package/src/sdk/incidents.ts +116 -0
- package/src/sdk/insights.ts +1 -1
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/syllablesdktools.ts +20 -2
- package/src/sdk/takeouts.ts +7 -7
- package/src/sdk/workflows.ts +1 -1
- package/funcs/outboundBatchesOutboundBatchAdd.d.ts.map +0 -1
- package/funcs/outboundBatchesOutboundBatchAdd.js.map +0 -1
- package/funcs/outboundBatchesOutboundBatchRemove.d.ts.map +0 -1
- package/funcs/outboundBatchesOutboundBatchRemove.js.map +0 -1
- package/funcs/outboundBatchesOutboundBatchResults.d.ts.map +0 -1
- package/funcs/outboundBatchesOutboundBatchResults.js.map +0 -1
- package/funcs/takeoutsCreateTakeoutApiV1TakeoutsCreatePost.d.ts.map +0 -1
- package/funcs/takeoutsCreateTakeoutApiV1TakeoutsCreatePost.js.map +0 -1
- package/funcs/takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.d.ts.map +0 -1
- package/funcs/takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.js.map +0 -1
- package/models/components/requeststatus.d.ts +0 -46
- package/models/components/requeststatus.d.ts.map +0 -1
- package/models/components/requeststatus.js.map +0 -1
- package/models/operations/gettakeoutapiv1takeoutsgetjobidget.d.ts +0 -29
- package/models/operations/gettakeoutapiv1takeoutsgetjobidget.d.ts.map +0 -1
- package/models/operations/gettakeoutapiv1takeoutsgetjobidget.js.map +0 -1
- package/src/models/components/requeststatus.ts +0 -43
- package/src/models/operations/gettakeoutapiv1takeoutsgetjobidget.ts +0 -87
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { SyllableSDKCore } from "../core.js";
|
|
7
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Delete Incident
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Delete an incident by ID
|
|
32
|
+
*/
|
|
33
|
+
export async function incidentsDelete(
|
|
34
|
+
client: SyllableSDKCore,
|
|
35
|
+
request: operations.IncidentDeleteRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): Promise<
|
|
38
|
+
Result<
|
|
39
|
+
any,
|
|
40
|
+
| errors.HTTPValidationError
|
|
41
|
+
| SDKError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
const parsed = safeParse(
|
|
51
|
+
request,
|
|
52
|
+
(value) => operations.IncidentDeleteRequest$outboundSchema.parse(value),
|
|
53
|
+
"Input validation failed",
|
|
54
|
+
);
|
|
55
|
+
if (!parsed.ok) {
|
|
56
|
+
return parsed;
|
|
57
|
+
}
|
|
58
|
+
const payload = parsed.value;
|
|
59
|
+
const body = null;
|
|
60
|
+
|
|
61
|
+
const pathParams = {
|
|
62
|
+
incident_id: encodeSimple("incident_id", payload.incident_id, {
|
|
63
|
+
explode: false,
|
|
64
|
+
charEncoding: "percent",
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const path = pathToFunc("/api/v1/incidents/{incident_id}")(pathParams);
|
|
69
|
+
|
|
70
|
+
const query = encodeFormQuery({
|
|
71
|
+
"reason": payload.reason,
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const headers = new Headers(compactMap({
|
|
75
|
+
Accept: "application/json",
|
|
76
|
+
}));
|
|
77
|
+
|
|
78
|
+
const secConfig = await extractSecurity(client._options.apiKeyHeader);
|
|
79
|
+
const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
|
|
80
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
81
|
+
|
|
82
|
+
const context = {
|
|
83
|
+
baseURL: options?.serverURL ?? "",
|
|
84
|
+
operationID: "incident_delete",
|
|
85
|
+
oAuth2Scopes: [],
|
|
86
|
+
|
|
87
|
+
resolvedSecurity: requestSecurity,
|
|
88
|
+
|
|
89
|
+
securitySource: client._options.apiKeyHeader,
|
|
90
|
+
retryConfig: options?.retries
|
|
91
|
+
|| client._options.retryConfig
|
|
92
|
+
|| { strategy: "none" },
|
|
93
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const requestRes = client._createRequest(context, {
|
|
97
|
+
security: requestSecurity,
|
|
98
|
+
method: "DELETE",
|
|
99
|
+
baseURL: options?.serverURL,
|
|
100
|
+
path: path,
|
|
101
|
+
headers: headers,
|
|
102
|
+
query: query,
|
|
103
|
+
body: body,
|
|
104
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
105
|
+
}, options);
|
|
106
|
+
if (!requestRes.ok) {
|
|
107
|
+
return requestRes;
|
|
108
|
+
}
|
|
109
|
+
const req = requestRes.value;
|
|
110
|
+
|
|
111
|
+
const doResult = await client._do(req, {
|
|
112
|
+
context,
|
|
113
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
114
|
+
retryConfig: context.retryConfig,
|
|
115
|
+
retryCodes: context.retryCodes,
|
|
116
|
+
});
|
|
117
|
+
if (!doResult.ok) {
|
|
118
|
+
return doResult;
|
|
119
|
+
}
|
|
120
|
+
const response = doResult.value;
|
|
121
|
+
|
|
122
|
+
const responseFields = {
|
|
123
|
+
HttpMeta: { Response: response, Request: req },
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const [result] = await M.match<
|
|
127
|
+
any,
|
|
128
|
+
| errors.HTTPValidationError
|
|
129
|
+
| SDKError
|
|
130
|
+
| SDKValidationError
|
|
131
|
+
| UnexpectedClientError
|
|
132
|
+
| InvalidRequestError
|
|
133
|
+
| RequestAbortedError
|
|
134
|
+
| RequestTimeoutError
|
|
135
|
+
| ConnectionError
|
|
136
|
+
>(
|
|
137
|
+
M.json(200, z.any()),
|
|
138
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
139
|
+
M.fail("4XX"),
|
|
140
|
+
M.fail("5XX"),
|
|
141
|
+
)(response, { extraFields: responseFields });
|
|
142
|
+
if (!result.ok) {
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return result;
|
|
147
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SyllableSDKCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get Incident By Id
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* Get incident by ID
|
|
32
|
+
*/
|
|
33
|
+
export async function incidentsGetById(
|
|
34
|
+
client: SyllableSDKCore,
|
|
35
|
+
request: operations.IncidentGetByIdRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): Promise<
|
|
38
|
+
Result<
|
|
39
|
+
components.IncidentResponse,
|
|
40
|
+
| errors.HTTPValidationError
|
|
41
|
+
| SDKError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
const parsed = safeParse(
|
|
51
|
+
request,
|
|
52
|
+
(value) => operations.IncidentGetByIdRequest$outboundSchema.parse(value),
|
|
53
|
+
"Input validation failed",
|
|
54
|
+
);
|
|
55
|
+
if (!parsed.ok) {
|
|
56
|
+
return parsed;
|
|
57
|
+
}
|
|
58
|
+
const payload = parsed.value;
|
|
59
|
+
const body = null;
|
|
60
|
+
|
|
61
|
+
const pathParams = {
|
|
62
|
+
incident_id: encodeSimple("incident_id", payload.incident_id, {
|
|
63
|
+
explode: false,
|
|
64
|
+
charEncoding: "percent",
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const path = pathToFunc("/api/v1/incidents/{incident_id}")(pathParams);
|
|
69
|
+
|
|
70
|
+
const headers = new Headers(compactMap({
|
|
71
|
+
Accept: "application/json",
|
|
72
|
+
}));
|
|
73
|
+
|
|
74
|
+
const secConfig = await extractSecurity(client._options.apiKeyHeader);
|
|
75
|
+
const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
|
|
76
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
77
|
+
|
|
78
|
+
const context = {
|
|
79
|
+
baseURL: options?.serverURL ?? "",
|
|
80
|
+
operationID: "incident_get_by_id",
|
|
81
|
+
oAuth2Scopes: [],
|
|
82
|
+
|
|
83
|
+
resolvedSecurity: requestSecurity,
|
|
84
|
+
|
|
85
|
+
securitySource: client._options.apiKeyHeader,
|
|
86
|
+
retryConfig: options?.retries
|
|
87
|
+
|| client._options.retryConfig
|
|
88
|
+
|| { strategy: "none" },
|
|
89
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const requestRes = client._createRequest(context, {
|
|
93
|
+
security: requestSecurity,
|
|
94
|
+
method: "GET",
|
|
95
|
+
baseURL: options?.serverURL,
|
|
96
|
+
path: path,
|
|
97
|
+
headers: headers,
|
|
98
|
+
body: body,
|
|
99
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
100
|
+
}, options);
|
|
101
|
+
if (!requestRes.ok) {
|
|
102
|
+
return requestRes;
|
|
103
|
+
}
|
|
104
|
+
const req = requestRes.value;
|
|
105
|
+
|
|
106
|
+
const doResult = await client._do(req, {
|
|
107
|
+
context,
|
|
108
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
109
|
+
retryConfig: context.retryConfig,
|
|
110
|
+
retryCodes: context.retryCodes,
|
|
111
|
+
});
|
|
112
|
+
if (!doResult.ok) {
|
|
113
|
+
return doResult;
|
|
114
|
+
}
|
|
115
|
+
const response = doResult.value;
|
|
116
|
+
|
|
117
|
+
const responseFields = {
|
|
118
|
+
HttpMeta: { Response: response, Request: req },
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const [result] = await M.match<
|
|
122
|
+
components.IncidentResponse,
|
|
123
|
+
| errors.HTTPValidationError
|
|
124
|
+
| SDKError
|
|
125
|
+
| SDKValidationError
|
|
126
|
+
| UnexpectedClientError
|
|
127
|
+
| InvalidRequestError
|
|
128
|
+
| RequestAbortedError
|
|
129
|
+
| RequestTimeoutError
|
|
130
|
+
| ConnectionError
|
|
131
|
+
>(
|
|
132
|
+
M.json(200, components.IncidentResponse$inboundSchema),
|
|
133
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
134
|
+
M.fail("4XX"),
|
|
135
|
+
M.fail("5XX"),
|
|
136
|
+
)(response, { extraFields: responseFields });
|
|
137
|
+
if (!result.ok) {
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { SyllableSDKCore } from "../core.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 * as components from "../models/components/index.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import { Result } from "../types/fp.js";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get Organizations
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Get all organizations
|
|
29
|
+
*/
|
|
30
|
+
export async function incidentsIncidentGetOrganizations(
|
|
31
|
+
client: SyllableSDKCore,
|
|
32
|
+
options?: RequestOptions,
|
|
33
|
+
): Promise<
|
|
34
|
+
Result<
|
|
35
|
+
Array<components.IncidentOrganizationResponse>,
|
|
36
|
+
| SDKError
|
|
37
|
+
| SDKValidationError
|
|
38
|
+
| UnexpectedClientError
|
|
39
|
+
| InvalidRequestError
|
|
40
|
+
| RequestAbortedError
|
|
41
|
+
| RequestTimeoutError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
>
|
|
44
|
+
> {
|
|
45
|
+
const path = pathToFunc("/api/v1/incidents/organizations")();
|
|
46
|
+
|
|
47
|
+
const headers = new Headers(compactMap({
|
|
48
|
+
Accept: "application/json",
|
|
49
|
+
}));
|
|
50
|
+
|
|
51
|
+
const secConfig = await extractSecurity(client._options.apiKeyHeader);
|
|
52
|
+
const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
|
|
53
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
54
|
+
|
|
55
|
+
const context = {
|
|
56
|
+
baseURL: options?.serverURL ?? "",
|
|
57
|
+
operationID: "incident_get_organizations",
|
|
58
|
+
oAuth2Scopes: [],
|
|
59
|
+
|
|
60
|
+
resolvedSecurity: requestSecurity,
|
|
61
|
+
|
|
62
|
+
securitySource: client._options.apiKeyHeader,
|
|
63
|
+
retryConfig: options?.retries
|
|
64
|
+
|| client._options.retryConfig
|
|
65
|
+
|| { strategy: "none" },
|
|
66
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const requestRes = client._createRequest(context, {
|
|
70
|
+
security: requestSecurity,
|
|
71
|
+
method: "GET",
|
|
72
|
+
baseURL: options?.serverURL,
|
|
73
|
+
path: path,
|
|
74
|
+
headers: headers,
|
|
75
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
76
|
+
}, options);
|
|
77
|
+
if (!requestRes.ok) {
|
|
78
|
+
return requestRes;
|
|
79
|
+
}
|
|
80
|
+
const req = requestRes.value;
|
|
81
|
+
|
|
82
|
+
const doResult = await client._do(req, {
|
|
83
|
+
context,
|
|
84
|
+
errorCodes: ["4XX", "5XX"],
|
|
85
|
+
retryConfig: context.retryConfig,
|
|
86
|
+
retryCodes: context.retryCodes,
|
|
87
|
+
});
|
|
88
|
+
if (!doResult.ok) {
|
|
89
|
+
return doResult;
|
|
90
|
+
}
|
|
91
|
+
const response = doResult.value;
|
|
92
|
+
|
|
93
|
+
const [result] = await M.match<
|
|
94
|
+
Array<components.IncidentOrganizationResponse>,
|
|
95
|
+
| SDKError
|
|
96
|
+
| SDKValidationError
|
|
97
|
+
| UnexpectedClientError
|
|
98
|
+
| InvalidRequestError
|
|
99
|
+
| RequestAbortedError
|
|
100
|
+
| RequestTimeoutError
|
|
101
|
+
| ConnectionError
|
|
102
|
+
>(
|
|
103
|
+
M.json(200, z.array(components.IncidentOrganizationResponse$inboundSchema)),
|
|
104
|
+
M.fail("4XX"),
|
|
105
|
+
M.fail("5XX"),
|
|
106
|
+
)(response);
|
|
107
|
+
if (!result.ok) {
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SyllableSDKCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* List Incidents
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* List service incidents with pagination and filtering
|
|
32
|
+
*/
|
|
33
|
+
export async function incidentsList(
|
|
34
|
+
client: SyllableSDKCore,
|
|
35
|
+
request: operations.IncidentListRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): Promise<
|
|
38
|
+
Result<
|
|
39
|
+
components.ListResponseIncidentResponse,
|
|
40
|
+
| errors.HTTPValidationError
|
|
41
|
+
| SDKError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
const parsed = safeParse(
|
|
51
|
+
request,
|
|
52
|
+
(value) => operations.IncidentListRequest$outboundSchema.parse(value),
|
|
53
|
+
"Input validation failed",
|
|
54
|
+
);
|
|
55
|
+
if (!parsed.ok) {
|
|
56
|
+
return parsed;
|
|
57
|
+
}
|
|
58
|
+
const payload = parsed.value;
|
|
59
|
+
const body = null;
|
|
60
|
+
|
|
61
|
+
const path = pathToFunc("/api/v1/incidents/")();
|
|
62
|
+
|
|
63
|
+
const query = encodeFormQuery({
|
|
64
|
+
"end_datetime": payload.end_datetime,
|
|
65
|
+
"fields": payload.fields,
|
|
66
|
+
"limit": payload.limit,
|
|
67
|
+
"order_by": payload.order_by,
|
|
68
|
+
"order_by_direction": payload.order_by_direction,
|
|
69
|
+
"page": payload.page,
|
|
70
|
+
"search_field_values": payload.search_field_values,
|
|
71
|
+
"search_fields": payload.search_fields,
|
|
72
|
+
"start_datetime": payload.start_datetime,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const headers = new Headers(compactMap({
|
|
76
|
+
Accept: "application/json",
|
|
77
|
+
}));
|
|
78
|
+
|
|
79
|
+
const secConfig = await extractSecurity(client._options.apiKeyHeader);
|
|
80
|
+
const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
|
|
81
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
82
|
+
|
|
83
|
+
const context = {
|
|
84
|
+
baseURL: options?.serverURL ?? "",
|
|
85
|
+
operationID: "incident_list",
|
|
86
|
+
oAuth2Scopes: [],
|
|
87
|
+
|
|
88
|
+
resolvedSecurity: requestSecurity,
|
|
89
|
+
|
|
90
|
+
securitySource: client._options.apiKeyHeader,
|
|
91
|
+
retryConfig: options?.retries
|
|
92
|
+
|| client._options.retryConfig
|
|
93
|
+
|| { strategy: "none" },
|
|
94
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const requestRes = client._createRequest(context, {
|
|
98
|
+
security: requestSecurity,
|
|
99
|
+
method: "GET",
|
|
100
|
+
baseURL: options?.serverURL,
|
|
101
|
+
path: path,
|
|
102
|
+
headers: headers,
|
|
103
|
+
query: query,
|
|
104
|
+
body: body,
|
|
105
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
106
|
+
}, options);
|
|
107
|
+
if (!requestRes.ok) {
|
|
108
|
+
return requestRes;
|
|
109
|
+
}
|
|
110
|
+
const req = requestRes.value;
|
|
111
|
+
|
|
112
|
+
const doResult = await client._do(req, {
|
|
113
|
+
context,
|
|
114
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
115
|
+
retryConfig: context.retryConfig,
|
|
116
|
+
retryCodes: context.retryCodes,
|
|
117
|
+
});
|
|
118
|
+
if (!doResult.ok) {
|
|
119
|
+
return doResult;
|
|
120
|
+
}
|
|
121
|
+
const response = doResult.value;
|
|
122
|
+
|
|
123
|
+
const responseFields = {
|
|
124
|
+
HttpMeta: { Response: response, Request: req },
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const [result] = await M.match<
|
|
128
|
+
components.ListResponseIncidentResponse,
|
|
129
|
+
| errors.HTTPValidationError
|
|
130
|
+
| SDKError
|
|
131
|
+
| SDKValidationError
|
|
132
|
+
| UnexpectedClientError
|
|
133
|
+
| InvalidRequestError
|
|
134
|
+
| RequestAbortedError
|
|
135
|
+
| RequestTimeoutError
|
|
136
|
+
| ConnectionError
|
|
137
|
+
>(
|
|
138
|
+
M.json(200, components.ListResponseIncidentResponse$inboundSchema),
|
|
139
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
140
|
+
M.fail("4XX"),
|
|
141
|
+
M.fail("5XX"),
|
|
142
|
+
)(response, { extraFields: responseFields });
|
|
143
|
+
if (!result.ok) {
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SyllableSDKCore } from "../core.js";
|
|
6
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as components from "../models/components/index.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Update Incident
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Update an existing incident
|
|
31
|
+
*/
|
|
32
|
+
export async function incidentsUpdate(
|
|
33
|
+
client: SyllableSDKCore,
|
|
34
|
+
request: components.IncidentUpdateRequest,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): Promise<
|
|
37
|
+
Result<
|
|
38
|
+
components.IncidentResponse,
|
|
39
|
+
| errors.HTTPValidationError
|
|
40
|
+
| SDKError
|
|
41
|
+
| SDKValidationError
|
|
42
|
+
| UnexpectedClientError
|
|
43
|
+
| InvalidRequestError
|
|
44
|
+
| RequestAbortedError
|
|
45
|
+
| RequestTimeoutError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
>
|
|
48
|
+
> {
|
|
49
|
+
const parsed = safeParse(
|
|
50
|
+
request,
|
|
51
|
+
(value) => components.IncidentUpdateRequest$outboundSchema.parse(value),
|
|
52
|
+
"Input validation failed",
|
|
53
|
+
);
|
|
54
|
+
if (!parsed.ok) {
|
|
55
|
+
return parsed;
|
|
56
|
+
}
|
|
57
|
+
const payload = parsed.value;
|
|
58
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
59
|
+
|
|
60
|
+
const path = pathToFunc("/api/v1/incidents/")();
|
|
61
|
+
|
|
62
|
+
const headers = new Headers(compactMap({
|
|
63
|
+
"Content-Type": "application/json",
|
|
64
|
+
Accept: "application/json",
|
|
65
|
+
}));
|
|
66
|
+
|
|
67
|
+
const secConfig = await extractSecurity(client._options.apiKeyHeader);
|
|
68
|
+
const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
|
|
69
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
70
|
+
|
|
71
|
+
const context = {
|
|
72
|
+
baseURL: options?.serverURL ?? "",
|
|
73
|
+
operationID: "incident_update",
|
|
74
|
+
oAuth2Scopes: [],
|
|
75
|
+
|
|
76
|
+
resolvedSecurity: requestSecurity,
|
|
77
|
+
|
|
78
|
+
securitySource: client._options.apiKeyHeader,
|
|
79
|
+
retryConfig: options?.retries
|
|
80
|
+
|| client._options.retryConfig
|
|
81
|
+
|| { strategy: "none" },
|
|
82
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const requestRes = client._createRequest(context, {
|
|
86
|
+
security: requestSecurity,
|
|
87
|
+
method: "PUT",
|
|
88
|
+
baseURL: options?.serverURL,
|
|
89
|
+
path: path,
|
|
90
|
+
headers: headers,
|
|
91
|
+
body: body,
|
|
92
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
93
|
+
}, options);
|
|
94
|
+
if (!requestRes.ok) {
|
|
95
|
+
return requestRes;
|
|
96
|
+
}
|
|
97
|
+
const req = requestRes.value;
|
|
98
|
+
|
|
99
|
+
const doResult = await client._do(req, {
|
|
100
|
+
context,
|
|
101
|
+
errorCodes: ["422", "4XX", "5XX"],
|
|
102
|
+
retryConfig: context.retryConfig,
|
|
103
|
+
retryCodes: context.retryCodes,
|
|
104
|
+
});
|
|
105
|
+
if (!doResult.ok) {
|
|
106
|
+
return doResult;
|
|
107
|
+
}
|
|
108
|
+
const response = doResult.value;
|
|
109
|
+
|
|
110
|
+
const responseFields = {
|
|
111
|
+
HttpMeta: { Response: response, Request: req },
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const [result] = await M.match<
|
|
115
|
+
components.IncidentResponse,
|
|
116
|
+
| errors.HTTPValidationError
|
|
117
|
+
| SDKError
|
|
118
|
+
| SDKValidationError
|
|
119
|
+
| UnexpectedClientError
|
|
120
|
+
| InvalidRequestError
|
|
121
|
+
| RequestAbortedError
|
|
122
|
+
| RequestTimeoutError
|
|
123
|
+
| ConnectionError
|
|
124
|
+
>(
|
|
125
|
+
M.json(200, components.IncidentResponse$inboundSchema),
|
|
126
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
127
|
+
M.fail("4XX"),
|
|
128
|
+
M.fail("5XX"),
|
|
129
|
+
)(response, { extraFields: responseFields });
|
|
130
|
+
if (!result.ok) {
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return result;
|
|
135
|
+
}
|