gitbundle_sdk/apis/
groups_api.rs

1/*
2 * GitBundle API
3 *
4 * GitBundle API documentation.
5 *
6 * The version of the OpenAPI document: 3.3.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use reqwest;
12use serde::{de::Error as _, Deserialize, Serialize};
13
14use super::{configuration, ContentType, Error};
15use crate::{apis::ResponseContent, models};
16
17/// struct for typed errors of method [`delete_groups_runner`]
18#[derive(Debug, Clone, Serialize, Deserialize)]
19#[serde(untagged)]
20pub enum DeleteGroupsRunnerError {
21    Status400(models::JsonErrorResponseNull),
22    Status401(models::JsonErrorResponseNull),
23    Status403(models::JsonErrorResponseNull),
24    Status404(models::JsonErrorResponseNull),
25    Status409(models::JsonErrorResponseNull),
26    Status429(models::JsonErrorResponseNull),
27    Status500(models::JsonErrorResponseNull),
28    UnknownValue(serde_json::Value),
29}
30
31/// struct for typed errors of method [`delete_groups_variable`]
32#[derive(Debug, Clone, Serialize, Deserialize)]
33#[serde(untagged)]
34pub enum DeleteGroupsVariableError {
35    Status400(models::JsonErrorResponseNull),
36    Status401(models::JsonErrorResponseNull),
37    Status403(models::JsonErrorResponseNull),
38    Status404(models::JsonErrorResponseNull),
39    Status409(models::JsonErrorResponseNull),
40    Status429(models::JsonErrorResponseNull),
41    Status500(models::JsonErrorResponseNull),
42    UnknownValue(serde_json::Value),
43}
44
45/// struct for typed errors of method [`delete_member`]
46#[derive(Debug, Clone, Serialize, Deserialize)]
47#[serde(untagged)]
48pub enum DeleteMemberError {
49    Status400(models::JsonErrorResponseNull),
50    Status401(models::JsonErrorResponseNull),
51    Status403(models::JsonErrorResponseNull),
52    Status404(models::JsonErrorResponseNull),
53    Status409(models::JsonErrorResponseNull),
54    Status429(models::JsonErrorResponseNull),
55    Status500(models::JsonErrorResponseNull),
56    UnknownValue(serde_json::Value),
57}
58
59/// struct for typed errors of method [`get_connectors`]
60#[derive(Debug, Clone, Serialize, Deserialize)]
61#[serde(untagged)]
62pub enum GetConnectorsError {
63    Status400(models::JsonErrorResponseNull),
64    Status401(models::JsonErrorResponseNull),
65    Status403(models::JsonErrorResponseNull),
66    Status404(models::JsonErrorResponseNull),
67    Status409(models::JsonErrorResponseNull),
68    Status429(models::JsonErrorResponseNull),
69    Status500(models::JsonErrorResponseNull),
70    UnknownValue(serde_json::Value),
71}
72
73/// struct for typed errors of method [`get_events`]
74#[derive(Debug, Clone, Serialize, Deserialize)]
75#[serde(untagged)]
76pub enum GetEventsError {
77    Status400(models::JsonErrorResponseNull),
78    Status401(models::JsonErrorResponseNull),
79    Status403(models::JsonErrorResponseNull),
80    Status404(models::JsonErrorResponseNull),
81    Status409(models::JsonErrorResponseNull),
82    Status429(models::JsonErrorResponseNull),
83    Status500(models::JsonErrorResponseNull),
84    UnknownValue(serde_json::Value),
85}
86
87/// struct for typed errors of method [`get_group`]
88#[derive(Debug, Clone, Serialize, Deserialize)]
89#[serde(untagged)]
90pub enum GetGroupError {
91    Status400(models::JsonErrorResponseNull),
92    Status401(models::JsonErrorResponseNull),
93    Status403(models::JsonErrorResponseNull),
94    Status404(models::JsonErrorResponseNull),
95    Status409(models::JsonErrorResponseNull),
96    Status429(models::JsonErrorResponseNull),
97    Status500(models::JsonErrorResponseNull),
98    UnknownValue(serde_json::Value),
99}
100
101/// struct for typed errors of method [`get_groups_reseted_runner_register_token`]
102#[derive(Debug, Clone, Serialize, Deserialize)]
103#[serde(untagged)]
104pub enum GetGroupsResetedRunnerRegisterTokenError {
105    Status400(models::JsonErrorResponseNull),
106    Status401(models::JsonErrorResponseNull),
107    Status403(models::JsonErrorResponseNull),
108    Status404(models::JsonErrorResponseNull),
109    Status409(models::JsonErrorResponseNull),
110    Status429(models::JsonErrorResponseNull),
111    Status500(models::JsonErrorResponseNull),
112    UnknownValue(serde_json::Value),
113}
114
115/// struct for typed errors of method [`get_groups_runner`]
116#[derive(Debug, Clone, Serialize, Deserialize)]
117#[serde(untagged)]
118pub enum GetGroupsRunnerError {
119    Status400(models::JsonErrorResponseNull),
120    Status401(models::JsonErrorResponseNull),
121    Status403(models::JsonErrorResponseNull),
122    Status404(models::JsonErrorResponseNull),
123    Status409(models::JsonErrorResponseNull),
124    Status429(models::JsonErrorResponseNull),
125    Status500(models::JsonErrorResponseNull),
126    UnknownValue(serde_json::Value),
127}
128
129/// struct for typed errors of method [`get_groups_runner_register_token`]
130#[derive(Debug, Clone, Serialize, Deserialize)]
131#[serde(untagged)]
132pub enum GetGroupsRunnerRegisterTokenError {
133    Status400(models::JsonErrorResponseNull),
134    Status401(models::JsonErrorResponseNull),
135    Status403(models::JsonErrorResponseNull),
136    Status404(models::JsonErrorResponseNull),
137    Status409(models::JsonErrorResponseNull),
138    Status429(models::JsonErrorResponseNull),
139    Status500(models::JsonErrorResponseNull),
140    UnknownValue(serde_json::Value),
141}
142
143/// struct for typed errors of method [`get_groups_runners`]
144#[derive(Debug, Clone, Serialize, Deserialize)]
145#[serde(untagged)]
146pub enum GetGroupsRunnersError {
147    Status400(models::JsonErrorResponseNull),
148    Status401(models::JsonErrorResponseNull),
149    Status403(models::JsonErrorResponseNull),
150    Status404(models::JsonErrorResponseNull),
151    Status409(models::JsonErrorResponseNull),
152    Status429(models::JsonErrorResponseNull),
153    Status500(models::JsonErrorResponseNull),
154    UnknownValue(serde_json::Value),
155}
156
157/// struct for typed errors of method [`get_groups_variable`]
158#[derive(Debug, Clone, Serialize, Deserialize)]
159#[serde(untagged)]
160pub enum GetGroupsVariableError {
161    Status400(models::JsonErrorResponseNull),
162    Status401(models::JsonErrorResponseNull),
163    Status403(models::JsonErrorResponseNull),
164    Status404(models::JsonErrorResponseNull),
165    Status409(models::JsonErrorResponseNull),
166    Status429(models::JsonErrorResponseNull),
167    Status500(models::JsonErrorResponseNull),
168    UnknownValue(serde_json::Value),
169}
170
171/// struct for typed errors of method [`get_groups_variables`]
172#[derive(Debug, Clone, Serialize, Deserialize)]
173#[serde(untagged)]
174pub enum GetGroupsVariablesError {
175    Status400(models::JsonErrorResponseNull),
176    Status401(models::JsonErrorResponseNull),
177    Status403(models::JsonErrorResponseNull),
178    Status404(models::JsonErrorResponseNull),
179    Status409(models::JsonErrorResponseNull),
180    Status429(models::JsonErrorResponseNull),
181    Status500(models::JsonErrorResponseNull),
182    UnknownValue(serde_json::Value),
183}
184
185/// struct for typed errors of method [`get_members`]
186#[derive(Debug, Clone, Serialize, Deserialize)]
187#[serde(untagged)]
188pub enum GetMembersError {
189    Status400(models::JsonErrorResponseNull),
190    Status401(models::JsonErrorResponseNull),
191    Status403(models::JsonErrorResponseNull),
192    Status404(models::JsonErrorResponseNull),
193    Status409(models::JsonErrorResponseNull),
194    Status429(models::JsonErrorResponseNull),
195    Status500(models::JsonErrorResponseNull),
196    UnknownValue(serde_json::Value),
197}
198
199/// struct for typed errors of method [`get_repos`]
200#[derive(Debug, Clone, Serialize, Deserialize)]
201#[serde(untagged)]
202pub enum GetReposError {
203    Status400(models::JsonErrorResponseNull),
204    Status401(models::JsonErrorResponseNull),
205    Status403(models::JsonErrorResponseNull),
206    Status404(models::JsonErrorResponseNull),
207    Status409(models::JsonErrorResponseNull),
208    Status429(models::JsonErrorResponseNull),
209    Status500(models::JsonErrorResponseNull),
210    UnknownValue(serde_json::Value),
211}
212
213/// struct for typed errors of method [`get_service_accounts`]
214#[derive(Debug, Clone, Serialize, Deserialize)]
215#[serde(untagged)]
216pub enum GetServiceAccountsError {
217    Status400(models::JsonErrorResponseNull),
218    Status401(models::JsonErrorResponseNull),
219    Status403(models::JsonErrorResponseNull),
220    Status404(models::JsonErrorResponseNull),
221    Status409(models::JsonErrorResponseNull),
222    Status429(models::JsonErrorResponseNull),
223    Status500(models::JsonErrorResponseNull),
224    UnknownValue(serde_json::Value),
225}
226
227/// struct for typed errors of method [`get_sub_groups`]
228#[derive(Debug, Clone, Serialize, Deserialize)]
229#[serde(untagged)]
230pub enum GetSubGroupsError {
231    Status400(models::JsonErrorResponseNull),
232    Status401(models::JsonErrorResponseNull),
233    Status403(models::JsonErrorResponseNull),
234    Status404(models::JsonErrorResponseNull),
235    Status409(models::JsonErrorResponseNull),
236    Status429(models::JsonErrorResponseNull),
237    Status500(models::JsonErrorResponseNull),
238    UnknownValue(serde_json::Value),
239}
240
241/// struct for typed errors of method [`patch_group`]
242#[derive(Debug, Clone, Serialize, Deserialize)]
243#[serde(untagged)]
244pub enum PatchGroupError {
245    Status400(models::JsonErrorResponseNull),
246    Status401(models::JsonErrorResponseNull),
247    Status403(models::JsonErrorResponseNull),
248    Status404(models::JsonErrorResponseNull),
249    Status409(models::JsonErrorResponseNull),
250    Status429(models::JsonErrorResponseNull),
251    Status500(models::JsonErrorResponseNull),
252    UnknownValue(serde_json::Value),
253}
254
255/// struct for typed errors of method [`patch_groups_runner`]
256#[derive(Debug, Clone, Serialize, Deserialize)]
257#[serde(untagged)]
258pub enum PatchGroupsRunnerError {
259    Status400(models::JsonErrorResponseNull),
260    Status401(models::JsonErrorResponseNull),
261    Status403(models::JsonErrorResponseNull),
262    Status404(models::JsonErrorResponseNull),
263    Status409(models::JsonErrorResponseNull),
264    Status429(models::JsonErrorResponseNull),
265    Status500(models::JsonErrorResponseNull),
266    UnknownValue(serde_json::Value),
267}
268
269/// struct for typed errors of method [`patch_groups_variable`]
270#[derive(Debug, Clone, Serialize, Deserialize)]
271#[serde(untagged)]
272pub enum PatchGroupsVariableError {
273    Status400(models::JsonErrorResponseNull),
274    Status401(models::JsonErrorResponseNull),
275    Status403(models::JsonErrorResponseNull),
276    Status404(models::JsonErrorResponseNull),
277    Status409(models::JsonErrorResponseNull),
278    Status429(models::JsonErrorResponseNull),
279    Status500(models::JsonErrorResponseNull),
280    UnknownValue(serde_json::Value),
281}
282
283/// struct for typed errors of method [`patch_member`]
284#[derive(Debug, Clone, Serialize, Deserialize)]
285#[serde(untagged)]
286pub enum PatchMemberError {
287    Status400(models::JsonErrorResponseNull),
288    Status401(models::JsonErrorResponseNull),
289    Status403(models::JsonErrorResponseNull),
290    Status404(models::JsonErrorResponseNull),
291    Status409(models::JsonErrorResponseNull),
292    Status429(models::JsonErrorResponseNull),
293    Status500(models::JsonErrorResponseNull),
294    UnknownValue(serde_json::Value),
295}
296
297/// struct for typed errors of method [`post_group`]
298#[derive(Debug, Clone, Serialize, Deserialize)]
299#[serde(untagged)]
300pub enum PostGroupError {
301    Status400(models::JsonErrorResponseNull),
302    Status401(models::JsonErrorResponseNull),
303    Status403(models::JsonErrorResponseNull),
304    Status404(models::JsonErrorResponseNull),
305    Status409(models::JsonErrorResponseNull),
306    Status429(models::JsonErrorResponseNull),
307    Status500(models::JsonErrorResponseNull),
308    UnknownValue(serde_json::Value),
309}
310
311/// struct for typed errors of method [`post_groups_variable`]
312#[derive(Debug, Clone, Serialize, Deserialize)]
313#[serde(untagged)]
314pub enum PostGroupsVariableError {
315    Status400(models::JsonErrorResponseNull),
316    Status401(models::JsonErrorResponseNull),
317    Status403(models::JsonErrorResponseNull),
318    Status404(models::JsonErrorResponseNull),
319    Status409(models::JsonErrorResponseNull),
320    Status429(models::JsonErrorResponseNull),
321    Status500(models::JsonErrorResponseNull),
322    UnknownValue(serde_json::Value),
323}
324
325/// struct for typed errors of method [`post_import`]
326#[derive(Debug, Clone, Serialize, Deserialize)]
327#[serde(untagged)]
328pub enum PostImportError {
329    Status400(models::JsonErrorResponseNull),
330    Status401(models::JsonErrorResponseNull),
331    Status403(models::JsonErrorResponseNull),
332    Status404(models::JsonErrorResponseNull),
333    Status409(models::JsonErrorResponseNull),
334    Status429(models::JsonErrorResponseNull),
335    Status500(models::JsonErrorResponseNull),
336    UnknownValue(serde_json::Value),
337}
338
339/// struct for typed errors of method [`post_import_repos`]
340#[derive(Debug, Clone, Serialize, Deserialize)]
341#[serde(untagged)]
342pub enum PostImportReposError {
343    Status400(models::JsonErrorResponseNull),
344    Status401(models::JsonErrorResponseNull),
345    Status403(models::JsonErrorResponseNull),
346    Status404(models::JsonErrorResponseNull),
347    Status409(models::JsonErrorResponseNull),
348    Status429(models::JsonErrorResponseNull),
349    Status500(models::JsonErrorResponseNull),
350    UnknownValue(serde_json::Value),
351}
352
353/// struct for typed errors of method [`post_member`]
354#[derive(Debug, Clone, Serialize, Deserialize)]
355#[serde(untagged)]
356pub enum PostMemberError {
357    Status400(models::JsonErrorResponseNull),
358    Status401(models::JsonErrorResponseNull),
359    Status403(models::JsonErrorResponseNull),
360    Status404(models::JsonErrorResponseNull),
361    Status409(models::JsonErrorResponseNull),
362    Status429(models::JsonErrorResponseNull),
363    Status500(models::JsonErrorResponseNull),
364    UnknownValue(serde_json::Value),
365}
366
367/// struct for typed errors of method [`post_move`]
368#[derive(Debug, Clone, Serialize, Deserialize)]
369#[serde(untagged)]
370pub enum PostMoveError {
371    Status400(models::JsonErrorResponseNull),
372    Status401(models::JsonErrorResponseNull),
373    Status403(models::JsonErrorResponseNull),
374    Status404(models::JsonErrorResponseNull),
375    Status409(models::JsonErrorResponseNull),
376    Status429(models::JsonErrorResponseNull),
377    Status500(models::JsonErrorResponseNull),
378    UnknownValue(serde_json::Value),
379}
380
381/// struct for typed errors of method [`post_purge`]
382#[derive(Debug, Clone, Serialize, Deserialize)]
383#[serde(untagged)]
384pub enum PostPurgeError {
385    Status400(models::JsonErrorResponseNull),
386    Status401(models::JsonErrorResponseNull),
387    Status403(models::JsonErrorResponseNull),
388    Status404(models::JsonErrorResponseNull),
389    Status409(models::JsonErrorResponseNull),
390    Status429(models::JsonErrorResponseNull),
391    Status500(models::JsonErrorResponseNull),
392    UnknownValue(serde_json::Value),
393}
394
395/// struct for typed errors of method [`post_restore`]
396#[derive(Debug, Clone, Serialize, Deserialize)]
397#[serde(untagged)]
398pub enum PostRestoreError {
399    Status400(models::JsonErrorResponseNull),
400    Status401(models::JsonErrorResponseNull),
401    Status403(models::JsonErrorResponseNull),
402    Status404(models::JsonErrorResponseNull),
403    Status409(models::JsonErrorResponseNull),
404    Status429(models::JsonErrorResponseNull),
405    Status500(models::JsonErrorResponseNull),
406    UnknownValue(serde_json::Value),
407}
408
409/// struct for typed errors of method [`soft_delete`]
410#[derive(Debug, Clone, Serialize, Deserialize)]
411#[serde(untagged)]
412pub enum SoftDeleteError {
413    Status400(models::JsonErrorResponseNull),
414    Status401(models::JsonErrorResponseNull),
415    Status403(models::JsonErrorResponseNull),
416    Status404(models::JsonErrorResponseNull),
417    Status409(models::JsonErrorResponseNull),
418    Status429(models::JsonErrorResponseNull),
419    Status500(models::JsonErrorResponseNull),
420    UnknownValue(serde_json::Value),
421}
422
423pub async fn delete_groups_runner(
424    configuration: &configuration::Configuration,
425    group_ref: &str,
426    runner_uuid: &str,
427) -> Result<(), Error<DeleteGroupsRunnerError>> {
428    // add a prefix to parameters to efficiently prevent name collisions
429    let p_path_group_ref = group_ref;
430    let p_path_runner_uuid = runner_uuid;
431
432    let uri_str = format!(
433        "{}/groups/{group_ref}/+/runners/{runner_uuid}",
434        configuration.base_path,
435        group_ref = crate::apis::urlencode(p_path_group_ref),
436        runner_uuid = crate::apis::urlencode(p_path_runner_uuid)
437    );
438    let mut req_builder = configuration
439        .client
440        .request(reqwest::Method::DELETE, &uri_str);
441
442    if let Some(ref apikey) = configuration.api_key {
443        let key = apikey.key.clone();
444        let value = match apikey.prefix {
445            Some(ref prefix) => format!("{} {}", prefix, key),
446            None => key,
447        };
448        req_builder = req_builder.query(&[("access_token", value)]);
449    }
450    if let Some(ref user_agent) = configuration.user_agent {
451        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
452    }
453    if let Some(ref auth_conf) = configuration.basic_auth {
454        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
455    };
456    if let Some(ref token) = configuration.bearer_access_token {
457        req_builder = req_builder.bearer_auth(token.to_owned());
458    };
459
460    let req = req_builder.build()?;
461    let resp = configuration.client.execute(req).await?;
462
463    let status = resp.status();
464
465    if !status.is_client_error() && !status.is_server_error() {
466        Ok(())
467    } else {
468        let content = resp.text().await?;
469        let entity: Option<DeleteGroupsRunnerError> = serde_json::from_str(&content).ok();
470        Err(Error::ResponseError(ResponseContent {
471            status,
472            content,
473            entity,
474        }))
475    }
476}
477
478pub async fn delete_groups_variable(
479    configuration: &configuration::Configuration,
480    group_ref: &str,
481    variable_identifier: &str,
482) -> Result<(), Error<DeleteGroupsVariableError>> {
483    // add a prefix to parameters to efficiently prevent name collisions
484    let p_path_group_ref = group_ref;
485    let p_path_variable_identifier = variable_identifier;
486
487    let uri_str = format!(
488        "{}/groups/{group_ref}/+/variables/{variable_identifier}",
489        configuration.base_path,
490        group_ref = crate::apis::urlencode(p_path_group_ref),
491        variable_identifier = crate::apis::urlencode(p_path_variable_identifier)
492    );
493    let mut req_builder = configuration
494        .client
495        .request(reqwest::Method::DELETE, &uri_str);
496
497    if let Some(ref apikey) = configuration.api_key {
498        let key = apikey.key.clone();
499        let value = match apikey.prefix {
500            Some(ref prefix) => format!("{} {}", prefix, key),
501            None => key,
502        };
503        req_builder = req_builder.query(&[("access_token", value)]);
504    }
505    if let Some(ref user_agent) = configuration.user_agent {
506        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
507    }
508    if let Some(ref auth_conf) = configuration.basic_auth {
509        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
510    };
511    if let Some(ref token) = configuration.bearer_access_token {
512        req_builder = req_builder.bearer_auth(token.to_owned());
513    };
514
515    let req = req_builder.build()?;
516    let resp = configuration.client.execute(req).await?;
517
518    let status = resp.status();
519
520    if !status.is_client_error() && !status.is_server_error() {
521        Ok(())
522    } else {
523        let content = resp.text().await?;
524        let entity: Option<DeleteGroupsVariableError> = serde_json::from_str(&content).ok();
525        Err(Error::ResponseError(ResponseContent {
526            status,
527            content,
528            entity,
529        }))
530    }
531}
532
533pub async fn delete_member(
534    configuration: &configuration::Configuration,
535    group_ref: &str,
536    user_identifier: &str,
537) -> Result<(), Error<DeleteMemberError>> {
538    // add a prefix to parameters to efficiently prevent name collisions
539    let p_path_group_ref = group_ref;
540    let p_path_user_identifier = user_identifier;
541
542    let uri_str = format!(
543        "{}/groups/{group_ref}/+/members/{user_identifier}",
544        configuration.base_path,
545        group_ref = crate::apis::urlencode(p_path_group_ref),
546        user_identifier = crate::apis::urlencode(p_path_user_identifier)
547    );
548    let mut req_builder = configuration
549        .client
550        .request(reqwest::Method::DELETE, &uri_str);
551
552    if let Some(ref apikey) = configuration.api_key {
553        let key = apikey.key.clone();
554        let value = match apikey.prefix {
555            Some(ref prefix) => format!("{} {}", prefix, key),
556            None => key,
557        };
558        req_builder = req_builder.query(&[("access_token", value)]);
559    }
560    if let Some(ref user_agent) = configuration.user_agent {
561        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
562    }
563    if let Some(ref auth_conf) = configuration.basic_auth {
564        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
565    };
566    if let Some(ref token) = configuration.bearer_access_token {
567        req_builder = req_builder.bearer_auth(token.to_owned());
568    };
569
570    let req = req_builder.build()?;
571    let resp = configuration.client.execute(req).await?;
572
573    let status = resp.status();
574
575    if !status.is_client_error() && !status.is_server_error() {
576        Ok(())
577    } else {
578        let content = resp.text().await?;
579        let entity: Option<DeleteMemberError> = serde_json::from_str(&content).ok();
580        Err(Error::ResponseError(ResponseContent {
581            status,
582            content,
583            entity,
584        }))
585    }
586}
587
588pub async fn get_connectors(
589    configuration: &configuration::Configuration,
590    group_ref: &str,
591    page: Option<i64>,
592    size: Option<i64>,
593    query: Option<&str>,
594) -> Result<Vec<models::ConnectorModel>, Error<GetConnectorsError>> {
595    // add a prefix to parameters to efficiently prevent name collisions
596    let p_path_group_ref = group_ref;
597    let p_query_page = page;
598    let p_query_size = size;
599    let p_query_query = query;
600
601    let uri_str = format!(
602        "{}/groups/{group_ref}/+/connectors",
603        configuration.base_path,
604        group_ref = crate::apis::urlencode(p_path_group_ref)
605    );
606    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
607
608    if let Some(ref param_value) = p_query_page {
609        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
610    }
611    if let Some(ref param_value) = p_query_size {
612        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
613    }
614    if let Some(ref param_value) = p_query_query {
615        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
616    }
617    if let Some(ref apikey) = configuration.api_key {
618        let key = apikey.key.clone();
619        let value = match apikey.prefix {
620            Some(ref prefix) => format!("{} {}", prefix, key),
621            None => key,
622        };
623        req_builder = req_builder.query(&[("access_token", value)]);
624    }
625    if let Some(ref user_agent) = configuration.user_agent {
626        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
627    }
628    if let Some(ref auth_conf) = configuration.basic_auth {
629        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
630    };
631    if let Some(ref token) = configuration.bearer_access_token {
632        req_builder = req_builder.bearer_auth(token.to_owned());
633    };
634
635    let req = req_builder.build()?;
636    let resp = configuration.client.execute(req).await?;
637
638    let status = resp.status();
639    let content_type = resp
640        .headers()
641        .get("content-type")
642        .and_then(|v| v.to_str().ok())
643        .unwrap_or("application/octet-stream");
644    let content_type = super::ContentType::from(content_type);
645
646    if !status.is_client_error() && !status.is_server_error() {
647        let content = resp.text().await?;
648        match content_type {
649            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
650            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::ConnectorModel&gt;`"))),
651            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::ConnectorModel&gt;`")))),
652        }
653    } else {
654        let content = resp.text().await?;
655        let entity: Option<GetConnectorsError> = serde_json::from_str(&content).ok();
656        Err(Error::ResponseError(ResponseContent {
657            status,
658            content,
659            entity,
660        }))
661    }
662}
663
664pub async fn get_events(
665    configuration: &configuration::Configuration,
666    group_ref: &str,
667) -> Result<Vec<i32>, Error<GetEventsError>> {
668    // add a prefix to parameters to efficiently prevent name collisions
669    let p_path_group_ref = group_ref;
670
671    let uri_str = format!(
672        "{}/groups/{group_ref}/+/events",
673        configuration.base_path,
674        group_ref = crate::apis::urlencode(p_path_group_ref)
675    );
676    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
677
678    if let Some(ref apikey) = configuration.api_key {
679        let key = apikey.key.clone();
680        let value = match apikey.prefix {
681            Some(ref prefix) => format!("{} {}", prefix, key),
682            None => key,
683        };
684        req_builder = req_builder.query(&[("access_token", value)]);
685    }
686    if let Some(ref user_agent) = configuration.user_agent {
687        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
688    }
689    if let Some(ref auth_conf) = configuration.basic_auth {
690        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
691    };
692    if let Some(ref token) = configuration.bearer_access_token {
693        req_builder = req_builder.bearer_auth(token.to_owned());
694    };
695
696    let req = req_builder.build()?;
697    let resp = configuration.client.execute(req).await?;
698
699    let status = resp.status();
700    let content_type = resp
701        .headers()
702        .get("content-type")
703        .and_then(|v| v.to_str().ok())
704        .unwrap_or("application/octet-stream");
705    let content_type = super::ContentType::from(content_type);
706
707    if !status.is_client_error() && !status.is_server_error() {
708        let content = resp.text().await?;
709        match content_type {
710            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
711            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;i32&gt;`"))),
712            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;i32&gt;`")))),
713        }
714    } else {
715        let content = resp.text().await?;
716        let entity: Option<GetEventsError> = serde_json::from_str(&content).ok();
717        Err(Error::ResponseError(ResponseContent {
718            status,
719            content,
720            entity,
721        }))
722    }
723}
724
725pub async fn get_group(
726    configuration: &configuration::Configuration,
727    group_ref: &str,
728) -> Result<models::GroupModel, Error<GetGroupError>> {
729    // add a prefix to parameters to efficiently prevent name collisions
730    let p_path_group_ref = group_ref;
731
732    let uri_str = format!(
733        "{}/groups/{group_ref}/+",
734        configuration.base_path,
735        group_ref = crate::apis::urlencode(p_path_group_ref)
736    );
737    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
738
739    if let Some(ref apikey) = configuration.api_key {
740        let key = apikey.key.clone();
741        let value = match apikey.prefix {
742            Some(ref prefix) => format!("{} {}", prefix, key),
743            None => key,
744        };
745        req_builder = req_builder.query(&[("access_token", value)]);
746    }
747    if let Some(ref user_agent) = configuration.user_agent {
748        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
749    }
750    if let Some(ref auth_conf) = configuration.basic_auth {
751        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
752    };
753    if let Some(ref token) = configuration.bearer_access_token {
754        req_builder = req_builder.bearer_auth(token.to_owned());
755    };
756
757    let req = req_builder.build()?;
758    let resp = configuration.client.execute(req).await?;
759
760    let status = resp.status();
761    let content_type = resp
762        .headers()
763        .get("content-type")
764        .and_then(|v| v.to_str().ok())
765        .unwrap_or("application/octet-stream");
766    let content_type = super::ContentType::from(content_type);
767
768    if !status.is_client_error() && !status.is_server_error() {
769        let content = resp.text().await?;
770        match content_type {
771            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
772            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupModel`"))),
773            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupModel`")))),
774        }
775    } else {
776        let content = resp.text().await?;
777        let entity: Option<GetGroupError> = serde_json::from_str(&content).ok();
778        Err(Error::ResponseError(ResponseContent {
779            status,
780            content,
781            entity,
782        }))
783    }
784}
785
786pub async fn get_groups_reseted_runner_register_token(
787    configuration: &configuration::Configuration,
788    group_ref: &str,
789) -> Result<models::RegisterTokenModel, Error<GetGroupsResetedRunnerRegisterTokenError>> {
790    // add a prefix to parameters to efficiently prevent name collisions
791    let p_path_group_ref = group_ref;
792
793    let uri_str = format!(
794        "{}/groups/{group_ref}/+/runners/register_token/reseted",
795        configuration.base_path,
796        group_ref = crate::apis::urlencode(p_path_group_ref)
797    );
798    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
799
800    if let Some(ref apikey) = configuration.api_key {
801        let key = apikey.key.clone();
802        let value = match apikey.prefix {
803            Some(ref prefix) => format!("{} {}", prefix, key),
804            None => key,
805        };
806        req_builder = req_builder.query(&[("access_token", value)]);
807    }
808    if let Some(ref user_agent) = configuration.user_agent {
809        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
810    }
811    if let Some(ref auth_conf) = configuration.basic_auth {
812        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
813    };
814    if let Some(ref token) = configuration.bearer_access_token {
815        req_builder = req_builder.bearer_auth(token.to_owned());
816    };
817
818    let req = req_builder.build()?;
819    let resp = configuration.client.execute(req).await?;
820
821    let status = resp.status();
822    let content_type = resp
823        .headers()
824        .get("content-type")
825        .and_then(|v| v.to_str().ok())
826        .unwrap_or("application/octet-stream");
827    let content_type = super::ContentType::from(content_type);
828
829    if !status.is_client_error() && !status.is_server_error() {
830        let content = resp.text().await?;
831        match content_type {
832            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
833            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegisterTokenModel`"))),
834            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegisterTokenModel`")))),
835        }
836    } else {
837        let content = resp.text().await?;
838        let entity: Option<GetGroupsResetedRunnerRegisterTokenError> =
839            serde_json::from_str(&content).ok();
840        Err(Error::ResponseError(ResponseContent {
841            status,
842            content,
843            entity,
844        }))
845    }
846}
847
848pub async fn get_groups_runner(
849    configuration: &configuration::Configuration,
850    group_ref: &str,
851    runner_uuid: &str,
852) -> Result<models::RunnerModel, Error<GetGroupsRunnerError>> {
853    // add a prefix to parameters to efficiently prevent name collisions
854    let p_path_group_ref = group_ref;
855    let p_path_runner_uuid = runner_uuid;
856
857    let uri_str = format!(
858        "{}/groups/{group_ref}/+/runners/{runner_uuid}",
859        configuration.base_path,
860        group_ref = crate::apis::urlencode(p_path_group_ref),
861        runner_uuid = crate::apis::urlencode(p_path_runner_uuid)
862    );
863    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
864
865    if let Some(ref apikey) = configuration.api_key {
866        let key = apikey.key.clone();
867        let value = match apikey.prefix {
868            Some(ref prefix) => format!("{} {}", prefix, key),
869            None => key,
870        };
871        req_builder = req_builder.query(&[("access_token", value)]);
872    }
873    if let Some(ref user_agent) = configuration.user_agent {
874        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
875    }
876    if let Some(ref auth_conf) = configuration.basic_auth {
877        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
878    };
879    if let Some(ref token) = configuration.bearer_access_token {
880        req_builder = req_builder.bearer_auth(token.to_owned());
881    };
882
883    let req = req_builder.build()?;
884    let resp = configuration.client.execute(req).await?;
885
886    let status = resp.status();
887    let content_type = resp
888        .headers()
889        .get("content-type")
890        .and_then(|v| v.to_str().ok())
891        .unwrap_or("application/octet-stream");
892    let content_type = super::ContentType::from(content_type);
893
894    if !status.is_client_error() && !status.is_server_error() {
895        let content = resp.text().await?;
896        match content_type {
897            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
898            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RunnerModel`"))),
899            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RunnerModel`")))),
900        }
901    } else {
902        let content = resp.text().await?;
903        let entity: Option<GetGroupsRunnerError> = serde_json::from_str(&content).ok();
904        Err(Error::ResponseError(ResponseContent {
905            status,
906            content,
907            entity,
908        }))
909    }
910}
911
912pub async fn get_groups_runner_register_token(
913    configuration: &configuration::Configuration,
914    group_ref: &str,
915) -> Result<models::RegisterTokenModel, Error<GetGroupsRunnerRegisterTokenError>> {
916    // add a prefix to parameters to efficiently prevent name collisions
917    let p_path_group_ref = group_ref;
918
919    let uri_str = format!(
920        "{}/groups/{group_ref}/+/runners/register_token",
921        configuration.base_path,
922        group_ref = crate::apis::urlencode(p_path_group_ref)
923    );
924    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
925
926    if let Some(ref apikey) = configuration.api_key {
927        let key = apikey.key.clone();
928        let value = match apikey.prefix {
929            Some(ref prefix) => format!("{} {}", prefix, key),
930            None => key,
931        };
932        req_builder = req_builder.query(&[("access_token", value)]);
933    }
934    if let Some(ref user_agent) = configuration.user_agent {
935        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
936    }
937    if let Some(ref auth_conf) = configuration.basic_auth {
938        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
939    };
940    if let Some(ref token) = configuration.bearer_access_token {
941        req_builder = req_builder.bearer_auth(token.to_owned());
942    };
943
944    let req = req_builder.build()?;
945    let resp = configuration.client.execute(req).await?;
946
947    let status = resp.status();
948    let content_type = resp
949        .headers()
950        .get("content-type")
951        .and_then(|v| v.to_str().ok())
952        .unwrap_or("application/octet-stream");
953    let content_type = super::ContentType::from(content_type);
954
955    if !status.is_client_error() && !status.is_server_error() {
956        let content = resp.text().await?;
957        match content_type {
958            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
959            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegisterTokenModel`"))),
960            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegisterTokenModel`")))),
961        }
962    } else {
963        let content = resp.text().await?;
964        let entity: Option<GetGroupsRunnerRegisterTokenError> = serde_json::from_str(&content).ok();
965        Err(Error::ResponseError(ResponseContent {
966            status,
967            content,
968            entity,
969        }))
970    }
971}
972
973pub async fn get_groups_runners(
974    configuration: &configuration::Configuration,
975    group_ref: &str,
976    page: Option<i64>,
977    size: Option<i64>,
978    query: Option<&str>,
979) -> Result<Vec<models::RunnerCreator>, Error<GetGroupsRunnersError>> {
980    // add a prefix to parameters to efficiently prevent name collisions
981    let p_path_group_ref = group_ref;
982    let p_query_page = page;
983    let p_query_size = size;
984    let p_query_query = query;
985
986    let uri_str = format!(
987        "{}/groups/{group_ref}/+/runners",
988        configuration.base_path,
989        group_ref = crate::apis::urlencode(p_path_group_ref)
990    );
991    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
992
993    if let Some(ref param_value) = p_query_page {
994        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
995    }
996    if let Some(ref param_value) = p_query_size {
997        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
998    }
999    if let Some(ref param_value) = p_query_query {
1000        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
1001    }
1002    if let Some(ref apikey) = configuration.api_key {
1003        let key = apikey.key.clone();
1004        let value = match apikey.prefix {
1005            Some(ref prefix) => format!("{} {}", prefix, key),
1006            None => key,
1007        };
1008        req_builder = req_builder.query(&[("access_token", value)]);
1009    }
1010    if let Some(ref user_agent) = configuration.user_agent {
1011        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1012    }
1013    if let Some(ref auth_conf) = configuration.basic_auth {
1014        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1015    };
1016    if let Some(ref token) = configuration.bearer_access_token {
1017        req_builder = req_builder.bearer_auth(token.to_owned());
1018    };
1019
1020    let req = req_builder.build()?;
1021    let resp = configuration.client.execute(req).await?;
1022
1023    let status = resp.status();
1024    let content_type = resp
1025        .headers()
1026        .get("content-type")
1027        .and_then(|v| v.to_str().ok())
1028        .unwrap_or("application/octet-stream");
1029    let content_type = super::ContentType::from(content_type);
1030
1031    if !status.is_client_error() && !status.is_server_error() {
1032        let content = resp.text().await?;
1033        match content_type {
1034            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1035            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::RunnerCreator&gt;`"))),
1036            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::RunnerCreator&gt;`")))),
1037        }
1038    } else {
1039        let content = resp.text().await?;
1040        let entity: Option<GetGroupsRunnersError> = serde_json::from_str(&content).ok();
1041        Err(Error::ResponseError(ResponseContent {
1042            status,
1043            content,
1044            entity,
1045        }))
1046    }
1047}
1048
1049pub async fn get_groups_variable(
1050    configuration: &configuration::Configuration,
1051    group_ref: &str,
1052    variable_identifier: &str,
1053) -> Result<models::VariableModel, Error<GetGroupsVariableError>> {
1054    // add a prefix to parameters to efficiently prevent name collisions
1055    let p_path_group_ref = group_ref;
1056    let p_path_variable_identifier = variable_identifier;
1057
1058    let uri_str = format!(
1059        "{}/groups/{group_ref}/+/variables/{variable_identifier}",
1060        configuration.base_path,
1061        group_ref = crate::apis::urlencode(p_path_group_ref),
1062        variable_identifier = crate::apis::urlencode(p_path_variable_identifier)
1063    );
1064    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1065
1066    if let Some(ref apikey) = configuration.api_key {
1067        let key = apikey.key.clone();
1068        let value = match apikey.prefix {
1069            Some(ref prefix) => format!("{} {}", prefix, key),
1070            None => key,
1071        };
1072        req_builder = req_builder.query(&[("access_token", value)]);
1073    }
1074    if let Some(ref user_agent) = configuration.user_agent {
1075        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1076    }
1077    if let Some(ref auth_conf) = configuration.basic_auth {
1078        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1079    };
1080    if let Some(ref token) = configuration.bearer_access_token {
1081        req_builder = req_builder.bearer_auth(token.to_owned());
1082    };
1083
1084    let req = req_builder.build()?;
1085    let resp = configuration.client.execute(req).await?;
1086
1087    let status = resp.status();
1088    let content_type = resp
1089        .headers()
1090        .get("content-type")
1091        .and_then(|v| v.to_str().ok())
1092        .unwrap_or("application/octet-stream");
1093    let content_type = super::ContentType::from(content_type);
1094
1095    if !status.is_client_error() && !status.is_server_error() {
1096        let content = resp.text().await?;
1097        match content_type {
1098            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1099            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VariableModel`"))),
1100            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::VariableModel`")))),
1101        }
1102    } else {
1103        let content = resp.text().await?;
1104        let entity: Option<GetGroupsVariableError> = serde_json::from_str(&content).ok();
1105        Err(Error::ResponseError(ResponseContent {
1106            status,
1107            content,
1108            entity,
1109        }))
1110    }
1111}
1112
1113pub async fn get_groups_variables(
1114    configuration: &configuration::Configuration,
1115    group_ref: &str,
1116    page: Option<i64>,
1117    size: Option<i64>,
1118    query: Option<&str>,
1119    types: Option<Vec<models::VariableType>>,
1120    sort: Option<models::VariableSort>,
1121    order: Option<models::OrderOption>,
1122) -> Result<Vec<models::VariableGroup>, Error<GetGroupsVariablesError>> {
1123    // add a prefix to parameters to efficiently prevent name collisions
1124    let p_path_group_ref = group_ref;
1125    let p_query_page = page;
1126    let p_query_size = size;
1127    let p_query_query = query;
1128    let p_query_types = types;
1129    let p_query_sort = sort;
1130    let p_query_order = order;
1131
1132    let uri_str = format!(
1133        "{}/groups/{group_ref}/+/variables",
1134        configuration.base_path,
1135        group_ref = crate::apis::urlencode(p_path_group_ref)
1136    );
1137    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1138
1139    if let Some(ref param_value) = p_query_page {
1140        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1141    }
1142    if let Some(ref param_value) = p_query_size {
1143        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
1144    }
1145    if let Some(ref param_value) = p_query_query {
1146        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
1147    }
1148    if let Some(ref param_value) = p_query_types {
1149        req_builder = match "multi" {
1150            "multi" => req_builder.query(
1151                &param_value
1152                    .iter()
1153                    .map(|p| ("types".to_owned(), p.to_string()))
1154                    .collect::<Vec<(std::string::String, std::string::String)>>(),
1155            ),
1156            _ => req_builder.query(&[(
1157                "types",
1158                &param_value
1159                    .iter()
1160                    .map(|p| p.to_string())
1161                    .collect::<Vec<String>>()
1162                    .join(",")
1163                    .to_string(),
1164            )]),
1165        };
1166    }
1167    if let Some(ref param_value) = p_query_sort {
1168        req_builder = req_builder.query(&[("sort", &serde_json::to_string(param_value)?)]);
1169    }
1170    if let Some(ref param_value) = p_query_order {
1171        req_builder = req_builder.query(&[("order", &serde_json::to_string(param_value)?)]);
1172    }
1173    if let Some(ref apikey) = configuration.api_key {
1174        let key = apikey.key.clone();
1175        let value = match apikey.prefix {
1176            Some(ref prefix) => format!("{} {}", prefix, key),
1177            None => key,
1178        };
1179        req_builder = req_builder.query(&[("access_token", value)]);
1180    }
1181    if let Some(ref user_agent) = configuration.user_agent {
1182        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1183    }
1184    if let Some(ref auth_conf) = configuration.basic_auth {
1185        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1186    };
1187    if let Some(ref token) = configuration.bearer_access_token {
1188        req_builder = req_builder.bearer_auth(token.to_owned());
1189    };
1190
1191    let req = req_builder.build()?;
1192    let resp = configuration.client.execute(req).await?;
1193
1194    let status = resp.status();
1195    let content_type = resp
1196        .headers()
1197        .get("content-type")
1198        .and_then(|v| v.to_str().ok())
1199        .unwrap_or("application/octet-stream");
1200    let content_type = super::ContentType::from(content_type);
1201
1202    if !status.is_client_error() && !status.is_server_error() {
1203        let content = resp.text().await?;
1204        match content_type {
1205            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1206            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::VariableGroup&gt;`"))),
1207            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::VariableGroup&gt;`")))),
1208        }
1209    } else {
1210        let content = resp.text().await?;
1211        let entity: Option<GetGroupsVariablesError> = serde_json::from_str(&content).ok();
1212        Err(Error::ResponseError(ResponseContent {
1213            status,
1214            content,
1215            entity,
1216        }))
1217    }
1218}
1219
1220pub async fn get_members(
1221    configuration: &configuration::Configuration,
1222    group_ref: &str,
1223    page: Option<i64>,
1224    size: Option<i64>,
1225    query: Option<&str>,
1226    sort: Option<models::MembershipSort>,
1227    order: Option<models::OrderOption>,
1228) -> Result<Vec<models::MembershipUserGroup>, Error<GetMembersError>> {
1229    // add a prefix to parameters to efficiently prevent name collisions
1230    let p_path_group_ref = group_ref;
1231    let p_query_page = page;
1232    let p_query_size = size;
1233    let p_query_query = query;
1234    let p_query_sort = sort;
1235    let p_query_order = order;
1236
1237    let uri_str = format!(
1238        "{}/groups/{group_ref}/+/members",
1239        configuration.base_path,
1240        group_ref = crate::apis::urlencode(p_path_group_ref)
1241    );
1242    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1243
1244    if let Some(ref param_value) = p_query_page {
1245        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1246    }
1247    if let Some(ref param_value) = p_query_size {
1248        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
1249    }
1250    if let Some(ref param_value) = p_query_query {
1251        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
1252    }
1253    if let Some(ref param_value) = p_query_sort {
1254        req_builder = req_builder.query(&[("sort", &serde_json::to_string(param_value)?)]);
1255    }
1256    if let Some(ref param_value) = p_query_order {
1257        req_builder = req_builder.query(&[("order", &serde_json::to_string(param_value)?)]);
1258    }
1259    if let Some(ref apikey) = configuration.api_key {
1260        let key = apikey.key.clone();
1261        let value = match apikey.prefix {
1262            Some(ref prefix) => format!("{} {}", prefix, key),
1263            None => key,
1264        };
1265        req_builder = req_builder.query(&[("access_token", value)]);
1266    }
1267    if let Some(ref user_agent) = configuration.user_agent {
1268        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1269    }
1270    if let Some(ref auth_conf) = configuration.basic_auth {
1271        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1272    };
1273    if let Some(ref token) = configuration.bearer_access_token {
1274        req_builder = req_builder.bearer_auth(token.to_owned());
1275    };
1276
1277    let req = req_builder.build()?;
1278    let resp = configuration.client.execute(req).await?;
1279
1280    let status = resp.status();
1281    let content_type = resp
1282        .headers()
1283        .get("content-type")
1284        .and_then(|v| v.to_str().ok())
1285        .unwrap_or("application/octet-stream");
1286    let content_type = super::ContentType::from(content_type);
1287
1288    if !status.is_client_error() && !status.is_server_error() {
1289        let content = resp.text().await?;
1290        match content_type {
1291            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1292            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::MembershipUserGroup&gt;`"))),
1293            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::MembershipUserGroup&gt;`")))),
1294        }
1295    } else {
1296        let content = resp.text().await?;
1297        let entity: Option<GetMembersError> = serde_json::from_str(&content).ok();
1298        Err(Error::ResponseError(ResponseContent {
1299            status,
1300            content,
1301            entity,
1302        }))
1303    }
1304}
1305
1306pub async fn get_repos(
1307    configuration: &configuration::Configuration,
1308    group_ref: &str,
1309    page: Option<i64>,
1310    size: Option<i64>,
1311    query: Option<&str>,
1312    sort: Option<models::RepoSort>,
1313    order: Option<models::OrderOption>,
1314) -> Result<Vec<models::RepoParent>, Error<GetReposError>> {
1315    // add a prefix to parameters to efficiently prevent name collisions
1316    let p_path_group_ref = group_ref;
1317    let p_query_page = page;
1318    let p_query_size = size;
1319    let p_query_query = query;
1320    let p_query_sort = sort;
1321    let p_query_order = order;
1322
1323    let uri_str = format!(
1324        "{}/groups/{group_ref}/+/repos",
1325        configuration.base_path,
1326        group_ref = crate::apis::urlencode(p_path_group_ref)
1327    );
1328    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1329
1330    if let Some(ref param_value) = p_query_page {
1331        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1332    }
1333    if let Some(ref param_value) = p_query_size {
1334        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
1335    }
1336    if let Some(ref param_value) = p_query_query {
1337        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
1338    }
1339    if let Some(ref param_value) = p_query_sort {
1340        req_builder = req_builder.query(&[("sort", &serde_json::to_string(param_value)?)]);
1341    }
1342    if let Some(ref param_value) = p_query_order {
1343        req_builder = req_builder.query(&[("order", &serde_json::to_string(param_value)?)]);
1344    }
1345    if let Some(ref apikey) = configuration.api_key {
1346        let key = apikey.key.clone();
1347        let value = match apikey.prefix {
1348            Some(ref prefix) => format!("{} {}", prefix, key),
1349            None => key,
1350        };
1351        req_builder = req_builder.query(&[("access_token", value)]);
1352    }
1353    if let Some(ref user_agent) = configuration.user_agent {
1354        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1355    }
1356    if let Some(ref auth_conf) = configuration.basic_auth {
1357        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1358    };
1359    if let Some(ref token) = configuration.bearer_access_token {
1360        req_builder = req_builder.bearer_auth(token.to_owned());
1361    };
1362
1363    let req = req_builder.build()?;
1364    let resp = configuration.client.execute(req).await?;
1365
1366    let status = resp.status();
1367    let content_type = resp
1368        .headers()
1369        .get("content-type")
1370        .and_then(|v| v.to_str().ok())
1371        .unwrap_or("application/octet-stream");
1372    let content_type = super::ContentType::from(content_type);
1373
1374    if !status.is_client_error() && !status.is_server_error() {
1375        let content = resp.text().await?;
1376        match content_type {
1377            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1378            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::RepoParent&gt;`"))),
1379            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::RepoParent&gt;`")))),
1380        }
1381    } else {
1382        let content = resp.text().await?;
1383        let entity: Option<GetReposError> = serde_json::from_str(&content).ok();
1384        Err(Error::ResponseError(ResponseContent {
1385            status,
1386            content,
1387            entity,
1388        }))
1389    }
1390}
1391
1392pub async fn get_service_accounts(
1393    configuration: &configuration::Configuration,
1394    group_ref: &str,
1395    page: Option<i64>,
1396    size: Option<i64>,
1397    query: Option<&str>,
1398    sort: Option<models::UserSort>,
1399    order: Option<models::OrderOption>,
1400) -> Result<Vec<models::UserModel>, Error<GetServiceAccountsError>> {
1401    // add a prefix to parameters to efficiently prevent name collisions
1402    let p_path_group_ref = group_ref;
1403    let p_query_page = page;
1404    let p_query_size = size;
1405    let p_query_query = query;
1406    let p_query_sort = sort;
1407    let p_query_order = order;
1408
1409    let uri_str = format!(
1410        "{}/groups/{group_ref}/+/service-accounts",
1411        configuration.base_path,
1412        group_ref = crate::apis::urlencode(p_path_group_ref)
1413    );
1414    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1415
1416    if let Some(ref param_value) = p_query_page {
1417        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1418    }
1419    if let Some(ref param_value) = p_query_size {
1420        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
1421    }
1422    if let Some(ref param_value) = p_query_query {
1423        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
1424    }
1425    if let Some(ref param_value) = p_query_sort {
1426        req_builder = req_builder.query(&[("sort", &serde_json::to_string(param_value)?)]);
1427    }
1428    if let Some(ref param_value) = p_query_order {
1429        req_builder = req_builder.query(&[("order", &serde_json::to_string(param_value)?)]);
1430    }
1431    if let Some(ref apikey) = configuration.api_key {
1432        let key = apikey.key.clone();
1433        let value = match apikey.prefix {
1434            Some(ref prefix) => format!("{} {}", prefix, key),
1435            None => key,
1436        };
1437        req_builder = req_builder.query(&[("access_token", value)]);
1438    }
1439    if let Some(ref user_agent) = configuration.user_agent {
1440        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1441    }
1442    if let Some(ref auth_conf) = configuration.basic_auth {
1443        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1444    };
1445    if let Some(ref token) = configuration.bearer_access_token {
1446        req_builder = req_builder.bearer_auth(token.to_owned());
1447    };
1448
1449    let req = req_builder.build()?;
1450    let resp = configuration.client.execute(req).await?;
1451
1452    let status = resp.status();
1453    let content_type = resp
1454        .headers()
1455        .get("content-type")
1456        .and_then(|v| v.to_str().ok())
1457        .unwrap_or("application/octet-stream");
1458    let content_type = super::ContentType::from(content_type);
1459
1460    if !status.is_client_error() && !status.is_server_error() {
1461        let content = resp.text().await?;
1462        match content_type {
1463            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1464            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UserModel&gt;`"))),
1465            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UserModel&gt;`")))),
1466        }
1467    } else {
1468        let content = resp.text().await?;
1469        let entity: Option<GetServiceAccountsError> = serde_json::from_str(&content).ok();
1470        Err(Error::ResponseError(ResponseContent {
1471            status,
1472            content,
1473            entity,
1474        }))
1475    }
1476}
1477
1478pub async fn get_sub_groups(
1479    configuration: &configuration::Configuration,
1480    group_ref: &str,
1481    page: Option<i64>,
1482    size: Option<i64>,
1483    query: Option<&str>,
1484    sort: Option<models::GroupSort>,
1485    order: Option<models::OrderOption>,
1486) -> Result<Vec<models::GroupModel>, Error<GetSubGroupsError>> {
1487    // add a prefix to parameters to efficiently prevent name collisions
1488    let p_path_group_ref = group_ref;
1489    let p_query_page = page;
1490    let p_query_size = size;
1491    let p_query_query = query;
1492    let p_query_sort = sort;
1493    let p_query_order = order;
1494
1495    let uri_str = format!(
1496        "{}/groups/{group_ref}/+/groups",
1497        configuration.base_path,
1498        group_ref = crate::apis::urlencode(p_path_group_ref)
1499    );
1500    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1501
1502    if let Some(ref param_value) = p_query_page {
1503        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1504    }
1505    if let Some(ref param_value) = p_query_size {
1506        req_builder = req_builder.query(&[("size", &param_value.to_string())]);
1507    }
1508    if let Some(ref param_value) = p_query_query {
1509        req_builder = req_builder.query(&[("query", &param_value.to_string())]);
1510    }
1511    if let Some(ref param_value) = p_query_sort {
1512        req_builder = req_builder.query(&[("sort", &serde_json::to_string(param_value)?)]);
1513    }
1514    if let Some(ref param_value) = p_query_order {
1515        req_builder = req_builder.query(&[("order", &serde_json::to_string(param_value)?)]);
1516    }
1517    if let Some(ref apikey) = configuration.api_key {
1518        let key = apikey.key.clone();
1519        let value = match apikey.prefix {
1520            Some(ref prefix) => format!("{} {}", prefix, key),
1521            None => key,
1522        };
1523        req_builder = req_builder.query(&[("access_token", value)]);
1524    }
1525    if let Some(ref user_agent) = configuration.user_agent {
1526        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1527    }
1528    if let Some(ref auth_conf) = configuration.basic_auth {
1529        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1530    };
1531    if let Some(ref token) = configuration.bearer_access_token {
1532        req_builder = req_builder.bearer_auth(token.to_owned());
1533    };
1534
1535    let req = req_builder.build()?;
1536    let resp = configuration.client.execute(req).await?;
1537
1538    let status = resp.status();
1539    let content_type = resp
1540        .headers()
1541        .get("content-type")
1542        .and_then(|v| v.to_str().ok())
1543        .unwrap_or("application/octet-stream");
1544    let content_type = super::ContentType::from(content_type);
1545
1546    if !status.is_client_error() && !status.is_server_error() {
1547        let content = resp.text().await?;
1548        match content_type {
1549            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1550            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::GroupModel&gt;`"))),
1551            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::GroupModel&gt;`")))),
1552        }
1553    } else {
1554        let content = resp.text().await?;
1555        let entity: Option<GetSubGroupsError> = serde_json::from_str(&content).ok();
1556        Err(Error::ResponseError(ResponseContent {
1557            status,
1558            content,
1559            entity,
1560        }))
1561    }
1562}
1563
1564pub async fn patch_group(
1565    configuration: &configuration::Configuration,
1566    group_ref: &str,
1567    group_patch_input: models::GroupPatchInput,
1568) -> Result<models::GroupModel, Error<PatchGroupError>> {
1569    // add a prefix to parameters to efficiently prevent name collisions
1570    let p_path_group_ref = group_ref;
1571    let p_body_group_patch_input = group_patch_input;
1572
1573    let uri_str = format!(
1574        "{}/groups/{group_ref}/+",
1575        configuration.base_path,
1576        group_ref = crate::apis::urlencode(p_path_group_ref)
1577    );
1578    let mut req_builder = configuration
1579        .client
1580        .request(reqwest::Method::PATCH, &uri_str);
1581
1582    if let Some(ref apikey) = configuration.api_key {
1583        let key = apikey.key.clone();
1584        let value = match apikey.prefix {
1585            Some(ref prefix) => format!("{} {}", prefix, key),
1586            None => key,
1587        };
1588        req_builder = req_builder.query(&[("access_token", value)]);
1589    }
1590    if let Some(ref user_agent) = configuration.user_agent {
1591        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1592    }
1593    if let Some(ref auth_conf) = configuration.basic_auth {
1594        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1595    };
1596    if let Some(ref token) = configuration.bearer_access_token {
1597        req_builder = req_builder.bearer_auth(token.to_owned());
1598    };
1599    req_builder = req_builder.json(&p_body_group_patch_input);
1600
1601    let req = req_builder.build()?;
1602    let resp = configuration.client.execute(req).await?;
1603
1604    let status = resp.status();
1605    let content_type = resp
1606        .headers()
1607        .get("content-type")
1608        .and_then(|v| v.to_str().ok())
1609        .unwrap_or("application/octet-stream");
1610    let content_type = super::ContentType::from(content_type);
1611
1612    if !status.is_client_error() && !status.is_server_error() {
1613        let content = resp.text().await?;
1614        match content_type {
1615            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1616            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupModel`"))),
1617            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupModel`")))),
1618        }
1619    } else {
1620        let content = resp.text().await?;
1621        let entity: Option<PatchGroupError> = serde_json::from_str(&content).ok();
1622        Err(Error::ResponseError(ResponseContent {
1623            status,
1624            content,
1625            entity,
1626        }))
1627    }
1628}
1629
1630pub async fn patch_groups_runner(
1631    configuration: &configuration::Configuration,
1632    group_ref: &str,
1633    runner_uuid: &str,
1634    runner_patch_input: models::RunnerPatchInput,
1635) -> Result<models::RunnerModel, Error<PatchGroupsRunnerError>> {
1636    // add a prefix to parameters to efficiently prevent name collisions
1637    let p_path_group_ref = group_ref;
1638    let p_path_runner_uuid = runner_uuid;
1639    let p_body_runner_patch_input = runner_patch_input;
1640
1641    let uri_str = format!(
1642        "{}/groups/{group_ref}/+/runners/{runner_uuid}",
1643        configuration.base_path,
1644        group_ref = crate::apis::urlencode(p_path_group_ref),
1645        runner_uuid = crate::apis::urlencode(p_path_runner_uuid)
1646    );
1647    let mut req_builder = configuration
1648        .client
1649        .request(reqwest::Method::PATCH, &uri_str);
1650
1651    if let Some(ref apikey) = configuration.api_key {
1652        let key = apikey.key.clone();
1653        let value = match apikey.prefix {
1654            Some(ref prefix) => format!("{} {}", prefix, key),
1655            None => key,
1656        };
1657        req_builder = req_builder.query(&[("access_token", value)]);
1658    }
1659    if let Some(ref user_agent) = configuration.user_agent {
1660        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1661    }
1662    if let Some(ref auth_conf) = configuration.basic_auth {
1663        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1664    };
1665    if let Some(ref token) = configuration.bearer_access_token {
1666        req_builder = req_builder.bearer_auth(token.to_owned());
1667    };
1668    req_builder = req_builder.json(&p_body_runner_patch_input);
1669
1670    let req = req_builder.build()?;
1671    let resp = configuration.client.execute(req).await?;
1672
1673    let status = resp.status();
1674    let content_type = resp
1675        .headers()
1676        .get("content-type")
1677        .and_then(|v| v.to_str().ok())
1678        .unwrap_or("application/octet-stream");
1679    let content_type = super::ContentType::from(content_type);
1680
1681    if !status.is_client_error() && !status.is_server_error() {
1682        let content = resp.text().await?;
1683        match content_type {
1684            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1685            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RunnerModel`"))),
1686            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RunnerModel`")))),
1687        }
1688    } else {
1689        let content = resp.text().await?;
1690        let entity: Option<PatchGroupsRunnerError> = serde_json::from_str(&content).ok();
1691        Err(Error::ResponseError(ResponseContent {
1692            status,
1693            content,
1694            entity,
1695        }))
1696    }
1697}
1698
1699pub async fn patch_groups_variable(
1700    configuration: &configuration::Configuration,
1701    group_ref: &str,
1702    variable_identifier: &str,
1703    variable_patch_input: models::VariablePatchInput,
1704) -> Result<models::VariableModel, Error<PatchGroupsVariableError>> {
1705    // add a prefix to parameters to efficiently prevent name collisions
1706    let p_path_group_ref = group_ref;
1707    let p_path_variable_identifier = variable_identifier;
1708    let p_body_variable_patch_input = variable_patch_input;
1709
1710    let uri_str = format!(
1711        "{}/groups/{group_ref}/+/variables/{variable_identifier}",
1712        configuration.base_path,
1713        group_ref = crate::apis::urlencode(p_path_group_ref),
1714        variable_identifier = crate::apis::urlencode(p_path_variable_identifier)
1715    );
1716    let mut req_builder = configuration
1717        .client
1718        .request(reqwest::Method::PATCH, &uri_str);
1719
1720    if let Some(ref apikey) = configuration.api_key {
1721        let key = apikey.key.clone();
1722        let value = match apikey.prefix {
1723            Some(ref prefix) => format!("{} {}", prefix, key),
1724            None => key,
1725        };
1726        req_builder = req_builder.query(&[("access_token", value)]);
1727    }
1728    if let Some(ref user_agent) = configuration.user_agent {
1729        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1730    }
1731    if let Some(ref auth_conf) = configuration.basic_auth {
1732        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1733    };
1734    if let Some(ref token) = configuration.bearer_access_token {
1735        req_builder = req_builder.bearer_auth(token.to_owned());
1736    };
1737    req_builder = req_builder.json(&p_body_variable_patch_input);
1738
1739    let req = req_builder.build()?;
1740    let resp = configuration.client.execute(req).await?;
1741
1742    let status = resp.status();
1743    let content_type = resp
1744        .headers()
1745        .get("content-type")
1746        .and_then(|v| v.to_str().ok())
1747        .unwrap_or("application/octet-stream");
1748    let content_type = super::ContentType::from(content_type);
1749
1750    if !status.is_client_error() && !status.is_server_error() {
1751        let content = resp.text().await?;
1752        match content_type {
1753            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1754            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VariableModel`"))),
1755            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::VariableModel`")))),
1756        }
1757    } else {
1758        let content = resp.text().await?;
1759        let entity: Option<PatchGroupsVariableError> = serde_json::from_str(&content).ok();
1760        Err(Error::ResponseError(ResponseContent {
1761            status,
1762            content,
1763            entity,
1764        }))
1765    }
1766}
1767
1768pub async fn patch_member(
1769    configuration: &configuration::Configuration,
1770    group_ref: &str,
1771    user_identifier: &str,
1772    group_member_update_input: models::GroupMemberUpdateInput,
1773) -> Result<models::MembershipModel, Error<PatchMemberError>> {
1774    // add a prefix to parameters to efficiently prevent name collisions
1775    let p_path_group_ref = group_ref;
1776    let p_path_user_identifier = user_identifier;
1777    let p_body_group_member_update_input = group_member_update_input;
1778
1779    let uri_str = format!(
1780        "{}/groups/{group_ref}/+/members/{user_identifier}",
1781        configuration.base_path,
1782        group_ref = crate::apis::urlencode(p_path_group_ref),
1783        user_identifier = crate::apis::urlencode(p_path_user_identifier)
1784    );
1785    let mut req_builder = configuration
1786        .client
1787        .request(reqwest::Method::PATCH, &uri_str);
1788
1789    if let Some(ref apikey) = configuration.api_key {
1790        let key = apikey.key.clone();
1791        let value = match apikey.prefix {
1792            Some(ref prefix) => format!("{} {}", prefix, key),
1793            None => key,
1794        };
1795        req_builder = req_builder.query(&[("access_token", value)]);
1796    }
1797    if let Some(ref user_agent) = configuration.user_agent {
1798        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1799    }
1800    if let Some(ref auth_conf) = configuration.basic_auth {
1801        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1802    };
1803    if let Some(ref token) = configuration.bearer_access_token {
1804        req_builder = req_builder.bearer_auth(token.to_owned());
1805    };
1806    req_builder = req_builder.json(&p_body_group_member_update_input);
1807
1808    let req = req_builder.build()?;
1809    let resp = configuration.client.execute(req).await?;
1810
1811    let status = resp.status();
1812    let content_type = resp
1813        .headers()
1814        .get("content-type")
1815        .and_then(|v| v.to_str().ok())
1816        .unwrap_or("application/octet-stream");
1817    let content_type = super::ContentType::from(content_type);
1818
1819    if !status.is_client_error() && !status.is_server_error() {
1820        let content = resp.text().await?;
1821        match content_type {
1822            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1823            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MembershipModel`"))),
1824            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MembershipModel`")))),
1825        }
1826    } else {
1827        let content = resp.text().await?;
1828        let entity: Option<PatchMemberError> = serde_json::from_str(&content).ok();
1829        Err(Error::ResponseError(ResponseContent {
1830            status,
1831            content,
1832            entity,
1833        }))
1834    }
1835}
1836
1837pub async fn post_group(
1838    configuration: &configuration::Configuration,
1839    group_create_input: models::GroupCreateInput,
1840) -> Result<models::GroupModel, Error<PostGroupError>> {
1841    // add a prefix to parameters to efficiently prevent name collisions
1842    let p_body_group_create_input = group_create_input;
1843
1844    let uri_str = format!("{}/groups", configuration.base_path);
1845    let mut req_builder = configuration
1846        .client
1847        .request(reqwest::Method::POST, &uri_str);
1848
1849    if let Some(ref user_agent) = configuration.user_agent {
1850        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1851    }
1852    req_builder = req_builder.json(&p_body_group_create_input);
1853
1854    let req = req_builder.build()?;
1855    let resp = configuration.client.execute(req).await?;
1856
1857    let status = resp.status();
1858    let content_type = resp
1859        .headers()
1860        .get("content-type")
1861        .and_then(|v| v.to_str().ok())
1862        .unwrap_or("application/octet-stream");
1863    let content_type = super::ContentType::from(content_type);
1864
1865    if !status.is_client_error() && !status.is_server_error() {
1866        let content = resp.text().await?;
1867        match content_type {
1868            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1869            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupModel`"))),
1870            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupModel`")))),
1871        }
1872    } else {
1873        let content = resp.text().await?;
1874        let entity: Option<PostGroupError> = serde_json::from_str(&content).ok();
1875        Err(Error::ResponseError(ResponseContent {
1876            status,
1877            content,
1878            entity,
1879        }))
1880    }
1881}
1882
1883pub async fn post_groups_variable(
1884    configuration: &configuration::Configuration,
1885    group_ref: &str,
1886    variable_create_input: models::VariableCreateInput,
1887) -> Result<models::VariableModel, Error<PostGroupsVariableError>> {
1888    // add a prefix to parameters to efficiently prevent name collisions
1889    let p_path_group_ref = group_ref;
1890    let p_body_variable_create_input = variable_create_input;
1891
1892    let uri_str = format!(
1893        "{}/groups/{group_ref}/+/variables",
1894        configuration.base_path,
1895        group_ref = crate::apis::urlencode(p_path_group_ref)
1896    );
1897    let mut req_builder = configuration
1898        .client
1899        .request(reqwest::Method::POST, &uri_str);
1900
1901    if let Some(ref apikey) = configuration.api_key {
1902        let key = apikey.key.clone();
1903        let value = match apikey.prefix {
1904            Some(ref prefix) => format!("{} {}", prefix, key),
1905            None => key,
1906        };
1907        req_builder = req_builder.query(&[("access_token", value)]);
1908    }
1909    if let Some(ref user_agent) = configuration.user_agent {
1910        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1911    }
1912    if let Some(ref auth_conf) = configuration.basic_auth {
1913        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
1914    };
1915    if let Some(ref token) = configuration.bearer_access_token {
1916        req_builder = req_builder.bearer_auth(token.to_owned());
1917    };
1918    req_builder = req_builder.json(&p_body_variable_create_input);
1919
1920    let req = req_builder.build()?;
1921    let resp = configuration.client.execute(req).await?;
1922
1923    let status = resp.status();
1924    let content_type = resp
1925        .headers()
1926        .get("content-type")
1927        .and_then(|v| v.to_str().ok())
1928        .unwrap_or("application/octet-stream");
1929    let content_type = super::ContentType::from(content_type);
1930
1931    if !status.is_client_error() && !status.is_server_error() {
1932        let content = resp.text().await?;
1933        match content_type {
1934            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1935            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VariableModel`"))),
1936            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::VariableModel`")))),
1937        }
1938    } else {
1939        let content = resp.text().await?;
1940        let entity: Option<PostGroupsVariableError> = serde_json::from_str(&content).ok();
1941        Err(Error::ResponseError(ResponseContent {
1942            status,
1943            content,
1944            entity,
1945        }))
1946    }
1947}
1948
1949pub async fn post_import(
1950    configuration: &configuration::Configuration,
1951    group_import_input: models::GroupImportInput,
1952) -> Result<models::GroupModel, Error<PostImportError>> {
1953    // add a prefix to parameters to efficiently prevent name collisions
1954    let p_body_group_import_input = group_import_input;
1955
1956    let uri_str = format!("{}/groups/import", configuration.base_path);
1957    let mut req_builder = configuration
1958        .client
1959        .request(reqwest::Method::POST, &uri_str);
1960
1961    if let Some(ref user_agent) = configuration.user_agent {
1962        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1963    }
1964    req_builder = req_builder.json(&p_body_group_import_input);
1965
1966    let req = req_builder.build()?;
1967    let resp = configuration.client.execute(req).await?;
1968
1969    let status = resp.status();
1970    let content_type = resp
1971        .headers()
1972        .get("content-type")
1973        .and_then(|v| v.to_str().ok())
1974        .unwrap_or("application/octet-stream");
1975    let content_type = super::ContentType::from(content_type);
1976
1977    if !status.is_client_error() && !status.is_server_error() {
1978        let content = resp.text().await?;
1979        match content_type {
1980            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1981            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupModel`"))),
1982            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupModel`")))),
1983        }
1984    } else {
1985        let content = resp.text().await?;
1986        let entity: Option<PostImportError> = serde_json::from_str(&content).ok();
1987        Err(Error::ResponseError(ResponseContent {
1988            status,
1989            content,
1990            entity,
1991        }))
1992    }
1993}
1994
1995pub async fn post_import_repos(
1996    configuration: &configuration::Configuration,
1997    group_ref: &str,
1998    group_import_repos_input: models::GroupImportReposInput,
1999) -> Result<models::GroupImportReposOutput, Error<PostImportReposError>> {
2000    // add a prefix to parameters to efficiently prevent name collisions
2001    let p_path_group_ref = group_ref;
2002    let p_body_group_import_repos_input = group_import_repos_input;
2003
2004    let uri_str = format!(
2005        "{}/groups/{group_ref}/+/import",
2006        configuration.base_path,
2007        group_ref = crate::apis::urlencode(p_path_group_ref)
2008    );
2009    let mut req_builder = configuration
2010        .client
2011        .request(reqwest::Method::POST, &uri_str);
2012
2013    if let Some(ref apikey) = configuration.api_key {
2014        let key = apikey.key.clone();
2015        let value = match apikey.prefix {
2016            Some(ref prefix) => format!("{} {}", prefix, key),
2017            None => key,
2018        };
2019        req_builder = req_builder.query(&[("access_token", value)]);
2020    }
2021    if let Some(ref user_agent) = configuration.user_agent {
2022        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2023    }
2024    if let Some(ref auth_conf) = configuration.basic_auth {
2025        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2026    };
2027    if let Some(ref token) = configuration.bearer_access_token {
2028        req_builder = req_builder.bearer_auth(token.to_owned());
2029    };
2030    req_builder = req_builder.json(&p_body_group_import_repos_input);
2031
2032    let req = req_builder.build()?;
2033    let resp = configuration.client.execute(req).await?;
2034
2035    let status = resp.status();
2036    let content_type = resp
2037        .headers()
2038        .get("content-type")
2039        .and_then(|v| v.to_str().ok())
2040        .unwrap_or("application/octet-stream");
2041    let content_type = super::ContentType::from(content_type);
2042
2043    if !status.is_client_error() && !status.is_server_error() {
2044        let content = resp.text().await?;
2045        match content_type {
2046            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2047            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupImportReposOutput`"))),
2048            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupImportReposOutput`")))),
2049        }
2050    } else {
2051        let content = resp.text().await?;
2052        let entity: Option<PostImportReposError> = serde_json::from_str(&content).ok();
2053        Err(Error::ResponseError(ResponseContent {
2054            status,
2055            content,
2056            entity,
2057        }))
2058    }
2059}
2060
2061pub async fn post_member(
2062    configuration: &configuration::Configuration,
2063    group_ref: &str,
2064    group_member_add_input: models::GroupMemberAddInput,
2065) -> Result<models::MembershipUserGroup, Error<PostMemberError>> {
2066    // add a prefix to parameters to efficiently prevent name collisions
2067    let p_path_group_ref = group_ref;
2068    let p_body_group_member_add_input = group_member_add_input;
2069
2070    let uri_str = format!(
2071        "{}/groups/{group_ref}/+/members",
2072        configuration.base_path,
2073        group_ref = crate::apis::urlencode(p_path_group_ref)
2074    );
2075    let mut req_builder = configuration
2076        .client
2077        .request(reqwest::Method::POST, &uri_str);
2078
2079    if let Some(ref apikey) = configuration.api_key {
2080        let key = apikey.key.clone();
2081        let value = match apikey.prefix {
2082            Some(ref prefix) => format!("{} {}", prefix, key),
2083            None => key,
2084        };
2085        req_builder = req_builder.query(&[("access_token", value)]);
2086    }
2087    if let Some(ref user_agent) = configuration.user_agent {
2088        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2089    }
2090    if let Some(ref auth_conf) = configuration.basic_auth {
2091        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2092    };
2093    if let Some(ref token) = configuration.bearer_access_token {
2094        req_builder = req_builder.bearer_auth(token.to_owned());
2095    };
2096    req_builder = req_builder.json(&p_body_group_member_add_input);
2097
2098    let req = req_builder.build()?;
2099    let resp = configuration.client.execute(req).await?;
2100
2101    let status = resp.status();
2102    let content_type = resp
2103        .headers()
2104        .get("content-type")
2105        .and_then(|v| v.to_str().ok())
2106        .unwrap_or("application/octet-stream");
2107    let content_type = super::ContentType::from(content_type);
2108
2109    if !status.is_client_error() && !status.is_server_error() {
2110        let content = resp.text().await?;
2111        match content_type {
2112            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2113            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MembershipUserGroup`"))),
2114            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MembershipUserGroup`")))),
2115        }
2116    } else {
2117        let content = resp.text().await?;
2118        let entity: Option<PostMemberError> = serde_json::from_str(&content).ok();
2119        Err(Error::ResponseError(ResponseContent {
2120            status,
2121            content,
2122            entity,
2123        }))
2124    }
2125}
2126
2127pub async fn post_move(
2128    configuration: &configuration::Configuration,
2129    group_ref: &str,
2130    group_move_input: models::GroupMoveInput,
2131) -> Result<models::GroupModel, Error<PostMoveError>> {
2132    // add a prefix to parameters to efficiently prevent name collisions
2133    let p_path_group_ref = group_ref;
2134    let p_body_group_move_input = group_move_input;
2135
2136    let uri_str = format!(
2137        "{}/groups/{group_ref}/+/move",
2138        configuration.base_path,
2139        group_ref = crate::apis::urlencode(p_path_group_ref)
2140    );
2141    let mut req_builder = configuration
2142        .client
2143        .request(reqwest::Method::POST, &uri_str);
2144
2145    if let Some(ref apikey) = configuration.api_key {
2146        let key = apikey.key.clone();
2147        let value = match apikey.prefix {
2148            Some(ref prefix) => format!("{} {}", prefix, key),
2149            None => key,
2150        };
2151        req_builder = req_builder.query(&[("access_token", value)]);
2152    }
2153    if let Some(ref user_agent) = configuration.user_agent {
2154        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2155    }
2156    if let Some(ref auth_conf) = configuration.basic_auth {
2157        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2158    };
2159    if let Some(ref token) = configuration.bearer_access_token {
2160        req_builder = req_builder.bearer_auth(token.to_owned());
2161    };
2162    req_builder = req_builder.json(&p_body_group_move_input);
2163
2164    let req = req_builder.build()?;
2165    let resp = configuration.client.execute(req).await?;
2166
2167    let status = resp.status();
2168    let content_type = resp
2169        .headers()
2170        .get("content-type")
2171        .and_then(|v| v.to_str().ok())
2172        .unwrap_or("application/octet-stream");
2173    let content_type = super::ContentType::from(content_type);
2174
2175    if !status.is_client_error() && !status.is_server_error() {
2176        let content = resp.text().await?;
2177        match content_type {
2178            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2179            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupModel`"))),
2180            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupModel`")))),
2181        }
2182    } else {
2183        let content = resp.text().await?;
2184        let entity: Option<PostMoveError> = serde_json::from_str(&content).ok();
2185        Err(Error::ResponseError(ResponseContent {
2186            status,
2187            content,
2188            entity,
2189        }))
2190    }
2191}
2192
2193pub async fn post_purge(
2194    configuration: &configuration::Configuration,
2195    group_ref: &str,
2196) -> Result<(), Error<PostPurgeError>> {
2197    // add a prefix to parameters to efficiently prevent name collisions
2198    let p_path_group_ref = group_ref;
2199
2200    let uri_str = format!(
2201        "{}/groups/{group_ref}/+/purge",
2202        configuration.base_path,
2203        group_ref = crate::apis::urlencode(p_path_group_ref)
2204    );
2205    let mut req_builder = configuration
2206        .client
2207        .request(reqwest::Method::POST, &uri_str);
2208
2209    if let Some(ref apikey) = configuration.api_key {
2210        let key = apikey.key.clone();
2211        let value = match apikey.prefix {
2212            Some(ref prefix) => format!("{} {}", prefix, key),
2213            None => key,
2214        };
2215        req_builder = req_builder.query(&[("access_token", value)]);
2216    }
2217    if let Some(ref user_agent) = configuration.user_agent {
2218        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2219    }
2220    if let Some(ref auth_conf) = configuration.basic_auth {
2221        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2222    };
2223    if let Some(ref token) = configuration.bearer_access_token {
2224        req_builder = req_builder.bearer_auth(token.to_owned());
2225    };
2226
2227    let req = req_builder.build()?;
2228    let resp = configuration.client.execute(req).await?;
2229
2230    let status = resp.status();
2231
2232    if !status.is_client_error() && !status.is_server_error() {
2233        Ok(())
2234    } else {
2235        let content = resp.text().await?;
2236        let entity: Option<PostPurgeError> = serde_json::from_str(&content).ok();
2237        Err(Error::ResponseError(ResponseContent {
2238            status,
2239            content,
2240            entity,
2241        }))
2242    }
2243}
2244
2245pub async fn post_restore(
2246    configuration: &configuration::Configuration,
2247    group_ref: &str,
2248    group_restore_input: models::GroupRestoreInput,
2249) -> Result<models::GroupModel, Error<PostRestoreError>> {
2250    // add a prefix to parameters to efficiently prevent name collisions
2251    let p_path_group_ref = group_ref;
2252    let p_body_group_restore_input = group_restore_input;
2253
2254    let uri_str = format!(
2255        "{}/groups/{group_ref}/+/restore",
2256        configuration.base_path,
2257        group_ref = crate::apis::urlencode(p_path_group_ref)
2258    );
2259    let mut req_builder = configuration
2260        .client
2261        .request(reqwest::Method::POST, &uri_str);
2262
2263    if let Some(ref apikey) = configuration.api_key {
2264        let key = apikey.key.clone();
2265        let value = match apikey.prefix {
2266            Some(ref prefix) => format!("{} {}", prefix, key),
2267            None => key,
2268        };
2269        req_builder = req_builder.query(&[("access_token", value)]);
2270    }
2271    if let Some(ref user_agent) = configuration.user_agent {
2272        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2273    }
2274    if let Some(ref auth_conf) = configuration.basic_auth {
2275        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2276    };
2277    if let Some(ref token) = configuration.bearer_access_token {
2278        req_builder = req_builder.bearer_auth(token.to_owned());
2279    };
2280    req_builder = req_builder.json(&p_body_group_restore_input);
2281
2282    let req = req_builder.build()?;
2283    let resp = configuration.client.execute(req).await?;
2284
2285    let status = resp.status();
2286    let content_type = resp
2287        .headers()
2288        .get("content-type")
2289        .and_then(|v| v.to_str().ok())
2290        .unwrap_or("application/octet-stream");
2291    let content_type = super::ContentType::from(content_type);
2292
2293    if !status.is_client_error() && !status.is_server_error() {
2294        let content = resp.text().await?;
2295        match content_type {
2296            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2297            ContentType::Text => Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GroupModel`"))),
2298            ContentType::Unsupported(unknown_type) => Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GroupModel`")))),
2299        }
2300    } else {
2301        let content = resp.text().await?;
2302        let entity: Option<PostRestoreError> = serde_json::from_str(&content).ok();
2303        Err(Error::ResponseError(ResponseContent {
2304            status,
2305            content,
2306            entity,
2307        }))
2308    }
2309}
2310
2311pub async fn soft_delete(
2312    configuration: &configuration::Configuration,
2313    group_ref: &str,
2314) -> Result<(), Error<SoftDeleteError>> {
2315    // add a prefix to parameters to efficiently prevent name collisions
2316    let p_path_group_ref = group_ref;
2317
2318    let uri_str = format!(
2319        "{}/groups/{group_ref}/+",
2320        configuration.base_path,
2321        group_ref = crate::apis::urlencode(p_path_group_ref)
2322    );
2323    let mut req_builder = configuration
2324        .client
2325        .request(reqwest::Method::DELETE, &uri_str);
2326
2327    if let Some(ref apikey) = configuration.api_key {
2328        let key = apikey.key.clone();
2329        let value = match apikey.prefix {
2330            Some(ref prefix) => format!("{} {}", prefix, key),
2331            None => key,
2332        };
2333        req_builder = req_builder.query(&[("access_token", value)]);
2334    }
2335    if let Some(ref user_agent) = configuration.user_agent {
2336        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2337    }
2338    if let Some(ref auth_conf) = configuration.basic_auth {
2339        req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned());
2340    };
2341    if let Some(ref token) = configuration.bearer_access_token {
2342        req_builder = req_builder.bearer_auth(token.to_owned());
2343    };
2344
2345    let req = req_builder.build()?;
2346    let resp = configuration.client.execute(req).await?;
2347
2348    let status = resp.status();
2349
2350    if !status.is_client_error() && !status.is_server_error() {
2351        Ok(())
2352    } else {
2353        let content = resp.text().await?;
2354        let entity: Option<SoftDeleteError> = serde_json::from_str(&content).ok();
2355        Err(Error::ResponseError(ResponseContent {
2356            status,
2357            content,
2358            entity,
2359        }))
2360    }
2361}