1#![allow(
5 clippy::all,
6 clippy::pedantic,
7 clippy::nursery,
8 clippy::restriction,
9 clippy::cargo,
10 dead_code,
11 missing_debug_implementations,
12 unused_imports,
13 unused_variables,
14 rust_2018_idioms
15)]
16
17#[allow(unused_imports)]
18pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue};
19#[allow(unused_imports)]
20use progenitor_client::{ClientHooks, OperationInfo, RequestBuilderExt, encode_path};
21#[allow(clippy::all)]
23pub mod types {
24 pub mod error {
26 pub struct ConversionError(::std::borrow::Cow<'static, str>);
28 impl ::std::error::Error for ConversionError {}
29 impl ::std::fmt::Display for ConversionError {
30 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
31 ::std::fmt::Display::fmt(&self.0, f)
32 }
33 }
34 impl ::std::fmt::Debug for ConversionError {
35 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
36 ::std::fmt::Debug::fmt(&self.0, f)
37 }
38 }
39 impl From<&'static str> for ConversionError {
40 fn from(value: &'static str) -> Self {
41 Self(value.into())
42 }
43 }
44 impl From<String> for ConversionError {
45 fn from(value: String) -> Self {
46 Self(value.into())
47 }
48 }
49 }
50 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
70 pub struct AcceptEulaRequest {
71 pub accepted: bool,
72 }
73 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
104 pub struct AcceptEulaResponse {
105 pub message: ::std::string::String,
106 pub user_id: ::std::string::String,
107 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
110 pub workspace_id: ::std::option::Option<::std::string::String>,
111 }
112 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
139 pub struct AccessInviteGrantedPortal {
140 pub id: ::std::string::String,
141 pub name: LocalizedString,
142 pub public_id: ::std::string::String,
143 }
144 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
259 pub struct AccessInviteListItem {
260 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
261 pub created_at: ::std::option::Option<::std::string::String>,
262 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
263 pub disabled_justification: ::std::option::Option<::std::string::String>,
264 pub granted_portals: ::std::vec::Vec<AccessInviteGrantedPortal>,
265 pub id: ::std::string::String,
266 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
267 pub invite_recurrence: ::std::option::Option<::serde_json::Value>,
268 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
269 pub invitee_message: ::std::option::Option<::serde_json::Value>,
270 pub is_enabled: bool,
271 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
272 pub last_used_at: ::std::option::Option<::std::string::String>,
273 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
274 pub max_uses: ::std::option::Option<i32>,
275 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
276 pub name: ::std::option::Option<::std::string::String>,
277 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
278 pub revoked_at: ::std::option::Option<::std::string::String>,
279 pub schedule: InviteScheduleSnapshot,
280 pub schedule_combined: InviteScheduleCombined,
281 pub schedule_entries: ::std::vec::Vec<InviteScheduleEntrySnapshot>,
282 pub schedule_kind: InviteScheduleKind,
283 pub state: ::std::string::String,
284 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
285 pub updated_at: ::std::option::Option<::std::string::String>,
286 pub uses: i32,
287 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
288 pub valid_from: ::std::option::Option<::std::string::String>,
289 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
290 pub valid_to: ::std::option::Option<::std::string::String>,
291 }
292 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
338 pub struct AccessPortalListItem {
339 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
340 pub created_at: ::std::option::Option<::std::string::String>,
341 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
343 pub device_external_id: ::std::option::Option<::std::string::String>,
344 pub id: ::std::string::String,
345 pub name: LocalizedString,
346 pub public_id: ::std::string::String,
347 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
348 pub updated_at: ::std::option::Option<::std::string::String>,
349 }
350 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
373 pub struct AddBuildingUserPayload {
374 pub role: ::std::string::String,
375 pub user_id: ::std::string::String,
376 }
377 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
395 #[serde(transparent)]
396 pub struct AddRolesRequest(
397 pub ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
398 );
399 impl ::std::ops::Deref for AddRolesRequest {
400 type Target = ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>;
401 fn deref(
402 &self,
403 ) -> &::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>> {
404 &self.0
405 }
406 }
407 impl ::std::convert::From<AddRolesRequest>
408 for ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>
409 {
410 fn from(value: AddRolesRequest) -> Self {
411 value.0
412 }
413 }
414 impl
415 ::std::convert::From<
416 ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
417 > for AddRolesRequest
418 {
419 fn from(
420 value: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
421 ) -> Self {
422 Self(value)
423 }
424 }
425 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
448 pub struct ApartmentFloorListResponse {
449 pub floors: ::std::vec::Vec<ApartmentFloorSummary>,
450 }
451 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
480 pub struct ApartmentFloorSummary {
481 pub floor: ::serde_json::Value,
482 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
483 pub floor_number: ::std::option::Option<i64>,
484 pub key: ::std::string::String,
485 }
486 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
513 pub struct ApiErrorResponse {
514 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
516 pub error_code: ::std::option::Option<::std::string::String>,
517 pub message: ::std::string::String,
518 }
519 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
597 pub struct ApiKeyListItem {
598 pub base_url: ::std::string::String,
599 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
600 pub created_at: ::std::option::Option<::std::string::String>,
601 pub expires_at: ::std::string::String,
602 pub id: ::std::string::String,
603 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
604 pub last_used_at: ::std::option::Option<::std::string::String>,
605 pub name: ::std::string::String,
606 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
607 pub revoked_at: ::std::option::Option<::std::string::String>,
608 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
609 pub scoped_entity_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
610 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
611 pub scoped_roles: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
612 pub token_suffix: ::std::string::String,
613 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
614 pub updated_at: ::std::option::Option<::std::string::String>,
615 }
616 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
641 pub struct BackendStatus {
642 pub environment: ::std::string::String,
644 pub version: ::std::string::String,
646 }
647 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
698 pub struct BillingEvent {
699 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
700 pub external_customer_id: ::std::option::Option<::std::string::String>,
701 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
702 pub external_subscription_id: ::std::option::Option<::std::string::String>,
703 pub kind: BillingEventKind,
704 pub provider: ::std::string::String,
705 pub raw: ::serde_json::Value,
706 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
707 pub status: ::std::option::Option<::std::string::String>,
708 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
709 pub tier_slug: ::std::option::Option<::std::string::String>,
710 }
711 #[derive(
730 ::serde::Deserialize,
731 ::serde::Serialize,
732 Clone,
733 Copy,
734 Debug,
735 Eq,
736 Hash,
737 Ord,
738 PartialEq,
739 PartialOrd,
740 )]
741 pub enum BillingEventKind {
742 #[serde(rename = "subscription_created")]
743 SubscriptionCreated,
744 #[serde(rename = "subscription_updated")]
745 SubscriptionUpdated,
746 #[serde(rename = "subscription_canceled")]
747 SubscriptionCanceled,
748 #[serde(rename = "invoice_paid")]
749 InvoicePaid,
750 #[serde(rename = "invoice_failed")]
751 InvoiceFailed,
752 #[serde(rename = "other")]
753 Other,
754 }
755 impl ::std::fmt::Display for BillingEventKind {
756 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
757 match *self {
758 Self::SubscriptionCreated => f.write_str("subscription_created"),
759 Self::SubscriptionUpdated => f.write_str("subscription_updated"),
760 Self::SubscriptionCanceled => f.write_str("subscription_canceled"),
761 Self::InvoicePaid => f.write_str("invoice_paid"),
762 Self::InvoiceFailed => f.write_str("invoice_failed"),
763 Self::Other => f.write_str("other"),
764 }
765 }
766 }
767 impl ::std::str::FromStr for BillingEventKind {
768 type Err = self::error::ConversionError;
769 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
770 match value {
771 "subscription_created" => Ok(Self::SubscriptionCreated),
772 "subscription_updated" => Ok(Self::SubscriptionUpdated),
773 "subscription_canceled" => Ok(Self::SubscriptionCanceled),
774 "invoice_paid" => Ok(Self::InvoicePaid),
775 "invoice_failed" => Ok(Self::InvoiceFailed),
776 "other" => Ok(Self::Other),
777 _ => Err("invalid value".into()),
778 }
779 }
780 }
781 impl ::std::convert::TryFrom<&str> for BillingEventKind {
782 type Error = self::error::ConversionError;
783 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
784 value.parse()
785 }
786 }
787 impl ::std::convert::TryFrom<&::std::string::String> for BillingEventKind {
788 type Error = self::error::ConversionError;
789 fn try_from(
790 value: &::std::string::String,
791 ) -> ::std::result::Result<Self, self::error::ConversionError> {
792 value.parse()
793 }
794 }
795 impl ::std::convert::TryFrom<::std::string::String> for BillingEventKind {
796 type Error = self::error::ConversionError;
797 fn try_from(
798 value: ::std::string::String,
799 ) -> ::std::result::Result<Self, self::error::ConversionError> {
800 value.parse()
801 }
802 }
803 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
829 pub struct BillingPlanResponse {
830 pub org_id: ::std::string::String,
831 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
832 pub subscription: ::std::option::Option<::serde_json::Value>,
833 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
834 pub tier_id: ::std::option::Option<::std::string::String>,
835 }
836 #[derive(
848 ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
849 )]
850 #[serde(transparent)]
851 pub struct BillingWebhookPayload(pub ::std::string::String);
852 impl ::std::ops::Deref for BillingWebhookPayload {
853 type Target = ::std::string::String;
854 fn deref(&self) -> &::std::string::String {
855 &self.0
856 }
857 }
858 impl ::std::convert::From<BillingWebhookPayload> for ::std::string::String {
859 fn from(value: BillingWebhookPayload) -> Self {
860 value.0
861 }
862 }
863 impl ::std::convert::From<::std::string::String> for BillingWebhookPayload {
864 fn from(value: ::std::string::String) -> Self {
865 Self(value)
866 }
867 }
868 impl ::std::str::FromStr for BillingWebhookPayload {
869 type Err = ::std::convert::Infallible;
870 fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
871 Ok(Self(value.to_string()))
872 }
873 }
874 impl ::std::fmt::Display for BillingWebhookPayload {
875 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
876 self.0.fmt(f)
877 }
878 }
879 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
905 pub struct BillingWebhookResponse {
906 pub events: ::std::vec::Vec<BillingEvent>,
907 pub provider: ::std::string::String,
908 }
909 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
946 pub struct BuildingUserResponse {
947 pub apartments: ::std::vec::Vec<::std::string::String>,
948 pub role: ::std::string::String,
949 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
950 pub user_email: ::std::option::Option<::std::string::String>,
951 pub user_id: ::std::string::String,
952 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
953 pub user_name: ::std::option::Option<::serde_json::Value>,
954 }
955 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
974 pub struct CheckoutRequest {
975 pub tier_slug: ::std::string::String,
976 }
977 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1048 pub struct CreateAccessInviteRequest {
1049 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1050 pub expires_in: ::std::option::Option<::std::string::String>,
1051 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1052 pub invite_recurrence: ::std::option::Option<::serde_json::Value>,
1053 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1054 pub invitee_message: ::std::option::Option<::serde_json::Value>,
1055 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1056 pub is_enabled: ::std::option::Option<bool>,
1057 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1058 pub max_uses: ::std::option::Option<i32>,
1059 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1060 pub name: ::std::option::Option<::std::string::String>,
1061 pub portal_ids: ::std::vec::Vec<::std::string::String>,
1062 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1065 pub schedules: ::std::option::Option<::std::vec::Vec<InviteScheduleEntryInput>>,
1066 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1067 pub valid_from: ::std::option::Option<::std::string::String>,
1068 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1069 pub valid_to: ::std::option::Option<::std::string::String>,
1070 }
1071 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1152 pub struct CreateAccessInviteResponse {
1153 pub granted_portals: ::std::vec::Vec<AccessInviteGrantedPortal>,
1154 pub invite_link_id: ::std::string::String,
1155 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1156 pub invite_recurrence: ::std::option::Option<::serde_json::Value>,
1157 pub invite_token: ::std::string::String,
1158 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1159 pub invitee_message: ::std::option::Option<::serde_json::Value>,
1160 pub is_enabled: bool,
1161 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1162 pub max_uses: ::std::option::Option<i32>,
1163 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1164 pub name: ::std::option::Option<::std::string::String>,
1165 pub schedule: InviteScheduleSnapshot,
1166 pub schedule_combined: InviteScheduleCombined,
1167 pub schedule_entries: ::std::vec::Vec<InviteScheduleEntrySnapshot>,
1168 pub schedule_kind: InviteScheduleKind,
1169 pub uses: i32,
1170 pub valid_from: ::std::string::String,
1171 pub valid_to: ::std::string::String,
1172 }
1173 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1199 pub struct CreateAccessPortalRequest {
1200 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1202 pub device_external_id: ::std::option::Option<::std::string::String>,
1203 pub name: LocalizedString,
1204 }
1205 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1238 pub struct CreateAccessPortalResponse {
1239 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1240 pub device_external_id: ::std::option::Option<::std::string::String>,
1241 pub id: ::std::string::String,
1242 pub name: LocalizedString,
1243 pub public_id: ::std::string::String,
1244 }
1245 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1296 pub struct CreateApiKeyRequest {
1297 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1299 pub expires_at: ::std::option::Option<::std::string::String>,
1300 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1302 pub expires_in: ::std::option::Option<::std::string::String>,
1303 pub name: ::std::string::String,
1304 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1305 pub scoped_entity_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
1306 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1307 pub scoped_roles: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
1308 }
1309 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1375 pub struct CreateApiKeyResponse {
1376 pub base_url: ::std::string::String,
1377 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1378 pub created_at: ::std::option::Option<::std::string::String>,
1379 pub expires_at: ::std::string::String,
1380 pub id: ::std::string::String,
1381 pub name: ::std::string::String,
1382 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1383 pub scoped_entity_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
1384 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1385 pub scoped_roles: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
1386 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1387 pub token: ::std::option::Option<::std::string::String>,
1388 pub token_suffix: ::std::string::String,
1389 }
1390 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1424 pub struct CreateDeviceRequest {
1425 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1426 pub device_metadata: ::std::option::Option<::serde_json::Value>,
1427 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1428 pub external_id: ::std::option::Option<::std::string::String>,
1429 pub integration_id: ::std::string::String,
1430 pub name: LocalizedString,
1431 pub org_id: ::std::string::String,
1432 }
1433 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1490 pub struct CreateEntityRequest {
1491 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1492 pub channel_index: ::std::option::Option<i32>,
1493 pub device_id: ::std::string::String,
1494 pub entity_type: ::std::string::String,
1495 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1496 pub external_id: ::std::option::Option<::std::string::String>,
1497 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1505 pub metadata:
1506 ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1507 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1509 pub name: ::std::option::Option<::std::string::String>,
1510 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1511 pub zone_id: ::std::option::Option<::std::string::String>,
1512 }
1513 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1555 pub struct CreateIntegrationRequest {
1556 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1557 pub config: ::std::option::Option<::serde_json::Value>,
1558 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1559 pub enabled: ::std::option::Option<bool>,
1560 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1561 pub name: ::std::option::Option<LocalizedString>,
1562 pub org_id: ::std::string::String,
1563 pub provider_type: ::std::string::String,
1564 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1565 pub secrets: ::std::option::Option<::serde_json::Value>,
1566 }
1567 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1605 pub struct CreateOrganizationRequest {
1606 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1607 pub description: ::std::option::Option<::std::string::String>,
1608 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1610 pub id: ::std::option::Option<::std::string::String>,
1611 pub name: LocalizedString,
1612 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1613 pub parent_id: ::std::option::Option<::std::string::String>,
1614 }
1615 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1673 pub struct CreateUserRequest {
1674 pub email: ::std::string::String,
1675 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1677 pub first_name: ::std::option::Option<::std::string::String>,
1678 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1681 pub id: ::std::option::Option<::std::string::String>,
1682 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1684 pub last_name: ::std::option::Option<::std::string::String>,
1685 pub name: LocalizedString,
1686 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1689 pub password: ::std::option::Option<::std::string::String>,
1690 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1692 pub roles:
1693 ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
1694 }
1695 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1730 pub struct CreateZoneRequest {
1731 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1732 pub external_id: ::std::option::Option<::std::string::String>,
1733 pub integration_id: ::std::string::String,
1734 pub name: LocalizedString,
1735 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1736 pub parent_zone_id: ::std::option::Option<::std::string::String>,
1737 }
1738 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1756 #[serde(transparent)]
1757 pub struct DeleteRolesRequest(
1758 pub ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
1759 );
1760 impl ::std::ops::Deref for DeleteRolesRequest {
1761 type Target = ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>;
1762 fn deref(
1763 &self,
1764 ) -> &::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>> {
1765 &self.0
1766 }
1767 }
1768 impl ::std::convert::From<DeleteRolesRequest>
1769 for ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>
1770 {
1771 fn from(value: DeleteRolesRequest) -> Self {
1772 value.0
1773 }
1774 }
1775 impl
1776 ::std::convert::From<
1777 ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
1778 > for DeleteRolesRequest
1779 {
1780 fn from(
1781 value: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
1782 ) -> Self {
1783 Self(value)
1784 }
1785 }
1786 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1845 pub struct Device {
1846 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1848 pub device_metadata: ::std::option::Option<::serde_json::Value>,
1849 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1851 pub external_id: ::std::option::Option<::std::string::String>,
1852 pub id: ::std::string::String,
1854 pub integration_id: ::std::string::String,
1856 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1857 pub metadata: ::std::option::Option<HashMap>,
1858 pub name: LocalizedString,
1859 pub org_id: ::std::string::String,
1861 }
1862 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1881 pub struct DeviceEntityMetadataDefinitionQuery {
1882 pub entity_type: ::std::string::String,
1883 }
1884 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1912 pub struct DeviceMetadataDefinitionResponse {
1913 pub data: ::serde_json::Value,
1915 pub provider_type: ::std::string::String,
1916 pub schema: ::serde_json::Value,
1918 }
1919 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
1960 pub struct DeviceResponse {
1961 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1962 pub cache_hit: ::std::option::Option<bool>,
1963 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1964 pub cache_ttl: ::std::option::Option<i64>,
1965 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1966 pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
1967 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1968 pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
1969 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1971 pub device_metadata: ::std::option::Option<::serde_json::Value>,
1972 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1974 pub external_id: ::std::option::Option<::std::string::String>,
1975 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1976 pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
1977 pub id: ::std::string::String,
1979 pub integration_id: ::std::string::String,
1981 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1982 pub metadata: ::std::option::Option<HashMap>,
1983 pub name: LocalizedString,
1984 pub org_id: ::std::string::String,
1986 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1987 pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
1988 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1990 pub stale: ::std::option::Option<bool>,
1991 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1992 pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
1993 }
1994 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2016 pub struct DoorRestrictionsResponse {
2017 pub apartment_entity_ids: ::std::vec::Vec<::std::string::String>,
2018 }
2019 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2049 pub struct EffectiveLimit {
2050 pub source: LimitSource,
2051 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2053 pub value: ::std::option::Option<i64>,
2054 }
2055 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2122 pub struct Entity {
2123 pub device_id: ::std::string::String,
2125 pub entity_type: EntityType,
2126 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2128 pub external_id: ::std::option::Option<::std::string::String>,
2129 pub id: ::std::string::String,
2131 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2132 pub metadata: ::std::option::Option<HashMap>,
2133 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2135 pub name: ::std::option::Option<::std::string::String>,
2136 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2138 pub zone_id: ::std::option::Option<::std::string::String>,
2139 }
2140 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2171 pub struct EntityMetadataDefinitionResponse {
2172 pub data: ::serde_json::Value,
2174 pub entity_type: ::std::string::String,
2175 pub provider_type: ::std::string::String,
2176 pub schema: ::serde_json::Value,
2178 }
2179 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2228 pub struct EntityResponse {
2229 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2230 pub cache_hit: ::std::option::Option<bool>,
2231 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2232 pub cache_ttl: ::std::option::Option<i64>,
2233 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2234 pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
2235 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2236 pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
2237 pub device_id: ::std::string::String,
2239 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2240 pub entity_metadata: ::std::option::Option<HashMap>,
2241 pub entity_type: EntityType,
2242 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2244 pub external_id: ::std::option::Option<::std::string::String>,
2245 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2246 pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
2247 pub id: ::std::string::String,
2249 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2250 pub metadata: ::std::option::Option<HashMap>,
2251 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2253 pub name: ::std::option::Option<::std::string::String>,
2254 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2255 pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
2256 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2257 pub state: ::std::option::Option<::serde_json::Value>,
2258 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2259 pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
2260 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2262 pub zone_id: ::std::option::Option<::std::string::String>,
2263 }
2264 #[derive(
2283 ::serde::Deserialize,
2284 ::serde::Serialize,
2285 Clone,
2286 Copy,
2287 Debug,
2288 Eq,
2289 Hash,
2290 Ord,
2291 PartialEq,
2292 PartialOrd,
2293 )]
2294 pub enum EntityType {
2295 #[serde(rename = "apartment")]
2296 Apartment,
2297 #[serde(rename = "door")]
2298 Door,
2299 #[serde(rename = "light")]
2300 Light,
2301 #[serde(rename = "sensor")]
2302 Sensor,
2303 #[serde(rename = "switch")]
2304 Switch,
2305 }
2306 impl ::std::fmt::Display for EntityType {
2307 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2308 match *self {
2309 Self::Apartment => f.write_str("apartment"),
2310 Self::Door => f.write_str("door"),
2311 Self::Light => f.write_str("light"),
2312 Self::Sensor => f.write_str("sensor"),
2313 Self::Switch => f.write_str("switch"),
2314 }
2315 }
2316 }
2317 impl ::std::str::FromStr for EntityType {
2318 type Err = self::error::ConversionError;
2319 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2320 match value {
2321 "apartment" => Ok(Self::Apartment),
2322 "door" => Ok(Self::Door),
2323 "light" => Ok(Self::Light),
2324 "sensor" => Ok(Self::Sensor),
2325 "switch" => Ok(Self::Switch),
2326 _ => Err("invalid value".into()),
2327 }
2328 }
2329 }
2330 impl ::std::convert::TryFrom<&str> for EntityType {
2331 type Error = self::error::ConversionError;
2332 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2333 value.parse()
2334 }
2335 }
2336 impl ::std::convert::TryFrom<&::std::string::String> for EntityType {
2337 type Error = self::error::ConversionError;
2338 fn try_from(
2339 value: &::std::string::String,
2340 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2341 value.parse()
2342 }
2343 }
2344 impl ::std::convert::TryFrom<::std::string::String> for EntityType {
2345 type Error = self::error::ConversionError;
2346 fn try_from(
2347 value: ::std::string::String,
2348 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2349 value.parse()
2350 }
2351 }
2352 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2376 pub struct EulaResponse {
2377 pub content: ::std::string::String,
2378 pub version: ::std::string::String,
2379 }
2380 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2399 pub struct ExecuteScriptingRequest {
2400 pub script: ::std::string::String,
2401 }
2402 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2419 pub struct ExecuteScriptingResponse {
2420 pub result: ::serde_json::Value,
2421 }
2422 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2449 pub struct GetAccessPortalResponse {
2450 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2451 pub created_at: ::std::option::Option<::std::string::String>,
2452 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2454 pub device_external_id: ::std::option::Option<::std::string::String>,
2455 pub id: ::std::string::String,
2456 pub integration_id: ::std::string::String,
2457 pub name: LocalizedString,
2458 pub public_id: ::std::string::String,
2459 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2460 pub updated_at: ::std::option::Option<::std::string::String>,
2461 }
2462 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2476 #[serde(transparent)]
2477 pub struct HashMap(
2478 pub ::std::collections::HashMap<::std::string::String, ::std::string::String>,
2479 );
2480 impl ::std::ops::Deref for HashMap {
2481 type Target = ::std::collections::HashMap<::std::string::String, ::std::string::String>;
2482 fn deref(
2483 &self,
2484 ) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
2485 &self.0
2486 }
2487 }
2488 impl ::std::convert::From<HashMap>
2489 for ::std::collections::HashMap<::std::string::String, ::std::string::String>
2490 {
2491 fn from(value: HashMap) -> Self {
2492 value.0
2493 }
2494 }
2495 impl
2496 ::std::convert::From<
2497 ::std::collections::HashMap<::std::string::String, ::std::string::String>,
2498 > for HashMap
2499 {
2500 fn from(
2501 value: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
2502 ) -> Self {
2503 Self(value)
2504 }
2505 }
2506 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2568 pub struct Integration {
2569 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2571 pub config: ::std::option::Option<::serde_json::Value>,
2572 pub enabled: bool,
2574 pub health: IntegrationHealth,
2575 pub id: ::std::string::String,
2577 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2578 pub metadata: ::std::option::Option<HashMap>,
2579 pub name: LocalizedString,
2580 pub org_id: ::std::string::String,
2582 pub provider_type: ProviderType,
2583 }
2584 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2608 pub struct IntegrationDeviceMetadataSchemaResponse {
2609 pub provider_type: ::std::string::String,
2610 pub schema: ::serde_json::Value,
2612 }
2613 #[derive(
2629 ::serde::Deserialize,
2630 ::serde::Serialize,
2631 Clone,
2632 Copy,
2633 Debug,
2634 Eq,
2635 Hash,
2636 Ord,
2637 PartialEq,
2638 PartialOrd,
2639 )]
2640 pub enum IntegrationHealth {
2641 #[serde(rename = "ok")]
2642 Ok,
2643 #[serde(rename = "error")]
2644 Error,
2645 }
2646 impl ::std::fmt::Display for IntegrationHealth {
2647 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2648 match *self {
2649 Self::Ok => f.write_str("ok"),
2650 Self::Error => f.write_str("error"),
2651 }
2652 }
2653 }
2654 impl ::std::str::FromStr for IntegrationHealth {
2655 type Err = self::error::ConversionError;
2656 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2657 match value {
2658 "ok" => Ok(Self::Ok),
2659 "error" => Ok(Self::Error),
2660 _ => Err("invalid value".into()),
2661 }
2662 }
2663 }
2664 impl ::std::convert::TryFrom<&str> for IntegrationHealth {
2665 type Error = self::error::ConversionError;
2666 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2667 value.parse()
2668 }
2669 }
2670 impl ::std::convert::TryFrom<&::std::string::String> for IntegrationHealth {
2671 type Error = self::error::ConversionError;
2672 fn try_from(
2673 value: &::std::string::String,
2674 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2675 value.parse()
2676 }
2677 }
2678 impl ::std::convert::TryFrom<::std::string::String> for IntegrationHealth {
2679 type Error = self::error::ConversionError;
2680 fn try_from(
2681 value: ::std::string::String,
2682 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2683 value.parse()
2684 }
2685 }
2686 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2726 pub struct IntegrationResponse {
2727 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2728 pub cache_hit: ::std::option::Option<bool>,
2729 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2730 pub cache_ttl: ::std::option::Option<i64>,
2731 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2733 pub config: ::std::option::Option<::serde_json::Value>,
2734 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2735 pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
2736 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2737 pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
2738 pub enabled: bool,
2740 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2741 pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
2742 pub health: IntegrationHealth,
2743 pub id: ::std::string::String,
2745 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2746 pub metadata: ::std::option::Option<HashMap>,
2747 pub name: LocalizedString,
2748 pub org_id: ::std::string::String,
2750 pub provider_type: ProviderType,
2751 pub provider_type_name: LocalizedString,
2752 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2753 pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
2754 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2755 pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
2756 }
2757 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2822 #[serde(tag = "kind")]
2823 pub enum InviteRecurrenceSeriesEnd {
2824 #[serde(rename = "never")]
2825 Never,
2826 #[serde(rename = "until")]
2827 Until { at: ::std::string::String },
2828 #[serde(rename = "count")]
2829 Count { total: i32 },
2830 }
2831 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2859 pub struct InviteScheduleCombined {
2860 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2861 pub open_ended_recurrence: ::std::option::Option<bool>,
2862 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2863 pub since: ::std::option::Option<::std::string::String>,
2864 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2865 pub until: ::std::option::Option<::std::string::String>,
2866 }
2867 impl ::std::default::Default for InviteScheduleCombined {
2868 fn default() -> Self {
2869 Self {
2870 open_ended_recurrence: Default::default(),
2871 since: Default::default(),
2872 until: Default::default(),
2873 }
2874 }
2875 }
2876 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2915 pub struct InviteScheduleEntryInput {
2916 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2917 pub id: ::std::option::Option<::std::string::String>,
2918 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2919 pub invite_recurrence: ::std::option::Option<::serde_json::Value>,
2920 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2921 pub is_enabled: ::std::option::Option<bool>,
2922 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2923 pub name: ::std::option::Option<::std::string::String>,
2924 pub valid_from: ::std::string::String,
2925 pub valid_to: ::std::string::String,
2926 }
2927 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
2969 pub struct InviteScheduleEntrySnapshot {
2970 pub id: ::std::string::String,
2971 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2972 pub invite_recurrence: ::std::option::Option<::serde_json::Value>,
2973 pub is_enabled: bool,
2974 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2975 pub name: ::std::option::Option<::std::string::String>,
2976 pub schedule: InviteScheduleSnapshot,
2977 pub valid_from: ::std::string::String,
2978 pub valid_to: ::std::string::String,
2979 }
2980 #[derive(
2996 ::serde::Deserialize,
2997 ::serde::Serialize,
2998 Clone,
2999 Copy,
3000 Debug,
3001 Eq,
3002 Hash,
3003 Ord,
3004 PartialEq,
3005 PartialOrd,
3006 )]
3007 pub enum InviteScheduleKind {
3008 #[serde(rename = "single_window")]
3009 SingleWindow,
3010 #[serde(rename = "single_recurring")]
3011 SingleRecurring,
3012 #[serde(rename = "multiple")]
3013 Multiple,
3014 }
3015 impl ::std::fmt::Display for InviteScheduleKind {
3016 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3017 match *self {
3018 Self::SingleWindow => f.write_str("single_window"),
3019 Self::SingleRecurring => f.write_str("single_recurring"),
3020 Self::Multiple => f.write_str("multiple"),
3021 }
3022 }
3023 }
3024 impl ::std::str::FromStr for InviteScheduleKind {
3025 type Err = self::error::ConversionError;
3026 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3027 match value {
3028 "single_window" => Ok(Self::SingleWindow),
3029 "single_recurring" => Ok(Self::SingleRecurring),
3030 "multiple" => Ok(Self::Multiple),
3031 _ => Err("invalid value".into()),
3032 }
3033 }
3034 }
3035 impl ::std::convert::TryFrom<&str> for InviteScheduleKind {
3036 type Error = self::error::ConversionError;
3037 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3038 value.parse()
3039 }
3040 }
3041 impl ::std::convert::TryFrom<&::std::string::String> for InviteScheduleKind {
3042 type Error = self::error::ConversionError;
3043 fn try_from(
3044 value: &::std::string::String,
3045 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3046 value.parse()
3047 }
3048 }
3049 impl ::std::convert::TryFrom<::std::string::String> for InviteScheduleKind {
3050 type Error = self::error::ConversionError;
3051 fn try_from(
3052 value: ::std::string::String,
3053 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3054 value.parse()
3055 }
3056 }
3057 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3123 pub struct InviteScheduleSnapshot {
3124 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3125 pub active_window: ::std::option::Option<InviteWindow>,
3126 pub is_recurring: bool,
3127 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3128 pub next_window: ::std::option::Option<InviteWindow>,
3129 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3130 pub series_end: ::std::option::Option<InviteRecurrenceSeriesEnd>,
3131 pub slot_duration_seconds: i64,
3132 }
3133 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3156 pub struct InviteWindow {
3157 pub from: ::std::string::String,
3158 pub to: ::std::string::String,
3159 }
3160 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3197 pub struct LanAgentBootstrapTokenRequest {
3198 pub api_base_url: ::std::string::String,
3200 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3201 pub device_id: ::std::option::Option<::std::string::String>,
3202 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3204 pub integration_id: ::std::option::Option<::std::string::String>,
3205 pub task_id: ::std::string::String,
3206 }
3207 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3233 pub struct LanAgentBootstrapTokenResponse {
3234 pub bootstrap_key: ::std::string::String,
3236 pub expires_in: i64,
3237 }
3238 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3267 pub struct LanAgentCliTokenResponse {
3268 pub access_token: ::std::string::String,
3269 pub expires_in: i64,
3270 pub token_type: ::std::string::String,
3271 }
3272 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3313 pub struct LanAgentMetaResponse {
3314 pub lan_protocol_version: i32,
3315 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3316 pub latest_agent_version: ::std::option::Option<::std::string::String>,
3317 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3318 pub min_supported_agent_version: ::std::option::Option<::std::string::String>,
3319 pub tasks_catalog: ::serde_json::Value,
3320 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3321 pub upgrade_download_url: ::std::option::Option<::std::string::String>,
3322 }
3323 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3350 pub struct LanAgentTaskSpecRequest {
3351 pub lan_protocol_version: i32,
3352 pub payload: ::serde_json::Value,
3353 pub task_id: ::std::string::String,
3354 }
3355 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3382 pub struct LanAgentTaskSpecResponse {
3383 pub lan_protocol_version: i32,
3384 pub spec: ::serde_json::Value,
3385 pub task_id: ::std::string::String,
3386 }
3387 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3405 #[serde(transparent)]
3406 pub struct LightsAutoOffDuration(pub ::std::collections::HashMap<::std::string::String, i64>);
3407 impl ::std::ops::Deref for LightsAutoOffDuration {
3408 type Target = ::std::collections::HashMap<::std::string::String, i64>;
3409 fn deref(&self) -> &::std::collections::HashMap<::std::string::String, i64> {
3410 &self.0
3411 }
3412 }
3413 impl ::std::convert::From<LightsAutoOffDuration>
3414 for ::std::collections::HashMap<::std::string::String, i64>
3415 {
3416 fn from(value: LightsAutoOffDuration) -> Self {
3417 value.0
3418 }
3419 }
3420 impl ::std::convert::From<::std::collections::HashMap<::std::string::String, i64>>
3421 for LightsAutoOffDuration
3422 {
3423 fn from(value: ::std::collections::HashMap<::std::string::String, i64>) -> Self {
3424 Self(value)
3425 }
3426 }
3427 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3492 #[serde(tag = "kind")]
3493 pub enum LimitSource {
3494 #[serde(rename = "override")]
3496 Override { id: ::std::string::String },
3497 #[serde(rename = "tier")]
3499 Tier { slug: ::std::string::String },
3500 #[serde(rename = "default")]
3501 Default,
3502 }
3503 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3575 pub struct ListDevicesQuery {
3576 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3579 pub device_kind: ::std::option::Option<::std::string::String>,
3580 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3583 pub external_id: ::std::option::Option<::std::string::String>,
3584 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3586 pub has_external_id: ::std::option::Option<bool>,
3587 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3589 pub has_go2rtc_channel: ::std::option::Option<bool>,
3590 pub include_deleted: bool,
3591 pub include_metadata: bool,
3592 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3594 pub include_stale: ::std::option::Option<bool>,
3595 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3597 pub integration_id: ::std::option::Option<::std::string::String>,
3598 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3600 pub limit: ::std::option::Option<i32>,
3601 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3603 pub offset: ::std::option::Option<i32>,
3604 pub only_deleted: bool,
3605 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3607 pub q: ::std::option::Option<::std::string::String>,
3608 }
3609 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3640 pub struct ListEntitiesQuery {
3641 pub include_deleted: bool,
3642 pub include_metadata: bool,
3643 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3645 pub limit: ::std::option::Option<i32>,
3646 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3648 pub offset: ::std::option::Option<i32>,
3649 pub only_deleted: bool,
3650 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3652 pub zone_id: ::std::option::Option<::std::string::String>,
3653 }
3654 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3676 pub struct ListIntegrationAccessInvitesResponse {
3677 pub invites: ::std::vec::Vec<AccessInviteListItem>,
3678 }
3679 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3701 pub struct ListIntegrationAccessPortalsResponse {
3702 pub portals: ::std::vec::Vec<AccessPortalListItem>,
3703 }
3704 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3741 pub struct ListIntegrationsQuery {
3742 pub include_deleted: bool,
3743 pub include_metadata: bool,
3744 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3746 pub limit: ::std::option::Option<i32>,
3747 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3749 pub offset: ::std::option::Option<i32>,
3750 pub only_deleted: bool,
3751 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3753 pub provider_type: ::std::option::Option<::std::string::String>,
3754 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3756 pub q: ::std::option::Option<::std::string::String>,
3757 }
3758 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3787 pub struct ListOrgUsersQuery {
3788 pub include_deleted: bool,
3789 pub include_metadata: bool,
3790 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3792 pub limit: ::std::option::Option<i32>,
3793 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3795 pub offset: ::std::option::Option<i32>,
3796 pub only_deleted: bool,
3797 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3798 pub recursive: ::std::option::Option<bool>,
3799 }
3800 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3818 pub struct ListOrgsQuery {
3819 pub include_deleted: bool,
3820 pub include_metadata: bool,
3821 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3823 pub limit: ::std::option::Option<i32>,
3824 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3826 pub offset: ::std::option::Option<i32>,
3827 pub only_deleted: bool,
3828 }
3829 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3859 pub struct LocalizedString {
3860 pub value: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
3862 }
3863 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3928 pub struct MeApartmentAsset {
3929 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3930 pub apartment_label: ::std::option::Option<::serde_json::Value>,
3931 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3932 pub apartment_number: ::std::option::Option<i64>,
3933 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3934 pub building_name: ::std::option::Option<::serde_json::Value>,
3935 pub call_eligible: bool,
3937 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3938 pub display_name: ::std::option::Option<::serde_json::Value>,
3939 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3941 pub dnd_enabled: ::std::option::Option<bool>,
3942 pub entity_id: ::std::string::String,
3943 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3944 pub floor: ::std::option::Option<::serde_json::Value>,
3945 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3946 pub floor_number: ::std::option::Option<i64>,
3947 pub integration_id: ::std::string::String,
3948 pub org_id: ::std::string::String,
3949 pub receives_calls: bool,
3950 pub role: ::std::string::String,
3951 }
3952 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
3981 pub struct MeApartmentsResponse {
3982 pub apartments: ::std::vec::Vec<MeApartmentAsset>,
3983 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3985 pub dnd_global: ::std::option::Option<bool>,
3986 }
3987 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4064 pub struct MeInvitationAsset {
4065 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4066 pub building_name: ::std::option::Option<::serde_json::Value>,
4067 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4068 pub claimed_at: ::std::option::Option<::std::string::String>,
4069 pub integration_id: ::std::string::String,
4070 pub invite_link_id: ::std::string::String,
4071 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4072 pub last_used_at: ::std::option::Option<::std::string::String>,
4073 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4074 pub max_uses: ::std::option::Option<i32>,
4075 pub org_id: ::std::string::String,
4076 pub portal_ids: ::std::vec::Vec<::std::string::String>,
4078 pub state: ::std::string::String,
4079 pub uses: i32,
4081 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4082 pub valid_from: ::std::option::Option<::std::string::String>,
4083 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4084 pub valid_to: ::std::option::Option<::std::string::String>,
4085 }
4086 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4108 pub struct MeInvitationsResponse {
4109 pub invitations: ::std::vec::Vec<MeInvitationAsset>,
4110 }
4111 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4135 pub struct MePushSubscriptionStatusResponse {
4136 pub has_subscription: bool,
4137 pub push_configured: bool,
4139 }
4140 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4159 pub struct MePushVapidPublicKeyResponse {
4160 pub public_key: ::std::string::String,
4161 }
4162 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4202 pub struct MultiResourceOutputOptions {
4203 pub limit: i32,
4205 pub offset: i32,
4207 pub only_deleted: bool,
4212 pub single: SingleResourceOutputOptions,
4213 }
4214 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4241 pub struct MultiResourceOutputOptionsQuery {
4242 pub include_deleted: bool,
4243 pub include_metadata: bool,
4244 pub only_deleted: bool,
4245 }
4246 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4265 pub struct NotifyPortalMessageBody {
4266 pub text: ::std::string::String,
4267 }
4268 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4292 pub struct OrgPermissionsResponse {
4293 pub permissions: ::std::vec::Vec<::std::string::String>,
4294 }
4295 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4359 pub struct Organization {
4360 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4362 pub description: ::std::option::Option<::std::string::String>,
4363 pub id: ::std::string::String,
4365 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4366 pub metadata: ::std::option::Option<HashMap>,
4367 pub name: LocalizedString,
4368 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4370 pub parent_id: ::std::option::Option<::std::string::String>,
4371 pub user_roles: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
4373 }
4374 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4422 pub struct OrganizationResponse {
4423 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4424 pub cache_hit: ::std::option::Option<bool>,
4425 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4426 pub cache_ttl: ::std::option::Option<i64>,
4427 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4428 pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
4429 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4430 pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
4431 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4433 pub description: ::std::option::Option<::std::string::String>,
4434 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4435 pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
4436 pub id: ::std::string::String,
4438 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4439 pub metadata: ::std::option::Option<HashMap>,
4440 pub name: LocalizedString,
4441 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4443 pub parent_id: ::std::option::Option<::std::string::String>,
4444 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4445 pub parent_name: ::std::option::Option<LocalizedString>,
4446 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4447 pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
4448 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4449 pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
4450 pub user_roles: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
4452 }
4453 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4482 pub struct PaginatedResponse {
4483 pub items: ::std::vec::Vec<UserResponse>,
4484 pub total: i64,
4485 }
4486 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4553 pub struct PaginatedResponseEntityResponse {
4554 pub items: ::std::vec::Vec<PaginatedResponseEntityResponseItemsItem>,
4555 pub total: i64,
4556 }
4557 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4606 pub struct PaginatedResponseEntityResponseItemsItem {
4607 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4608 pub cache_hit: ::std::option::Option<bool>,
4609 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4610 pub cache_ttl: ::std::option::Option<i64>,
4611 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4612 pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
4613 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4614 pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
4615 pub device_id: ::std::string::String,
4617 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4618 pub entity_metadata: ::std::option::Option<HashMap>,
4619 pub entity_type: EntityType,
4620 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4622 pub external_id: ::std::option::Option<::std::string::String>,
4623 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4624 pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
4625 pub id: ::std::string::String,
4627 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4628 pub metadata: ::std::option::Option<HashMap>,
4629 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4631 pub name: ::std::option::Option<::std::string::String>,
4632 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4633 pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
4634 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4635 pub state: ::std::option::Option<::serde_json::Value>,
4636 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4637 pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
4638 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4640 pub zone_id: ::std::option::Option<::std::string::String>,
4641 }
4642 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4669 pub struct PaginationQuery {
4670 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4672 pub limit: ::std::option::Option<i32>,
4673 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4675 pub offset: ::std::option::Option<i32>,
4676 }
4677 impl ::std::default::Default for PaginationQuery {
4678 fn default() -> Self {
4679 Self {
4680 limit: Default::default(),
4681 offset: Default::default(),
4682 }
4683 }
4684 }
4685 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4707 pub struct PatchEntityRequest {
4708 pub metadata: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
4711 }
4712 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4745 pub struct PeerJsConfig {
4746 pub host: ::std::string::String,
4747 pub path: ::std::string::String,
4748 pub port: i32,
4749 pub secure: bool,
4750 }
4751 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4781 pub struct PlanQuotaResponse {
4782 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4783 pub limit_value: ::std::option::Option<i64>,
4784 pub period: ::std::string::String,
4785 pub quota_key: ::std::string::String,
4786 }
4787 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4829 pub struct PlanResponse {
4830 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4831 pub description: ::std::option::Option<::serde_json::Value>,
4832 pub is_default_for_personal: bool,
4833 pub is_published: bool,
4834 pub name: ::serde_json::Value,
4835 pub quotas: ::std::vec::Vec<PlanQuotaResponse>,
4836 pub slug: ::std::string::String,
4837 pub sort_order: i32,
4838 }
4839 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4861 pub struct PlansResponse {
4862 pub plans: ::std::vec::Vec<PlanResponse>,
4863 }
4864 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4883 pub struct PortalRequest {
4884 pub return_url: ::std::string::String,
4885 }
4886 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4905 pub struct PortalResponse {
4906 pub url: ::std::string::String,
4907 }
4908 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
4935 pub struct PostMePushSubscriptionPayload {
4936 pub auth: ::std::string::String,
4937 pub endpoint: ::std::string::String,
4938 pub p256dh: ::std::string::String,
4939 }
4940 #[derive(
4965 ::serde::Deserialize,
4966 ::serde::Serialize,
4967 Clone,
4968 Copy,
4969 Debug,
4970 Eq,
4971 Hash,
4972 Ord,
4973 PartialEq,
4974 PartialOrd,
4975 )]
4976 pub enum ProviderType {
4977 #[serde(rename = "go2rtc")]
4978 Go2rtc,
4979 #[serde(rename = "home_assistant")]
4980 HomeAssistant,
4981 #[serde(rename = "knx")]
4982 Knx,
4983 #[serde(rename = "mqtt")]
4984 Mqtt,
4985 #[serde(rename = "palgate_cloud")]
4986 PalgateCloud,
4987 #[serde(rename = "shelly_cloud")]
4988 ShellyCloud,
4989 #[serde(rename = "shelly_websocket")]
4990 ShellyWebsocket,
4991 #[serde(rename = "virtual_budget")]
4992 VirtualBudget,
4993 #[serde(rename = "virtual_access")]
4994 VirtualAccess,
4995 #[serde(rename = "virtual_demo")]
4996 VirtualDemo,
4997 #[serde(rename = "waveshare")]
4998 Waveshare,
4999 }
5000 impl ::std::fmt::Display for ProviderType {
5001 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5002 match *self {
5003 Self::Go2rtc => f.write_str("go2rtc"),
5004 Self::HomeAssistant => f.write_str("home_assistant"),
5005 Self::Knx => f.write_str("knx"),
5006 Self::Mqtt => f.write_str("mqtt"),
5007 Self::PalgateCloud => f.write_str("palgate_cloud"),
5008 Self::ShellyCloud => f.write_str("shelly_cloud"),
5009 Self::ShellyWebsocket => f.write_str("shelly_websocket"),
5010 Self::VirtualBudget => f.write_str("virtual_budget"),
5011 Self::VirtualAccess => f.write_str("virtual_access"),
5012 Self::VirtualDemo => f.write_str("virtual_demo"),
5013 Self::Waveshare => f.write_str("waveshare"),
5014 }
5015 }
5016 }
5017 impl ::std::str::FromStr for ProviderType {
5018 type Err = self::error::ConversionError;
5019 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5020 match value {
5021 "go2rtc" => Ok(Self::Go2rtc),
5022 "home_assistant" => Ok(Self::HomeAssistant),
5023 "knx" => Ok(Self::Knx),
5024 "mqtt" => Ok(Self::Mqtt),
5025 "palgate_cloud" => Ok(Self::PalgateCloud),
5026 "shelly_cloud" => Ok(Self::ShellyCloud),
5027 "shelly_websocket" => Ok(Self::ShellyWebsocket),
5028 "virtual_budget" => Ok(Self::VirtualBudget),
5029 "virtual_access" => Ok(Self::VirtualAccess),
5030 "virtual_demo" => Ok(Self::VirtualDemo),
5031 "waveshare" => Ok(Self::Waveshare),
5032 _ => Err("invalid value".into()),
5033 }
5034 }
5035 }
5036 impl ::std::convert::TryFrom<&str> for ProviderType {
5037 type Error = self::error::ConversionError;
5038 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5039 value.parse()
5040 }
5041 }
5042 impl ::std::convert::TryFrom<&::std::string::String> for ProviderType {
5043 type Error = self::error::ConversionError;
5044 fn try_from(
5045 value: &::std::string::String,
5046 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5047 value.parse()
5048 }
5049 }
5050 impl ::std::convert::TryFrom<::std::string::String> for ProviderType {
5051 type Error = self::error::ConversionError;
5052 fn try_from(
5053 value: ::std::string::String,
5054 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5055 value.parse()
5056 }
5057 }
5058 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5077 pub struct PublicInviteExecuteRequest {
5078 pub grant_id: ::std::string::String,
5079 }
5080 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5127 pub struct PublicInviteExecuteResponse {
5128 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5129 pub door_auto_close_duration: ::std::option::Option<i64>,
5130 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5131 pub lights_auto_off_duration: ::std::option::Option<LightsAutoOffDuration>,
5132 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5133 pub message: ::std::option::Option<::std::string::String>,
5134 pub ok: bool,
5135 }
5136 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5213 #[serde(tag = "kind")]
5214 pub enum PublicInviteGrant {
5215 #[serde(rename = "portal_open")]
5216 PortalOpen {
5217 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5219 door_image_url: ::std::option::Option<::std::string::String>,
5220 has_lights: bool,
5222 id: ::std::string::String,
5223 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5225 label: ::std::option::Option<::serde_json::Value>,
5226 public_portal_id: ::std::string::String,
5227 },
5228 #[serde(rename = "entity_action")]
5229 EntityAction {
5230 action_id: ::std::string::String,
5231 entity_id: ::std::string::String,
5232 id: ::std::string::String,
5233 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5234 label: ::std::option::Option<::serde_json::Value>,
5235 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5236 payload: ::std::option::Option<::serde_json::Value>,
5237 },
5238 }
5239 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5350 pub struct PublicInviteResponse {
5351 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5352 pub already_claimed: ::std::option::Option<bool>,
5353 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5354 pub branding: ::std::option::Option<::serde_json::Value>,
5355 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5358 pub building: ::std::option::Option<::serde_json::Value>,
5359 pub grants: ::std::vec::Vec<PublicInviteGrant>,
5360 pub invite_token: ::std::string::String,
5361 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5362 pub invitee_message: ::std::option::Option<::serde_json::Value>,
5363 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5365 pub name: ::std::option::Option<::std::string::String>,
5366 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5367 pub schedule: ::std::option::Option<InviteScheduleSnapshot>,
5368 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5369 pub schedule_combined: ::std::option::Option<InviteScheduleCombined>,
5370 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5371 pub schedule_entries: ::std::option::Option<::std::vec::Vec<InviteScheduleEntrySnapshot>>,
5372 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5373 pub schedule_kind: ::std::option::Option<InviteScheduleKind>,
5374 pub state: PublicInviteState,
5375 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5376 pub valid_from: ::std::option::Option<::std::string::String>,
5377 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5378 pub valid_to: ::std::option::Option<::std::string::String>,
5379 }
5380 #[derive(
5399 ::serde::Deserialize,
5400 ::serde::Serialize,
5401 Clone,
5402 Copy,
5403 Debug,
5404 Eq,
5405 Hash,
5406 Ord,
5407 PartialEq,
5408 PartialOrd,
5409 )]
5410 pub enum PublicInviteState {
5411 #[serde(rename = "active")]
5412 Active,
5413 #[serde(rename = "expired")]
5414 Expired,
5415 #[serde(rename = "revoked")]
5416 Revoked,
5417 #[serde(rename = "scheduled")]
5418 Scheduled,
5419 #[serde(rename = "disabled")]
5420 Disabled,
5421 #[serde(rename = "not_found")]
5422 NotFound,
5423 }
5424 impl ::std::fmt::Display for PublicInviteState {
5425 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5426 match *self {
5427 Self::Active => f.write_str("active"),
5428 Self::Expired => f.write_str("expired"),
5429 Self::Revoked => f.write_str("revoked"),
5430 Self::Scheduled => f.write_str("scheduled"),
5431 Self::Disabled => f.write_str("disabled"),
5432 Self::NotFound => f.write_str("not_found"),
5433 }
5434 }
5435 }
5436 impl ::std::str::FromStr for PublicInviteState {
5437 type Err = self::error::ConversionError;
5438 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5439 match value {
5440 "active" => Ok(Self::Active),
5441 "expired" => Ok(Self::Expired),
5442 "revoked" => Ok(Self::Revoked),
5443 "scheduled" => Ok(Self::Scheduled),
5444 "disabled" => Ok(Self::Disabled),
5445 "not_found" => Ok(Self::NotFound),
5446 _ => Err("invalid value".into()),
5447 }
5448 }
5449 }
5450 impl ::std::convert::TryFrom<&str> for PublicInviteState {
5451 type Error = self::error::ConversionError;
5452 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5453 value.parse()
5454 }
5455 }
5456 impl ::std::convert::TryFrom<&::std::string::String> for PublicInviteState {
5457 type Error = self::error::ConversionError;
5458 fn try_from(
5459 value: &::std::string::String,
5460 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5461 value.parse()
5462 }
5463 }
5464 impl ::std::convert::TryFrom<::std::string::String> for PublicInviteState {
5465 type Error = self::error::ConversionError;
5466 fn try_from(
5467 value: ::std::string::String,
5468 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5469 value.parse()
5470 }
5471 }
5472 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5495 pub struct PublicPortalCreateSessionRequest {
5496 pub mode: ::std::string::String,
5497 pub target_entity_id: ::std::string::String,
5498 }
5499 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5543 pub struct PublicPortalCreateSessionResponse {
5544 pub callee_peer_id: ::std::string::String,
5545 pub callees_notified: bool,
5547 pub caller_peer_id: ::std::string::String,
5548 pub caller_token: ::std::string::String,
5549 pub expires_at: ::std::string::String,
5550 pub peerjs: PeerJsConfig,
5551 pub session_id: ::std::string::String,
5552 }
5553 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5581 pub struct PublicPortalLight {
5582 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5583 pub effective_auto_off_duration: ::std::option::Option<i64>,
5584 pub entity_id: ::std::string::String,
5585 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5586 pub label: ::std::option::Option<::serde_json::Value>,
5587 }
5588 #[derive(
5604 ::serde::Deserialize,
5605 ::serde::Serialize,
5606 Clone,
5607 Copy,
5608 Debug,
5609 Eq,
5610 Hash,
5611 Ord,
5612 PartialEq,
5613 PartialOrd,
5614 )]
5615 pub enum PublicPortalMode {
5616 #[serde(rename = "guest_directory")]
5617 GuestDirectory,
5618 #[serde(rename = "resident_quick_open")]
5619 ResidentQuickOpen,
5620 #[serde(rename = "guest_quick_open")]
5621 GuestQuickOpen,
5622 }
5623 impl ::std::fmt::Display for PublicPortalMode {
5624 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5625 match *self {
5626 Self::GuestDirectory => f.write_str("guest_directory"),
5627 Self::ResidentQuickOpen => f.write_str("resident_quick_open"),
5628 Self::GuestQuickOpen => f.write_str("guest_quick_open"),
5629 }
5630 }
5631 }
5632 impl ::std::str::FromStr for PublicPortalMode {
5633 type Err = self::error::ConversionError;
5634 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5635 match value {
5636 "guest_directory" => Ok(Self::GuestDirectory),
5637 "resident_quick_open" => Ok(Self::ResidentQuickOpen),
5638 "guest_quick_open" => Ok(Self::GuestQuickOpen),
5639 _ => Err("invalid value".into()),
5640 }
5641 }
5642 }
5643 impl ::std::convert::TryFrom<&str> for PublicPortalMode {
5644 type Error = self::error::ConversionError;
5645 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5646 value.parse()
5647 }
5648 }
5649 impl ::std::convert::TryFrom<&::std::string::String> for PublicPortalMode {
5650 type Error = self::error::ConversionError;
5651 fn try_from(
5652 value: &::std::string::String,
5653 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5654 value.parse()
5655 }
5656 }
5657 impl ::std::convert::TryFrom<::std::string::String> for PublicPortalMode {
5658 type Error = self::error::ConversionError;
5659 fn try_from(
5660 value: ::std::string::String,
5661 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5662 value.parse()
5663 }
5664 }
5665 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5690 pub struct PublicPortalOpenRateLimit {
5691 pub integration_id: ::std::string::String,
5692 pub min_interval_ms: i64,
5693 }
5694 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5713 pub struct PublicPortalReachableResponse {
5714 pub reachable: bool,
5715 }
5716 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5792 pub struct PublicPortalResponse {
5793 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5794 pub branding: ::std::option::Option<::serde_json::Value>,
5795 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5796 pub door_effective_auto_off_duration: ::std::option::Option<i64>,
5797 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5799 pub door_image_url: ::std::option::Option<::std::string::String>,
5800 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5801 pub lights: ::std::option::Option<::std::vec::Vec<PublicPortalLight>>,
5802 pub mode: PublicPortalMode,
5803 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5804 pub name: ::std::option::Option<LocalizedString>,
5805 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5806 pub open_rate_limit: ::std::option::Option<PublicPortalOpenRateLimit>,
5807 pub public_portal_id: ::std::string::String,
5808 }
5809 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5873 pub struct PublicPortalTarget {
5874 pub allowed_actions: ::std::vec::Vec<::std::string::String>,
5875 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5876 pub apartment_label: ::std::option::Option<::serde_json::Value>,
5877 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5878 pub apartment_number: ::std::option::Option<i64>,
5879 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5881 pub call_available: ::std::option::Option<bool>,
5882 pub display_name: ::serde_json::Value,
5883 pub floor: ::serde_json::Value,
5884 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5885 pub floor_number: ::std::option::Option<i64>,
5886 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5887 pub image: ::std::option::Option<::std::string::String>,
5888 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5889 pub require_video: ::std::option::Option<bool>,
5890 pub target_id: ::std::string::String,
5891 }
5892 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
5924 pub struct PublicPortalTargetsResponse {
5925 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
5927 pub floor_order: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
5928 pub targets: ::std::vec::Vec<PublicPortalTarget>,
5929 }
5930 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6018 pub struct PublicSessionResponse {
6019 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6021 pub building_display_name: ::std::option::Option<::serde_json::Value>,
6022 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6024 pub call_target_display_name: ::std::option::Option<::serde_json::Value>,
6025 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6027 pub call_target_location_line: ::std::option::Option<::std::string::String>,
6028 pub callee_peer_id: ::std::string::String,
6029 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6031 pub callees_notified: ::std::option::Option<bool>,
6032 pub caller_peer_id: ::std::string::String,
6033 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6034 pub expires_at: ::std::option::Option<::std::string::String>,
6035 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6037 pub has_lights: ::std::option::Option<bool>,
6038 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6040 pub mode: ::std::option::Option<::std::string::String>,
6041 pub peerjs: PeerJsConfig,
6042 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6043 pub portal_camera_device_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
6044 pub role: PublicSessionRole,
6045 pub session_id: ::std::string::String,
6046 pub state: ::std::string::String,
6047 }
6048 #[derive(
6063 ::serde::Deserialize,
6064 ::serde::Serialize,
6065 Clone,
6066 Copy,
6067 Debug,
6068 Eq,
6069 Hash,
6070 Ord,
6071 PartialEq,
6072 PartialOrd,
6073 )]
6074 pub enum PublicSessionRole {
6075 #[serde(rename = "caller")]
6076 Caller,
6077 #[serde(rename = "callee")]
6078 Callee,
6079 }
6080 impl ::std::fmt::Display for PublicSessionRole {
6081 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
6082 match *self {
6083 Self::Caller => f.write_str("caller"),
6084 Self::Callee => f.write_str("callee"),
6085 }
6086 }
6087 }
6088 impl ::std::str::FromStr for PublicSessionRole {
6089 type Err = self::error::ConversionError;
6090 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6091 match value {
6092 "caller" => Ok(Self::Caller),
6093 "callee" => Ok(Self::Callee),
6094 _ => Err("invalid value".into()),
6095 }
6096 }
6097 }
6098 impl ::std::convert::TryFrom<&str> for PublicSessionRole {
6099 type Error = self::error::ConversionError;
6100 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6101 value.parse()
6102 }
6103 }
6104 impl ::std::convert::TryFrom<&::std::string::String> for PublicSessionRole {
6105 type Error = self::error::ConversionError;
6106 fn try_from(
6107 value: &::std::string::String,
6108 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6109 value.parse()
6110 }
6111 }
6112 impl ::std::convert::TryFrom<::std::string::String> for PublicSessionRole {
6113 type Error = self::error::ConversionError;
6114 fn try_from(
6115 value: ::std::string::String,
6116 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6117 value.parse()
6118 }
6119 }
6120 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6143 pub struct PublicSessionStreamsResponse {
6144 pub device_ids: ::std::vec::Vec<::std::string::String>,
6146 }
6147 #[derive(
6175 ::serde::Deserialize,
6176 ::serde::Serialize,
6177 Clone,
6178 Copy,
6179 Debug,
6180 Eq,
6181 Hash,
6182 Ord,
6183 PartialEq,
6184 PartialOrd,
6185 )]
6186 pub enum QuotaKey {
6187 #[serde(rename = "org_users")]
6188 OrgUsers,
6189 #[serde(rename = "integrations")]
6190 Integrations,
6191 #[serde(rename = "devices")]
6192 Devices,
6193 #[serde(rename = "entities")]
6194 Entities,
6195 #[serde(rename = "zones")]
6196 Zones,
6197 #[serde(rename = "api_keys")]
6198 ApiKeys,
6199 #[serde(rename = "door_opens")]
6200 DoorOpens,
6201 #[serde(rename = "portal_views")]
6202 PortalViews,
6203 #[serde(rename = "video_sessions")]
6204 VideoSessions,
6205 #[serde(rename = "video_session_duration_seconds")]
6206 VideoSessionDurationSeconds,
6207 #[serde(rename = "scripting_executions")]
6208 ScriptingExecutions,
6209 }
6210 impl ::std::fmt::Display for QuotaKey {
6211 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
6212 match *self {
6213 Self::OrgUsers => f.write_str("org_users"),
6214 Self::Integrations => f.write_str("integrations"),
6215 Self::Devices => f.write_str("devices"),
6216 Self::Entities => f.write_str("entities"),
6217 Self::Zones => f.write_str("zones"),
6218 Self::ApiKeys => f.write_str("api_keys"),
6219 Self::DoorOpens => f.write_str("door_opens"),
6220 Self::PortalViews => f.write_str("portal_views"),
6221 Self::VideoSessions => f.write_str("video_sessions"),
6222 Self::VideoSessionDurationSeconds => f.write_str("video_session_duration_seconds"),
6223 Self::ScriptingExecutions => f.write_str("scripting_executions"),
6224 }
6225 }
6226 }
6227 impl ::std::str::FromStr for QuotaKey {
6228 type Err = self::error::ConversionError;
6229 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6230 match value {
6231 "org_users" => Ok(Self::OrgUsers),
6232 "integrations" => Ok(Self::Integrations),
6233 "devices" => Ok(Self::Devices),
6234 "entities" => Ok(Self::Entities),
6235 "zones" => Ok(Self::Zones),
6236 "api_keys" => Ok(Self::ApiKeys),
6237 "door_opens" => Ok(Self::DoorOpens),
6238 "portal_views" => Ok(Self::PortalViews),
6239 "video_sessions" => Ok(Self::VideoSessions),
6240 "video_session_duration_seconds" => Ok(Self::VideoSessionDurationSeconds),
6241 "scripting_executions" => Ok(Self::ScriptingExecutions),
6242 _ => Err("invalid value".into()),
6243 }
6244 }
6245 }
6246 impl ::std::convert::TryFrom<&str> for QuotaKey {
6247 type Error = self::error::ConversionError;
6248 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6249 value.parse()
6250 }
6251 }
6252 impl ::std::convert::TryFrom<&::std::string::String> for QuotaKey {
6253 type Error = self::error::ConversionError;
6254 fn try_from(
6255 value: &::std::string::String,
6256 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6257 value.parse()
6258 }
6259 }
6260 impl ::std::convert::TryFrom<::std::string::String> for QuotaKey {
6261 type Error = self::error::ConversionError;
6262 fn try_from(
6263 value: ::std::string::String,
6264 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6265 value.parse()
6266 }
6267 }
6268 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6318 pub struct QuotaOverrideRequest {
6319 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6320 pub expires_at: ::std::option::Option<::std::string::String>,
6321 pub limit_value: i64,
6322 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6323 pub period: ::std::option::Option<::std::string::String>,
6324 pub quota_key: ::std::string::String,
6325 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6326 pub reason: ::std::option::Option<::std::string::String>,
6327 pub subject_id: ::std::string::String,
6328 pub subject_type: ::std::string::String,
6329 }
6330 #[derive(
6350 ::serde::Deserialize,
6351 ::serde::Serialize,
6352 Clone,
6353 Copy,
6354 Debug,
6355 Eq,
6356 Hash,
6357 Ord,
6358 PartialEq,
6359 PartialOrd,
6360 )]
6361 pub enum QuotaPeriod {
6362 #[serde(rename = "lifetime")]
6363 Lifetime,
6364 #[serde(rename = "day")]
6365 Day,
6366 #[serde(rename = "week")]
6367 Week,
6368 #[serde(rename = "month")]
6369 Month,
6370 #[serde(rename = "per_session")]
6371 PerSession,
6372 }
6373 impl ::std::fmt::Display for QuotaPeriod {
6374 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
6375 match *self {
6376 Self::Lifetime => f.write_str("lifetime"),
6377 Self::Day => f.write_str("day"),
6378 Self::Week => f.write_str("week"),
6379 Self::Month => f.write_str("month"),
6380 Self::PerSession => f.write_str("per_session"),
6381 }
6382 }
6383 }
6384 impl ::std::str::FromStr for QuotaPeriod {
6385 type Err = self::error::ConversionError;
6386 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6387 match value {
6388 "lifetime" => Ok(Self::Lifetime),
6389 "day" => Ok(Self::Day),
6390 "week" => Ok(Self::Week),
6391 "month" => Ok(Self::Month),
6392 "per_session" => Ok(Self::PerSession),
6393 _ => Err("invalid value".into()),
6394 }
6395 }
6396 }
6397 impl ::std::convert::TryFrom<&str> for QuotaPeriod {
6398 type Error = self::error::ConversionError;
6399 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
6400 value.parse()
6401 }
6402 }
6403 impl ::std::convert::TryFrom<&::std::string::String> for QuotaPeriod {
6404 type Error = self::error::ConversionError;
6405 fn try_from(
6406 value: &::std::string::String,
6407 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6408 value.parse()
6409 }
6410 }
6411 impl ::std::convert::TryFrom<::std::string::String> for QuotaPeriod {
6412 type Error = self::error::ConversionError;
6413 fn try_from(
6414 value: ::std::string::String,
6415 ) -> ::std::result::Result<Self, self::error::ConversionError> {
6416 value.parse()
6417 }
6418 }
6419 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6452 pub struct QuotaReport {
6453 pub items: ::std::vec::Vec<QuotaUsage>,
6454 pub org_id: ::std::string::String,
6455 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6456 pub tier_slug: ::std::option::Option<::std::string::String>,
6457 }
6458 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6511 pub struct QuotaUsage {
6512 pub current: i64,
6513 pub key: QuotaKey,
6514 pub limit: EffectiveLimit,
6515 pub period: QuotaPeriod,
6516 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6518 pub period_end: ::std::option::Option<::std::string::String>,
6519 pub period_label: ::std::string::String,
6521 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6523 pub period_start: ::std::option::Option<::std::string::String>,
6524 }
6525 #[derive(
6537 ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
6538 )]
6539 #[serde(transparent)]
6540 pub struct Role(pub ::std::string::String);
6541 impl ::std::ops::Deref for Role {
6542 type Target = ::std::string::String;
6543 fn deref(&self) -> &::std::string::String {
6544 &self.0
6545 }
6546 }
6547 impl ::std::convert::From<Role> for ::std::string::String {
6548 fn from(value: Role) -> Self {
6549 value.0
6550 }
6551 }
6552 impl ::std::convert::From<::std::string::String> for Role {
6553 fn from(value: ::std::string::String) -> Self {
6554 Self(value)
6555 }
6556 }
6557 impl ::std::str::FromStr for Role {
6558 type Err = ::std::convert::Infallible;
6559 fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
6560 Ok(Self(value.to_string()))
6561 }
6562 }
6563 impl ::std::fmt::Display for Role {
6564 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
6565 self.0.fmt(f)
6566 }
6567 }
6568 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6617 pub struct SearchUsersQuery {
6618 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6620 pub exclude_ids: ::std::option::Option<::std::string::String>,
6621 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6622 pub limit: ::std::option::Option<u64>,
6623 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6624 pub offset: ::std::option::Option<u64>,
6625 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6627 pub org_id: ::std::option::Option<::std::string::String>,
6628 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6630 pub q: ::std::option::Option<::std::string::String>,
6631 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6633 pub scope: ::std::option::Option<::std::string::String>,
6634 }
6635 impl ::std::default::Default for SearchUsersQuery {
6636 fn default() -> Self {
6637 Self {
6638 exclude_ids: Default::default(),
6639 limit: Default::default(),
6640 offset: Default::default(),
6641 org_id: Default::default(),
6642 q: Default::default(),
6643 scope: Default::default(),
6644 }
6645 }
6646 }
6647 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6669 pub struct SetDoorRestrictionsPayload {
6670 pub apartment_entity_ids: ::std::vec::Vec<::std::string::String>,
6671 }
6672 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6699 pub struct SingleResourceOutputOptions {
6700 pub include_deleted: bool,
6702 pub include_metadata: bool,
6704 }
6705 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6730 pub struct SingleResourceOutputOptionsQuery {
6731 pub include_deleted: bool,
6732 pub include_metadata: bool,
6733 }
6734 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6796 pub struct StorageFeatures {
6797 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6798 pub cache_hit: ::std::option::Option<bool>,
6799 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6800 pub cache_ttl: ::std::option::Option<i64>,
6801 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6802 pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
6803 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6804 pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
6805 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6806 pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
6807 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6808 pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
6809 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6810 pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
6811 }
6812 impl ::std::default::Default for StorageFeatures {
6813 fn default() -> Self {
6814 Self {
6815 cache_hit: Default::default(),
6816 cache_ttl: Default::default(),
6817 created_at: Default::default(),
6818 deleted_at: Default::default(),
6819 hard_delete_at: Default::default(),
6820 purge_at: Default::default(),
6821 updated_at: Default::default(),
6822 }
6823 }
6824 }
6825 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6857 pub struct SubscriptionRef {
6858 pub external_id: ::std::string::String,
6859 pub provider: ::std::string::String,
6860 pub status: ::std::string::String,
6861 pub tier_slug: ::std::string::String,
6862 }
6863 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
6940 pub struct UpdateAccessInviteRequest {
6941 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6942 pub disabled_justification: ::std::option::Option<::std::string::String>,
6943 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6944 pub expires_in: ::std::option::Option<::std::string::String>,
6945 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6946 pub invite_recurrence: ::std::option::Option<::serde_json::Value>,
6947 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6948 pub invitee_message: ::std::option::Option<::serde_json::Value>,
6949 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6950 pub is_enabled: ::std::option::Option<bool>,
6951 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6952 pub max_uses: ::std::option::Option<i32>,
6953 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6954 pub name: ::std::option::Option<::std::string::String>,
6955 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6956 pub portal_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
6957 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6960 pub schedules: ::std::option::Option<::std::vec::Vec<InviteScheduleEntryInput>>,
6961 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6962 pub valid_from: ::std::option::Option<::std::string::String>,
6963 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
6964 pub valid_to: ::std::option::Option<::std::string::String>,
6965 }
6966 impl ::std::default::Default for UpdateAccessInviteRequest {
6967 fn default() -> Self {
6968 Self {
6969 disabled_justification: Default::default(),
6970 expires_in: Default::default(),
6971 invite_recurrence: Default::default(),
6972 invitee_message: Default::default(),
6973 is_enabled: Default::default(),
6974 max_uses: Default::default(),
6975 name: Default::default(),
6976 portal_ids: Default::default(),
6977 schedules: Default::default(),
6978 valid_from: Default::default(),
6979 valid_to: Default::default(),
6980 }
6981 }
6982 }
6983 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7017 pub struct UpdateAccessPortalRequest {
7018 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7020 pub device_external_id: ::std::option::Option<::std::string::String>,
7021 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7022 pub name: ::std::option::Option<LocalizedString>,
7023 }
7024 impl ::std::default::Default for UpdateAccessPortalRequest {
7025 fn default() -> Self {
7026 Self {
7027 device_external_id: Default::default(),
7028 name: Default::default(),
7029 }
7030 }
7031 }
7032 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7065 pub struct UpdateApiKeyRequest {
7066 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7068 pub expires_at: ::std::option::Option<::std::string::String>,
7069 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7071 pub expires_in: ::std::option::Option<::std::string::String>,
7072 pub name: ::std::string::String,
7073 }
7074 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7108 pub struct UpdateDeviceRequest {
7109 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7110 pub device_metadata: ::std::option::Option<::serde_json::Value>,
7111 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7112 pub external_id: ::std::option::Option<::std::string::String>,
7113 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7114 pub name: ::std::option::Option<LocalizedString>,
7115 }
7116 impl ::std::default::Default for UpdateDeviceRequest {
7117 fn default() -> Self {
7118 Self {
7119 device_metadata: Default::default(),
7120 external_id: Default::default(),
7121 name: Default::default(),
7122 }
7123 }
7124 }
7125 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7178 pub struct UpdateEntityRequest {
7179 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7180 pub channel_index: ::std::option::Option<i32>,
7181 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7182 pub entity_type: ::std::option::Option<::std::string::String>,
7183 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7184 pub external_id: ::std::option::Option<::std::string::String>,
7185 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7191 pub metadata:
7192 ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
7193 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7199 pub name: ::std::option::Option<::std::string::String>,
7200 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7201 pub zone_id: ::std::option::Option<::std::string::String>,
7202 }
7203 impl ::std::default::Default for UpdateEntityRequest {
7204 fn default() -> Self {
7205 Self {
7206 channel_index: Default::default(),
7207 entity_type: Default::default(),
7208 external_id: Default::default(),
7209 metadata: Default::default(),
7210 name: Default::default(),
7211 zone_id: Default::default(),
7212 }
7213 }
7214 }
7215 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7260 pub struct UpdateIntegrationRequest {
7261 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7266 pub config: ::std::option::Option<::serde_json::Value>,
7267 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7268 pub enabled: ::std::option::Option<bool>,
7269 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7270 pub name: ::std::option::Option<LocalizedString>,
7271 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7272 pub provider_type: ::std::option::Option<::std::string::String>,
7273 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7278 pub secrets: ::std::option::Option<::serde_json::Value>,
7279 }
7280 impl ::std::default::Default for UpdateIntegrationRequest {
7281 fn default() -> Self {
7282 Self {
7283 config: Default::default(),
7284 enabled: Default::default(),
7285 name: Default::default(),
7286 provider_type: Default::default(),
7287 secrets: Default::default(),
7288 }
7289 }
7290 }
7291 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7324 pub struct UpdateOrganizationRequest {
7325 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7326 pub description: ::std::option::Option<::std::string::String>,
7327 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7328 pub name: ::std::option::Option<LocalizedString>,
7329 }
7330 impl ::std::default::Default for UpdateOrganizationRequest {
7331 fn default() -> Self {
7332 Self {
7333 description: Default::default(),
7334 name: Default::default(),
7335 }
7336 }
7337 }
7338 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7377 pub struct UpdateUserRequest {
7378 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7379 pub email: ::std::option::Option<::std::string::String>,
7380 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7381 pub id: ::std::option::Option<::std::string::String>,
7382 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7383 pub name: ::std::option::Option<LocalizedString>,
7384 }
7385 impl ::std::default::Default for UpdateUserRequest {
7386 fn default() -> Self {
7387 Self {
7388 email: Default::default(),
7389 id: Default::default(),
7390 name: Default::default(),
7391 }
7392 }
7393 }
7394 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7433 pub struct UpdateZoneRequest {
7434 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7435 pub external_id: ::std::option::Option<::std::string::String>,
7436 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7437 pub name: ::std::option::Option<LocalizedString>,
7438 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7439 pub parent_zone_id: ::std::option::Option<::std::string::String>,
7440 }
7441 impl ::std::default::Default for UpdateZoneRequest {
7442 fn default() -> Self {
7443 Self {
7444 external_id: Default::default(),
7445 name: Default::default(),
7446 parent_zone_id: Default::default(),
7447 }
7448 }
7449 }
7450 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7494 pub struct User {
7495 pub email: ::std::string::String,
7497 pub id: ::std::string::String,
7499 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7500 pub metadata: ::std::option::Option<HashMap>,
7501 pub name: LocalizedString,
7502 }
7503 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7549 pub struct UserResponse {
7550 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7551 pub cache_hit: ::std::option::Option<bool>,
7552 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7553 pub cache_ttl: ::std::option::Option<i64>,
7554 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7555 pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
7556 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7557 pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
7558 pub email: ::std::string::String,
7560 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7561 pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
7562 pub id: ::std::string::String,
7564 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7565 pub metadata: ::std::option::Option<HashMap>,
7566 pub name: LocalizedString,
7567 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7568 pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
7569 pub roles: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
7570 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7571 pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
7572 }
7573 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7633 pub struct Zone {
7634 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7636 pub external_id: ::std::option::Option<::std::string::String>,
7637 pub id: ::std::string::String,
7639 pub integration_id: ::std::string::String,
7641 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7642 pub metadata: ::std::option::Option<HashMap>,
7643 pub name: LocalizedString,
7644 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7646 pub parent_zone_id: ::std::option::Option<::std::string::String>,
7647 }
7648 #[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
7677 pub struct ZoneResponse {
7678 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7679 pub cache_hit: ::std::option::Option<bool>,
7680 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7681 pub cache_ttl: ::std::option::Option<i64>,
7682 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7683 pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
7684 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7685 pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
7686 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7688 pub external_id: ::std::option::Option<::std::string::String>,
7689 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7690 pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
7691 pub id: ::std::string::String,
7693 pub integration_id: ::std::string::String,
7695 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7696 pub metadata: ::std::option::Option<HashMap>,
7697 pub name: LocalizedString,
7698 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7700 pub parent_zone_id: ::std::option::Option<::std::string::String>,
7701 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7702 pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
7703 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
7704 pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
7705 }
7706}
7707#[derive(Clone, Debug)]
7708pub struct Client {
7714 pub(crate) baseurl: String,
7715 pub(crate) client: reqwest::Client,
7716}
7717impl Client {
7718 pub fn new(baseurl: &str) -> Self {
7724 #[cfg(not(target_arch = "wasm32"))]
7725 let client = {
7726 let dur = ::std::time::Duration::from_secs(15u64);
7727 reqwest::ClientBuilder::new()
7728 .connect_timeout(dur)
7729 .timeout(dur)
7730 };
7731 #[cfg(target_arch = "wasm32")]
7732 let client = reqwest::ClientBuilder::new();
7733 Self::new_with_client(baseurl, client.build().unwrap())
7734 }
7735 pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self {
7742 Self {
7743 baseurl: baseurl.to_string(),
7744 client,
7745 }
7746 }
7747}
7748impl ClientInfo<()> for Client {
7749 fn api_version() -> &'static str {
7750 "v1"
7751 }
7752 fn baseurl(&self) -> &str {
7753 self.baseurl.as_str()
7754 }
7755 fn client(&self) -> &reqwest::Client {
7756 &self.client
7757 }
7758 fn inner(&self) -> &() {
7759 &()
7760 }
7761}
7762impl ClientHooks<()> for &Client {}
7763#[allow(clippy::all)]
7764impl Client {
7765 pub async fn get_admin_quota_overrides<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>> {
7769 let url = format!("{}/admin/quota_overrides", self.baseurl,);
7770 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7771 header_map.append(
7772 ::reqwest::header::HeaderName::from_static("api-version"),
7773 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7774 );
7775 #[allow(unused_mut)]
7776 let mut request = self.client.get(url).headers(header_map).build()?;
7777 let info = OperationInfo {
7778 operation_id: "get_admin_quota_overrides",
7779 };
7780 self.pre(&mut request, &info).await?;
7781 let result = self.exec(request, &info).await;
7782 self.post(&result, &info).await?;
7783 let response = result?;
7784 match response.status().as_u16() {
7785 200u16 => Ok(ResponseValue::empty(response)),
7786 _ => Err(Error::UnexpectedResponse(response)),
7787 }
7788 }
7789 pub async fn post_admin_quota_override<'a>(
7793 &'a self,
7794 body: &'a types::QuotaOverrideRequest,
7795 ) -> Result<ResponseValue<()>, Error<()>> {
7796 let url = format!("{}/admin/quota_overrides", self.baseurl,);
7797 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7798 header_map.append(
7799 ::reqwest::header::HeaderName::from_static("api-version"),
7800 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7801 );
7802 #[allow(unused_mut)]
7803 let mut request = self
7804 .client
7805 .post(url)
7806 .json(&body)
7807 .headers(header_map)
7808 .build()?;
7809 let info = OperationInfo {
7810 operation_id: "post_admin_quota_override",
7811 };
7812 self.pre(&mut request, &info).await?;
7813 let result = self.exec(request, &info).await;
7814 self.post(&result, &info).await?;
7815 let response = result?;
7816 match response.status().as_u16() {
7817 200u16 => Ok(ResponseValue::empty(response)),
7818 _ => Err(Error::UnexpectedResponse(response)),
7819 }
7820 }
7821 pub async fn list_api_keys<'a>(
7825 &'a self,
7826 ) -> Result<ResponseValue<::std::vec::Vec<types::ApiKeyListItem>>, Error<()>> {
7827 let url = format!("{}/api-keys", self.baseurl,);
7828 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7829 header_map.append(
7830 ::reqwest::header::HeaderName::from_static("api-version"),
7831 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7832 );
7833 #[allow(unused_mut)]
7834 let mut request = self
7835 .client
7836 .get(url)
7837 .header(
7838 ::reqwest::header::ACCEPT,
7839 ::reqwest::header::HeaderValue::from_static("application/json"),
7840 )
7841 .headers(header_map)
7842 .build()?;
7843 let info = OperationInfo {
7844 operation_id: "list_api_keys",
7845 };
7846 self.pre(&mut request, &info).await?;
7847 let result = self.exec(request, &info).await;
7848 self.post(&result, &info).await?;
7849 let response = result?;
7850 match response.status().as_u16() {
7851 200u16 => ResponseValue::from_response(response).await,
7852 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7853 500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7854 _ => Err(Error::UnexpectedResponse(response)),
7855 }
7856 }
7857 pub async fn create_api_key<'a>(
7861 &'a self,
7862 body: &'a types::CreateApiKeyRequest,
7863 ) -> Result<ResponseValue<types::CreateApiKeyResponse>, Error<()>> {
7864 let url = format!("{}/api-keys", self.baseurl,);
7865 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7866 header_map.append(
7867 ::reqwest::header::HeaderName::from_static("api-version"),
7868 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7869 );
7870 #[allow(unused_mut)]
7871 let mut request = self
7872 .client
7873 .post(url)
7874 .header(
7875 ::reqwest::header::ACCEPT,
7876 ::reqwest::header::HeaderValue::from_static("application/json"),
7877 )
7878 .json(&body)
7879 .headers(header_map)
7880 .build()?;
7881 let info = OperationInfo {
7882 operation_id: "create_api_key",
7883 };
7884 self.pre(&mut request, &info).await?;
7885 let result = self.exec(request, &info).await;
7886 self.post(&result, &info).await?;
7887 let response = result?;
7888 match response.status().as_u16() {
7889 201u16 => ResponseValue::from_response(response).await,
7890 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7891 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7892 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7893 500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7894 _ => Err(Error::UnexpectedResponse(response)),
7895 }
7896 }
7897 pub async fn revoke_api_key<'a>(&'a self, id: &'a str) -> Result<ResponseValue<()>, Error<()>> {
7903 let url = format!("{}/api-keys/{}", self.baseurl, encode_path(&id.to_string()),);
7904 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7905 header_map.append(
7906 ::reqwest::header::HeaderName::from_static("api-version"),
7907 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7908 );
7909 #[allow(unused_mut)]
7910 let mut request = self.client.delete(url).headers(header_map).build()?;
7911 let info = OperationInfo {
7912 operation_id: "revoke_api_key",
7913 };
7914 self.pre(&mut request, &info).await?;
7915 let result = self.exec(request, &info).await;
7916 self.post(&result, &info).await?;
7917 let response = result?;
7918 match response.status().as_u16() {
7919 204u16 => Ok(ResponseValue::empty(response)),
7920 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7921 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7922 500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7923 _ => Err(Error::UnexpectedResponse(response)),
7924 }
7925 }
7926 pub async fn update_api_key<'a>(
7933 &'a self,
7934 id: &'a str,
7935 body: &'a types::UpdateApiKeyRequest,
7936 ) -> Result<ResponseValue<()>, Error<()>> {
7937 let url = format!("{}/api-keys/{}", self.baseurl, encode_path(&id.to_string()),);
7938 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7939 header_map.append(
7940 ::reqwest::header::HeaderName::from_static("api-version"),
7941 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7942 );
7943 #[allow(unused_mut)]
7944 let mut request = self
7945 .client
7946 .patch(url)
7947 .json(&body)
7948 .headers(header_map)
7949 .build()?;
7950 let info = OperationInfo {
7951 operation_id: "update_api_key",
7952 };
7953 self.pre(&mut request, &info).await?;
7954 let result = self.exec(request, &info).await;
7955 self.post(&result, &info).await?;
7956 let response = result?;
7957 match response.status().as_u16() {
7958 204u16 => Ok(ResponseValue::empty(response)),
7959 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7960 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7961 500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7962 _ => Err(Error::UnexpectedResponse(response)),
7963 }
7964 }
7965 pub async fn purge_api_key<'a>(&'a self, id: &'a str) -> Result<ResponseValue<()>, Error<()>> {
7971 let url = format!(
7972 "{}/api-keys/{}/purge",
7973 self.baseurl,
7974 encode_path(&id.to_string()),
7975 );
7976 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7977 header_map.append(
7978 ::reqwest::header::HeaderName::from_static("api-version"),
7979 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7980 );
7981 #[allow(unused_mut)]
7982 let mut request = self.client.delete(url).headers(header_map).build()?;
7983 let info = OperationInfo {
7984 operation_id: "purge_api_key",
7985 };
7986 self.pre(&mut request, &info).await?;
7987 let result = self.exec(request, &info).await;
7988 self.post(&result, &info).await?;
7989 let response = result?;
7990 match response.status().as_u16() {
7991 204u16 => Ok(ResponseValue::empty(response)),
7992 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7993 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7994 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7995 409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7996 500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
7997 _ => Err(Error::UnexpectedResponse(response)),
7998 }
7999 }
8000 pub async fn restore_api_key<'a>(
8006 &'a self,
8007 id: &'a str,
8008 ) -> Result<ResponseValue<()>, Error<()>> {
8009 let url = format!(
8010 "{}/api-keys/{}/restore",
8011 self.baseurl,
8012 encode_path(&id.to_string()),
8013 );
8014 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8015 header_map.append(
8016 ::reqwest::header::HeaderName::from_static("api-version"),
8017 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8018 );
8019 #[allow(unused_mut)]
8020 let mut request = self.client.post(url).headers(header_map).build()?;
8021 let info = OperationInfo {
8022 operation_id: "restore_api_key",
8023 };
8024 self.pre(&mut request, &info).await?;
8025 let result = self.exec(request, &info).await;
8026 self.post(&result, &info).await?;
8027 let response = result?;
8028 match response.status().as_u16() {
8029 204u16 => Ok(ResponseValue::empty(response)),
8030 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8031 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8032 409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8033 500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8034 _ => Err(Error::UnexpectedResponse(response)),
8035 }
8036 }
8037 pub async fn get_auth_kratos_identity<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>> {
8044 let url = format!("{}/auth/kratos-identity", self.baseurl,);
8045 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8046 header_map.append(
8047 ::reqwest::header::HeaderName::from_static("api-version"),
8048 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8049 );
8050 #[allow(unused_mut)]
8051 let mut request = self.client.get(url).headers(header_map).build()?;
8052 let info = OperationInfo {
8053 operation_id: "get_auth_kratos_identity",
8054 };
8055 self.pre(&mut request, &info).await?;
8056 let result = self.exec(request, &info).await;
8057 self.post(&result, &info).await?;
8058 let response = result?;
8059 match response.status().as_u16() {
8060 200u16 => Ok(ResponseValue::empty(response)),
8061 _ => Err(Error::UnexpectedResponse(response)),
8062 }
8063 }
8064 pub async fn post_auth_logout<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>> {
8070 let url = format!("{}/auth/logout", self.baseurl,);
8071 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8072 header_map.append(
8073 ::reqwest::header::HeaderName::from_static("api-version"),
8074 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8075 );
8076 #[allow(unused_mut)]
8077 let mut request = self.client.post(url).headers(header_map).build()?;
8078 let info = OperationInfo {
8079 operation_id: "post_auth_logout",
8080 };
8081 self.pre(&mut request, &info).await?;
8082 let result = self.exec(request, &info).await;
8083 self.post(&result, &info).await?;
8084 let response = result?;
8085 match response.status().as_u16() {
8086 204u16 => Ok(ResponseValue::empty(response)),
8087 _ => Err(Error::UnexpectedResponse(response)),
8088 }
8089 }
8090 pub async fn get_auth_provisioned<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>> {
8097 let url = format!("{}/auth/provisioned", self.baseurl,);
8098 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8099 header_map.append(
8100 ::reqwest::header::HeaderName::from_static("api-version"),
8101 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8102 );
8103 #[allow(unused_mut)]
8104 let mut request = self.client.get(url).headers(header_map).build()?;
8105 let info = OperationInfo {
8106 operation_id: "get_auth_provisioned",
8107 };
8108 self.pre(&mut request, &info).await?;
8109 let result = self.exec(request, &info).await;
8110 self.post(&result, &info).await?;
8111 let response = result?;
8112 match response.status().as_u16() {
8113 204u16 => Ok(ResponseValue::empty(response)),
8114 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8115 _ => Err(Error::UnexpectedResponse(response)),
8116 }
8117 }
8118 pub async fn get_auth_session<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>> {
8124 let url = format!("{}/auth/session", self.baseurl,);
8125 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8126 header_map.append(
8127 ::reqwest::header::HeaderName::from_static("api-version"),
8128 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8129 );
8130 #[allow(unused_mut)]
8131 let mut request = self.client.get(url).headers(header_map).build()?;
8132 let info = OperationInfo {
8133 operation_id: "get_auth_session",
8134 };
8135 self.pre(&mut request, &info).await?;
8136 let result = self.exec(request, &info).await;
8137 self.post(&result, &info).await?;
8138 let response = result?;
8139 match response.status().as_u16() {
8140 200u16 => Ok(ResponseValue::empty(response)),
8141 _ => Err(Error::UnexpectedResponse(response)),
8142 }
8143 }
8144 pub async fn post_auth_sign_out<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>> {
8148 let url = format!("{}/auth/sign-out", self.baseurl,);
8149 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8150 header_map.append(
8151 ::reqwest::header::HeaderName::from_static("api-version"),
8152 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8153 );
8154 #[allow(unused_mut)]
8155 let mut request = self.client.post(url).headers(header_map).build()?;
8156 let info = OperationInfo {
8157 operation_id: "post_auth_sign_out",
8158 };
8159 self.pre(&mut request, &info).await?;
8160 let result = self.exec(request, &info).await;
8161 self.post(&result, &info).await?;
8162 let response = result?;
8163 match response.status().as_u16() {
8164 204u16 => Ok(ResponseValue::empty(response)),
8165 _ => Err(Error::UnexpectedResponse(response)),
8166 }
8167 }
8168 pub async fn get_auth_whoami<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>> {
8172 let url = format!("{}/auth/whoami", self.baseurl,);
8173 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8174 header_map.append(
8175 ::reqwest::header::HeaderName::from_static("api-version"),
8176 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8177 );
8178 #[allow(unused_mut)]
8179 let mut request = self.client.get(url).headers(header_map).build()?;
8180 let info = OperationInfo {
8181 operation_id: "get_auth_whoami",
8182 };
8183 self.pre(&mut request, &info).await?;
8184 let result = self.exec(request, &info).await;
8185 self.post(&result, &info).await?;
8186 let response = result?;
8187 match response.status().as_u16() {
8188 200u16 => Ok(ResponseValue::empty(response)),
8189 _ => Err(Error::UnexpectedResponse(response)),
8190 }
8191 }
8192 pub async fn post_billing_webhook<'a, B: Into<reqwest::Body>>(
8199 &'a self,
8200 provider: &'a str,
8201 body: B,
8202 ) -> Result<ResponseValue<types::BillingWebhookResponse>, Error<()>> {
8203 let url = format!(
8204 "{}/billing/webhooks/{}",
8205 self.baseurl,
8206 encode_path(&provider.to_string()),
8207 );
8208 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8209 header_map.append(
8210 ::reqwest::header::HeaderName::from_static("api-version"),
8211 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8212 );
8213 #[allow(unused_mut)]
8214 let mut request = self
8215 .client
8216 .post(url)
8217 .header(
8218 ::reqwest::header::ACCEPT,
8219 ::reqwest::header::HeaderValue::from_static("application/json"),
8220 )
8221 .header(
8222 ::reqwest::header::CONTENT_TYPE,
8223 ::reqwest::header::HeaderValue::from_static("application/octet-stream"),
8224 )
8225 .body(body)
8226 .headers(header_map)
8227 .build()?;
8228 let info = OperationInfo {
8229 operation_id: "post_billing_webhook",
8230 };
8231 self.pre(&mut request, &info).await?;
8232 let result = self.exec(request, &info).await;
8233 self.post(&result, &info).await?;
8234 let response = result?;
8235 match response.status().as_u16() {
8236 200u16 => ResponseValue::from_response(response).await,
8237 _ => Err(Error::UnexpectedResponse(response)),
8238 }
8239 }
8240 pub async fn list_devices<'a>(
8262 &'a self,
8263 device_kind: Option<&'a str>,
8264 external_id: Option<&'a str>,
8265 has_external_id: Option<bool>,
8266 has_go2rtc_channel: Option<bool>,
8267 include_deleted: bool,
8268 include_metadata: bool,
8269 include_stale: Option<bool>,
8270 integration_id: Option<&'a str>,
8271 limit: Option<i32>,
8272 offset: Option<i32>,
8273 only_deleted: bool,
8274 q: Option<&'a str>,
8275 x_org: &'a str,
8276 ) -> Result<ResponseValue<::std::vec::Vec<types::DeviceResponse>>, Error<types::ApiErrorResponse>>
8277 {
8278 let url = format!("{}/devices", self.baseurl,);
8279 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
8280 header_map.append(
8281 ::reqwest::header::HeaderName::from_static("api-version"),
8282 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8283 );
8284 header_map.append("X-Org", x_org.to_string().try_into()?);
8285 #[allow(unused_mut)]
8286 let mut request = self
8287 .client
8288 .get(url)
8289 .header(
8290 ::reqwest::header::ACCEPT,
8291 ::reqwest::header::HeaderValue::from_static("application/json"),
8292 )
8293 .query(&progenitor_client::QueryParam::new(
8294 "device_kind",
8295 &device_kind,
8296 ))
8297 .query(&progenitor_client::QueryParam::new(
8298 "external_id",
8299 &external_id,
8300 ))
8301 .query(&progenitor_client::QueryParam::new(
8302 "has_external_id",
8303 &has_external_id,
8304 ))
8305 .query(&progenitor_client::QueryParam::new(
8306 "has_go2rtc_channel",
8307 &has_go2rtc_channel,
8308 ))
8309 .query(&progenitor_client::QueryParam::new(
8310 "include_deleted",
8311 &include_deleted,
8312 ))
8313 .query(&progenitor_client::QueryParam::new(
8314 "include_metadata",
8315 &include_metadata,
8316 ))
8317 .query(&progenitor_client::QueryParam::new(
8318 "include_stale",
8319 &include_stale,
8320 ))
8321 .query(&progenitor_client::QueryParam::new(
8322 "integration_id",
8323 &integration_id,
8324 ))
8325 .query(&progenitor_client::QueryParam::new("limit", &limit))
8326 .query(&progenitor_client::QueryParam::new("offset", &offset))
8327 .query(&progenitor_client::QueryParam::new(
8328 "only_deleted",
8329 &only_deleted,
8330 ))
8331 .query(&progenitor_client::QueryParam::new("q", &q))
8332 .headers(header_map)
8333 .build()?;
8334 let info = OperationInfo {
8335 operation_id: "list_devices",
8336 };
8337 self.pre(&mut request, &info).await?;
8338 let result = self.exec(request, &info).await;
8339 self.post(&result, &info).await?;
8340 let response = result?;
8341 match response.status().as_u16() {
8342 200u16 => ResponseValue::from_response(response).await,
8343 401u16 => Err(Error::ErrorResponse(
8344 ResponseValue::from_response(response).await?,
8345 )),
8346 403u16 => Err(Error::ErrorResponse(
8347 ResponseValue::from_response(response).await?,
8348 )),
8349 500u16 => Err(Error::ErrorResponse(
8350 ResponseValue::from_response(response).await?,
8351 )),
8352 _ => Err(Error::UnexpectedResponse(response)),
8353 }
8354 }
8355 pub async fn create_device<'a>(
8366 &'a self,
8367 include_deleted: Option<bool>,
8368 include_metadata: Option<bool>,
8369 x_org: &'a str,
8370 body: &'a types::CreateDeviceRequest,
8371 ) -> Result<ResponseValue<types::DeviceResponse>, Error<types::ApiErrorResponse>> {
8372 let url = format!("{}/devices", self.baseurl,);
8373 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
8374 header_map.append(
8375 ::reqwest::header::HeaderName::from_static("api-version"),
8376 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8377 );
8378 header_map.append("X-Org", x_org.to_string().try_into()?);
8379 #[allow(unused_mut)]
8380 let mut request = self
8381 .client
8382 .post(url)
8383 .header(
8384 ::reqwest::header::ACCEPT,
8385 ::reqwest::header::HeaderValue::from_static("application/json"),
8386 )
8387 .json(&body)
8388 .query(&progenitor_client::QueryParam::new(
8389 "include_deleted",
8390 &include_deleted,
8391 ))
8392 .query(&progenitor_client::QueryParam::new(
8393 "include_metadata",
8394 &include_metadata,
8395 ))
8396 .headers(header_map)
8397 .build()?;
8398 let info = OperationInfo {
8399 operation_id: "create_device",
8400 };
8401 self.pre(&mut request, &info).await?;
8402 let result = self.exec(request, &info).await;
8403 self.post(&result, &info).await?;
8404 let response = result?;
8405 match response.status().as_u16() {
8406 200u16 => ResponseValue::from_response(response).await,
8407 400u16 => Err(Error::ErrorResponse(
8408 ResponseValue::from_response(response).await?,
8409 )),
8410 401u16 => Err(Error::ErrorResponse(
8411 ResponseValue::from_response(response).await?,
8412 )),
8413 403u16 => Err(Error::ErrorResponse(
8414 ResponseValue::from_response(response).await?,
8415 )),
8416 422u16 => Err(Error::ErrorResponse(
8417 ResponseValue::from_response(response).await?,
8418 )),
8419 500u16 => Err(Error::ErrorResponse(
8420 ResponseValue::from_response(response).await?,
8421 )),
8422 _ => Err(Error::UnexpectedResponse(response)),
8423 }
8424 }
8425 pub async fn list_device_apartment_floors<'a>(
8429 &'a self,
8430 device_id: &'a str,
8431 x_org: &'a str,
8432 ) -> Result<ResponseValue<types::ApartmentFloorListResponse>, Error<types::ApiErrorResponse>>
8433 {
8434 let url = format!(
8435 "{}/devices/{}/apartment-floors",
8436 self.baseurl,
8437 encode_path(&device_id.to_string()),
8438 );
8439 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
8440 header_map.append(
8441 ::reqwest::header::HeaderName::from_static("api-version"),
8442 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8443 );
8444 header_map.append("X-Org", x_org.to_string().try_into()?);
8445 #[allow(unused_mut)]
8446 let mut request = self
8447 .client
8448 .get(url)
8449 .header(
8450 ::reqwest::header::ACCEPT,
8451 ::reqwest::header::HeaderValue::from_static("application/json"),
8452 )
8453 .headers(header_map)
8454 .build()?;
8455 let info = OperationInfo {
8456 operation_id: "list_device_apartment_floors",
8457 };
8458 self.pre(&mut request, &info).await?;
8459 let result = self.exec(request, &info).await;
8460 self.post(&result, &info).await?;
8461 let response = result?;
8462 match response.status().as_u16() {
8463 200u16 => ResponseValue::from_response(response).await,
8464 400u16 => Err(Error::ErrorResponse(
8465 ResponseValue::from_response(response).await?,
8466 )),
8467 401u16 => Err(Error::ErrorResponse(
8468 ResponseValue::from_response(response).await?,
8469 )),
8470 403u16 => Err(Error::ErrorResponse(
8471 ResponseValue::from_response(response).await?,
8472 )),
8473 500u16 => Err(Error::ErrorResponse(
8474 ResponseValue::from_response(response).await?,
8475 )),
8476 _ => Err(Error::UnexpectedResponse(response)),
8477 }
8478 }
8479 pub async fn list_device_entities<'a>(
8494 &'a self,
8495 device_id: &'a str,
8496 entity_type: Option<&'a str>,
8497 include_deleted: Option<bool>,
8498 include_metadata: Option<bool>,
8499 limit: Option<i32>,
8500 offset: Option<i32>,
8501 only_deleted: Option<bool>,
8502 x_org: &'a str,
8503 ) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
8504 let url = format!(
8505 "{}/devices/{}/entities",
8506 self.baseurl,
8507 encode_path(&device_id.to_string()),
8508 );
8509 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
8510 header_map.append(
8511 ::reqwest::header::HeaderName::from_static("api-version"),
8512 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8513 );
8514 header_map.append("X-Org", x_org.to_string().try_into()?);
8515 #[allow(unused_mut)]
8516 let mut request = self
8517 .client
8518 .get(url)
8519 .header(
8520 ::reqwest::header::ACCEPT,
8521 ::reqwest::header::HeaderValue::from_static("application/json"),
8522 )
8523 .query(&progenitor_client::QueryParam::new(
8524 "entity_type",
8525 &entity_type,
8526 ))
8527 .query(&progenitor_client::QueryParam::new(
8528 "include_deleted",
8529 &include_deleted,
8530 ))
8531 .query(&progenitor_client::QueryParam::new(
8532 "include_metadata",
8533 &include_metadata,
8534 ))
8535 .query(&progenitor_client::QueryParam::new("limit", &limit))
8536 .query(&progenitor_client::QueryParam::new("offset", &offset))
8537 .query(&progenitor_client::QueryParam::new(
8538 "only_deleted",
8539 &only_deleted,
8540 ))
8541 .headers(header_map)
8542 .build()?;
8543 let info = OperationInfo {
8544 operation_id: "list_device_entities",
8545 };
8546 self.pre(&mut request, &info).await?;
8547 let result = self.exec(request, &info).await;
8548 self.post(&result, &info).await?;
8549 let response = result?;
8550 match response.status().as_u16() {
8551 200u16 => ResponseValue::from_response(response).await,
8552 400u16 => Err(Error::ErrorResponse(
8553 ResponseValue::from_response(response).await?,
8554 )),
8555 401u16 => Err(Error::ErrorResponse(
8556 ResponseValue::from_response(response).await?,
8557 )),
8558 403u16 => Err(Error::ErrorResponse(
8559 ResponseValue::from_response(response).await?,
8560 )),
8561 500u16 => Err(Error::ErrorResponse(
8562 ResponseValue::from_response(response).await?,
8563 )),
8564 _ => Err(Error::UnexpectedResponse(response)),
8565 }
8566 }
8567 pub async fn get_device_entity_metadata_definition<'a>(
8573 &'a self,
8574 device_id: &'a str,
8575 entity_type: &'a str,
8576 x_org: &'a str,
8577 ) -> Result<ResponseValue<types::EntityMetadataDefinitionResponse>, Error<()>> {
8578 let url = format!(
8579 "{}/devices/{}/entities/metadata-definition",
8580 self.baseurl,
8581 encode_path(&device_id.to_string()),
8582 );
8583 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
8584 header_map.append(
8585 ::reqwest::header::HeaderName::from_static("api-version"),
8586 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8587 );
8588 header_map.append("X-Org", x_org.to_string().try_into()?);
8589 #[allow(unused_mut)]
8590 let mut request = self
8591 .client
8592 .get(url)
8593 .header(
8594 ::reqwest::header::ACCEPT,
8595 ::reqwest::header::HeaderValue::from_static("application/json"),
8596 )
8597 .query(&progenitor_client::QueryParam::new(
8598 "entity_type",
8599 &entity_type,
8600 ))
8601 .headers(header_map)
8602 .build()?;
8603 let info = OperationInfo {
8604 operation_id: "get_device_entity_metadata_definition",
8605 };
8606 self.pre(&mut request, &info).await?;
8607 let result = self.exec(request, &info).await;
8608 self.post(&result, &info).await?;
8609 let response = result?;
8610 match response.status().as_u16() {
8611 200u16 => ResponseValue::from_response(response).await,
8612 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8613 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8614 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8615 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8616 _ => Err(Error::UnexpectedResponse(response)),
8617 }
8618 }
8619 pub async fn get_device<'a>(
8631 &'a self,
8632 id: &'a str,
8633 include_deleted: bool,
8634 include_metadata: bool,
8635 include_stale: Option<bool>,
8636 x_org: &'a str,
8637 ) -> Result<ResponseValue<types::DeviceResponse>, Error<types::ApiErrorResponse>> {
8638 let url = format!("{}/devices/{}", self.baseurl, encode_path(&id.to_string()),);
8639 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
8640 header_map.append(
8641 ::reqwest::header::HeaderName::from_static("api-version"),
8642 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8643 );
8644 header_map.append("X-Org", x_org.to_string().try_into()?);
8645 #[allow(unused_mut)]
8646 let mut request = self
8647 .client
8648 .get(url)
8649 .header(
8650 ::reqwest::header::ACCEPT,
8651 ::reqwest::header::HeaderValue::from_static("application/json"),
8652 )
8653 .query(&progenitor_client::QueryParam::new(
8654 "include_deleted",
8655 &include_deleted,
8656 ))
8657 .query(&progenitor_client::QueryParam::new(
8658 "include_metadata",
8659 &include_metadata,
8660 ))
8661 .query(&progenitor_client::QueryParam::new(
8662 "include_stale",
8663 &include_stale,
8664 ))
8665 .headers(header_map)
8666 .build()?;
8667 let info = OperationInfo {
8668 operation_id: "get_device",
8669 };
8670 self.pre(&mut request, &info).await?;
8671 let result = self.exec(request, &info).await;
8672 self.post(&result, &info).await?;
8673 let response = result?;
8674 match response.status().as_u16() {
8675 200u16 => ResponseValue::from_response(response).await,
8676 400u16 => Err(Error::ErrorResponse(
8677 ResponseValue::from_response(response).await?,
8678 )),
8679 401u16 => Err(Error::ErrorResponse(
8680 ResponseValue::from_response(response).await?,
8681 )),
8682 403u16 => Err(Error::ErrorResponse(
8683 ResponseValue::from_response(response).await?,
8684 )),
8685 404u16 => Err(Error::ErrorResponse(
8686 ResponseValue::from_response(response).await?,
8687 )),
8688 500u16 => Err(Error::ErrorResponse(
8689 ResponseValue::from_response(response).await?,
8690 )),
8691 _ => Err(Error::UnexpectedResponse(response)),
8692 }
8693 }
8694 pub async fn update_device<'a>(
8700 &'a self,
8701 id: &'a str,
8702 include_deleted: Option<bool>,
8703 include_metadata: Option<bool>,
8704 x_org: &'a str,
8705 body: &'a types::UpdateDeviceRequest,
8706 ) -> Result<ResponseValue<types::DeviceResponse>, Error<types::ApiErrorResponse>> {
8707 let url = format!("{}/devices/{}", self.baseurl, encode_path(&id.to_string()),);
8708 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
8709 header_map.append(
8710 ::reqwest::header::HeaderName::from_static("api-version"),
8711 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8712 );
8713 header_map.append("X-Org", x_org.to_string().try_into()?);
8714 #[allow(unused_mut)]
8715 let mut request = self
8716 .client
8717 .put(url)
8718 .header(
8719 ::reqwest::header::ACCEPT,
8720 ::reqwest::header::HeaderValue::from_static("application/json"),
8721 )
8722 .json(&body)
8723 .query(&progenitor_client::QueryParam::new(
8724 "include_deleted",
8725 &include_deleted,
8726 ))
8727 .query(&progenitor_client::QueryParam::new(
8728 "include_metadata",
8729 &include_metadata,
8730 ))
8731 .headers(header_map)
8732 .build()?;
8733 let info = OperationInfo {
8734 operation_id: "update_device",
8735 };
8736 self.pre(&mut request, &info).await?;
8737 let result = self.exec(request, &info).await;
8738 self.post(&result, &info).await?;
8739 let response = result?;
8740 match response.status().as_u16() {
8741 200u16 => ResponseValue::from_response(response).await,
8742 400u16 => Err(Error::ErrorResponse(
8743 ResponseValue::from_response(response).await?,
8744 )),
8745 401u16 => Err(Error::ErrorResponse(
8746 ResponseValue::from_response(response).await?,
8747 )),
8748 403u16 => Err(Error::ErrorResponse(
8749 ResponseValue::from_response(response).await?,
8750 )),
8751 404u16 => Err(Error::ErrorResponse(
8752 ResponseValue::from_response(response).await?,
8753 )),
8754 500u16 => Err(Error::ErrorResponse(
8755 ResponseValue::from_response(response).await?,
8756 )),
8757 _ => Err(Error::UnexpectedResponse(response)),
8758 }
8759 }
8760 pub async fn delete_device<'a>(
8772 &'a self,
8773 id: &'a str,
8774 include_deleted: Option<bool>,
8775 include_metadata: Option<bool>,
8776 recursive: Option<bool>,
8777 x_org: &'a str,
8778 ) -> Result<ResponseValue<types::DeviceResponse>, Error<types::ApiErrorResponse>> {
8779 let url = format!("{}/devices/{}", self.baseurl, encode_path(&id.to_string()),);
8780 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
8781 header_map.append(
8782 ::reqwest::header::HeaderName::from_static("api-version"),
8783 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8784 );
8785 header_map.append("X-Org", x_org.to_string().try_into()?);
8786 #[allow(unused_mut)]
8787 let mut request = self
8788 .client
8789 .delete(url)
8790 .header(
8791 ::reqwest::header::ACCEPT,
8792 ::reqwest::header::HeaderValue::from_static("application/json"),
8793 )
8794 .query(&progenitor_client::QueryParam::new(
8795 "include_deleted",
8796 &include_deleted,
8797 ))
8798 .query(&progenitor_client::QueryParam::new(
8799 "include_metadata",
8800 &include_metadata,
8801 ))
8802 .query(&progenitor_client::QueryParam::new("recursive", &recursive))
8803 .headers(header_map)
8804 .build()?;
8805 let info = OperationInfo {
8806 operation_id: "delete_device",
8807 };
8808 self.pre(&mut request, &info).await?;
8809 let result = self.exec(request, &info).await;
8810 self.post(&result, &info).await?;
8811 let response = result?;
8812 match response.status().as_u16() {
8813 200u16 => ResponseValue::from_response(response).await,
8814 400u16 => Err(Error::ErrorResponse(
8815 ResponseValue::from_response(response).await?,
8816 )),
8817 401u16 => Err(Error::ErrorResponse(
8818 ResponseValue::from_response(response).await?,
8819 )),
8820 403u16 => Err(Error::ErrorResponse(
8821 ResponseValue::from_response(response).await?,
8822 )),
8823 404u16 => Err(Error::ErrorResponse(
8824 ResponseValue::from_response(response).await?,
8825 )),
8826 422u16 => Err(Error::ErrorResponse(
8827 ResponseValue::from_response(response).await?,
8828 )),
8829 500u16 => Err(Error::ErrorResponse(
8830 ResponseValue::from_response(response).await?,
8831 )),
8832 _ => Err(Error::UnexpectedResponse(response)),
8833 }
8834 }
8835 pub async fn get_door_restrictions<'a>(
8842 &'a self,
8843 id: &'a str,
8844 ) -> Result<ResponseValue<types::DoorRestrictionsResponse>, Error<()>> {
8845 let url = format!(
8846 "{}/devices/{}/door-restrictions",
8847 self.baseurl,
8848 encode_path(&id.to_string()),
8849 );
8850 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8851 header_map.append(
8852 ::reqwest::header::HeaderName::from_static("api-version"),
8853 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8854 );
8855 #[allow(unused_mut)]
8856 let mut request = self
8857 .client
8858 .get(url)
8859 .header(
8860 ::reqwest::header::ACCEPT,
8861 ::reqwest::header::HeaderValue::from_static("application/json"),
8862 )
8863 .headers(header_map)
8864 .build()?;
8865 let info = OperationInfo {
8866 operation_id: "get_door_restrictions",
8867 };
8868 self.pre(&mut request, &info).await?;
8869 let result = self.exec(request, &info).await;
8870 self.post(&result, &info).await?;
8871 let response = result?;
8872 match response.status().as_u16() {
8873 200u16 => ResponseValue::from_response(response).await,
8874 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8875 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8876 _ => Err(Error::UnexpectedResponse(response)),
8877 }
8878 }
8879 pub async fn get_device_metadata_definition<'a>(
8885 &'a self,
8886 id: &'a str,
8887 x_org: &'a str,
8888 ) -> Result<ResponseValue<types::DeviceMetadataDefinitionResponse>, Error<()>> {
8889 let url = format!(
8890 "{}/devices/{}/metadata-definition",
8891 self.baseurl,
8892 encode_path(&id.to_string()),
8893 );
8894 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
8895 header_map.append(
8896 ::reqwest::header::HeaderName::from_static("api-version"),
8897 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8898 );
8899 header_map.append("X-Org", x_org.to_string().try_into()?);
8900 #[allow(unused_mut)]
8901 let mut request = self
8902 .client
8903 .get(url)
8904 .header(
8905 ::reqwest::header::ACCEPT,
8906 ::reqwest::header::HeaderValue::from_static("application/json"),
8907 )
8908 .headers(header_map)
8909 .build()?;
8910 let info = OperationInfo {
8911 operation_id: "get_device_metadata_definition",
8912 };
8913 self.pre(&mut request, &info).await?;
8914 let result = self.exec(request, &info).await;
8915 self.post(&result, &info).await?;
8916 let response = result?;
8917 match response.status().as_u16() {
8918 200u16 => ResponseValue::from_response(response).await,
8919 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8920 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8921 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8922 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
8923 _ => Err(Error::UnexpectedResponse(response)),
8924 }
8925 }
8926 pub async fn hard_delete_device<'a>(
8938 &'a self,
8939 id: &'a str,
8940 include_deleted: Option<bool>,
8941 include_metadata: Option<bool>,
8942 recursive: Option<bool>,
8943 x_org: &'a str,
8944 ) -> Result<ResponseValue<types::DeviceResponse>, Error<types::ApiErrorResponse>> {
8945 let url = format!(
8946 "{}/devices/{}/purge",
8947 self.baseurl,
8948 encode_path(&id.to_string()),
8949 );
8950 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
8951 header_map.append(
8952 ::reqwest::header::HeaderName::from_static("api-version"),
8953 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8954 );
8955 header_map.append("X-Org", x_org.to_string().try_into()?);
8956 #[allow(unused_mut)]
8957 let mut request = self
8958 .client
8959 .delete(url)
8960 .header(
8961 ::reqwest::header::ACCEPT,
8962 ::reqwest::header::HeaderValue::from_static("application/json"),
8963 )
8964 .query(&progenitor_client::QueryParam::new(
8965 "include_deleted",
8966 &include_deleted,
8967 ))
8968 .query(&progenitor_client::QueryParam::new(
8969 "include_metadata",
8970 &include_metadata,
8971 ))
8972 .query(&progenitor_client::QueryParam::new("recursive", &recursive))
8973 .headers(header_map)
8974 .build()?;
8975 let info = OperationInfo {
8976 operation_id: "hard_delete_device",
8977 };
8978 self.pre(&mut request, &info).await?;
8979 let result = self.exec(request, &info).await;
8980 self.post(&result, &info).await?;
8981 let response = result?;
8982 match response.status().as_u16() {
8983 200u16 => ResponseValue::from_response(response).await,
8984 400u16 => Err(Error::ErrorResponse(
8985 ResponseValue::from_response(response).await?,
8986 )),
8987 401u16 => Err(Error::ErrorResponse(
8988 ResponseValue::from_response(response).await?,
8989 )),
8990 403u16 => Err(Error::ErrorResponse(
8991 ResponseValue::from_response(response).await?,
8992 )),
8993 404u16 => Err(Error::ErrorResponse(
8994 ResponseValue::from_response(response).await?,
8995 )),
8996 422u16 => Err(Error::ErrorResponse(
8997 ResponseValue::from_response(response).await?,
8998 )),
8999 500u16 => Err(Error::ErrorResponse(
9000 ResponseValue::from_response(response).await?,
9001 )),
9002 _ => Err(Error::UnexpectedResponse(response)),
9003 }
9004 }
9005 pub async fn restore_device<'a>(
9011 &'a self,
9012 id: &'a str,
9013 include_deleted: Option<bool>,
9014 include_metadata: Option<bool>,
9015 x_org: &'a str,
9016 ) -> Result<ResponseValue<types::DeviceResponse>, Error<types::ApiErrorResponse>> {
9017 let url = format!(
9018 "{}/devices/{}/restore",
9019 self.baseurl,
9020 encode_path(&id.to_string()),
9021 );
9022 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
9023 header_map.append(
9024 ::reqwest::header::HeaderName::from_static("api-version"),
9025 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9026 );
9027 header_map.append("X-Org", x_org.to_string().try_into()?);
9028 #[allow(unused_mut)]
9029 let mut request = self
9030 .client
9031 .post(url)
9032 .header(
9033 ::reqwest::header::ACCEPT,
9034 ::reqwest::header::HeaderValue::from_static("application/json"),
9035 )
9036 .query(&progenitor_client::QueryParam::new(
9037 "include_deleted",
9038 &include_deleted,
9039 ))
9040 .query(&progenitor_client::QueryParam::new(
9041 "include_metadata",
9042 &include_metadata,
9043 ))
9044 .headers(header_map)
9045 .build()?;
9046 let info = OperationInfo {
9047 operation_id: "restore_device",
9048 };
9049 self.pre(&mut request, &info).await?;
9050 let result = self.exec(request, &info).await;
9051 self.post(&result, &info).await?;
9052 let response = result?;
9053 match response.status().as_u16() {
9054 200u16 => ResponseValue::from_response(response).await,
9055 400u16 => Err(Error::ErrorResponse(
9056 ResponseValue::from_response(response).await?,
9057 )),
9058 401u16 => Err(Error::ErrorResponse(
9059 ResponseValue::from_response(response).await?,
9060 )),
9061 403u16 => Err(Error::ErrorResponse(
9062 ResponseValue::from_response(response).await?,
9063 )),
9064 404u16 => Err(Error::ErrorResponse(
9065 ResponseValue::from_response(response).await?,
9066 )),
9067 422u16 => Err(Error::ErrorResponse(
9068 ResponseValue::from_response(response).await?,
9069 )),
9070 500u16 => Err(Error::ErrorResponse(
9071 ResponseValue::from_response(response).await?,
9072 )),
9073 _ => Err(Error::UnexpectedResponse(response)),
9074 }
9075 }
9076 pub async fn list_entities<'a>(
9088 &'a self,
9089 include_deleted: bool,
9090 include_metadata: bool,
9091 limit: Option<i32>,
9092 offset: Option<i32>,
9093 only_deleted: bool,
9094 zone_id: Option<&'a str>,
9095 x_org: &'a str,
9096 ) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
9097 let url = format!("{}/entities", self.baseurl,);
9098 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
9099 header_map.append(
9100 ::reqwest::header::HeaderName::from_static("api-version"),
9101 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9102 );
9103 header_map.append("X-Org", x_org.to_string().try_into()?);
9104 #[allow(unused_mut)]
9105 let mut request = self
9106 .client
9107 .get(url)
9108 .header(
9109 ::reqwest::header::ACCEPT,
9110 ::reqwest::header::HeaderValue::from_static("application/json"),
9111 )
9112 .query(&progenitor_client::QueryParam::new(
9113 "include_deleted",
9114 &include_deleted,
9115 ))
9116 .query(&progenitor_client::QueryParam::new(
9117 "include_metadata",
9118 &include_metadata,
9119 ))
9120 .query(&progenitor_client::QueryParam::new("limit", &limit))
9121 .query(&progenitor_client::QueryParam::new("offset", &offset))
9122 .query(&progenitor_client::QueryParam::new(
9123 "only_deleted",
9124 &only_deleted,
9125 ))
9126 .query(&progenitor_client::QueryParam::new("zone_id", &zone_id))
9127 .headers(header_map)
9128 .build()?;
9129 let info = OperationInfo {
9130 operation_id: "list_entities",
9131 };
9132 self.pre(&mut request, &info).await?;
9133 let result = self.exec(request, &info).await;
9134 self.post(&result, &info).await?;
9135 let response = result?;
9136 match response.status().as_u16() {
9137 200u16 => ResponseValue::from_response(response).await,
9138 401u16 => Err(Error::ErrorResponse(
9139 ResponseValue::from_response(response).await?,
9140 )),
9141 403u16 => Err(Error::ErrorResponse(
9142 ResponseValue::from_response(response).await?,
9143 )),
9144 500u16 => Err(Error::ErrorResponse(
9145 ResponseValue::from_response(response).await?,
9146 )),
9147 _ => Err(Error::UnexpectedResponse(response)),
9148 }
9149 }
9150 pub async fn create_entity<'a>(
9156 &'a self,
9157 include_deleted: Option<bool>,
9158 include_metadata: Option<bool>,
9159 x_org: &'a str,
9160 body: &'a types::CreateEntityRequest,
9161 ) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
9162 let url = format!("{}/entities", self.baseurl,);
9163 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
9164 header_map.append(
9165 ::reqwest::header::HeaderName::from_static("api-version"),
9166 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9167 );
9168 header_map.append("X-Org", x_org.to_string().try_into()?);
9169 #[allow(unused_mut)]
9170 let mut request = self
9171 .client
9172 .post(url)
9173 .header(
9174 ::reqwest::header::ACCEPT,
9175 ::reqwest::header::HeaderValue::from_static("application/json"),
9176 )
9177 .json(&body)
9178 .query(&progenitor_client::QueryParam::new(
9179 "include_deleted",
9180 &include_deleted,
9181 ))
9182 .query(&progenitor_client::QueryParam::new(
9183 "include_metadata",
9184 &include_metadata,
9185 ))
9186 .headers(header_map)
9187 .build()?;
9188 let info = OperationInfo {
9189 operation_id: "create_entity",
9190 };
9191 self.pre(&mut request, &info).await?;
9192 let result = self.exec(request, &info).await;
9193 self.post(&result, &info).await?;
9194 let response = result?;
9195 match response.status().as_u16() {
9196 200u16 => ResponseValue::from_response(response).await,
9197 400u16 => Err(Error::ErrorResponse(
9198 ResponseValue::from_response(response).await?,
9199 )),
9200 401u16 => Err(Error::ErrorResponse(
9201 ResponseValue::from_response(response).await?,
9202 )),
9203 403u16 => Err(Error::ErrorResponse(
9204 ResponseValue::from_response(response).await?,
9205 )),
9206 404u16 => Err(Error::ErrorResponse(
9207 ResponseValue::from_response(response).await?,
9208 )),
9209 422u16 => Err(Error::ErrorResponse(
9210 ResponseValue::from_response(response).await?,
9211 )),
9212 500u16 => Err(Error::ErrorResponse(
9213 ResponseValue::from_response(response).await?,
9214 )),
9215 _ => Err(Error::UnexpectedResponse(response)),
9216 }
9217 }
9218 pub async fn get_entity<'a>(
9224 &'a self,
9225 id: &'a str,
9226 include_deleted: Option<bool>,
9227 include_metadata: Option<bool>,
9228 x_org: &'a str,
9229 ) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
9230 let url = format!("{}/entities/{}", self.baseurl, encode_path(&id.to_string()),);
9231 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
9232 header_map.append(
9233 ::reqwest::header::HeaderName::from_static("api-version"),
9234 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9235 );
9236 header_map.append("X-Org", x_org.to_string().try_into()?);
9237 #[allow(unused_mut)]
9238 let mut request = self
9239 .client
9240 .get(url)
9241 .header(
9242 ::reqwest::header::ACCEPT,
9243 ::reqwest::header::HeaderValue::from_static("application/json"),
9244 )
9245 .query(&progenitor_client::QueryParam::new(
9246 "include_deleted",
9247 &include_deleted,
9248 ))
9249 .query(&progenitor_client::QueryParam::new(
9250 "include_metadata",
9251 &include_metadata,
9252 ))
9253 .headers(header_map)
9254 .build()?;
9255 let info = OperationInfo {
9256 operation_id: "get_entity",
9257 };
9258 self.pre(&mut request, &info).await?;
9259 let result = self.exec(request, &info).await;
9260 self.post(&result, &info).await?;
9261 let response = result?;
9262 match response.status().as_u16() {
9263 200u16 => ResponseValue::from_response(response).await,
9264 400u16 => Err(Error::ErrorResponse(
9265 ResponseValue::from_response(response).await?,
9266 )),
9267 401u16 => Err(Error::ErrorResponse(
9268 ResponseValue::from_response(response).await?,
9269 )),
9270 403u16 => Err(Error::ErrorResponse(
9271 ResponseValue::from_response(response).await?,
9272 )),
9273 404u16 => Err(Error::ErrorResponse(
9274 ResponseValue::from_response(response).await?,
9275 )),
9276 500u16 => Err(Error::ErrorResponse(
9277 ResponseValue::from_response(response).await?,
9278 )),
9279 _ => Err(Error::UnexpectedResponse(response)),
9280 }
9281 }
9282 pub async fn update_entity<'a>(
9288 &'a self,
9289 id: &'a str,
9290 include_deleted: Option<bool>,
9291 include_metadata: Option<bool>,
9292 x_org: &'a str,
9293 body: &'a types::UpdateEntityRequest,
9294 ) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
9295 let url = format!("{}/entities/{}", self.baseurl, encode_path(&id.to_string()),);
9296 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
9297 header_map.append(
9298 ::reqwest::header::HeaderName::from_static("api-version"),
9299 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9300 );
9301 header_map.append("X-Org", x_org.to_string().try_into()?);
9302 #[allow(unused_mut)]
9303 let mut request = self
9304 .client
9305 .put(url)
9306 .header(
9307 ::reqwest::header::ACCEPT,
9308 ::reqwest::header::HeaderValue::from_static("application/json"),
9309 )
9310 .json(&body)
9311 .query(&progenitor_client::QueryParam::new(
9312 "include_deleted",
9313 &include_deleted,
9314 ))
9315 .query(&progenitor_client::QueryParam::new(
9316 "include_metadata",
9317 &include_metadata,
9318 ))
9319 .headers(header_map)
9320 .build()?;
9321 let info = OperationInfo {
9322 operation_id: "update_entity",
9323 };
9324 self.pre(&mut request, &info).await?;
9325 let result = self.exec(request, &info).await;
9326 self.post(&result, &info).await?;
9327 let response = result?;
9328 match response.status().as_u16() {
9329 200u16 => ResponseValue::from_response(response).await,
9330 400u16 => Err(Error::ErrorResponse(
9331 ResponseValue::from_response(response).await?,
9332 )),
9333 401u16 => Err(Error::ErrorResponse(
9334 ResponseValue::from_response(response).await?,
9335 )),
9336 403u16 => Err(Error::ErrorResponse(
9337 ResponseValue::from_response(response).await?,
9338 )),
9339 404u16 => Err(Error::ErrorResponse(
9340 ResponseValue::from_response(response).await?,
9341 )),
9342 422u16 => Err(Error::ErrorResponse(
9343 ResponseValue::from_response(response).await?,
9344 )),
9345 500u16 => Err(Error::ErrorResponse(
9346 ResponseValue::from_response(response).await?,
9347 )),
9348 _ => Err(Error::UnexpectedResponse(response)),
9349 }
9350 }
9351 pub async fn delete_entity<'a>(
9357 &'a self,
9358 id: &'a str,
9359 include_deleted: Option<bool>,
9360 include_metadata: Option<bool>,
9361 x_org: &'a str,
9362 ) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
9363 let url = format!("{}/entities/{}", self.baseurl, encode_path(&id.to_string()),);
9364 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
9365 header_map.append(
9366 ::reqwest::header::HeaderName::from_static("api-version"),
9367 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9368 );
9369 header_map.append("X-Org", x_org.to_string().try_into()?);
9370 #[allow(unused_mut)]
9371 let mut request = self
9372 .client
9373 .delete(url)
9374 .header(
9375 ::reqwest::header::ACCEPT,
9376 ::reqwest::header::HeaderValue::from_static("application/json"),
9377 )
9378 .query(&progenitor_client::QueryParam::new(
9379 "include_deleted",
9380 &include_deleted,
9381 ))
9382 .query(&progenitor_client::QueryParam::new(
9383 "include_metadata",
9384 &include_metadata,
9385 ))
9386 .headers(header_map)
9387 .build()?;
9388 let info = OperationInfo {
9389 operation_id: "delete_entity",
9390 };
9391 self.pre(&mut request, &info).await?;
9392 let result = self.exec(request, &info).await;
9393 self.post(&result, &info).await?;
9394 let response = result?;
9395 match response.status().as_u16() {
9396 200u16 => ResponseValue::from_response(response).await,
9397 400u16 => Err(Error::ErrorResponse(
9398 ResponseValue::from_response(response).await?,
9399 )),
9400 401u16 => Err(Error::ErrorResponse(
9401 ResponseValue::from_response(response).await?,
9402 )),
9403 403u16 => Err(Error::ErrorResponse(
9404 ResponseValue::from_response(response).await?,
9405 )),
9406 404u16 => Err(Error::ErrorResponse(
9407 ResponseValue::from_response(response).await?,
9408 )),
9409 422u16 => Err(Error::ErrorResponse(
9410 ResponseValue::from_response(response).await?,
9411 )),
9412 500u16 => Err(Error::ErrorResponse(
9413 ResponseValue::from_response(response).await?,
9414 )),
9415 _ => Err(Error::UnexpectedResponse(response)),
9416 }
9417 }
9418 pub async fn patch_entity<'a>(
9424 &'a self,
9425 id: &'a str,
9426 include_deleted: Option<bool>,
9427 include_metadata: Option<bool>,
9428 x_org: &'a str,
9429 body: &'a types::PatchEntityRequest,
9430 ) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
9431 let url = format!("{}/entities/{}", self.baseurl, encode_path(&id.to_string()),);
9432 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
9433 header_map.append(
9434 ::reqwest::header::HeaderName::from_static("api-version"),
9435 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9436 );
9437 header_map.append("X-Org", x_org.to_string().try_into()?);
9438 #[allow(unused_mut)]
9439 let mut request = self
9440 .client
9441 .patch(url)
9442 .header(
9443 ::reqwest::header::ACCEPT,
9444 ::reqwest::header::HeaderValue::from_static("application/json"),
9445 )
9446 .json(&body)
9447 .query(&progenitor_client::QueryParam::new(
9448 "include_deleted",
9449 &include_deleted,
9450 ))
9451 .query(&progenitor_client::QueryParam::new(
9452 "include_metadata",
9453 &include_metadata,
9454 ))
9455 .headers(header_map)
9456 .build()?;
9457 let info = OperationInfo {
9458 operation_id: "patch_entity",
9459 };
9460 self.pre(&mut request, &info).await?;
9461 let result = self.exec(request, &info).await;
9462 self.post(&result, &info).await?;
9463 let response = result?;
9464 match response.status().as_u16() {
9465 200u16 => ResponseValue::from_response(response).await,
9466 400u16 => Err(Error::ErrorResponse(
9467 ResponseValue::from_response(response).await?,
9468 )),
9469 401u16 => Err(Error::ErrorResponse(
9470 ResponseValue::from_response(response).await?,
9471 )),
9472 403u16 => Err(Error::ErrorResponse(
9473 ResponseValue::from_response(response).await?,
9474 )),
9475 404u16 => Err(Error::ErrorResponse(
9476 ResponseValue::from_response(response).await?,
9477 )),
9478 422u16 => Err(Error::ErrorResponse(
9479 ResponseValue::from_response(response).await?,
9480 )),
9481 500u16 => Err(Error::ErrorResponse(
9482 ResponseValue::from_response(response).await?,
9483 )),
9484 _ => Err(Error::UnexpectedResponse(response)),
9485 }
9486 }
9487 pub async fn execute_entity_action<'a>(
9493 &'a self,
9494 id: &'a str,
9495 action_id: &'a str,
9496 body: &'a ::serde_json::Value,
9497 ) -> Result<ResponseValue<()>, Error<()>> {
9498 let url = format!(
9499 "{}/entities/{}/actions/{}",
9500 self.baseurl,
9501 encode_path(&id.to_string()),
9502 encode_path(&action_id.to_string()),
9503 );
9504 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
9505 header_map.append(
9506 ::reqwest::header::HeaderName::from_static("api-version"),
9507 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9508 );
9509 #[allow(unused_mut)]
9510 let mut request = self
9511 .client
9512 .post(url)
9513 .json(&body)
9514 .headers(header_map)
9515 .build()?;
9516 let info = OperationInfo {
9517 operation_id: "execute_entity_action",
9518 };
9519 self.pre(&mut request, &info).await?;
9520 let result = self.exec(request, &info).await;
9521 self.post(&result, &info).await?;
9522 let response = result?;
9523 match response.status().as_u16() {
9524 200u16 => Ok(ResponseValue::empty(response)),
9525 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9526 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9527 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9528 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9529 501u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9530 _ => Err(Error::UnexpectedResponse(response)),
9531 }
9532 }
9533 pub async fn get_entity_metadata_definition<'a>(
9539 &'a self,
9540 id: &'a str,
9541 x_org: &'a str,
9542 ) -> Result<ResponseValue<types::EntityMetadataDefinitionResponse>, Error<()>> {
9543 let url = format!(
9544 "{}/entities/{}/metadata-definition",
9545 self.baseurl,
9546 encode_path(&id.to_string()),
9547 );
9548 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
9549 header_map.append(
9550 ::reqwest::header::HeaderName::from_static("api-version"),
9551 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9552 );
9553 header_map.append("X-Org", x_org.to_string().try_into()?);
9554 #[allow(unused_mut)]
9555 let mut request = self
9556 .client
9557 .get(url)
9558 .header(
9559 ::reqwest::header::ACCEPT,
9560 ::reqwest::header::HeaderValue::from_static("application/json"),
9561 )
9562 .headers(header_map)
9563 .build()?;
9564 let info = OperationInfo {
9565 operation_id: "get_entity_metadata_definition",
9566 };
9567 self.pre(&mut request, &info).await?;
9568 let result = self.exec(request, &info).await;
9569 self.post(&result, &info).await?;
9570 let response = result?;
9571 match response.status().as_u16() {
9572 200u16 => ResponseValue::from_response(response).await,
9573 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9574 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9575 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9576 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9577 _ => Err(Error::UnexpectedResponse(response)),
9578 }
9579 }
9580 pub async fn hard_delete_entity<'a>(
9586 &'a self,
9587 id: &'a str,
9588 include_deleted: Option<bool>,
9589 include_metadata: Option<bool>,
9590 x_org: &'a str,
9591 ) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
9592 let url = format!(
9593 "{}/entities/{}/purge",
9594 self.baseurl,
9595 encode_path(&id.to_string()),
9596 );
9597 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
9598 header_map.append(
9599 ::reqwest::header::HeaderName::from_static("api-version"),
9600 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9601 );
9602 header_map.append("X-Org", x_org.to_string().try_into()?);
9603 #[allow(unused_mut)]
9604 let mut request = self
9605 .client
9606 .delete(url)
9607 .header(
9608 ::reqwest::header::ACCEPT,
9609 ::reqwest::header::HeaderValue::from_static("application/json"),
9610 )
9611 .query(&progenitor_client::QueryParam::new(
9612 "include_deleted",
9613 &include_deleted,
9614 ))
9615 .query(&progenitor_client::QueryParam::new(
9616 "include_metadata",
9617 &include_metadata,
9618 ))
9619 .headers(header_map)
9620 .build()?;
9621 let info = OperationInfo {
9622 operation_id: "hard_delete_entity",
9623 };
9624 self.pre(&mut request, &info).await?;
9625 let result = self.exec(request, &info).await;
9626 self.post(&result, &info).await?;
9627 let response = result?;
9628 match response.status().as_u16() {
9629 200u16 => ResponseValue::from_response(response).await,
9630 400u16 => Err(Error::ErrorResponse(
9631 ResponseValue::from_response(response).await?,
9632 )),
9633 401u16 => Err(Error::ErrorResponse(
9634 ResponseValue::from_response(response).await?,
9635 )),
9636 403u16 => Err(Error::ErrorResponse(
9637 ResponseValue::from_response(response).await?,
9638 )),
9639 404u16 => Err(Error::ErrorResponse(
9640 ResponseValue::from_response(response).await?,
9641 )),
9642 422u16 => Err(Error::ErrorResponse(
9643 ResponseValue::from_response(response).await?,
9644 )),
9645 500u16 => Err(Error::ErrorResponse(
9646 ResponseValue::from_response(response).await?,
9647 )),
9648 _ => Err(Error::UnexpectedResponse(response)),
9649 }
9650 }
9651 pub async fn restore_entity<'a>(
9657 &'a self,
9658 id: &'a str,
9659 include_deleted: Option<bool>,
9660 include_metadata: Option<bool>,
9661 x_org: &'a str,
9662 ) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
9663 let url = format!(
9664 "{}/entities/{}/restore",
9665 self.baseurl,
9666 encode_path(&id.to_string()),
9667 );
9668 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
9669 header_map.append(
9670 ::reqwest::header::HeaderName::from_static("api-version"),
9671 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9672 );
9673 header_map.append("X-Org", x_org.to_string().try_into()?);
9674 #[allow(unused_mut)]
9675 let mut request = self
9676 .client
9677 .post(url)
9678 .header(
9679 ::reqwest::header::ACCEPT,
9680 ::reqwest::header::HeaderValue::from_static("application/json"),
9681 )
9682 .query(&progenitor_client::QueryParam::new(
9683 "include_deleted",
9684 &include_deleted,
9685 ))
9686 .query(&progenitor_client::QueryParam::new(
9687 "include_metadata",
9688 &include_metadata,
9689 ))
9690 .headers(header_map)
9691 .build()?;
9692 let info = OperationInfo {
9693 operation_id: "restore_entity",
9694 };
9695 self.pre(&mut request, &info).await?;
9696 let result = self.exec(request, &info).await;
9697 self.post(&result, &info).await?;
9698 let response = result?;
9699 match response.status().as_u16() {
9700 200u16 => ResponseValue::from_response(response).await,
9701 400u16 => Err(Error::ErrorResponse(
9702 ResponseValue::from_response(response).await?,
9703 )),
9704 401u16 => Err(Error::ErrorResponse(
9705 ResponseValue::from_response(response).await?,
9706 )),
9707 403u16 => Err(Error::ErrorResponse(
9708 ResponseValue::from_response(response).await?,
9709 )),
9710 404u16 => Err(Error::ErrorResponse(
9711 ResponseValue::from_response(response).await?,
9712 )),
9713 422u16 => Err(Error::ErrorResponse(
9714 ResponseValue::from_response(response).await?,
9715 )),
9716 500u16 => Err(Error::ErrorResponse(
9717 ResponseValue::from_response(response).await?,
9718 )),
9719 _ => Err(Error::UnexpectedResponse(response)),
9720 }
9721 }
9722 pub async fn get_eula<'a>(&'a self) -> Result<ResponseValue<types::EulaResponse>, Error<()>> {
9728 let url = format!("{}/eula", self.baseurl,);
9729 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
9730 header_map.append(
9731 ::reqwest::header::HeaderName::from_static("api-version"),
9732 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9733 );
9734 #[allow(unused_mut)]
9735 let mut request = self
9736 .client
9737 .get(url)
9738 .header(
9739 ::reqwest::header::ACCEPT,
9740 ::reqwest::header::HeaderValue::from_static("application/json"),
9741 )
9742 .headers(header_map)
9743 .build()?;
9744 let info = OperationInfo {
9745 operation_id: "get_eula",
9746 };
9747 self.pre(&mut request, &info).await?;
9748 let result = self.exec(request, &info).await;
9749 self.post(&result, &info).await?;
9750 let response = result?;
9751 match response.status().as_u16() {
9752 200u16 => ResponseValue::from_response(response).await,
9753 _ => Err(Error::UnexpectedResponse(response)),
9754 }
9755 }
9756 pub async fn accept_eula<'a>(
9762 &'a self,
9763 body: &'a types::AcceptEulaRequest,
9764 ) -> Result<ResponseValue<types::AcceptEulaResponse>, Error<()>> {
9765 let url = format!("{}/eula/accept", self.baseurl,);
9766 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
9767 header_map.append(
9768 ::reqwest::header::HeaderName::from_static("api-version"),
9769 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9770 );
9771 #[allow(unused_mut)]
9772 let mut request = self
9773 .client
9774 .post(url)
9775 .header(
9776 ::reqwest::header::ACCEPT,
9777 ::reqwest::header::HeaderValue::from_static("application/json"),
9778 )
9779 .json(&body)
9780 .headers(header_map)
9781 .build()?;
9782 let info = OperationInfo {
9783 operation_id: "accept_eula",
9784 };
9785 self.pre(&mut request, &info).await?;
9786 let result = self.exec(request, &info).await;
9787 self.post(&result, &info).await?;
9788 let response = result?;
9789 match response.status().as_u16() {
9790 200u16 => ResponseValue::from_response(response).await,
9791 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9792 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9793 _ => Err(Error::UnexpectedResponse(response)),
9794 }
9795 }
9796 pub async fn list_integrations<'a>(
9811 &'a self,
9812 include_deleted: bool,
9813 include_metadata: bool,
9814 limit: Option<i32>,
9815 offset: Option<i32>,
9816 only_deleted: bool,
9817 provider_type: Option<&'a str>,
9818 q: Option<&'a str>,
9819 x_org: &'a str,
9820 ) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
9821 let url = format!("{}/integrations", self.baseurl,);
9822 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
9823 header_map.append(
9824 ::reqwest::header::HeaderName::from_static("api-version"),
9825 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9826 );
9827 header_map.append("X-Org", x_org.to_string().try_into()?);
9828 #[allow(unused_mut)]
9829 let mut request = self
9830 .client
9831 .get(url)
9832 .header(
9833 ::reqwest::header::ACCEPT,
9834 ::reqwest::header::HeaderValue::from_static("application/json"),
9835 )
9836 .query(&progenitor_client::QueryParam::new(
9837 "include_deleted",
9838 &include_deleted,
9839 ))
9840 .query(&progenitor_client::QueryParam::new(
9841 "include_metadata",
9842 &include_metadata,
9843 ))
9844 .query(&progenitor_client::QueryParam::new("limit", &limit))
9845 .query(&progenitor_client::QueryParam::new("offset", &offset))
9846 .query(&progenitor_client::QueryParam::new(
9847 "only_deleted",
9848 &only_deleted,
9849 ))
9850 .query(&progenitor_client::QueryParam::new(
9851 "provider_type",
9852 &provider_type,
9853 ))
9854 .query(&progenitor_client::QueryParam::new("q", &q))
9855 .headers(header_map)
9856 .build()?;
9857 let info = OperationInfo {
9858 operation_id: "list_integrations",
9859 };
9860 self.pre(&mut request, &info).await?;
9861 let result = self.exec(request, &info).await;
9862 self.post(&result, &info).await?;
9863 let response = result?;
9864 match response.status().as_u16() {
9865 200u16 => ResponseValue::from_response(response).await,
9866 401u16 => Err(Error::ErrorResponse(
9867 ResponseValue::from_response(response).await?,
9868 )),
9869 403u16 => Err(Error::ErrorResponse(
9870 ResponseValue::from_response(response).await?,
9871 )),
9872 500u16 => Err(Error::ErrorResponse(
9873 ResponseValue::from_response(response).await?,
9874 )),
9875 _ => Err(Error::UnexpectedResponse(response)),
9876 }
9877 }
9878 pub async fn create_integration<'a>(
9884 &'a self,
9885 include_deleted: Option<bool>,
9886 include_metadata: Option<bool>,
9887 x_org: &'a str,
9888 body: &'a types::CreateIntegrationRequest,
9889 ) -> Result<ResponseValue<types::IntegrationResponse>, Error<()>> {
9890 let url = format!("{}/integrations", self.baseurl,);
9891 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
9892 header_map.append(
9893 ::reqwest::header::HeaderName::from_static("api-version"),
9894 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9895 );
9896 header_map.append("X-Org", x_org.to_string().try_into()?);
9897 #[allow(unused_mut)]
9898 let mut request = self
9899 .client
9900 .post(url)
9901 .header(
9902 ::reqwest::header::ACCEPT,
9903 ::reqwest::header::HeaderValue::from_static("application/json"),
9904 )
9905 .json(&body)
9906 .query(&progenitor_client::QueryParam::new(
9907 "include_deleted",
9908 &include_deleted,
9909 ))
9910 .query(&progenitor_client::QueryParam::new(
9911 "include_metadata",
9912 &include_metadata,
9913 ))
9914 .headers(header_map)
9915 .build()?;
9916 let info = OperationInfo {
9917 operation_id: "create_integration",
9918 };
9919 self.pre(&mut request, &info).await?;
9920 let result = self.exec(request, &info).await;
9921 self.post(&result, &info).await?;
9922 let response = result?;
9923 match response.status().as_u16() {
9924 200u16 => ResponseValue::from_response(response).await,
9925 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9926 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9927 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9928 _ => Err(Error::UnexpectedResponse(response)),
9929 }
9930 }
9931 pub async fn get_access_portal_by_id<'a>(
9937 &'a self,
9938 portal_id: &'a str,
9939 x_org: &'a str,
9940 ) -> Result<ResponseValue<types::GetAccessPortalResponse>, Error<()>> {
9941 let url = format!(
9942 "{}/integrations/access-portals/{}",
9943 self.baseurl,
9944 encode_path(&portal_id.to_string()),
9945 );
9946 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
9947 header_map.append(
9948 ::reqwest::header::HeaderName::from_static("api-version"),
9949 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9950 );
9951 header_map.append("X-Org", x_org.to_string().try_into()?);
9952 #[allow(unused_mut)]
9953 let mut request = self
9954 .client
9955 .get(url)
9956 .header(
9957 ::reqwest::header::ACCEPT,
9958 ::reqwest::header::HeaderValue::from_static("application/json"),
9959 )
9960 .headers(header_map)
9961 .build()?;
9962 let info = OperationInfo {
9963 operation_id: "get_access_portal_by_id",
9964 };
9965 self.pre(&mut request, &info).await?;
9966 let result = self.exec(request, &info).await;
9967 self.post(&result, &info).await?;
9968 let response = result?;
9969 match response.status().as_u16() {
9970 200u16 => ResponseValue::from_response(response).await,
9971 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9972 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9973 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9974 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
9975 _ => Err(Error::UnexpectedResponse(response)),
9976 }
9977 }
9978 pub async fn list_integration_provider_types<'a>(
9984 &'a self,
9985 ) -> Result<
9986 ResponseValue<
9987 ::std::collections::HashMap<
9988 ::std::string::String,
9989 ::std::collections::HashMap<::std::string::String, ::std::string::String>,
9990 >,
9991 >,
9992 Error<()>,
9993 > {
9994 let url = format!("{}/integrations/provider-types", self.baseurl,);
9995 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
9996 header_map.append(
9997 ::reqwest::header::HeaderName::from_static("api-version"),
9998 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
9999 );
10000 #[allow(unused_mut)]
10001 let mut request = self
10002 .client
10003 .get(url)
10004 .header(
10005 ::reqwest::header::ACCEPT,
10006 ::reqwest::header::HeaderValue::from_static("application/json"),
10007 )
10008 .headers(header_map)
10009 .build()?;
10010 let info = OperationInfo {
10011 operation_id: "list_integration_provider_types",
10012 };
10013 self.pre(&mut request, &info).await?;
10014 let result = self.exec(request, &info).await;
10015 self.post(&result, &info).await?;
10016 let response = result?;
10017 match response.status().as_u16() {
10018 200u16 => ResponseValue::from_response(response).await,
10019 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10020 _ => Err(Error::UnexpectedResponse(response)),
10021 }
10022 }
10023 pub async fn get_integration_provider_definition<'a>(
10029 &'a self,
10030 provider_type: &'a str,
10031 ) -> Result<ResponseValue<()>, Error<()>> {
10032 let url = format!(
10033 "{}/integrations/provider-types/{}/definition",
10034 self.baseurl,
10035 encode_path(&provider_type.to_string()),
10036 );
10037 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
10038 header_map.append(
10039 ::reqwest::header::HeaderName::from_static("api-version"),
10040 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10041 );
10042 #[allow(unused_mut)]
10043 let mut request = self.client.get(url).headers(header_map).build()?;
10044 let info = OperationInfo {
10045 operation_id: "get_integration_provider_definition",
10046 };
10047 self.pre(&mut request, &info).await?;
10048 let result = self.exec(request, &info).await;
10049 self.post(&result, &info).await?;
10050 let response = result?;
10051 match response.status().as_u16() {
10052 200u16 => Ok(ResponseValue::empty(response)),
10053 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10054 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10055 _ => Err(Error::UnexpectedResponse(response)),
10056 }
10057 }
10058 pub async fn get_integration<'a>(
10062 &'a self,
10063 id: &'a str,
10064 include_deleted: Option<bool>,
10065 include_metadata: Option<bool>,
10066 x_org: &'a str,
10067 ) -> Result<ResponseValue<types::IntegrationResponse>, Error<types::ApiErrorResponse>> {
10068 let url = format!(
10069 "{}/integrations/{}",
10070 self.baseurl,
10071 encode_path(&id.to_string()),
10072 );
10073 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10074 header_map.append(
10075 ::reqwest::header::HeaderName::from_static("api-version"),
10076 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10077 );
10078 header_map.append("X-Org", x_org.to_string().try_into()?);
10079 #[allow(unused_mut)]
10080 let mut request = self
10081 .client
10082 .get(url)
10083 .header(
10084 ::reqwest::header::ACCEPT,
10085 ::reqwest::header::HeaderValue::from_static("application/json"),
10086 )
10087 .query(&progenitor_client::QueryParam::new(
10088 "include_deleted",
10089 &include_deleted,
10090 ))
10091 .query(&progenitor_client::QueryParam::new(
10092 "include_metadata",
10093 &include_metadata,
10094 ))
10095 .headers(header_map)
10096 .build()?;
10097 let info = OperationInfo {
10098 operation_id: "get_integration",
10099 };
10100 self.pre(&mut request, &info).await?;
10101 let result = self.exec(request, &info).await;
10102 self.post(&result, &info).await?;
10103 let response = result?;
10104 match response.status().as_u16() {
10105 200u16 => ResponseValue::from_response(response).await,
10106 400u16 => Err(Error::ErrorResponse(
10107 ResponseValue::from_response(response).await?,
10108 )),
10109 401u16 => Err(Error::ErrorResponse(
10110 ResponseValue::from_response(response).await?,
10111 )),
10112 403u16 => Err(Error::ErrorResponse(
10113 ResponseValue::from_response(response).await?,
10114 )),
10115 404u16 => Err(Error::ErrorResponse(
10116 ResponseValue::from_response(response).await?,
10117 )),
10118 500u16 => Err(Error::ErrorResponse(
10119 ResponseValue::from_response(response).await?,
10120 )),
10121 _ => Err(Error::UnexpectedResponse(response)),
10122 }
10123 }
10124 pub async fn update_integration<'a>(
10130 &'a self,
10131 id: &'a str,
10132 include_deleted: Option<bool>,
10133 include_metadata: Option<bool>,
10134 x_org: &'a str,
10135 body: &'a types::UpdateIntegrationRequest,
10136 ) -> Result<ResponseValue<types::IntegrationResponse>, Error<()>> {
10137 let url = format!(
10138 "{}/integrations/{}",
10139 self.baseurl,
10140 encode_path(&id.to_string()),
10141 );
10142 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10143 header_map.append(
10144 ::reqwest::header::HeaderName::from_static("api-version"),
10145 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10146 );
10147 header_map.append("X-Org", x_org.to_string().try_into()?);
10148 #[allow(unused_mut)]
10149 let mut request = self
10150 .client
10151 .put(url)
10152 .header(
10153 ::reqwest::header::ACCEPT,
10154 ::reqwest::header::HeaderValue::from_static("application/json"),
10155 )
10156 .json(&body)
10157 .query(&progenitor_client::QueryParam::new(
10158 "include_deleted",
10159 &include_deleted,
10160 ))
10161 .query(&progenitor_client::QueryParam::new(
10162 "include_metadata",
10163 &include_metadata,
10164 ))
10165 .headers(header_map)
10166 .build()?;
10167 let info = OperationInfo {
10168 operation_id: "update_integration",
10169 };
10170 self.pre(&mut request, &info).await?;
10171 let result = self.exec(request, &info).await;
10172 self.post(&result, &info).await?;
10173 let response = result?;
10174 match response.status().as_u16() {
10175 200u16 => ResponseValue::from_response(response).await,
10176 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10177 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10178 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10179 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10180 _ => Err(Error::UnexpectedResponse(response)),
10181 }
10182 }
10183 pub async fn list_integration_access_invites<'a>(
10189 &'a self,
10190 id: &'a str,
10191 x_org: &'a str,
10192 ) -> Result<
10193 ResponseValue<types::ListIntegrationAccessInvitesResponse>,
10194 Error<types::ApiErrorResponse>,
10195 > {
10196 let url = format!(
10197 "{}/integrations/{}/access-invites",
10198 self.baseurl,
10199 encode_path(&id.to_string()),
10200 );
10201 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10202 header_map.append(
10203 ::reqwest::header::HeaderName::from_static("api-version"),
10204 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10205 );
10206 header_map.append("X-Org", x_org.to_string().try_into()?);
10207 #[allow(unused_mut)]
10208 let mut request = self
10209 .client
10210 .get(url)
10211 .header(
10212 ::reqwest::header::ACCEPT,
10213 ::reqwest::header::HeaderValue::from_static("application/json"),
10214 )
10215 .headers(header_map)
10216 .build()?;
10217 let info = OperationInfo {
10218 operation_id: "list_integration_access_invites",
10219 };
10220 self.pre(&mut request, &info).await?;
10221 let result = self.exec(request, &info).await;
10222 self.post(&result, &info).await?;
10223 let response = result?;
10224 match response.status().as_u16() {
10225 200u16 => ResponseValue::from_response(response).await,
10226 400u16 => Err(Error::ErrorResponse(
10227 ResponseValue::from_response(response).await?,
10228 )),
10229 401u16 => Err(Error::ErrorResponse(
10230 ResponseValue::from_response(response).await?,
10231 )),
10232 403u16 => Err(Error::ErrorResponse(
10233 ResponseValue::from_response(response).await?,
10234 )),
10235 404u16 => Err(Error::ErrorResponse(
10236 ResponseValue::from_response(response).await?,
10237 )),
10238 _ => Err(Error::UnexpectedResponse(response)),
10239 }
10240 }
10241 pub async fn create_integration_access_invite<'a>(
10247 &'a self,
10248 id: &'a str,
10249 x_org: &'a str,
10250 body: &'a types::CreateAccessInviteRequest,
10251 ) -> Result<ResponseValue<types::CreateAccessInviteResponse>, Error<types::ApiErrorResponse>>
10252 {
10253 let url = format!(
10254 "{}/integrations/{}/access-invites",
10255 self.baseurl,
10256 encode_path(&id.to_string()),
10257 );
10258 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10259 header_map.append(
10260 ::reqwest::header::HeaderName::from_static("api-version"),
10261 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10262 );
10263 header_map.append("X-Org", x_org.to_string().try_into()?);
10264 #[allow(unused_mut)]
10265 let mut request = self
10266 .client
10267 .post(url)
10268 .header(
10269 ::reqwest::header::ACCEPT,
10270 ::reqwest::header::HeaderValue::from_static("application/json"),
10271 )
10272 .json(&body)
10273 .headers(header_map)
10274 .build()?;
10275 let info = OperationInfo {
10276 operation_id: "create_integration_access_invite",
10277 };
10278 self.pre(&mut request, &info).await?;
10279 let result = self.exec(request, &info).await;
10280 self.post(&result, &info).await?;
10281 let response = result?;
10282 match response.status().as_u16() {
10283 200u16 => ResponseValue::from_response(response).await,
10284 400u16 => Err(Error::ErrorResponse(
10285 ResponseValue::from_response(response).await?,
10286 )),
10287 401u16 => Err(Error::ErrorResponse(
10288 ResponseValue::from_response(response).await?,
10289 )),
10290 403u16 => Err(Error::ErrorResponse(
10291 ResponseValue::from_response(response).await?,
10292 )),
10293 404u16 => Err(Error::ErrorResponse(
10294 ResponseValue::from_response(response).await?,
10295 )),
10296 _ => Err(Error::UnexpectedResponse(response)),
10297 }
10298 }
10299 pub async fn update_integration_access_invite<'a>(
10305 &'a self,
10306 id: &'a str,
10307 invite_link_id: &'a str,
10308 x_org: &'a str,
10309 body: &'a types::UpdateAccessInviteRequest,
10310 ) -> Result<ResponseValue<types::AccessInviteListItem>, Error<types::ApiErrorResponse>> {
10311 let url = format!(
10312 "{}/integrations/{}/access-invites/{}",
10313 self.baseurl,
10314 encode_path(&id.to_string()),
10315 encode_path(&invite_link_id.to_string()),
10316 );
10317 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10318 header_map.append(
10319 ::reqwest::header::HeaderName::from_static("api-version"),
10320 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10321 );
10322 header_map.append("X-Org", x_org.to_string().try_into()?);
10323 #[allow(unused_mut)]
10324 let mut request = self
10325 .client
10326 .put(url)
10327 .header(
10328 ::reqwest::header::ACCEPT,
10329 ::reqwest::header::HeaderValue::from_static("application/json"),
10330 )
10331 .json(&body)
10332 .headers(header_map)
10333 .build()?;
10334 let info = OperationInfo {
10335 operation_id: "update_integration_access_invite",
10336 };
10337 self.pre(&mut request, &info).await?;
10338 let result = self.exec(request, &info).await;
10339 self.post(&result, &info).await?;
10340 let response = result?;
10341 match response.status().as_u16() {
10342 200u16 => ResponseValue::from_response(response).await,
10343 400u16 => Err(Error::ErrorResponse(
10344 ResponseValue::from_response(response).await?,
10345 )),
10346 401u16 => Err(Error::ErrorResponse(
10347 ResponseValue::from_response(response).await?,
10348 )),
10349 403u16 => Err(Error::ErrorResponse(
10350 ResponseValue::from_response(response).await?,
10351 )),
10352 404u16 => Err(Error::ErrorResponse(
10353 ResponseValue::from_response(response).await?,
10354 )),
10355 _ => Err(Error::UnexpectedResponse(response)),
10356 }
10357 }
10358 pub async fn delete_integration_access_invite<'a>(
10364 &'a self,
10365 id: &'a str,
10366 invite_link_id: &'a str,
10367 x_org: &'a str,
10368 ) -> Result<ResponseValue<()>, Error<()>> {
10369 let url = format!(
10370 "{}/integrations/{}/access-invites/{}",
10371 self.baseurl,
10372 encode_path(&id.to_string()),
10373 encode_path(&invite_link_id.to_string()),
10374 );
10375 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10376 header_map.append(
10377 ::reqwest::header::HeaderName::from_static("api-version"),
10378 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10379 );
10380 header_map.append("X-Org", x_org.to_string().try_into()?);
10381 #[allow(unused_mut)]
10382 let mut request = self.client.delete(url).headers(header_map).build()?;
10383 let info = OperationInfo {
10384 operation_id: "delete_integration_access_invite",
10385 };
10386 self.pre(&mut request, &info).await?;
10387 let result = self.exec(request, &info).await;
10388 self.post(&result, &info).await?;
10389 let response = result?;
10390 match response.status().as_u16() {
10391 200u16 => Ok(ResponseValue::empty(response)),
10392 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10393 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10394 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10395 _ => Err(Error::UnexpectedResponse(response)),
10396 }
10397 }
10398 pub async fn restore_integration_access_invite<'a>(
10404 &'a self,
10405 id: &'a str,
10406 invite_link_id: &'a str,
10407 x_org: &'a str,
10408 ) -> Result<ResponseValue<types::AccessInviteListItem>, Error<types::ApiErrorResponse>> {
10409 let url = format!(
10410 "{}/integrations/{}/access-invites/{}/restore",
10411 self.baseurl,
10412 encode_path(&id.to_string()),
10413 encode_path(&invite_link_id.to_string()),
10414 );
10415 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10416 header_map.append(
10417 ::reqwest::header::HeaderName::from_static("api-version"),
10418 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10419 );
10420 header_map.append("X-Org", x_org.to_string().try_into()?);
10421 #[allow(unused_mut)]
10422 let mut request = self
10423 .client
10424 .post(url)
10425 .header(
10426 ::reqwest::header::ACCEPT,
10427 ::reqwest::header::HeaderValue::from_static("application/json"),
10428 )
10429 .headers(header_map)
10430 .build()?;
10431 let info = OperationInfo {
10432 operation_id: "restore_integration_access_invite",
10433 };
10434 self.pre(&mut request, &info).await?;
10435 let result = self.exec(request, &info).await;
10436 self.post(&result, &info).await?;
10437 let response = result?;
10438 match response.status().as_u16() {
10439 200u16 => ResponseValue::from_response(response).await,
10440 400u16 => Err(Error::ErrorResponse(
10441 ResponseValue::from_response(response).await?,
10442 )),
10443 401u16 => Err(Error::ErrorResponse(
10444 ResponseValue::from_response(response).await?,
10445 )),
10446 403u16 => Err(Error::ErrorResponse(
10447 ResponseValue::from_response(response).await?,
10448 )),
10449 404u16 => Err(Error::ErrorResponse(
10450 ResponseValue::from_response(response).await?,
10451 )),
10452 _ => Err(Error::UnexpectedResponse(response)),
10453 }
10454 }
10455 pub async fn list_integration_access_portals<'a>(
10461 &'a self,
10462 id: &'a str,
10463 x_org: &'a str,
10464 ) -> Result<ResponseValue<types::ListIntegrationAccessPortalsResponse>, Error<()>> {
10465 let url = format!(
10466 "{}/integrations/{}/access-portals",
10467 self.baseurl,
10468 encode_path(&id.to_string()),
10469 );
10470 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10471 header_map.append(
10472 ::reqwest::header::HeaderName::from_static("api-version"),
10473 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10474 );
10475 header_map.append("X-Org", x_org.to_string().try_into()?);
10476 #[allow(unused_mut)]
10477 let mut request = self
10478 .client
10479 .get(url)
10480 .header(
10481 ::reqwest::header::ACCEPT,
10482 ::reqwest::header::HeaderValue::from_static("application/json"),
10483 )
10484 .headers(header_map)
10485 .build()?;
10486 let info = OperationInfo {
10487 operation_id: "list_integration_access_portals",
10488 };
10489 self.pre(&mut request, &info).await?;
10490 let result = self.exec(request, &info).await;
10491 self.post(&result, &info).await?;
10492 let response = result?;
10493 match response.status().as_u16() {
10494 200u16 => ResponseValue::from_response(response).await,
10495 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10496 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10497 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10498 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10499 _ => Err(Error::UnexpectedResponse(response)),
10500 }
10501 }
10502 pub async fn create_integration_access_portal<'a>(
10508 &'a self,
10509 id: &'a str,
10510 x_org: &'a str,
10511 body: &'a types::CreateAccessPortalRequest,
10512 ) -> Result<ResponseValue<types::CreateAccessPortalResponse>, Error<()>> {
10513 let url = format!(
10514 "{}/integrations/{}/access-portals",
10515 self.baseurl,
10516 encode_path(&id.to_string()),
10517 );
10518 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10519 header_map.append(
10520 ::reqwest::header::HeaderName::from_static("api-version"),
10521 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10522 );
10523 header_map.append("X-Org", x_org.to_string().try_into()?);
10524 #[allow(unused_mut)]
10525 let mut request = self
10526 .client
10527 .post(url)
10528 .header(
10529 ::reqwest::header::ACCEPT,
10530 ::reqwest::header::HeaderValue::from_static("application/json"),
10531 )
10532 .json(&body)
10533 .headers(header_map)
10534 .build()?;
10535 let info = OperationInfo {
10536 operation_id: "create_integration_access_portal",
10537 };
10538 self.pre(&mut request, &info).await?;
10539 let result = self.exec(request, &info).await;
10540 self.post(&result, &info).await?;
10541 let response = result?;
10542 match response.status().as_u16() {
10543 200u16 => ResponseValue::from_response(response).await,
10544 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10545 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10546 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10547 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10548 _ => Err(Error::UnexpectedResponse(response)),
10549 }
10550 }
10551 pub async fn update_integration_access_portal<'a>(
10557 &'a self,
10558 id: &'a str,
10559 portal_id: &'a str,
10560 x_org: &'a str,
10561 body: &'a types::UpdateAccessPortalRequest,
10562 ) -> Result<ResponseValue<types::AccessPortalListItem>, Error<()>> {
10563 let url = format!(
10564 "{}/integrations/{}/access-portals/{}",
10565 self.baseurl,
10566 encode_path(&id.to_string()),
10567 encode_path(&portal_id.to_string()),
10568 );
10569 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10570 header_map.append(
10571 ::reqwest::header::HeaderName::from_static("api-version"),
10572 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10573 );
10574 header_map.append("X-Org", x_org.to_string().try_into()?);
10575 #[allow(unused_mut)]
10576 let mut request = self
10577 .client
10578 .put(url)
10579 .header(
10580 ::reqwest::header::ACCEPT,
10581 ::reqwest::header::HeaderValue::from_static("application/json"),
10582 )
10583 .json(&body)
10584 .headers(header_map)
10585 .build()?;
10586 let info = OperationInfo {
10587 operation_id: "update_integration_access_portal",
10588 };
10589 self.pre(&mut request, &info).await?;
10590 let result = self.exec(request, &info).await;
10591 self.post(&result, &info).await?;
10592 let response = result?;
10593 match response.status().as_u16() {
10594 200u16 => ResponseValue::from_response(response).await,
10595 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10596 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10597 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10598 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10599 _ => Err(Error::UnexpectedResponse(response)),
10600 }
10601 }
10602 pub async fn delete_integration_access_portal<'a>(
10608 &'a self,
10609 id: &'a str,
10610 portal_id: &'a str,
10611 x_org: &'a str,
10612 ) -> Result<ResponseValue<()>, Error<()>> {
10613 let url = format!(
10614 "{}/integrations/{}/access-portals/{}",
10615 self.baseurl,
10616 encode_path(&id.to_string()),
10617 encode_path(&portal_id.to_string()),
10618 );
10619 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10620 header_map.append(
10621 ::reqwest::header::HeaderName::from_static("api-version"),
10622 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10623 );
10624 header_map.append("X-Org", x_org.to_string().try_into()?);
10625 #[allow(unused_mut)]
10626 let mut request = self.client.delete(url).headers(header_map).build()?;
10627 let info = OperationInfo {
10628 operation_id: "delete_integration_access_portal",
10629 };
10630 self.pre(&mut request, &info).await?;
10631 let result = self.exec(request, &info).await;
10632 self.post(&result, &info).await?;
10633 let response = result?;
10634 match response.status().as_u16() {
10635 200u16 => Ok(ResponseValue::empty(response)),
10636 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10637 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10638 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10639 _ => Err(Error::UnexpectedResponse(response)),
10640 }
10641 }
10642 pub async fn list_building_users<'a>(
10648 &'a self,
10649 id: &'a str,
10650 x_org: &'a str,
10651 ) -> Result<ResponseValue<()>, Error<()>> {
10652 let url = format!(
10653 "{}/integrations/{}/building-users",
10654 self.baseurl,
10655 encode_path(&id.to_string()),
10656 );
10657 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10658 header_map.append(
10659 ::reqwest::header::HeaderName::from_static("api-version"),
10660 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10661 );
10662 header_map.append("X-Org", x_org.to_string().try_into()?);
10663 #[allow(unused_mut)]
10664 let mut request = self.client.get(url).headers(header_map).build()?;
10665 let info = OperationInfo {
10666 operation_id: "list_building_users",
10667 };
10668 self.pre(&mut request, &info).await?;
10669 let result = self.exec(request, &info).await;
10670 self.post(&result, &info).await?;
10671 let response = result?;
10672 match response.status().as_u16() {
10673 200u16 => Ok(ResponseValue::empty(response)),
10674 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10675 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10676 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10677 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10678 500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10679 _ => Err(Error::UnexpectedResponse(response)),
10680 }
10681 }
10682 pub async fn add_building_user<'a>(
10688 &'a self,
10689 id: &'a str,
10690 x_org: &'a str,
10691 body: &'a types::AddBuildingUserPayload,
10692 ) -> Result<ResponseValue<()>, Error<()>> {
10693 let url = format!(
10694 "{}/integrations/{}/building-users",
10695 self.baseurl,
10696 encode_path(&id.to_string()),
10697 );
10698 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10699 header_map.append(
10700 ::reqwest::header::HeaderName::from_static("api-version"),
10701 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10702 );
10703 header_map.append("X-Org", x_org.to_string().try_into()?);
10704 #[allow(unused_mut)]
10705 let mut request = self
10706 .client
10707 .post(url)
10708 .json(&body)
10709 .headers(header_map)
10710 .build()?;
10711 let info = OperationInfo {
10712 operation_id: "add_building_user",
10713 };
10714 self.pre(&mut request, &info).await?;
10715 let result = self.exec(request, &info).await;
10716 self.post(&result, &info).await?;
10717 let response = result?;
10718 match response.status().as_u16() {
10719 201u16 => Ok(ResponseValue::empty(response)),
10720 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10721 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10722 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10723 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10724 500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10725 _ => Err(Error::UnexpectedResponse(response)),
10726 }
10727 }
10728 pub async fn delete_building_user<'a>(
10734 &'a self,
10735 id: &'a str,
10736 user_id: &'a str,
10737 x_org: &'a str,
10738 ) -> Result<ResponseValue<()>, Error<()>> {
10739 let url = format!(
10740 "{}/integrations/{}/building-users/{}",
10741 self.baseurl,
10742 encode_path(&id.to_string()),
10743 encode_path(&user_id.to_string()),
10744 );
10745 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10746 header_map.append(
10747 ::reqwest::header::HeaderName::from_static("api-version"),
10748 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10749 );
10750 header_map.append("X-Org", x_org.to_string().try_into()?);
10751 #[allow(unused_mut)]
10752 let mut request = self.client.delete(url).headers(header_map).build()?;
10753 let info = OperationInfo {
10754 operation_id: "delete_building_user",
10755 };
10756 self.pre(&mut request, &info).await?;
10757 let result = self.exec(request, &info).await;
10758 self.post(&result, &info).await?;
10759 let response = result?;
10760 match response.status().as_u16() {
10761 204u16 => Ok(ResponseValue::empty(response)),
10762 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10763 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10764 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10765 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10766 500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10767 _ => Err(Error::UnexpectedResponse(response)),
10768 }
10769 }
10770 pub async fn get_integration_device_metadata_schema<'a>(
10776 &'a self,
10777 id: &'a str,
10778 x_org: &'a str,
10779 ) -> Result<ResponseValue<types::IntegrationDeviceMetadataSchemaResponse>, Error<()>> {
10780 let url = format!(
10781 "{}/integrations/{}/device-metadata-schema",
10782 self.baseurl,
10783 encode_path(&id.to_string()),
10784 );
10785 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10786 header_map.append(
10787 ::reqwest::header::HeaderName::from_static("api-version"),
10788 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10789 );
10790 header_map.append("X-Org", x_org.to_string().try_into()?);
10791 #[allow(unused_mut)]
10792 let mut request = self
10793 .client
10794 .get(url)
10795 .header(
10796 ::reqwest::header::ACCEPT,
10797 ::reqwest::header::HeaderValue::from_static("application/json"),
10798 )
10799 .headers(header_map)
10800 .build()?;
10801 let info = OperationInfo {
10802 operation_id: "get_integration_device_metadata_schema",
10803 };
10804 self.pre(&mut request, &info).await?;
10805 let result = self.exec(request, &info).await;
10806 self.post(&result, &info).await?;
10807 let response = result?;
10808 match response.status().as_u16() {
10809 200u16 => ResponseValue::from_response(response).await,
10810 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10811 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10812 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10813 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10814 _ => Err(Error::UnexpectedResponse(response)),
10815 }
10816 }
10817 pub async fn get_integration_discovered_devices<'a>(
10823 &'a self,
10824 id: &'a str,
10825 include_deleted: Option<bool>,
10826 include_metadata: Option<bool>,
10827 x_org: &'a str,
10828 ) -> Result<ResponseValue<::serde_json::Value>, Error<()>> {
10829 let url = format!(
10830 "{}/integrations/{}/discovered-devices",
10831 self.baseurl,
10832 encode_path(&id.to_string()),
10833 );
10834 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10835 header_map.append(
10836 ::reqwest::header::HeaderName::from_static("api-version"),
10837 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10838 );
10839 header_map.append("X-Org", x_org.to_string().try_into()?);
10840 #[allow(unused_mut)]
10841 let mut request = self
10842 .client
10843 .get(url)
10844 .header(
10845 ::reqwest::header::ACCEPT,
10846 ::reqwest::header::HeaderValue::from_static("application/json"),
10847 )
10848 .query(&progenitor_client::QueryParam::new(
10849 "include_deleted",
10850 &include_deleted,
10851 ))
10852 .query(&progenitor_client::QueryParam::new(
10853 "include_metadata",
10854 &include_metadata,
10855 ))
10856 .headers(header_map)
10857 .build()?;
10858 let info = OperationInfo {
10859 operation_id: "get_integration_discovered_devices",
10860 };
10861 self.pre(&mut request, &info).await?;
10862 let result = self.exec(request, &info).await;
10863 self.post(&result, &info).await?;
10864 let response = result?;
10865 match response.status().as_u16() {
10866 200u16 => ResponseValue::from_response(response).await,
10867 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10868 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10869 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10870 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10871 501u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10872 502u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
10873 _ => Err(Error::UnexpectedResponse(response)),
10874 }
10875 }
10876 pub async fn list_integration_entities<'a>(
10891 &'a self,
10892 id: &'a str,
10893 entity_type: Option<&'a str>,
10894 include_deleted: bool,
10895 include_metadata: bool,
10896 limit: Option<i32>,
10897 offset: Option<i32>,
10898 only_deleted: bool,
10899 x_org: &'a str,
10900 ) -> Result<ResponseValue<types::PaginatedResponseEntityResponse>, Error<types::ApiErrorResponse>>
10901 {
10902 let url = format!(
10903 "{}/integrations/{}/entities",
10904 self.baseurl,
10905 encode_path(&id.to_string()),
10906 );
10907 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10908 header_map.append(
10909 ::reqwest::header::HeaderName::from_static("api-version"),
10910 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10911 );
10912 header_map.append("X-Org", x_org.to_string().try_into()?);
10913 #[allow(unused_mut)]
10914 let mut request = self
10915 .client
10916 .get(url)
10917 .header(
10918 ::reqwest::header::ACCEPT,
10919 ::reqwest::header::HeaderValue::from_static("application/json"),
10920 )
10921 .query(&progenitor_client::QueryParam::new(
10922 "entity_type",
10923 &entity_type,
10924 ))
10925 .query(&progenitor_client::QueryParam::new(
10926 "include_deleted",
10927 &include_deleted,
10928 ))
10929 .query(&progenitor_client::QueryParam::new(
10930 "include_metadata",
10931 &include_metadata,
10932 ))
10933 .query(&progenitor_client::QueryParam::new("limit", &limit))
10934 .query(&progenitor_client::QueryParam::new("offset", &offset))
10935 .query(&progenitor_client::QueryParam::new(
10936 "only_deleted",
10937 &only_deleted,
10938 ))
10939 .headers(header_map)
10940 .build()?;
10941 let info = OperationInfo {
10942 operation_id: "list_integration_entities",
10943 };
10944 self.pre(&mut request, &info).await?;
10945 let result = self.exec(request, &info).await;
10946 self.post(&result, &info).await?;
10947 let response = result?;
10948 match response.status().as_u16() {
10949 200u16 => ResponseValue::from_response(response).await,
10950 400u16 => Err(Error::ErrorResponse(
10951 ResponseValue::from_response(response).await?,
10952 )),
10953 401u16 => Err(Error::ErrorResponse(
10954 ResponseValue::from_response(response).await?,
10955 )),
10956 403u16 => Err(Error::ErrorResponse(
10957 ResponseValue::from_response(response).await?,
10958 )),
10959 404u16 => Err(Error::ErrorResponse(
10960 ResponseValue::from_response(response).await?,
10961 )),
10962 500u16 => Err(Error::ErrorResponse(
10963 ResponseValue::from_response(response).await?,
10964 )),
10965 _ => Err(Error::UnexpectedResponse(response)),
10966 }
10967 }
10968 pub async fn list_integration_ops<'a>(
10974 &'a self,
10975 id: &'a str,
10976 include_deleted: Option<bool>,
10977 include_metadata: Option<bool>,
10978 x_org: &'a str,
10979 ) -> Result<ResponseValue<()>, Error<()>> {
10980 let url = format!(
10981 "{}/integrations/{}/ops",
10982 self.baseurl,
10983 encode_path(&id.to_string()),
10984 );
10985 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
10986 header_map.append(
10987 ::reqwest::header::HeaderName::from_static("api-version"),
10988 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
10989 );
10990 header_map.append("X-Org", x_org.to_string().try_into()?);
10991 #[allow(unused_mut)]
10992 let mut request = self
10993 .client
10994 .get(url)
10995 .query(&progenitor_client::QueryParam::new(
10996 "include_deleted",
10997 &include_deleted,
10998 ))
10999 .query(&progenitor_client::QueryParam::new(
11000 "include_metadata",
11001 &include_metadata,
11002 ))
11003 .headers(header_map)
11004 .build()?;
11005 let info = OperationInfo {
11006 operation_id: "list_integration_ops",
11007 };
11008 self.pre(&mut request, &info).await?;
11009 let result = self.exec(request, &info).await;
11010 self.post(&result, &info).await?;
11011 let response = result?;
11012 match response.status().as_u16() {
11013 200u16 => Ok(ResponseValue::empty(response)),
11014 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11015 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11016 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11017 _ => Err(Error::UnexpectedResponse(response)),
11018 }
11019 }
11020 pub async fn execute_integration_op<'a>(
11026 &'a self,
11027 id: &'a str,
11028 op_id: &'a str,
11029 x_org: &'a str,
11030 body: &'a ::serde_json::Value,
11031 ) -> Result<ResponseValue<()>, Error<()>> {
11032 let url = format!(
11033 "{}/integrations/{}/ops/{}",
11034 self.baseurl,
11035 encode_path(&id.to_string()),
11036 encode_path(&op_id.to_string()),
11037 );
11038 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
11039 header_map.append(
11040 ::reqwest::header::HeaderName::from_static("api-version"),
11041 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11042 );
11043 header_map.append("X-Org", x_org.to_string().try_into()?);
11044 #[allow(unused_mut)]
11045 let mut request = self
11046 .client
11047 .post(url)
11048 .json(&body)
11049 .headers(header_map)
11050 .build()?;
11051 let info = OperationInfo {
11052 operation_id: "execute_integration_op",
11053 };
11054 self.pre(&mut request, &info).await?;
11055 let result = self.exec(request, &info).await;
11056 self.post(&result, &info).await?;
11057 let response = result?;
11058 match response.status().as_u16() {
11059 200u16 => Ok(ResponseValue::empty(response)),
11060 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11061 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11062 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11063 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11064 501u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11065 _ => Err(Error::UnexpectedResponse(response)),
11066 }
11067 }
11068 pub async fn hard_delete_integration<'a>(
11074 &'a self,
11075 id: &'a str,
11076 include_deleted: Option<bool>,
11077 include_metadata: Option<bool>,
11078 x_org: &'a str,
11079 ) -> Result<ResponseValue<types::IntegrationResponse>, Error<types::ApiErrorResponse>> {
11080 let url = format!(
11081 "{}/integrations/{}/purge",
11082 self.baseurl,
11083 encode_path(&id.to_string()),
11084 );
11085 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
11086 header_map.append(
11087 ::reqwest::header::HeaderName::from_static("api-version"),
11088 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11089 );
11090 header_map.append("X-Org", x_org.to_string().try_into()?);
11091 #[allow(unused_mut)]
11092 let mut request = self
11093 .client
11094 .delete(url)
11095 .header(
11096 ::reqwest::header::ACCEPT,
11097 ::reqwest::header::HeaderValue::from_static("application/json"),
11098 )
11099 .query(&progenitor_client::QueryParam::new(
11100 "include_deleted",
11101 &include_deleted,
11102 ))
11103 .query(&progenitor_client::QueryParam::new(
11104 "include_metadata",
11105 &include_metadata,
11106 ))
11107 .headers(header_map)
11108 .build()?;
11109 let info = OperationInfo {
11110 operation_id: "hard_delete_integration",
11111 };
11112 self.pre(&mut request, &info).await?;
11113 let result = self.exec(request, &info).await;
11114 self.post(&result, &info).await?;
11115 let response = result?;
11116 match response.status().as_u16() {
11117 200u16 => ResponseValue::from_response(response).await,
11118 400u16 => Err(Error::ErrorResponse(
11119 ResponseValue::from_response(response).await?,
11120 )),
11121 401u16 => Err(Error::ErrorResponse(
11122 ResponseValue::from_response(response).await?,
11123 )),
11124 403u16 => Err(Error::ErrorResponse(
11125 ResponseValue::from_response(response).await?,
11126 )),
11127 404u16 => Err(Error::ErrorResponse(
11128 ResponseValue::from_response(response).await?,
11129 )),
11130 422u16 => Err(Error::ErrorResponse(
11131 ResponseValue::from_response(response).await?,
11132 )),
11133 500u16 => Err(Error::ErrorResponse(
11134 ResponseValue::from_response(response).await?,
11135 )),
11136 _ => Err(Error::UnexpectedResponse(response)),
11137 }
11138 }
11139 pub async fn restore_integration<'a>(
11145 &'a self,
11146 id: &'a str,
11147 include_deleted: Option<bool>,
11148 include_metadata: Option<bool>,
11149 x_org: &'a str,
11150 ) -> Result<ResponseValue<types::IntegrationResponse>, Error<types::ApiErrorResponse>> {
11151 let url = format!(
11152 "{}/integrations/{}/restore",
11153 self.baseurl,
11154 encode_path(&id.to_string()),
11155 );
11156 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
11157 header_map.append(
11158 ::reqwest::header::HeaderName::from_static("api-version"),
11159 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11160 );
11161 header_map.append("X-Org", x_org.to_string().try_into()?);
11162 #[allow(unused_mut)]
11163 let mut request = self
11164 .client
11165 .post(url)
11166 .header(
11167 ::reqwest::header::ACCEPT,
11168 ::reqwest::header::HeaderValue::from_static("application/json"),
11169 )
11170 .query(&progenitor_client::QueryParam::new(
11171 "include_deleted",
11172 &include_deleted,
11173 ))
11174 .query(&progenitor_client::QueryParam::new(
11175 "include_metadata",
11176 &include_metadata,
11177 ))
11178 .headers(header_map)
11179 .build()?;
11180 let info = OperationInfo {
11181 operation_id: "restore_integration",
11182 };
11183 self.pre(&mut request, &info).await?;
11184 let result = self.exec(request, &info).await;
11185 self.post(&result, &info).await?;
11186 let response = result?;
11187 match response.status().as_u16() {
11188 200u16 => ResponseValue::from_response(response).await,
11189 400u16 => Err(Error::ErrorResponse(
11190 ResponseValue::from_response(response).await?,
11191 )),
11192 401u16 => Err(Error::ErrorResponse(
11193 ResponseValue::from_response(response).await?,
11194 )),
11195 403u16 => Err(Error::ErrorResponse(
11196 ResponseValue::from_response(response).await?,
11197 )),
11198 404u16 => Err(Error::ErrorResponse(
11199 ResponseValue::from_response(response).await?,
11200 )),
11201 422u16 => Err(Error::ErrorResponse(
11202 ResponseValue::from_response(response).await?,
11203 )),
11204 500u16 => Err(Error::ErrorResponse(
11205 ResponseValue::from_response(response).await?,
11206 )),
11207 _ => Err(Error::UnexpectedResponse(response)),
11208 }
11209 }
11210 pub async fn post_integration_lan_agent_task_spec<'a>(
11220 &'a self,
11221 integration_id: &'a str,
11222 x_org: &'a str,
11223 body: &'a types::LanAgentTaskSpecRequest,
11224 ) -> Result<ResponseValue<types::LanAgentTaskSpecResponse>, Error<()>> {
11225 let url = format!(
11226 "{}/integrations/{}/lan-agent/task-spec",
11227 self.baseurl,
11228 encode_path(&integration_id.to_string()),
11229 );
11230 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
11231 header_map.append(
11232 ::reqwest::header::HeaderName::from_static("api-version"),
11233 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11234 );
11235 header_map.append("X-Org", x_org.to_string().try_into()?);
11236 #[allow(unused_mut)]
11237 let mut request = self
11238 .client
11239 .post(url)
11240 .header(
11241 ::reqwest::header::ACCEPT,
11242 ::reqwest::header::HeaderValue::from_static("application/json"),
11243 )
11244 .json(&body)
11245 .headers(header_map)
11246 .build()?;
11247 let info = OperationInfo {
11248 operation_id: "post_integration_lan_agent_task_spec",
11249 };
11250 self.pre(&mut request, &info).await?;
11251 let result = self.exec(request, &info).await;
11252 self.post(&result, &info).await?;
11253 let response = result?;
11254 match response.status().as_u16() {
11255 200u16 => ResponseValue::from_response(response).await,
11256 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11257 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11258 426u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11259 _ => Err(Error::UnexpectedResponse(response)),
11260 }
11261 }
11262 pub async fn get_integration_lan_agent_tasks<'a>(
11271 &'a self,
11272 integration_id: &'a str,
11273 x_org: &'a str,
11274 ) -> Result<ResponseValue<()>, Error<()>> {
11275 let url = format!(
11276 "{}/integrations/{}/lan-agent/tasks",
11277 self.baseurl,
11278 encode_path(&integration_id.to_string()),
11279 );
11280 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
11281 header_map.append(
11282 ::reqwest::header::HeaderName::from_static("api-version"),
11283 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11284 );
11285 header_map.append("X-Org", x_org.to_string().try_into()?);
11286 #[allow(unused_mut)]
11287 let mut request = self.client.get(url).headers(header_map).build()?;
11288 let info = OperationInfo {
11289 operation_id: "get_integration_lan_agent_tasks",
11290 };
11291 self.pre(&mut request, &info).await?;
11292 let result = self.exec(request, &info).await;
11293 self.post(&result, &info).await?;
11294 let response = result?;
11295 match response.status().as_u16() {
11296 200u16 => Ok(ResponseValue::empty(response)),
11297 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11298 _ => Err(Error::UnexpectedResponse(response)),
11299 }
11300 }
11301 pub async fn list_integration_zones<'a>(
11307 &'a self,
11308 integration_id: &'a str,
11309 include_deleted: Option<bool>,
11310 include_metadata: Option<bool>,
11311 only_deleted: Option<bool>,
11312 x_org: &'a str,
11313 ) -> Result<ResponseValue<::std::vec::Vec<types::ZoneResponse>>, Error<types::ApiErrorResponse>>
11314 {
11315 let url = format!(
11316 "{}/integrations/{}/zones",
11317 self.baseurl,
11318 encode_path(&integration_id.to_string()),
11319 );
11320 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
11321 header_map.append(
11322 ::reqwest::header::HeaderName::from_static("api-version"),
11323 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11324 );
11325 header_map.append("X-Org", x_org.to_string().try_into()?);
11326 #[allow(unused_mut)]
11327 let mut request = self
11328 .client
11329 .get(url)
11330 .header(
11331 ::reqwest::header::ACCEPT,
11332 ::reqwest::header::HeaderValue::from_static("application/json"),
11333 )
11334 .query(&progenitor_client::QueryParam::new(
11335 "include_deleted",
11336 &include_deleted,
11337 ))
11338 .query(&progenitor_client::QueryParam::new(
11339 "include_metadata",
11340 &include_metadata,
11341 ))
11342 .query(&progenitor_client::QueryParam::new(
11343 "only_deleted",
11344 &only_deleted,
11345 ))
11346 .headers(header_map)
11347 .build()?;
11348 let info = OperationInfo {
11349 operation_id: "list_integration_zones",
11350 };
11351 self.pre(&mut request, &info).await?;
11352 let result = self.exec(request, &info).await;
11353 self.post(&result, &info).await?;
11354 let response = result?;
11355 match response.status().as_u16() {
11356 200u16 => ResponseValue::from_response(response).await,
11357 400u16 => Err(Error::ErrorResponse(
11358 ResponseValue::from_response(response).await?,
11359 )),
11360 401u16 => Err(Error::ErrorResponse(
11361 ResponseValue::from_response(response).await?,
11362 )),
11363 403u16 => Err(Error::ErrorResponse(
11364 ResponseValue::from_response(response).await?,
11365 )),
11366 500u16 => Err(Error::ErrorResponse(
11367 ResponseValue::from_response(response).await?,
11368 )),
11369 _ => Err(Error::UnexpectedResponse(response)),
11370 }
11371 }
11372 pub async fn post_lan_agent_cli_bootstrap_token<'a>(
11378 &'a self,
11379 body: &'a types::LanAgentBootstrapTokenRequest,
11380 ) -> Result<ResponseValue<types::LanAgentBootstrapTokenResponse>, Error<()>> {
11381 let url = format!("{}/lan-agent/cli/bootstrap-token", self.baseurl,);
11382 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11383 header_map.append(
11384 ::reqwest::header::HeaderName::from_static("api-version"),
11385 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11386 );
11387 #[allow(unused_mut)]
11388 let mut request = self
11389 .client
11390 .post(url)
11391 .header(
11392 ::reqwest::header::ACCEPT,
11393 ::reqwest::header::HeaderValue::from_static("application/json"),
11394 )
11395 .json(&body)
11396 .headers(header_map)
11397 .build()?;
11398 let info = OperationInfo {
11399 operation_id: "post_lan_agent_cli_bootstrap_token",
11400 };
11401 self.pre(&mut request, &info).await?;
11402 let result = self.exec(request, &info).await;
11403 self.post(&result, &info).await?;
11404 let response = result?;
11405 match response.status().as_u16() {
11406 200u16 => ResponseValue::from_response(response).await,
11407 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11408 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11409 500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11410 503u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11411 _ => Err(Error::UnexpectedResponse(response)),
11412 }
11413 }
11414 pub async fn get_lan_agent_cli_bootstrap_sh<'a>(
11422 &'a self,
11423 key: &'a str,
11424 ) -> Result<ResponseValue<ByteStream>, Error<()>> {
11425 let url = format!("{}/lan-agent/cli/bootstrap.sh", self.baseurl,);
11426 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11427 header_map.append(
11428 ::reqwest::header::HeaderName::from_static("api-version"),
11429 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11430 );
11431 #[allow(unused_mut)]
11432 let mut request = self
11433 .client
11434 .get(url)
11435 .query(&progenitor_client::QueryParam::new("key", &key))
11436 .headers(header_map)
11437 .build()?;
11438 let info = OperationInfo {
11439 operation_id: "get_lan_agent_cli_bootstrap_sh",
11440 };
11441 self.pre(&mut request, &info).await?;
11442 let result = self.exec(request, &info).await;
11443 self.post(&result, &info).await?;
11444 let response = result?;
11445 match response.status().as_u16() {
11446 200u16 => Ok(ResponseValue::stream(response)),
11447 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11448 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11449 503u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11450 _ => Err(Error::UnexpectedResponse(response)),
11451 }
11452 }
11453 pub async fn post_lan_agent_cli_token<'a>(
11459 &'a self,
11460 ) -> Result<ResponseValue<types::LanAgentCliTokenResponse>, Error<()>> {
11461 let url = format!("{}/lan-agent/cli/token", self.baseurl,);
11462 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11463 header_map.append(
11464 ::reqwest::header::HeaderName::from_static("api-version"),
11465 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11466 );
11467 #[allow(unused_mut)]
11468 let mut request = self
11469 .client
11470 .post(url)
11471 .header(
11472 ::reqwest::header::ACCEPT,
11473 ::reqwest::header::HeaderValue::from_static("application/json"),
11474 )
11475 .headers(header_map)
11476 .build()?;
11477 let info = OperationInfo {
11478 operation_id: "post_lan_agent_cli_token",
11479 };
11480 self.pre(&mut request, &info).await?;
11481 let result = self.exec(request, &info).await;
11482 self.post(&result, &info).await?;
11483 let response = result?;
11484 match response.status().as_u16() {
11485 200u16 => ResponseValue::from_response(response).await,
11486 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11487 500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11488 _ => Err(Error::UnexpectedResponse(response)),
11489 }
11490 }
11491 pub async fn get_lan_agent_meta<'a>(
11497 &'a self,
11498 ) -> Result<ResponseValue<types::LanAgentMetaResponse>, Error<()>> {
11499 let url = format!("{}/lan-agent/meta", self.baseurl,);
11500 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11501 header_map.append(
11502 ::reqwest::header::HeaderName::from_static("api-version"),
11503 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11504 );
11505 #[allow(unused_mut)]
11506 let mut request = self
11507 .client
11508 .get(url)
11509 .header(
11510 ::reqwest::header::ACCEPT,
11511 ::reqwest::header::HeaderValue::from_static("application/json"),
11512 )
11513 .headers(header_map)
11514 .build()?;
11515 let info = OperationInfo {
11516 operation_id: "get_lan_agent_meta",
11517 };
11518 self.pre(&mut request, &info).await?;
11519 let result = self.exec(request, &info).await;
11520 self.post(&result, &info).await?;
11521 let response = result?;
11522 match response.status().as_u16() {
11523 200u16 => ResponseValue::from_response(response).await,
11524 _ => Err(Error::UnexpectedResponse(response)),
11525 }
11526 }
11527 pub async fn get_me_apartments<'a>(
11533 &'a self,
11534 ) -> Result<ResponseValue<types::MeApartmentsResponse>, Error<()>> {
11535 let url = format!("{}/me/apartments", self.baseurl,);
11536 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11537 header_map.append(
11538 ::reqwest::header::HeaderName::from_static("api-version"),
11539 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11540 );
11541 #[allow(unused_mut)]
11542 let mut request = self
11543 .client
11544 .get(url)
11545 .header(
11546 ::reqwest::header::ACCEPT,
11547 ::reqwest::header::HeaderValue::from_static("application/json"),
11548 )
11549 .headers(header_map)
11550 .build()?;
11551 let info = OperationInfo {
11552 operation_id: "get_me_apartments",
11553 };
11554 self.pre(&mut request, &info).await?;
11555 let result = self.exec(request, &info).await;
11556 self.post(&result, &info).await?;
11557 let response = result?;
11558 match response.status().as_u16() {
11559 200u16 => ResponseValue::from_response(response).await,
11560 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11561 _ => Err(Error::UnexpectedResponse(response)),
11562 }
11563 }
11564 pub async fn get_me_invitations<'a>(
11570 &'a self,
11571 ) -> Result<ResponseValue<types::MeInvitationsResponse>, Error<()>> {
11572 let url = format!("{}/me/invitations", self.baseurl,);
11573 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11574 header_map.append(
11575 ::reqwest::header::HeaderName::from_static("api-version"),
11576 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11577 );
11578 #[allow(unused_mut)]
11579 let mut request = self
11580 .client
11581 .get(url)
11582 .header(
11583 ::reqwest::header::ACCEPT,
11584 ::reqwest::header::HeaderValue::from_static("application/json"),
11585 )
11586 .headers(header_map)
11587 .build()?;
11588 let info = OperationInfo {
11589 operation_id: "get_me_invitations",
11590 };
11591 self.pre(&mut request, &info).await?;
11592 let result = self.exec(request, &info).await;
11593 self.post(&result, &info).await?;
11594 let response = result?;
11595 match response.status().as_u16() {
11596 200u16 => ResponseValue::from_response(response).await,
11597 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11598 _ => Err(Error::UnexpectedResponse(response)),
11599 }
11600 }
11601 pub async fn get_me_push_subscription_status<'a>(
11607 &'a self,
11608 ) -> Result<ResponseValue<types::MePushSubscriptionStatusResponse>, Error<()>> {
11609 let url = format!("{}/me/push-subscription-status", self.baseurl,);
11610 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11611 header_map.append(
11612 ::reqwest::header::HeaderName::from_static("api-version"),
11613 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11614 );
11615 #[allow(unused_mut)]
11616 let mut request = self
11617 .client
11618 .get(url)
11619 .header(
11620 ::reqwest::header::ACCEPT,
11621 ::reqwest::header::HeaderValue::from_static("application/json"),
11622 )
11623 .headers(header_map)
11624 .build()?;
11625 let info = OperationInfo {
11626 operation_id: "get_me_push_subscription_status",
11627 };
11628 self.pre(&mut request, &info).await?;
11629 let result = self.exec(request, &info).await;
11630 self.post(&result, &info).await?;
11631 let response = result?;
11632 match response.status().as_u16() {
11633 200u16 => ResponseValue::from_response(response).await,
11634 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11635 _ => Err(Error::UnexpectedResponse(response)),
11636 }
11637 }
11638 pub async fn post_me_push_subscription<'a>(
11644 &'a self,
11645 body: &'a types::PostMePushSubscriptionPayload,
11646 ) -> Result<ResponseValue<()>, Error<()>> {
11647 let url = format!("{}/me/push-subscriptions", self.baseurl,);
11648 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11649 header_map.append(
11650 ::reqwest::header::HeaderName::from_static("api-version"),
11651 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11652 );
11653 #[allow(unused_mut)]
11654 let mut request = self
11655 .client
11656 .post(url)
11657 .json(&body)
11658 .headers(header_map)
11659 .build()?;
11660 let info = OperationInfo {
11661 operation_id: "post_me_push_subscription",
11662 };
11663 self.pre(&mut request, &info).await?;
11664 let result = self.exec(request, &info).await;
11665 self.post(&result, &info).await?;
11666 let response = result?;
11667 match response.status().as_u16() {
11668 200u16 => Ok(ResponseValue::empty(response)),
11669 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11670 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11671 _ => Err(Error::UnexpectedResponse(response)),
11672 }
11673 }
11674 pub async fn get_me_push_vapid_public_key<'a>(
11680 &'a self,
11681 ) -> Result<ResponseValue<types::MePushVapidPublicKeyResponse>, Error<()>> {
11682 let url = format!("{}/me/push-vapid-public-key", self.baseurl,);
11683 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11684 header_map.append(
11685 ::reqwest::header::HeaderName::from_static("api-version"),
11686 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11687 );
11688 #[allow(unused_mut)]
11689 let mut request = self
11690 .client
11691 .get(url)
11692 .header(
11693 ::reqwest::header::ACCEPT,
11694 ::reqwest::header::HeaderValue::from_static("application/json"),
11695 )
11696 .headers(header_map)
11697 .build()?;
11698 let info = OperationInfo {
11699 operation_id: "get_me_push_vapid_public_key",
11700 };
11701 self.pre(&mut request, &info).await?;
11702 let result = self.exec(request, &info).await;
11703 self.post(&result, &info).await?;
11704 let response = result?;
11705 match response.status().as_u16() {
11706 200u16 => ResponseValue::from_response(response).await,
11707 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
11708 _ => Err(Error::UnexpectedResponse(response)),
11709 }
11710 }
11711 pub async fn list_orgs<'a>(
11723 &'a self,
11724 include_deleted: bool,
11725 include_metadata: bool,
11726 limit: Option<i32>,
11727 offset: Option<i32>,
11728 only_deleted: bool,
11729 ) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
11730 let url = format!("{}/orgs", self.baseurl,);
11731 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11732 header_map.append(
11733 ::reqwest::header::HeaderName::from_static("api-version"),
11734 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11735 );
11736 #[allow(unused_mut)]
11737 let mut request = self
11738 .client
11739 .get(url)
11740 .header(
11741 ::reqwest::header::ACCEPT,
11742 ::reqwest::header::HeaderValue::from_static("application/json"),
11743 )
11744 .query(&progenitor_client::QueryParam::new(
11745 "include_deleted",
11746 &include_deleted,
11747 ))
11748 .query(&progenitor_client::QueryParam::new(
11749 "include_metadata",
11750 &include_metadata,
11751 ))
11752 .query(&progenitor_client::QueryParam::new("limit", &limit))
11753 .query(&progenitor_client::QueryParam::new("offset", &offset))
11754 .query(&progenitor_client::QueryParam::new(
11755 "only_deleted",
11756 &only_deleted,
11757 ))
11758 .headers(header_map)
11759 .build()?;
11760 let info = OperationInfo {
11761 operation_id: "list_orgs",
11762 };
11763 self.pre(&mut request, &info).await?;
11764 let result = self.exec(request, &info).await;
11765 self.post(&result, &info).await?;
11766 let response = result?;
11767 match response.status().as_u16() {
11768 200u16 => ResponseValue::from_response(response).await,
11769 401u16 => Err(Error::ErrorResponse(
11770 ResponseValue::from_response(response).await?,
11771 )),
11772 500u16 => Err(Error::ErrorResponse(
11773 ResponseValue::from_response(response).await?,
11774 )),
11775 _ => Err(Error::UnexpectedResponse(response)),
11776 }
11777 }
11778 pub async fn create_org<'a>(
11784 &'a self,
11785 include_deleted: Option<bool>,
11786 include_metadata: Option<bool>,
11787 body: &'a types::CreateOrganizationRequest,
11788 ) -> Result<ResponseValue<types::OrganizationResponse>, Error<types::ApiErrorResponse>> {
11789 let url = format!("{}/orgs", self.baseurl,);
11790 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11791 header_map.append(
11792 ::reqwest::header::HeaderName::from_static("api-version"),
11793 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11794 );
11795 #[allow(unused_mut)]
11796 let mut request = self
11797 .client
11798 .post(url)
11799 .header(
11800 ::reqwest::header::ACCEPT,
11801 ::reqwest::header::HeaderValue::from_static("application/json"),
11802 )
11803 .json(&body)
11804 .query(&progenitor_client::QueryParam::new(
11805 "include_deleted",
11806 &include_deleted,
11807 ))
11808 .query(&progenitor_client::QueryParam::new(
11809 "include_metadata",
11810 &include_metadata,
11811 ))
11812 .headers(header_map)
11813 .build()?;
11814 let info = OperationInfo {
11815 operation_id: "create_org",
11816 };
11817 self.pre(&mut request, &info).await?;
11818 let result = self.exec(request, &info).await;
11819 self.post(&result, &info).await?;
11820 let response = result?;
11821 match response.status().as_u16() {
11822 200u16 => ResponseValue::from_response(response).await,
11823 400u16 => Err(Error::ErrorResponse(
11824 ResponseValue::from_response(response).await?,
11825 )),
11826 401u16 => Err(Error::ErrorResponse(
11827 ResponseValue::from_response(response).await?,
11828 )),
11829 403u16 => Err(Error::ErrorResponse(
11830 ResponseValue::from_response(response).await?,
11831 )),
11832 409u16 => Err(Error::ErrorResponse(
11833 ResponseValue::from_response(response).await?,
11834 )),
11835 500u16 => Err(Error::ErrorResponse(
11836 ResponseValue::from_response(response).await?,
11837 )),
11838 _ => Err(Error::UnexpectedResponse(response)),
11839 }
11840 }
11841 pub async fn get_org<'a>(
11847 &'a self,
11848 id: &'a str,
11849 include_deleted: Option<bool>,
11850 include_metadata: Option<bool>,
11851 ) -> Result<ResponseValue<types::OrganizationResponse>, Error<types::ApiErrorResponse>> {
11852 let url = format!("{}/orgs/{}", self.baseurl, encode_path(&id.to_string()),);
11853 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11854 header_map.append(
11855 ::reqwest::header::HeaderName::from_static("api-version"),
11856 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11857 );
11858 #[allow(unused_mut)]
11859 let mut request = self
11860 .client
11861 .get(url)
11862 .header(
11863 ::reqwest::header::ACCEPT,
11864 ::reqwest::header::HeaderValue::from_static("application/json"),
11865 )
11866 .query(&progenitor_client::QueryParam::new(
11867 "include_deleted",
11868 &include_deleted,
11869 ))
11870 .query(&progenitor_client::QueryParam::new(
11871 "include_metadata",
11872 &include_metadata,
11873 ))
11874 .headers(header_map)
11875 .build()?;
11876 let info = OperationInfo {
11877 operation_id: "get_org",
11878 };
11879 self.pre(&mut request, &info).await?;
11880 let result = self.exec(request, &info).await;
11881 self.post(&result, &info).await?;
11882 let response = result?;
11883 match response.status().as_u16() {
11884 200u16 => ResponseValue::from_response(response).await,
11885 400u16 => Err(Error::ErrorResponse(
11886 ResponseValue::from_response(response).await?,
11887 )),
11888 401u16 => Err(Error::ErrorResponse(
11889 ResponseValue::from_response(response).await?,
11890 )),
11891 403u16 => Err(Error::ErrorResponse(
11892 ResponseValue::from_response(response).await?,
11893 )),
11894 404u16 => Err(Error::ErrorResponse(
11895 ResponseValue::from_response(response).await?,
11896 )),
11897 500u16 => Err(Error::ErrorResponse(
11898 ResponseValue::from_response(response).await?,
11899 )),
11900 _ => Err(Error::UnexpectedResponse(response)),
11901 }
11902 }
11903 pub async fn update_org<'a>(
11909 &'a self,
11910 id: &'a str,
11911 include_deleted: Option<bool>,
11912 include_metadata: Option<bool>,
11913 body: &'a types::UpdateOrganizationRequest,
11914 ) -> Result<ResponseValue<types::OrganizationResponse>, Error<types::ApiErrorResponse>> {
11915 let url = format!("{}/orgs/{}", self.baseurl, encode_path(&id.to_string()),);
11916 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11917 header_map.append(
11918 ::reqwest::header::HeaderName::from_static("api-version"),
11919 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11920 );
11921 #[allow(unused_mut)]
11922 let mut request = self
11923 .client
11924 .put(url)
11925 .header(
11926 ::reqwest::header::ACCEPT,
11927 ::reqwest::header::HeaderValue::from_static("application/json"),
11928 )
11929 .json(&body)
11930 .query(&progenitor_client::QueryParam::new(
11931 "include_deleted",
11932 &include_deleted,
11933 ))
11934 .query(&progenitor_client::QueryParam::new(
11935 "include_metadata",
11936 &include_metadata,
11937 ))
11938 .headers(header_map)
11939 .build()?;
11940 let info = OperationInfo {
11941 operation_id: "update_org",
11942 };
11943 self.pre(&mut request, &info).await?;
11944 let result = self.exec(request, &info).await;
11945 self.post(&result, &info).await?;
11946 let response = result?;
11947 match response.status().as_u16() {
11948 200u16 => ResponseValue::from_response(response).await,
11949 400u16 => Err(Error::ErrorResponse(
11950 ResponseValue::from_response(response).await?,
11951 )),
11952 401u16 => Err(Error::ErrorResponse(
11953 ResponseValue::from_response(response).await?,
11954 )),
11955 403u16 => Err(Error::ErrorResponse(
11956 ResponseValue::from_response(response).await?,
11957 )),
11958 404u16 => Err(Error::ErrorResponse(
11959 ResponseValue::from_response(response).await?,
11960 )),
11961 422u16 => Err(Error::ErrorResponse(
11962 ResponseValue::from_response(response).await?,
11963 )),
11964 500u16 => Err(Error::ErrorResponse(
11965 ResponseValue::from_response(response).await?,
11966 )),
11967 _ => Err(Error::UnexpectedResponse(response)),
11968 }
11969 }
11970 pub async fn delete_org<'a>(
11976 &'a self,
11977 id: &'a str,
11978 include_deleted: Option<bool>,
11979 include_metadata: Option<bool>,
11980 ) -> Result<ResponseValue<types::OrganizationResponse>, Error<types::ApiErrorResponse>> {
11981 let url = format!("{}/orgs/{}", self.baseurl, encode_path(&id.to_string()),);
11982 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
11983 header_map.append(
11984 ::reqwest::header::HeaderName::from_static("api-version"),
11985 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
11986 );
11987 #[allow(unused_mut)]
11988 let mut request = self
11989 .client
11990 .delete(url)
11991 .header(
11992 ::reqwest::header::ACCEPT,
11993 ::reqwest::header::HeaderValue::from_static("application/json"),
11994 )
11995 .query(&progenitor_client::QueryParam::new(
11996 "include_deleted",
11997 &include_deleted,
11998 ))
11999 .query(&progenitor_client::QueryParam::new(
12000 "include_metadata",
12001 &include_metadata,
12002 ))
12003 .headers(header_map)
12004 .build()?;
12005 let info = OperationInfo {
12006 operation_id: "delete_org",
12007 };
12008 self.pre(&mut request, &info).await?;
12009 let result = self.exec(request, &info).await;
12010 self.post(&result, &info).await?;
12011 let response = result?;
12012 match response.status().as_u16() {
12013 200u16 => ResponseValue::from_response(response).await,
12014 400u16 => Err(Error::ErrorResponse(
12015 ResponseValue::from_response(response).await?,
12016 )),
12017 401u16 => Err(Error::ErrorResponse(
12018 ResponseValue::from_response(response).await?,
12019 )),
12020 403u16 => Err(Error::ErrorResponse(
12021 ResponseValue::from_response(response).await?,
12022 )),
12023 404u16 => Err(Error::ErrorResponse(
12024 ResponseValue::from_response(response).await?,
12025 )),
12026 409u16 => Err(Error::ErrorResponse(
12027 ResponseValue::from_response(response).await?,
12028 )),
12029 422u16 => Err(Error::ErrorResponse(
12030 ResponseValue::from_response(response).await?,
12031 )),
12032 500u16 => Err(Error::ErrorResponse(
12033 ResponseValue::from_response(response).await?,
12034 )),
12035 _ => Err(Error::UnexpectedResponse(response)),
12036 }
12037 }
12038 pub async fn post_org_billing_checkout<'a>(
12042 &'a self,
12043 id: &'a str,
12044 body: &'a types::CheckoutRequest,
12045 ) -> Result<ResponseValue<types::SubscriptionRef>, Error<()>> {
12046 let url = format!(
12047 "{}/orgs/{}/billing/checkout",
12048 self.baseurl,
12049 encode_path(&id.to_string()),
12050 );
12051 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12052 header_map.append(
12053 ::reqwest::header::HeaderName::from_static("api-version"),
12054 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12055 );
12056 #[allow(unused_mut)]
12057 let mut request = self
12058 .client
12059 .post(url)
12060 .header(
12061 ::reqwest::header::ACCEPT,
12062 ::reqwest::header::HeaderValue::from_static("application/json"),
12063 )
12064 .json(&body)
12065 .headers(header_map)
12066 .build()?;
12067 let info = OperationInfo {
12068 operation_id: "post_org_billing_checkout",
12069 };
12070 self.pre(&mut request, &info).await?;
12071 let result = self.exec(request, &info).await;
12072 self.post(&result, &info).await?;
12073 let response = result?;
12074 match response.status().as_u16() {
12075 200u16 => ResponseValue::from_response(response).await,
12076 _ => Err(Error::UnexpectedResponse(response)),
12077 }
12078 }
12079 pub async fn get_org_billing_plan<'a>(
12083 &'a self,
12084 id: &'a str,
12085 ) -> Result<ResponseValue<types::BillingPlanResponse>, Error<()>> {
12086 let url = format!(
12087 "{}/orgs/{}/billing/plan",
12088 self.baseurl,
12089 encode_path(&id.to_string()),
12090 );
12091 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12092 header_map.append(
12093 ::reqwest::header::HeaderName::from_static("api-version"),
12094 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12095 );
12096 #[allow(unused_mut)]
12097 let mut request = self
12098 .client
12099 .get(url)
12100 .header(
12101 ::reqwest::header::ACCEPT,
12102 ::reqwest::header::HeaderValue::from_static("application/json"),
12103 )
12104 .headers(header_map)
12105 .build()?;
12106 let info = OperationInfo {
12107 operation_id: "get_org_billing_plan",
12108 };
12109 self.pre(&mut request, &info).await?;
12110 let result = self.exec(request, &info).await;
12111 self.post(&result, &info).await?;
12112 let response = result?;
12113 match response.status().as_u16() {
12114 200u16 => ResponseValue::from_response(response).await,
12115 _ => Err(Error::UnexpectedResponse(response)),
12116 }
12117 }
12118 pub async fn post_org_billing_portal<'a>(
12122 &'a self,
12123 id: &'a str,
12124 body: &'a types::PortalRequest,
12125 ) -> Result<ResponseValue<types::PortalResponse>, Error<()>> {
12126 let url = format!(
12127 "{}/orgs/{}/billing/portal",
12128 self.baseurl,
12129 encode_path(&id.to_string()),
12130 );
12131 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12132 header_map.append(
12133 ::reqwest::header::HeaderName::from_static("api-version"),
12134 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12135 );
12136 #[allow(unused_mut)]
12137 let mut request = self
12138 .client
12139 .post(url)
12140 .header(
12141 ::reqwest::header::ACCEPT,
12142 ::reqwest::header::HeaderValue::from_static("application/json"),
12143 )
12144 .json(&body)
12145 .headers(header_map)
12146 .build()?;
12147 let info = OperationInfo {
12148 operation_id: "post_org_billing_portal",
12149 };
12150 self.pre(&mut request, &info).await?;
12151 let result = self.exec(request, &info).await;
12152 self.post(&result, &info).await?;
12153 let response = result?;
12154 match response.status().as_u16() {
12155 200u16 => ResponseValue::from_response(response).await,
12156 501u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
12157 _ => Err(Error::UnexpectedResponse(response)),
12158 }
12159 }
12160 pub async fn get_org_billing_upgrade_options<'a>(
12164 &'a self,
12165 id: &'a str,
12166 ) -> Result<ResponseValue<types::PlansResponse>, Error<()>> {
12167 let url = format!(
12168 "{}/orgs/{}/billing/upgrade-options",
12169 self.baseurl,
12170 encode_path(&id.to_string()),
12171 );
12172 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12173 header_map.append(
12174 ::reqwest::header::HeaderName::from_static("api-version"),
12175 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12176 );
12177 #[allow(unused_mut)]
12178 let mut request = self
12179 .client
12180 .get(url)
12181 .header(
12182 ::reqwest::header::ACCEPT,
12183 ::reqwest::header::HeaderValue::from_static("application/json"),
12184 )
12185 .headers(header_map)
12186 .build()?;
12187 let info = OperationInfo {
12188 operation_id: "get_org_billing_upgrade_options",
12189 };
12190 self.pre(&mut request, &info).await?;
12191 let result = self.exec(request, &info).await;
12192 self.post(&result, &info).await?;
12193 let response = result?;
12194 match response.status().as_u16() {
12195 200u16 => ResponseValue::from_response(response).await,
12196 _ => Err(Error::UnexpectedResponse(response)),
12197 }
12198 }
12199 pub async fn get_org_billing_usage<'a>(
12203 &'a self,
12204 id: &'a str,
12205 ) -> Result<ResponseValue<types::QuotaReport>, Error<()>> {
12206 let url = format!(
12207 "{}/orgs/{}/billing/usage",
12208 self.baseurl,
12209 encode_path(&id.to_string()),
12210 );
12211 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12212 header_map.append(
12213 ::reqwest::header::HeaderName::from_static("api-version"),
12214 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12215 );
12216 #[allow(unused_mut)]
12217 let mut request = self
12218 .client
12219 .get(url)
12220 .header(
12221 ::reqwest::header::ACCEPT,
12222 ::reqwest::header::HeaderValue::from_static("application/json"),
12223 )
12224 .headers(header_map)
12225 .build()?;
12226 let info = OperationInfo {
12227 operation_id: "get_org_billing_usage",
12228 };
12229 self.pre(&mut request, &info).await?;
12230 let result = self.exec(request, &info).await;
12231 self.post(&result, &info).await?;
12232 let response = result?;
12233 match response.status().as_u16() {
12234 200u16 => ResponseValue::from_response(response).await,
12235 _ => Err(Error::UnexpectedResponse(response)),
12236 }
12237 }
12238 pub async fn get_org_permissions<'a>(
12244 &'a self,
12245 id: &'a str,
12246 ) -> Result<ResponseValue<types::OrgPermissionsResponse>, Error<()>> {
12247 let url = format!(
12248 "{}/orgs/{}/permissions",
12249 self.baseurl,
12250 encode_path(&id.to_string()),
12251 );
12252 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12253 header_map.append(
12254 ::reqwest::header::HeaderName::from_static("api-version"),
12255 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12256 );
12257 #[allow(unused_mut)]
12258 let mut request = self
12259 .client
12260 .get(url)
12261 .header(
12262 ::reqwest::header::ACCEPT,
12263 ::reqwest::header::HeaderValue::from_static("application/json"),
12264 )
12265 .headers(header_map)
12266 .build()?;
12267 let info = OperationInfo {
12268 operation_id: "get_org_permissions",
12269 };
12270 self.pre(&mut request, &info).await?;
12271 let result = self.exec(request, &info).await;
12272 self.post(&result, &info).await?;
12273 let response = result?;
12274 match response.status().as_u16() {
12275 200u16 => ResponseValue::from_response(response).await,
12276 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
12277 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
12278 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
12279 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
12280 _ => Err(Error::UnexpectedResponse(response)),
12281 }
12282 }
12283 pub async fn hard_delete_org<'a>(
12289 &'a self,
12290 id: &'a str,
12291 include_deleted: Option<bool>,
12292 include_metadata: Option<bool>,
12293 ) -> Result<ResponseValue<types::OrganizationResponse>, Error<types::ApiErrorResponse>> {
12294 let url = format!(
12295 "{}/orgs/{}/purge",
12296 self.baseurl,
12297 encode_path(&id.to_string()),
12298 );
12299 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12300 header_map.append(
12301 ::reqwest::header::HeaderName::from_static("api-version"),
12302 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12303 );
12304 #[allow(unused_mut)]
12305 let mut request = self
12306 .client
12307 .delete(url)
12308 .header(
12309 ::reqwest::header::ACCEPT,
12310 ::reqwest::header::HeaderValue::from_static("application/json"),
12311 )
12312 .query(&progenitor_client::QueryParam::new(
12313 "include_deleted",
12314 &include_deleted,
12315 ))
12316 .query(&progenitor_client::QueryParam::new(
12317 "include_metadata",
12318 &include_metadata,
12319 ))
12320 .headers(header_map)
12321 .build()?;
12322 let info = OperationInfo {
12323 operation_id: "hard_delete_org",
12324 };
12325 self.pre(&mut request, &info).await?;
12326 let result = self.exec(request, &info).await;
12327 self.post(&result, &info).await?;
12328 let response = result?;
12329 match response.status().as_u16() {
12330 200u16 => ResponseValue::from_response(response).await,
12331 400u16 => Err(Error::ErrorResponse(
12332 ResponseValue::from_response(response).await?,
12333 )),
12334 401u16 => Err(Error::ErrorResponse(
12335 ResponseValue::from_response(response).await?,
12336 )),
12337 403u16 => Err(Error::ErrorResponse(
12338 ResponseValue::from_response(response).await?,
12339 )),
12340 404u16 => Err(Error::ErrorResponse(
12341 ResponseValue::from_response(response).await?,
12342 )),
12343 409u16 => Err(Error::ErrorResponse(
12344 ResponseValue::from_response(response).await?,
12345 )),
12346 422u16 => Err(Error::ErrorResponse(
12347 ResponseValue::from_response(response).await?,
12348 )),
12349 500u16 => Err(Error::ErrorResponse(
12350 ResponseValue::from_response(response).await?,
12351 )),
12352 _ => Err(Error::UnexpectedResponse(response)),
12353 }
12354 }
12355 pub async fn list_org_users<'a>(
12370 &'a self,
12371 org_id: &'a str,
12372 include_deleted: bool,
12373 include_metadata: bool,
12374 limit: Option<i32>,
12375 offset: Option<i32>,
12376 only_deleted: bool,
12377 recursive: Option<bool>,
12378 x_org: &'a str,
12379 ) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
12380 let url = format!(
12381 "{}/orgs/{}/users",
12382 self.baseurl,
12383 encode_path(&org_id.to_string()),
12384 );
12385 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
12386 header_map.append(
12387 ::reqwest::header::HeaderName::from_static("api-version"),
12388 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12389 );
12390 header_map.append("X-Org", x_org.to_string().try_into()?);
12391 #[allow(unused_mut)]
12392 let mut request = self
12393 .client
12394 .get(url)
12395 .header(
12396 ::reqwest::header::ACCEPT,
12397 ::reqwest::header::HeaderValue::from_static("application/json"),
12398 )
12399 .query(&progenitor_client::QueryParam::new(
12400 "include_deleted",
12401 &include_deleted,
12402 ))
12403 .query(&progenitor_client::QueryParam::new(
12404 "include_metadata",
12405 &include_metadata,
12406 ))
12407 .query(&progenitor_client::QueryParam::new("limit", &limit))
12408 .query(&progenitor_client::QueryParam::new("offset", &offset))
12409 .query(&progenitor_client::QueryParam::new(
12410 "only_deleted",
12411 &only_deleted,
12412 ))
12413 .query(&progenitor_client::QueryParam::new("recursive", &recursive))
12414 .headers(header_map)
12415 .build()?;
12416 let info = OperationInfo {
12417 operation_id: "list_org_users",
12418 };
12419 self.pre(&mut request, &info).await?;
12420 let result = self.exec(request, &info).await;
12421 self.post(&result, &info).await?;
12422 let response = result?;
12423 match response.status().as_u16() {
12424 200u16 => ResponseValue::from_response(response).await,
12425 400u16 => Err(Error::ErrorResponse(
12426 ResponseValue::from_response(response).await?,
12427 )),
12428 401u16 => Err(Error::ErrorResponse(
12429 ResponseValue::from_response(response).await?,
12430 )),
12431 403u16 => Err(Error::ErrorResponse(
12432 ResponseValue::from_response(response).await?,
12433 )),
12434 404u16 => Err(Error::ErrorResponse(
12435 ResponseValue::from_response(response).await?,
12436 )),
12437 500u16 => Err(Error::ErrorResponse(
12438 ResponseValue::from_response(response).await?,
12439 )),
12440 _ => Err(Error::UnexpectedResponse(response)),
12441 }
12442 }
12443 pub async fn get_plans<'a>(&'a self) -> Result<ResponseValue<types::PlansResponse>, Error<()>> {
12447 let url = format!("{}/plans", self.baseurl,);
12448 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12449 header_map.append(
12450 ::reqwest::header::HeaderName::from_static("api-version"),
12451 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12452 );
12453 #[allow(unused_mut)]
12454 let mut request = self
12455 .client
12456 .get(url)
12457 .header(
12458 ::reqwest::header::ACCEPT,
12459 ::reqwest::header::HeaderValue::from_static("application/json"),
12460 )
12461 .headers(header_map)
12462 .build()?;
12463 let info = OperationInfo {
12464 operation_id: "get_plans",
12465 };
12466 self.pre(&mut request, &info).await?;
12467 let result = self.exec(request, &info).await;
12468 self.post(&result, &info).await?;
12469 let response = result?;
12470 match response.status().as_u16() {
12471 200u16 => ResponseValue::from_response(response).await,
12472 _ => Err(Error::UnexpectedResponse(response)),
12473 }
12474 }
12475 pub async fn get_public_invite<'a>(
12479 &'a self,
12480 invite_token: &'a str,
12481 ) -> Result<ResponseValue<types::PublicInviteResponse>, Error<types::ApiErrorResponse>> {
12482 let url = format!(
12483 "{}/public/access/invites/{}",
12484 self.baseurl,
12485 encode_path(&invite_token.to_string()),
12486 );
12487 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12488 header_map.append(
12489 ::reqwest::header::HeaderName::from_static("api-version"),
12490 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12491 );
12492 #[allow(unused_mut)]
12493 let mut request = self
12494 .client
12495 .get(url)
12496 .header(
12497 ::reqwest::header::ACCEPT,
12498 ::reqwest::header::HeaderValue::from_static("application/json"),
12499 )
12500 .headers(header_map)
12501 .build()?;
12502 let info = OperationInfo {
12503 operation_id: "get_public_invite",
12504 };
12505 self.pre(&mut request, &info).await?;
12506 let result = self.exec(request, &info).await;
12507 self.post(&result, &info).await?;
12508 let response = result?;
12509 match response.status().as_u16() {
12510 200u16 => ResponseValue::from_response(response).await,
12511 400u16 => Err(Error::ErrorResponse(
12512 ResponseValue::from_response(response).await?,
12513 )),
12514 _ => Err(Error::UnexpectedResponse(response)),
12515 }
12516 }
12517 pub async fn post_public_invite_claim<'a>(
12521 &'a self,
12522 invite_token: &'a str,
12523 ) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
12524 let url = format!(
12525 "{}/public/access/invites/{}/claim",
12526 self.baseurl,
12527 encode_path(&invite_token.to_string()),
12528 );
12529 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12530 header_map.append(
12531 ::reqwest::header::HeaderName::from_static("api-version"),
12532 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12533 );
12534 #[allow(unused_mut)]
12535 let mut request = self
12536 .client
12537 .post(url)
12538 .header(
12539 ::reqwest::header::ACCEPT,
12540 ::reqwest::header::HeaderValue::from_static("application/json"),
12541 )
12542 .headers(header_map)
12543 .build()?;
12544 let info = OperationInfo {
12545 operation_id: "post_public_invite_claim",
12546 };
12547 self.pre(&mut request, &info).await?;
12548 let result = self.exec(request, &info).await;
12549 self.post(&result, &info).await?;
12550 let response = result?;
12551 match response.status().as_u16() {
12552 200u16 => Ok(ResponseValue::empty(response)),
12553 401u16 => Err(Error::ErrorResponse(
12554 ResponseValue::from_response(response).await?,
12555 )),
12556 _ => Err(Error::UnexpectedResponse(response)),
12557 }
12558 }
12559 pub async fn post_public_invite_execute<'a>(
12563 &'a self,
12564 invite_token: &'a str,
12565 body: &'a types::PublicInviteExecuteRequest,
12566 ) -> Result<ResponseValue<types::PublicInviteExecuteResponse>, Error<types::ApiErrorResponse>>
12567 {
12568 let url = format!(
12569 "{}/public/access/invites/{}/execute",
12570 self.baseurl,
12571 encode_path(&invite_token.to_string()),
12572 );
12573 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12574 header_map.append(
12575 ::reqwest::header::HeaderName::from_static("api-version"),
12576 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12577 );
12578 #[allow(unused_mut)]
12579 let mut request = self
12580 .client
12581 .post(url)
12582 .header(
12583 ::reqwest::header::ACCEPT,
12584 ::reqwest::header::HeaderValue::from_static("application/json"),
12585 )
12586 .json(&body)
12587 .headers(header_map)
12588 .build()?;
12589 let info = OperationInfo {
12590 operation_id: "post_public_invite_execute",
12591 };
12592 self.pre(&mut request, &info).await?;
12593 let result = self.exec(request, &info).await;
12594 self.post(&result, &info).await?;
12595 let response = result?;
12596 match response.status().as_u16() {
12597 200u16 => ResponseValue::from_response(response).await,
12598 403u16 => Err(Error::ErrorResponse(
12599 ResponseValue::from_response(response).await?,
12600 )),
12601 404u16 => Err(Error::ErrorResponse(
12602 ResponseValue::from_response(response).await?,
12603 )),
12604 _ => Err(Error::UnexpectedResponse(response)),
12605 }
12606 }
12607 pub async fn post_public_invite_session<'a>(
12611 &'a self,
12612 invite_token: &'a str,
12613 ) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
12614 let url = format!(
12615 "{}/public/access/invites/{}/session",
12616 self.baseurl,
12617 encode_path(&invite_token.to_string()),
12618 );
12619 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12620 header_map.append(
12621 ::reqwest::header::HeaderName::from_static("api-version"),
12622 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12623 );
12624 #[allow(unused_mut)]
12625 let mut request = self
12626 .client
12627 .post(url)
12628 .header(
12629 ::reqwest::header::ACCEPT,
12630 ::reqwest::header::HeaderValue::from_static("application/json"),
12631 )
12632 .headers(header_map)
12633 .build()?;
12634 let info = OperationInfo {
12635 operation_id: "post_public_invite_session",
12636 };
12637 self.pre(&mut request, &info).await?;
12638 let result = self.exec(request, &info).await;
12639 self.post(&result, &info).await?;
12640 let response = result?;
12641 match response.status().as_u16() {
12642 200u16 => Ok(ResponseValue::empty(response)),
12643 400u16 => Err(Error::ErrorResponse(
12644 ResponseValue::from_response(response).await?,
12645 )),
12646 _ => Err(Error::UnexpectedResponse(response)),
12647 }
12648 }
12649 pub async fn get_public_portal<'a>(
12653 &'a self,
12654 public_portal_id: &'a str,
12655 ) -> Result<ResponseValue<types::PublicPortalResponse>, Error<types::ApiErrorResponse>> {
12656 let url = format!(
12657 "{}/public/access/portals/{}",
12658 self.baseurl,
12659 encode_path(&public_portal_id.to_string()),
12660 );
12661 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12662 header_map.append(
12663 ::reqwest::header::HeaderName::from_static("api-version"),
12664 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12665 );
12666 #[allow(unused_mut)]
12667 let mut request = self
12668 .client
12669 .get(url)
12670 .header(
12671 ::reqwest::header::ACCEPT,
12672 ::reqwest::header::HeaderValue::from_static("application/json"),
12673 )
12674 .headers(header_map)
12675 .build()?;
12676 let info = OperationInfo {
12677 operation_id: "get_public_portal",
12678 };
12679 self.pre(&mut request, &info).await?;
12680 let result = self.exec(request, &info).await;
12681 self.post(&result, &info).await?;
12682 let response = result?;
12683 match response.status().as_u16() {
12684 200u16 => ResponseValue::from_response(response).await,
12685 404u16 => Err(Error::ErrorResponse(
12686 ResponseValue::from_response(response).await?,
12687 )),
12688 _ => Err(Error::UnexpectedResponse(response)),
12689 }
12690 }
12691 pub async fn post_public_portal_lights<'a>(
12695 &'a self,
12696 public_portal_id: &'a str,
12697 ) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
12698 let url = format!(
12699 "{}/public/access/portals/{}/lights",
12700 self.baseurl,
12701 encode_path(&public_portal_id.to_string()),
12702 );
12703 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12704 header_map.append(
12705 ::reqwest::header::HeaderName::from_static("api-version"),
12706 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12707 );
12708 #[allow(unused_mut)]
12709 let mut request = self
12710 .client
12711 .post(url)
12712 .header(
12713 ::reqwest::header::ACCEPT,
12714 ::reqwest::header::HeaderValue::from_static("application/json"),
12715 )
12716 .headers(header_map)
12717 .build()?;
12718 let info = OperationInfo {
12719 operation_id: "post_public_portal_lights",
12720 };
12721 self.pre(&mut request, &info).await?;
12722 let result = self.exec(request, &info).await;
12723 self.post(&result, &info).await?;
12724 let response = result?;
12725 match response.status().as_u16() {
12726 200u16 => Ok(ResponseValue::empty(response)),
12727 403u16 => Err(Error::ErrorResponse(
12728 ResponseValue::from_response(response).await?,
12729 )),
12730 _ => Err(Error::UnexpectedResponse(response)),
12731 }
12732 }
12733 pub async fn post_public_portal_open<'a>(
12737 &'a self,
12738 public_portal_id: &'a str,
12739 ) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
12740 let url = format!(
12741 "{}/public/access/portals/{}/open",
12742 self.baseurl,
12743 encode_path(&public_portal_id.to_string()),
12744 );
12745 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12746 header_map.append(
12747 ::reqwest::header::HeaderName::from_static("api-version"),
12748 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12749 );
12750 #[allow(unused_mut)]
12751 let mut request = self
12752 .client
12753 .post(url)
12754 .header(
12755 ::reqwest::header::ACCEPT,
12756 ::reqwest::header::HeaderValue::from_static("application/json"),
12757 )
12758 .headers(header_map)
12759 .build()?;
12760 let info = OperationInfo {
12761 operation_id: "post_public_portal_open",
12762 };
12763 self.pre(&mut request, &info).await?;
12764 let result = self.exec(request, &info).await;
12765 self.post(&result, &info).await?;
12766 let response = result?;
12767 match response.status().as_u16() {
12768 200u16 => Ok(ResponseValue::empty(response)),
12769 403u16 => Err(Error::ErrorResponse(
12770 ResponseValue::from_response(response).await?,
12771 )),
12772 _ => Err(Error::UnexpectedResponse(response)),
12773 }
12774 }
12775 pub async fn get_public_portal_reachable<'a>(
12779 &'a self,
12780 public_portal_id: &'a str,
12781 ) -> Result<ResponseValue<types::PublicPortalReachableResponse>, Error<types::ApiErrorResponse>>
12782 {
12783 let url = format!(
12784 "{}/public/access/portals/{}/reachable",
12785 self.baseurl,
12786 encode_path(&public_portal_id.to_string()),
12787 );
12788 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12789 header_map.append(
12790 ::reqwest::header::HeaderName::from_static("api-version"),
12791 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12792 );
12793 #[allow(unused_mut)]
12794 let mut request = self
12795 .client
12796 .get(url)
12797 .header(
12798 ::reqwest::header::ACCEPT,
12799 ::reqwest::header::HeaderValue::from_static("application/json"),
12800 )
12801 .headers(header_map)
12802 .build()?;
12803 let info = OperationInfo {
12804 operation_id: "get_public_portal_reachable",
12805 };
12806 self.pre(&mut request, &info).await?;
12807 let result = self.exec(request, &info).await;
12808 self.post(&result, &info).await?;
12809 let response = result?;
12810 match response.status().as_u16() {
12811 200u16 => ResponseValue::from_response(response).await,
12812 404u16 => Err(Error::ErrorResponse(
12813 ResponseValue::from_response(response).await?,
12814 )),
12815 _ => Err(Error::UnexpectedResponse(response)),
12816 }
12817 }
12818 pub async fn post_public_portal_sessions<'a>(
12822 &'a self,
12823 public_portal_id: &'a str,
12824 body: &'a types::PublicPortalCreateSessionRequest,
12825 ) -> Result<
12826 ResponseValue<types::PublicPortalCreateSessionResponse>,
12827 Error<types::ApiErrorResponse>,
12828 > {
12829 let url = format!(
12830 "{}/public/access/portals/{}/sessions",
12831 self.baseurl,
12832 encode_path(&public_portal_id.to_string()),
12833 );
12834 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12835 header_map.append(
12836 ::reqwest::header::HeaderName::from_static("api-version"),
12837 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12838 );
12839 #[allow(unused_mut)]
12840 let mut request = self
12841 .client
12842 .post(url)
12843 .header(
12844 ::reqwest::header::ACCEPT,
12845 ::reqwest::header::HeaderValue::from_static("application/json"),
12846 )
12847 .json(&body)
12848 .headers(header_map)
12849 .build()?;
12850 let info = OperationInfo {
12851 operation_id: "post_public_portal_sessions",
12852 };
12853 self.pre(&mut request, &info).await?;
12854 let result = self.exec(request, &info).await;
12855 self.post(&result, &info).await?;
12856 let response = result?;
12857 match response.status().as_u16() {
12858 200u16 => ResponseValue::from_response(response).await,
12859 400u16 => Err(Error::ErrorResponse(
12860 ResponseValue::from_response(response).await?,
12861 )),
12862 403u16 => Err(Error::ErrorResponse(
12863 ResponseValue::from_response(response).await?,
12864 )),
12865 404u16 => Err(Error::ErrorResponse(
12866 ResponseValue::from_response(response).await?,
12867 )),
12868 _ => Err(Error::UnexpectedResponse(response)),
12869 }
12870 }
12871 pub async fn get_public_portal_targets<'a>(
12875 &'a self,
12876 public_portal_id: &'a str,
12877 ) -> Result<ResponseValue<types::PublicPortalTargetsResponse>, Error<types::ApiErrorResponse>>
12878 {
12879 let url = format!(
12880 "{}/public/access/portals/{}/targets",
12881 self.baseurl,
12882 encode_path(&public_portal_id.to_string()),
12883 );
12884 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12885 header_map.append(
12886 ::reqwest::header::HeaderName::from_static("api-version"),
12887 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12888 );
12889 #[allow(unused_mut)]
12890 let mut request = self
12891 .client
12892 .get(url)
12893 .header(
12894 ::reqwest::header::ACCEPT,
12895 ::reqwest::header::HeaderValue::from_static("application/json"),
12896 )
12897 .headers(header_map)
12898 .build()?;
12899 let info = OperationInfo {
12900 operation_id: "get_public_portal_targets",
12901 };
12902 self.pre(&mut request, &info).await?;
12903 let result = self.exec(request, &info).await;
12904 self.post(&result, &info).await?;
12905 let response = result?;
12906 match response.status().as_u16() {
12907 200u16 => ResponseValue::from_response(response).await,
12908 404u16 => Err(Error::ErrorResponse(
12909 ResponseValue::from_response(response).await?,
12910 )),
12911 _ => Err(Error::UnexpectedResponse(response)),
12912 }
12913 }
12914 pub async fn get_public_session<'a>(
12921 &'a self,
12922 session_id: &'a str,
12923 token: Option<&'a str>,
12924 ) -> Result<ResponseValue<types::PublicSessionResponse>, Error<types::ApiErrorResponse>> {
12925 let url = format!(
12926 "{}/public/access/sessions/{}",
12927 self.baseurl,
12928 encode_path(&session_id.to_string()),
12929 );
12930 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12931 header_map.append(
12932 ::reqwest::header::HeaderName::from_static("api-version"),
12933 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12934 );
12935 #[allow(unused_mut)]
12936 let mut request = self
12937 .client
12938 .get(url)
12939 .header(
12940 ::reqwest::header::ACCEPT,
12941 ::reqwest::header::HeaderValue::from_static("application/json"),
12942 )
12943 .query(&progenitor_client::QueryParam::new("token", &token))
12944 .headers(header_map)
12945 .build()?;
12946 let info = OperationInfo {
12947 operation_id: "get_public_session",
12948 };
12949 self.pre(&mut request, &info).await?;
12950 let result = self.exec(request, &info).await;
12951 self.post(&result, &info).await?;
12952 let response = result?;
12953 match response.status().as_u16() {
12954 200u16 => ResponseValue::from_response(response).await,
12955 401u16 => Err(Error::ErrorResponse(
12956 ResponseValue::from_response(response).await?,
12957 )),
12958 403u16 => Err(Error::ErrorResponse(
12959 ResponseValue::from_response(response).await?,
12960 )),
12961 404u16 => Err(Error::ErrorResponse(
12962 ResponseValue::from_response(response).await?,
12963 )),
12964 _ => Err(Error::UnexpectedResponse(response)),
12965 }
12966 }
12967 pub async fn post_public_session_cancel<'a>(
12973 &'a self,
12974 session_id: &'a str,
12975 token: Option<&'a str>,
12976 ) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
12977 let url = format!(
12978 "{}/public/access/sessions/{}/cancel",
12979 self.baseurl,
12980 encode_path(&session_id.to_string()),
12981 );
12982 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
12983 header_map.append(
12984 ::reqwest::header::HeaderName::from_static("api-version"),
12985 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
12986 );
12987 #[allow(unused_mut)]
12988 let mut request = self
12989 .client
12990 .post(url)
12991 .header(
12992 ::reqwest::header::ACCEPT,
12993 ::reqwest::header::HeaderValue::from_static("application/json"),
12994 )
12995 .query(&progenitor_client::QueryParam::new("token", &token))
12996 .headers(header_map)
12997 .build()?;
12998 let info = OperationInfo {
12999 operation_id: "post_public_session_cancel",
13000 };
13001 self.pre(&mut request, &info).await?;
13002 let result = self.exec(request, &info).await;
13003 self.post(&result, &info).await?;
13004 let response = result?;
13005 match response.status().as_u16() {
13006 200u16 => Ok(ResponseValue::empty(response)),
13007 403u16 => Err(Error::ErrorResponse(
13008 ResponseValue::from_response(response).await?,
13009 )),
13010 404u16 => Err(Error::ErrorResponse(
13011 ResponseValue::from_response(response).await?,
13012 )),
13013 _ => Err(Error::UnexpectedResponse(response)),
13014 }
13015 }
13016 pub async fn post_public_session_decline<'a>(
13022 &'a self,
13023 session_id: &'a str,
13024 token: Option<&'a str>,
13025 ) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
13026 let url = format!(
13027 "{}/public/access/sessions/{}/decline",
13028 self.baseurl,
13029 encode_path(&session_id.to_string()),
13030 );
13031 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
13032 header_map.append(
13033 ::reqwest::header::HeaderName::from_static("api-version"),
13034 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13035 );
13036 #[allow(unused_mut)]
13037 let mut request = self
13038 .client
13039 .post(url)
13040 .header(
13041 ::reqwest::header::ACCEPT,
13042 ::reqwest::header::HeaderValue::from_static("application/json"),
13043 )
13044 .query(&progenitor_client::QueryParam::new("token", &token))
13045 .headers(header_map)
13046 .build()?;
13047 let info = OperationInfo {
13048 operation_id: "post_public_session_decline",
13049 };
13050 self.pre(&mut request, &info).await?;
13051 let result = self.exec(request, &info).await;
13052 self.post(&result, &info).await?;
13053 let response = result?;
13054 match response.status().as_u16() {
13055 200u16 => Ok(ResponseValue::empty(response)),
13056 403u16 => Err(Error::ErrorResponse(
13057 ResponseValue::from_response(response).await?,
13058 )),
13059 404u16 => Err(Error::ErrorResponse(
13060 ResponseValue::from_response(response).await?,
13061 )),
13062 _ => Err(Error::UnexpectedResponse(response)),
13063 }
13064 }
13065 pub async fn post_public_session_lights<'a>(
13069 &'a self,
13070 session_id: &'a str,
13071 token: Option<&'a str>,
13072 ) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
13073 let url = format!(
13074 "{}/public/access/sessions/{}/lights",
13075 self.baseurl,
13076 encode_path(&session_id.to_string()),
13077 );
13078 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
13079 header_map.append(
13080 ::reqwest::header::HeaderName::from_static("api-version"),
13081 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13082 );
13083 #[allow(unused_mut)]
13084 let mut request = self
13085 .client
13086 .post(url)
13087 .header(
13088 ::reqwest::header::ACCEPT,
13089 ::reqwest::header::HeaderValue::from_static("application/json"),
13090 )
13091 .query(&progenitor_client::QueryParam::new("token", &token))
13092 .headers(header_map)
13093 .build()?;
13094 let info = OperationInfo {
13095 operation_id: "post_public_session_lights",
13096 };
13097 self.pre(&mut request, &info).await?;
13098 let result = self.exec(request, &info).await;
13099 self.post(&result, &info).await?;
13100 let response = result?;
13101 match response.status().as_u16() {
13102 200u16 => Ok(ResponseValue::empty(response)),
13103 403u16 => Err(Error::ErrorResponse(
13104 ResponseValue::from_response(response).await?,
13105 )),
13106 404u16 => Err(Error::ErrorResponse(
13107 ResponseValue::from_response(response).await?,
13108 )),
13109 _ => Err(Error::UnexpectedResponse(response)),
13110 }
13111 }
13112 pub async fn post_public_session_notify_message<'a>(
13118 &'a self,
13119 session_id: &'a str,
13120 token: Option<&'a str>,
13121 body: &'a types::NotifyPortalMessageBody,
13122 ) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
13123 let url = format!(
13124 "{}/public/access/sessions/{}/notify-message",
13125 self.baseurl,
13126 encode_path(&session_id.to_string()),
13127 );
13128 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
13129 header_map.append(
13130 ::reqwest::header::HeaderName::from_static("api-version"),
13131 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13132 );
13133 #[allow(unused_mut)]
13134 let mut request = self
13135 .client
13136 .post(url)
13137 .header(
13138 ::reqwest::header::ACCEPT,
13139 ::reqwest::header::HeaderValue::from_static("application/json"),
13140 )
13141 .json(&body)
13142 .query(&progenitor_client::QueryParam::new("token", &token))
13143 .headers(header_map)
13144 .build()?;
13145 let info = OperationInfo {
13146 operation_id: "post_public_session_notify_message",
13147 };
13148 self.pre(&mut request, &info).await?;
13149 let result = self.exec(request, &info).await;
13150 self.post(&result, &info).await?;
13151 let response = result?;
13152 match response.status().as_u16() {
13153 200u16 => Ok(ResponseValue::empty(response)),
13154 400u16 => Err(Error::ErrorResponse(
13155 ResponseValue::from_response(response).await?,
13156 )),
13157 403u16 => Err(Error::ErrorResponse(
13158 ResponseValue::from_response(response).await?,
13159 )),
13160 404u16 => Err(Error::ErrorResponse(
13161 ResponseValue::from_response(response).await?,
13162 )),
13163 _ => Err(Error::UnexpectedResponse(response)),
13164 }
13165 }
13166 pub async fn post_public_session_open<'a>(
13170 &'a self,
13171 session_id: &'a str,
13172 token: Option<&'a str>,
13173 ) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
13174 let url = format!(
13175 "{}/public/access/sessions/{}/open",
13176 self.baseurl,
13177 encode_path(&session_id.to_string()),
13178 );
13179 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
13180 header_map.append(
13181 ::reqwest::header::HeaderName::from_static("api-version"),
13182 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13183 );
13184 #[allow(unused_mut)]
13185 let mut request = self
13186 .client
13187 .post(url)
13188 .header(
13189 ::reqwest::header::ACCEPT,
13190 ::reqwest::header::HeaderValue::from_static("application/json"),
13191 )
13192 .query(&progenitor_client::QueryParam::new("token", &token))
13193 .headers(header_map)
13194 .build()?;
13195 let info = OperationInfo {
13196 operation_id: "post_public_session_open",
13197 };
13198 self.pre(&mut request, &info).await?;
13199 let result = self.exec(request, &info).await;
13200 self.post(&result, &info).await?;
13201 let response = result?;
13202 match response.status().as_u16() {
13203 200u16 => Ok(ResponseValue::empty(response)),
13204 403u16 => Err(Error::ErrorResponse(
13205 ResponseValue::from_response(response).await?,
13206 )),
13207 404u16 => Err(Error::ErrorResponse(
13208 ResponseValue::from_response(response).await?,
13209 )),
13210 _ => Err(Error::UnexpectedResponse(response)),
13211 }
13212 }
13213 pub async fn get_public_session_streams<'a>(
13217 &'a self,
13218 session_id: &'a str,
13219 token: Option<&'a str>,
13220 ) -> Result<ResponseValue<types::PublicSessionStreamsResponse>, Error<types::ApiErrorResponse>>
13221 {
13222 let url = format!(
13223 "{}/public/access/sessions/{}/streams",
13224 self.baseurl,
13225 encode_path(&session_id.to_string()),
13226 );
13227 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
13228 header_map.append(
13229 ::reqwest::header::HeaderName::from_static("api-version"),
13230 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13231 );
13232 #[allow(unused_mut)]
13233 let mut request = self
13234 .client
13235 .get(url)
13236 .header(
13237 ::reqwest::header::ACCEPT,
13238 ::reqwest::header::HeaderValue::from_static("application/json"),
13239 )
13240 .query(&progenitor_client::QueryParam::new("token", &token))
13241 .headers(header_map)
13242 .build()?;
13243 let info = OperationInfo {
13244 operation_id: "get_public_session_streams",
13245 };
13246 self.pre(&mut request, &info).await?;
13247 let result = self.exec(request, &info).await;
13248 self.post(&result, &info).await?;
13249 let response = result?;
13250 match response.status().as_u16() {
13251 200u16 => ResponseValue::from_response(response).await,
13252 403u16 => Err(Error::ErrorResponse(
13253 ResponseValue::from_response(response).await?,
13254 )),
13255 404u16 => Err(Error::ErrorResponse(
13256 ResponseValue::from_response(response).await?,
13257 )),
13258 _ => Err(Error::UnexpectedResponse(response)),
13259 }
13260 }
13261 pub async fn execute_scripting<'a>(
13267 &'a self,
13268 body: &'a types::ExecuteScriptingRequest,
13269 ) -> Result<ResponseValue<types::ExecuteScriptingResponse>, Error<()>> {
13270 let url = format!("{}/scripting/execute", self.baseurl,);
13271 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
13272 header_map.append(
13273 ::reqwest::header::HeaderName::from_static("api-version"),
13274 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13275 );
13276 #[allow(unused_mut)]
13277 let mut request = self
13278 .client
13279 .post(url)
13280 .header(
13281 ::reqwest::header::ACCEPT,
13282 ::reqwest::header::HeaderValue::from_static("application/json"),
13283 )
13284 .json(&body)
13285 .headers(header_map)
13286 .build()?;
13287 let info = OperationInfo {
13288 operation_id: "execute_scripting",
13289 };
13290 self.pre(&mut request, &info).await?;
13291 let result = self.exec(request, &info).await;
13292 self.post(&result, &info).await?;
13293 let response = result?;
13294 match response.status().as_u16() {
13295 200u16 => ResponseValue::from_response(response).await,
13296 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
13297 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
13298 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
13299 _ => Err(Error::UnexpectedResponse(response)),
13300 }
13301 }
13302 pub async fn get_backend_status<'a>(
13308 &'a self,
13309 ) -> Result<ResponseValue<types::BackendStatus>, Error<()>> {
13310 let url = format!("{}/status", self.baseurl,);
13311 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
13312 header_map.append(
13313 ::reqwest::header::HeaderName::from_static("api-version"),
13314 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13315 );
13316 #[allow(unused_mut)]
13317 let mut request = self
13318 .client
13319 .get(url)
13320 .header(
13321 ::reqwest::header::ACCEPT,
13322 ::reqwest::header::HeaderValue::from_static("application/json"),
13323 )
13324 .headers(header_map)
13325 .build()?;
13326 let info = OperationInfo {
13327 operation_id: "get_backend_status",
13328 };
13329 self.pre(&mut request, &info).await?;
13330 let result = self.exec(request, &info).await;
13331 self.post(&result, &info).await?;
13332 let response = result?;
13333 match response.status().as_u16() {
13334 200u16 => ResponseValue::from_response(response).await,
13335 _ => Err(Error::UnexpectedResponse(response)),
13336 }
13337 }
13338 pub async fn create_user<'a>(
13344 &'a self,
13345 include_deleted: Option<bool>,
13346 include_metadata: Option<bool>,
13347 only_deleted: Option<bool>,
13348 x_org: &'a str,
13349 body: &'a types::CreateUserRequest,
13350 ) -> Result<ResponseValue<types::UserResponse>, Error<types::ApiErrorResponse>> {
13351 let url = format!("{}/users", self.baseurl,);
13352 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
13353 header_map.append(
13354 ::reqwest::header::HeaderName::from_static("api-version"),
13355 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13356 );
13357 header_map.append("X-Org", x_org.to_string().try_into()?);
13358 #[allow(unused_mut)]
13359 let mut request = self
13360 .client
13361 .post(url)
13362 .header(
13363 ::reqwest::header::ACCEPT,
13364 ::reqwest::header::HeaderValue::from_static("application/json"),
13365 )
13366 .json(&body)
13367 .query(&progenitor_client::QueryParam::new(
13368 "include_deleted",
13369 &include_deleted,
13370 ))
13371 .query(&progenitor_client::QueryParam::new(
13372 "include_metadata",
13373 &include_metadata,
13374 ))
13375 .query(&progenitor_client::QueryParam::new(
13376 "only_deleted",
13377 &only_deleted,
13378 ))
13379 .headers(header_map)
13380 .build()?;
13381 let info = OperationInfo {
13382 operation_id: "create_user",
13383 };
13384 self.pre(&mut request, &info).await?;
13385 let result = self.exec(request, &info).await;
13386 self.post(&result, &info).await?;
13387 let response = result?;
13388 match response.status().as_u16() {
13389 200u16 => ResponseValue::from_response(response).await,
13390 400u16 => Err(Error::ErrorResponse(
13391 ResponseValue::from_response(response).await?,
13392 )),
13393 401u16 => Err(Error::ErrorResponse(
13394 ResponseValue::from_response(response).await?,
13395 )),
13396 403u16 => Err(Error::ErrorResponse(
13397 ResponseValue::from_response(response).await?,
13398 )),
13399 409u16 => Err(Error::ErrorResponse(
13400 ResponseValue::from_response(response).await?,
13401 )),
13402 422u16 => Err(Error::ErrorResponse(
13403 ResponseValue::from_response(response).await?,
13404 )),
13405 500u16 => Err(Error::ErrorResponse(
13406 ResponseValue::from_response(response).await?,
13407 )),
13408 _ => Err(Error::UnexpectedResponse(response)),
13409 }
13410 }
13411 pub async fn search_users<'a>(
13424 &'a self,
13425 exclude_ids: Option<&'a str>,
13426 limit: Option<u64>,
13427 offset: Option<u64>,
13428 org_id: Option<&'a str>,
13429 q: Option<&'a str>,
13430 scope: Option<&'a str>,
13431 ) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
13432 let url = format!("{}/users/search", self.baseurl,);
13433 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
13434 header_map.append(
13435 ::reqwest::header::HeaderName::from_static("api-version"),
13436 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13437 );
13438 #[allow(unused_mut)]
13439 let mut request = self
13440 .client
13441 .get(url)
13442 .header(
13443 ::reqwest::header::ACCEPT,
13444 ::reqwest::header::HeaderValue::from_static("application/json"),
13445 )
13446 .query(&progenitor_client::QueryParam::new(
13447 "exclude_ids",
13448 &exclude_ids,
13449 ))
13450 .query(&progenitor_client::QueryParam::new("limit", &limit))
13451 .query(&progenitor_client::QueryParam::new("offset", &offset))
13452 .query(&progenitor_client::QueryParam::new("org_id", &org_id))
13453 .query(&progenitor_client::QueryParam::new("q", &q))
13454 .query(&progenitor_client::QueryParam::new("scope", &scope))
13455 .headers(header_map)
13456 .build()?;
13457 let info = OperationInfo {
13458 operation_id: "search_users",
13459 };
13460 self.pre(&mut request, &info).await?;
13461 let result = self.exec(request, &info).await;
13462 self.post(&result, &info).await?;
13463 let response = result?;
13464 match response.status().as_u16() {
13465 200u16 => ResponseValue::from_response(response).await,
13466 400u16 => Err(Error::ErrorResponse(
13467 ResponseValue::from_response(response).await?,
13468 )),
13469 401u16 => Err(Error::ErrorResponse(
13470 ResponseValue::from_response(response).await?,
13471 )),
13472 403u16 => Err(Error::ErrorResponse(
13473 ResponseValue::from_response(response).await?,
13474 )),
13475 500u16 => Err(Error::ErrorResponse(
13476 ResponseValue::from_response(response).await?,
13477 )),
13478 _ => Err(Error::UnexpectedResponse(response)),
13479 }
13480 }
13481 pub async fn get_user<'a>(
13487 &'a self,
13488 id: &'a str,
13489 include_deleted: Option<bool>,
13490 include_metadata: Option<bool>,
13491 x_org: &'a str,
13492 ) -> Result<ResponseValue<types::UserResponse>, Error<types::ApiErrorResponse>> {
13493 let url = format!("{}/users/{}", self.baseurl, encode_path(&id.to_string()),);
13494 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
13495 header_map.append(
13496 ::reqwest::header::HeaderName::from_static("api-version"),
13497 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13498 );
13499 header_map.append("X-Org", x_org.to_string().try_into()?);
13500 #[allow(unused_mut)]
13501 let mut request = self
13502 .client
13503 .get(url)
13504 .header(
13505 ::reqwest::header::ACCEPT,
13506 ::reqwest::header::HeaderValue::from_static("application/json"),
13507 )
13508 .query(&progenitor_client::QueryParam::new(
13509 "include_deleted",
13510 &include_deleted,
13511 ))
13512 .query(&progenitor_client::QueryParam::new(
13513 "include_metadata",
13514 &include_metadata,
13515 ))
13516 .headers(header_map)
13517 .build()?;
13518 let info = OperationInfo {
13519 operation_id: "get_user",
13520 };
13521 self.pre(&mut request, &info).await?;
13522 let result = self.exec(request, &info).await;
13523 self.post(&result, &info).await?;
13524 let response = result?;
13525 match response.status().as_u16() {
13526 200u16 => ResponseValue::from_response(response).await,
13527 400u16 => Err(Error::ErrorResponse(
13528 ResponseValue::from_response(response).await?,
13529 )),
13530 401u16 => Err(Error::ErrorResponse(
13531 ResponseValue::from_response(response).await?,
13532 )),
13533 403u16 => Err(Error::ErrorResponse(
13534 ResponseValue::from_response(response).await?,
13535 )),
13536 404u16 => Err(Error::ErrorResponse(
13537 ResponseValue::from_response(response).await?,
13538 )),
13539 500u16 => Err(Error::ErrorResponse(
13540 ResponseValue::from_response(response).await?,
13541 )),
13542 _ => Err(Error::UnexpectedResponse(response)),
13543 }
13544 }
13545 pub async fn update_user<'a>(
13551 &'a self,
13552 id: &'a str,
13553 include_deleted: Option<bool>,
13554 include_metadata: Option<bool>,
13555 x_org: &'a str,
13556 body: &'a types::UpdateUserRequest,
13557 ) -> Result<ResponseValue<types::UserResponse>, Error<types::ApiErrorResponse>> {
13558 let url = format!("{}/users/{}", self.baseurl, encode_path(&id.to_string()),);
13559 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
13560 header_map.append(
13561 ::reqwest::header::HeaderName::from_static("api-version"),
13562 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13563 );
13564 header_map.append("X-Org", x_org.to_string().try_into()?);
13565 #[allow(unused_mut)]
13566 let mut request = self
13567 .client
13568 .put(url)
13569 .header(
13570 ::reqwest::header::ACCEPT,
13571 ::reqwest::header::HeaderValue::from_static("application/json"),
13572 )
13573 .json(&body)
13574 .query(&progenitor_client::QueryParam::new(
13575 "include_deleted",
13576 &include_deleted,
13577 ))
13578 .query(&progenitor_client::QueryParam::new(
13579 "include_metadata",
13580 &include_metadata,
13581 ))
13582 .headers(header_map)
13583 .build()?;
13584 let info = OperationInfo {
13585 operation_id: "update_user",
13586 };
13587 self.pre(&mut request, &info).await?;
13588 let result = self.exec(request, &info).await;
13589 self.post(&result, &info).await?;
13590 let response = result?;
13591 match response.status().as_u16() {
13592 200u16 => ResponseValue::from_response(response).await,
13593 400u16 => Err(Error::ErrorResponse(
13594 ResponseValue::from_response(response).await?,
13595 )),
13596 401u16 => Err(Error::ErrorResponse(
13597 ResponseValue::from_response(response).await?,
13598 )),
13599 403u16 => Err(Error::ErrorResponse(
13600 ResponseValue::from_response(response).await?,
13601 )),
13602 404u16 => Err(Error::ErrorResponse(
13603 ResponseValue::from_response(response).await?,
13604 )),
13605 422u16 => Err(Error::ErrorResponse(
13606 ResponseValue::from_response(response).await?,
13607 )),
13608 500u16 => Err(Error::ErrorResponse(
13609 ResponseValue::from_response(response).await?,
13610 )),
13611 _ => Err(Error::UnexpectedResponse(response)),
13612 }
13613 }
13614 pub async fn delete_user<'a>(
13620 &'a self,
13621 id: &'a str,
13622 include_deleted: Option<bool>,
13623 include_metadata: Option<bool>,
13624 x_org: &'a str,
13625 ) -> Result<ResponseValue<types::UserResponse>, Error<types::ApiErrorResponse>> {
13626 let url = format!("{}/users/{}", self.baseurl, encode_path(&id.to_string()),);
13627 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
13628 header_map.append(
13629 ::reqwest::header::HeaderName::from_static("api-version"),
13630 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13631 );
13632 header_map.append("X-Org", x_org.to_string().try_into()?);
13633 #[allow(unused_mut)]
13634 let mut request = self
13635 .client
13636 .delete(url)
13637 .header(
13638 ::reqwest::header::ACCEPT,
13639 ::reqwest::header::HeaderValue::from_static("application/json"),
13640 )
13641 .query(&progenitor_client::QueryParam::new(
13642 "include_deleted",
13643 &include_deleted,
13644 ))
13645 .query(&progenitor_client::QueryParam::new(
13646 "include_metadata",
13647 &include_metadata,
13648 ))
13649 .headers(header_map)
13650 .build()?;
13651 let info = OperationInfo {
13652 operation_id: "delete_user",
13653 };
13654 self.pre(&mut request, &info).await?;
13655 let result = self.exec(request, &info).await;
13656 self.post(&result, &info).await?;
13657 let response = result?;
13658 match response.status().as_u16() {
13659 200u16 => ResponseValue::from_response(response).await,
13660 400u16 => Err(Error::ErrorResponse(
13661 ResponseValue::from_response(response).await?,
13662 )),
13663 401u16 => Err(Error::ErrorResponse(
13664 ResponseValue::from_response(response).await?,
13665 )),
13666 403u16 => Err(Error::ErrorResponse(
13667 ResponseValue::from_response(response).await?,
13668 )),
13669 404u16 => Err(Error::ErrorResponse(
13670 ResponseValue::from_response(response).await?,
13671 )),
13672 409u16 => Err(Error::ErrorResponse(
13673 ResponseValue::from_response(response).await?,
13674 )),
13675 422u16 => Err(Error::ErrorResponse(
13676 ResponseValue::from_response(response).await?,
13677 )),
13678 500u16 => Err(Error::ErrorResponse(
13679 ResponseValue::from_response(response).await?,
13680 )),
13681 _ => Err(Error::UnexpectedResponse(response)),
13682 }
13683 }
13684 pub async fn hard_delete_user<'a>(
13690 &'a self,
13691 id: &'a str,
13692 include_deleted: Option<bool>,
13693 include_metadata: Option<bool>,
13694 x_org: &'a str,
13695 ) -> Result<ResponseValue<types::UserResponse>, Error<types::ApiErrorResponse>> {
13696 let url = format!(
13697 "{}/users/{}/purge",
13698 self.baseurl,
13699 encode_path(&id.to_string()),
13700 );
13701 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
13702 header_map.append(
13703 ::reqwest::header::HeaderName::from_static("api-version"),
13704 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13705 );
13706 header_map.append("X-Org", x_org.to_string().try_into()?);
13707 #[allow(unused_mut)]
13708 let mut request = self
13709 .client
13710 .delete(url)
13711 .header(
13712 ::reqwest::header::ACCEPT,
13713 ::reqwest::header::HeaderValue::from_static("application/json"),
13714 )
13715 .query(&progenitor_client::QueryParam::new(
13716 "include_deleted",
13717 &include_deleted,
13718 ))
13719 .query(&progenitor_client::QueryParam::new(
13720 "include_metadata",
13721 &include_metadata,
13722 ))
13723 .headers(header_map)
13724 .build()?;
13725 let info = OperationInfo {
13726 operation_id: "hard_delete_user",
13727 };
13728 self.pre(&mut request, &info).await?;
13729 let result = self.exec(request, &info).await;
13730 self.post(&result, &info).await?;
13731 let response = result?;
13732 match response.status().as_u16() {
13733 200u16 => ResponseValue::from_response(response).await,
13734 400u16 => Err(Error::ErrorResponse(
13735 ResponseValue::from_response(response).await?,
13736 )),
13737 401u16 => Err(Error::ErrorResponse(
13738 ResponseValue::from_response(response).await?,
13739 )),
13740 403u16 => Err(Error::ErrorResponse(
13741 ResponseValue::from_response(response).await?,
13742 )),
13743 404u16 => Err(Error::ErrorResponse(
13744 ResponseValue::from_response(response).await?,
13745 )),
13746 409u16 => Err(Error::ErrorResponse(
13747 ResponseValue::from_response(response).await?,
13748 )),
13749 422u16 => Err(Error::ErrorResponse(
13750 ResponseValue::from_response(response).await?,
13751 )),
13752 500u16 => Err(Error::ErrorResponse(
13753 ResponseValue::from_response(response).await?,
13754 )),
13755 _ => Err(Error::UnexpectedResponse(response)),
13756 }
13757 }
13758 pub async fn add_roles<'a>(
13764 &'a self,
13765 id: &'a str,
13766 x_org: &'a str,
13767 body: &'a types::AddRolesRequest,
13768 ) -> Result<ResponseValue<types::UserResponse>, Error<()>> {
13769 let url = format!(
13770 "{}/users/{}/roles",
13771 self.baseurl,
13772 encode_path(&id.to_string()),
13773 );
13774 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
13775 header_map.append(
13776 ::reqwest::header::HeaderName::from_static("api-version"),
13777 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13778 );
13779 header_map.append("X-Org", x_org.to_string().try_into()?);
13780 #[allow(unused_mut)]
13781 let mut request = self
13782 .client
13783 .post(url)
13784 .header(
13785 ::reqwest::header::ACCEPT,
13786 ::reqwest::header::HeaderValue::from_static("application/json"),
13787 )
13788 .json(&body)
13789 .headers(header_map)
13790 .build()?;
13791 let info = OperationInfo {
13792 operation_id: "add_roles",
13793 };
13794 self.pre(&mut request, &info).await?;
13795 let result = self.exec(request, &info).await;
13796 self.post(&result, &info).await?;
13797 let response = result?;
13798 match response.status().as_u16() {
13799 200u16 => ResponseValue::from_response(response).await,
13800 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
13801 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
13802 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
13803 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
13804 _ => Err(Error::UnexpectedResponse(response)),
13805 }
13806 }
13807 pub async fn delete_roles<'a>(
13813 &'a self,
13814 id: &'a str,
13815 x_org: &'a str,
13816 body: &'a types::DeleteRolesRequest,
13817 ) -> Result<ResponseValue<types::UserResponse>, Error<()>> {
13818 let url = format!(
13819 "{}/users/{}/roles",
13820 self.baseurl,
13821 encode_path(&id.to_string()),
13822 );
13823 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
13824 header_map.append(
13825 ::reqwest::header::HeaderName::from_static("api-version"),
13826 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13827 );
13828 header_map.append("X-Org", x_org.to_string().try_into()?);
13829 #[allow(unused_mut)]
13830 let mut request = self
13831 .client
13832 .delete(url)
13833 .header(
13834 ::reqwest::header::ACCEPT,
13835 ::reqwest::header::HeaderValue::from_static("application/json"),
13836 )
13837 .json(&body)
13838 .headers(header_map)
13839 .build()?;
13840 let info = OperationInfo {
13841 operation_id: "delete_roles",
13842 };
13843 self.pre(&mut request, &info).await?;
13844 let result = self.exec(request, &info).await;
13845 self.post(&result, &info).await?;
13846 let response = result?;
13847 match response.status().as_u16() {
13848 200u16 => ResponseValue::from_response(response).await,
13849 400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
13850 401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
13851 403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
13852 404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
13853 _ => Err(Error::UnexpectedResponse(response)),
13854 }
13855 }
13856 pub async fn create_zone<'a>(
13862 &'a self,
13863 include_deleted: Option<bool>,
13864 include_metadata: Option<bool>,
13865 x_org: &'a str,
13866 body: &'a types::CreateZoneRequest,
13867 ) -> Result<ResponseValue<types::ZoneResponse>, Error<types::ApiErrorResponse>> {
13868 let url = format!("{}/zones", self.baseurl,);
13869 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
13870 header_map.append(
13871 ::reqwest::header::HeaderName::from_static("api-version"),
13872 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13873 );
13874 header_map.append("X-Org", x_org.to_string().try_into()?);
13875 #[allow(unused_mut)]
13876 let mut request = self
13877 .client
13878 .post(url)
13879 .header(
13880 ::reqwest::header::ACCEPT,
13881 ::reqwest::header::HeaderValue::from_static("application/json"),
13882 )
13883 .json(&body)
13884 .query(&progenitor_client::QueryParam::new(
13885 "include_deleted",
13886 &include_deleted,
13887 ))
13888 .query(&progenitor_client::QueryParam::new(
13889 "include_metadata",
13890 &include_metadata,
13891 ))
13892 .headers(header_map)
13893 .build()?;
13894 let info = OperationInfo {
13895 operation_id: "create_zone",
13896 };
13897 self.pre(&mut request, &info).await?;
13898 let result = self.exec(request, &info).await;
13899 self.post(&result, &info).await?;
13900 let response = result?;
13901 match response.status().as_u16() {
13902 200u16 => ResponseValue::from_response(response).await,
13903 400u16 => Err(Error::ErrorResponse(
13904 ResponseValue::from_response(response).await?,
13905 )),
13906 401u16 => Err(Error::ErrorResponse(
13907 ResponseValue::from_response(response).await?,
13908 )),
13909 403u16 => Err(Error::ErrorResponse(
13910 ResponseValue::from_response(response).await?,
13911 )),
13912 404u16 => Err(Error::ErrorResponse(
13913 ResponseValue::from_response(response).await?,
13914 )),
13915 422u16 => Err(Error::ErrorResponse(
13916 ResponseValue::from_response(response).await?,
13917 )),
13918 500u16 => Err(Error::ErrorResponse(
13919 ResponseValue::from_response(response).await?,
13920 )),
13921 _ => Err(Error::UnexpectedResponse(response)),
13922 }
13923 }
13924 pub async fn get_zone<'a>(
13930 &'a self,
13931 id: &'a str,
13932 include_deleted: Option<bool>,
13933 include_metadata: Option<bool>,
13934 x_org: &'a str,
13935 ) -> Result<ResponseValue<types::ZoneResponse>, Error<types::ApiErrorResponse>> {
13936 let url = format!("{}/zones/{}", self.baseurl, encode_path(&id.to_string()),);
13937 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
13938 header_map.append(
13939 ::reqwest::header::HeaderName::from_static("api-version"),
13940 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
13941 );
13942 header_map.append("X-Org", x_org.to_string().try_into()?);
13943 #[allow(unused_mut)]
13944 let mut request = self
13945 .client
13946 .get(url)
13947 .header(
13948 ::reqwest::header::ACCEPT,
13949 ::reqwest::header::HeaderValue::from_static("application/json"),
13950 )
13951 .query(&progenitor_client::QueryParam::new(
13952 "include_deleted",
13953 &include_deleted,
13954 ))
13955 .query(&progenitor_client::QueryParam::new(
13956 "include_metadata",
13957 &include_metadata,
13958 ))
13959 .headers(header_map)
13960 .build()?;
13961 let info = OperationInfo {
13962 operation_id: "get_zone",
13963 };
13964 self.pre(&mut request, &info).await?;
13965 let result = self.exec(request, &info).await;
13966 self.post(&result, &info).await?;
13967 let response = result?;
13968 match response.status().as_u16() {
13969 200u16 => ResponseValue::from_response(response).await,
13970 400u16 => Err(Error::ErrorResponse(
13971 ResponseValue::from_response(response).await?,
13972 )),
13973 401u16 => Err(Error::ErrorResponse(
13974 ResponseValue::from_response(response).await?,
13975 )),
13976 403u16 => Err(Error::ErrorResponse(
13977 ResponseValue::from_response(response).await?,
13978 )),
13979 404u16 => Err(Error::ErrorResponse(
13980 ResponseValue::from_response(response).await?,
13981 )),
13982 500u16 => Err(Error::ErrorResponse(
13983 ResponseValue::from_response(response).await?,
13984 )),
13985 _ => Err(Error::UnexpectedResponse(response)),
13986 }
13987 }
13988 pub async fn update_zone<'a>(
13994 &'a self,
13995 id: &'a str,
13996 include_deleted: Option<bool>,
13997 include_metadata: Option<bool>,
13998 x_org: &'a str,
13999 body: &'a types::UpdateZoneRequest,
14000 ) -> Result<ResponseValue<types::ZoneResponse>, Error<types::ApiErrorResponse>> {
14001 let url = format!("{}/zones/{}", self.baseurl, encode_path(&id.to_string()),);
14002 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
14003 header_map.append(
14004 ::reqwest::header::HeaderName::from_static("api-version"),
14005 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
14006 );
14007 header_map.append("X-Org", x_org.to_string().try_into()?);
14008 #[allow(unused_mut)]
14009 let mut request = self
14010 .client
14011 .put(url)
14012 .header(
14013 ::reqwest::header::ACCEPT,
14014 ::reqwest::header::HeaderValue::from_static("application/json"),
14015 )
14016 .json(&body)
14017 .query(&progenitor_client::QueryParam::new(
14018 "include_deleted",
14019 &include_deleted,
14020 ))
14021 .query(&progenitor_client::QueryParam::new(
14022 "include_metadata",
14023 &include_metadata,
14024 ))
14025 .headers(header_map)
14026 .build()?;
14027 let info = OperationInfo {
14028 operation_id: "update_zone",
14029 };
14030 self.pre(&mut request, &info).await?;
14031 let result = self.exec(request, &info).await;
14032 self.post(&result, &info).await?;
14033 let response = result?;
14034 match response.status().as_u16() {
14035 200u16 => ResponseValue::from_response(response).await,
14036 400u16 => Err(Error::ErrorResponse(
14037 ResponseValue::from_response(response).await?,
14038 )),
14039 401u16 => Err(Error::ErrorResponse(
14040 ResponseValue::from_response(response).await?,
14041 )),
14042 403u16 => Err(Error::ErrorResponse(
14043 ResponseValue::from_response(response).await?,
14044 )),
14045 404u16 => Err(Error::ErrorResponse(
14046 ResponseValue::from_response(response).await?,
14047 )),
14048 422u16 => Err(Error::ErrorResponse(
14049 ResponseValue::from_response(response).await?,
14050 )),
14051 500u16 => Err(Error::ErrorResponse(
14052 ResponseValue::from_response(response).await?,
14053 )),
14054 _ => Err(Error::UnexpectedResponse(response)),
14055 }
14056 }
14057 pub async fn delete_zone<'a>(
14063 &'a self,
14064 id: &'a str,
14065 include_deleted: Option<bool>,
14066 include_metadata: Option<bool>,
14067 x_org: &'a str,
14068 ) -> Result<ResponseValue<types::ZoneResponse>, Error<types::ApiErrorResponse>> {
14069 let url = format!("{}/zones/{}", self.baseurl, encode_path(&id.to_string()),);
14070 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
14071 header_map.append(
14072 ::reqwest::header::HeaderName::from_static("api-version"),
14073 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
14074 );
14075 header_map.append("X-Org", x_org.to_string().try_into()?);
14076 #[allow(unused_mut)]
14077 let mut request = self
14078 .client
14079 .delete(url)
14080 .header(
14081 ::reqwest::header::ACCEPT,
14082 ::reqwest::header::HeaderValue::from_static("application/json"),
14083 )
14084 .query(&progenitor_client::QueryParam::new(
14085 "include_deleted",
14086 &include_deleted,
14087 ))
14088 .query(&progenitor_client::QueryParam::new(
14089 "include_metadata",
14090 &include_metadata,
14091 ))
14092 .headers(header_map)
14093 .build()?;
14094 let info = OperationInfo {
14095 operation_id: "delete_zone",
14096 };
14097 self.pre(&mut request, &info).await?;
14098 let result = self.exec(request, &info).await;
14099 self.post(&result, &info).await?;
14100 let response = result?;
14101 match response.status().as_u16() {
14102 200u16 => ResponseValue::from_response(response).await,
14103 400u16 => Err(Error::ErrorResponse(
14104 ResponseValue::from_response(response).await?,
14105 )),
14106 401u16 => Err(Error::ErrorResponse(
14107 ResponseValue::from_response(response).await?,
14108 )),
14109 403u16 => Err(Error::ErrorResponse(
14110 ResponseValue::from_response(response).await?,
14111 )),
14112 404u16 => Err(Error::ErrorResponse(
14113 ResponseValue::from_response(response).await?,
14114 )),
14115 422u16 => Err(Error::ErrorResponse(
14116 ResponseValue::from_response(response).await?,
14117 )),
14118 500u16 => Err(Error::ErrorResponse(
14119 ResponseValue::from_response(response).await?,
14120 )),
14121 _ => Err(Error::UnexpectedResponse(response)),
14122 }
14123 }
14124 pub async fn hard_delete_zone<'a>(
14130 &'a self,
14131 id: &'a str,
14132 include_deleted: Option<bool>,
14133 include_metadata: Option<bool>,
14134 x_org: &'a str,
14135 ) -> Result<ResponseValue<types::ZoneResponse>, Error<types::ApiErrorResponse>> {
14136 let url = format!(
14137 "{}/zones/{}/purge",
14138 self.baseurl,
14139 encode_path(&id.to_string()),
14140 );
14141 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
14142 header_map.append(
14143 ::reqwest::header::HeaderName::from_static("api-version"),
14144 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
14145 );
14146 header_map.append("X-Org", x_org.to_string().try_into()?);
14147 #[allow(unused_mut)]
14148 let mut request = self
14149 .client
14150 .delete(url)
14151 .header(
14152 ::reqwest::header::ACCEPT,
14153 ::reqwest::header::HeaderValue::from_static("application/json"),
14154 )
14155 .query(&progenitor_client::QueryParam::new(
14156 "include_deleted",
14157 &include_deleted,
14158 ))
14159 .query(&progenitor_client::QueryParam::new(
14160 "include_metadata",
14161 &include_metadata,
14162 ))
14163 .headers(header_map)
14164 .build()?;
14165 let info = OperationInfo {
14166 operation_id: "hard_delete_zone",
14167 };
14168 self.pre(&mut request, &info).await?;
14169 let result = self.exec(request, &info).await;
14170 self.post(&result, &info).await?;
14171 let response = result?;
14172 match response.status().as_u16() {
14173 200u16 => ResponseValue::from_response(response).await,
14174 400u16 => Err(Error::ErrorResponse(
14175 ResponseValue::from_response(response).await?,
14176 )),
14177 401u16 => Err(Error::ErrorResponse(
14178 ResponseValue::from_response(response).await?,
14179 )),
14180 403u16 => Err(Error::ErrorResponse(
14181 ResponseValue::from_response(response).await?,
14182 )),
14183 404u16 => Err(Error::ErrorResponse(
14184 ResponseValue::from_response(response).await?,
14185 )),
14186 422u16 => Err(Error::ErrorResponse(
14187 ResponseValue::from_response(response).await?,
14188 )),
14189 500u16 => Err(Error::ErrorResponse(
14190 ResponseValue::from_response(response).await?,
14191 )),
14192 _ => Err(Error::UnexpectedResponse(response)),
14193 }
14194 }
14195}
14196pub mod prelude {
14198 #[allow(unused_imports)]
14199 pub use super::Client;
14200}