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 OrganizationsCreateWithoutPaymentPostError {
21 UnknownValue(serde_json::Value),
22}
23
24#[derive(Debug, Clone, Serialize, Deserialize)]
26#[serde(untagged)]
27pub enum OrganizationsGetError {
28 UnknownValue(serde_json::Value),
29}
30
31#[derive(Debug, Clone, Serialize, Deserialize)]
33#[serde(untagged)]
34pub enum OrganizationsIdApiKeyInformationTypeGetError {
35 UnknownValue(serde_json::Value),
36}
37
38#[derive(Debug, Clone, Serialize, Deserialize)]
40#[serde(untagged)]
41pub enum OrganizationsIdApiKeyPostError {
42 UnknownValue(serde_json::Value),
43}
44
45#[derive(Debug, Clone, Serialize, Deserialize)]
47#[serde(untagged)]
48pub enum OrganizationsIdCancelPostError {
49 UnknownValue(serde_json::Value),
50}
51
52#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum OrganizationsIdCollectionManagementPutError {
56 UnknownValue(serde_json::Value),
57}
58
59#[derive(Debug, Clone, Serialize, Deserialize)]
61#[serde(untagged)]
62pub enum OrganizationsIdDeleteError {
63 UnknownValue(serde_json::Value),
64}
65
66#[derive(Debug, Clone, Serialize, Deserialize)]
68#[serde(untagged)]
69pub enum OrganizationsIdDeletePostError {
70 UnknownValue(serde_json::Value),
71}
72
73#[derive(Debug, Clone, Serialize, Deserialize)]
75#[serde(untagged)]
76pub enum OrganizationsIdDeleteRecoverTokenPostError {
77 UnknownValue(serde_json::Value),
78}
79
80#[derive(Debug, Clone, Serialize, Deserialize)]
82#[serde(untagged)]
83pub enum OrganizationsIdGetError {
84 UnknownValue(serde_json::Value),
85}
86
87#[derive(Debug, Clone, Serialize, Deserialize)]
89#[serde(untagged)]
90pub enum OrganizationsIdKeysGetError {
91 UnknownValue(serde_json::Value),
92}
93
94#[derive(Debug, Clone, Serialize, Deserialize)]
96#[serde(untagged)]
97pub enum OrganizationsIdKeysPostError {
98 UnknownValue(serde_json::Value),
99}
100
101#[derive(Debug, Clone, Serialize, Deserialize)]
103#[serde(untagged)]
104pub enum OrganizationsIdLeavePostError {
105 UnknownValue(serde_json::Value),
106}
107
108#[derive(Debug, Clone, Serialize, Deserialize)]
110#[serde(untagged)]
111pub enum OrganizationsIdLicenseGetError {
112 UnknownValue(serde_json::Value),
113}
114
115#[derive(Debug, Clone, Serialize, Deserialize)]
117#[serde(untagged)]
118pub enum OrganizationsIdPaymentPostError {
119 UnknownValue(serde_json::Value),
120}
121
122#[derive(Debug, Clone, Serialize, Deserialize)]
124#[serde(untagged)]
125pub enum OrganizationsIdPlanTypeGetError {
126 UnknownValue(serde_json::Value),
127}
128
129#[derive(Debug, Clone, Serialize, Deserialize)]
131#[serde(untagged)]
132pub enum OrganizationsIdPostError {
133 UnknownValue(serde_json::Value),
134}
135
136#[derive(Debug, Clone, Serialize, Deserialize)]
138#[serde(untagged)]
139pub enum OrganizationsIdPublicKeyGetError {
140 UnknownValue(serde_json::Value),
141}
142
143#[derive(Debug, Clone, Serialize, Deserialize)]
145#[serde(untagged)]
146pub enum OrganizationsIdPutError {
147 UnknownValue(serde_json::Value),
148}
149
150#[derive(Debug, Clone, Serialize, Deserialize)]
152#[serde(untagged)]
153pub enum OrganizationsIdReinstatePostError {
154 UnknownValue(serde_json::Value),
155}
156
157#[derive(Debug, Clone, Serialize, Deserialize)]
159#[serde(untagged)]
160pub enum OrganizationsIdRotateApiKeyPostError {
161 UnknownValue(serde_json::Value),
162}
163
164#[derive(Debug, Clone, Serialize, Deserialize)]
166#[serde(untagged)]
167pub enum OrganizationsIdSeatPostError {
168 UnknownValue(serde_json::Value),
169}
170
171#[derive(Debug, Clone, Serialize, Deserialize)]
173#[serde(untagged)]
174pub enum OrganizationsIdSmSubscriptionPostError {
175 UnknownValue(serde_json::Value),
176}
177
178#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(untagged)]
181pub enum OrganizationsIdSsoGetError {
182 UnknownValue(serde_json::Value),
183}
184
185#[derive(Debug, Clone, Serialize, Deserialize)]
187#[serde(untagged)]
188pub enum OrganizationsIdSsoPostError {
189 UnknownValue(serde_json::Value),
190}
191
192#[derive(Debug, Clone, Serialize, Deserialize)]
194#[serde(untagged)]
195pub enum OrganizationsIdStoragePostError {
196 UnknownValue(serde_json::Value),
197}
198
199#[derive(Debug, Clone, Serialize, Deserialize)]
201#[serde(untagged)]
202pub enum OrganizationsIdSubscribeSecretsManagerPostError {
203 UnknownValue(serde_json::Value),
204}
205
206#[derive(Debug, Clone, Serialize, Deserialize)]
208#[serde(untagged)]
209pub enum OrganizationsIdSubscriptionGetError {
210 UnknownValue(serde_json::Value),
211}
212
213#[derive(Debug, Clone, Serialize, Deserialize)]
215#[serde(untagged)]
216pub enum OrganizationsIdSubscriptionPostError {
217 UnknownValue(serde_json::Value),
218}
219
220#[derive(Debug, Clone, Serialize, Deserialize)]
222#[serde(untagged)]
223pub enum OrganizationsIdTaxGetError {
224 UnknownValue(serde_json::Value),
225}
226
227#[derive(Debug, Clone, Serialize, Deserialize)]
229#[serde(untagged)]
230pub enum OrganizationsIdTaxPutError {
231 UnknownValue(serde_json::Value),
232}
233
234#[derive(Debug, Clone, Serialize, Deserialize)]
236#[serde(untagged)]
237pub enum OrganizationsIdUpgradePostError {
238 UnknownValue(serde_json::Value),
239}
240
241#[derive(Debug, Clone, Serialize, Deserialize)]
243#[serde(untagged)]
244pub enum OrganizationsIdVerifyBankPostError {
245 UnknownValue(serde_json::Value),
246}
247
248#[derive(Debug, Clone, Serialize, Deserialize)]
250#[serde(untagged)]
251pub enum OrganizationsIdentifierAutoEnrollStatusGetError {
252 UnknownValue(serde_json::Value),
253}
254
255#[derive(Debug, Clone, Serialize, Deserialize)]
257#[serde(untagged)]
258pub enum OrganizationsPostError {
259 UnknownValue(serde_json::Value),
260}
261
262pub async fn organizations_create_without_payment_post(
263 configuration: &configuration::Configuration,
264 organization_no_payment_create_request: Option<models::OrganizationNoPaymentCreateRequest>,
265) -> Result<models::OrganizationResponseModel, Error<OrganizationsCreateWithoutPaymentPostError>> {
266 let p_organization_no_payment_create_request = organization_no_payment_create_request;
268
269 let uri_str = format!(
270 "{}/organizations/create-without-payment",
271 configuration.base_path
272 );
273 let mut req_builder = configuration
274 .client
275 .request(reqwest::Method::POST, &uri_str);
276
277 if let Some(ref user_agent) = configuration.user_agent {
278 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
279 }
280 if let Some(ref token) = configuration.oauth_access_token {
281 req_builder = req_builder.bearer_auth(token.to_owned());
282 };
283 req_builder = req_builder.json(&p_organization_no_payment_create_request);
284
285 let req = req_builder.build()?;
286 let resp = configuration.client.execute(req).await?;
287
288 let status = resp.status();
289 let content_type = resp
290 .headers()
291 .get("content-type")
292 .and_then(|v| v.to_str().ok())
293 .unwrap_or("application/octet-stream");
294 let content_type = super::ContentType::from(content_type);
295
296 if !status.is_client_error() && !status.is_server_error() {
297 let content = resp.text().await?;
298 match content_type {
299 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
300 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`"))),
301 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`")))),
302 }
303 } else {
304 let content = resp.text().await?;
305 let entity: Option<OrganizationsCreateWithoutPaymentPostError> =
306 serde_json::from_str(&content).ok();
307 Err(Error::ResponseError(ResponseContent {
308 status,
309 content,
310 entity,
311 }))
312 }
313}
314
315pub async fn organizations_get(
316 configuration: &configuration::Configuration,
317) -> Result<models::ProfileOrganizationResponseModelListResponseModel, Error<OrganizationsGetError>>
318{
319 let uri_str = format!("{}/organizations", configuration.base_path);
320 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
321
322 if let Some(ref user_agent) = configuration.user_agent {
323 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
324 }
325 if let Some(ref token) = configuration.oauth_access_token {
326 req_builder = req_builder.bearer_auth(token.to_owned());
327 };
328
329 let req = req_builder.build()?;
330 let resp = configuration.client.execute(req).await?;
331
332 let status = resp.status();
333 let content_type = resp
334 .headers()
335 .get("content-type")
336 .and_then(|v| v.to_str().ok())
337 .unwrap_or("application/octet-stream");
338 let content_type = super::ContentType::from(content_type);
339
340 if !status.is_client_error() && !status.is_server_error() {
341 let content = resp.text().await?;
342 match content_type {
343 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
344 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModelListResponseModel`"))),
345 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModelListResponseModel`")))),
346 }
347 } else {
348 let content = resp.text().await?;
349 let entity: Option<OrganizationsGetError> = serde_json::from_str(&content).ok();
350 Err(Error::ResponseError(ResponseContent {
351 status,
352 content,
353 entity,
354 }))
355 }
356}
357
358pub async fn organizations_id_api_key_information_type_get(
359 configuration: &configuration::Configuration,
360 id: uuid::Uuid,
361 r#type: models::OrganizationApiKeyType,
362) -> Result<
363 models::OrganizationApiKeyInformationListResponseModel,
364 Error<OrganizationsIdApiKeyInformationTypeGetError>,
365> {
366 let p_id = id;
368 let p_type = r#type;
369
370 let uri_str = format!("{}/organizations/{id}/api-key-information/{type}", configuration.base_path, id=crate::apis::urlencode(p_id.to_string()), type=p_type.to_string());
371 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
372
373 if let Some(ref user_agent) = configuration.user_agent {
374 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
375 }
376 if let Some(ref token) = configuration.oauth_access_token {
377 req_builder = req_builder.bearer_auth(token.to_owned());
378 };
379
380 let req = req_builder.build()?;
381 let resp = configuration.client.execute(req).await?;
382
383 let status = resp.status();
384 let content_type = resp
385 .headers()
386 .get("content-type")
387 .and_then(|v| v.to_str().ok())
388 .unwrap_or("application/octet-stream");
389 let content_type = super::ContentType::from(content_type);
390
391 if !status.is_client_error() && !status.is_server_error() {
392 let content = resp.text().await?;
393 match content_type {
394 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
395 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationApiKeyInformationListResponseModel`"))),
396 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationApiKeyInformationListResponseModel`")))),
397 }
398 } else {
399 let content = resp.text().await?;
400 let entity: Option<OrganizationsIdApiKeyInformationTypeGetError> =
401 serde_json::from_str(&content).ok();
402 Err(Error::ResponseError(ResponseContent {
403 status,
404 content,
405 entity,
406 }))
407 }
408}
409
410pub async fn organizations_id_api_key_post(
411 configuration: &configuration::Configuration,
412 id: &str,
413 organization_api_key_request_model: Option<models::OrganizationApiKeyRequestModel>,
414) -> Result<models::ApiKeyResponseModel, Error<OrganizationsIdApiKeyPostError>> {
415 let p_id = id;
417 let p_organization_api_key_request_model = organization_api_key_request_model;
418
419 let uri_str = format!(
420 "{}/organizations/{id}/api-key",
421 configuration.base_path,
422 id = crate::apis::urlencode(p_id)
423 );
424 let mut req_builder = configuration
425 .client
426 .request(reqwest::Method::POST, &uri_str);
427
428 if let Some(ref user_agent) = configuration.user_agent {
429 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
430 }
431 if let Some(ref token) = configuration.oauth_access_token {
432 req_builder = req_builder.bearer_auth(token.to_owned());
433 };
434 req_builder = req_builder.json(&p_organization_api_key_request_model);
435
436 let req = req_builder.build()?;
437 let resp = configuration.client.execute(req).await?;
438
439 let status = resp.status();
440 let content_type = resp
441 .headers()
442 .get("content-type")
443 .and_then(|v| v.to_str().ok())
444 .unwrap_or("application/octet-stream");
445 let content_type = super::ContentType::from(content_type);
446
447 if !status.is_client_error() && !status.is_server_error() {
448 let content = resp.text().await?;
449 match content_type {
450 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
451 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponseModel`"))),
452 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiKeyResponseModel`")))),
453 }
454 } else {
455 let content = resp.text().await?;
456 let entity: Option<OrganizationsIdApiKeyPostError> = serde_json::from_str(&content).ok();
457 Err(Error::ResponseError(ResponseContent {
458 status,
459 content,
460 entity,
461 }))
462 }
463}
464
465pub async fn organizations_id_cancel_post(
466 configuration: &configuration::Configuration,
467 id: uuid::Uuid,
468 subscription_cancellation_request_model: Option<models::SubscriptionCancellationRequestModel>,
469) -> Result<(), Error<OrganizationsIdCancelPostError>> {
470 let p_id = id;
472 let p_subscription_cancellation_request_model = subscription_cancellation_request_model;
473
474 let uri_str = format!(
475 "{}/organizations/{id}/cancel",
476 configuration.base_path,
477 id = crate::apis::urlencode(p_id.to_string())
478 );
479 let mut req_builder = configuration
480 .client
481 .request(reqwest::Method::POST, &uri_str);
482
483 if let Some(ref user_agent) = configuration.user_agent {
484 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
485 }
486 if let Some(ref token) = configuration.oauth_access_token {
487 req_builder = req_builder.bearer_auth(token.to_owned());
488 };
489 req_builder = req_builder.json(&p_subscription_cancellation_request_model);
490
491 let req = req_builder.build()?;
492 let resp = configuration.client.execute(req).await?;
493
494 let status = resp.status();
495
496 if !status.is_client_error() && !status.is_server_error() {
497 Ok(())
498 } else {
499 let content = resp.text().await?;
500 let entity: Option<OrganizationsIdCancelPostError> = serde_json::from_str(&content).ok();
501 Err(Error::ResponseError(ResponseContent {
502 status,
503 content,
504 entity,
505 }))
506 }
507}
508
509pub async fn organizations_id_collection_management_put(
510 configuration: &configuration::Configuration,
511 id: uuid::Uuid,
512 organization_collection_management_update_request_model: Option<
513 models::OrganizationCollectionManagementUpdateRequestModel,
514 >,
515) -> Result<models::OrganizationResponseModel, Error<OrganizationsIdCollectionManagementPutError>> {
516 let p_id = id;
518 let p_organization_collection_management_update_request_model =
519 organization_collection_management_update_request_model;
520
521 let uri_str = format!(
522 "{}/organizations/{id}/collection-management",
523 configuration.base_path,
524 id = crate::apis::urlencode(p_id.to_string())
525 );
526 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
527
528 if let Some(ref user_agent) = configuration.user_agent {
529 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
530 }
531 if let Some(ref token) = configuration.oauth_access_token {
532 req_builder = req_builder.bearer_auth(token.to_owned());
533 };
534 req_builder = req_builder.json(&p_organization_collection_management_update_request_model);
535
536 let req = req_builder.build()?;
537 let resp = configuration.client.execute(req).await?;
538
539 let status = resp.status();
540 let content_type = resp
541 .headers()
542 .get("content-type")
543 .and_then(|v| v.to_str().ok())
544 .unwrap_or("application/octet-stream");
545 let content_type = super::ContentType::from(content_type);
546
547 if !status.is_client_error() && !status.is_server_error() {
548 let content = resp.text().await?;
549 match content_type {
550 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
551 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`"))),
552 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`")))),
553 }
554 } else {
555 let content = resp.text().await?;
556 let entity: Option<OrganizationsIdCollectionManagementPutError> =
557 serde_json::from_str(&content).ok();
558 Err(Error::ResponseError(ResponseContent {
559 status,
560 content,
561 entity,
562 }))
563 }
564}
565
566pub async fn organizations_id_delete(
567 configuration: &configuration::Configuration,
568 id: &str,
569 secret_verification_request_model: Option<models::SecretVerificationRequestModel>,
570) -> Result<(), Error<OrganizationsIdDeleteError>> {
571 let p_id = id;
573 let p_secret_verification_request_model = secret_verification_request_model;
574
575 let uri_str = format!(
576 "{}/organizations/{id}",
577 configuration.base_path,
578 id = crate::apis::urlencode(p_id)
579 );
580 let mut req_builder = configuration
581 .client
582 .request(reqwest::Method::DELETE, &uri_str);
583
584 if let Some(ref user_agent) = configuration.user_agent {
585 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
586 }
587 if let Some(ref token) = configuration.oauth_access_token {
588 req_builder = req_builder.bearer_auth(token.to_owned());
589 };
590 req_builder = req_builder.json(&p_secret_verification_request_model);
591
592 let req = req_builder.build()?;
593 let resp = configuration.client.execute(req).await?;
594
595 let status = resp.status();
596
597 if !status.is_client_error() && !status.is_server_error() {
598 Ok(())
599 } else {
600 let content = resp.text().await?;
601 let entity: Option<OrganizationsIdDeleteError> = serde_json::from_str(&content).ok();
602 Err(Error::ResponseError(ResponseContent {
603 status,
604 content,
605 entity,
606 }))
607 }
608}
609
610pub async fn organizations_id_delete_post(
611 configuration: &configuration::Configuration,
612 id: &str,
613 secret_verification_request_model: Option<models::SecretVerificationRequestModel>,
614) -> Result<(), Error<OrganizationsIdDeletePostError>> {
615 let p_id = id;
617 let p_secret_verification_request_model = secret_verification_request_model;
618
619 let uri_str = format!(
620 "{}/organizations/{id}/delete",
621 configuration.base_path,
622 id = crate::apis::urlencode(p_id)
623 );
624 let mut req_builder = configuration
625 .client
626 .request(reqwest::Method::POST, &uri_str);
627
628 if let Some(ref user_agent) = configuration.user_agent {
629 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
630 }
631 if let Some(ref token) = configuration.oauth_access_token {
632 req_builder = req_builder.bearer_auth(token.to_owned());
633 };
634 req_builder = req_builder.json(&p_secret_verification_request_model);
635
636 let req = req_builder.build()?;
637 let resp = configuration.client.execute(req).await?;
638
639 let status = resp.status();
640
641 if !status.is_client_error() && !status.is_server_error() {
642 Ok(())
643 } else {
644 let content = resp.text().await?;
645 let entity: Option<OrganizationsIdDeletePostError> = serde_json::from_str(&content).ok();
646 Err(Error::ResponseError(ResponseContent {
647 status,
648 content,
649 entity,
650 }))
651 }
652}
653
654pub async fn organizations_id_delete_recover_token_post(
655 configuration: &configuration::Configuration,
656 id: uuid::Uuid,
657 organization_verify_delete_recover_request_model: Option<
658 models::OrganizationVerifyDeleteRecoverRequestModel,
659 >,
660) -> Result<(), Error<OrganizationsIdDeleteRecoverTokenPostError>> {
661 let p_id = id;
663 let p_organization_verify_delete_recover_request_model =
664 organization_verify_delete_recover_request_model;
665
666 let uri_str = format!(
667 "{}/organizations/{id}/delete-recover-token",
668 configuration.base_path,
669 id = crate::apis::urlencode(p_id.to_string())
670 );
671 let mut req_builder = configuration
672 .client
673 .request(reqwest::Method::POST, &uri_str);
674
675 if let Some(ref user_agent) = configuration.user_agent {
676 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
677 }
678 if let Some(ref token) = configuration.oauth_access_token {
679 req_builder = req_builder.bearer_auth(token.to_owned());
680 };
681 req_builder = req_builder.json(&p_organization_verify_delete_recover_request_model);
682
683 let req = req_builder.build()?;
684 let resp = configuration.client.execute(req).await?;
685
686 let status = resp.status();
687
688 if !status.is_client_error() && !status.is_server_error() {
689 Ok(())
690 } else {
691 let content = resp.text().await?;
692 let entity: Option<OrganizationsIdDeleteRecoverTokenPostError> =
693 serde_json::from_str(&content).ok();
694 Err(Error::ResponseError(ResponseContent {
695 status,
696 content,
697 entity,
698 }))
699 }
700}
701
702pub async fn organizations_id_get(
703 configuration: &configuration::Configuration,
704 id: &str,
705) -> Result<models::OrganizationResponseModel, Error<OrganizationsIdGetError>> {
706 let p_id = id;
708
709 let uri_str = format!(
710 "{}/organizations/{id}",
711 configuration.base_path,
712 id = crate::apis::urlencode(p_id)
713 );
714 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
715
716 if let Some(ref user_agent) = configuration.user_agent {
717 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
718 }
719 if let Some(ref token) = configuration.oauth_access_token {
720 req_builder = req_builder.bearer_auth(token.to_owned());
721 };
722
723 let req = req_builder.build()?;
724 let resp = configuration.client.execute(req).await?;
725
726 let status = resp.status();
727 let content_type = resp
728 .headers()
729 .get("content-type")
730 .and_then(|v| v.to_str().ok())
731 .unwrap_or("application/octet-stream");
732 let content_type = super::ContentType::from(content_type);
733
734 if !status.is_client_error() && !status.is_server_error() {
735 let content = resp.text().await?;
736 match content_type {
737 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
738 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`"))),
739 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`")))),
740 }
741 } else {
742 let content = resp.text().await?;
743 let entity: Option<OrganizationsIdGetError> = serde_json::from_str(&content).ok();
744 Err(Error::ResponseError(ResponseContent {
745 status,
746 content,
747 entity,
748 }))
749 }
750}
751
752pub async fn organizations_id_keys_get(
753 configuration: &configuration::Configuration,
754 id: &str,
755) -> Result<models::OrganizationPublicKeyResponseModel, Error<OrganizationsIdKeysGetError>> {
756 let p_id = id;
758
759 let uri_str = format!(
760 "{}/organizations/{id}/keys",
761 configuration.base_path,
762 id = crate::apis::urlencode(p_id)
763 );
764 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
765
766 if let Some(ref user_agent) = configuration.user_agent {
767 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
768 }
769 if let Some(ref token) = configuration.oauth_access_token {
770 req_builder = req_builder.bearer_auth(token.to_owned());
771 };
772
773 let req = req_builder.build()?;
774 let resp = configuration.client.execute(req).await?;
775
776 let status = resp.status();
777 let content_type = resp
778 .headers()
779 .get("content-type")
780 .and_then(|v| v.to_str().ok())
781 .unwrap_or("application/octet-stream");
782 let content_type = super::ContentType::from(content_type);
783
784 if !status.is_client_error() && !status.is_server_error() {
785 let content = resp.text().await?;
786 match content_type {
787 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
788 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationPublicKeyResponseModel`"))),
789 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationPublicKeyResponseModel`")))),
790 }
791 } else {
792 let content = resp.text().await?;
793 let entity: Option<OrganizationsIdKeysGetError> = serde_json::from_str(&content).ok();
794 Err(Error::ResponseError(ResponseContent {
795 status,
796 content,
797 entity,
798 }))
799 }
800}
801
802pub async fn organizations_id_keys_post(
803 configuration: &configuration::Configuration,
804 id: &str,
805 organization_keys_request_model: Option<models::OrganizationKeysRequestModel>,
806) -> Result<models::OrganizationKeysResponseModel, Error<OrganizationsIdKeysPostError>> {
807 let p_id = id;
809 let p_organization_keys_request_model = organization_keys_request_model;
810
811 let uri_str = format!(
812 "{}/organizations/{id}/keys",
813 configuration.base_path,
814 id = crate::apis::urlencode(p_id)
815 );
816 let mut req_builder = configuration
817 .client
818 .request(reqwest::Method::POST, &uri_str);
819
820 if let Some(ref user_agent) = configuration.user_agent {
821 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
822 }
823 if let Some(ref token) = configuration.oauth_access_token {
824 req_builder = req_builder.bearer_auth(token.to_owned());
825 };
826 req_builder = req_builder.json(&p_organization_keys_request_model);
827
828 let req = req_builder.build()?;
829 let resp = configuration.client.execute(req).await?;
830
831 let status = resp.status();
832 let content_type = resp
833 .headers()
834 .get("content-type")
835 .and_then(|v| v.to_str().ok())
836 .unwrap_or("application/octet-stream");
837 let content_type = super::ContentType::from(content_type);
838
839 if !status.is_client_error() && !status.is_server_error() {
840 let content = resp.text().await?;
841 match content_type {
842 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
843 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationKeysResponseModel`"))),
844 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationKeysResponseModel`")))),
845 }
846 } else {
847 let content = resp.text().await?;
848 let entity: Option<OrganizationsIdKeysPostError> = serde_json::from_str(&content).ok();
849 Err(Error::ResponseError(ResponseContent {
850 status,
851 content,
852 entity,
853 }))
854 }
855}
856
857pub async fn organizations_id_leave_post(
858 configuration: &configuration::Configuration,
859 id: uuid::Uuid,
860) -> Result<(), Error<OrganizationsIdLeavePostError>> {
861 let p_id = id;
863
864 let uri_str = format!(
865 "{}/organizations/{id}/leave",
866 configuration.base_path,
867 id = crate::apis::urlencode(p_id.to_string())
868 );
869 let mut req_builder = configuration
870 .client
871 .request(reqwest::Method::POST, &uri_str);
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 token) = configuration.oauth_access_token {
877 req_builder = req_builder.bearer_auth(token.to_owned());
878 };
879
880 let req = req_builder.build()?;
881 let resp = configuration.client.execute(req).await?;
882
883 let status = resp.status();
884
885 if !status.is_client_error() && !status.is_server_error() {
886 Ok(())
887 } else {
888 let content = resp.text().await?;
889 let entity: Option<OrganizationsIdLeavePostError> = serde_json::from_str(&content).ok();
890 Err(Error::ResponseError(ResponseContent {
891 status,
892 content,
893 entity,
894 }))
895 }
896}
897
898pub async fn organizations_id_license_get(
899 configuration: &configuration::Configuration,
900 id: uuid::Uuid,
901 installation_id: Option<uuid::Uuid>,
902) -> Result<models::OrganizationLicense, Error<OrganizationsIdLicenseGetError>> {
903 let p_id = id;
905 let p_installation_id = installation_id;
906
907 let uri_str = format!(
908 "{}/organizations/{id}/license",
909 configuration.base_path,
910 id = crate::apis::urlencode(p_id.to_string())
911 );
912 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
913
914 if let Some(ref param_value) = p_installation_id {
915 req_builder = req_builder.query(&[("installationId", ¶m_value.to_string())]);
916 }
917 if let Some(ref user_agent) = configuration.user_agent {
918 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
919 }
920 if let Some(ref token) = configuration.oauth_access_token {
921 req_builder = req_builder.bearer_auth(token.to_owned());
922 };
923
924 let req = req_builder.build()?;
925 let resp = configuration.client.execute(req).await?;
926
927 let status = resp.status();
928 let content_type = resp
929 .headers()
930 .get("content-type")
931 .and_then(|v| v.to_str().ok())
932 .unwrap_or("application/octet-stream");
933 let content_type = super::ContentType::from(content_type);
934
935 if !status.is_client_error() && !status.is_server_error() {
936 let content = resp.text().await?;
937 match content_type {
938 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
939 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationLicense`"))),
940 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationLicense`")))),
941 }
942 } else {
943 let content = resp.text().await?;
944 let entity: Option<OrganizationsIdLicenseGetError> = serde_json::from_str(&content).ok();
945 Err(Error::ResponseError(ResponseContent {
946 status,
947 content,
948 entity,
949 }))
950 }
951}
952
953pub async fn organizations_id_payment_post(
954 configuration: &configuration::Configuration,
955 id: uuid::Uuid,
956 payment_request_model: Option<models::PaymentRequestModel>,
957) -> Result<(), Error<OrganizationsIdPaymentPostError>> {
958 let p_id = id;
960 let p_payment_request_model = payment_request_model;
961
962 let uri_str = format!(
963 "{}/organizations/{id}/payment",
964 configuration.base_path,
965 id = crate::apis::urlencode(p_id.to_string())
966 );
967 let mut req_builder = configuration
968 .client
969 .request(reqwest::Method::POST, &uri_str);
970
971 if let Some(ref user_agent) = configuration.user_agent {
972 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
973 }
974 if let Some(ref token) = configuration.oauth_access_token {
975 req_builder = req_builder.bearer_auth(token.to_owned());
976 };
977 req_builder = req_builder.json(&p_payment_request_model);
978
979 let req = req_builder.build()?;
980 let resp = configuration.client.execute(req).await?;
981
982 let status = resp.status();
983
984 if !status.is_client_error() && !status.is_server_error() {
985 Ok(())
986 } else {
987 let content = resp.text().await?;
988 let entity: Option<OrganizationsIdPaymentPostError> = serde_json::from_str(&content).ok();
989 Err(Error::ResponseError(ResponseContent {
990 status,
991 content,
992 entity,
993 }))
994 }
995}
996
997pub async fn organizations_id_plan_type_get(
998 configuration: &configuration::Configuration,
999 id: &str,
1000) -> Result<models::PlanType, Error<OrganizationsIdPlanTypeGetError>> {
1001 let p_id = id;
1003
1004 let uri_str = format!(
1005 "{}/organizations/{id}/plan-type",
1006 configuration.base_path,
1007 id = crate::apis::urlencode(p_id)
1008 );
1009 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1010
1011 if let Some(ref user_agent) = configuration.user_agent {
1012 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1013 }
1014 if let Some(ref token) = configuration.oauth_access_token {
1015 req_builder = req_builder.bearer_auth(token.to_owned());
1016 };
1017
1018 let req = req_builder.build()?;
1019 let resp = configuration.client.execute(req).await?;
1020
1021 let status = resp.status();
1022 let content_type = resp
1023 .headers()
1024 .get("content-type")
1025 .and_then(|v| v.to_str().ok())
1026 .unwrap_or("application/octet-stream");
1027 let content_type = super::ContentType::from(content_type);
1028
1029 if !status.is_client_error() && !status.is_server_error() {
1030 let content = resp.text().await?;
1031 match content_type {
1032 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1033 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PlanType`"))),
1034 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PlanType`")))),
1035 }
1036 } else {
1037 let content = resp.text().await?;
1038 let entity: Option<OrganizationsIdPlanTypeGetError> = serde_json::from_str(&content).ok();
1039 Err(Error::ResponseError(ResponseContent {
1040 status,
1041 content,
1042 entity,
1043 }))
1044 }
1045}
1046
1047pub async fn organizations_id_post(
1048 configuration: &configuration::Configuration,
1049 id: &str,
1050 organization_update_request_model: Option<models::OrganizationUpdateRequestModel>,
1051) -> Result<models::OrganizationResponseModel, Error<OrganizationsIdPostError>> {
1052 let p_id = id;
1054 let p_organization_update_request_model = organization_update_request_model;
1055
1056 let uri_str = format!(
1057 "{}/organizations/{id}",
1058 configuration.base_path,
1059 id = crate::apis::urlencode(p_id)
1060 );
1061 let mut req_builder = configuration
1062 .client
1063 .request(reqwest::Method::POST, &uri_str);
1064
1065 if let Some(ref user_agent) = configuration.user_agent {
1066 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1067 }
1068 if let Some(ref token) = configuration.oauth_access_token {
1069 req_builder = req_builder.bearer_auth(token.to_owned());
1070 };
1071 req_builder = req_builder.json(&p_organization_update_request_model);
1072
1073 let req = req_builder.build()?;
1074 let resp = configuration.client.execute(req).await?;
1075
1076 let status = resp.status();
1077 let content_type = resp
1078 .headers()
1079 .get("content-type")
1080 .and_then(|v| v.to_str().ok())
1081 .unwrap_or("application/octet-stream");
1082 let content_type = super::ContentType::from(content_type);
1083
1084 if !status.is_client_error() && !status.is_server_error() {
1085 let content = resp.text().await?;
1086 match content_type {
1087 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1088 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`"))),
1089 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`")))),
1090 }
1091 } else {
1092 let content = resp.text().await?;
1093 let entity: Option<OrganizationsIdPostError> = serde_json::from_str(&content).ok();
1094 Err(Error::ResponseError(ResponseContent {
1095 status,
1096 content,
1097 entity,
1098 }))
1099 }
1100}
1101
1102pub async fn organizations_id_public_key_get(
1103 configuration: &configuration::Configuration,
1104 id: &str,
1105) -> Result<models::OrganizationPublicKeyResponseModel, Error<OrganizationsIdPublicKeyGetError>> {
1106 let p_id = id;
1108
1109 let uri_str = format!(
1110 "{}/organizations/{id}/public-key",
1111 configuration.base_path,
1112 id = crate::apis::urlencode(p_id)
1113 );
1114 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1115
1116 if let Some(ref user_agent) = configuration.user_agent {
1117 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1118 }
1119 if let Some(ref token) = configuration.oauth_access_token {
1120 req_builder = req_builder.bearer_auth(token.to_owned());
1121 };
1122
1123 let req = req_builder.build()?;
1124 let resp = configuration.client.execute(req).await?;
1125
1126 let status = resp.status();
1127 let content_type = resp
1128 .headers()
1129 .get("content-type")
1130 .and_then(|v| v.to_str().ok())
1131 .unwrap_or("application/octet-stream");
1132 let content_type = super::ContentType::from(content_type);
1133
1134 if !status.is_client_error() && !status.is_server_error() {
1135 let content = resp.text().await?;
1136 match content_type {
1137 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1138 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationPublicKeyResponseModel`"))),
1139 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationPublicKeyResponseModel`")))),
1140 }
1141 } else {
1142 let content = resp.text().await?;
1143 let entity: Option<OrganizationsIdPublicKeyGetError> = serde_json::from_str(&content).ok();
1144 Err(Error::ResponseError(ResponseContent {
1145 status,
1146 content,
1147 entity,
1148 }))
1149 }
1150}
1151
1152pub async fn organizations_id_put(
1153 configuration: &configuration::Configuration,
1154 id: &str,
1155 organization_update_request_model: Option<models::OrganizationUpdateRequestModel>,
1156) -> Result<models::OrganizationResponseModel, Error<OrganizationsIdPutError>> {
1157 let p_id = id;
1159 let p_organization_update_request_model = organization_update_request_model;
1160
1161 let uri_str = format!(
1162 "{}/organizations/{id}",
1163 configuration.base_path,
1164 id = crate::apis::urlencode(p_id)
1165 );
1166 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1167
1168 if let Some(ref user_agent) = configuration.user_agent {
1169 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1170 }
1171 if let Some(ref token) = configuration.oauth_access_token {
1172 req_builder = req_builder.bearer_auth(token.to_owned());
1173 };
1174 req_builder = req_builder.json(&p_organization_update_request_model);
1175
1176 let req = req_builder.build()?;
1177 let resp = configuration.client.execute(req).await?;
1178
1179 let status = resp.status();
1180 let content_type = resp
1181 .headers()
1182 .get("content-type")
1183 .and_then(|v| v.to_str().ok())
1184 .unwrap_or("application/octet-stream");
1185 let content_type = super::ContentType::from(content_type);
1186
1187 if !status.is_client_error() && !status.is_server_error() {
1188 let content = resp.text().await?;
1189 match content_type {
1190 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1191 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`"))),
1192 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`")))),
1193 }
1194 } else {
1195 let content = resp.text().await?;
1196 let entity: Option<OrganizationsIdPutError> = serde_json::from_str(&content).ok();
1197 Err(Error::ResponseError(ResponseContent {
1198 status,
1199 content,
1200 entity,
1201 }))
1202 }
1203}
1204
1205pub async fn organizations_id_reinstate_post(
1206 configuration: &configuration::Configuration,
1207 id: uuid::Uuid,
1208) -> Result<(), Error<OrganizationsIdReinstatePostError>> {
1209 let p_id = id;
1211
1212 let uri_str = format!(
1213 "{}/organizations/{id}/reinstate",
1214 configuration.base_path,
1215 id = crate::apis::urlencode(p_id.to_string())
1216 );
1217 let mut req_builder = configuration
1218 .client
1219 .request(reqwest::Method::POST, &uri_str);
1220
1221 if let Some(ref user_agent) = configuration.user_agent {
1222 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1223 }
1224 if let Some(ref token) = configuration.oauth_access_token {
1225 req_builder = req_builder.bearer_auth(token.to_owned());
1226 };
1227
1228 let req = req_builder.build()?;
1229 let resp = configuration.client.execute(req).await?;
1230
1231 let status = resp.status();
1232
1233 if !status.is_client_error() && !status.is_server_error() {
1234 Ok(())
1235 } else {
1236 let content = resp.text().await?;
1237 let entity: Option<OrganizationsIdReinstatePostError> = serde_json::from_str(&content).ok();
1238 Err(Error::ResponseError(ResponseContent {
1239 status,
1240 content,
1241 entity,
1242 }))
1243 }
1244}
1245
1246pub async fn organizations_id_rotate_api_key_post(
1247 configuration: &configuration::Configuration,
1248 id: &str,
1249 organization_api_key_request_model: Option<models::OrganizationApiKeyRequestModel>,
1250) -> Result<models::ApiKeyResponseModel, Error<OrganizationsIdRotateApiKeyPostError>> {
1251 let p_id = id;
1253 let p_organization_api_key_request_model = organization_api_key_request_model;
1254
1255 let uri_str = format!(
1256 "{}/organizations/{id}/rotate-api-key",
1257 configuration.base_path,
1258 id = crate::apis::urlencode(p_id)
1259 );
1260 let mut req_builder = configuration
1261 .client
1262 .request(reqwest::Method::POST, &uri_str);
1263
1264 if let Some(ref user_agent) = configuration.user_agent {
1265 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1266 }
1267 if let Some(ref token) = configuration.oauth_access_token {
1268 req_builder = req_builder.bearer_auth(token.to_owned());
1269 };
1270 req_builder = req_builder.json(&p_organization_api_key_request_model);
1271
1272 let req = req_builder.build()?;
1273 let resp = configuration.client.execute(req).await?;
1274
1275 let status = resp.status();
1276 let content_type = resp
1277 .headers()
1278 .get("content-type")
1279 .and_then(|v| v.to_str().ok())
1280 .unwrap_or("application/octet-stream");
1281 let content_type = super::ContentType::from(content_type);
1282
1283 if !status.is_client_error() && !status.is_server_error() {
1284 let content = resp.text().await?;
1285 match content_type {
1286 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1287 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiKeyResponseModel`"))),
1288 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiKeyResponseModel`")))),
1289 }
1290 } else {
1291 let content = resp.text().await?;
1292 let entity: Option<OrganizationsIdRotateApiKeyPostError> =
1293 serde_json::from_str(&content).ok();
1294 Err(Error::ResponseError(ResponseContent {
1295 status,
1296 content,
1297 entity,
1298 }))
1299 }
1300}
1301
1302pub async fn organizations_id_seat_post(
1303 configuration: &configuration::Configuration,
1304 id: uuid::Uuid,
1305 organization_seat_request_model: Option<models::OrganizationSeatRequestModel>,
1306) -> Result<models::PaymentResponseModel, Error<OrganizationsIdSeatPostError>> {
1307 let p_id = id;
1309 let p_organization_seat_request_model = organization_seat_request_model;
1310
1311 let uri_str = format!(
1312 "{}/organizations/{id}/seat",
1313 configuration.base_path,
1314 id = crate::apis::urlencode(p_id.to_string())
1315 );
1316 let mut req_builder = configuration
1317 .client
1318 .request(reqwest::Method::POST, &uri_str);
1319
1320 if let Some(ref user_agent) = configuration.user_agent {
1321 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1322 }
1323 if let Some(ref token) = configuration.oauth_access_token {
1324 req_builder = req_builder.bearer_auth(token.to_owned());
1325 };
1326 req_builder = req_builder.json(&p_organization_seat_request_model);
1327
1328 let req = req_builder.build()?;
1329 let resp = configuration.client.execute(req).await?;
1330
1331 let status = resp.status();
1332 let content_type = resp
1333 .headers()
1334 .get("content-type")
1335 .and_then(|v| v.to_str().ok())
1336 .unwrap_or("application/octet-stream");
1337 let content_type = super::ContentType::from(content_type);
1338
1339 if !status.is_client_error() && !status.is_server_error() {
1340 let content = resp.text().await?;
1341 match content_type {
1342 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1343 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`"))),
1344 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaymentResponseModel`")))),
1345 }
1346 } else {
1347 let content = resp.text().await?;
1348 let entity: Option<OrganizationsIdSeatPostError> = serde_json::from_str(&content).ok();
1349 Err(Error::ResponseError(ResponseContent {
1350 status,
1351 content,
1352 entity,
1353 }))
1354 }
1355}
1356
1357pub async fn organizations_id_sm_subscription_post(
1358 configuration: &configuration::Configuration,
1359 id: uuid::Uuid,
1360 secrets_manager_subscription_update_request_model: Option<
1361 models::SecretsManagerSubscriptionUpdateRequestModel,
1362 >,
1363) -> Result<models::ProfileOrganizationResponseModel, Error<OrganizationsIdSmSubscriptionPostError>>
1364{
1365 let p_id = id;
1367 let p_secrets_manager_subscription_update_request_model =
1368 secrets_manager_subscription_update_request_model;
1369
1370 let uri_str = format!(
1371 "{}/organizations/{id}/sm-subscription",
1372 configuration.base_path,
1373 id = crate::apis::urlencode(p_id.to_string())
1374 );
1375 let mut req_builder = configuration
1376 .client
1377 .request(reqwest::Method::POST, &uri_str);
1378
1379 if let Some(ref user_agent) = configuration.user_agent {
1380 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1381 }
1382 if let Some(ref token) = configuration.oauth_access_token {
1383 req_builder = req_builder.bearer_auth(token.to_owned());
1384 };
1385 req_builder = req_builder.json(&p_secrets_manager_subscription_update_request_model);
1386
1387 let req = req_builder.build()?;
1388 let resp = configuration.client.execute(req).await?;
1389
1390 let status = resp.status();
1391 let content_type = resp
1392 .headers()
1393 .get("content-type")
1394 .and_then(|v| v.to_str().ok())
1395 .unwrap_or("application/octet-stream");
1396 let content_type = super::ContentType::from(content_type);
1397
1398 if !status.is_client_error() && !status.is_server_error() {
1399 let content = resp.text().await?;
1400 match content_type {
1401 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1402 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`"))),
1403 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`")))),
1404 }
1405 } else {
1406 let content = resp.text().await?;
1407 let entity: Option<OrganizationsIdSmSubscriptionPostError> =
1408 serde_json::from_str(&content).ok();
1409 Err(Error::ResponseError(ResponseContent {
1410 status,
1411 content,
1412 entity,
1413 }))
1414 }
1415}
1416
1417pub async fn organizations_id_sso_get(
1418 configuration: &configuration::Configuration,
1419 id: uuid::Uuid,
1420) -> Result<models::OrganizationSsoResponseModel, Error<OrganizationsIdSsoGetError>> {
1421 let p_id = id;
1423
1424 let uri_str = format!(
1425 "{}/organizations/{id}/sso",
1426 configuration.base_path,
1427 id = crate::apis::urlencode(p_id.to_string())
1428 );
1429 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1430
1431 if let Some(ref user_agent) = configuration.user_agent {
1432 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1433 }
1434 if let Some(ref token) = configuration.oauth_access_token {
1435 req_builder = req_builder.bearer_auth(token.to_owned());
1436 };
1437
1438 let req = req_builder.build()?;
1439 let resp = configuration.client.execute(req).await?;
1440
1441 let status = resp.status();
1442 let content_type = resp
1443 .headers()
1444 .get("content-type")
1445 .and_then(|v| v.to_str().ok())
1446 .unwrap_or("application/octet-stream");
1447 let content_type = super::ContentType::from(content_type);
1448
1449 if !status.is_client_error() && !status.is_server_error() {
1450 let content = resp.text().await?;
1451 match content_type {
1452 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1453 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationSsoResponseModel`"))),
1454 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationSsoResponseModel`")))),
1455 }
1456 } else {
1457 let content = resp.text().await?;
1458 let entity: Option<OrganizationsIdSsoGetError> = serde_json::from_str(&content).ok();
1459 Err(Error::ResponseError(ResponseContent {
1460 status,
1461 content,
1462 entity,
1463 }))
1464 }
1465}
1466
1467pub async fn organizations_id_sso_post(
1468 configuration: &configuration::Configuration,
1469 id: uuid::Uuid,
1470 organization_sso_request_model: Option<models::OrganizationSsoRequestModel>,
1471) -> Result<models::OrganizationSsoResponseModel, Error<OrganizationsIdSsoPostError>> {
1472 let p_id = id;
1474 let p_organization_sso_request_model = organization_sso_request_model;
1475
1476 let uri_str = format!(
1477 "{}/organizations/{id}/sso",
1478 configuration.base_path,
1479 id = crate::apis::urlencode(p_id.to_string())
1480 );
1481 let mut req_builder = configuration
1482 .client
1483 .request(reqwest::Method::POST, &uri_str);
1484
1485 if let Some(ref user_agent) = configuration.user_agent {
1486 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1487 }
1488 if let Some(ref token) = configuration.oauth_access_token {
1489 req_builder = req_builder.bearer_auth(token.to_owned());
1490 };
1491 req_builder = req_builder.json(&p_organization_sso_request_model);
1492
1493 let req = req_builder.build()?;
1494 let resp = configuration.client.execute(req).await?;
1495
1496 let status = resp.status();
1497 let content_type = resp
1498 .headers()
1499 .get("content-type")
1500 .and_then(|v| v.to_str().ok())
1501 .unwrap_or("application/octet-stream");
1502 let content_type = super::ContentType::from(content_type);
1503
1504 if !status.is_client_error() && !status.is_server_error() {
1505 let content = resp.text().await?;
1506 match content_type {
1507 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1508 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationSsoResponseModel`"))),
1509 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationSsoResponseModel`")))),
1510 }
1511 } else {
1512 let content = resp.text().await?;
1513 let entity: Option<OrganizationsIdSsoPostError> = serde_json::from_str(&content).ok();
1514 Err(Error::ResponseError(ResponseContent {
1515 status,
1516 content,
1517 entity,
1518 }))
1519 }
1520}
1521
1522pub async fn organizations_id_storage_post(
1523 configuration: &configuration::Configuration,
1524 id: &str,
1525 storage_request_model: Option<models::StorageRequestModel>,
1526) -> Result<models::PaymentResponseModel, Error<OrganizationsIdStoragePostError>> {
1527 let p_id = id;
1529 let p_storage_request_model = storage_request_model;
1530
1531 let uri_str = format!(
1532 "{}/organizations/{id}/storage",
1533 configuration.base_path,
1534 id = crate::apis::urlencode(p_id)
1535 );
1536 let mut req_builder = configuration
1537 .client
1538 .request(reqwest::Method::POST, &uri_str);
1539
1540 if let Some(ref user_agent) = configuration.user_agent {
1541 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1542 }
1543 if let Some(ref token) = configuration.oauth_access_token {
1544 req_builder = req_builder.bearer_auth(token.to_owned());
1545 };
1546 req_builder = req_builder.json(&p_storage_request_model);
1547
1548 let req = req_builder.build()?;
1549 let resp = configuration.client.execute(req).await?;
1550
1551 let status = resp.status();
1552 let content_type = resp
1553 .headers()
1554 .get("content-type")
1555 .and_then(|v| v.to_str().ok())
1556 .unwrap_or("application/octet-stream");
1557 let content_type = super::ContentType::from(content_type);
1558
1559 if !status.is_client_error() && !status.is_server_error() {
1560 let content = resp.text().await?;
1561 match content_type {
1562 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1563 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`"))),
1564 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaymentResponseModel`")))),
1565 }
1566 } else {
1567 let content = resp.text().await?;
1568 let entity: Option<OrganizationsIdStoragePostError> = serde_json::from_str(&content).ok();
1569 Err(Error::ResponseError(ResponseContent {
1570 status,
1571 content,
1572 entity,
1573 }))
1574 }
1575}
1576
1577pub async fn organizations_id_subscribe_secrets_manager_post(
1578 configuration: &configuration::Configuration,
1579 id: uuid::Uuid,
1580 secrets_manager_subscribe_request_model: Option<models::SecretsManagerSubscribeRequestModel>,
1581) -> Result<
1582 models::ProfileOrganizationResponseModel,
1583 Error<OrganizationsIdSubscribeSecretsManagerPostError>,
1584> {
1585 let p_id = id;
1587 let p_secrets_manager_subscribe_request_model = secrets_manager_subscribe_request_model;
1588
1589 let uri_str = format!(
1590 "{}/organizations/{id}/subscribe-secrets-manager",
1591 configuration.base_path,
1592 id = crate::apis::urlencode(p_id.to_string())
1593 );
1594 let mut req_builder = configuration
1595 .client
1596 .request(reqwest::Method::POST, &uri_str);
1597
1598 if let Some(ref user_agent) = configuration.user_agent {
1599 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1600 }
1601 if let Some(ref token) = configuration.oauth_access_token {
1602 req_builder = req_builder.bearer_auth(token.to_owned());
1603 };
1604 req_builder = req_builder.json(&p_secrets_manager_subscribe_request_model);
1605
1606 let req = req_builder.build()?;
1607 let resp = configuration.client.execute(req).await?;
1608
1609 let status = resp.status();
1610 let content_type = resp
1611 .headers()
1612 .get("content-type")
1613 .and_then(|v| v.to_str().ok())
1614 .unwrap_or("application/octet-stream");
1615 let content_type = super::ContentType::from(content_type);
1616
1617 if !status.is_client_error() && !status.is_server_error() {
1618 let content = resp.text().await?;
1619 match content_type {
1620 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1621 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`"))),
1622 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`")))),
1623 }
1624 } else {
1625 let content = resp.text().await?;
1626 let entity: Option<OrganizationsIdSubscribeSecretsManagerPostError> =
1627 serde_json::from_str(&content).ok();
1628 Err(Error::ResponseError(ResponseContent {
1629 status,
1630 content,
1631 entity,
1632 }))
1633 }
1634}
1635
1636pub async fn organizations_id_subscription_get(
1637 configuration: &configuration::Configuration,
1638 id: uuid::Uuid,
1639) -> Result<models::OrganizationSubscriptionResponseModel, Error<OrganizationsIdSubscriptionGetError>>
1640{
1641 let p_id = id;
1643
1644 let uri_str = format!(
1645 "{}/organizations/{id}/subscription",
1646 configuration.base_path,
1647 id = crate::apis::urlencode(p_id.to_string())
1648 );
1649 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1650
1651 if let Some(ref user_agent) = configuration.user_agent {
1652 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1653 }
1654 if let Some(ref token) = configuration.oauth_access_token {
1655 req_builder = req_builder.bearer_auth(token.to_owned());
1656 };
1657
1658 let req = req_builder.build()?;
1659 let resp = configuration.client.execute(req).await?;
1660
1661 let status = resp.status();
1662 let content_type = resp
1663 .headers()
1664 .get("content-type")
1665 .and_then(|v| v.to_str().ok())
1666 .unwrap_or("application/octet-stream");
1667 let content_type = super::ContentType::from(content_type);
1668
1669 if !status.is_client_error() && !status.is_server_error() {
1670 let content = resp.text().await?;
1671 match content_type {
1672 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1673 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationSubscriptionResponseModel`"))),
1674 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationSubscriptionResponseModel`")))),
1675 }
1676 } else {
1677 let content = resp.text().await?;
1678 let entity: Option<OrganizationsIdSubscriptionGetError> =
1679 serde_json::from_str(&content).ok();
1680 Err(Error::ResponseError(ResponseContent {
1681 status,
1682 content,
1683 entity,
1684 }))
1685 }
1686}
1687
1688pub async fn organizations_id_subscription_post(
1689 configuration: &configuration::Configuration,
1690 id: uuid::Uuid,
1691 organization_subscription_update_request_model: Option<
1692 models::OrganizationSubscriptionUpdateRequestModel,
1693 >,
1694) -> Result<models::ProfileOrganizationResponseModel, Error<OrganizationsIdSubscriptionPostError>> {
1695 let p_id = id;
1697 let p_organization_subscription_update_request_model =
1698 organization_subscription_update_request_model;
1699
1700 let uri_str = format!(
1701 "{}/organizations/{id}/subscription",
1702 configuration.base_path,
1703 id = crate::apis::urlencode(p_id.to_string())
1704 );
1705 let mut req_builder = configuration
1706 .client
1707 .request(reqwest::Method::POST, &uri_str);
1708
1709 if let Some(ref user_agent) = configuration.user_agent {
1710 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1711 }
1712 if let Some(ref token) = configuration.oauth_access_token {
1713 req_builder = req_builder.bearer_auth(token.to_owned());
1714 };
1715 req_builder = req_builder.json(&p_organization_subscription_update_request_model);
1716
1717 let req = req_builder.build()?;
1718 let resp = configuration.client.execute(req).await?;
1719
1720 let status = resp.status();
1721 let content_type = resp
1722 .headers()
1723 .get("content-type")
1724 .and_then(|v| v.to_str().ok())
1725 .unwrap_or("application/octet-stream");
1726 let content_type = super::ContentType::from(content_type);
1727
1728 if !status.is_client_error() && !status.is_server_error() {
1729 let content = resp.text().await?;
1730 match content_type {
1731 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1732 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`"))),
1733 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ProfileOrganizationResponseModel`")))),
1734 }
1735 } else {
1736 let content = resp.text().await?;
1737 let entity: Option<OrganizationsIdSubscriptionPostError> =
1738 serde_json::from_str(&content).ok();
1739 Err(Error::ResponseError(ResponseContent {
1740 status,
1741 content,
1742 entity,
1743 }))
1744 }
1745}
1746
1747pub async fn organizations_id_tax_get(
1748 configuration: &configuration::Configuration,
1749 id: uuid::Uuid,
1750) -> Result<models::TaxInfoResponseModel, Error<OrganizationsIdTaxGetError>> {
1751 let p_id = id;
1753
1754 let uri_str = format!(
1755 "{}/organizations/{id}/tax",
1756 configuration.base_path,
1757 id = crate::apis::urlencode(p_id.to_string())
1758 );
1759 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1760
1761 if let Some(ref user_agent) = configuration.user_agent {
1762 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1763 }
1764 if let Some(ref token) = configuration.oauth_access_token {
1765 req_builder = req_builder.bearer_auth(token.to_owned());
1766 };
1767
1768 let req = req_builder.build()?;
1769 let resp = configuration.client.execute(req).await?;
1770
1771 let status = resp.status();
1772 let content_type = resp
1773 .headers()
1774 .get("content-type")
1775 .and_then(|v| v.to_str().ok())
1776 .unwrap_or("application/octet-stream");
1777 let content_type = super::ContentType::from(content_type);
1778
1779 if !status.is_client_error() && !status.is_server_error() {
1780 let content = resp.text().await?;
1781 match content_type {
1782 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1783 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TaxInfoResponseModel`"))),
1784 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TaxInfoResponseModel`")))),
1785 }
1786 } else {
1787 let content = resp.text().await?;
1788 let entity: Option<OrganizationsIdTaxGetError> = serde_json::from_str(&content).ok();
1789 Err(Error::ResponseError(ResponseContent {
1790 status,
1791 content,
1792 entity,
1793 }))
1794 }
1795}
1796
1797pub async fn organizations_id_tax_put(
1798 configuration: &configuration::Configuration,
1799 id: uuid::Uuid,
1800 expanded_tax_info_update_request_model: Option<models::ExpandedTaxInfoUpdateRequestModel>,
1801) -> Result<(), Error<OrganizationsIdTaxPutError>> {
1802 let p_id = id;
1804 let p_expanded_tax_info_update_request_model = expanded_tax_info_update_request_model;
1805
1806 let uri_str = format!(
1807 "{}/organizations/{id}/tax",
1808 configuration.base_path,
1809 id = crate::apis::urlencode(p_id.to_string())
1810 );
1811 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1812
1813 if let Some(ref user_agent) = configuration.user_agent {
1814 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1815 }
1816 if let Some(ref token) = configuration.oauth_access_token {
1817 req_builder = req_builder.bearer_auth(token.to_owned());
1818 };
1819 req_builder = req_builder.json(&p_expanded_tax_info_update_request_model);
1820
1821 let req = req_builder.build()?;
1822 let resp = configuration.client.execute(req).await?;
1823
1824 let status = resp.status();
1825
1826 if !status.is_client_error() && !status.is_server_error() {
1827 Ok(())
1828 } else {
1829 let content = resp.text().await?;
1830 let entity: Option<OrganizationsIdTaxPutError> = serde_json::from_str(&content).ok();
1831 Err(Error::ResponseError(ResponseContent {
1832 status,
1833 content,
1834 entity,
1835 }))
1836 }
1837}
1838
1839pub async fn organizations_id_upgrade_post(
1840 configuration: &configuration::Configuration,
1841 id: uuid::Uuid,
1842 organization_upgrade_request_model: Option<models::OrganizationUpgradeRequestModel>,
1843) -> Result<models::PaymentResponseModel, Error<OrganizationsIdUpgradePostError>> {
1844 let p_id = id;
1846 let p_organization_upgrade_request_model = organization_upgrade_request_model;
1847
1848 let uri_str = format!(
1849 "{}/organizations/{id}/upgrade",
1850 configuration.base_path,
1851 id = crate::apis::urlencode(p_id.to_string())
1852 );
1853 let mut req_builder = configuration
1854 .client
1855 .request(reqwest::Method::POST, &uri_str);
1856
1857 if let Some(ref user_agent) = configuration.user_agent {
1858 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1859 }
1860 if let Some(ref token) = configuration.oauth_access_token {
1861 req_builder = req_builder.bearer_auth(token.to_owned());
1862 };
1863 req_builder = req_builder.json(&p_organization_upgrade_request_model);
1864
1865 let req = req_builder.build()?;
1866 let resp = configuration.client.execute(req).await?;
1867
1868 let status = resp.status();
1869 let content_type = resp
1870 .headers()
1871 .get("content-type")
1872 .and_then(|v| v.to_str().ok())
1873 .unwrap_or("application/octet-stream");
1874 let content_type = super::ContentType::from(content_type);
1875
1876 if !status.is_client_error() && !status.is_server_error() {
1877 let content = resp.text().await?;
1878 match content_type {
1879 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1880 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaymentResponseModel`"))),
1881 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaymentResponseModel`")))),
1882 }
1883 } else {
1884 let content = resp.text().await?;
1885 let entity: Option<OrganizationsIdUpgradePostError> = serde_json::from_str(&content).ok();
1886 Err(Error::ResponseError(ResponseContent {
1887 status,
1888 content,
1889 entity,
1890 }))
1891 }
1892}
1893
1894pub async fn organizations_id_verify_bank_post(
1895 configuration: &configuration::Configuration,
1896 id: uuid::Uuid,
1897 organization_verify_bank_request_model: Option<models::OrganizationVerifyBankRequestModel>,
1898) -> Result<(), Error<OrganizationsIdVerifyBankPostError>> {
1899 let p_id = id;
1901 let p_organization_verify_bank_request_model = organization_verify_bank_request_model;
1902
1903 let uri_str = format!(
1904 "{}/organizations/{id}/verify-bank",
1905 configuration.base_path,
1906 id = crate::apis::urlencode(p_id.to_string())
1907 );
1908 let mut req_builder = configuration
1909 .client
1910 .request(reqwest::Method::POST, &uri_str);
1911
1912 if let Some(ref user_agent) = configuration.user_agent {
1913 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1914 }
1915 if let Some(ref token) = configuration.oauth_access_token {
1916 req_builder = req_builder.bearer_auth(token.to_owned());
1917 };
1918 req_builder = req_builder.json(&p_organization_verify_bank_request_model);
1919
1920 let req = req_builder.build()?;
1921 let resp = configuration.client.execute(req).await?;
1922
1923 let status = resp.status();
1924
1925 if !status.is_client_error() && !status.is_server_error() {
1926 Ok(())
1927 } else {
1928 let content = resp.text().await?;
1929 let entity: Option<OrganizationsIdVerifyBankPostError> =
1930 serde_json::from_str(&content).ok();
1931 Err(Error::ResponseError(ResponseContent {
1932 status,
1933 content,
1934 entity,
1935 }))
1936 }
1937}
1938
1939pub async fn organizations_identifier_auto_enroll_status_get(
1940 configuration: &configuration::Configuration,
1941 identifier: &str,
1942) -> Result<
1943 models::OrganizationAutoEnrollStatusResponseModel,
1944 Error<OrganizationsIdentifierAutoEnrollStatusGetError>,
1945> {
1946 let p_identifier = identifier;
1948
1949 let uri_str = format!(
1950 "{}/organizations/{identifier}/auto-enroll-status",
1951 configuration.base_path,
1952 identifier = crate::apis::urlencode(p_identifier)
1953 );
1954 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1955
1956 if let Some(ref user_agent) = configuration.user_agent {
1957 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1958 }
1959 if let Some(ref token) = configuration.oauth_access_token {
1960 req_builder = req_builder.bearer_auth(token.to_owned());
1961 };
1962
1963 let req = req_builder.build()?;
1964 let resp = configuration.client.execute(req).await?;
1965
1966 let status = resp.status();
1967 let content_type = resp
1968 .headers()
1969 .get("content-type")
1970 .and_then(|v| v.to_str().ok())
1971 .unwrap_or("application/octet-stream");
1972 let content_type = super::ContentType::from(content_type);
1973
1974 if !status.is_client_error() && !status.is_server_error() {
1975 let content = resp.text().await?;
1976 match content_type {
1977 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1978 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationAutoEnrollStatusResponseModel`"))),
1979 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationAutoEnrollStatusResponseModel`")))),
1980 }
1981 } else {
1982 let content = resp.text().await?;
1983 let entity: Option<OrganizationsIdentifierAutoEnrollStatusGetError> =
1984 serde_json::from_str(&content).ok();
1985 Err(Error::ResponseError(ResponseContent {
1986 status,
1987 content,
1988 entity,
1989 }))
1990 }
1991}
1992
1993pub async fn organizations_post(
1994 configuration: &configuration::Configuration,
1995 organization_create_request_model: Option<models::OrganizationCreateRequestModel>,
1996) -> Result<models::OrganizationResponseModel, Error<OrganizationsPostError>> {
1997 let p_organization_create_request_model = organization_create_request_model;
1999
2000 let uri_str = format!("{}/organizations", configuration.base_path);
2001 let mut req_builder = configuration
2002 .client
2003 .request(reqwest::Method::POST, &uri_str);
2004
2005 if let Some(ref user_agent) = configuration.user_agent {
2006 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2007 }
2008 if let Some(ref token) = configuration.oauth_access_token {
2009 req_builder = req_builder.bearer_auth(token.to_owned());
2010 };
2011 req_builder = req_builder.json(&p_organization_create_request_model);
2012
2013 let req = req_builder.build()?;
2014 let resp = configuration.client.execute(req).await?;
2015
2016 let status = resp.status();
2017 let content_type = resp
2018 .headers()
2019 .get("content-type")
2020 .and_then(|v| v.to_str().ok())
2021 .unwrap_or("application/octet-stream");
2022 let content_type = super::ContentType::from(content_type);
2023
2024 if !status.is_client_error() && !status.is_server_error() {
2025 let content = resp.text().await?;
2026 match content_type {
2027 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2028 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationResponseModel`"))),
2029 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationResponseModel`")))),
2030 }
2031 } else {
2032 let content = resp.text().await?;
2033 let entity: Option<OrganizationsPostError> = serde_json::from_str(&content).ok();
2034 Err(Error::ResponseError(ResponseContent {
2035 status,
2036 content,
2037 entity,
2038 }))
2039 }
2040}