uarp_sdk/generated/api/
health.rs1#![allow(unused_imports, clippy::too_many_arguments)]
6
7use reqwest::Method;
8use serde::{Deserialize, Serialize};
9
10use crate::client::{Client, Request, NO_BODY, NO_QUERY};
11use crate::error::Result;
12use crate::generated::models;
13use crate::multipart::{field_text, FilePart};
14use crate::sse::EventStream;
15use crate::util::encode_path;
16
17#[derive(Debug, Clone)]
19pub struct HealthApi {
20 pub(crate) client: Client,
21}
22
23impl Client {
24 pub fn health(&self) -> HealthApi {
26 HealthApi { client: self.clone() }
27 }
28}
29
30impl HealthApi {
31 pub async fn get(&self) -> Result<models::GetHealthResponse> {
35 self.client
36 .request_json(Request {
37 method: Method::GET,
38 path: "/health".to_string(),
39 query: NO_QUERY,
40 body: NO_BODY,
41 headers: Vec::new(),
42 idempotent: false,
43 })
44 .await
45 }
46
47 pub async fn get_metrics(&self) -> Result<String> {
51 self.client
52 .request_text(Request {
53 method: Method::GET,
54 path: "/metrics".to_string(),
55 query: NO_QUERY,
56 body: NO_BODY,
57 headers: Vec::new(),
58 idempotent: false,
59 })
60 .await
61 }
62
63 pub async fn get_ready(&self) -> Result<models::GetReadyResponse> {
67 self.client
68 .request_json(Request {
69 method: Method::GET,
70 path: "/ready".to_string(),
71 query: NO_QUERY,
72 body: NO_BODY,
73 headers: Vec::new(),
74 idempotent: false,
75 })
76 .await
77 }
78
79 pub async fn health_check_v1alias(&self) -> Result<models::HealthCheckV1aliasResponse> {
86 self.client
87 .request_json(Request {
88 method: Method::GET,
89 path: "/api/v1/health".to_string(),
90 query: NO_QUERY,
91 body: NO_BODY,
92 headers: Vec::new(),
93 idempotent: false,
94 })
95 .await
96 }
97
98 pub async fn health_live(&self) -> Result<models::HealthLiveResponse> {
102 self.client
103 .request_json(Request {
104 method: Method::GET,
105 path: "/health/live".to_string(),
106 query: NO_QUERY,
107 body: NO_BODY,
108 headers: Vec::new(),
109 idempotent: false,
110 })
111 .await
112 }
113
114 pub async fn health_ready(&self) -> Result<models::ReadinessReport> {
118 self.client
119 .request_json(Request {
120 method: Method::GET,
121 path: "/health/ready".to_string(),
122 query: NO_QUERY,
123 body: NO_BODY,
124 headers: Vec::new(),
125 idempotent: false,
126 })
127 .await
128 }
129
130 pub fn health_sse(&self) -> EventStream {
136 self.client.request_stream(
137 "/health/sse",
138 NO_QUERY,
139 Vec::new(),
140 )
141 }
142
143 pub async fn healthz_alias(&self) -> Result<models::HealthzAliasResponse> {
147 self.client
148 .request_json(Request {
149 method: Method::GET,
150 path: "/healthz".to_string(),
151 query: NO_QUERY,
152 body: NO_BODY,
153 headers: Vec::new(),
154 idempotent: false,
155 })
156 .await
157 }
158
159 pub async fn readyz_alias(&self) -> Result<models::ReadinessReport> {
163 self.client
164 .request_json(Request {
165 method: Method::GET,
166 path: "/readyz".to_string(),
167 query: NO_QUERY,
168 body: NO_BODY,
169 headers: Vec::new(),
170 idempotent: false,
171 })
172 .await
173 }
174}