@censys/platform-sdk 0.4.3 → 0.5.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.
Files changed (177) hide show
  1. package/FUNCTIONS.md +0 -1
  2. package/README.md +17 -2
  3. package/docs/sdks/collections/README.md +12 -6
  4. package/docs/sdks/globaldata/README.md +347 -6
  5. package/docs/sdks/threathunting/README.md +248 -0
  6. package/examples/globalDataSearch.example.ts +0 -1
  7. package/examples/package-lock.json +5 -6
  8. package/funcs/globalDataCreateTrackedScan.d.ts +18 -0
  9. package/funcs/globalDataCreateTrackedScan.d.ts.map +1 -0
  10. package/funcs/globalDataCreateTrackedScan.js +132 -0
  11. package/funcs/globalDataCreateTrackedScan.js.map +1 -0
  12. package/funcs/globalDataGetHostObservationsWithCertificate.d.ts +18 -0
  13. package/funcs/globalDataGetHostObservationsWithCertificate.d.ts.map +1 -0
  14. package/funcs/globalDataGetHostObservationsWithCertificate.js +141 -0
  15. package/funcs/globalDataGetHostObservationsWithCertificate.js.map +1 -0
  16. package/funcs/globalDataGetTrackedScan.d.ts +19 -0
  17. package/funcs/globalDataGetTrackedScan.d.ts.map +1 -0
  18. package/funcs/globalDataGetTrackedScan.js +137 -0
  19. package/funcs/globalDataGetTrackedScan.js.map +1 -0
  20. package/funcs/globalDataGetTrackedScanThreatHunting.d.ts +19 -0
  21. package/funcs/globalDataGetTrackedScanThreatHunting.d.ts.map +1 -0
  22. package/funcs/globalDataGetTrackedScanThreatHunting.js +137 -0
  23. package/funcs/globalDataGetTrackedScanThreatHunting.js.map +1 -0
  24. package/funcs/threatHuntingCreateTrackedScan.d.ts +18 -0
  25. package/funcs/threatHuntingCreateTrackedScan.d.ts.map +1 -0
  26. package/funcs/threatHuntingCreateTrackedScan.js +129 -0
  27. package/funcs/threatHuntingCreateTrackedScan.js.map +1 -0
  28. package/jsr.json +1 -1
  29. package/lib/config.d.ts +4 -4
  30. package/lib/config.js +4 -4
  31. package/models/components/elasticsearch.d.ts +3 -0
  32. package/models/components/elasticsearch.d.ts.map +1 -1
  33. package/models/components/elasticsearch.js +5 -0
  34. package/models/components/elasticsearch.js.map +1 -1
  35. package/models/components/elasticsearcherrormessage.d.ts +33 -0
  36. package/models/components/elasticsearcherrormessage.d.ts.map +1 -0
  37. package/models/components/elasticsearcherrormessage.js +73 -0
  38. package/models/components/elasticsearcherrormessage.js.map +1 -0
  39. package/models/components/hostobservationrange.d.ts +39 -0
  40. package/models/components/hostobservationrange.d.ts.map +1 -0
  41. package/models/components/hostobservationrange.js +92 -0
  42. package/models/components/hostobservationrange.js.map +1 -0
  43. package/models/components/hostobservationresponse.d.ts +34 -0
  44. package/models/components/hostobservationresponse.d.ts.map +1 -0
  45. package/models/components/hostobservationresponse.js +85 -0
  46. package/models/components/hostobservationresponse.js.map +1 -0
  47. package/models/components/httpfavicon.d.ts +5 -0
  48. package/models/components/httpfavicon.d.ts.map +1 -1
  49. package/models/components/httpfavicon.js +4 -0
  50. package/models/components/httpfavicon.js.map +1 -1
  51. package/models/components/index.d.ts +14 -0
  52. package/models/components/index.d.ts.map +1 -1
  53. package/models/components/index.js +14 -0
  54. package/models/components/index.js.map +1 -1
  55. package/models/components/responseenvelopehostobservationresponse.d.ts +30 -0
  56. package/models/components/responseenvelopehostobservationresponse.d.ts.map +1 -0
  57. package/models/components/responseenvelopehostobservationresponse.js +70 -0
  58. package/models/components/responseenvelopehostobservationresponse.js.map +1 -0
  59. package/models/components/responseenvelopetrackedscan.d.ts +30 -0
  60. package/models/components/responseenvelopetrackedscan.d.ts.map +1 -0
  61. package/models/components/responseenvelopetrackedscan.js +70 -0
  62. package/models/components/responseenvelopetrackedscan.js.map +1 -0
  63. package/models/components/scansdiscoveryinputbody.d.ts +172 -0
  64. package/models/components/scansdiscoveryinputbody.d.ts.map +1 -0
  65. package/models/components/scansdiscoveryinputbody.js +233 -0
  66. package/models/components/scansdiscoveryinputbody.js.map +1 -0
  67. package/models/components/scansrescaninputbody.d.ts +214 -0
  68. package/models/components/scansrescaninputbody.d.ts.map +1 -0
  69. package/models/components/scansrescaninputbody.js +268 -0
  70. package/models/components/scansrescaninputbody.js.map +1 -0
  71. package/models/components/screenshot.d.ts +2 -0
  72. package/models/components/screenshot.d.ts.map +1 -1
  73. package/models/components/screenshot.js +11 -0
  74. package/models/components/screenshot.js.map +1 -1
  75. package/models/components/searchaggregateinputbody.d.ts +5 -0
  76. package/models/components/searchaggregateinputbody.d.ts.map +1 -1
  77. package/models/components/searchaggregateinputbody.js +4 -0
  78. package/models/components/searchaggregateinputbody.js.map +1 -1
  79. package/models/components/searchvaluecountsinputbody.d.ts +5 -0
  80. package/models/components/searchvaluecountsinputbody.d.ts.map +1 -1
  81. package/models/components/searchvaluecountsinputbody.js +2 -0
  82. package/models/components/searchvaluecountsinputbody.js.map +1 -1
  83. package/models/components/serviceid.d.ts +70 -0
  84. package/models/components/serviceid.d.ts.map +1 -0
  85. package/models/components/serviceid.js +106 -0
  86. package/models/components/serviceid.js.map +1 -0
  87. package/models/components/trackedscan.d.ts +39 -0
  88. package/models/components/trackedscan.d.ts.map +1 -0
  89. package/models/components/trackedscan.js +90 -0
  90. package/models/components/trackedscan.js.map +1 -0
  91. package/models/components/trackedscanscantarget.d.ts +39 -0
  92. package/models/components/trackedscanscantarget.d.ts.map +1 -0
  93. package/models/components/trackedscanscantarget.js +94 -0
  94. package/models/components/trackedscanscantarget.js.map +1 -0
  95. package/models/components/trackedscanscantargethostnameport.d.ts +31 -0
  96. package/models/components/trackedscanscantargethostnameport.d.ts.map +1 -0
  97. package/models/components/trackedscanscantargethostnameport.js +71 -0
  98. package/models/components/trackedscanscantargethostnameport.js.map +1 -0
  99. package/models/components/trackedscanscantargethostport.d.ts +31 -0
  100. package/models/components/trackedscanscantargethostport.d.ts.map +1 -0
  101. package/models/components/trackedscanscantargethostport.js +71 -0
  102. package/models/components/trackedscanscantargethostport.js.map +1 -0
  103. package/models/components/trackedscantask.d.ts +74 -0
  104. package/models/components/trackedscantask.d.ts.map +1 -0
  105. package/models/components/trackedscantask.js +106 -0
  106. package/models/components/trackedscantask.js.map +1 -0
  107. package/models/components/weborigin.d.ts +31 -0
  108. package/models/components/weborigin.d.ts.map +1 -0
  109. package/models/components/weborigin.js +71 -0
  110. package/models/components/weborigin.js.map +1 -0
  111. package/models/operations/index.d.ts +5 -0
  112. package/models/operations/index.d.ts.map +1 -1
  113. package/models/operations/index.js +5 -0
  114. package/models/operations/index.js.map +1 -1
  115. package/models/operations/v3globaldatagethostobservationswithcertificate.d.ts +124 -0
  116. package/models/operations/v3globaldatagethostobservationswithcertificate.d.ts.map +1 -0
  117. package/models/operations/v3globaldatagethostobservationswithcertificate.js +178 -0
  118. package/models/operations/v3globaldatagethostobservationswithcertificate.js.map +1 -0
  119. package/models/operations/v3globaldatascansget.d.ts +94 -0
  120. package/models/operations/v3globaldatascansget.d.ts.map +1 -0
  121. package/models/operations/v3globaldatascansget.js +157 -0
  122. package/models/operations/v3globaldatascansget.js.map +1 -0
  123. package/models/operations/v3globaldatascansrescan.d.ts +91 -0
  124. package/models/operations/v3globaldatascansrescan.d.ts.map +1 -0
  125. package/models/operations/v3globaldatascansrescan.js +157 -0
  126. package/models/operations/v3globaldatascansrescan.js.map +1 -0
  127. package/models/operations/v3threathuntingscansdiscovery.d.ts +91 -0
  128. package/models/operations/v3threathuntingscansdiscovery.d.ts.map +1 -0
  129. package/models/operations/v3threathuntingscansdiscovery.js +157 -0
  130. package/models/operations/v3threathuntingscansdiscovery.js.map +1 -0
  131. package/models/operations/v3threathuntingscansget.d.ts +94 -0
  132. package/models/operations/v3threathuntingscansget.d.ts.map +1 -0
  133. package/models/operations/v3threathuntingscansget.js +157 -0
  134. package/models/operations/v3threathuntingscansget.js.map +1 -0
  135. package/package.json +4 -5
  136. package/sdk/globaldata.d.ts +30 -0
  137. package/sdk/globaldata.d.ts.map +1 -1
  138. package/sdk/globaldata.js +42 -0
  139. package/sdk/globaldata.js.map +1 -1
  140. package/sdk/threathunting.d.ts +23 -0
  141. package/sdk/threathunting.d.ts.map +1 -1
  142. package/sdk/threathunting.js +32 -0
  143. package/sdk/threathunting.js.map +1 -1
  144. package/src/funcs/globalDataCreateTrackedScan.ts +185 -0
  145. package/src/funcs/globalDataGetHostObservationsWithCertificate.ts +201 -0
  146. package/src/funcs/globalDataGetTrackedScan.ts +191 -0
  147. package/src/funcs/globalDataGetTrackedScanThreatHunting.ts +191 -0
  148. package/src/funcs/threatHuntingCreateTrackedScan.ts +188 -0
  149. package/src/lib/config.ts +4 -4
  150. package/src/models/components/elasticsearch.ts +12 -0
  151. package/src/models/components/elasticsearcherrormessage.ts +74 -0
  152. package/src/models/components/hostobservationrange.ts +99 -0
  153. package/src/models/components/hostobservationresponse.ts +91 -0
  154. package/src/models/components/httpfavicon.ts +9 -0
  155. package/src/models/components/index.ts +14 -0
  156. package/src/models/components/responseenvelopehostobservationresponse.ts +83 -0
  157. package/src/models/components/responseenvelopetrackedscan.ts +74 -0
  158. package/src/models/components/scansdiscoveryinputbody.ts +385 -0
  159. package/src/models/components/scansrescaninputbody.ts +428 -0
  160. package/src/models/components/screenshot.ts +13 -0
  161. package/src/models/components/searchaggregateinputbody.ts +9 -0
  162. package/src/models/components/searchvaluecountsinputbody.ts +7 -0
  163. package/src/models/components/serviceid.ts +116 -0
  164. package/src/models/components/trackedscan.ts +101 -0
  165. package/src/models/components/trackedscanscantarget.ts +117 -0
  166. package/src/models/components/trackedscanscantargethostnameport.ts +73 -0
  167. package/src/models/components/trackedscanscantargethostport.ts +72 -0
  168. package/src/models/components/trackedscantask.ts +114 -0
  169. package/src/models/components/weborigin.ts +66 -0
  170. package/src/models/operations/index.ts +5 -0
  171. package/src/models/operations/v3globaldatagethostobservationswithcertificate.ts +317 -0
  172. package/src/models/operations/v3globaldatascansget.ts +232 -0
  173. package/src/models/operations/v3globaldatascansrescan.ts +229 -0
  174. package/src/models/operations/v3threathuntingscansdiscovery.ts +238 -0
  175. package/src/models/operations/v3threathuntingscansget.ts +232 -0
  176. package/src/sdk/globaldata.ts +76 -0
  177. package/src/sdk/threathunting.ts +56 -0
@@ -0,0 +1,385 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type HostnamePort = {
12
+ /**
13
+ * Hostname to scan
14
+ */
15
+ hostname: string;
16
+ /**
17
+ * Port number to scan
18
+ */
19
+ port: number;
20
+ };
21
+
22
+ /**
23
+ * Discovery scan against hostname:PORT
24
+ */
25
+ export type Target2 = {
26
+ hostnamePort: HostnamePort;
27
+ };
28
+
29
+ export type HostPort = {
30
+ /**
31
+ * IP address to scan
32
+ */
33
+ ip: string;
34
+ /**
35
+ * Port number to scan
36
+ */
37
+ port: number;
38
+ };
39
+
40
+ /**
41
+ * Discovery scan against IP:PORT
42
+ */
43
+ export type Target1 = {
44
+ hostPort: HostPort;
45
+ };
46
+
47
+ export type ScansDiscoveryInputBodyTarget = Target1 | Target2;
48
+
49
+ export type ScansDiscoveryInputBody = {
50
+ target: Target1 | Target2;
51
+ };
52
+
53
+ /** @internal */
54
+ export const HostnamePort$inboundSchema: z.ZodType<
55
+ HostnamePort,
56
+ z.ZodTypeDef,
57
+ unknown
58
+ > = z.object({
59
+ hostname: z.string(),
60
+ port: z.number().int(),
61
+ });
62
+
63
+ /** @internal */
64
+ export type HostnamePort$Outbound = {
65
+ hostname: string;
66
+ port: number;
67
+ };
68
+
69
+ /** @internal */
70
+ export const HostnamePort$outboundSchema: z.ZodType<
71
+ HostnamePort$Outbound,
72
+ z.ZodTypeDef,
73
+ HostnamePort
74
+ > = z.object({
75
+ hostname: z.string(),
76
+ port: z.number().int(),
77
+ });
78
+
79
+ /**
80
+ * @internal
81
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
82
+ */
83
+ export namespace HostnamePort$ {
84
+ /** @deprecated use `HostnamePort$inboundSchema` instead. */
85
+ export const inboundSchema = HostnamePort$inboundSchema;
86
+ /** @deprecated use `HostnamePort$outboundSchema` instead. */
87
+ export const outboundSchema = HostnamePort$outboundSchema;
88
+ /** @deprecated use `HostnamePort$Outbound` instead. */
89
+ export type Outbound = HostnamePort$Outbound;
90
+ }
91
+
92
+ export function hostnamePortToJSON(hostnamePort: HostnamePort): string {
93
+ return JSON.stringify(HostnamePort$outboundSchema.parse(hostnamePort));
94
+ }
95
+
96
+ export function hostnamePortFromJSON(
97
+ jsonString: string,
98
+ ): SafeParseResult<HostnamePort, SDKValidationError> {
99
+ return safeParse(
100
+ jsonString,
101
+ (x) => HostnamePort$inboundSchema.parse(JSON.parse(x)),
102
+ `Failed to parse 'HostnamePort' from JSON`,
103
+ );
104
+ }
105
+
106
+ /** @internal */
107
+ export const Target2$inboundSchema: z.ZodType<Target2, z.ZodTypeDef, unknown> =
108
+ z.object({
109
+ hostname_port: z.lazy(() => HostnamePort$inboundSchema),
110
+ }).transform((v) => {
111
+ return remap$(v, {
112
+ "hostname_port": "hostnamePort",
113
+ });
114
+ });
115
+
116
+ /** @internal */
117
+ export type Target2$Outbound = {
118
+ hostname_port: HostnamePort$Outbound;
119
+ };
120
+
121
+ /** @internal */
122
+ export const Target2$outboundSchema: z.ZodType<
123
+ Target2$Outbound,
124
+ z.ZodTypeDef,
125
+ Target2
126
+ > = z.object({
127
+ hostnamePort: z.lazy(() => HostnamePort$outboundSchema),
128
+ }).transform((v) => {
129
+ return remap$(v, {
130
+ hostnamePort: "hostname_port",
131
+ });
132
+ });
133
+
134
+ /**
135
+ * @internal
136
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
137
+ */
138
+ export namespace Target2$ {
139
+ /** @deprecated use `Target2$inboundSchema` instead. */
140
+ export const inboundSchema = Target2$inboundSchema;
141
+ /** @deprecated use `Target2$outboundSchema` instead. */
142
+ export const outboundSchema = Target2$outboundSchema;
143
+ /** @deprecated use `Target2$Outbound` instead. */
144
+ export type Outbound = Target2$Outbound;
145
+ }
146
+
147
+ export function target2ToJSON(target2: Target2): string {
148
+ return JSON.stringify(Target2$outboundSchema.parse(target2));
149
+ }
150
+
151
+ export function target2FromJSON(
152
+ jsonString: string,
153
+ ): SafeParseResult<Target2, SDKValidationError> {
154
+ return safeParse(
155
+ jsonString,
156
+ (x) => Target2$inboundSchema.parse(JSON.parse(x)),
157
+ `Failed to parse 'Target2' from JSON`,
158
+ );
159
+ }
160
+
161
+ /** @internal */
162
+ export const HostPort$inboundSchema: z.ZodType<
163
+ HostPort,
164
+ z.ZodTypeDef,
165
+ unknown
166
+ > = z.object({
167
+ ip: z.string(),
168
+ port: z.number().int(),
169
+ });
170
+
171
+ /** @internal */
172
+ export type HostPort$Outbound = {
173
+ ip: string;
174
+ port: number;
175
+ };
176
+
177
+ /** @internal */
178
+ export const HostPort$outboundSchema: z.ZodType<
179
+ HostPort$Outbound,
180
+ z.ZodTypeDef,
181
+ HostPort
182
+ > = z.object({
183
+ ip: z.string(),
184
+ port: z.number().int(),
185
+ });
186
+
187
+ /**
188
+ * @internal
189
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
190
+ */
191
+ export namespace HostPort$ {
192
+ /** @deprecated use `HostPort$inboundSchema` instead. */
193
+ export const inboundSchema = HostPort$inboundSchema;
194
+ /** @deprecated use `HostPort$outboundSchema` instead. */
195
+ export const outboundSchema = HostPort$outboundSchema;
196
+ /** @deprecated use `HostPort$Outbound` instead. */
197
+ export type Outbound = HostPort$Outbound;
198
+ }
199
+
200
+ export function hostPortToJSON(hostPort: HostPort): string {
201
+ return JSON.stringify(HostPort$outboundSchema.parse(hostPort));
202
+ }
203
+
204
+ export function hostPortFromJSON(
205
+ jsonString: string,
206
+ ): SafeParseResult<HostPort, SDKValidationError> {
207
+ return safeParse(
208
+ jsonString,
209
+ (x) => HostPort$inboundSchema.parse(JSON.parse(x)),
210
+ `Failed to parse 'HostPort' from JSON`,
211
+ );
212
+ }
213
+
214
+ /** @internal */
215
+ export const Target1$inboundSchema: z.ZodType<Target1, z.ZodTypeDef, unknown> =
216
+ z.object({
217
+ host_port: z.lazy(() => HostPort$inboundSchema),
218
+ }).transform((v) => {
219
+ return remap$(v, {
220
+ "host_port": "hostPort",
221
+ });
222
+ });
223
+
224
+ /** @internal */
225
+ export type Target1$Outbound = {
226
+ host_port: HostPort$Outbound;
227
+ };
228
+
229
+ /** @internal */
230
+ export const Target1$outboundSchema: z.ZodType<
231
+ Target1$Outbound,
232
+ z.ZodTypeDef,
233
+ Target1
234
+ > = z.object({
235
+ hostPort: z.lazy(() => HostPort$outboundSchema),
236
+ }).transform((v) => {
237
+ return remap$(v, {
238
+ hostPort: "host_port",
239
+ });
240
+ });
241
+
242
+ /**
243
+ * @internal
244
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
245
+ */
246
+ export namespace Target1$ {
247
+ /** @deprecated use `Target1$inboundSchema` instead. */
248
+ export const inboundSchema = Target1$inboundSchema;
249
+ /** @deprecated use `Target1$outboundSchema` instead. */
250
+ export const outboundSchema = Target1$outboundSchema;
251
+ /** @deprecated use `Target1$Outbound` instead. */
252
+ export type Outbound = Target1$Outbound;
253
+ }
254
+
255
+ export function target1ToJSON(target1: Target1): string {
256
+ return JSON.stringify(Target1$outboundSchema.parse(target1));
257
+ }
258
+
259
+ export function target1FromJSON(
260
+ jsonString: string,
261
+ ): SafeParseResult<Target1, SDKValidationError> {
262
+ return safeParse(
263
+ jsonString,
264
+ (x) => Target1$inboundSchema.parse(JSON.parse(x)),
265
+ `Failed to parse 'Target1' from JSON`,
266
+ );
267
+ }
268
+
269
+ /** @internal */
270
+ export const ScansDiscoveryInputBodyTarget$inboundSchema: z.ZodType<
271
+ ScansDiscoveryInputBodyTarget,
272
+ z.ZodTypeDef,
273
+ unknown
274
+ > = z.union([
275
+ z.lazy(() => Target1$inboundSchema),
276
+ z.lazy(() => Target2$inboundSchema),
277
+ ]);
278
+
279
+ /** @internal */
280
+ export type ScansDiscoveryInputBodyTarget$Outbound =
281
+ | Target1$Outbound
282
+ | Target2$Outbound;
283
+
284
+ /** @internal */
285
+ export const ScansDiscoveryInputBodyTarget$outboundSchema: z.ZodType<
286
+ ScansDiscoveryInputBodyTarget$Outbound,
287
+ z.ZodTypeDef,
288
+ ScansDiscoveryInputBodyTarget
289
+ > = z.union([
290
+ z.lazy(() => Target1$outboundSchema),
291
+ z.lazy(() => Target2$outboundSchema),
292
+ ]);
293
+
294
+ /**
295
+ * @internal
296
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
297
+ */
298
+ export namespace ScansDiscoveryInputBodyTarget$ {
299
+ /** @deprecated use `ScansDiscoveryInputBodyTarget$inboundSchema` instead. */
300
+ export const inboundSchema = ScansDiscoveryInputBodyTarget$inboundSchema;
301
+ /** @deprecated use `ScansDiscoveryInputBodyTarget$outboundSchema` instead. */
302
+ export const outboundSchema = ScansDiscoveryInputBodyTarget$outboundSchema;
303
+ /** @deprecated use `ScansDiscoveryInputBodyTarget$Outbound` instead. */
304
+ export type Outbound = ScansDiscoveryInputBodyTarget$Outbound;
305
+ }
306
+
307
+ export function scansDiscoveryInputBodyTargetToJSON(
308
+ scansDiscoveryInputBodyTarget: ScansDiscoveryInputBodyTarget,
309
+ ): string {
310
+ return JSON.stringify(
311
+ ScansDiscoveryInputBodyTarget$outboundSchema.parse(
312
+ scansDiscoveryInputBodyTarget,
313
+ ),
314
+ );
315
+ }
316
+
317
+ export function scansDiscoveryInputBodyTargetFromJSON(
318
+ jsonString: string,
319
+ ): SafeParseResult<ScansDiscoveryInputBodyTarget, SDKValidationError> {
320
+ return safeParse(
321
+ jsonString,
322
+ (x) => ScansDiscoveryInputBodyTarget$inboundSchema.parse(JSON.parse(x)),
323
+ `Failed to parse 'ScansDiscoveryInputBodyTarget' from JSON`,
324
+ );
325
+ }
326
+
327
+ /** @internal */
328
+ export const ScansDiscoveryInputBody$inboundSchema: z.ZodType<
329
+ ScansDiscoveryInputBody,
330
+ z.ZodTypeDef,
331
+ unknown
332
+ > = z.object({
333
+ target: z.union([
334
+ z.lazy(() => Target1$inboundSchema),
335
+ z.lazy(() => Target2$inboundSchema),
336
+ ]),
337
+ });
338
+
339
+ /** @internal */
340
+ export type ScansDiscoveryInputBody$Outbound = {
341
+ target: Target1$Outbound | Target2$Outbound;
342
+ };
343
+
344
+ /** @internal */
345
+ export const ScansDiscoveryInputBody$outboundSchema: z.ZodType<
346
+ ScansDiscoveryInputBody$Outbound,
347
+ z.ZodTypeDef,
348
+ ScansDiscoveryInputBody
349
+ > = z.object({
350
+ target: z.union([
351
+ z.lazy(() => Target1$outboundSchema),
352
+ z.lazy(() => Target2$outboundSchema),
353
+ ]),
354
+ });
355
+
356
+ /**
357
+ * @internal
358
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
359
+ */
360
+ export namespace ScansDiscoveryInputBody$ {
361
+ /** @deprecated use `ScansDiscoveryInputBody$inboundSchema` instead. */
362
+ export const inboundSchema = ScansDiscoveryInputBody$inboundSchema;
363
+ /** @deprecated use `ScansDiscoveryInputBody$outboundSchema` instead. */
364
+ export const outboundSchema = ScansDiscoveryInputBody$outboundSchema;
365
+ /** @deprecated use `ScansDiscoveryInputBody$Outbound` instead. */
366
+ export type Outbound = ScansDiscoveryInputBody$Outbound;
367
+ }
368
+
369
+ export function scansDiscoveryInputBodyToJSON(
370
+ scansDiscoveryInputBody: ScansDiscoveryInputBody,
371
+ ): string {
372
+ return JSON.stringify(
373
+ ScansDiscoveryInputBody$outboundSchema.parse(scansDiscoveryInputBody),
374
+ );
375
+ }
376
+
377
+ export function scansDiscoveryInputBodyFromJSON(
378
+ jsonString: string,
379
+ ): SafeParseResult<ScansDiscoveryInputBody, SDKValidationError> {
380
+ return safeParse(
381
+ jsonString,
382
+ (x) => ScansDiscoveryInputBody$inboundSchema.parse(JSON.parse(x)),
383
+ `Failed to parse 'ScansDiscoveryInputBody' from JSON`,
384
+ );
385
+ }