argo_workflows_rs/apis/
event_source_service_api.rs

1/*
2 * Argo Workflows API
3 *
4 * Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
5 *
6 * The version of the OpenAPI document: VERSION
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13
14use crate::apis::ResponseContent;
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`event_source_service_create_event_source`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum EventSourceServiceCreateEventSourceError {
22    DefaultResponse(crate::models::GrpcPeriodGatewayPeriodRuntimePeriodError),
23    UnknownValue(serde_json::Value),
24}
25
26/// struct for typed errors of method [`event_source_service_delete_event_source`]
27#[derive(Debug, Clone, Serialize, Deserialize)]
28#[serde(untagged)]
29pub enum EventSourceServiceDeleteEventSourceError {
30    DefaultResponse(crate::models::GrpcPeriodGatewayPeriodRuntimePeriodError),
31    UnknownValue(serde_json::Value),
32}
33
34/// struct for typed errors of method [`event_source_service_event_sources_logs`]
35#[derive(Debug, Clone, Serialize, Deserialize)]
36#[serde(untagged)]
37pub enum EventSourceServiceEventSourcesLogsError {
38    DefaultResponse(crate::models::GrpcPeriodGatewayPeriodRuntimePeriodError),
39    UnknownValue(serde_json::Value),
40}
41
42/// struct for typed errors of method [`event_source_service_get_event_source`]
43#[derive(Debug, Clone, Serialize, Deserialize)]
44#[serde(untagged)]
45pub enum EventSourceServiceGetEventSourceError {
46    DefaultResponse(crate::models::GrpcPeriodGatewayPeriodRuntimePeriodError),
47    UnknownValue(serde_json::Value),
48}
49
50/// struct for typed errors of method [`event_source_service_list_event_sources`]
51#[derive(Debug, Clone, Serialize, Deserialize)]
52#[serde(untagged)]
53pub enum EventSourceServiceListEventSourcesError {
54    DefaultResponse(crate::models::GrpcPeriodGatewayPeriodRuntimePeriodError),
55    UnknownValue(serde_json::Value),
56}
57
58/// struct for typed errors of method [`event_source_service_update_event_source`]
59#[derive(Debug, Clone, Serialize, Deserialize)]
60#[serde(untagged)]
61pub enum EventSourceServiceUpdateEventSourceError {
62    DefaultResponse(crate::models::GrpcPeriodGatewayPeriodRuntimePeriodError),
63    UnknownValue(serde_json::Value),
64}
65
66/// struct for typed errors of method [`event_source_service_watch_event_sources`]
67#[derive(Debug, Clone, Serialize, Deserialize)]
68#[serde(untagged)]
69pub enum EventSourceServiceWatchEventSourcesError {
70    DefaultResponse(crate::models::GrpcPeriodGatewayPeriodRuntimePeriodError),
71    UnknownValue(serde_json::Value),
72}
73
74
75pub async fn event_source_service_create_event_source(configuration: &configuration::Configuration, namespace: &str, body: crate::models::EventsourcePeriodCreateEventSourceRequest) -> Result<crate::models::IoPeriodArgoprojPeriodEventsPeriodV1alpha1PeriodEventSource, Error<EventSourceServiceCreateEventSourceError>> {
76    let local_var_configuration = configuration;
77
78    let local_var_client = &local_var_configuration.client;
79
80    let local_var_uri_str = format!("{}/api/v1/event-sources/{namespace}", local_var_configuration.base_path, namespace=crate::apis::urlencode(namespace));
81    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
82
83    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
84        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
85    }
86    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
87        let local_var_key = local_var_apikey.key.clone();
88        let local_var_value = match local_var_apikey.prefix {
89            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
90            None => local_var_key,
91        };
92        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
93    };
94    local_var_req_builder = local_var_req_builder.json(&body);
95
96    let local_var_req = local_var_req_builder.build()?;
97    let local_var_resp = local_var_client.execute(local_var_req).await?;
98
99    let local_var_status = local_var_resp.status();
100    let local_var_content = local_var_resp.text().await?;
101
102    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
103        serde_json::from_str(&local_var_content).map_err(Error::from)
104    } else {
105        let local_var_entity: Option<EventSourceServiceCreateEventSourceError> = serde_json::from_str(&local_var_content).ok();
106        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
107        Err(Error::ResponseError(local_var_error))
108    }
109}
110
111pub async fn event_source_service_delete_event_source(configuration: &configuration::Configuration, namespace: &str, name: &str, delete_options_period_grace_period_seconds: Option<&str>, delete_options_period_preconditions_period_uid: Option<&str>, delete_options_period_preconditions_period_resource_version: Option<&str>, delete_options_period_orphan_dependents: Option<bool>, delete_options_period_propagation_policy: Option<&str>, delete_options_period_dry_run: Option<Vec<String>>) -> Result<serde_json::Value, Error<EventSourceServiceDeleteEventSourceError>> {
112    let local_var_configuration = configuration;
113
114    let local_var_client = &local_var_configuration.client;
115
116    let local_var_uri_str = format!("{}/api/v1/event-sources/{namespace}/{name}", local_var_configuration.base_path, namespace=crate::apis::urlencode(namespace), name=crate::apis::urlencode(name));
117    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
118
119    if let Some(ref local_var_str) = delete_options_period_grace_period_seconds {
120        local_var_req_builder = local_var_req_builder.query(&[("deleteOptions.gracePeriodSeconds", &local_var_str.to_string())]);
121    }
122    if let Some(ref local_var_str) = delete_options_period_preconditions_period_uid {
123        local_var_req_builder = local_var_req_builder.query(&[("deleteOptions.preconditions.uid", &local_var_str.to_string())]);
124    }
125    if let Some(ref local_var_str) = delete_options_period_preconditions_period_resource_version {
126        local_var_req_builder = local_var_req_builder.query(&[("deleteOptions.preconditions.resourceVersion", &local_var_str.to_string())]);
127    }
128    if let Some(ref local_var_str) = delete_options_period_orphan_dependents {
129        local_var_req_builder = local_var_req_builder.query(&[("deleteOptions.orphanDependents", &local_var_str.to_string())]);
130    }
131    if let Some(ref local_var_str) = delete_options_period_propagation_policy {
132        local_var_req_builder = local_var_req_builder.query(&[("deleteOptions.propagationPolicy", &local_var_str.to_string())]);
133    }
134    if let Some(ref local_var_str) = delete_options_period_dry_run {
135        local_var_req_builder = match "multi" {
136            "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("deleteOptions.dryRun".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
137            _ => local_var_req_builder.query(&[("deleteOptions.dryRun", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
138        };
139    }
140    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
141        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
142    }
143    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
144        let local_var_key = local_var_apikey.key.clone();
145        let local_var_value = match local_var_apikey.prefix {
146            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
147            None => local_var_key,
148        };
149        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
150    };
151
152    let local_var_req = local_var_req_builder.build()?;
153    let local_var_resp = local_var_client.execute(local_var_req).await?;
154
155    let local_var_status = local_var_resp.status();
156    let local_var_content = local_var_resp.text().await?;
157
158    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
159        serde_json::from_str(&local_var_content).map_err(Error::from)
160    } else {
161        let local_var_entity: Option<EventSourceServiceDeleteEventSourceError> = serde_json::from_str(&local_var_content).ok();
162        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
163        Err(Error::ResponseError(local_var_error))
164    }
165}
166
167pub async fn event_source_service_event_sources_logs(configuration: &configuration::Configuration, namespace: &str, name: Option<&str>, event_source_type: Option<&str>, event_name: Option<&str>, grep: Option<&str>, pod_log_options_period_container: Option<&str>, pod_log_options_period_follow: Option<bool>, pod_log_options_period_previous: Option<bool>, pod_log_options_period_since_seconds: Option<&str>, pod_log_options_period_since_time_period_seconds: Option<&str>, pod_log_options_period_since_time_period_nanos: Option<i32>, pod_log_options_period_timestamps: Option<bool>, pod_log_options_period_tail_lines: Option<&str>, pod_log_options_period_limit_bytes: Option<&str>, pod_log_options_period_insecure_skip_tls_verify_backend: Option<bool>) -> Result<crate::models::StreamResultOfEventsourceLogEntry, Error<EventSourceServiceEventSourcesLogsError>> {
168    let local_var_configuration = configuration;
169
170    let local_var_client = &local_var_configuration.client;
171
172    let local_var_uri_str = format!("{}/api/v1/stream/event-sources/{namespace}/logs", local_var_configuration.base_path, namespace=crate::apis::urlencode(namespace));
173    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
174
175    if let Some(ref local_var_str) = name {
176        local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
177    }
178    if let Some(ref local_var_str) = event_source_type {
179        local_var_req_builder = local_var_req_builder.query(&[("eventSourceType", &local_var_str.to_string())]);
180    }
181    if let Some(ref local_var_str) = event_name {
182        local_var_req_builder = local_var_req_builder.query(&[("eventName", &local_var_str.to_string())]);
183    }
184    if let Some(ref local_var_str) = grep {
185        local_var_req_builder = local_var_req_builder.query(&[("grep", &local_var_str.to_string())]);
186    }
187    if let Some(ref local_var_str) = pod_log_options_period_container {
188        local_var_req_builder = local_var_req_builder.query(&[("podLogOptions.container", &local_var_str.to_string())]);
189    }
190    if let Some(ref local_var_str) = pod_log_options_period_follow {
191        local_var_req_builder = local_var_req_builder.query(&[("podLogOptions.follow", &local_var_str.to_string())]);
192    }
193    if let Some(ref local_var_str) = pod_log_options_period_previous {
194        local_var_req_builder = local_var_req_builder.query(&[("podLogOptions.previous", &local_var_str.to_string())]);
195    }
196    if let Some(ref local_var_str) = pod_log_options_period_since_seconds {
197        local_var_req_builder = local_var_req_builder.query(&[("podLogOptions.sinceSeconds", &local_var_str.to_string())]);
198    }
199    if let Some(ref local_var_str) = pod_log_options_period_since_time_period_seconds {
200        local_var_req_builder = local_var_req_builder.query(&[("podLogOptions.sinceTime.seconds", &local_var_str.to_string())]);
201    }
202    if let Some(ref local_var_str) = pod_log_options_period_since_time_period_nanos {
203        local_var_req_builder = local_var_req_builder.query(&[("podLogOptions.sinceTime.nanos", &local_var_str.to_string())]);
204    }
205    if let Some(ref local_var_str) = pod_log_options_period_timestamps {
206        local_var_req_builder = local_var_req_builder.query(&[("podLogOptions.timestamps", &local_var_str.to_string())]);
207    }
208    if let Some(ref local_var_str) = pod_log_options_period_tail_lines {
209        local_var_req_builder = local_var_req_builder.query(&[("podLogOptions.tailLines", &local_var_str.to_string())]);
210    }
211    if let Some(ref local_var_str) = pod_log_options_period_limit_bytes {
212        local_var_req_builder = local_var_req_builder.query(&[("podLogOptions.limitBytes", &local_var_str.to_string())]);
213    }
214    if let Some(ref local_var_str) = pod_log_options_period_insecure_skip_tls_verify_backend {
215        local_var_req_builder = local_var_req_builder.query(&[("podLogOptions.insecureSkipTLSVerifyBackend", &local_var_str.to_string())]);
216    }
217    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
218        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
219    }
220    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
221        let local_var_key = local_var_apikey.key.clone();
222        let local_var_value = match local_var_apikey.prefix {
223            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
224            None => local_var_key,
225        };
226        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
227    };
228
229    let local_var_req = local_var_req_builder.build()?;
230    let local_var_resp = local_var_client.execute(local_var_req).await?;
231
232    let local_var_status = local_var_resp.status();
233    let local_var_content = local_var_resp.text().await?;
234
235    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
236        serde_json::from_str(&local_var_content).map_err(Error::from)
237    } else {
238        let local_var_entity: Option<EventSourceServiceEventSourcesLogsError> = serde_json::from_str(&local_var_content).ok();
239        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
240        Err(Error::ResponseError(local_var_error))
241    }
242}
243
244pub async fn event_source_service_get_event_source(configuration: &configuration::Configuration, namespace: &str, name: &str) -> Result<crate::models::IoPeriodArgoprojPeriodEventsPeriodV1alpha1PeriodEventSource, Error<EventSourceServiceGetEventSourceError>> {
245    let local_var_configuration = configuration;
246
247    let local_var_client = &local_var_configuration.client;
248
249    let local_var_uri_str = format!("{}/api/v1/event-sources/{namespace}/{name}", local_var_configuration.base_path, namespace=crate::apis::urlencode(namespace), name=crate::apis::urlencode(name));
250    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
251
252    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
253        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
254    }
255    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
256        let local_var_key = local_var_apikey.key.clone();
257        let local_var_value = match local_var_apikey.prefix {
258            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
259            None => local_var_key,
260        };
261        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
262    };
263
264    let local_var_req = local_var_req_builder.build()?;
265    let local_var_resp = local_var_client.execute(local_var_req).await?;
266
267    let local_var_status = local_var_resp.status();
268    let local_var_content = local_var_resp.text().await?;
269
270    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
271        serde_json::from_str(&local_var_content).map_err(Error::from)
272    } else {
273        let local_var_entity: Option<EventSourceServiceGetEventSourceError> = serde_json::from_str(&local_var_content).ok();
274        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
275        Err(Error::ResponseError(local_var_error))
276    }
277}
278
279pub async fn event_source_service_list_event_sources(configuration: &configuration::Configuration, namespace: &str, list_options_period_label_selector: Option<&str>, list_options_period_field_selector: Option<&str>, list_options_period_watch: Option<bool>, list_options_period_allow_watch_bookmarks: Option<bool>, list_options_period_resource_version: Option<&str>, list_options_period_resource_version_match: Option<&str>, list_options_period_timeout_seconds: Option<&str>, list_options_period_limit: Option<&str>, list_options_period_continue: Option<&str>) -> Result<crate::models::IoPeriodArgoprojPeriodEventsPeriodV1alpha1PeriodEventSourceList, Error<EventSourceServiceListEventSourcesError>> {
280    let local_var_configuration = configuration;
281
282    let local_var_client = &local_var_configuration.client;
283
284    let local_var_uri_str = format!("{}/api/v1/event-sources/{namespace}", local_var_configuration.base_path, namespace=crate::apis::urlencode(namespace));
285    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
286
287    if let Some(ref local_var_str) = list_options_period_label_selector {
288        local_var_req_builder = local_var_req_builder.query(&[("listOptions.labelSelector", &local_var_str.to_string())]);
289    }
290    if let Some(ref local_var_str) = list_options_period_field_selector {
291        local_var_req_builder = local_var_req_builder.query(&[("listOptions.fieldSelector", &local_var_str.to_string())]);
292    }
293    if let Some(ref local_var_str) = list_options_period_watch {
294        local_var_req_builder = local_var_req_builder.query(&[("listOptions.watch", &local_var_str.to_string())]);
295    }
296    if let Some(ref local_var_str) = list_options_period_allow_watch_bookmarks {
297        local_var_req_builder = local_var_req_builder.query(&[("listOptions.allowWatchBookmarks", &local_var_str.to_string())]);
298    }
299    if let Some(ref local_var_str) = list_options_period_resource_version {
300        local_var_req_builder = local_var_req_builder.query(&[("listOptions.resourceVersion", &local_var_str.to_string())]);
301    }
302    if let Some(ref local_var_str) = list_options_period_resource_version_match {
303        local_var_req_builder = local_var_req_builder.query(&[("listOptions.resourceVersionMatch", &local_var_str.to_string())]);
304    }
305    if let Some(ref local_var_str) = list_options_period_timeout_seconds {
306        local_var_req_builder = local_var_req_builder.query(&[("listOptions.timeoutSeconds", &local_var_str.to_string())]);
307    }
308    if let Some(ref local_var_str) = list_options_period_limit {
309        local_var_req_builder = local_var_req_builder.query(&[("listOptions.limit", &local_var_str.to_string())]);
310    }
311    if let Some(ref local_var_str) = list_options_period_continue {
312        local_var_req_builder = local_var_req_builder.query(&[("listOptions.continue", &local_var_str.to_string())]);
313    }
314    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
315        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
316    }
317    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
318        let local_var_key = local_var_apikey.key.clone();
319        let local_var_value = match local_var_apikey.prefix {
320            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
321            None => local_var_key,
322        };
323        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
324    };
325
326    let local_var_req = local_var_req_builder.build()?;
327    let local_var_resp = local_var_client.execute(local_var_req).await?;
328
329    let local_var_status = local_var_resp.status();
330    let local_var_content = local_var_resp.text().await?;
331
332    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
333        serde_json::from_str(&local_var_content).map_err(Error::from)
334    } else {
335        let local_var_entity: Option<EventSourceServiceListEventSourcesError> = serde_json::from_str(&local_var_content).ok();
336        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
337        Err(Error::ResponseError(local_var_error))
338    }
339}
340
341pub async fn event_source_service_update_event_source(configuration: &configuration::Configuration, namespace: &str, name: &str, body: crate::models::EventsourcePeriodUpdateEventSourceRequest) -> Result<crate::models::IoPeriodArgoprojPeriodEventsPeriodV1alpha1PeriodEventSource, Error<EventSourceServiceUpdateEventSourceError>> {
342    let local_var_configuration = configuration;
343
344    let local_var_client = &local_var_configuration.client;
345
346    let local_var_uri_str = format!("{}/api/v1/event-sources/{namespace}/{name}", local_var_configuration.base_path, namespace=crate::apis::urlencode(namespace), name=crate::apis::urlencode(name));
347    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
348
349    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
350        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
351    }
352    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
353        let local_var_key = local_var_apikey.key.clone();
354        let local_var_value = match local_var_apikey.prefix {
355            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
356            None => local_var_key,
357        };
358        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
359    };
360    local_var_req_builder = local_var_req_builder.json(&body);
361
362    let local_var_req = local_var_req_builder.build()?;
363    let local_var_resp = local_var_client.execute(local_var_req).await?;
364
365    let local_var_status = local_var_resp.status();
366    let local_var_content = local_var_resp.text().await?;
367
368    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
369        serde_json::from_str(&local_var_content).map_err(Error::from)
370    } else {
371        let local_var_entity: Option<EventSourceServiceUpdateEventSourceError> = serde_json::from_str(&local_var_content).ok();
372        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
373        Err(Error::ResponseError(local_var_error))
374    }
375}
376
377pub async fn event_source_service_watch_event_sources(configuration: &configuration::Configuration, namespace: &str, list_options_period_label_selector: Option<&str>, list_options_period_field_selector: Option<&str>, list_options_period_watch: Option<bool>, list_options_period_allow_watch_bookmarks: Option<bool>, list_options_period_resource_version: Option<&str>, list_options_period_resource_version_match: Option<&str>, list_options_period_timeout_seconds: Option<&str>, list_options_period_limit: Option<&str>, list_options_period_continue: Option<&str>) -> Result<crate::models::StreamResultOfEventsourceEventSourceWatchEvent, Error<EventSourceServiceWatchEventSourcesError>> {
378    let local_var_configuration = configuration;
379
380    let local_var_client = &local_var_configuration.client;
381
382    let local_var_uri_str = format!("{}/api/v1/stream/event-sources/{namespace}", local_var_configuration.base_path, namespace=crate::apis::urlencode(namespace));
383    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
384
385    if let Some(ref local_var_str) = list_options_period_label_selector {
386        local_var_req_builder = local_var_req_builder.query(&[("listOptions.labelSelector", &local_var_str.to_string())]);
387    }
388    if let Some(ref local_var_str) = list_options_period_field_selector {
389        local_var_req_builder = local_var_req_builder.query(&[("listOptions.fieldSelector", &local_var_str.to_string())]);
390    }
391    if let Some(ref local_var_str) = list_options_period_watch {
392        local_var_req_builder = local_var_req_builder.query(&[("listOptions.watch", &local_var_str.to_string())]);
393    }
394    if let Some(ref local_var_str) = list_options_period_allow_watch_bookmarks {
395        local_var_req_builder = local_var_req_builder.query(&[("listOptions.allowWatchBookmarks", &local_var_str.to_string())]);
396    }
397    if let Some(ref local_var_str) = list_options_period_resource_version {
398        local_var_req_builder = local_var_req_builder.query(&[("listOptions.resourceVersion", &local_var_str.to_string())]);
399    }
400    if let Some(ref local_var_str) = list_options_period_resource_version_match {
401        local_var_req_builder = local_var_req_builder.query(&[("listOptions.resourceVersionMatch", &local_var_str.to_string())]);
402    }
403    if let Some(ref local_var_str) = list_options_period_timeout_seconds {
404        local_var_req_builder = local_var_req_builder.query(&[("listOptions.timeoutSeconds", &local_var_str.to_string())]);
405    }
406    if let Some(ref local_var_str) = list_options_period_limit {
407        local_var_req_builder = local_var_req_builder.query(&[("listOptions.limit", &local_var_str.to_string())]);
408    }
409    if let Some(ref local_var_str) = list_options_period_continue {
410        local_var_req_builder = local_var_req_builder.query(&[("listOptions.continue", &local_var_str.to_string())]);
411    }
412    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
413        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
414    }
415    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
416        let local_var_key = local_var_apikey.key.clone();
417        let local_var_value = match local_var_apikey.prefix {
418            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
419            None => local_var_key,
420        };
421        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
422    };
423
424    let local_var_req = local_var_req_builder.build()?;
425    let local_var_resp = local_var_client.execute(local_var_req).await?;
426
427    let local_var_status = local_var_resp.status();
428    let local_var_content = local_var_resp.text().await?;
429
430    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
431        serde_json::from_str(&local_var_content).map_err(Error::from)
432    } else {
433        let local_var_entity: Option<EventSourceServiceWatchEventSourcesError> = serde_json::from_str(&local_var_content).ok();
434        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
435        Err(Error::ResponseError(local_var_error))
436    }
437}
438