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