Openstatus sdk
www.openstatus.dev
1// @generated by protoc-gen-es v2.11.0 with parameter "target=ts,import_extension=ts"
2// @generated from file openstatus/monitor/v1/http_monitor.proto (package openstatus.monitor.v1, syntax proto3)
3/* eslint-disable */
4
5import type {
6 GenEnum,
7 GenFile,
8 GenMessage,
9} from "@bufbuild/protobuf/codegenv2";
10import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
11import { file_buf_validate_validate } from "../../../buf/validate/validate_pb.ts";
12import type {
13 BodyAssertion,
14 HeaderAssertion,
15 StatusCodeAssertion,
16} from "./assertions_pb.ts";
17import { file_openstatus_monitor_v1_assertions } from "./assertions_pb.ts";
18import type { MonitorStatus, Periodicity, Region } from "./monitor_pb.ts";
19import { file_openstatus_monitor_v1_monitor } from "./monitor_pb.ts";
20import type { Message } from "@bufbuild/protobuf";
21
22/**
23 * Describes the file openstatus/monitor/v1/http_monitor.proto.
24 */
25export const file_openstatus_monitor_v1_http_monitor: GenFile = /*@__PURE__*/
26 fileDesc(
27 "CihvcGVuc3RhdHVzL21vbml0b3IvdjEvaHR0cF9tb25pdG9yLnByb3RvEhVvcGVuc3RhdHVzLm1vbml0b3IudjEiLgoHSGVhZGVycxIUCgNrZXkYASABKAlCB7pIBHICEAESDQoFdmFsdWUYAiABKAkibAoTT3BlblRlbGVtZXRyeUNvbmZpZxIaCghlbmRwb2ludBgBIAEoCUIIukgFcgMYgBASOQoHaGVhZGVycxgCIAMoCzIeLm9wZW5zdGF0dXMubW9uaXRvci52MS5IZWFkZXJzQgi6SAWSAQIQFCKhBwoLSFRUUE1vbml0b3ISCgoCaWQYASABKAkSGAoEbmFtZRgCIAEoCUIKukgHcgUQARiAAhIaCgN1cmwYAyABKAlCDbpICnIIEAEYgBCIAQESQQoLcGVyaW9kaWNpdHkYBCABKA4yIi5vcGVuc3RhdHVzLm1vbml0b3IudjEuUGVyaW9kaWNpdHlCCLpIBYIBAiAAEjsKBm1ldGhvZBgFIAEoDjIhLm9wZW5zdG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ASEwoPSFRUUF9NRVRIT0RfR0VUEAESFAoQSFRUUF9NRVRIT0RfUE9TVBACEhQKEEhUVFBfTUVUSE9EX0hFQUQQAxITCg9IVFRQX01FVEhPRF9QVVQQBBIVChFIVFRQX01FVEhPRF9QQVRDSBAFEhYKEkhUVFBfTUVUSE9EX0RFTEVURRAGEhUKEUhUVFBfTUVUSE9EX1RSQUNFEAcSFwoTSFRUUF9NRVRIT0RfQ09OTkVDVBAIEhcKE0hUVFBfTUVUSE9EX09QVElPTlMQCUJTWlFnaXRodWIuY29tL29wZW5zdGF0dXNocS9vcGVuc3RhdHVzL3BhY2thZ2VzL3Byb3RvL29wZW5zdGF0dXMvbW9uaXRvci92MTttb25pdG9ydjFiBnByb3RvMw",
28 [
29 file_buf_validate_validate,
30 file_openstatus_monitor_v1_assertions,
31 file_openstatus_monitor_v1_monitor,
32 ],
33 );
34
35/**
36 * Headers represents a key-value pair for HTTP headers.
37 *
38 * @generated from message openstatus.monitor.v1.Headers
39 */
40export type Headers = Message<"openstatus.monitor.v1.Headers"> & {
41 /**
42 * @generated from field: string key = 1;
43 */
44 key: string;
45
46 /**
47 * @generated from field: string value = 2;
48 */
49 value: string;
50};
51
52/**
53 * Describes the message openstatus.monitor.v1.Headers.
54 * Use `create(HeadersSchema)` to create a new message.
55 */
56export const HeadersSchema: GenMessage<Headers> = /*@__PURE__*/
57 messageDesc(file_openstatus_monitor_v1_http_monitor, 0);
58
59/**
60 * OpenTelemetry configuration for exporting metrics.
61 *
62 * @generated from message openstatus.monitor.v1.OpenTelemetryConfig
63 */
64export type OpenTelemetryConfig =
65 & Message<"openstatus.monitor.v1.OpenTelemetryConfig">
66 & {
67 /**
68 * OTEL endpoint URL.
69 *
70 * @generated from field: string endpoint = 1;
71 */
72 endpoint: string;
73
74 /**
75 * Custom headers for OTEL requests.
76 *
77 * @generated from field: repeated openstatus.monitor.v1.Headers headers = 2;
78 */
79 headers: Headers[];
80 };
81
82/**
83 * Describes the message openstatus.monitor.v1.OpenTelemetryConfig.
84 * Use `create(OpenTelemetryConfigSchema)` to create a new message.
85 */
86export const OpenTelemetryConfigSchema: GenMessage<
87 OpenTelemetryConfig
88> = /*@__PURE__*/
89 messageDesc(file_openstatus_monitor_v1_http_monitor, 1);
90
91/**
92 * HTTPMonitor defines the configuration for an HTTP monitor.
93 *
94 * @generated from message openstatus.monitor.v1.HTTPMonitor
95 */
96export type HTTPMonitor = Message<"openstatus.monitor.v1.HTTPMonitor"> & {
97 /**
98 * Unique identifier for the monitor (output only for create requests).
99 *
100 * @generated from field: string id = 1;
101 */
102 id: string;
103
104 /**
105 * Name of the monitor (required, max 256 characters).
106 *
107 * @generated from field: string name = 2;
108 */
109 name: string;
110
111 /**
112 * URL to monitor (required, max 2048 characters).
113 *
114 * @generated from field: string url = 3;
115 */
116 url: string;
117
118 /**
119 * Check periodicity (required).
120 *
121 * @generated from field: openstatus.monitor.v1.Periodicity periodicity = 4;
122 */
123 periodicity: Periodicity;
124
125 /**
126 * HTTP method to use (defaults to GET).
127 *
128 * @generated from field: openstatus.monitor.v1.HTTPMethod method = 5;
129 */
130 method: HTTPMethod;
131
132 /**
133 * Request body (optional).
134 *
135 * @generated from field: string body = 6;
136 */
137 body: string;
138
139 /**
140 * Timeout in milliseconds (0-120000, defaults to 45000).
141 *
142 * @generated from field: int64 timeout = 7;
143 */
144 timeout: bigint;
145
146 /**
147 * Latency threshold for degraded status in milliseconds (optional, 0-120000).
148 *
149 * @generated from field: optional int64 degraded_at = 8;
150 */
151 degradedAt?: bigint;
152
153 /**
154 * Number of retry attempts (0-10, defaults to 3).
155 *
156 * @generated from field: int64 retry = 9;
157 */
158 retry: bigint;
159
160 /**
161 * Whether to follow HTTP redirects (defaults to true when not specified).
162 *
163 * @generated from field: optional bool follow_redirects = 10;
164 */
165 followRedirects?: boolean;
166
167 /**
168 * Custom headers for the request.
169 *
170 * @generated from field: repeated openstatus.monitor.v1.Headers headers = 11;
171 */
172 headers: Headers[];
173
174 /**
175 * Status code assertions for the response.
176 *
177 * @generated from field: repeated openstatus.monitor.v1.StatusCodeAssertion status_code_assertions = 12;
178 */
179 statusCodeAssertions: StatusCodeAssertion[];
180
181 /**
182 * Body content assertions for the response.
183 *
184 * @generated from field: repeated openstatus.monitor.v1.BodyAssertion body_assertions = 13;
185 */
186 bodyAssertions: BodyAssertion[];
187
188 /**
189 * Header assertions for the response.
190 *
191 * @generated from field: repeated openstatus.monitor.v1.HeaderAssertion header_assertions = 14;
192 */
193 headerAssertions: HeaderAssertion[];
194
195 /**
196 * Description of the monitor (optional).
197 *
198 * @generated from field: string description = 15;
199 */
200 description: string;
201
202 /**
203 * Whether the monitor is active (defaults to false).
204 *
205 * @generated from field: bool active = 16;
206 */
207 active: boolean;
208
209 /**
210 * Whether the monitor is publicly visible (defaults to false).
211 *
212 * @generated from field: bool public = 17;
213 */
214 public: boolean;
215
216 /**
217 * Geographic regions to run checks from.
218 *
219 * @generated from field: repeated openstatus.monitor.v1.Region regions = 18;
220 */
221 regions: Region[];
222
223 /**
224 * OpenTelemetry configuration for exporting metrics.
225 *
226 * @generated from field: openstatus.monitor.v1.OpenTelemetryConfig open_telemetry = 19;
227 */
228 openTelemetry?: OpenTelemetryConfig;
229
230 /**
231 * Current operational status of the monitor.
232 *
233 * @generated from field: openstatus.monitor.v1.MonitorStatus status = 20;
234 */
235 status: MonitorStatus;
236};
237
238/**
239 * Describes the message openstatus.monitor.v1.HTTPMonitor.
240 * Use `create(HTTPMonitorSchema)` to create a new message.
241 */
242export const HTTPMonitorSchema: GenMessage<HTTPMonitor> = /*@__PURE__*/
243 messageDesc(file_openstatus_monitor_v1_http_monitor, 2);
244
245/**
246 * HTTP methods supported for monitors.
247 *
248 * @generated from enum openstatus.monitor.v1.HTTPMethod
249 */
250export enum HTTPMethod {
251 /**
252 * @generated from enum value: HTTP_METHOD_UNSPECIFIED = 0;
253 */
254 HTTP_METHOD_UNSPECIFIED = 0,
255
256 /**
257 * @generated from enum value: HTTP_METHOD_GET = 1;
258 */
259 HTTP_METHOD_GET = 1,
260
261 /**
262 * @generated from enum value: HTTP_METHOD_POST = 2;
263 */
264 HTTP_METHOD_POST = 2,
265
266 /**
267 * @generated from enum value: HTTP_METHOD_HEAD = 3;
268 */
269 HTTP_METHOD_HEAD = 3,
270
271 /**
272 * @generated from enum value: HTTP_METHOD_PUT = 4;
273 */
274 HTTP_METHOD_PUT = 4,
275
276 /**
277 * @generated from enum value: HTTP_METHOD_PATCH = 5;
278 */
279 HTTP_METHOD_PATCH = 5,
280
281 /**
282 * @generated from enum value: HTTP_METHOD_DELETE = 6;
283 */
284 HTTP_METHOD_DELETE = 6,
285
286 /**
287 * @generated from enum value: HTTP_METHOD_TRACE = 7;
288 */
289 HTTP_METHOD_TRACE = 7,
290
291 /**
292 * @generated from enum value: HTTP_METHOD_CONNECT = 8;
293 */
294 HTTP_METHOD_CONNECT = 8,
295
296 /**
297 * @generated from enum value: HTTP_METHOD_OPTIONS = 9;
298 */
299 HTTP_METHOD_OPTIONS = 9,
300}
301
302/**
303 * Describes the enum openstatus.monitor.v1.HTTPMethod.
304 */
305export const HTTPMethodSchema: GenEnum<HTTPMethod> = /*@__PURE__*/
306 enumDesc(file_openstatus_monitor_v1_http_monitor, 0);