Skip to content

Commit 66a5935

Browse files
committed
add documentation ignore to healthcheck
1 parent 4d083ec commit 66a5935

File tree

3 files changed

+526
-0
lines changed

3 files changed

+526
-0
lines changed

src/funcs/generateRandomNumber.ts

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
/*
2+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3+
*/
4+
5+
import { NovuCore } 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 {
14+
ConnectionError,
15+
InvalidRequestError,
16+
RequestAbortedError,
17+
RequestTimeoutError,
18+
UnexpectedClientError,
19+
} from "../models/errors/httpclienterrors.js";
20+
import * as errors from "../models/errors/index.js";
21+
import { SDKError } from "../models/errors/sdkerror.js";
22+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23+
import * as operations from "../models/operations/index.js";
24+
import { Result } from "../types/fp.js";
25+
26+
export async function generateRandomNumber(
27+
client: NovuCore,
28+
idempotencyKey?: string | undefined,
29+
options?: RequestOptions,
30+
): Promise<
31+
Result<
32+
operations.HealthControllerGenerateRandomNumberResponse,
33+
| errors.ErrorDto
34+
| errors.ErrorDto
35+
| errors.ValidationErrorDto
36+
| errors.ErrorDto
37+
| SDKError
38+
| SDKValidationError
39+
| UnexpectedClientError
40+
| InvalidRequestError
41+
| RequestAbortedError
42+
| RequestTimeoutError
43+
| ConnectionError
44+
>
45+
> {
46+
const input: operations.HealthControllerGenerateRandomNumberRequest = {
47+
idempotencyKey: idempotencyKey,
48+
};
49+
50+
const parsed = safeParse(
51+
input,
52+
(value) =>
53+
operations.HealthControllerGenerateRandomNumberRequest$outboundSchema
54+
.parse(value),
55+
"Input validation failed",
56+
);
57+
if (!parsed.ok) {
58+
return parsed;
59+
}
60+
const payload = parsed.value;
61+
const body = null;
62+
63+
const path = pathToFunc("/v1/health-check/test-idempotency")();
64+
65+
const headers = new Headers(compactMap({
66+
Accept: "application/json",
67+
"idempotency-key": encodeSimple(
68+
"idempotency-key",
69+
payload["idempotency-key"],
70+
{ explode: false, charEncoding: "none" },
71+
),
72+
}));
73+
74+
const secConfig = await extractSecurity(client._options.apiKey);
75+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
76+
const requestSecurity = resolveGlobalSecurity(securityInput);
77+
78+
const context = {
79+
operationID: "HealthController_generateRandomNumber",
80+
oAuth2Scopes: [],
81+
82+
resolvedSecurity: requestSecurity,
83+
84+
securitySource: client._options.apiKey,
85+
retryConfig: options?.retries
86+
|| client._options.retryConfig
87+
|| {
88+
strategy: "backoff",
89+
backoff: {
90+
initialInterval: 1000,
91+
maxInterval: 30000,
92+
exponent: 1.5,
93+
maxElapsedTime: 3600000,
94+
},
95+
retryConnectionErrors: true,
96+
}
97+
|| { strategy: "none" },
98+
retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
99+
};
100+
101+
const requestRes = client._createRequest(context, {
102+
security: requestSecurity,
103+
method: "GET",
104+
baseURL: options?.serverURL,
105+
path: path,
106+
headers: headers,
107+
body: body,
108+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
109+
}, options);
110+
if (!requestRes.ok) {
111+
return requestRes;
112+
}
113+
const req = requestRes.value;
114+
115+
const doResult = await client._do(req, {
116+
context,
117+
errorCodes: [
118+
"400",
119+
"401",
120+
"403",
121+
"404",
122+
"405",
123+
"409",
124+
"413",
125+
"414",
126+
"415",
127+
"422",
128+
"429",
129+
"4XX",
130+
"500",
131+
"503",
132+
"5XX",
133+
],
134+
retryConfig: context.retryConfig,
135+
retryCodes: context.retryCodes,
136+
});
137+
if (!doResult.ok) {
138+
return doResult;
139+
}
140+
const response = doResult.value;
141+
142+
const responseFields = {
143+
HttpMeta: { Response: response, Request: req },
144+
};
145+
146+
const [result] = await M.match<
147+
operations.HealthControllerGenerateRandomNumberResponse,
148+
| errors.ErrorDto
149+
| errors.ErrorDto
150+
| errors.ValidationErrorDto
151+
| errors.ErrorDto
152+
| SDKError
153+
| SDKValidationError
154+
| UnexpectedClientError
155+
| InvalidRequestError
156+
| RequestAbortedError
157+
| RequestTimeoutError
158+
| ConnectionError
159+
>(
160+
M.json(
161+
201,
162+
operations.HealthControllerGenerateRandomNumberResponse$inboundSchema,
163+
{ hdrs: true, key: "Result" },
164+
),
165+
M.jsonErr(
166+
[400, 401, 403, 404, 405, 409, 413, 415],
167+
errors.ErrorDto$inboundSchema,
168+
{ hdrs: true },
169+
),
170+
M.jsonErr(414, errors.ErrorDto$inboundSchema),
171+
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
172+
M.fail(429),
173+
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
174+
M.fail(503),
175+
M.fail("4XX"),
176+
M.fail("5XX"),
177+
)(response, { extraFields: responseFields });
178+
if (!result.ok) {
179+
return result;
180+
}
181+
182+
return result;
183+
}
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
/*
2+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3+
*/
4+
5+
import { NovuCore } 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 {
14+
ConnectionError,
15+
InvalidRequestError,
16+
RequestAbortedError,
17+
RequestTimeoutError,
18+
UnexpectedClientError,
19+
} from "../models/errors/httpclienterrors.js";
20+
import * as errors from "../models/errors/index.js";
21+
import { SDKError } from "../models/errors/sdkerror.js";
22+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23+
import * as operations from "../models/operations/index.js";
24+
import { Result } from "../types/fp.js";
25+
26+
export async function healthControllerHealthCheck(
27+
client: NovuCore,
28+
idempotencyKey?: string | undefined,
29+
options?: RequestOptions,
30+
): Promise<
31+
Result<
32+
operations.HealthControllerHealthCheckResponseBody,
33+
| errors.HealthControllerHealthCheckResponseBody
34+
| SDKError
35+
| SDKValidationError
36+
| UnexpectedClientError
37+
| InvalidRequestError
38+
| RequestAbortedError
39+
| RequestTimeoutError
40+
| ConnectionError
41+
>
42+
> {
43+
const input: operations.HealthControllerHealthCheckRequest = {
44+
idempotencyKey: idempotencyKey,
45+
};
46+
47+
const parsed = safeParse(
48+
input,
49+
(value) =>
50+
operations.HealthControllerHealthCheckRequest$outboundSchema.parse(value),
51+
"Input validation failed",
52+
);
53+
if (!parsed.ok) {
54+
return parsed;
55+
}
56+
const payload = parsed.value;
57+
const body = null;
58+
59+
const path = pathToFunc("/v1/health-check")();
60+
61+
const headers = new Headers(compactMap({
62+
Accept: "application/json",
63+
"idempotency-key": encodeSimple(
64+
"idempotency-key",
65+
payload["idempotency-key"],
66+
{ explode: false, charEncoding: "none" },
67+
),
68+
}));
69+
70+
const secConfig = await extractSecurity(client._options.apiKey);
71+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
72+
const requestSecurity = resolveGlobalSecurity(securityInput);
73+
74+
const context = {
75+
operationID: "HealthController_healthCheck",
76+
oAuth2Scopes: [],
77+
78+
resolvedSecurity: requestSecurity,
79+
80+
securitySource: client._options.apiKey,
81+
retryConfig: options?.retries
82+
|| client._options.retryConfig
83+
|| {
84+
strategy: "backoff",
85+
backoff: {
86+
initialInterval: 1000,
87+
maxInterval: 30000,
88+
exponent: 1.5,
89+
maxElapsedTime: 3600000,
90+
},
91+
retryConnectionErrors: true,
92+
}
93+
|| { strategy: "none" },
94+
retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
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+
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: ["4XX", "503", "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+
operations.HealthControllerHealthCheckResponseBody,
128+
| errors.HealthControllerHealthCheckResponseBody
129+
| SDKError
130+
| SDKValidationError
131+
| UnexpectedClientError
132+
| InvalidRequestError
133+
| RequestAbortedError
134+
| RequestTimeoutError
135+
| ConnectionError
136+
>(
137+
M.json(
138+
200,
139+
operations.HealthControllerHealthCheckResponseBody$inboundSchema,
140+
),
141+
M.jsonErr(
142+
503,
143+
errors.HealthControllerHealthCheckResponseBody$inboundSchema,
144+
),
145+
M.fail("4XX"),
146+
M.fail("5XX"),
147+
)(response, { extraFields: responseFields });
148+
if (!result.ok) {
149+
return result;
150+
}
151+
152+
return result;
153+
}

0 commit comments

Comments
 (0)