// @generated by `just sdk::core::openapi-gen` — DO NOT EDIT.
// Source: packages/api-spec/openapi.json
#![allow(
clippy::all,
clippy::pedantic,
clippy::nursery,
clippy::restriction,
clippy::cargo,
dead_code,
missing_debug_implementations,
unused_imports,
unused_variables,
rust_2018_idioms
)]
#[allow(unused_imports)]
pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue};
#[allow(unused_imports)]
use progenitor_client::{ClientHooks, OperationInfo, RequestBuilderExt, encode_path};
/// Types used as operation parameters and responses.
#[allow(clippy::all)]
pub mod types {
/// Error types.
pub mod error {
/// Error from a `TryFrom` or `FromStr` implementation.
pub struct ConversionError(::std::borrow::Cow<'static, str>);
impl ::std::error::Error for ConversionError {}
impl ::std::fmt::Display for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Display::fmt(&self.0, f)
}
}
impl ::std::fmt::Debug for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
/**One contact named by an invitation.
Exactly one of `email`, `phone`, `user_id`, and `group_id` is set, and it must match
`contact_kind`. Free-form contacts are normalized on write: a phone becomes E.164 using
`phone_region` when it is not already international.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One contact named by an invitation.\n\nExactly one of `email`, `phone`, `user_id`, and `group_id` is set, and it must match\n`contact_kind`. Free-form contacts are normalized on write: a phone becomes E.164 using\n`phone_region` when it is not already international.",
/// "type": "object",
/// "required": [
/// "contact_kind"
/// ],
/// "properties": {
/// "contact_kind": {
/// "description": "`email`, `phone`, `user`, or `group`.",
/// "type": "string"
/// },
/// "display_name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "email": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "group_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "phone": {
/// "description": "E.164, or national format when `phone_region` is supplied.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "phone_region": {
/// "description": "ISO 3166-1 alpha-2 region used to normalize a national-format phone.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "user_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct AccessInviteContactInput {
///`email`, `phone`, `user`, or `group`.
pub contact_kind: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub display_name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub email: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub group_id: ::std::option::Option<::std::string::String>,
///E.164, or national format when `phone_region` is supplied.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone: ::std::option::Option<::std::string::String>,
///ISO 3166-1 alpha-2 region used to normalize a national-format phone.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone_region: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub user_id: ::std::option::Option<::std::string::String>,
}
///`AccessInviteGrantedPortal`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "is_linked",
/// "name",
/// "public_id"
/// ],
/// "properties": {
/// "id": {
/// "type": "string"
/// },
/// "is_linked": {
/// "description": "Whether the portal currently resolves to a live door device. When false the portal\nis misconfigured/unlinked and the invite UI shows it in a warning state.",
/// "type": "boolean"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "public_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccessInviteGrantedPortal {
pub id: ::std::string::String,
/**Whether the portal currently resolves to a live door device. When false the portal
is misconfigured/unlinked and the invite UI shows it in a warning state.*/
pub is_linked: bool,
pub name: LocalizedString,
pub public_id: ::std::string::String,
}
///`AccessInviteKind`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "invitation",
/// "share"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum AccessInviteKind {
#[serde(rename = "invitation")]
Invitation,
#[serde(rename = "share")]
Share,
}
impl ::std::fmt::Display for AccessInviteKind {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Invitation => f.write_str("invitation"),
Self::Share => f.write_str("share"),
}
}
}
impl ::std::str::FromStr for AccessInviteKind {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"invitation" => Ok(Self::Invitation),
"share" => Ok(Self::Share),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AccessInviteKind {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AccessInviteKind {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AccessInviteKind {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`AccessInviteListItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "granted_portals",
/// "id",
/// "is_enabled",
/// "location_mode",
/// "schedule",
/// "schedule_combined",
/// "schedule_entries",
/// "schedule_kind",
/// "state",
/// "uses"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "created_by_user_id": {
/// "description": "User who created this invite or share. Omitted when the row has no creator.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "creation_justification": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "curfew_exempt": {
/// "description": "Admin-only emergency exception: skip invitation curfew at redemption.",
/// "type": "boolean"
/// },
/// "devices_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "disabled_justification": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "external_ref": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ExternalReferenceResponse"
/// }
/// ]
/// }
/// ]
/// },
/// "granted_portals": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/AccessInviteGrantedPortal"
/// }
/// },
/// "id": {
/// "type": "string"
/// },
/// "invite_recurrence": {},
/// "invitee_message": {},
/// "is_enabled": {
/// "type": "boolean"
/// },
/// "kind": {
/// "$ref": "#/components/schemas/AccessInviteKind"
/// },
/// "last_shared_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "last_used_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "location": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocationResponse"
/// }
/// ]
/// }
/// ]
/// },
/// "location_mode": {
/// "$ref": "#/components/schemas/LocationBindingMode"
/// },
/// "max_devices": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "max_uses": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "pending_renewal_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "photo_thumb_url": {
/// "description": "Presigned URL for the `thumb` rendition of the invite photo, for avatar-sized renders.\nAbsent when the source is already thumb-sized; fall back to `photo_url`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "photo_url": {
/// "description": "Presigned URL for the invite's main photo (best-effort).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "revoked_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "schedule": {
/// "$ref": "#/components/schemas/InviteScheduleSnapshot"
/// },
/// "schedule_combined": {
/// "$ref": "#/components/schemas/InviteScheduleCombined"
/// },
/// "schedule_entries": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/InviteScheduleEntrySnapshot"
/// }
/// },
/// "schedule_kind": {
/// "$ref": "#/components/schemas/InviteScheduleKind"
/// },
/// "state": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "uses": {
/// "type": "integer",
/// "format": "int32"
/// },
/// "valid_from": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "valid_to": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccessInviteListItem {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
///User who created this invite or share. Omitted when the row has no creator.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_by_user_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub creation_justification: ::std::option::Option<::std::string::String>,
///Admin-only emergency exception: skip invitation curfew at redemption.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub curfew_exempt: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub devices_count: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub disabled_justification: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_ref: ::std::option::Option<ExternalReferenceResponse>,
pub granted_portals: ::std::vec::Vec<AccessInviteGrantedPortal>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invite_recurrence: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invitee_message: ::std::option::Option<::serde_json::Value>,
pub is_enabled: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub kind: ::std::option::Option<AccessInviteKind>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_shared_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_used_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub location: ::std::option::Option<LocationResponse>,
pub location_mode: LocationBindingMode,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_devices: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_uses: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub pending_renewal_count: ::std::option::Option<i32>,
/**Presigned URL for the `thumb` rendition of the invite photo, for avatar-sized renders.
Absent when the source is already thumb-sized; fall back to `photo_url`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub photo_thumb_url: ::std::option::Option<::std::string::String>,
///Presigned URL for the invite's main photo (best-effort).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub photo_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub revoked_at: ::std::option::Option<::std::string::String>,
pub schedule: InviteScheduleSnapshot,
pub schedule_combined: InviteScheduleCombined,
pub schedule_entries: ::std::vec::Vec<InviteScheduleEntrySnapshot>,
pub schedule_kind: InviteScheduleKind,
pub state: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
pub uses: i32,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub valid_from: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub valid_to: ::std::option::Option<::std::string::String>,
}
///`AccessInviteMessageMediaResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "expires_in_seconds",
/// "slot",
/// "url"
/// ],
/// "properties": {
/// "expires_in_seconds": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "slot": {
/// "type": "string"
/// },
/// "url": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccessInviteMessageMediaResponse {
pub expires_in_seconds: i64,
pub slot: ::std::string::String,
pub url: ::std::string::String,
}
///`AccessInviteRenewalRequestItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "requester_user_id"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "note": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "requester_name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "requester_user_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccessInviteRenewalRequestItem {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub note: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub requester_name: ::std::option::Option<::std::string::String>,
pub requester_user_id: ::std::string::String,
}
///`AccessPortalListItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "name",
/// "public_id"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "deleted_at": {
/// "description": "When set, the portal is soft-deleted (kept for restore).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "device_id": {
/// "description": "Door device id (virtual_access_portal in this integration). Canonical portal link key.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "directory_id": {
/// "description": "Directory device id (virtual_access_directory in this integration).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "public_id": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccessPortalListItem {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
///When set, the portal is soft-deleted (kept for restore).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::std::string::String>,
///Door device id (virtual_access_portal in this integration). Canonical portal link key.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub device_id: ::std::option::Option<::std::string::String>,
///Directory device id (virtual_access_directory in this integration).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub directory_id: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
pub name: LocalizedString,
pub public_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
///One friendly usage row.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One friendly usage row.",
/// "type": "object",
/// "required": [
/// "actor",
/// "id",
/// "occurred_at",
/// "outcome"
/// ],
/// "properties": {
/// "actor": {
/// "$ref": "#/components/schemas/UsageActor"
/// },
/// "door_name": {
/// "description": "Localized door/action name (plain string or `{ locale: name }`). Set on invite-usage rows."
/// },
/// "id": {
/// "description": "Source audit event id (ULID).",
/// "type": "string"
/// },
/// "invite_name": {
/// "description": "Localized invitation name. Set on door-usage rows opened via an invitation."
/// },
/// "occurred_at": {
/// "description": "RFC 3339 timestamp of the event.",
/// "type": "string"
/// },
/// "outcome": {
/// "description": "`succeeded` | `failed` | `denied`.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccessUsageEntry {
pub actor: UsageActor,
///Localized door/action name (plain string or `{ locale: name }`). Set on invite-usage rows.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub door_name: ::std::option::Option<::serde_json::Value>,
///Source audit event id (ULID).
pub id: ::std::string::String,
///Localized invitation name. Set on door-usage rows opened via an invitation.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invite_name: ::std::option::Option<::serde_json::Value>,
///RFC 3339 timestamp of the event.
pub occurred_at: ::std::string::String,
///`succeeded` | `failed` | `denied`.
pub outcome: ::std::string::String,
}
///`AccessUsageResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "entries"
/// ],
/// "properties": {
/// "entries": {
/// "description": "Newest first.",
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/AccessUsageEntry"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AccessUsageResponse {
///Newest first.
pub entries: ::std::vec::Vec<AccessUsageEntry>,
}
///`AddBillingMemberRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "user_id"
/// ],
/// "properties": {
/// "can_charge": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "user_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct AddBillingMemberRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub can_charge: ::std::option::Option<bool>,
pub user_id: ::std::string::String,
}
///`AddBuildingUserPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "role",
/// "user_id"
/// ],
/// "properties": {
/// "role": {
/// "type": "string"
/// },
/// "user_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct AddBuildingUserPayload {
pub role: ::std::string::String,
pub user_id: ::std::string::String,
}
///`AddDirectoryListingMemberPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "user_id"
/// ],
/// "properties": {
/// "date_of_birth": {
/// "description": "Parent-declared date of birth (`YYYY-MM-DD`). Required when `is_child` is true.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "is_child": {
/// "description": "When true, this household member is a child; date of birth is required.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "receives_calls": {
/// "description": "When omitted, defaults to false for minors and true for adults.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "role": {
/// "type": "string"
/// },
/// "user_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct AddDirectoryListingMemberPayload {
///Parent-declared date of birth (`YYYY-MM-DD`). Required when `is_child` is true.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub date_of_birth: ::std::option::Option<::std::string::String>,
///When true, this household member is a child; date of birth is required.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_child: ::std::option::Option<bool>,
///When omitted, defaults to false for minors and true for adults.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub receives_calls: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub role: ::std::option::Option<::std::string::String>,
pub user_id: ::std::string::String,
}
///`AddGroupMemberPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "user_id"
/// ],
/// "properties": {
/// "role": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "user_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct AddGroupMemberPayload {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub role: ::std::option::Option<::std::string::String>,
pub user_id: ::std::string::String,
}
///`AddMemberRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "user_id"
/// ],
/// "properties": {
/// "display_name": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "role": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "user_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct AddMemberRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub display_name: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub role: ::std::option::Option<::std::string::String>,
pub user_id: ::std::string::String,
}
///Request type for adding/deleting roles (org_id -> list of role names).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Request type for adding/deleting roles (org_id -> list of role names).",
/// "type": "object",
/// "additionalProperties": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/Role"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct AddRolesRequest(
pub ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
);
impl ::std::ops::Deref for AddRolesRequest {
type Target = ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>;
fn deref(
&self,
) -> &::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>> {
&self.0
}
}
impl ::std::convert::From<AddRolesRequest>
for ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>
{
fn from(value: AddRolesRequest) -> Self {
value.0
}
}
impl
::std::convert::From<
::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
> for AddRolesRequest
{
fn from(
value: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
) -> Self {
Self(value)
}
}
///`AdmissionDecisionPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "admitted"
/// ],
/// "properties": {
/// "admitted": {
/// "description": "true admits the member, false denies them. A denial is durable, so it does not resurface\nin the approval queue on every sync.",
/// "type": "boolean"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct AdmissionDecisionPayload {
/**true admits the member, false denies them. A denial is durable, so it does not resurface
in the approval queue on every sync.*/
pub admitted: bool,
}
///One row of the admission ledger, including members who were removed.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One row of the admission ledger, including members who were removed.",
/// "type": "object",
/// "required": [
/// "admission_count",
/// "member_ref",
/// "status"
/// ],
/// "properties": {
/// "admission_count": {
/// "type": "integer",
/// "format": "int32"
/// },
/// "admitted_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "denied_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "display_name": {},
/// "first_seen_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "member_ref": {
/// "type": "string"
/// },
/// "removed_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "status": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AdmissionResponse {
pub admission_count: i32,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub admitted_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub denied_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub display_name: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub first_seen_at: ::std::option::Option<::std::string::String>,
pub member_ref: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub removed_at: ::std::option::Option<::std::string::String>,
pub status: ::std::string::String,
}
/**Per-resource counts of the rows a transfer affects. Used both for the preview endpoint and to
gate target-org quota before any write happens.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Per-resource counts of the rows a transfer affects. Used both for the preview endpoint and to\ngate target-org quota before any write happens.",
/// "type": "object",
/// "required": [
/// "access_portals",
/// "devices",
/// "directory_listing_members",
/// "entities",
/// "invite_claims",
/// "invite_links",
/// "renewal_requests",
/// "sessions",
/// "zones"
/// ],
/// "properties": {
/// "access_portals": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "devices": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "directory_listing_members": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "entities": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "invite_claims": {
/// "description": "Ephemeral runtime rows; relevant to MOVE only (DUPLICATE does not clone them).",
/// "type": "integer",
/// "format": "int64"
/// },
/// "invite_links": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "renewal_requests": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "sessions": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "zones": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AffectedCounts {
pub access_portals: i64,
pub devices: i64,
pub directory_listing_members: i64,
pub entities: i64,
///Ephemeral runtime rows; relevant to MOVE only (DUPLICATE does not clone them).
pub invite_claims: i64,
pub invite_links: i64,
pub renewal_requests: i64,
pub sessions: i64,
pub zones: i64,
}
///Derived age class for call/portal limits. Not a marketing segment.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Derived age class for call/portal limits. Not a marketing segment.",
/// "type": "string",
/// "enum": [
/// "under_13",
/// "13_to_15",
/// "adult"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum AgeClass {
#[serde(rename = "under_13")]
Under13,
#[serde(rename = "13_to_15")]
X13To15,
#[serde(rename = "adult")]
Adult,
}
impl ::std::fmt::Display for AgeClass {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Under13 => f.write_str("under_13"),
Self::X13To15 => f.write_str("13_to_15"),
Self::Adult => f.write_str("adult"),
}
}
}
impl ::std::str::FromStr for AgeClass {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"under_13" => Ok(Self::Under13),
"13_to_15" => Ok(Self::X13To15),
"adult" => Ok(Self::Adult),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AgeClass {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AgeClass {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AgeClass {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`AgentResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "confirmation_mode",
/// "id",
/// "name",
/// "org_id",
/// "owner_user_id"
/// ],
/// "properties": {
/// "allowed_entity_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "allowed_portal_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "allowed_tool_names": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "confirmation_mode": {
/// "type": "string"
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "last_used_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": "string"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "owner_user_id": {
/// "type": "string"
/// },
/// "purpose": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "revoked_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AgentResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_entity_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_portal_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_tool_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub confirmation_mode: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_at: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_used_at: ::std::option::Option<::std::string::String>,
pub name: ::std::string::String,
pub org_id: ::std::string::String,
pub owner_user_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purpose: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub revoked_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
///`AliasResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "alias",
/// "id",
/// "org_id",
/// "resource_id",
/// "resource_type"
/// ],
/// "properties": {
/// "alias": {
/// "type": "string"
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "resource_id": {
/// "type": "string"
/// },
/// "resource_type": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AliasResponse {
pub alias: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
pub org_id: ::std::string::String,
pub resource_id: ::std::string::String,
pub resource_type: ::std::string::String,
}
///A minimal, user-facing error body for public API responses.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A minimal, user-facing error body for public API responses.",
/// "type": "object",
/// "required": [
/// "message"
/// ],
/// "properties": {
/// "correlationId": {
/// "description": "Server-generated correlation id that ties this error to the request trace and the\nmatching audit event (see the audit log). Present when the request carried one.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "error_code": {
/// "description": "Optional stable code for clients to branch on (e.g. \"door_unreachable\").",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "message": {
/// "type": "string"
/// },
/// "preview_token": {
/// "description": "Present when `error_code` is `confirmation_required` (retry with `X-OpenApp-Confirm`).",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ApiErrorResponse {
/**Server-generated correlation id that ties this error to the request trace and the
matching audit event (see the audit log). Present when the request carried one.*/
#[serde(
rename = "correlationId",
default,
skip_serializing_if = "::std::option::Option::is_none"
)]
pub correlation_id: ::std::option::Option<::std::string::String>,
///Optional stable code for clients to branch on (e.g. "door_unreachable").
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub error_code: ::std::option::Option<::std::string::String>,
pub message: ::std::string::String,
///Present when `error_code` is `confirmation_required` (retry with `X-OpenApp-Confirm`).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub preview_token: ::std::option::Option<::std::string::String>,
}
///Response for API key list item (no token).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Response for API key list item (no token).",
/// "type": "object",
/// "required": [
/// "base_url",
/// "expires_at",
/// "id",
/// "name",
/// "token_suffix"
/// ],
/// "properties": {
/// "base_url": {
/// "type": "string"
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_at": {
/// "type": "string"
/// },
/// "id": {
/// "type": "string"
/// },
/// "last_used_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": "string"
/// },
/// "revoked_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "scoped_entity_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "scoped_roles": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "token_suffix": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ApiKeyListItem {
pub base_url: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
pub expires_at: ::std::string::String,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_used_at: ::std::option::Option<::std::string::String>,
pub name: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub revoked_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub scoped_entity_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub scoped_roles: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub token_suffix: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
///`ApprovalDecisionResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "status"
/// ],
/// "properties": {
/// "approve_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "id": {
/// "type": "string"
/// },
/// "required_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "status": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ApprovalDecisionResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub approve_count: ::std::option::Option<i32>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub required_count: ::std::option::Option<i32>,
pub status: ::std::string::String,
}
///`ApprovalRequestResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "org_id",
/// "policy_id",
/// "requester_user_id"
/// ],
/// "properties": {
/// "approve_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "note": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "policy_id": {
/// "type": "string"
/// },
/// "requester_user_id": {
/// "type": "string"
/// },
/// "required_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "status": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "subject_kind": {
/// "description": "What the request is about, e.g. `invite`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "subject_label": {
/// "description": "Human-readable subject (invite name), not the raw kind/ref.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "subject_ref": {
/// "description": "Id of the subject (e.g. the disabled invite link awaiting approval).",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ApprovalRequestResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub approve_count: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub note: ::std::option::Option<::std::string::String>,
pub org_id: ::std::string::String,
pub policy_id: ::std::string::String,
pub requester_user_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub required_count: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub status: ::std::option::Option<::std::string::String>,
///What the request is about, e.g. `invite`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subject_kind: ::std::option::Option<::std::string::String>,
///Human-readable subject (invite name), not the raw kind/ref.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subject_label: ::std::option::Option<::std::string::String>,
///Id of the subject (e.g. the disabled invite link awaiting approval).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subject_ref: ::std::option::Option<::std::string::String>,
}
///Typed `config` shape for `approval_threshold`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Typed `config` shape for `approval_threshold`.",
/// "type": "object",
/// "required": [
/// "count",
/// "scope"
/// ],
/// "properties": {
/// "count": {
/// "description": "Number of distinct organization-admin approve votes required.",
/// "type": "integer",
/// "format": "int32",
/// "minimum": 1.0
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// },
/// "scope": {
/// "$ref": "#/components/schemas/ApprovalThresholdScope"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ApprovalThresholdPolicyConfig {
///Number of distinct organization-admin approve votes required.
pub count: ::std::num::NonZeroU32,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
pub scope: ApprovalThresholdScope,
}
///`ApprovalThresholdScope`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "org_admins"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ApprovalThresholdScope {
#[serde(rename = "org_admins")]
OrgAdmins,
}
impl ::std::fmt::Display for ApprovalThresholdScope {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::OrgAdmins => f.write_str("org_admins"),
}
}
}
impl ::std::str::FromStr for ApprovalThresholdScope {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"org_admins" => Ok(Self::OrgAdmins),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ApprovalThresholdScope {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ApprovalThresholdScope {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ApprovalThresholdScope {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`AuditEventsPage`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "items"
/// ],
/// "properties": {
/// "items": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/AuditRecord"
/// }
/// },
/// "next_cursor": {
/// "description": "Cursor for the next (older) page, or null when the last page was returned.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AuditEventsPage {
pub items: ::std::vec::Vec<AuditRecord>,
///Cursor for the next (older) page, or null when the last page was returned.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub next_cursor: ::std::option::Option<::std::string::String>,
}
///`AuditExportJob`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "format",
/// "id",
/// "org_id",
/// "status"
/// ],
/// "properties": {
/// "completed_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "download_url": {
/// "description": "Signed download URL, present only when `status = completed`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "error_message": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "format": {
/// "type": "string"
/// },
/// "id": {
/// "type": "string"
/// },
/// "occurred_after": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "occurred_before": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "row_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "status": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AuditExportJob {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub completed_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
///Signed download URL, present only when `status = completed`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub download_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub error_message: ::std::option::Option<::std::string::String>,
pub format: ::std::string::String,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub occurred_after: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub occurred_before: ::std::option::Option<::std::string::String>,
pub org_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub row_count: ::std::option::Option<i64>,
pub status: ::std::string::String,
}
/**Outcome of an audited action. `denied` (permission/quota refusal) is recorded too —
it is critical for security investigations.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Outcome of an audited action. `denied` (permission/quota refusal) is recorded too —\nit is critical for security investigations.",
/// "type": "string",
/// "enum": [
/// "succeeded",
/// "failed",
/// "denied"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum AuditOutcome {
#[serde(rename = "succeeded")]
Succeeded,
#[serde(rename = "failed")]
Failed,
#[serde(rename = "denied")]
Denied,
}
impl ::std::fmt::Display for AuditOutcome {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Succeeded => f.write_str("succeeded"),
Self::Failed => f.write_str("failed"),
Self::Denied => f.write_str("denied"),
}
}
}
impl ::std::str::FromStr for AuditOutcome {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"succeeded" => Ok(Self::Succeeded),
"failed" => Ok(Self::Failed),
"denied" => Ok(Self::Denied),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AuditOutcome {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AuditOutcome {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AuditOutcome {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**A persisted audit event. Serialized shape doubles as the webhook payload and the pull-API
response item.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A persisted audit event. Serialized shape doubles as the webhook payload and the pull-API\nresponse item.",
/// "type": "object",
/// "required": [
/// "actor_kind",
/// "details",
/// "event_type",
/// "id",
/// "occurred_at",
/// "org_id",
/// "outcome",
/// "source"
/// ],
/// "properties": {
/// "actor_agent_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "actor_api_key_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "actor_guest_id": {
/// "description": "Stable, client-supplied per-device guest fingerprint (ULID). Deliberately kept in its own\nfield, NEVER `actor_user_id`: a guest id is spoofable and must never be readable as a\ntrusted (registered) user identity, nor collide with the user-id population.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "actor_kind": {
/// "type": "string"
/// },
/// "actor_user_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "correlation_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "details": {},
/// "event_type": {
/// "type": "string"
/// },
/// "id": {
/// "description": "ULID; also the webhook idempotency key.",
/// "type": "string"
/// },
/// "occurred_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "outcome": {
/// "$ref": "#/components/schemas/AuditOutcome"
/// },
/// "resource_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "resource_type": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "source": {
/// "$ref": "#/components/schemas/AuditSource"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct AuditRecord {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub actor_agent_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub actor_api_key_id: ::std::option::Option<::std::string::String>,
/**Stable, client-supplied per-device guest fingerprint (ULID). Deliberately kept in its own
field, NEVER `actor_user_id`: a guest id is spoofable and must never be readable as a
trusted (registered) user identity, nor collide with the user-id population.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub actor_guest_id: ::std::option::Option<::std::string::String>,
pub actor_kind: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub actor_user_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub correlation_id: ::std::option::Option<::std::string::String>,
pub details: ::serde_json::Value,
pub event_type: ::std::string::String,
///ULID; also the webhook idempotency key.
pub id: ::std::string::String,
pub occurred_at: ::chrono::DateTime<::chrono::offset::Utc>,
pub org_id: ::std::string::String,
pub outcome: AuditOutcome,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub resource_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub resource_type: ::std::option::Option<::std::string::String>,
pub source: AuditSource,
}
///Surface that originated the action.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Surface that originated the action.",
/// "type": "string",
/// "enum": [
/// "api",
/// "dashboard",
/// "public_access",
/// "smarthome",
/// "scripting",
/// "system"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum AuditSource {
#[serde(rename = "api")]
Api,
#[serde(rename = "dashboard")]
Dashboard,
#[serde(rename = "public_access")]
PublicAccess,
#[serde(rename = "smarthome")]
Smarthome,
#[serde(rename = "scripting")]
Scripting,
#[serde(rename = "system")]
System,
}
impl ::std::fmt::Display for AuditSource {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Api => f.write_str("api"),
Self::Dashboard => f.write_str("dashboard"),
Self::PublicAccess => f.write_str("public_access"),
Self::Smarthome => f.write_str("smarthome"),
Self::Scripting => f.write_str("scripting"),
Self::System => f.write_str("system"),
}
}
}
impl ::std::str::FromStr for AuditSource {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"api" => Ok(Self::Api),
"dashboard" => Ok(Self::Dashboard),
"public_access" => Ok(Self::PublicAccess),
"smarthome" => Ok(Self::Smarthome),
"scripting" => Ok(Self::Scripting),
"system" => Ok(Self::System),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for AuditSource {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for AuditSource {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for AuditSource {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`BackendStatus`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "environment",
/// "version"
/// ],
/// "properties": {
/// "environment": {
/// "description": "Runtime environment (e.g. development, production).",
/// "type": "string"
/// },
/// "version": {
/// "description": "Application version from Cargo.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BackendStatus {
///Runtime environment (e.g. development, production).
pub environment: ::std::string::String,
///Application version from Cargo.
pub version: ::std::string::String,
}
/**The billable entity for purchases. By default each member has a personal account; grouping
multiple users into one account lets one user be billed to another's account.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The billable entity for purchases. By default each member has a personal account; grouping\nmultiple users into one account lets one user be billed to another's account.",
/// "type": "object",
/// "required": [
/// "id",
/// "name",
/// "org_id"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "deleted_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BillingAccount {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
pub name: LocalizedString,
pub org_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
///A user attached to a billing account. `can_charge` allows charging the account.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A user attached to a billing account. `can_charge` allows charging the account.",
/// "type": "object",
/// "required": [
/// "account_id",
/// "can_charge",
/// "user_id"
/// ],
/// "properties": {
/// "account_id": {
/// "type": "string"
/// },
/// "can_charge": {
/// "type": "boolean"
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "user_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BillingAccountMember {
pub account_id: ::std::string::String,
pub can_charge: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
pub user_id: ::std::string::String,
}
/**Provider-emitted event after webhook validation. Handlers translate this into
internal state (e.g. `billing_subscriptions` rows, tier_id changes on the org).*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Provider-emitted event after webhook validation. Handlers translate this into\ninternal state (e.g. `billing_subscriptions` rows, tier_id changes on the org).",
/// "type": "object",
/// "required": [
/// "kind",
/// "provider",
/// "raw"
/// ],
/// "properties": {
/// "external_customer_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "external_subscription_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "kind": {
/// "$ref": "#/components/schemas/BillingEventKind"
/// },
/// "provider": {
/// "type": "string"
/// },
/// "raw": {},
/// "status": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "tier_slug": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BillingEvent {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_customer_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_subscription_id: ::std::option::Option<::std::string::String>,
pub kind: BillingEventKind,
pub provider: ::std::string::String,
pub raw: ::serde_json::Value,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub status: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tier_slug: ::std::option::Option<::std::string::String>,
}
///`BillingEventKind`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "subscription_created",
/// "subscription_updated",
/// "subscription_canceled",
/// "invoice_paid",
/// "invoice_failed",
/// "other"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum BillingEventKind {
#[serde(rename = "subscription_created")]
SubscriptionCreated,
#[serde(rename = "subscription_updated")]
SubscriptionUpdated,
#[serde(rename = "subscription_canceled")]
SubscriptionCanceled,
#[serde(rename = "invoice_paid")]
InvoicePaid,
#[serde(rename = "invoice_failed")]
InvoiceFailed,
#[serde(rename = "other")]
Other,
}
impl ::std::fmt::Display for BillingEventKind {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::SubscriptionCreated => f.write_str("subscription_created"),
Self::SubscriptionUpdated => f.write_str("subscription_updated"),
Self::SubscriptionCanceled => f.write_str("subscription_canceled"),
Self::InvoicePaid => f.write_str("invoice_paid"),
Self::InvoiceFailed => f.write_str("invoice_failed"),
Self::Other => f.write_str("other"),
}
}
}
impl ::std::str::FromStr for BillingEventKind {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"subscription_created" => Ok(Self::SubscriptionCreated),
"subscription_updated" => Ok(Self::SubscriptionUpdated),
"subscription_canceled" => Ok(Self::SubscriptionCanceled),
"invoice_paid" => Ok(Self::InvoicePaid),
"invoice_failed" => Ok(Self::InvoiceFailed),
"other" => Ok(Self::Other),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for BillingEventKind {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for BillingEventKind {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for BillingEventKind {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`BillingPlanResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "org_id"
/// ],
/// "properties": {
/// "org_id": {
/// "type": "string"
/// },
/// "subscription": {},
/// "tier_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BillingPlanResponse {
pub org_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subscription: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tier_id: ::std::option::Option<::std::string::String>,
}
///`BuildingUserResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "listings",
/// "role",
/// "user_id"
/// ],
/// "properties": {
/// "listings": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "role": {
/// "type": "string"
/// },
/// "user_email": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "user_id": {
/// "type": "string"
/// },
/// "user_name": {}
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct BuildingUserResponse {
pub listings: ::std::vec::Vec<::std::string::String>,
pub role: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub user_email: ::std::option::Option<::std::string::String>,
pub user_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub user_name: ::std::option::Option<::serde_json::Value>,
}
/**A capacity-tracked resource type that participates in the lifecycle. (Org members are
intentionally excluded — they are never auto-deleted.)*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A capacity-tracked resource type that participates in the lifecycle. (Org members are\nintentionally excluded — they are never auto-deleted.)",
/// "type": "string",
/// "enum": [
/// "integrations",
/// "devices",
/// "zones",
/// "entities",
/// "api_keys"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum CapacityResource {
#[serde(rename = "integrations")]
Integrations,
#[serde(rename = "devices")]
Devices,
#[serde(rename = "zones")]
Zones,
#[serde(rename = "entities")]
Entities,
#[serde(rename = "api_keys")]
ApiKeys,
}
impl ::std::fmt::Display for CapacityResource {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Integrations => f.write_str("integrations"),
Self::Devices => f.write_str("devices"),
Self::Zones => f.write_str("zones"),
Self::Entities => f.write_str("entities"),
Self::ApiKeys => f.write_str("api_keys"),
}
}
}
impl ::std::str::FromStr for CapacityResource {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"integrations" => Ok(Self::Integrations),
"devices" => Ok(Self::Devices),
"zones" => Ok(Self::Zones),
"entities" => Ok(Self::Entities),
"api_keys" => Ok(Self::ApiKeys),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for CapacityResource {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for CapacityResource {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for CapacityResource {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`CheckoutRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "tier_slug"
/// ],
/// "properties": {
/// "tier_slug": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CheckoutRequest {
pub tier_slug: ::std::string::String,
}
///`ConflictingInviteResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id"
/// ],
/// "properties": {
/// "id": {
/// "type": "string"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ConflictingInviteResponse {
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
}
///`CopilotChatRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "message"
/// ],
/// "properties": {
/// "message": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CopilotChatRequest {
pub message: ::std::string::String,
}
///`CopilotChatResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "correlation_id",
/// "proposed_actions",
/// "replies"
/// ],
/// "properties": {
/// "correlation_id": {
/// "type": "string"
/// },
/// "proposed_actions": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/CopilotProposedAction"
/// }
/// },
/// "replies": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CopilotChatResponse {
pub correlation_id: ::std::string::String,
pub proposed_actions: ::std::vec::Vec<CopilotProposedAction>,
pub replies: ::std::vec::Vec<::std::string::String>,
}
///`CopilotCommitRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "actions"
/// ],
/// "properties": {
/// "actions": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/CopilotProposedAction"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CopilotCommitRequest {
pub actions: ::std::vec::Vec<CopilotProposedAction>,
}
///`CopilotCommitResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "correlation_id",
/// "results"
/// ],
/// "properties": {
/// "correlation_id": {
/// "type": "string"
/// },
/// "results": {
/// "type": "array",
/// "items": {}
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CopilotCommitResponse {
pub correlation_id: ::std::string::String,
pub results: ::std::vec::Vec<::serde_json::Value>,
}
///`CopilotProposedAction`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "args",
/// "tool"
/// ],
/// "properties": {
/// "args": {
/// "type": "object"
/// },
/// "preview": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "tool": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CopilotProposedAction {
pub args: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub preview: ::std::option::Option<::std::string::String>,
pub tool: ::std::string::String,
}
///`CopyDeviceImageRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "source_device_id"
/// ],
/// "properties": {
/// "source_device_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CopyDeviceImageRequest {
pub source_device_id: ::std::string::String,
}
///`CopyEntityImageRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "source_entity_id"
/// ],
/// "properties": {
/// "source_entity_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CopyEntityImageRequest {
pub source_entity_id: ::std::string::String,
}
///`CopyIntegrationImageRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "source_integration_id"
/// ],
/// "properties": {
/// "source_integration_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CopyIntegrationImageRequest {
pub source_integration_id: ::std::string::String,
}
///`CreateAccessInviteRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "portal_ids",
/// "schedules"
/// ],
/// "properties": {
/// "audience": {
/// "$ref": "#/components/schemas/InviteAudience"
/// },
/// "contacts": {
/// "description": "Who the invitation is for. Each contact is either free-form (an email address or a phone\nnumber) or drawn from the organization (a person or a group). Rejected for shares, which\ncarry no invitee identity. Empty when the link is open to anyone.",
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/AccessInviteContactInput"
/// }
/// },
/// "creation_justification": {
/// "description": "Why this invitation is being created (required when `invitation_require_justification` applies).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "curfew_exempt": {
/// "description": "Admin-only emergency exception: skip invitation curfew at redemption.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "external_ref": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ExternalReferenceInput"
/// }
/// ]
/// }
/// ]
/// },
/// "has_photo": {
/// "description": "True when the client will upload a photo immediately after create (media is a follow-up POST).",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "invitee_message": {},
/// "is_enabled": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "kind": {
/// "$ref": "#/components/schemas/AccessInviteKind"
/// },
/// "location_id": {
/// "description": "Reusable org-scoped location id to bind, only consumed when `location_mode` is `explicit`.\nCreate the location first via the locations API (which can geocode it), then reference it here.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "location_mode": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocationBindingMode"
/// }
/// ]
/// }
/// ]
/// },
/// "max_devices": {
/// "description": "Virtual keycard limit: max unique devices allowed to redeem/use this invite. JSON `null` or omitted means unlimited.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "max_uses": {
/// "description": "Omit to apply the share default (or leave invitations unlimited). JSON `null` means unlimited.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "pin": {
/// "description": "Host-chosen PIN (stored hashed). Required when `invitation_require_identity.require_pin`.\nJSON `null` means no PIN; omission leaves the create default unchanged.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "portal_ids": {
/// "description": "Portal ULIDs to grant. Array order is the display order on the public invite page.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "schedules": {
/// "description": "One or more validity windows. A single non-recurring entry is the ordinary case; a share is\nexactly one entry with no explicit start (it opens at request time).",
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/InviteScheduleEntryInput"
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateAccessInviteRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub audience: ::std::option::Option<InviteAudience>,
/**Who the invitation is for. Each contact is either free-form (an email address or a phone
number) or drawn from the organization (a person or a group). Rejected for shares, which
carry no invitee identity. Empty when the link is open to anyone.*/
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub contacts: ::std::vec::Vec<AccessInviteContactInput>,
///Why this invitation is being created (required when `invitation_require_justification` applies).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub creation_justification: ::std::option::Option<::std::string::String>,
///Admin-only emergency exception: skip invitation curfew at redemption.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub curfew_exempt: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_ref: ::std::option::Option<ExternalReferenceInput>,
///True when the client will upload a photo immediately after create (media is a follow-up POST).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub has_photo: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invitee_message: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_enabled: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub kind: ::std::option::Option<AccessInviteKind>,
/**Reusable org-scoped location id to bind, only consumed when `location_mode` is `explicit`.
Create the location first via the locations API (which can geocode it), then reference it here.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub location_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub location_mode: ::std::option::Option<LocationBindingMode>,
///Virtual keycard limit: max unique devices allowed to redeem/use this invite. JSON `null` or omitted means unlimited.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_devices: ::std::option::Option<i32>,
///Omit to apply the share default (or leave invitations unlimited). JSON `null` means unlimited.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_uses: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
/**Host-chosen PIN (stored hashed). Required when `invitation_require_identity.require_pin`.
JSON `null` means no PIN; omission leaves the create default unchanged.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub pin: ::std::option::Option<::std::string::String>,
///Portal ULIDs to grant. Array order is the display order on the public invite page.
pub portal_ids: ::std::vec::Vec<::std::string::String>,
/**One or more validity windows. A single non-recurring entry is the ordinary case; a share is
exactly one entry with no explicit start (it opens at request time).*/
pub schedules: ::std::vec::Vec<InviteScheduleEntryInput>,
}
///`CreateAccessInviteResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "granted_portals",
/// "invite_link_id",
/// "is_enabled",
/// "location_mode",
/// "schedule",
/// "schedule_combined",
/// "schedule_entries",
/// "schedule_kind",
/// "uses",
/// "valid_from",
/// "valid_to"
/// ],
/// "properties": {
/// "creation_justification": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "curfew_exempt": {
/// "description": "Admin-only emergency exception: skip invitation curfew at redemption.",
/// "type": "boolean"
/// },
/// "curfew_windows": {
/// "description": "Effective forbidden hour windows (informational; invites are never mutated).",
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/CurfewWindowResponse"
/// }
/// },
/// "devices_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "external_ref": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ExternalReferenceResponse"
/// }
/// ]
/// }
/// ]
/// },
/// "granted_portals": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/AccessInviteGrantedPortal"
/// }
/// },
/// "idempotent_replay": {
/// "description": "True when this body is a replay of an earlier create that carried the same\n`Idempotency-Key`. Nothing was created by this request and the one-time token fields are\nomitted.",
/// "type": "boolean"
/// },
/// "invite_link_id": {
/// "type": "string"
/// },
/// "invite_recurrence": {},
/// "invite_token": {
/// "description": "Guest bearer token, returned **once** by the original create call.\n\nIt is stored only as a hash, never logged, and never cached for idempotent replay, so a\nreplayed create response omits it. Persist it at delivery time or rotate it through\n`POST /access-invites/{id}/regenerate-token`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "invite_url": {
/// "description": "Guest-facing invite URL (shareable link for SMS/email). Same one-time visibility as\n`invite_token`, and subject to the same logging restrictions.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "invitee_message": {},
/// "is_enabled": {
/// "type": "boolean"
/// },
/// "kind": {
/// "$ref": "#/components/schemas/AccessInviteKind"
/// },
/// "location": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocationResponse"
/// }
/// ]
/// }
/// ]
/// },
/// "location_mode": {
/// "$ref": "#/components/schemas/LocationBindingMode"
/// },
/// "max_devices": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "max_uses": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "pending_approval": {
/// "description": "True when a `user_sharing` policy required admin approval: the invite was created disabled\nand an approval request is pending. The invite activates once an admin approves it.",
/// "type": "boolean"
/// },
/// "schedule": {
/// "$ref": "#/components/schemas/InviteScheduleSnapshot"
/// },
/// "schedule_combined": {
/// "$ref": "#/components/schemas/InviteScheduleCombined"
/// },
/// "schedule_entries": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/InviteScheduleEntrySnapshot"
/// }
/// },
/// "schedule_kind": {
/// "$ref": "#/components/schemas/InviteScheduleKind"
/// },
/// "timezone": {
/// "description": "Org IANA timezone used to evaluate invitation curfews.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "uses": {
/// "type": "integer",
/// "format": "int32"
/// },
/// "valid_from": {
/// "type": "string"
/// },
/// "valid_to": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateAccessInviteResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub creation_justification: ::std::option::Option<::std::string::String>,
///Admin-only emergency exception: skip invitation curfew at redemption.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub curfew_exempt: ::std::option::Option<bool>,
///Effective forbidden hour windows (informational; invites are never mutated).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub curfew_windows: ::std::option::Option<::std::vec::Vec<CurfewWindowResponse>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub devices_count: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_ref: ::std::option::Option<ExternalReferenceResponse>,
pub granted_portals: ::std::vec::Vec<AccessInviteGrantedPortal>,
/**True when this body is a replay of an earlier create that carried the same
`Idempotency-Key`. Nothing was created by this request and the one-time token fields are
omitted.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub idempotent_replay: ::std::option::Option<bool>,
pub invite_link_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invite_recurrence: ::std::option::Option<::serde_json::Value>,
/**Guest bearer token, returned **once** by the original create call.
It is stored only as a hash, never logged, and never cached for idempotent replay, so a
replayed create response omits it. Persist it at delivery time or rotate it through
`POST /access-invites/{id}/regenerate-token`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invite_token: ::std::option::Option<::std::string::String>,
/**Guest-facing invite URL (shareable link for SMS/email). Same one-time visibility as
`invite_token`, and subject to the same logging restrictions.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invite_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invitee_message: ::std::option::Option<::serde_json::Value>,
pub is_enabled: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub kind: ::std::option::Option<AccessInviteKind>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub location: ::std::option::Option<LocationResponse>,
pub location_mode: LocationBindingMode,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_devices: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_uses: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
/**True when a `user_sharing` policy required admin approval: the invite was created disabled
and an approval request is pending. The invite activates once an admin approves it.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub pending_approval: ::std::option::Option<bool>,
pub schedule: InviteScheduleSnapshot,
pub schedule_combined: InviteScheduleCombined,
pub schedule_entries: ::std::vec::Vec<InviteScheduleEntrySnapshot>,
pub schedule_kind: InviteScheduleKind,
///Org IANA timezone used to evaluate invitation curfews.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub timezone: ::std::option::Option<::std::string::String>,
pub uses: i32,
pub valid_from: ::std::string::String,
pub valid_to: ::std::string::String,
}
///`CreateAccessPortalRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "device_id": {
/// "description": "Door device id (virtual_access_portal device in this integration). Links the portal to a door.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "directory_id": {
/// "description": "Directory device id (virtual_access_directory in this integration).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateAccessPortalRequest {
///Door device id (virtual_access_portal device in this integration). Links the portal to a door.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub device_id: ::std::option::Option<::std::string::String>,
///Directory device id (virtual_access_directory in this integration).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub directory_id: ::std::option::Option<::std::string::String>,
pub name: LocalizedString,
}
///`CreateAccessPortalResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "name",
/// "public_id"
/// ],
/// "properties": {
/// "device_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "directory_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "public_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateAccessPortalResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub device_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub directory_id: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
pub name: LocalizedString,
pub public_id: ::std::string::String,
}
///`CreateAgentCredentialRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "expires_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_in": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateAgentCredentialRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_in: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for CreateAgentCredentialRequest {
fn default() -> Self {
Self {
expires_at: Default::default(),
expires_in: Default::default(),
name: Default::default(),
}
}
}
///`CreateAgentCredentialResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "agent_id",
/// "api_key_id",
/// "expires_at",
/// "token",
/// "token_suffix"
/// ],
/// "properties": {
/// "agent_id": {
/// "type": "string"
/// },
/// "api_key_id": {
/// "type": "string"
/// },
/// "expires_at": {
/// "type": "string"
/// },
/// "token": {
/// "type": "string"
/// },
/// "token_suffix": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateAgentCredentialResponse {
pub agent_id: ::std::string::String,
pub api_key_id: ::std::string::String,
pub expires_at: ::std::string::String,
pub token: ::std::string::String,
pub token_suffix: ::std::string::String,
}
///`CreateAgentRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "allowed_entity_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "allowed_portal_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "allowed_tool_names": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "confirmation_mode": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_in": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": "string"
/// },
/// "purpose": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateAgentRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_entity_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_portal_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_tool_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub confirmation_mode: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_in: ::std::option::Option<::std::string::String>,
pub name: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purpose: ::std::option::Option<::std::string::String>,
}
///`CreateAliasRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "alias",
/// "resource_id",
/// "resource_type"
/// ],
/// "properties": {
/// "alias": {
/// "type": "string"
/// },
/// "resource_id": {
/// "type": "string"
/// },
/// "resource_type": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateAliasRequest {
pub alias: ::std::string::String,
pub resource_id: ::std::string::String,
pub resource_type: ::std::string::String,
}
///`CreateApiKeyRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "expires_at": {
/// "description": "[RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) absolute expiration timestamp (UTC). Mutually exclusive with `expires_in`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_in": {
/// "description": "Duration per [RFC 5545 §3.3.6](https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.6) (ISO 8601 `P1D`, `PT1H`, …; no months/years) or compact tokens `s`/`m`/`h`/`d`/`w` (`M` is minutes). Max 3650d (10 years). `1y` is rejected. Mutually exclusive with `expires_at`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": "string"
/// },
/// "scoped_entity_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "scoped_roles": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateApiKeyRequest {
///[RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) absolute expiration timestamp (UTC). Mutually exclusive with `expires_in`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_at: ::std::option::Option<::std::string::String>,
///Duration per [RFC 5545 §3.3.6](https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.6) (ISO 8601 `P1D`, `PT1H`, …; no months/years) or compact tokens `s`/`m`/`h`/`d`/`w` (`M` is minutes). Max 3650d (10 years). `1y` is rejected. Mutually exclusive with `expires_at`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_in: ::std::option::Option<::std::string::String>,
pub name: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub scoped_entity_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub scoped_roles: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
///Response for API key creation (token shown once).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Response for API key creation (token shown once).",
/// "type": "object",
/// "required": [
/// "base_url",
/// "expires_at",
/// "id",
/// "name",
/// "token_suffix"
/// ],
/// "properties": {
/// "base_url": {
/// "type": "string"
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_at": {
/// "type": "string"
/// },
/// "id": {
/// "type": "string"
/// },
/// "name": {
/// "type": "string"
/// },
/// "scoped_entity_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "scoped_roles": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "token": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "token_suffix": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateApiKeyResponse {
pub base_url: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
pub expires_at: ::std::string::String,
pub id: ::std::string::String,
pub name: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub scoped_entity_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub scoped_roles: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub token: ::std::option::Option<::std::string::String>,
pub token_suffix: ::std::string::String,
}
///`CreateAuditExportRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "format": {
/// "description": "Output format: `jsonl` (default) or `csv`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "occurred_after": {
/// "description": "RFC 3339 lower bound (inclusive). Defaults to the start of retention.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "occurred_before": {
/// "description": "RFC 3339 upper bound (inclusive). Defaults to now.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateAuditExportRequest {
///Output format: `jsonl` (default) or `csv`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub format: ::std::option::Option<::std::string::String>,
///RFC 3339 lower bound (inclusive). Defaults to the start of retention.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub occurred_after: ::std::option::Option<::std::string::String>,
///RFC 3339 upper bound (inclusive). Defaults to now.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub occurred_before: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for CreateAuditExportRequest {
fn default() -> Self {
Self {
format: Default::default(),
occurred_after: Default::default(),
occurred_before: Default::default(),
}
}
}
///`CreateBillingAccountRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateBillingAccountRequest {
pub name: LocalizedString,
}
///`CreateDeviceRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "integration_id",
/// "name",
/// "org_id"
/// ],
/// "properties": {
/// "device_metadata": {},
/// "external_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "integration_id": {
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "org_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateDeviceRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub device_metadata: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
pub integration_id: ::std::string::String,
pub name: LocalizedString,
pub org_id: ::std::string::String,
}
///`CreateEntityRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "device_id",
/// "entity_type"
/// ],
/// "properties": {
/// "channel_index": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "device_id": {
/// "type": "string"
/// },
/// "entity_type": {
/// "type": "string"
/// },
/// "external_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "metadata": {
/// "description": "Arbitrary, persisted entity metadata (integration-specific).\n\nFor example, MQTT entities can store:\n- `command_topic`\n- `toggle_payload`\n\nValues are converted to strings (non-strings are JSON-stringified) to match `domain::Metadata`.",
/// "type": [
/// "object",
/// "null"
/// ],
/// "additionalProperties": {}
/// },
/// "name": {
/// "description": "Optional friendly name for the entity.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "zone_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateEntityRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub channel_index: ::std::option::Option<i32>,
pub device_id: ::std::string::String,
pub entity_type: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
/**Arbitrary, persisted entity metadata (integration-specific).
For example, MQTT entities can store:
- `command_topic`
- `toggle_payload`
Values are converted to strings (non-strings are JSON-stringified) to match `domain::Metadata`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub metadata:
::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
///Optional friendly name for the entity.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub zone_id: ::std::option::Option<::std::string::String>,
}
///`CreateGroupPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "description": {},
/// "kind": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {}
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateGroupPayload {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub kind: ::std::option::Option<::std::string::String>,
pub name: ::serde_json::Value,
}
///`CreateGroupShareOfferPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "expires_in_hours": {
/// "description": "Hours until the offer expires. Bounded so an offer cannot outlive the reason for it.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateGroupShareOfferPayload {
///Hours until the offer expires. Bounded so an offer cannot outlive the reason for it.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_in_hours: ::std::option::Option<i64>,
}
impl ::std::default::Default for CreateGroupShareOfferPayload {
fn default() -> Self {
Self {
expires_in_hours: Default::default(),
}
}
}
///`CreateHouseholdInvitation`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "email": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "phone": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateHouseholdInvitation {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub email: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for CreateHouseholdInvitation {
fn default() -> Self {
Self {
email: Default::default(),
phone: Default::default(),
}
}
}
///Payload for creating a household.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Payload for creating a household.",
/// "type": "object",
/// "properties": {
/// "name": {
/// "description": "Household name. Omit it to use the default derived from the caller.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateHouseholdPayload {
///Household name. Omit it to use the default derived from the caller.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for CreateHouseholdPayload {
fn default() -> Self {
Self {
name: Default::default(),
}
}
}
///`CreateIntegrationRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "org_id",
/// "provider_type"
/// ],
/// "properties": {
/// "config": {},
/// "enabled": {
/// "type": "boolean"
/// },
/// "name": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "non_admin_acknowledgment": {
/// "description": "Required when `linked_account_admin` is `warn_and_ack` and the PalGate probe is non-admin."
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "provider_type": {
/// "type": "string"
/// },
/// "secrets": {}
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateIntegrationRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub config: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub enabled: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<LocalizedString>,
///Required when `linked_account_admin` is `warn_and_ack` and the PalGate probe is non-admin.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub non_admin_acknowledgment: ::std::option::Option<::serde_json::Value>,
pub org_id: ::std::string::String,
pub provider_type: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub secrets: ::std::option::Option<::serde_json::Value>,
}
///`CreateInventoryRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "price_cents",
/// "product_id"
/// ],
/// "properties": {
/// "is_active": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "price_cents": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "product_id": {
/// "type": "string"
/// },
/// "stock_quantity": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateInventoryRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_active: ::std::option::Option<bool>,
pub price_cents: i64,
pub product_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub stock_quantity: ::std::option::Option<i32>,
}
///`CreateInvitationRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "default_roles": {
/// "description": "Roles to assign on accept (within the inviting org).",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "email": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "phone": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "site_access": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/InvitationSiteAccessDto"
/// }
/// ]
/// }
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateInvitationRequest {
///Roles to assign on accept (within the inviting org).
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub default_roles: ::std::vec::Vec<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub email: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub site_access: ::std::option::Option<InvitationSiteAccessDto>,
}
impl ::std::default::Default for CreateInvitationRequest {
fn default() -> Self {
Self {
default_roles: Default::default(),
email: Default::default(),
phone: Default::default(),
site_access: Default::default(),
}
}
}
///`CreateInvitationResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "invitation",
/// "redeem_url"
/// ],
/// "properties": {
/// "invitation": {
/// "$ref": "#/components/schemas/UserInvitationDto"
/// },
/// "redeem_url": {
/// "description": "Shareable redeem URL — surfaced once so the inviter can hand it off out-of-band\n(the PIN is never returned here).",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateInvitationResponse {
pub invitation: UserInvitationDto,
/**Shareable redeem URL — surfaced once so the inviter can hand it off out-of-band
(the PIN is never returned here).*/
pub redeem_url: ::std::string::String,
}
///`CreateLocationRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "kind"
/// ],
/// "properties": {
/// "city": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "country": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "formatted_address": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "geocode": {
/// "type": "boolean"
/// },
/// "geocoding_provider": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/GeocodingProviderId"
/// }
/// ]
/// }
/// ]
/// },
/// "kind": {
/// "$ref": "#/components/schemas/LocationKind"
/// },
/// "lat": {
/// "type": [
/// "number",
/// "null"
/// ],
/// "format": "double"
/// },
/// "lng": {
/// "type": [
/// "number",
/// "null"
/// ],
/// "format": "double"
/// },
/// "locale": {
/// "description": "Preferred locale (app code or BCP-47) for geocoding: controls the language of geocoded\ntext and the locale key it is tagged under. Defaults to `en` when omitted.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "notes": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "provider_place_id": {
/// "description": "Opaque place id issued by `geocoding_provider`. Both fields must be sent together: a place id\ncannot be resolved without naming its issuer.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateLocationRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub city: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub country: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub formatted_address: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub geocode: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub geocoding_provider: ::std::option::Option<GeocodingProviderId>,
pub kind: LocationKind,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lat: ::std::option::Option<f64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lng: ::std::option::Option<f64>,
/**Preferred locale (app code or BCP-47) for geocoding: controls the language of geocoded
text and the locale key it is tagged under. Defaults to `en` when omitted.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub locale: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub notes: ::std::option::Option<LocalizedString>,
/**Opaque place id issued by `geocoding_provider`. Both fields must be sent together: a place id
cannot be resolved without naming its issuer.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub provider_place_id: ::std::option::Option<::std::string::String>,
}
///`CreateOrganizationRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "description": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "description": "Optional ID parameter (admin-only, not documented in API docs).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "parent_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateOrganizationRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
///Optional ID parameter (admin-only, not documented in API docs).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub id: ::std::option::Option<::std::string::String>,
pub name: LocalizedString,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub parent_id: ::std::option::Option<::std::string::String>,
}
///`CreatePmsConnectorRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "name": {
/// "type": "string"
/// },
/// "provider": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreatePmsConnectorRequest {
pub name: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub provider: ::std::option::Option<::std::string::String>,
}
///`CreatePmsConnectorResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "name",
/// "provider",
/// "webhook_secret",
/// "webhook_url_path"
/// ],
/// "properties": {
/// "id": {
/// "type": "string"
/// },
/// "name": {
/// "type": "string"
/// },
/// "provider": {
/// "type": "string"
/// },
/// "webhook_secret": {
/// "type": "string"
/// },
/// "webhook_url_path": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreatePmsConnectorResponse {
pub id: ::std::string::String,
pub name: ::std::string::String,
pub provider: ::std::string::String,
pub webhook_secret: ::std::string::String,
pub webhook_url_path: ::std::string::String,
}
///`CreatePolicyRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "config",
/// "policy_type"
/// ],
/// "properties": {
/// "capability": {
/// "description": "Optional capability scoping (e.g. `switchable`, `users_admin`).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "config": {
/// "description": "Typed-per-`policy_type` configuration document. For the documented typed\nshapes, see `RequireStepUpPolicyConfig` and `ApprovalThresholdPolicyConfig`.",
/// "type": "object"
/// },
/// "enabled": {
/// "description": "Defaults to true.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "enforcement": {
/// "description": "`enforce` (default) | `require_approval` | `audit_only`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "policy_type": {
/// "description": "e.g. `invitation_curfew`, `user_sharing`.",
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreatePolicyRequest {
///Optional capability scoping (e.g. `switchable`, `users_admin`).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub capability: ::std::option::Option<::std::string::String>,
/**Typed-per-`policy_type` configuration document. For the documented typed
shapes, see `RequireStepUpPolicyConfig` and `ApprovalThresholdPolicyConfig`.*/
pub config: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
///Defaults to true.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub enabled: ::std::option::Option<bool>,
///`enforce` (default) | `require_approval` | `audit_only`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub enforcement: ::std::option::Option<::std::string::String>,
///e.g. `invitation_curfew`, `user_sharing`.
pub policy_type: ::std::string::String,
}
///`CreatePortalRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "branding_overrides": {
/// "type": [
/// "object",
/// "null"
/// ]
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreatePortalRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub branding_overrides:
::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
pub name: LocalizedString,
}
///`CreateScriptingExecutionRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "script"
/// ],
/// "properties": {
/// "script": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateScriptingExecutionRequest {
pub script: ::std::string::String,
}
///`CreateSkillRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "agent_id",
/// "name",
/// "steps",
/// "trigger_event_types"
/// ],
/// "properties": {
/// "agent_id": {
/// "type": "string"
/// },
/// "enabled": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "name": {
/// "type": "string"
/// },
/// "steps": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/SkillStep"
/// }
/// },
/// "trigger_event_types": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateSkillRequest {
pub agent_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub enabled: ::std::option::Option<bool>,
pub name: ::std::string::String,
pub steps: ::std::vec::Vec<SkillStep>,
pub trigger_event_types: ::std::vec::Vec<::std::string::String>,
}
///`CreateStoreRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "branding_overrides": {
/// "type": [
/// "object",
/// "null"
/// ]
/// },
/// "currency": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "timezone": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateStoreRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub branding_overrides:
::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub currency: ::std::option::Option<::std::string::String>,
pub name: LocalizedString,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub timezone: ::std::option::Option<::std::string::String>,
}
///`CreateUserRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "email": {
/// "description": "Login email. Omit for phone-only provisioning (Kratos uses `traits.phone` only; OpenApp\nstores a synthetic `{id}@phone.openapp.local` placeholder in `users.email`).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "first_name": {
/// "description": "Given name stored on the Kratos identity (`traits.name.first`) when creating the account.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "description": "Optional ID parameter (admin-only, not documented in API docs)\nThis field is intentionally not included in OpenAPI documentation",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "last_name": {
/// "description": "Family name stored on the Kratos identity (`traits.name.last`) when creating the account.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "password": {
/// "description": "Optional password for Kratos identity (provisioning only; same permission as id).\nWhen set, the Kratos identity is created with this password so the user can log in immediately.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "phone": {
/// "description": "E.164 phone (`+[country][digits]`). When set, must satisfy the same pattern as Kratos.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "roles": {
/// "description": "Org ID (string) to list of role names. Optional.",
/// "type": [
/// "object",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateUserRequest {
/**Login email. Omit for phone-only provisioning (Kratos uses `traits.phone` only; OpenApp
stores a synthetic `{id}@phone.openapp.local` placeholder in `users.email`).*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub email: ::std::option::Option<::std::string::String>,
///Given name stored on the Kratos identity (`traits.name.first`) when creating the account.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub first_name: ::std::option::Option<::std::string::String>,
/**Optional ID parameter (admin-only, not documented in API docs)
This field is intentionally not included in OpenAPI documentation*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub id: ::std::option::Option<::std::string::String>,
///Family name stored on the Kratos identity (`traits.name.last`) when creating the account.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_name: ::std::option::Option<::std::string::String>,
pub name: LocalizedString,
/**Optional password for Kratos identity (provisioning only; same permission as id).
When set, the Kratos identity is created with this password so the user can log in immediately.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub password: ::std::option::Option<::std::string::String>,
///E.164 phone (`+[country][digits]`). When set, must satisfy the same pattern as Kratos.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone: ::std::option::Option<::std::string::String>,
///Org ID (string) to list of role names. Optional.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub roles:
::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
}
///`CreateWebhookRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "url"
/// ],
/// "properties": {
/// "description": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "event_types": {
/// "description": "Event-type filter; omit or empty for all events.",
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "url": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateWebhookRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
///Event-type filter; omit or empty for all events.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub event_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub url: ::std::string::String,
}
///`CreateWebhookResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/WebhookEndpoint"
/// },
/// {
/// "type": "object",
/// "required": [
/// "signing_secret"
/// ],
/// "properties": {
/// "signing_secret": {
/// "description": "The HMAC signing secret, returned exactly once at creation. Store it securely; it is used to\nverify the `X-OpenApp-Signature` header on every delivery and is never returned again.",
/// "type": "string"
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CreateWebhookResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
pub enabled: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub event_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_delivery_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_delivery_status: ::std::option::Option<::std::string::String>,
pub org_id: ::std::string::String,
/**The HMAC signing secret, returned exactly once at creation. Store it securely; it is used to
verify the `X-OpenApp-Signature` header on every delivery and is never returned again.*/
pub signing_secret: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
pub url: ::std::string::String,
}
///`CreateZoneRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "integration_id",
/// "name"
/// ],
/// "properties": {
/// "external_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "integration_id": {
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "parent_zone_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct CreateZoneRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
pub integration_id: ::std::string::String,
pub name: LocalizedString,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub parent_zone_id: ::std::option::Option<::std::string::String>,
}
///`CurfewWindowResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "end",
/// "start"
/// ],
/// "properties": {
/// "end": {
/// "description": "Local clock `HH:MM`. Inclusive; may be earlier than `start` (midnight wrap).",
/// "type": "string"
/// },
/// "start": {
/// "description": "Local clock `HH:MM`.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct CurfewWindowResponse {
///Local clock `HH:MM`. Inclusive; may be earlier than `start` (midnight wrap).
pub end: ::std::string::String,
///Local clock `HH:MM`.
pub start: ::std::string::String,
}
///`DecideRegistrationRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "decision"
/// ],
/// "properties": {
/// "decision": {
/// "description": "`approve` or `reject`.",
/// "type": "string"
/// },
/// "display_name": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct DecideRegistrationRequest {
///`approve` or `reject`.
pub decision: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub display_name: ::std::option::Option<LocalizedString>,
}
///Lifecycle position of an org's over-capacity remediation.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Lifecycle position of an org's over-capacity remediation.",
/// "type": "string",
/// "enum": [
/// "none",
/// "warned",
/// "degraded",
/// "marked_for_delete"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum DegradationStage {
#[serde(rename = "none")]
None,
#[serde(rename = "warned")]
Warned,
#[serde(rename = "degraded")]
Degraded,
#[serde(rename = "marked_for_delete")]
MarkedForDelete,
}
impl ::std::fmt::Display for DegradationStage {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::None => f.write_str("none"),
Self::Warned => f.write_str("warned"),
Self::Degraded => f.write_str("degraded"),
Self::MarkedForDelete => f.write_str("marked_for_delete"),
}
}
}
impl ::std::str::FromStr for DegradationStage {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"none" => Ok(Self::None),
"warned" => Ok(Self::Warned),
"degraded" => Ok(Self::Degraded),
"marked_for_delete" => Ok(Self::MarkedForDelete),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for DegradationStage {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for DegradationStage {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for DegradationStage {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Full degradation snapshot for an org. Powers the dashboard panel + non-admin friction.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Full degradation snapshot for an org. Powers the dashboard panel + non-admin friction.",
/// "type": "object",
/// "required": [
/// "degradation_level",
/// "flagged",
/// "org_id",
/// "over_capacity",
/// "overages",
/// "selection_policy",
/// "stage"
/// ],
/// "properties": {
/// "degradation_level": {
/// "type": "number",
/// "format": "float"
/// },
/// "flagged": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/FlaggedResource"
/// }
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "over_capacity": {
/// "type": "boolean"
/// },
/// "over_capacity_since": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "overages": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/KeyOverage"
/// }
/// },
/// "selection_policy": {
/// "$ref": "#/components/schemas/SelectionPolicy"
/// },
/// "stage": {
/// "$ref": "#/components/schemas/DegradationStage"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DegradationStatus {
pub degradation_level: f32,
pub flagged: ::std::vec::Vec<FlaggedResource>,
pub org_id: ::std::string::String,
pub over_capacity: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub over_capacity_since: ::std::option::Option<::std::string::String>,
pub overages: ::std::vec::Vec<KeyOverage>,
pub selection_policy: SelectionPolicy,
pub stage: DegradationStage,
}
///Request type for deleting roles (org_id -> list of role names).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Request type for deleting roles (org_id -> list of role names).",
/// "type": "object",
/// "additionalProperties": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/Role"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct DeleteRolesRequest(
pub ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
);
impl ::std::ops::Deref for DeleteRolesRequest {
type Target = ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>;
fn deref(
&self,
) -> &::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>> {
&self.0
}
}
impl ::std::convert::From<DeleteRolesRequest>
for ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>
{
fn from(value: DeleteRolesRequest) -> Self {
value.0
}
}
impl
::std::convert::From<
::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
> for DeleteRolesRequest
{
fn from(
value: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
) -> Self {
Self(value)
}
}
///`DeletionRequestResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "message",
/// "status"
/// ],
/// "properties": {
/// "message": {
/// "type": "string"
/// },
/// "status": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DeletionRequestResponse {
pub message: ::std::string::String,
pub status: ::std::string::String,
}
///A physical or virtual device belonging to an org and integration.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A physical or virtual device belonging to an org and integration.",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ResourceLifecycle"
/// },
/// {
/// "type": "object",
/// "required": [
/// "id",
/// "integration_id",
/// "name",
/// "org_id"
/// ],
/// "properties": {
/// "device_metadata": {
/// "description": "Device-specific JSON metadata (stored in Postgres `devices.metadata` JSONB column)."
/// },
/// "external_id": {
/// "description": "External ID from the integration provider.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "description": "Unique identifier (ULID).",
/// "type": "string"
/// },
/// "integration_id": {
/// "description": "Owning integration (e.g. Shelly Cloud account/connection).",
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "org_id": {
/// "description": "Organization that owns this device.",
/// "type": "string"
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Device {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Device-specific JSON metadata (stored in Postgres `devices.metadata` JSONB column).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub device_metadata: ::std::option::Option<::serde_json::Value>,
///External ID from the integration provider.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Unique identifier (ULID).
pub id: ::std::string::String,
///Owning integration (e.g. Shelly Cloud account/connection).
pub integration_id: ::std::string::String,
pub name: LocalizedString,
///Organization that owns this device.
pub org_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
///`DeviceEntityMetadataDefinitionQuery`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "entity_type"
/// ],
/// "properties": {
/// "entity_type": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DeviceEntityMetadataDefinitionQuery {
pub entity_type: ::std::string::String,
}
///Device metadata definition response (schema + current data) for schema-driven edit UI.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Device metadata definition response (schema + current data) for schema-driven edit UI.",
/// "type": "object",
/// "required": [
/// "data",
/// "provider_type",
/// "schema"
/// ],
/// "properties": {
/// "data": {
/// "description": "Current `device_metadata` as a JSON object."
/// },
/// "provider_type": {
/// "type": "string"
/// },
/// "schema": {
/// "description": "JSON Schema describing `devices.device_metadata` shape for this provider."
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DeviceMetadataDefinitionResponse {
///Current `device_metadata` as a JSON object.
pub data: ::serde_json::Value,
pub provider_type: ::std::string::String,
///JSON Schema describing `devices.device_metadata` shape for this provider.
pub schema: ::serde_json::Value,
}
///`DevicePhysicalStatusResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "can_claim",
/// "has_steward",
/// "is_primary_instance",
/// "is_steward",
/// "provider_supports_steward"
/// ],
/// "properties": {
/// "admin_status": {
/// "description": "Verified hardware-admin status of the integration's linked account: `admin` | `non_admin` |\nnull (unknown / unverifiable / stale).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "can_claim": {
/// "description": "Whether the requester may claim/keep stewardship (verified admin + provider supports it +\nnot held by someone else).",
/// "type": "boolean"
/// },
/// "hardware_id": {
/// "description": "Server-derived hardware identity of the device (controller-level), if any.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "has_steward": {
/// "description": "Whether some user currently holds the steward slot for this physical device.",
/// "type": "boolean"
/// },
/// "is_primary_instance": {
/// "description": "Whether this OpenApp device record is the canonical (primary) instance for the hardware.",
/// "type": "boolean"
/// },
/// "is_steward": {
/// "description": "Whether the requesting user currently holds the steward slot.",
/// "type": "boolean"
/// },
/// "physical_device_id": {
/// "description": "The physical-device registry id, once the device has been registered/claimed.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "provider_supports_steward": {
/// "description": "Whether the provider supports the device-steward authority tier at all.",
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DevicePhysicalStatusResponse {
/**Verified hardware-admin status of the integration's linked account: `admin` | `non_admin` |
null (unknown / unverifiable / stale).*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub admin_status: ::std::option::Option<::std::string::String>,
/**Whether the requester may claim/keep stewardship (verified admin + provider supports it +
not held by someone else).*/
pub can_claim: bool,
///Server-derived hardware identity of the device (controller-level), if any.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hardware_id: ::std::option::Option<::std::string::String>,
///Whether some user currently holds the steward slot for this physical device.
pub has_steward: bool,
///Whether this OpenApp device record is the canonical (primary) instance for the hardware.
pub is_primary_instance: bool,
///Whether the requesting user currently holds the steward slot.
pub is_steward: bool,
///The physical-device registry id, once the device has been registered/claimed.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub physical_device_id: ::std::option::Option<::std::string::String>,
///Whether the provider supports the device-steward authority tier at all.
pub provider_supports_steward: bool,
}
///`DeviceResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/Device"
/// },
/// {
/// "type": "object",
/// "properties": {
/// "is_primary_instance": {
/// "description": "Server-computed, read-only: true when this OpenApp device record is the canonical\n(primary) instance for its physical hardware in the global `physical_devices` registry.\nNever accepted from a request body. See `docs/POLICIES_HDD.md` §6.3.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "stale": {
/// "description": "Present when `include_stale=true` was requested and the provider supports stale detection.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DeviceResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Device-specific JSON metadata (stored in Postgres `devices.metadata` JSONB column).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub device_metadata: ::std::option::Option<::serde_json::Value>,
///External ID from the integration provider.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Unique identifier (ULID).
pub id: ::std::string::String,
///Owning integration (e.g. Shelly Cloud account/connection).
pub integration_id: ::std::string::String,
/**Server-computed, read-only: true when this OpenApp device record is the canonical
(primary) instance for its physical hardware in the global `physical_devices` registry.
Never accepted from a request body. See `docs/POLICIES_HDD.md` §6.3.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_primary_instance: ::std::option::Option<bool>,
pub name: LocalizedString,
///Organization that owns this device.
pub org_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Present when `include_stale=true` was requested and the provider supports stale detection.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub stale: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
///`DirectoryConfigResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "allowed_listing_kinds",
/// "device_id",
/// "naming_patterns",
/// "state"
/// ],
/// "properties": {
/// "allowed_listing_kinds": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "device_id": {
/// "type": "string"
/// },
/// "disabled_message": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "naming_patterns": {
/// "type": "object",
/// "additionalProperties": {
/// "type": "string"
/// }
/// },
/// "state": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DirectoryConfigResponse {
pub allowed_listing_kinds: ::std::vec::Vec<::std::string::String>,
pub device_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub disabled_message: ::std::option::Option<LocalizedString>,
pub naming_patterns:
::std::collections::HashMap<::std::string::String, ::std::string::String>,
pub state: ::std::string::String,
}
///Distinct directory floors for a directory device (efficient SQL).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Distinct directory floors for a directory device (efficient SQL).",
/// "type": "object",
/// "required": [
/// "floors"
/// ],
/// "properties": {
/// "floors": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/DirectoryFloorSummary"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DirectoryFloorListResponse {
pub floors: ::std::vec::Vec<DirectoryFloorSummary>,
}
///One distinct floor row for a directory device (directory listing entities).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One distinct floor row for a directory device (directory listing entities).",
/// "type": "object",
/// "required": [
/// "floor",
/// "key"
/// ],
/// "properties": {
/// "floor": {},
/// "floor_number": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "key": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DirectoryFloorSummary {
pub floor: ::serde_json::Value,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub floor_number: ::std::option::Option<i64>,
pub key: ::std::string::String,
}
///Documented multipart body (`integration_id` plus `images`, `images[]`, or `file`).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Documented multipart body (`integration_id` plus `images`, `images[]`, or `file`).",
/// "type": "object",
/// "required": [
/// "images",
/// "integration_id"
/// ],
/// "properties": {
/// "images": {
/// "description": "One or more door / intercom photos.",
/// "type": "array",
/// "items": {
/// "type": "string",
/// "format": "binary"
/// }
/// },
/// "integration_id": {
/// "description": "Virtual access integration ULID.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DirectoryListingEnrichRequest {
///One or more door / intercom photos.
pub images: ::std::vec::Vec<::std::string::String>,
///Virtual access integration ULID.
pub integration_id: ::std::string::String,
}
///`DirectoryListingMemberResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "entity_id",
/// "integration_id",
/// "org_id",
/// "receives_calls",
/// "role",
/// "user_id"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "entity_id": {
/// "type": "string"
/// },
/// "integration_id": {
/// "type": "string"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "receives_calls": {
/// "type": "boolean"
/// },
/// "role": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "user_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DirectoryListingMemberResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
pub entity_id: ::std::string::String,
pub integration_id: ::std::string::String,
pub org_id: ::std::string::String,
pub receives_calls: bool,
pub role: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
pub user_id: ::std::string::String,
}
///`DirectoryListingMemberWithUserResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "member"
/// ],
/// "properties": {
/// "age_class": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/AgeClass"
/// }
/// ]
/// }
/// ]
/// },
/// "date_of_birth": {
/// "description": "Calendar date `YYYY-MM-DD`. Only set for listing managers.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "member": {
/// "$ref": "#/components/schemas/DirectoryListingMemberResponse"
/// },
/// "user_email": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "user_name": {}
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DirectoryListingMemberWithUserResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub age_class: ::std::option::Option<AgeClass>,
///Calendar date `YYYY-MM-DD`. Only set for listing managers.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub date_of_birth: ::std::option::Option<::std::string::String>,
pub member: DirectoryListingMemberResponse,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub user_email: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub user_name: ::std::option::Option<::serde_json::Value>,
}
///`DoorHoldResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "include_lights",
/// "lights",
/// "mixed",
/// "openers",
/// "timezone"
/// ],
/// "properties": {
/// "hold": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/HoldView"
/// }
/// ]
/// }
/// ]
/// },
/// "include_lights": {
/// "type": "boolean"
/// },
/// "lights": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/EntityHoldItem"
/// }
/// },
/// "mixed": {
/// "type": "boolean"
/// },
/// "mode": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/HoldMode"
/// }
/// ]
/// }
/// ]
/// },
/// "openers": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/EntityHoldItem"
/// }
/// },
/// "timezone": {
/// "description": "Organization IANA timezone used when authoring a new recurring hold.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DoorHoldResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hold: ::std::option::Option<HoldView>,
pub include_lights: bool,
pub lights: ::std::vec::Vec<EntityHoldItem>,
pub mixed: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub mode: ::std::option::Option<HoldMode>,
pub openers: ::std::vec::Vec<EntityHoldItem>,
///Organization IANA timezone used when authoring a new recurring hold.
pub timezone: ::std::string::String,
}
///`DoorRestrictionsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "listing_entity_ids"
/// ],
/// "properties": {
/// "listing_entity_ids": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct DoorRestrictionsResponse {
pub listing_entity_ids: ::std::vec::Vec<::std::string::String>,
}
/**Resolved limit for `(subject, key, period)`, with provenance so the dashboard can
explain to admins which line of policy is in effect.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Resolved limit for `(subject, key, period)`, with provenance so the dashboard can\nexplain to admins which line of policy is in effect.",
/// "type": "object",
/// "required": [
/// "source"
/// ],
/// "properties": {
/// "source": {
/// "$ref": "#/components/schemas/LimitSource"
/// },
/// "value": {
/// "description": "The effective cap. `None` means \"unlimited\".",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct EffectiveLimit {
pub source: LimitSource,
///The effective cap. `None` means "unlimited".
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub value: ::std::option::Option<i64>,
}
///`EffectivePoliciesResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "curfew_windows",
/// "timezone",
/// "user_sharing_mode"
/// ],
/// "properties": {
/// "allowed_creator_roles": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "allowed_entry_kinds": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "allowed_portal_ids": {
/// "description": "Present on integration effective-policies when listing-restrict binds this requester.",
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "allowed_weekdays": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// }
/// },
/// "blackout_dates": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "curfew_windows": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/CurfewWindowResponse"
/// }
/// },
/// "max_active_per_user": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "max_doors": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "max_duration_seconds": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "max_uses": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "no_reshare": {
/// "type": "boolean"
/// },
/// "no_transitive_delegation": {
/// "type": "boolean"
/// },
/// "prohibited_master_door_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "require_expiry": {
/// "type": "boolean"
/// },
/// "require_justification": {
/// "type": "boolean"
/// },
/// "require_photo": {
/// "type": "boolean"
/// },
/// "require_pin": {
/// "type": "boolean"
/// },
/// "require_verified_phone": {
/// "type": "boolean"
/// },
/// "restrict_to_own_listing_doors": {
/// "type": "boolean"
/// },
/// "share_allow_unlimited": {
/// "type": "boolean"
/// },
/// "share_default_max_uses": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "share_max_duration_seconds": {
/// "description": "Share-specific TTL cap in seconds. `86400` (1 day) when `share_max_duration` is unset.\nOrg policy may raise this up to `31536000` (365d). Authoring uses the min of this and\n`max_duration_seconds`.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "share_max_uses": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "timezone": {
/// "description": "IANA timezone used to evaluate curfews, or `\"UTC\"` when unset.",
/// "type": "string"
/// },
/// "user_sharing_mode": {
/// "description": "Effective `user_sharing` mode: `none` | `admin_only` | `approval_required` | `all`.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct EffectivePoliciesResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_creator_roles: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_entry_kinds: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
///Present on integration effective-policies when listing-restrict binds this requester.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_portal_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_weekdays: ::std::option::Option<::std::vec::Vec<i32>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub blackout_dates: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub curfew_windows: ::std::vec::Vec<CurfewWindowResponse>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_active_per_user: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_doors: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_duration_seconds: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_uses: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub no_reshare: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub no_transitive_delegation: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub prohibited_master_door_ids:
::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub require_expiry: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub require_justification: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub require_photo: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub require_pin: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub require_verified_phone: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub restrict_to_own_listing_doors: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub share_allow_unlimited: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub share_default_max_uses: ::std::option::Option<i32>,
/**Share-specific TTL cap in seconds. `86400` (1 day) when `share_max_duration` is unset.
Org policy may raise this up to `31536000` (365d). Authoring uses the min of this and
`max_duration_seconds`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub share_max_duration_seconds: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub share_max_uses: ::std::option::Option<i32>,
///IANA timezone used to evaluate curfews, or `"UTC"` when unset.
pub timezone: ::std::string::String,
///Effective `user_sharing` mode: `none` | `admin_only` | `approval_required` | `all`.
pub user_sharing_mode: ::std::string::String,
}
/**The actual controllable "button" or "sensor".
Examples: Relay 1, Temp Sensor, Light Switch.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The actual controllable \"button\" or \"sensor\".\n\nExamples: Relay 1, Temp Sensor, Light Switch.",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ResourceLifecycle"
/// },
/// {
/// "type": "object",
/// "required": [
/// "device_id",
/// "entity_type",
/// "id"
/// ],
/// "properties": {
/// "device_id": {
/// "description": "Parent device ID.",
/// "type": "string"
/// },
/// "entity_type": {
/// "$ref": "#/components/schemas/EntityType"
/// },
/// "external_id": {
/// "description": "External ID from the integration.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "description": "Unique identifier (ULID).",
/// "type": "string"
/// },
/// "metadata": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/HashMap"
/// }
/// ]
/// }
/// ]
/// },
/// "name": {
/// "description": "Optional friendly name for the entity.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "zone_id": {
/// "description": "Optional zone this entity belongs to.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Entity {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Parent device ID.
pub device_id: ::std::string::String,
pub entity_type: EntityType,
///External ID from the integration.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Unique identifier (ULID).
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub metadata: ::std::option::Option<HashMap>,
///Optional friendly name for the entity.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Optional zone this entity belongs to.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub zone_id: ::std::option::Option<::std::string::String>,
}
///`EntityHoldItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "entity_id",
/// "hold"
/// ],
/// "properties": {
/// "entity_id": {
/// "type": "string"
/// },
/// "hold": {
/// "$ref": "#/components/schemas/HoldView"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct EntityHoldItem {
pub entity_id: ::std::string::String,
pub hold: HoldView,
}
///`EntityMetadataDefinitionResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "data",
/// "entity_type",
/// "provider_type",
/// "schema"
/// ],
/// "properties": {
/// "data": {
/// "description": "Current `entity_metadata` as a JSON object (best-effort decoded from string values)."
/// },
/// "entity_type": {
/// "type": "string"
/// },
/// "provider_type": {
/// "type": "string"
/// },
/// "schema": {
/// "description": "JSON Schema describing `entities.entity_metadata` shape for this provider/entity type."
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct EntityMetadataDefinitionResponse {
///Current `entity_metadata` as a JSON object (best-effort decoded from string values).
pub data: ::serde_json::Value,
pub entity_type: ::std::string::String,
pub provider_type: ::std::string::String,
///JSON Schema describing `entities.entity_metadata` shape for this provider/entity type.
pub schema: ::serde_json::Value,
}
///`EntityResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/Entity"
/// },
/// {
/// "type": "object",
/// "properties": {
/// "entity_metadata": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/HashMap"
/// }
/// ]
/// }
/// ]
/// },
/// "entry_kind": {
/// "description": "Derived, read-only entry kind for switchable entries on Virtual Access devices.\nOmitted when the entity is not an entry or the device has no Virtual Access config.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "state": {
/// "description": "Derived, read-only. When local provider config cannot run switchable\nopen/close/toggle, `{ \"status\": \"invalid\", \"reason\": \"<message>\" }`."
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct EntityResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Parent device ID.
pub device_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub entity_metadata: ::std::option::Option<HashMap>,
pub entity_type: EntityType,
/**Derived, read-only entry kind for switchable entries on Virtual Access devices.
Omitted when the entity is not an entry or the device has no Virtual Access config.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub entry_kind: ::std::option::Option<::std::string::String>,
///External ID from the integration.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Unique identifier (ULID).
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub metadata: ::std::option::Option<HashMap>,
///Optional friendly name for the entity.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
/**Derived, read-only. When local provider config cannot run switchable
open/close/toggle, `{ "status": "invalid", "reason": "<message>" }`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub state: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Optional zone this entity belongs to.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub zone_id: ::std::option::Option<::std::string::String>,
}
///Entity type (directory_listing, switch, light, sensor...).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Entity type (directory_listing, switch, light, sensor...).",
/// "type": "string",
/// "enum": [
/// "directory_listing",
/// "door",
/// "light",
/// "sensor",
/// "switch"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum EntityType {
#[serde(rename = "directory_listing")]
DirectoryListing,
#[serde(rename = "door")]
Door,
#[serde(rename = "light")]
Light,
#[serde(rename = "sensor")]
Sensor,
#[serde(rename = "switch")]
Switch,
}
impl ::std::fmt::Display for EntityType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::DirectoryListing => f.write_str("directory_listing"),
Self::Door => f.write_str("door"),
Self::Light => f.write_str("light"),
Self::Sensor => f.write_str("sensor"),
Self::Switch => f.write_str("switch"),
}
}
}
impl ::std::str::FromStr for EntityType {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"directory_listing" => Ok(Self::DirectoryListing),
"door" => Ok(Self::Door),
"light" => Ok(Self::Light),
"sensor" => Ok(Self::Sensor),
"switch" => Ok(Self::Switch),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for EntityType {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for EntityType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for EntityType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ExecutionStatus`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "pending",
/// "running",
/// "succeeded",
/// "failed",
/// "canceled"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ExecutionStatus {
#[serde(rename = "pending")]
Pending,
#[serde(rename = "running")]
Running,
#[serde(rename = "succeeded")]
Succeeded,
#[serde(rename = "failed")]
Failed,
#[serde(rename = "canceled")]
Canceled,
}
impl ::std::fmt::Display for ExecutionStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Pending => f.write_str("pending"),
Self::Running => f.write_str("running"),
Self::Succeeded => f.write_str("succeeded"),
Self::Failed => f.write_str("failed"),
Self::Canceled => f.write_str("canceled"),
}
}
}
impl ::std::str::FromStr for ExecutionStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"pending" => Ok(Self::Pending),
"running" => Ok(Self::Running),
"succeeded" => Ok(Self::Succeeded),
"failed" => Ok(Self::Failed),
"canceled" => Ok(Self::Canceled),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ExecutionStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ExecutionStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ExecutionStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**Correlation to a record in an external system of record.
The pair (`source`, `record_id`) is the addressable key: one live invitation per pair per
integration. `revision` is the source's own monotonic version of the record and is the
precondition that keeps a late event from overwriting a newer one.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Correlation to a record in an external system of record.\n\nThe pair (`source`, `record_id`) is the addressable key: one live invitation per pair per\nintegration. `revision` is the source's own monotonic version of the record and is the\nprecondition that keeps a late event from overwriting a newer one.",
/// "type": "object",
/// "required": [
/// "record_id",
/// "source"
/// ],
/// "properties": {
/// "record_id": {
/// "description": "Identifier of the record inside that system (reservation, work order, enrolment). Opaque to\nOpenApp; up to 128 characters.",
/// "type": "string"
/// },
/// "revision": {
/// "description": "Monotonic revision of the external record. When present, OpenApp rejects any later write\ncarrying a lower revision with `external_revision_stale`.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "source": {
/// "description": "Slug naming the external system, e.g. `mews`, `opera`, `custom-pms`. Lowercase letters,\ndigits, `.`, `_`, and `-`; up to 64 characters.",
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ExternalReferenceInput {
/**Identifier of the record inside that system (reservation, work order, enrolment). Opaque to
OpenApp; up to 128 characters.*/
pub record_id: ::std::string::String,
/**Monotonic revision of the external record. When present, OpenApp rejects any later write
carrying a lower revision with `external_revision_stale`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub revision: ::std::option::Option<i64>,
/**Slug naming the external system, e.g. `mews`, `opera`, `custom-pms`. Lowercase letters,
digits, `.`, `_`, and `-`; up to 64 characters.*/
pub source: ::std::string::String,
}
///External correlation as returned by the invitation API.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "External correlation as returned by the invitation API.",
/// "type": "object",
/// "required": [
/// "record_id",
/// "source"
/// ],
/// "properties": {
/// "correlation_id": {
/// "description": "Correlation id of the request that last wrote this reference.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "record_id": {
/// "type": "string"
/// },
/// "revision": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "source": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ExternalReferenceResponse {
///Correlation id of the request that last wrote this reference.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub correlation_id: ::std::option::Option<::std::string::String>,
pub record_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub revision: ::std::option::Option<i64>,
pub source: ::std::string::String,
}
///A resource currently flagged in the lifecycle (shown to admins so they can resolve).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A resource currently flagged in the lifecycle (shown to admins so they can resolve).",
/// "type": "object",
/// "required": [
/// "id",
/// "resource",
/// "state"
/// ],
/// "properties": {
/// "flagged_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "marked_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "resource": {
/// "$ref": "#/components/schemas/CapacityResource"
/// },
/// "state": {
/// "$ref": "#/components/schemas/ResourceState"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct FlaggedResource {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub flagged_at: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub marked_at: ::std::option::Option<::std::string::String>,
pub resource: CapacityResource,
pub state: ResourceState,
}
///`GenerateListingsPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "source_group_ids"
/// ],
/// "properties": {
/// "listing_kind": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "naming_pattern": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "source_group_ids": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct GenerateListingsPayload {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub listing_kind: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub naming_pattern: ::std::option::Option<::std::string::String>,
pub source_group_ids: ::std::vec::Vec<::std::string::String>,
}
///`GeneratePlanEntry`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "group_id"
/// ],
/// "properties": {
/// "display_name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "group_id": {
/// "type": "string"
/// },
/// "listing_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "reason": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GeneratePlanEntry {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub display_name: ::std::option::Option<::std::string::String>,
pub group_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub listing_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reason: ::std::option::Option<::std::string::String>,
}
///`GeneratePlanResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "create",
/// "skipped",
/// "unchanged",
/// "update"
/// ],
/// "properties": {
/// "create": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/GeneratePlanEntry"
/// }
/// },
/// "skipped": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/GeneratePlanEntry"
/// }
/// },
/// "unchanged": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/GeneratePlanEntry"
/// }
/// },
/// "update": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/GeneratePlanEntry"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GeneratePlanResponse {
pub create: ::std::vec::Vec<GeneratePlanEntry>,
pub skipped: ::std::vec::Vec<GeneratePlanEntry>,
pub unchanged: ::std::vec::Vec<GeneratePlanEntry>,
pub update: ::std::vec::Vec<GeneratePlanEntry>,
}
/**Issuer of a place id. Place ids are opaque to OpenApp and are only interpretable by the provider
that minted them, so every stored or transported place id names its issuer.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Issuer of a place id. Place ids are opaque to OpenApp and are only interpretable by the provider\nthat minted them, so every stored or transported place id names its issuer.",
/// "type": "string",
/// "enum": [
/// "google",
/// "mapbox"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum GeocodingProviderId {
#[serde(rename = "google")]
Google,
#[serde(rename = "mapbox")]
Mapbox,
}
impl ::std::fmt::Display for GeocodingProviderId {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Google => f.write_str("google"),
Self::Mapbox => f.write_str("mapbox"),
}
}
}
impl ::std::str::FromStr for GeocodingProviderId {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"google" => Ok(Self::Google),
"mapbox" => Ok(Self::Mapbox),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for GeocodingProviderId {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for GeocodingProviderId {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for GeocodingProviderId {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Response for get access portal by ID (includes integration_id for navigation).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Response for get access portal by ID (includes integration_id for navigation).",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/AccessPortalListItem"
/// },
/// {
/// "type": "object",
/// "required": [
/// "integration_id"
/// ],
/// "properties": {
/// "integration_id": {
/// "type": "string"
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GetAccessPortalResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
///When set, the portal is soft-deleted (kept for restore).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::std::string::String>,
///Door device id (virtual_access_portal in this integration). Canonical portal link key.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub device_id: ::std::option::Option<::std::string::String>,
///Directory device id (virtual_access_directory in this integration).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub directory_id: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
pub integration_id: ::std::string::String,
pub name: LocalizedString,
pub public_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
///A group's link into an org.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A group's link into an org.",
/// "type": "object",
/// "required": [
/// "admission_mode",
/// "group_id",
/// "is_home",
/// "org_id",
/// "status"
/// ],
/// "properties": {
/// "admission_mode": {
/// "type": "string"
/// },
/// "group_id": {
/// "type": "string"
/// },
/// "is_home": {
/// "type": "boolean"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "status": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GroupLinkResponse {
pub admission_mode: ::std::string::String,
pub group_id: ::std::string::String,
pub is_home: bool,
pub org_id: ::std::string::String,
pub status: ::std::string::String,
}
/**A member as a requesting org may see them.
Contact details are absent by design: a referencing org may see who can enter its building but
not how to reach them.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A member as a requesting org may see them.\n\nContact details are absent by design: a referencing org may see who can enter its building but\nnot how to reach them.",
/// "type": "object",
/// "required": [
/// "member_ref",
/// "role"
/// ],
/// "properties": {
/// "display_name": {},
/// "member_ref": {
/// "type": "string"
/// },
/// "role": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GroupMemberResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub display_name: ::std::option::Option<::serde_json::Value>,
pub member_ref: ::std::string::String,
pub role: ::std::string::String,
}
///One household's proposal state at one org.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One household's proposal state at one org.",
/// "type": "object",
/// "required": [
/// "group_id",
/// "org_id",
/// "pending_members",
/// "status"
/// ],
/// "properties": {
/// "group_id": {
/// "type": "string"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "pending_members": {
/// "description": "Members waiting for this org to admit them.",
/// "type": "integer",
/// "minimum": 0.0
/// },
/// "status": {
/// "description": "pending, active, or revoked.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GroupProposalResponse {
pub group_id: ::std::string::String,
pub org_id: ::std::string::String,
///Members waiting for this org to admit them.
pub pending_members: u64,
///pending, active, or revoked.
pub status: ::std::string::String,
}
///A group as returned by the API.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A group as returned by the API.",
/// "type": "object",
/// "required": [
/// "home_org_id",
/// "id",
/// "kind",
/// "name",
/// "shareable"
/// ],
/// "properties": {
/// "description": {},
/// "home_org_id": {
/// "type": "string"
/// },
/// "id": {
/// "type": "string"
/// },
/// "kind": {
/// "type": "string"
/// },
/// "name": {},
/// "shareable": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GroupResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::serde_json::Value>,
pub home_org_id: ::std::string::String,
pub id: ::std::string::String,
pub kind: ::std::string::String,
pub name: ::serde_json::Value,
pub shareable: bool,
}
///`GroupShareOfferResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "expires_at",
/// "group_id",
/// "offer_id"
/// ],
/// "properties": {
/// "expires_at": {
/// "type": "string"
/// },
/// "group_id": {
/// "type": "string"
/// },
/// "offer_id": {
/// "type": "string"
/// },
/// "token": {
/// "description": "The one-time token. Returned only by create; redemption never echoes it back.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GroupShareOfferResponse {
pub expires_at: ::std::string::String,
pub group_id: ::std::string::String,
pub offer_id: ::std::string::String,
///The one-time token. Returned only by create; redemption never echoes it back.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub token: ::std::option::Option<::std::string::String>,
}
///A site a household grants access to.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A site a household grants access to.",
/// "type": "object",
/// "required": [
/// "id",
/// "name"
/// ],
/// "properties": {
/// "id": {
/// "type": "string"
/// },
/// "name": {
/// "description": "Localized site name, so the dashboard never has to render the integration id."
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct GroupSiteRef {
pub id: ::std::string::String,
///Localized site name, so the dashboard never has to render the integration id.
pub name: ::serde_json::Value,
}
///`HashMap`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "additionalProperties": {
/// "type": "string"
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct HashMap(
pub ::std::collections::HashMap<::std::string::String, ::std::string::String>,
);
impl ::std::ops::Deref for HashMap {
type Target = ::std::collections::HashMap<::std::string::String, ::std::string::String>;
fn deref(
&self,
) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
&self.0
}
}
impl ::std::convert::From<HashMap>
for ::std::collections::HashMap<::std::string::String, ::std::string::String>
{
fn from(value: HashMap) -> Self {
value.0
}
}
impl
::std::convert::From<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
> for HashMap
{
fn from(
value: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
) -> Self {
Self(value)
}
}
///`HoldKind`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "permanent",
/// "temporary",
/// "recurring"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum HoldKind {
#[serde(rename = "permanent")]
Permanent,
#[serde(rename = "temporary")]
Temporary,
#[serde(rename = "recurring")]
Recurring,
}
impl ::std::fmt::Display for HoldKind {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Permanent => f.write_str("permanent"),
Self::Temporary => f.write_str("temporary"),
Self::Recurring => f.write_str("recurring"),
}
}
}
impl ::std::str::FromStr for HoldKind {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"permanent" => Ok(Self::Permanent),
"temporary" => Ok(Self::Temporary),
"recurring" => Ok(Self::Recurring),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for HoldKind {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for HoldKind {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for HoldKind {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`HoldMode`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "normal",
/// "hold_open",
/// "hold_closed"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum HoldMode {
#[serde(rename = "normal")]
Normal,
#[serde(rename = "hold_open")]
HoldOpen,
#[serde(rename = "hold_closed")]
HoldClosed,
}
impl ::std::fmt::Display for HoldMode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Normal => f.write_str("normal"),
Self::HoldOpen => f.write_str("hold_open"),
Self::HoldClosed => f.write_str("hold_closed"),
}
}
}
impl ::std::str::FromStr for HoldMode {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"normal" => Ok(Self::Normal),
"hold_open" => Ok(Self::HoldOpen),
"hold_closed" => Ok(Self::HoldClosed),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for HoldMode {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for HoldMode {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for HoldMode {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`HoldView`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "entity_direct",
/// "held_by_door_ids",
/// "kind",
/// "mode",
/// "set_at",
/// "timezone"
/// ],
/// "properties": {
/// "entity_direct": {
/// "type": "boolean"
/// },
/// "held_by_door_ids": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "kind": {
/// "$ref": "#/components/schemas/HoldKind"
/// },
/// "mode": {
/// "$ref": "#/components/schemas/HoldMode"
/// },
/// "next_window": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/HoldWindowView"
/// }
/// ]
/// }
/// ]
/// },
/// "reason": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "recurrence": {
/// "description": "Authored recurrence (always `freq: weekly` and an explicit ISO day list).",
/// "type": [
/// "object",
/// "null"
/// ]
/// },
/// "set_at": {
/// "type": "string"
/// },
/// "set_by": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "set_by_display_name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "timezone": {
/// "description": "IANA timezone for authoring: the spec's zone when recurring, otherwise the org zone\n(`UTC` if the org has none). Never the caller's browser zone.",
/// "type": "string"
/// },
/// "until": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct HoldView {
pub entity_direct: bool,
pub held_by_door_ids: ::std::vec::Vec<::std::string::String>,
pub kind: HoldKind,
pub mode: HoldMode,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub next_window: ::std::option::Option<HoldWindowView>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reason: ::std::option::Option<::std::string::String>,
///Authored recurrence (always `freq: weekly` and an explicit ISO day list).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub recurrence:
::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
pub set_at: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub set_by: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub set_by_display_name: ::std::option::Option<::std::string::String>,
/**IANA timezone for authoring: the spec's zone when recurring, otherwise the org zone
(`UTC` if the org has none). Never the caller's browser zone.*/
pub timezone: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub until: ::std::option::Option<::std::string::String>,
}
///`HoldWindowView`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "from",
/// "to"
/// ],
/// "properties": {
/// "from": {
/// "type": "string"
/// },
/// "to": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct HoldWindowView {
pub from: ::std::string::String,
pub to: ::std::string::String,
}
///Typed `config` shape for `holiday_calendar`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Typed `config` shape for `holiday_calendar`.",
/// "type": "object",
/// "required": [
/// "dates"
/// ],
/// "properties": {
/// "applies_to": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PolicyPrincipalKind"
/// }
/// },
/// "dates": {
/// "description": "Organization-local ISO dates in `YYYY-MM-DD` format.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct HolidayCalendarPolicyConfig {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub applies_to: ::std::option::Option<::std::vec::Vec<PolicyPrincipalKind>>,
///Organization-local ISO dates in `YYYY-MM-DD` format.
pub dates: ::std::vec::Vec<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
}
///`HouseholdAdmissionStatus`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "org_name",
/// "status"
/// ],
/// "properties": {
/// "member_name": {},
/// "member_ref": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "org_name": {},
/// "status": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct HouseholdAdmissionStatus {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub member_name: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub member_ref: ::std::option::Option<::std::string::String>,
pub org_name: ::serde_json::Value,
pub status: ::std::string::String,
}
///`HouseholdInvitationPreview`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "channel",
/// "expires_at",
/// "household_name",
/// "target_masked"
/// ],
/// "properties": {
/// "channel": {
/// "type": "string"
/// },
/// "expires_at": {
/// "type": "string"
/// },
/// "household_name": {},
/// "invited_by_name": {},
/// "target_masked": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct HouseholdInvitationPreview {
pub channel: ::std::string::String,
pub expires_at: ::std::string::String,
pub household_name: ::serde_json::Value,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invited_by_name: ::std::option::Option<::serde_json::Value>,
pub target_masked: ::std::string::String,
}
///`HouseholdInvitationResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "channel",
/// "created_at",
/// "expires_at",
/// "group_id",
/// "id",
/// "invited_by_user_id",
/// "sent_count",
/// "status"
/// ],
/// "properties": {
/// "channel": {
/// "type": "string"
/// },
/// "created_at": {
/// "type": "string"
/// },
/// "expires_at": {
/// "type": "string"
/// },
/// "group_id": {
/// "type": "string"
/// },
/// "id": {
/// "type": "string"
/// },
/// "invited_by_user_id": {
/// "type": "string"
/// },
/// "last_sent_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "recipient_email": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "recipient_phone": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "responded_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "sent_count": {
/// "type": "integer",
/// "format": "int32"
/// },
/// "status": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct HouseholdInvitationResponse {
pub channel: ::std::string::String,
pub created_at: ::std::string::String,
pub expires_at: ::std::string::String,
pub group_id: ::std::string::String,
pub id: ::std::string::String,
pub invited_by_user_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_sent_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub recipient_email: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub recipient_phone: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub responded_at: ::std::option::Option<::std::string::String>,
pub sent_count: i32,
pub status: ::std::string::String,
}
///`HouseholdManagerTransferView`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "declined",
/// "expires_at",
/// "nominee_user_id"
/// ],
/// "properties": {
/// "declined": {
/// "type": "boolean"
/// },
/// "expires_at": {
/// "type": "string"
/// },
/// "nominee_user_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct HouseholdManagerTransferView {
pub declined: bool,
pub expires_at: ::std::string::String,
pub nominee_user_id: ::std::string::String,
}
///A household member as a fellow member may see them.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A household member as a fellow member may see them.",
/// "type": "object",
/// "required": [
/// "manager_eligible",
/// "role",
/// "user_id"
/// ],
/// "properties": {
/// "manager_eligible": {
/// "description": "Missing age data is treated as adult; only an explicit under-16 classification is ineligible.",
/// "type": "boolean"
/// },
/// "role": {
/// "type": "string"
/// },
/// "user_id": {
/// "type": "string"
/// },
/// "user_name": {
/// "description": "Localized display name, so the roster never renders the transport id."
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct HouseholdMemberResponse {
///Missing age data is treated as adult; only an explicit under-16 classification is ineligible.
pub manager_eligible: bool,
pub role: ::std::string::String,
pub user_id: ::std::string::String,
///Localized display name, so the roster never renders the transport id.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub user_name: ::std::option::Option<::serde_json::Value>,
}
///`IdpLinkResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "is_primary",
/// "provider"
/// ],
/// "properties": {
/// "is_primary": {
/// "type": "boolean"
/// },
/// "provider": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct IdpLinkResponse {
pub is_primary: bool,
pub provider: ::std::string::String,
}
/**Multipart form body for image uploads. Documents the `file` field for the
generated OpenAPI spec / SDKs; the handler reads the multipart stream directly.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Multipart form body for image uploads. Documents the `file` field for the\ngenerated OpenAPI spec / SDKs; the handler reads the multipart stream directly.",
/// "type": "object",
/// "required": [
/// "file"
/// ],
/// "properties": {
/// "file": {
/// "description": "Image file bytes (JPEG, PNG, or WebP).",
/// "type": "string",
/// "format": "binary"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ImageUploadForm {
///Image file bytes (JPEG, PNG, or WebP).
pub file: ::std::string::String,
}
/**Credential/Auth for a specific cloud instance.
Example: Shelly account "A", HomeAssistant instance "Home".*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Credential/Auth for a specific cloud instance.\n\nExample: Shelly account \"A\", HomeAssistant instance \"Home\".",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ResourceLifecycle"
/// },
/// {
/// "type": "object",
/// "required": [
/// "enabled",
/// "health",
/// "id",
/// "name",
/// "org_id",
/// "provider_type"
/// ],
/// "properties": {
/// "config": {
/// "description": "Provider-specific non-secret configuration (JSON)."
/// },
/// "enabled": {
/// "description": "Pause switch for hardware connectors. Always true for site providers.",
/// "type": "boolean"
/// },
/// "health": {
/// "$ref": "#/components/schemas/IntegrationHealth"
/// },
/// "id": {
/// "description": "Unique identifier (ULID).",
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "org_id": {
/// "description": "Organization that owns this integration.",
/// "type": "string"
/// },
/// "provider_type": {
/// "$ref": "#/components/schemas/ProviderType"
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Integration {
///Provider-specific non-secret configuration (JSON).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub config: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Pause switch for hardware connectors. Always true for site providers.
pub enabled: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
pub health: IntegrationHealth,
///Unique identifier (ULID).
pub id: ::std::string::String,
pub name: LocalizedString,
///Organization that owns this integration.
pub org_id: ::std::string::String,
pub provider_type: ProviderType,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
///JSON Schema for `devices.device_metadata` for an integration's provider (no device instance required).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "JSON Schema for `devices.device_metadata` for an integration's provider (no device instance required).",
/// "type": "object",
/// "required": [
/// "provider_type",
/// "schema"
/// ],
/// "properties": {
/// "provider_type": {
/// "type": "string"
/// },
/// "schema": {
/// "description": "JSON Schema describing `devices.device_metadata` for this provider."
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct IntegrationDeviceMetadataSchemaResponse {
pub provider_type: ::std::string::String,
///JSON Schema describing `devices.device_metadata` for this provider.
pub schema: ::serde_json::Value,
}
///Integration health marker (backend-controlled).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Integration health marker (backend-controlled).",
/// "type": "string",
/// "enum": [
/// "ok",
/// "reduced",
/// "error"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum IntegrationHealth {
#[serde(rename = "ok")]
Ok,
#[serde(rename = "reduced")]
Reduced,
#[serde(rename = "error")]
Error,
}
impl ::std::fmt::Display for IntegrationHealth {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Ok => f.write_str("ok"),
Self::Reduced => f.write_str("reduced"),
Self::Error => f.write_str("error"),
}
}
}
impl ::std::str::FromStr for IntegrationHealth {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"ok" => Ok(Self::Ok),
"reduced" => Ok(Self::Reduced),
"error" => Ok(Self::Error),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for IntegrationHealth {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for IntegrationHealth {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for IntegrationHealth {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`IntegrationResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/Integration"
/// },
/// {
/// "type": "object",
/// "required": [
/// "provider_type_name"
/// ],
/// "properties": {
/// "provider_type_name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct IntegrationResponse {
///Provider-specific non-secret configuration (JSON).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub config: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Pause switch for hardware connectors. Always true for site providers.
pub enabled: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
pub health: IntegrationHealth,
///Unique identifier (ULID).
pub id: ::std::string::String,
pub name: LocalizedString,
///Organization that owns this integration.
pub org_id: ::std::string::String,
pub provider_type: ProviderType,
pub provider_type_name: LocalizedString,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
///`IntegrationUserItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "external_id",
/// "status",
/// "unmanaged"
/// ],
/// "properties": {
/// "display_name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "email": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "external_id": {
/// "type": "string"
/// },
/// "is_admin": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "last_seen_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "openapp_user_id": {
/// "description": "Present when `status == linked`. ULID string of the OpenApp user.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "pending_invitation_id": {
/// "description": "Present when `status == invited`. ULID string of the matching `user_invitations` row.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "phone": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "status": {
/// "description": "`linked` | `invited` | `unlinked`.",
/// "type": "string"
/// },
/// "unmanaged": {
/// "description": "True when the vendor user is on the gate but not linked to an OpenApp user (flag only).",
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct IntegrationUserItem {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub display_name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub email: ::std::option::Option<::std::string::String>,
pub external_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_admin: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_seen_at: ::std::option::Option<::std::string::String>,
///Present when `status == linked`. ULID string of the OpenApp user.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub openapp_user_id: ::std::option::Option<::std::string::String>,
///Present when `status == invited`. ULID string of the matching `user_invitations` row.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub pending_invitation_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone: ::std::option::Option<::std::string::String>,
///`linked` | `invited` | `unlinked`.
pub status: ::std::string::String,
///True when the vendor user is on the gate but not linked to an OpenApp user (flag only).
pub unmanaged: bool,
}
///`IntegrationUsersResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "integration_id",
/// "items",
/// "unmanaged_count"
/// ],
/// "properties": {
/// "directory_limited": {
/// "description": "When true, the upstream provider did not return the full user directory\n(e.g. linked credentials lack upstream admin rights). Provider-agnostic;\nsee provider-specific endpoints for role details.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "integration_id": {
/// "type": "string"
/// },
/// "items": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/IntegrationUserItem"
/// }
/// },
/// "unmanaged_count": {
/// "description": "Count of vendor users not linked to OpenApp (status `unlinked`). Informational only.",
/// "type": "integer",
/// "format": "int32"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct IntegrationUsersResponse {
/**When true, the upstream provider did not return the full user directory
(e.g. linked credentials lack upstream admin rights). Provider-agnostic;
see provider-specific endpoints for role details.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub directory_limited: ::std::option::Option<bool>,
pub integration_id: ::std::string::String,
pub items: ::std::vec::Vec<IntegrationUserItem>,
///Count of vendor users not linked to OpenApp (status `unlinked`). Informational only.
pub unmanaged_count: i32,
}
///Typed `config` shape for `invitation_allowed_days`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Typed `config` shape for `invitation_allowed_days`.",
/// "type": "object",
/// "properties": {
/// "applies_to": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PolicyPrincipalKind"
/// }
/// },
/// "blackout_dates": {
/// "description": "Organization-local ISO dates that invitations cannot use.",
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "holiday_calendar": {
/// "description": "Include dates from applicable `holiday_calendar` rows.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// },
/// "weekdays": {
/// "description": "Sunday is 0; Saturday is 6. Omit to leave weekdays unrestricted for this row.",
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InvitationAllowedDaysPolicyConfig {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub applies_to: ::std::option::Option<::std::vec::Vec<PolicyPrincipalKind>>,
///Organization-local ISO dates that invitations cannot use.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub blackout_dates: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
///Include dates from applicable `holiday_calendar` rows.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub holiday_calendar: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
///Sunday is 0; Saturday is 6. Omit to leave weekdays unrestricted for this row.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub weekdays: ::std::option::Option<::std::vec::Vec<i32>>,
}
impl ::std::default::Default for InvitationAllowedDaysPolicyConfig {
fn default() -> Self {
Self {
applies_to: Default::default(),
blackout_dates: Default::default(),
holiday_calendar: Default::default(),
output: Default::default(),
weekdays: Default::default(),
}
}
}
///Typed `config` shape for `invitation_allowed_entry_kinds`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Typed `config` shape for `invitation_allowed_entry_kinds`.",
/// "type": "object",
/// "required": [
/// "kinds"
/// ],
/// "properties": {
/// "applies_to": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PolicyPrincipalKind"
/// }
/// },
/// "kinds": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/InvitationEntryKind"
/// }
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InvitationAllowedEntryKindsPolicyConfig {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub applies_to: ::std::option::Option<::std::vec::Vec<PolicyPrincipalKind>>,
pub kinds: ::std::vec::Vec<InvitationEntryKind>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
}
///Typed `config` shape for empty invitation authoring policies.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Typed `config` shape for empty invitation authoring policies.",
/// "type": "object",
/// "properties": {
/// "applies_to": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PolicyPrincipalKind"
/// }
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InvitationAuthoringPolicyConfig {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub applies_to: ::std::option::Option<::std::vec::Vec<PolicyPrincipalKind>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
}
impl ::std::default::Default for InvitationAuthoringPolicyConfig {
fn default() -> Self {
Self {
applies_to: Default::default(),
output: Default::default(),
}
}
}
///Typed `config` shape for `invitation_max_active_per_user` and `max_doors_per_invite`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Typed `config` shape for `invitation_max_active_per_user` and `max_doors_per_invite`.",
/// "type": "object",
/// "required": [
/// "max"
/// ],
/// "properties": {
/// "applies_to": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PolicyPrincipalKind"
/// }
/// },
/// "max": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 1.0
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InvitationCountLimitPolicyConfig {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub applies_to: ::std::option::Option<::std::vec::Vec<PolicyPrincipalKind>>,
pub max: ::std::num::NonZeroU64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
}
///`InvitationEntryKind`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "door",
/// "gate",
/// "boom-gate"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum InvitationEntryKind {
#[serde(rename = "door")]
Door,
#[serde(rename = "gate")]
Gate,
#[serde(rename = "boom-gate")]
BoomGate,
}
impl ::std::fmt::Display for InvitationEntryKind {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Door => f.write_str("door"),
Self::Gate => f.write_str("gate"),
Self::BoomGate => f.write_str("boom-gate"),
}
}
}
impl ::std::str::FromStr for InvitationEntryKind {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"door" => Ok(Self::Door),
"gate" => Ok(Self::Gate),
"boom-gate" => Ok(Self::BoomGate),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for InvitationEntryKind {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for InvitationEntryKind {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for InvitationEntryKind {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Typed `config` shape for invitation policies that prohibit or require a boolean behavior.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Typed `config` shape for invitation policies that prohibit or require a boolean behavior.",
/// "type": "object",
/// "properties": {
/// "applies_to": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PolicyPrincipalKind"
/// }
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// },
/// "require_photo": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "require_pin": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "require_verified_phone": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InvitationIdentityPolicyConfig {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub applies_to: ::std::option::Option<::std::vec::Vec<PolicyPrincipalKind>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub require_photo: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub require_pin: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub require_verified_phone: ::std::option::Option<bool>,
}
impl ::std::default::Default for InvitationIdentityPolicyConfig {
fn default() -> Self {
Self {
applies_to: Default::default(),
output: Default::default(),
require_photo: Default::default(),
require_pin: Default::default(),
require_verified_phone: Default::default(),
}
}
}
///`InvitationListingGrant`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "entity_id",
/// "role"
/// ],
/// "properties": {
/// "entity_id": {
/// "type": "string"
/// },
/// "role": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InvitationListingGrant {
pub entity_id: ::std::string::String,
pub role: ::std::string::String,
}
///Typed `config` shape for `invitation_max_duration`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Typed `config` shape for `invitation_max_duration`.",
/// "type": "object",
/// "required": [
/// "max_seconds"
/// ],
/// "properties": {
/// "applies_to": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PolicyPrincipalKind"
/// }
/// },
/// "max_seconds": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 1.0
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InvitationMaxDurationPolicyConfig {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub applies_to: ::std::option::Option<::std::vec::Vec<PolicyPrincipalKind>>,
pub max_seconds: ::std::num::NonZeroU64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
}
///Typed `config` shape for `invitation_max_uses`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Typed `config` shape for `invitation_max_uses`.",
/// "type": "object",
/// "required": [
/// "max_uses"
/// ],
/// "properties": {
/// "applies_to": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PolicyPrincipalKind"
/// }
/// },
/// "max_uses": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 1.0
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InvitationMaxUsesPolicyConfig {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub applies_to: ::std::option::Option<::std::vec::Vec<PolicyPrincipalKind>>,
pub max_uses: ::std::num::NonZeroU64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
}
///`InvitationPreviewRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "token"
/// ],
/// "properties": {
/// "token": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct InvitationPreviewRequest {
pub token: ::std::string::String,
}
///`InvitationPreviewResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "channel",
/// "expires_at",
/// "org_id",
/// "status",
/// "target_masked"
/// ],
/// "properties": {
/// "channel": {
/// "type": "string"
/// },
/// "expires_at": {
/// "type": "string"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "status": {
/// "type": "string"
/// },
/// "target_masked": {
/// "description": "Masked destination so the redeem page can confirm \"we'll send the code to +9725…78\".",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InvitationPreviewResponse {
pub channel: ::std::string::String,
pub expires_at: ::std::string::String,
pub org_id: ::std::string::String,
pub status: ::std::string::String,
///Masked destination so the redeem page can confirm "we'll send the code to +9725…78".
pub target_masked: ::std::string::String,
}
///`InvitationSiteAccessDto`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "integration_id",
/// "role"
/// ],
/// "properties": {
/// "integration_id": {
/// "type": "string"
/// },
/// "listing": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/InvitationListingGrant"
/// }
/// ]
/// }
/// ]
/// },
/// "role": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InvitationSiteAccessDto {
pub integration_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub listing: ::std::option::Option<InvitationListingGrant>,
pub role: ::std::string::String,
}
///`InvitationTokenRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "token"
/// ],
/// "properties": {
/// "token": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct InvitationTokenRequest {
pub token: ::std::string::String,
}
/**Who an invitation may be used by.
`anyone_with_link` is the historical behaviour: the bearer of the link may use it. `listed_contacts`
requires the bearer to resolve to one of the invitation's named contacts, which is what stops a
credential being passed around.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Who an invitation may be used by.\n\n`anyone_with_link` is the historical behaviour: the bearer of the link may use it. `listed_contacts`\nrequires the bearer to resolve to one of the invitation's named contacts, which is what stops a\ncredential being passed around.",
/// "type": "string",
/// "enum": [
/// "anyone_with_link",
/// "listed_contacts"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum InviteAudience {
#[serde(rename = "anyone_with_link")]
AnyoneWithLink,
#[serde(rename = "listed_contacts")]
ListedContacts,
}
impl ::std::fmt::Display for InviteAudience {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::AnyoneWithLink => f.write_str("anyone_with_link"),
Self::ListedContacts => f.write_str("listed_contacts"),
}
}
}
impl ::std::str::FromStr for InviteAudience {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"anyone_with_link" => Ok(Self::AnyoneWithLink),
"listed_contacts" => Ok(Self::ListedContacts),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for InviteAudience {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for InviteAudience {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for InviteAudience {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Typed `config` shape for `invite_creator_roles`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Typed `config` shape for `invite_creator_roles`.",
/// "type": "object",
/// "required": [
/// "allowed_roles"
/// ],
/// "properties": {
/// "allowed_roles": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "applies_to": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PolicyPrincipalKind"
/// }
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InviteCreatorRolesPolicyConfig {
pub allowed_roles: ::std::vec::Vec<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub applies_to: ::std::option::Option<::std::vec::Vec<PolicyPrincipalKind>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
}
///How the recurring series ends (from `invite_recurrence`), for admin/public display.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "How the recurring series ends (from `invite_recurrence`), for admin/public display.",
/// "oneOf": [
/// {
/// "type": "object",
/// "required": [
/// "kind"
/// ],
/// "properties": {
/// "kind": {
/// "type": "string",
/// "enum": [
/// "never"
/// ]
/// }
/// }
/// },
/// {
/// "type": "object",
/// "required": [
/// "at",
/// "kind"
/// ],
/// "properties": {
/// "at": {
/// "type": "string"
/// },
/// "kind": {
/// "type": "string",
/// "enum": [
/// "until"
/// ]
/// }
/// }
/// },
/// {
/// "type": "object",
/// "required": [
/// "kind",
/// "total"
/// ],
/// "properties": {
/// "kind": {
/// "type": "string",
/// "enum": [
/// "count"
/// ]
/// },
/// "last_window_to": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "total": {
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(tag = "kind")]
pub enum InviteRecurrenceSeriesEnd {
#[serde(rename = "never")]
Never,
#[serde(rename = "until")]
Until { at: ::std::string::String },
#[serde(rename = "count")]
Count {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
last_window_to: ::std::option::Option<::std::string::String>,
total: i32,
},
}
///`InviteScheduleCombined`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "open_ended_recurrence": {
/// "type": "boolean"
/// },
/// "since": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "until": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InviteScheduleCombined {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub open_ended_recurrence: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub since: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub until: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for InviteScheduleCombined {
fn default() -> Self {
Self {
open_ended_recurrence: Default::default(),
since: Default::default(),
until: Default::default(),
}
}
}
///`InviteScheduleEntryInput`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "expires_in": {
/// "description": "Duration per [RFC 5545 §3.3.6](https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.6) (ISO 8601 `P1D`, `PT1H`, …; no months/years) or compact tokens `s`/`m`/`h`/`d`/`w` (`M` is minutes). Max 3650d (10 years). `1y` is rejected. Measured from resolved `valid_from`. Mutually exclusive with `valid_to`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "invite_recurrence": {},
/// "is_enabled": {
/// "type": "boolean"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "starts_in": {
/// "description": "Duration per [RFC 5545 §3.3.6](https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.6) (ISO 8601 `P1D`, `PT1H`, …; no months/years) or compact tokens `s`/`m`/`h`/`d`/`w` (`M` is minutes). Max 3650d (10 years). `1y` is rejected. Mutually exclusive with `valid_from`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "valid_from": {
/// "description": "[RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) start (UTC). Mutually exclusive with `starts_in`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "valid_to": {
/// "description": "[RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) end (UTC). Mutually exclusive with `expires_in`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InviteScheduleEntryInput {
///Duration per [RFC 5545 §3.3.6](https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.6) (ISO 8601 `P1D`, `PT1H`, …; no months/years) or compact tokens `s`/`m`/`h`/`d`/`w` (`M` is minutes). Max 3650d (10 years). `1y` is rejected. Measured from resolved `valid_from`. Mutually exclusive with `valid_to`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_in: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invite_recurrence: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_enabled: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
///Duration per [RFC 5545 §3.3.6](https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.6) (ISO 8601 `P1D`, `PT1H`, …; no months/years) or compact tokens `s`/`m`/`h`/`d`/`w` (`M` is minutes). Max 3650d (10 years). `1y` is rejected. Mutually exclusive with `valid_from`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub starts_in: ::std::option::Option<::std::string::String>,
///[RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) start (UTC). Mutually exclusive with `starts_in`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub valid_from: ::std::option::Option<::std::string::String>,
///[RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) end (UTC). Mutually exclusive with `expires_in`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub valid_to: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for InviteScheduleEntryInput {
fn default() -> Self {
Self {
expires_in: Default::default(),
id: Default::default(),
invite_recurrence: Default::default(),
is_enabled: Default::default(),
name: Default::default(),
starts_in: Default::default(),
valid_from: Default::default(),
valid_to: Default::default(),
}
}
}
///`InviteScheduleEntrySnapshot`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "is_enabled",
/// "schedule",
/// "valid_from",
/// "valid_to"
/// ],
/// "properties": {
/// "id": {
/// "type": "string"
/// },
/// "invite_recurrence": {},
/// "is_enabled": {
/// "type": "boolean"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "schedule": {
/// "$ref": "#/components/schemas/InviteScheduleSnapshot"
/// },
/// "valid_from": {
/// "type": "string"
/// },
/// "valid_to": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InviteScheduleEntrySnapshot {
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invite_recurrence: ::std::option::Option<::serde_json::Value>,
pub is_enabled: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
pub schedule: InviteScheduleSnapshot,
pub valid_from: ::std::string::String,
pub valid_to: ::std::string::String,
}
///`InviteScheduleKind`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "single_window",
/// "single_recurring",
/// "multiple"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum InviteScheduleKind {
#[serde(rename = "single_window")]
SingleWindow,
#[serde(rename = "single_recurring")]
SingleRecurring,
#[serde(rename = "multiple")]
Multiple,
}
impl ::std::fmt::Display for InviteScheduleKind {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::SingleWindow => f.write_str("single_window"),
Self::SingleRecurring => f.write_str("single_recurring"),
Self::Multiple => f.write_str("multiple"),
}
}
}
impl ::std::str::FromStr for InviteScheduleKind {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"single_window" => Ok(Self::SingleWindow),
"single_recurring" => Ok(Self::SingleRecurring),
"multiple" => Ok(Self::Multiple),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for InviteScheduleKind {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for InviteScheduleKind {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for InviteScheduleKind {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`InviteScheduleSnapshot`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "is_recurring",
/// "slot_duration_seconds"
/// ],
/// "properties": {
/// "active_window": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/InviteWindow"
/// }
/// ]
/// }
/// ]
/// },
/// "is_recurring": {
/// "type": "boolean"
/// },
/// "next_window": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/InviteWindow"
/// }
/// ]
/// }
/// ]
/// },
/// "series_end": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/InviteRecurrenceSeriesEnd"
/// }
/// ]
/// }
/// ]
/// },
/// "slot_duration_seconds": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InviteScheduleSnapshot {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub active_window: ::std::option::Option<InviteWindow>,
pub is_recurring: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub next_window: ::std::option::Option<InviteWindow>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub series_end: ::std::option::Option<InviteRecurrenceSeriesEnd>,
pub slot_duration_seconds: i64,
}
///`InviteWindow`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "from",
/// "to"
/// ],
/// "properties": {
/// "from": {
/// "type": "string"
/// },
/// "to": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct InviteWindow {
pub from: ::std::string::String,
pub to: ::std::string::String,
}
///`JsonRpcResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "jsonrpc"
/// ],
/// "properties": {
/// "error": {},
/// "id": {},
/// "jsonrpc": {
/// "type": "string"
/// },
/// "result": {}
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct JsonRpcResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub error: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub id: ::std::option::Option<::serde_json::Value>,
pub jsonrpc: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub result: ::std::option::Option<::serde_json::Value>,
}
///One capacity key's overage snapshot.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One capacity key's overage snapshot.",
/// "type": "object",
/// "required": [
/// "current",
/// "excess",
/// "key",
/// "limit",
/// "unit"
/// ],
/// "properties": {
/// "current": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "excess": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "key": {
/// "$ref": "#/components/schemas/QuotaKey"
/// },
/// "limit": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "unit": {
/// "$ref": "#/components/schemas/QuotaUnit"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct KeyOverage {
pub current: i64,
pub excess: i64,
pub key: QuotaKey,
pub limit: i64,
pub unit: QuotaUnit,
}
///`LanAgentTaskSpecRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "lan_protocol_version",
/// "payload",
/// "task_id"
/// ],
/// "properties": {
/// "lan_protocol_version": {
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "payload": {},
/// "task_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct LanAgentTaskSpecRequest {
pub lan_protocol_version: i32,
pub payload: ::serde_json::Value,
pub task_id: ::std::string::String,
}
///`LanAgentTaskSpecResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "lan_protocol_version",
/// "spec",
/// "task_id"
/// ],
/// "properties": {
/// "lan_protocol_version": {
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "spec": {},
/// "task_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LanAgentTaskSpecResponse {
pub lan_protocol_version: i32,
pub spec: ::serde_json::Value,
pub task_id: ::std::string::String,
}
///`LifeSafetyAttestation`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "attested_at",
/// "fire_door_listing_unaltered",
/// "independent_egress",
/// "installer_name",
/// "openapp_not_fire_alarm_interface",
/// "power_fail_behavior"
/// ],
/// "properties": {
/// "attested_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "attested_by_user_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "entrapment_protection_present": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "fire_door_listing_unaltered": {
/// "type": "boolean"
/// },
/// "independent_egress": {
/// "type": "boolean"
/// },
/// "installer_name": {
/// "type": "string"
/// },
/// "listed_local_system": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "openapp_not_fire_alarm_interface": {
/// "type": "boolean"
/// },
/// "power_fail_behavior": {
/// "$ref": "#/components/schemas/PowerFailBehavior"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LifeSafetyAttestation {
pub attested_at: ::chrono::DateTime<::chrono::offset::Utc>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub attested_by_user_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub entrapment_protection_present: ::std::option::Option<bool>,
pub fire_door_listing_unaltered: bool,
pub independent_egress: bool,
pub installer_name: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub listed_local_system: ::std::option::Option<bool>,
pub openapp_not_fire_alarm_interface: bool,
pub power_fail_behavior: PowerFailBehavior,
}
///`LifeSafetyClass`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "not_applicable",
/// "ingress_only",
/// "vehicle_gate",
/// "special_locking_listed_local",
/// "means_of_egress",
/// "fire_door_assembly"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum LifeSafetyClass {
#[serde(rename = "not_applicable")]
NotApplicable,
#[serde(rename = "ingress_only")]
IngressOnly,
#[serde(rename = "vehicle_gate")]
VehicleGate,
#[serde(rename = "special_locking_listed_local")]
SpecialLockingListedLocal,
#[serde(rename = "means_of_egress")]
MeansOfEgress,
#[serde(rename = "fire_door_assembly")]
FireDoorAssembly,
}
impl ::std::fmt::Display for LifeSafetyClass {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::NotApplicable => f.write_str("not_applicable"),
Self::IngressOnly => f.write_str("ingress_only"),
Self::VehicleGate => f.write_str("vehicle_gate"),
Self::SpecialLockingListedLocal => f.write_str("special_locking_listed_local"),
Self::MeansOfEgress => f.write_str("means_of_egress"),
Self::FireDoorAssembly => f.write_str("fire_door_assembly"),
}
}
}
impl ::std::str::FromStr for LifeSafetyClass {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"not_applicable" => Ok(Self::NotApplicable),
"ingress_only" => Ok(Self::IngressOnly),
"vehicle_gate" => Ok(Self::VehicleGate),
"special_locking_listed_local" => Ok(Self::SpecialLockingListedLocal),
"means_of_egress" => Ok(Self::MeansOfEgress),
"fire_door_assembly" => Ok(Self::FireDoorAssembly),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for LifeSafetyClass {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for LifeSafetyClass {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for LifeSafetyClass {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Map of light entity ULID to auto-off duration in seconds.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Map of light entity ULID to auto-off duration in seconds.",
/// "type": "object",
/// "additionalProperties": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct LightsAutoOffDuration(pub ::std::collections::HashMap<::std::string::String, i64>);
impl ::std::ops::Deref for LightsAutoOffDuration {
type Target = ::std::collections::HashMap<::std::string::String, i64>;
fn deref(&self) -> &::std::collections::HashMap<::std::string::String, i64> {
&self.0
}
}
impl ::std::convert::From<LightsAutoOffDuration>
for ::std::collections::HashMap<::std::string::String, i64>
{
fn from(value: LightsAutoOffDuration) -> Self {
value.0
}
}
impl ::std::convert::From<::std::collections::HashMap<::std::string::String, i64>>
for LightsAutoOffDuration
{
fn from(value: ::std::collections::HashMap<::std::string::String, i64>) -> Self {
Self(value)
}
}
///`LimitSource`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "oneOf": [
/// {
/// "description": "A row in `quota_overrides`; carries the override id for traceability.",
/// "type": "object",
/// "required": [
/// "id",
/// "kind"
/// ],
/// "properties": {
/// "id": {
/// "type": "string"
/// },
/// "kind": {
/// "type": "string",
/// "enum": [
/// "override"
/// ]
/// }
/// }
/// },
/// {
/// "description": "A row in `tier_quotas`; carries the tier slug.",
/// "type": "object",
/// "required": [
/// "kind",
/// "slug"
/// ],
/// "properties": {
/// "kind": {
/// "type": "string",
/// "enum": [
/// "tier"
/// ]
/// },
/// "slug": {
/// "type": "string"
/// }
/// }
/// },
/// {
/// "description": "The hardcoded fallback in `catalog::DEFAULT_TIER_FOR_PERSONAL` when no\ntier is configured for the org (e.g. brand-new personal workspace).",
/// "type": "object",
/// "required": [
/// "kind"
/// ],
/// "properties": {
/// "kind": {
/// "type": "string",
/// "enum": [
/// "default"
/// ]
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(tag = "kind")]
pub enum LimitSource {
///A row in `quota_overrides`; carries the override id for traceability.
#[serde(rename = "override")]
Override { id: ::std::string::String },
///A row in `tier_quotas`; carries the tier slug.
#[serde(rename = "tier")]
Tier { slug: ::std::string::String },
#[serde(rename = "default")]
Default,
}
///`ListAccessInviteRenewalRequestsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "requests"
/// ],
/// "properties": {
/// "requests": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/AccessInviteRenewalRequestItem"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListAccessInviteRenewalRequestsResponse {
pub requests: ::std::vec::Vec<AccessInviteRenewalRequestItem>,
}
///`ListAuditEventsQuery`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "actor_guest_id": {
/// "description": "Filter to a single guest fingerprint. Disjoint from `actor_user_id`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "actor_kind": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "actor_user_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "correlation_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "cursor": {
/// "description": "Opaque cursor from a previous page's `next_cursor`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "door_name": {
/// "description": "Case-insensitive substring match on the snapshotted door name\n(`details.door_name`), e.g. `lobby`. Lets the Activity table answer \"who opened\nthis door\" across every event that names it.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "event_type": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "limit": {
/// "description": "Page size (default 50, max 200).",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "occurred_after": {
/// "description": "RFC 3339 lower bound (inclusive). Must be within the 30-day hot window.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "occurred_before": {
/// "description": "RFC 3339 upper bound (inclusive).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "org_scope": {
/// "description": "Organization scope for resource events. Descendants are included by default.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "outcome": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "resource_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "resource_name": {
/// "description": "Case-insensitive substring match on the resource's snapshotted display name\n(`details.resource_name`), e.g. `shelly`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "resource_type": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "target_id": {
/// "description": "Exact match against the snapshotted portal target ID (`details.public_portal_id`).",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListAuditEventsQuery {
///Filter to a single guest fingerprint. Disjoint from `actor_user_id`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub actor_guest_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub actor_kind: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub actor_user_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub correlation_id: ::std::option::Option<::std::string::String>,
///Opaque cursor from a previous page's `next_cursor`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub cursor: ::std::option::Option<::std::string::String>,
/**Case-insensitive substring match on the snapshotted door name
(`details.door_name`), e.g. `lobby`. Lets the Activity table answer "who opened
this door" across every event that names it.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub door_name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub event_type: ::std::option::Option<::std::string::String>,
///Page size (default 50, max 200).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub limit: ::std::option::Option<i32>,
///RFC 3339 lower bound (inclusive). Must be within the 30-day hot window.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub occurred_after: ::std::option::Option<::std::string::String>,
///RFC 3339 upper bound (inclusive).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub occurred_before: ::std::option::Option<::std::string::String>,
///Organization scope for resource events. Descendants are included by default.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub org_scope: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub outcome: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub resource_id: ::std::option::Option<::std::string::String>,
/**Case-insensitive substring match on the resource's snapshotted display name
(`details.resource_name`), e.g. `shelly`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub resource_name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub resource_type: ::std::option::Option<::std::string::String>,
///Exact match against the snapshotted portal target ID (`details.public_portal_id`).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub target_id: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for ListAuditEventsQuery {
fn default() -> Self {
Self {
actor_guest_id: Default::default(),
actor_kind: Default::default(),
actor_user_id: Default::default(),
correlation_id: Default::default(),
cursor: Default::default(),
door_name: Default::default(),
event_type: Default::default(),
limit: Default::default(),
occurred_after: Default::default(),
occurred_before: Default::default(),
org_scope: Default::default(),
outcome: Default::default(),
resource_id: Default::default(),
resource_name: Default::default(),
resource_type: Default::default(),
target_id: Default::default(),
}
}
}
///`ListDevicesQuery`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/MultiResourceOutputOptionsQuery"
/// },
/// {
/// "$ref": "#/components/schemas/PaginationQuery"
/// },
/// {
/// "type": "object",
/// "properties": {
/// "device_kind": {
/// "description": "Optional filter: only devices with metadata.kind equal to this value (e.g. virtual_access_portal).\nRequires integration_id. Filtering done at SQL level.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "external_id": {
/// "description": "Optional filter: only devices with this external_id. Requires integration_id and device_kind.\nReturns at most 1 device. Filtering done at SQL level.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "has_external_id": {
/// "description": "When true, only devices with a non-empty `external_id`. Requires `integration_id`.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "has_go2rtc_channel": {
/// "description": "When true, only devices whose metadata JSON has a non-empty `channel` (go2rtc cameras). Requires `integration_id`.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "include_stale": {
/// "description": "When true with `integration_id`, include `stale` per device when the provider supports it.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "integration_id": {
/// "description": "Optional filter: only devices belonging to this integration.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "locale": {
/// "description": "Locale used to resolve the localized `name` when sorting by name (e.g. `en`). Defaults to `en`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "q": {
/// "description": "Case-insensitive substring match on localized device name (JSON). Best-effort when `integration_id` is set (SQL ILIKE).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "sort": {
/// "description": "Server-side ordering for org-wide lists: `name:asc`, `name:desc`, `created_at:asc`, `created_at:desc`.\nIgnored when `integration_id` is set. Defaults to insertion order when omitted.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListDevicesQuery {
/**Optional filter: only devices with metadata.kind equal to this value (e.g. virtual_access_portal).
Requires integration_id. Filtering done at SQL level.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub device_kind: ::std::option::Option<::std::string::String>,
/**Optional filter: only devices with this external_id. Requires integration_id and device_kind.
Returns at most 1 device. Filtering done at SQL level.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
///When true, only devices with a non-empty `external_id`. Requires `integration_id`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub has_external_id: ::std::option::Option<bool>,
///When true, only devices whose metadata JSON has a non-empty `channel` (go2rtc cameras). Requires `integration_id`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub has_go2rtc_channel: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub include_deleted: ::std::option::Option<bool>,
///When true with `integration_id`, include `stale` per device when the provider supports it.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub include_stale: ::std::option::Option<bool>,
///Optional filter: only devices belonging to this integration.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub integration_id: ::std::option::Option<::std::string::String>,
///Number of items per page. Default from config, max 200.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub limit: ::std::option::Option<i32>,
///Locale used to resolve the localized `name` when sorting by name (e.g. `en`). Defaults to `en`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub locale: ::std::option::Option<::std::string::String>,
///Number of items to skip. Default 0.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub offset: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub only_deleted: ::std::option::Option<bool>,
///Case-insensitive substring match on localized device name (JSON). Best-effort when `integration_id` is set (SQL ILIKE).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub q: ::std::option::Option<::std::string::String>,
/**Server-side ordering for org-wide lists: `name:asc`, `name:desc`, `created_at:asc`, `created_at:desc`.
Ignored when `integration_id` is set. Defaults to insertion order when omitted.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub sort: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for ListDevicesQuery {
fn default() -> Self {
Self {
device_kind: Default::default(),
external_id: Default::default(),
has_external_id: Default::default(),
has_go2rtc_channel: Default::default(),
include_deleted: Default::default(),
include_stale: Default::default(),
integration_id: Default::default(),
limit: Default::default(),
locale: Default::default(),
offset: Default::default(),
only_deleted: Default::default(),
q: Default::default(),
sort: Default::default(),
}
}
}
///List entities for the organization context (X-Org).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "List entities for the organization context (X-Org).",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/MultiResourceOutputOptionsQuery"
/// },
/// {
/// "$ref": "#/components/schemas/PaginationQuery"
/// },
/// {
/// "type": "object",
/// "properties": {
/// "q": {
/// "description": "Case-insensitive substring match on entity `name` (plain text). Applies to org-wide lists.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "sort": {
/// "description": "Server-side ordering for org-wide lists: `name:asc`, `name:desc`, `created_at:asc`, `created_at:desc`.\nIgnored when `zone_id` is set. Defaults to insertion order when omitted.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "zone_id": {
/// "description": "Optional filter: only entities in this zone.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListEntitiesQuery {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub include_deleted: ::std::option::Option<bool>,
///Number of items per page. Default from config, max 200.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub limit: ::std::option::Option<i32>,
///Number of items to skip. Default 0.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub offset: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub only_deleted: ::std::option::Option<bool>,
///Case-insensitive substring match on entity `name` (plain text). Applies to org-wide lists.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub q: ::std::option::Option<::std::string::String>,
/**Server-side ordering for org-wide lists: `name:asc`, `name:desc`, `created_at:asc`, `created_at:desc`.
Ignored when `zone_id` is set. Defaults to insertion order when omitted.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub sort: ::std::option::Option<::std::string::String>,
///Optional filter: only entities in this zone.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub zone_id: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for ListEntitiesQuery {
fn default() -> Self {
Self {
include_deleted: Default::default(),
limit: Default::default(),
offset: Default::default(),
only_deleted: Default::default(),
q: Default::default(),
sort: Default::default(),
zone_id: Default::default(),
}
}
}
///`ListIntegrationAccessInvitesResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "invites"
/// ],
/// "properties": {
/// "invites": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/AccessInviteListItem"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListIntegrationAccessInvitesResponse {
pub invites: ::std::vec::Vec<AccessInviteListItem>,
}
///`ListIntegrationAccessPortalsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "portals"
/// ],
/// "properties": {
/// "portals": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/AccessPortalListItem"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListIntegrationAccessPortalsResponse {
pub portals: ::std::vec::Vec<AccessPortalListItem>,
}
///`ListIntegrationsQuery`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/MultiResourceOutputOptionsQuery"
/// },
/// {
/// "$ref": "#/components/schemas/PaginationQuery"
/// },
/// {
/// "type": "object",
/// "properties": {
/// "provider_type": {
/// "description": "Optional filter: only integrations with this provider_type (e.g. virtual_access).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "q": {
/// "description": "Optional case-insensitive substring match on integration `name` (localized JSON), same as devices list.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListIntegrationsQuery {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub include_deleted: ::std::option::Option<bool>,
///Number of items per page. Default from config, max 200.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub limit: ::std::option::Option<i32>,
///Number of items to skip. Default 0.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub offset: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub only_deleted: ::std::option::Option<bool>,
///Optional filter: only integrations with this provider_type (e.g. virtual_access).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub provider_type: ::std::option::Option<::std::string::String>,
///Optional case-insensitive substring match on integration `name` (localized JSON), same as devices list.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub q: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for ListIntegrationsQuery {
fn default() -> Self {
Self {
include_deleted: Default::default(),
limit: Default::default(),
offset: Default::default(),
only_deleted: Default::default(),
provider_type: Default::default(),
q: Default::default(),
}
}
}
///`ListInvitationsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "invitations"
/// ],
/// "properties": {
/// "invitations": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/UserInvitationDto"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListInvitationsResponse {
pub invitations: ::std::vec::Vec<UserInvitationDto>,
}
///`ListOrgChildrenQuery`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/MultiResourceOutputOptionsQuery"
/// },
/// {
/// "$ref": "#/components/schemas/PaginationQuery"
/// },
/// {
/// "type": "object",
/// "properties": {
/// "parent_id": {
/// "description": "Parent org id. When omitted, returns the roots of the caller's visible org forest.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListOrgChildrenQuery {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub include_deleted: ::std::option::Option<bool>,
///Number of items per page. Default from config, max 200.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub limit: ::std::option::Option<i32>,
///Number of items to skip. Default 0.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub offset: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub only_deleted: ::std::option::Option<bool>,
///Parent org id. When omitted, returns the roots of the caller's visible org forest.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub parent_id: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for ListOrgChildrenQuery {
fn default() -> Self {
Self {
include_deleted: Default::default(),
limit: Default::default(),
offset: Default::default(),
only_deleted: Default::default(),
parent_id: Default::default(),
}
}
}
///`ListOrgUsersQuery`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/MultiResourceOutputOptionsQuery"
/// },
/// {
/// "$ref": "#/components/schemas/PaginationQuery"
/// },
/// {
/// "type": "object",
/// "properties": {
/// "recursive": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListOrgUsersQuery {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub include_deleted: ::std::option::Option<bool>,
///Number of items per page. Default from config, max 200.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub limit: ::std::option::Option<i32>,
///Number of items to skip. Default 0.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub offset: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub only_deleted: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub recursive: ::std::option::Option<bool>,
}
impl ::std::default::Default for ListOrgUsersQuery {
fn default() -> Self {
Self {
include_deleted: Default::default(),
limit: Default::default(),
offset: Default::default(),
only_deleted: Default::default(),
recursive: Default::default(),
}
}
}
///`ListOrgsQuery`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/MultiResourceOutputOptionsQuery"
/// },
/// {
/// "$ref": "#/components/schemas/PaginationQuery"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListOrgsQuery {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub include_deleted: ::std::option::Option<bool>,
///Number of items per page. Default from config, max 200.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub limit: ::std::option::Option<i32>,
///Number of items to skip. Default 0.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub offset: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub only_deleted: ::std::option::Option<bool>,
}
impl ::std::default::Default for ListOrgsQuery {
fn default() -> Self {
Self {
include_deleted: Default::default(),
limit: Default::default(),
offset: Default::default(),
only_deleted: Default::default(),
}
}
}
///`ListScriptingExecutionsQuery`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "limit": {
/// "description": "Maximum number of executions to return (1-100, default 20).",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ListScriptingExecutionsQuery {
///Maximum number of executions to return (1-100, default 20).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub limit: ::std::option::Option<i64>,
}
impl ::std::default::Default for ListScriptingExecutionsQuery {
fn default() -> Self {
Self {
limit: Default::default(),
}
}
}
///`LocaleContentTranslation`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "body",
/// "title"
/// ],
/// "properties": {
/// "body": {
/// "type": "string"
/// },
/// "title": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LocaleContentTranslation {
pub body: ::std::string::String,
pub title: ::std::string::String,
}
/**Localized string dictionary.
This matches the dashboard convention: `{ [locale: string]: string }`.
Notes:
- Internally this is keyed by `icu_locale_core::Locale` for type-safety.
- For JSON/OpenAPI purposes this is treated as a `{ [locale: string]: string }` object.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Localized string dictionary.\n\nThis matches the dashboard convention: `{ [locale: string]: string }`.\n\nNotes:\n- Internally this is keyed by `icu_locale_core::Locale` for type-safety.\n- For JSON/OpenAPI purposes this is treated as a `{ [locale: string]: string }` object.",
/// "type": "object",
/// "required": [
/// "value"
/// ],
/// "properties": {
/// "value": {
/// "description": "OpenAPI representation: `HashMap<String, String>` (JSON object).",
/// "type": "object",
/// "additionalProperties": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LocalizedString {
///OpenAPI representation: `HashMap<String, String>` (JSON object).
pub value: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
}
///`LocationBindingMode`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "inherit",
/// "explicit",
/// "none"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum LocationBindingMode {
#[serde(rename = "inherit")]
Inherit,
#[serde(rename = "explicit")]
Explicit,
#[serde(rename = "none")]
None,
}
impl ::std::fmt::Display for LocationBindingMode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Inherit => f.write_str("inherit"),
Self::Explicit => f.write_str("explicit"),
Self::None => f.write_str("none"),
}
}
}
impl ::std::str::FromStr for LocationBindingMode {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"inherit" => Ok(Self::Inherit),
"explicit" => Ok(Self::Explicit),
"none" => Ok(Self::None),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for LocationBindingMode {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for LocationBindingMode {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for LocationBindingMode {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`LocationBindingResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "mode"
/// ],
/// "properties": {
/// "location_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "mode": {
/// "$ref": "#/components/schemas/LocationBindingMode"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LocationBindingResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub location_id: ::std::option::Option<::std::string::String>,
pub mode: LocationBindingMode,
}
///`LocationKind`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "address",
/// "coordinates"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum LocationKind {
#[serde(rename = "address")]
Address,
#[serde(rename = "coordinates")]
Coordinates,
}
impl ::std::fmt::Display for LocationKind {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Address => f.write_str("address"),
Self::Coordinates => f.write_str("coordinates"),
}
}
}
impl ::std::str::FromStr for LocationKind {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"address" => Ok(Self::Address),
"coordinates" => Ok(Self::Coordinates),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for LocationKind {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for LocationKind {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for LocationKind {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`LocationListItemResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/LocationResponse"
/// },
/// {
/// "type": "object",
/// "properties": {
/// "is_bound_here": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "is_relevant": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "usage_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LocationListItemResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub city: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub country: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub formatted_address: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub geocoding_provider: ::std::option::Option<GeocodingProviderId>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_bound_here: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_relevant: ::std::option::Option<bool>,
pub kind: LocationKind,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lat: ::std::option::Option<f64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lng: ::std::option::Option<f64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub notes: ::std::option::Option<LocalizedString>,
/**Opaque place id issued by `geocoding_provider`. Both fields are present together or not at
all: a place id cannot be interpreted without knowing who issued it.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub provider_place_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub source: ::std::option::Option<LocationSource>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub usage_count: ::std::option::Option<i64>,
}
///`LocationResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "kind"
/// ],
/// "properties": {
/// "city": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "country": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "formatted_address": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "geocoding_provider": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/GeocodingProviderId"
/// }
/// ]
/// }
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "image_url": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "kind": {
/// "$ref": "#/components/schemas/LocationKind"
/// },
/// "lat": {
/// "type": [
/// "number",
/// "null"
/// ],
/// "format": "double"
/// },
/// "lng": {
/// "type": [
/// "number",
/// "null"
/// ],
/// "format": "double"
/// },
/// "notes": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "provider_place_id": {
/// "description": "Opaque place id issued by `geocoding_provider`. Both fields are present together or not at\nall: a place id cannot be interpreted without knowing who issued it.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "source": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocationSource"
/// }
/// ]
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LocationResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub city: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub country: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub formatted_address: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub geocoding_provider: ::std::option::Option<GeocodingProviderId>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_url: ::std::option::Option<::std::string::String>,
pub kind: LocationKind,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lat: ::std::option::Option<f64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lng: ::std::option::Option<f64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub notes: ::std::option::Option<LocalizedString>,
/**Opaque place id issued by `geocoding_provider`. Both fields are present together or not at
all: a place id cannot be interpreted without knowing who issued it.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub provider_place_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub source: ::std::option::Option<LocationSource>,
}
///`LocationSource`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "owner_id",
/// "owner_kind"
/// ],
/// "properties": {
/// "owner_id": {
/// "type": "string"
/// },
/// "owner_kind": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct LocationSource {
pub owner_id: ::std::string::String,
pub owner_kind: ::std::string::String,
}
///`ManagerTransferPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "nominee_user_id"
/// ],
/// "properties": {
/// "nominee_user_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ManagerTransferPayload {
pub nominee_user_id: ::std::string::String,
}
///`MeAccessInvitesResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "invites"
/// ],
/// "properties": {
/// "invites": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/AccessInviteListItem"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MeAccessInvitesResponse {
pub invites: ::std::vec::Vec<AccessInviteListItem>,
}
///`MeCallBlockItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "created_at",
/// "public_portal_id"
/// ],
/// "properties": {
/// "created_at": {
/// "type": "string"
/// },
/// "public_portal_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MeCallBlockItem {
pub created_at: ::std::string::String,
pub public_portal_id: ::std::string::String,
}
///`MeCallBlocksResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "blocks"
/// ],
/// "properties": {
/// "blocks": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/MeCallBlockItem"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MeCallBlocksResponse {
pub blocks: ::std::vec::Vec<MeCallBlockItem>,
}
///`MeCallSafetyOkResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "ok"
/// ],
/// "properties": {
/// "ok": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MeCallSafetyOkResponse {
pub ok: bool,
}
///`MeInvitationAsset`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "can_read",
/// "grants",
/// "integration_id",
/// "invite_link_id",
/// "org_id",
/// "state",
/// "uses"
/// ],
/// "properties": {
/// "access_control": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PublicPortalAccessControl"
/// }
/// ]
/// }
/// ]
/// },
/// "building_name": {},
/// "can_read": {
/// "description": "True when the requester has `integrations:read` on the invite's org, i.e.\nmay open the invitation's management page. Mirrors the authz check in\n`list_integration_access_invites`.",
/// "type": "boolean"
/// },
/// "claimed_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "grants": {
/// "description": "One entry per grant in the invite, with label / door image / lights flag\nenriched the same way as `GET /public/access/invites/{token}`. Lets\nclients render multi-door invitations without an extra round trip.",
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/PublicInviteGrant"
/// }
/// },
/// "integration_id": {
/// "type": "string"
/// },
/// "invite_link_id": {
/// "type": "string"
/// },
/// "invitee_message": {
/// "description": "Invitee-facing message (mirrors `PublicInviteResponse.invitee_message`).\nSame `LocalizedString` shape as on the public invite endpoint."
/// },
/// "last_used_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "max_uses": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "name": {
/// "description": "Admin-defined invite name (mirrors `PublicInviteResponse.name`).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "org_image_thumb_url": {
/// "description": "Presigned URL for the `thumb` rendition of the org logo, for small renders.\nAbsent when the source is already thumb-sized; fall back to `org_image_url`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "org_image_url": {
/// "description": "Presigned org logo URL (best-effort).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "photo_thumb_url": {
/// "description": "Presigned URL for the `thumb` rendition of the invite photo, for small renders.\nAbsent when the source is already thumb-sized; fall back to `photo_url`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "photo_url": {
/// "description": "Presigned URL for the invite's main photo (best-effort).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "state": {
/// "type": "string"
/// },
/// "uses": {
/// "description": "Number of times the invite has been used.",
/// "type": "integer",
/// "format": "int32"
/// },
/// "valid_from": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "valid_to": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MeInvitationAsset {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub access_control: ::std::option::Option<PublicPortalAccessControl>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub building_name: ::std::option::Option<::serde_json::Value>,
/**True when the requester has `integrations:read` on the invite's org, i.e.
may open the invitation's management page. Mirrors the authz check in
`list_integration_access_invites`.*/
pub can_read: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub claimed_at: ::std::option::Option<::std::string::String>,
/**One entry per grant in the invite, with label / door image / lights flag
enriched the same way as `GET /public/access/invites/{token}`. Lets
clients render multi-door invitations without an extra round trip.*/
pub grants: ::std::vec::Vec<PublicInviteGrant>,
pub integration_id: ::std::string::String,
pub invite_link_id: ::std::string::String,
/**Invitee-facing message (mirrors `PublicInviteResponse.invitee_message`).
Same `LocalizedString` shape as on the public invite endpoint.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invitee_message: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_used_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_uses: ::std::option::Option<i32>,
///Admin-defined invite name (mirrors `PublicInviteResponse.name`).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
pub org_id: ::std::string::String,
/**Presigned URL for the `thumb` rendition of the org logo, for small renders.
Absent when the source is already thumb-sized; fall back to `org_image_url`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub org_image_thumb_url: ::std::option::Option<::std::string::String>,
///Presigned org logo URL (best-effort).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub org_image_url: ::std::option::Option<::std::string::String>,
/**Presigned URL for the `thumb` rendition of the invite photo, for small renders.
Absent when the source is already thumb-sized; fall back to `photo_url`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub photo_thumb_url: ::std::option::Option<::std::string::String>,
///Presigned URL for the invite's main photo (best-effort).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub photo_url: ::std::option::Option<::std::string::String>,
pub state: ::std::string::String,
///Number of times the invite has been used.
pub uses: i32,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub valid_from: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub valid_to: ::std::option::Option<::std::string::String>,
}
///`MeInvitationsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "invitations"
/// ],
/// "properties": {
/// "invitations": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/MeInvitationAsset"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MeInvitationsResponse {
pub invitations: ::std::vec::Vec<MeInvitationAsset>,
}
///`MeListingAsset`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "call_eligible",
/// "entity_id",
/// "integration_id",
/// "org_id",
/// "receives_calls",
/// "role"
/// ],
/// "properties": {
/// "building_name": {},
/// "call_eligible": {
/// "description": "True when this user would be a callee for intercom calls (policy + role + receives_calls).",
/// "type": "boolean"
/// },
/// "display_name": {},
/// "dnd_enabled": {
/// "description": "True when calls are silenced for this listing (global DND or per-listing DND).",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "entity_id": {
/// "type": "string"
/// },
/// "floor": {},
/// "floor_number": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "image_thumb_url": {
/// "description": "Presigned URL for the `thumb` rendition of the listing photo, for small renders.\nAbsent when the source is already thumb-sized; fall back to `image_url`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "image_url": {
/// "description": "Presigned listing (entity) photo URL (best-effort).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "integration_id": {
/// "type": "string"
/// },
/// "listing_label": {},
/// "listing_number": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "org_name": {
/// "description": "Organization display name (best-effort)."
/// },
/// "receives_calls": {
/// "type": "boolean"
/// },
/// "role": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MeListingAsset {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub building_name: ::std::option::Option<::serde_json::Value>,
///True when this user would be a callee for intercom calls (policy + role + receives_calls).
pub call_eligible: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub display_name: ::std::option::Option<::serde_json::Value>,
///True when calls are silenced for this listing (global DND or per-listing DND).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub dnd_enabled: ::std::option::Option<bool>,
pub entity_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub floor: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub floor_number: ::std::option::Option<i64>,
/**Presigned URL for the `thumb` rendition of the listing photo, for small renders.
Absent when the source is already thumb-sized; fall back to `image_url`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_thumb_url: ::std::option::Option<::std::string::String>,
///Presigned listing (entity) photo URL (best-effort).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_url: ::std::option::Option<::std::string::String>,
pub integration_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub listing_label: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub listing_number: ::std::option::Option<i64>,
pub org_id: ::std::string::String,
///Organization display name (best-effort).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub org_name: ::std::option::Option<::serde_json::Value>,
pub receives_calls: bool,
pub role: ::std::string::String,
}
///`MeListingsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "age_class",
/// "listings"
/// ],
/// "properties": {
/// "age_class": {
/// "$ref": "#/components/schemas/AgeClass"
/// },
/// "dnd_global": {
/// "description": "True when user has global DND enabled (all calls silenced).",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "listings": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/MeListingAsset"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MeListingsResponse {
pub age_class: AgeClass,
///True when user has global DND enabled (all calls silenced).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub dnd_global: ::std::option::Option<bool>,
pub listings: ::std::vec::Vec<MeListingAsset>,
}
///`MeProfileResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "email_verified",
/// "idp_links",
/// "phone_verified",
/// "profile_sources"
/// ],
/// "properties": {
/// "email": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "email_verified": {
/// "type": "boolean"
/// },
/// "idp_links": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/IdpLinkResponse"
/// }
/// },
/// "image_sync_error": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "image_thumb_url": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "image_url": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "locale": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "phone": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "phone_verified": {
/// "type": "boolean"
/// },
/// "profile_sources": {
/// "$ref": "#/components/schemas/ProfileSourcesResponse"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MeProfileResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub email: ::std::option::Option<::std::string::String>,
pub email_verified: bool,
pub idp_links: ::std::vec::Vec<IdpLinkResponse>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_sync_error: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_thumb_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub locale: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone: ::std::option::Option<::std::string::String>,
pub phone_verified: bool,
pub profile_sources: ProfileSourcesResponse,
}
///`MePushSubscriptionStatusResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "has_any_notification_channel",
/// "has_device_token",
/// "has_subscription",
/// "push_configured"
/// ],
/// "properties": {
/// "has_any_notification_channel": {
/// "description": "Convenience: `has_subscription || has_device_token`.",
/// "type": "boolean"
/// },
/// "has_device_token": {
/// "description": "True when at least one native device token (APNs / FCM) is registered.",
/// "type": "boolean"
/// },
/// "has_subscription": {
/// "description": "True when at least one Web Push subscription exists for this browser/device flow.",
/// "type": "boolean"
/// },
/// "push_configured": {
/// "description": "True when VAPID is configured; false means Web Push call notifications cannot be sent.",
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MePushSubscriptionStatusResponse {
///Convenience: `has_subscription || has_device_token`.
pub has_any_notification_channel: bool,
///True when at least one native device token (APNs / FCM) is registered.
pub has_device_token: bool,
///True when at least one Web Push subscription exists for this browser/device flow.
pub has_subscription: bool,
///True when VAPID is configured; false means Web Push call notifications cannot be sent.
pub push_configured: bool,
}
///`MePushVapidPublicKeyResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "public_key"
/// ],
/// "properties": {
/// "public_key": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MePushVapidPublicKeyResponse {
pub public_key: ::std::string::String,
}
///`MeShareAuthoringPortal`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "integration_id",
/// "label",
/// "org_id",
/// "public_id"
/// ],
/// "properties": {
/// "id": {
/// "type": "string"
/// },
/// "integration_id": {
/// "type": "string"
/// },
/// "label": {},
/// "org_id": {
/// "type": "string"
/// },
/// "public_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MeShareAuthoringPortal {
pub id: ::std::string::String,
pub integration_id: ::std::string::String,
pub label: ::serde_json::Value,
pub org_id: ::std::string::String,
pub public_id: ::std::string::String,
}
///`MeShareAuthoringResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "allow_unlimited",
/// "default_max_uses",
/// "integration_id",
/// "max_duration_seconds",
/// "org_id",
/// "portals",
/// "require_justification",
/// "uses_editable"
/// ],
/// "properties": {
/// "allow_unlimited": {
/// "type": "boolean"
/// },
/// "blocked_reason": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "default_max_uses": {
/// "type": "integer",
/// "format": "int32"
/// },
/// "integration_id": {
/// "type": "string"
/// },
/// "max_duration_seconds": {
/// "description": "Effective share TTL cap (seconds): min of invitation max duration and share max\n(system default 86400 when `share_max_duration` is unset).",
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "max_uses": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "portals": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/MeShareAuthoringPortal"
/// }
/// },
/// "require_justification": {
/// "type": "boolean"
/// },
/// "uses_editable": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MeShareAuthoringResponse {
pub allow_unlimited: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub blocked_reason: ::std::option::Option<::std::string::String>,
pub default_max_uses: i32,
pub integration_id: ::std::string::String,
/**Effective share TTL cap (seconds): min of invitation max duration and share max
(system default 86400 when `share_max_duration` is unset).*/
pub max_duration_seconds: i64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_uses: ::std::option::Option<i32>,
pub org_id: ::std::string::String,
pub portals: ::std::vec::Vec<MeShareAuthoringPortal>,
pub require_justification: bool,
pub uses_editable: bool,
}
///`MemberCatalogItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "inventory_id",
/// "name",
/// "price_cents",
/// "product_id"
/// ],
/// "properties": {
/// "external_url": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "image_media_asset_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "inventory_id": {
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "price_cents": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "product_id": {
/// "type": "string"
/// },
/// "stock_quantity": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MemberCatalogItem {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_media_asset_id: ::std::option::Option<::std::string::String>,
pub inventory_id: ::std::string::String,
pub name: LocalizedString,
pub price_cents: i64,
pub product_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub stock_quantity: ::std::option::Option<i32>,
}
///`MemberCatalogResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "items",
/// "store"
/// ],
/// "properties": {
/// "items": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/MemberCatalogItem"
/// }
/// },
/// "store": {
/// "$ref": "#/components/schemas/Store"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MemberCatalogResponse {
pub items: ::std::vec::Vec<MemberCatalogItem>,
pub store: Store,
}
///`MergeOfferDto`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "candidate_has_avatar",
/// "candidate_user_id",
/// "expires_at",
/// "id",
/// "proof_complete",
/// "requesting_has_avatar",
/// "requesting_user_id",
/// "session_will_remap",
/// "survivor_user_id",
/// "trigger_kind",
/// "trigger_masked"
/// ],
/// "properties": {
/// "candidate_has_avatar": {
/// "type": "boolean"
/// },
/// "candidate_user_id": {
/// "type": "string"
/// },
/// "claim_email": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "claim_phone": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_at": {
/// "type": "string"
/// },
/// "id": {
/// "type": "string"
/// },
/// "proof_complete": {
/// "description": "False for an org-admin request until the resident proves the other identifier.",
/// "type": "boolean"
/// },
/// "requesting_has_avatar": {
/// "type": "boolean"
/// },
/// "requesting_user_id": {
/// "type": "string"
/// },
/// "session_will_remap": {
/// "type": "boolean"
/// },
/// "survivor_user_id": {
/// "type": "string"
/// },
/// "trigger_kind": {
/// "type": "string"
/// },
/// "trigger_masked": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MergeOfferDto {
pub candidate_has_avatar: bool,
pub candidate_user_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub claim_email: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub claim_phone: ::std::option::Option<::std::string::String>,
pub expires_at: ::std::string::String,
pub id: ::std::string::String,
///False for an org-admin request until the resident proves the other identifier.
pub proof_complete: bool,
pub requesting_has_avatar: bool,
pub requesting_user_id: ::std::string::String,
pub session_will_remap: bool,
pub survivor_user_id: ::std::string::String,
pub trigger_kind: ::std::string::String,
pub trigger_masked: ::std::string::String,
}
/**Options for list and other multi-resource operations.
Contains single-resource options in a flat manner plus `only_deleted` and pagination.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Options for list and other multi-resource operations.\nContains single-resource options in a flat manner plus `only_deleted` and pagination.",
/// "type": "object",
/// "required": [
/// "limit",
/// "offset",
/// "only_deleted",
/// "single"
/// ],
/// "properties": {
/// "limit": {
/// "description": "Pagination: max items to return. Default from config when not specified.",
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "offset": {
/// "description": "Pagination: items to skip. Default 0 when not specified.",
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "only_deleted": {
/// "description": "If true, return *only* soft-deleted items.\n\nNote: This implies `include_deleted=true` at the API boundary, but repository/storage\nimplementations should treat this as a separate filter.",
/// "type": "boolean"
/// },
/// "single": {
/// "$ref": "#/components/schemas/SingleResourceOutputOptions"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MultiResourceOutputOptions {
///Pagination: max items to return. Default from config when not specified.
pub limit: i32,
///Pagination: items to skip. Default 0 when not specified.
pub offset: i32,
/**If true, return *only* soft-deleted items.
Note: This implies `include_deleted=true` at the API boundary, but repository/storage
implementations should treat this as a separate filter.*/
pub only_deleted: bool,
pub single: SingleResourceOutputOptions,
}
///`MultiResourceOutputOptionsQuery`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "include_deleted": {
/// "type": "boolean"
/// },
/// "only_deleted": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MultiResourceOutputOptionsQuery {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub include_deleted: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub only_deleted: ::std::option::Option<bool>,
}
impl ::std::default::Default for MultiResourceOutputOptionsQuery {
fn default() -> Self {
Self {
include_deleted: Default::default(),
only_deleted: Default::default(),
}
}
}
///A group the caller belongs to, with the sites it grants access to.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A group the caller belongs to, with the sites it grants access to.",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/GroupResponse"
/// },
/// {
/// "type": "object",
/// "required": [
/// "my_role",
/// "sites"
/// ],
/// "properties": {
/// "manager_transfer": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/HouseholdManagerTransferView"
/// }
/// ]
/// }
/// ]
/// },
/// "my_role": {
/// "description": "The caller's role within the group.",
/// "type": "string"
/// },
/// "sites": {
/// "description": "Sites where this group is linked and the caller is admitted.",
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/GroupSiteRef"
/// }
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct MyGroupResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::serde_json::Value>,
pub home_org_id: ::std::string::String,
pub id: ::std::string::String,
pub kind: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub manager_transfer: ::std::option::Option<HouseholdManagerTransferView>,
///The caller's role within the group.
pub my_role: ::std::string::String,
pub name: ::serde_json::Value,
pub shareable: bool,
///Sites where this group is linked and the caller is admitted.
pub sites: ::std::vec::Vec<GroupSiteRef>,
}
///`NotificationChannel`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "audit"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum NotificationChannel {
#[serde(rename = "audit")]
Audit,
}
impl ::std::fmt::Display for NotificationChannel {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Audit => f.write_str("audit"),
}
}
}
impl ::std::str::FromStr for NotificationChannel {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"audit" => Ok(Self::Audit),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for NotificationChannel {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for NotificationChannel {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for NotificationChannel {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Shared typed `config` shape for notification policies.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Shared typed `config` shape for notification policies.",
/// "type": "object",
/// "required": [
/// "channels"
/// ],
/// "properties": {
/// "applies_to": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PolicyPrincipalKind"
/// }
/// },
/// "channels": {
/// "description": "Notification destinations. Only `audit` is currently supported.",
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/NotificationChannel"
/// }
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct NotificationPolicyConfig {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub applies_to: ::std::option::Option<::std::vec::Vec<PolicyPrincipalKind>>,
///Notification destinations. Only `audit` is currently supported.
pub channels: ::std::vec::Vec<NotificationChannel>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
}
///`NotifyPortalMessageBody`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "text"
/// ],
/// "properties": {
/// "text": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct NotifyPortalMessageBody {
pub text: ::std::string::String,
}
/**Permissions the current user has in this org (for UI: gray out / tooltips).
Returns permission keys (e.g. `users:create`, `admin`) granted directly or via inheritance.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Permissions the current user has in this org (for UI: gray out / tooltips).\nReturns permission keys (e.g. `users:create`, `admin`) granted directly or via inheritance.",
/// "type": "object",
/// "required": [
/// "permissions"
/// ],
/// "properties": {
/// "permissions": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrgPermissionsResponse {
pub permissions: ::std::vec::Vec<::std::string::String>,
}
///`OrgPrivacySettingsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "audit_retention_days",
/// "audit_retention_days_max",
/// "audit_retention_days_min"
/// ],
/// "properties": {
/// "audit_retention_days": {
/// "type": "integer",
/// "format": "int32"
/// },
/// "audit_retention_days_max": {
/// "type": "integer",
/// "format": "int32"
/// },
/// "audit_retention_days_min": {
/// "type": "integer",
/// "format": "int32"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrgPrivacySettingsResponse {
pub audit_retention_days: i32,
pub audit_retention_days_max: i32,
pub audit_retention_days_min: i32,
}
///`OrgProposeMergeRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "org_user_id"
/// ],
/// "properties": {
/// "org_user_id": {
/// "type": "string"
/// },
/// "other_email": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "other_phone": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct OrgProposeMergeRequest {
pub org_user_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub other_email: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub other_phone: ::std::option::Option<::std::string::String>,
}
///`OrgProposeMergeResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "expires_at",
/// "id"
/// ],
/// "properties": {
/// "expires_at": {
/// "type": "string"
/// },
/// "id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrgProposeMergeResponse {
pub expires_at: ::std::string::String,
pub id: ::std::string::String,
}
///`OrgTimezoneResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "timezone": {
/// "description": "IANA timezone (e.g. `Asia/Jerusalem`). `null` means UTC fallback at evaluation.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrgTimezoneResponse {
///IANA timezone (e.g. `Asia/Jerusalem`). `null` means UTC fallback at evaluation.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub timezone: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for OrgTimezoneResponse {
fn default() -> Self {
Self {
timezone: Default::default(),
}
}
}
///An organization (tenant) with optional parent for hierarchy.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "An organization (tenant) with optional parent for hierarchy.",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ResourceLifecycle"
/// },
/// {
/// "type": "object",
/// "required": [
/// "id",
/// "name",
/// "user_roles"
/// ],
/// "properties": {
/// "description": {
/// "description": "Optional description.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "description": "Unique identifier (ULID).",
/// "type": "string"
/// },
/// "is_personal": {
/// "description": "True when this org is a personal workspace auto-created for a self-signup user.\n\nCompany / property orgs are `false`. A workspace is the parent a user's own first\nsite is created under, not an operating organization that members are invited into.",
/// "type": "boolean"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "parent_id": {
/// "description": "Parent organization ID for hierarchy.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "user_roles": {
/// "description": "User ID to roles mapping for this org (keys are org IDs as strings).",
/// "type": "object",
/// "additionalProperties": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/Role"
/// }
/// }
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Organization {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Optional description.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Unique identifier (ULID).
pub id: ::std::string::String,
/**True when this org is a personal workspace auto-created for a self-signup user.
Company / property orgs are `false`. A workspace is the parent a user's own first
site is created under, not an operating organization that members are invited into.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_personal: ::std::option::Option<bool>,
pub name: LocalizedString,
///Parent organization ID for hierarchy.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub parent_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///User ID to roles mapping for this org (keys are org IDs as strings).
pub user_roles: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
}
///`OrganizationResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/Organization"
/// },
/// {
/// "type": "object",
/// "properties": {
/// "has_children": {
/// "description": "Whether this org has at least one child visible to the requester.\n\nPopulated only by the tree endpoints (children / search); `None` elsewhere. Lets the org\nselector render an expand affordance without first fetching the node's children.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "parent_name": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct OrganizationResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Optional description.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
/**Whether this org has at least one child visible to the requester.
Populated only by the tree endpoints (children / search); `None` elsewhere. Lets the org
selector render an expand affordance without first fetching the node's children.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub has_children: ::std::option::Option<bool>,
///Unique identifier (ULID).
pub id: ::std::string::String,
/**True when this org is a personal workspace auto-created for a self-signup user.
Company / property orgs are `false`. A workspace is the parent a user's own first
site is created under, not an operating organization that members are invited into.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_personal: ::std::option::Option<bool>,
pub name: LocalizedString,
///Parent organization ID for hierarchy.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub parent_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub parent_name: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///User ID to roles mapping for this org (keys are org IDs as strings).
pub user_roles: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
}
///Paginated response body for list endpoints.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Paginated response body for list endpoints.",
/// "type": "object",
/// "required": [
/// "items",
/// "total"
/// ],
/// "properties": {
/// "items": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/UserResponse"
/// }
/// },
/// "total": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponse {
pub items: ::std::vec::Vec<UserResponse>,
pub total: i64,
}
///Paginated response body for list endpoints.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Paginated response body for list endpoints.",
/// "type": "object",
/// "required": [
/// "items",
/// "total"
/// ],
/// "properties": {
/// "items": {
/// "type": "array",
/// "items": {
/// "type": "object",
/// "required": [
/// "granted_portals",
/// "id",
/// "is_enabled",
/// "location_mode",
/// "schedule",
/// "schedule_combined",
/// "schedule_entries",
/// "schedule_kind",
/// "state",
/// "uses"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "created_by_user_id": {
/// "description": "User who created this invite or share. Omitted when the row has no creator.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "creation_justification": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "curfew_exempt": {
/// "description": "Admin-only emergency exception: skip invitation curfew at redemption.",
/// "type": "boolean"
/// },
/// "devices_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "disabled_justification": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "external_ref": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ExternalReferenceResponse"
/// }
/// ]
/// }
/// ]
/// },
/// "granted_portals": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/AccessInviteGrantedPortal"
/// }
/// },
/// "id": {
/// "type": "string"
/// },
/// "invite_recurrence": {},
/// "invitee_message": {},
/// "is_enabled": {
/// "type": "boolean"
/// },
/// "kind": {
/// "$ref": "#/components/schemas/AccessInviteKind"
/// },
/// "last_shared_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "last_used_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "location": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocationResponse"
/// }
/// ]
/// }
/// ]
/// },
/// "location_mode": {
/// "$ref": "#/components/schemas/LocationBindingMode"
/// },
/// "max_devices": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "max_uses": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "pending_renewal_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "photo_thumb_url": {
/// "description": "Presigned URL for the `thumb` rendition of the invite photo, for avatar-sized renders.\nAbsent when the source is already thumb-sized; fall back to `photo_url`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "photo_url": {
/// "description": "Presigned URL for the invite's main photo (best-effort).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "revoked_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "schedule": {
/// "$ref": "#/components/schemas/InviteScheduleSnapshot"
/// },
/// "schedule_combined": {
/// "$ref": "#/components/schemas/InviteScheduleCombined"
/// },
/// "schedule_entries": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/InviteScheduleEntrySnapshot"
/// }
/// },
/// "schedule_kind": {
/// "$ref": "#/components/schemas/InviteScheduleKind"
/// },
/// "state": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "uses": {
/// "type": "integer",
/// "format": "int32"
/// },
/// "valid_from": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "valid_to": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
/// }
/// },
/// "total": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseAccessInviteListItem {
pub items: ::std::vec::Vec<PaginatedResponseAccessInviteListItemItemsItem>,
pub total: i64,
}
///`PaginatedResponseAccessInviteListItemItemsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "granted_portals",
/// "id",
/// "is_enabled",
/// "location_mode",
/// "schedule",
/// "schedule_combined",
/// "schedule_entries",
/// "schedule_kind",
/// "state",
/// "uses"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "created_by_user_id": {
/// "description": "User who created this invite or share. Omitted when the row has no creator.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "creation_justification": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "curfew_exempt": {
/// "description": "Admin-only emergency exception: skip invitation curfew at redemption.",
/// "type": "boolean"
/// },
/// "devices_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "disabled_justification": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "external_ref": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ExternalReferenceResponse"
/// }
/// ]
/// }
/// ]
/// },
/// "granted_portals": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/AccessInviteGrantedPortal"
/// }
/// },
/// "id": {
/// "type": "string"
/// },
/// "invite_recurrence": {},
/// "invitee_message": {},
/// "is_enabled": {
/// "type": "boolean"
/// },
/// "kind": {
/// "$ref": "#/components/schemas/AccessInviteKind"
/// },
/// "last_shared_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "last_used_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "location": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocationResponse"
/// }
/// ]
/// }
/// ]
/// },
/// "location_mode": {
/// "$ref": "#/components/schemas/LocationBindingMode"
/// },
/// "max_devices": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "max_uses": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "pending_renewal_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "photo_thumb_url": {
/// "description": "Presigned URL for the `thumb` rendition of the invite photo, for avatar-sized renders.\nAbsent when the source is already thumb-sized; fall back to `photo_url`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "photo_url": {
/// "description": "Presigned URL for the invite's main photo (best-effort).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "revoked_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "schedule": {
/// "$ref": "#/components/schemas/InviteScheduleSnapshot"
/// },
/// "schedule_combined": {
/// "$ref": "#/components/schemas/InviteScheduleCombined"
/// },
/// "schedule_entries": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/InviteScheduleEntrySnapshot"
/// }
/// },
/// "schedule_kind": {
/// "$ref": "#/components/schemas/InviteScheduleKind"
/// },
/// "state": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "uses": {
/// "type": "integer",
/// "format": "int32"
/// },
/// "valid_from": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "valid_to": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseAccessInviteListItemItemsItem {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
///User who created this invite or share. Omitted when the row has no creator.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_by_user_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub creation_justification: ::std::option::Option<::std::string::String>,
///Admin-only emergency exception: skip invitation curfew at redemption.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub curfew_exempt: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub devices_count: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub disabled_justification: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_ref: ::std::option::Option<ExternalReferenceResponse>,
pub granted_portals: ::std::vec::Vec<AccessInviteGrantedPortal>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invite_recurrence: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invitee_message: ::std::option::Option<::serde_json::Value>,
pub is_enabled: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub kind: ::std::option::Option<AccessInviteKind>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_shared_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_used_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub location: ::std::option::Option<LocationResponse>,
pub location_mode: LocationBindingMode,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_devices: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_uses: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub pending_renewal_count: ::std::option::Option<i32>,
/**Presigned URL for the `thumb` rendition of the invite photo, for avatar-sized renders.
Absent when the source is already thumb-sized; fall back to `photo_url`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub photo_thumb_url: ::std::option::Option<::std::string::String>,
///Presigned URL for the invite's main photo (best-effort).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub photo_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub revoked_at: ::std::option::Option<::std::string::String>,
pub schedule: InviteScheduleSnapshot,
pub schedule_combined: InviteScheduleCombined,
pub schedule_entries: ::std::vec::Vec<InviteScheduleEntrySnapshot>,
pub schedule_kind: InviteScheduleKind,
pub state: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
pub uses: i32,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub valid_from: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub valid_to: ::std::option::Option<::std::string::String>,
}
///Paginated response body for list endpoints.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Paginated response body for list endpoints.",
/// "type": "object",
/// "required": [
/// "items",
/// "total"
/// ],
/// "properties": {
/// "items": {
/// "type": "array",
/// "items": {
/// "type": "object",
/// "required": [
/// "id",
/// "name",
/// "public_id"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "deleted_at": {
/// "description": "When set, the portal is soft-deleted (kept for restore).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "device_id": {
/// "description": "Door device id (virtual_access_portal in this integration). Canonical portal link key.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "directory_id": {
/// "description": "Directory device id (virtual_access_directory in this integration).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "public_id": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
/// }
/// },
/// "total": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseAccessPortalListItem {
pub items: ::std::vec::Vec<PaginatedResponseAccessPortalListItemItemsItem>,
pub total: i64,
}
///`PaginatedResponseAccessPortalListItemItemsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "name",
/// "public_id"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "deleted_at": {
/// "description": "When set, the portal is soft-deleted (kept for restore).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "device_id": {
/// "description": "Door device id (virtual_access_portal in this integration). Canonical portal link key.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "directory_id": {
/// "description": "Directory device id (virtual_access_directory in this integration).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "public_id": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseAccessPortalListItemItemsItem {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
///When set, the portal is soft-deleted (kept for restore).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::std::string::String>,
///Door device id (virtual_access_portal in this integration). Canonical portal link key.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub device_id: ::std::option::Option<::std::string::String>,
///Directory device id (virtual_access_directory in this integration).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub directory_id: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
pub name: LocalizedString,
pub public_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
///Paginated response body for list endpoints.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Paginated response body for list endpoints.",
/// "type": "object",
/// "required": [
/// "items",
/// "total"
/// ],
/// "properties": {
/// "items": {
/// "type": "array",
/// "items": {
/// "type": "object",
/// "required": [
/// "confirmation_mode",
/// "id",
/// "name",
/// "org_id",
/// "owner_user_id"
/// ],
/// "properties": {
/// "allowed_entity_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "allowed_portal_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "allowed_tool_names": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "confirmation_mode": {
/// "type": "string"
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "last_used_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": "string"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "owner_user_id": {
/// "type": "string"
/// },
/// "purpose": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "revoked_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
/// }
/// },
/// "total": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseAgentResponse {
pub items: ::std::vec::Vec<PaginatedResponseAgentResponseItemsItem>,
pub total: i64,
}
///`PaginatedResponseAgentResponseItemsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "confirmation_mode",
/// "id",
/// "name",
/// "org_id",
/// "owner_user_id"
/// ],
/// "properties": {
/// "allowed_entity_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "allowed_portal_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "allowed_tool_names": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "confirmation_mode": {
/// "type": "string"
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "last_used_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": "string"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "owner_user_id": {
/// "type": "string"
/// },
/// "purpose": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "revoked_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseAgentResponseItemsItem {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_entity_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_portal_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_tool_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub confirmation_mode: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_at: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_used_at: ::std::option::Option<::std::string::String>,
pub name: ::std::string::String,
pub org_id: ::std::string::String,
pub owner_user_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purpose: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub revoked_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
///Paginated response body for list endpoints.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Paginated response body for list endpoints.",
/// "type": "object",
/// "required": [
/// "items",
/// "total"
/// ],
/// "properties": {
/// "items": {
/// "type": "array",
/// "items": {
/// "description": "Response for API key list item (no token).",
/// "type": "object",
/// "required": [
/// "base_url",
/// "expires_at",
/// "id",
/// "name",
/// "token_suffix"
/// ],
/// "properties": {
/// "base_url": {
/// "type": "string"
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_at": {
/// "type": "string"
/// },
/// "id": {
/// "type": "string"
/// },
/// "last_used_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": "string"
/// },
/// "revoked_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "scoped_entity_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "scoped_roles": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "token_suffix": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
/// }
/// },
/// "total": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseApiKeyListItem {
pub items: ::std::vec::Vec<PaginatedResponseApiKeyListItemItemsItem>,
pub total: i64,
}
///Response for API key list item (no token).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Response for API key list item (no token).",
/// "type": "object",
/// "required": [
/// "base_url",
/// "expires_at",
/// "id",
/// "name",
/// "token_suffix"
/// ],
/// "properties": {
/// "base_url": {
/// "type": "string"
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_at": {
/// "type": "string"
/// },
/// "id": {
/// "type": "string"
/// },
/// "last_used_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": "string"
/// },
/// "revoked_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "scoped_entity_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "scoped_roles": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "token_suffix": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseApiKeyListItemItemsItem {
pub base_url: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
pub expires_at: ::std::string::String,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_used_at: ::std::option::Option<::std::string::String>,
pub name: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub revoked_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub scoped_entity_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub scoped_roles: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub token_suffix: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
///Paginated response body for list endpoints.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Paginated response body for list endpoints.",
/// "type": "object",
/// "required": [
/// "items",
/// "total"
/// ],
/// "properties": {
/// "items": {
/// "type": "array",
/// "items": {
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/Entity"
/// },
/// {
/// "type": "object",
/// "properties": {
/// "entity_metadata": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/HashMap"
/// }
/// ]
/// }
/// ]
/// },
/// "entry_kind": {
/// "description": "Derived, read-only entry kind for switchable entries on Virtual Access devices.\nOmitted when the entity is not an entry or the device has no Virtual Access config.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "state": {
/// "description": "Derived, read-only. When local provider config cannot run switchable\nopen/close/toggle, `{ \"status\": \"invalid\", \"reason\": \"<message>\" }`."
/// }
/// }
/// }
/// ]
/// }
/// },
/// "total": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseEntityResponse {
pub items: ::std::vec::Vec<PaginatedResponseEntityResponseItemsItem>,
pub total: i64,
}
///`PaginatedResponseEntityResponseItemsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/Entity"
/// },
/// {
/// "type": "object",
/// "properties": {
/// "entity_metadata": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/HashMap"
/// }
/// ]
/// }
/// ]
/// },
/// "entry_kind": {
/// "description": "Derived, read-only entry kind for switchable entries on Virtual Access devices.\nOmitted when the entity is not an entry or the device has no Virtual Access config.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "state": {
/// "description": "Derived, read-only. When local provider config cannot run switchable\nopen/close/toggle, `{ \"status\": \"invalid\", \"reason\": \"<message>\" }`."
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseEntityResponseItemsItem {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Parent device ID.
pub device_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub entity_metadata: ::std::option::Option<HashMap>,
pub entity_type: EntityType,
/**Derived, read-only entry kind for switchable entries on Virtual Access devices.
Omitted when the entity is not an entry or the device has no Virtual Access config.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub entry_kind: ::std::option::Option<::std::string::String>,
///External ID from the integration.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Unique identifier (ULID).
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub metadata: ::std::option::Option<HashMap>,
///Optional friendly name for the entity.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
/**Derived, read-only. When local provider config cannot run switchable
open/close/toggle, `{ "status": "invalid", "reason": "<message>" }`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub state: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Optional zone this entity belongs to.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub zone_id: ::std::option::Option<::std::string::String>,
}
///Paginated response body for list endpoints.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Paginated response body for list endpoints.",
/// "type": "object",
/// "required": [
/// "items",
/// "total"
/// ],
/// "properties": {
/// "items": {
/// "type": "array",
/// "items": {
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/LocationResponse"
/// },
/// {
/// "type": "object",
/// "properties": {
/// "is_bound_here": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "is_relevant": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "usage_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
/// }
/// ]
/// }
/// },
/// "total": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseLocationListItemResponse {
pub items: ::std::vec::Vec<PaginatedResponseLocationListItemResponseItemsItem>,
pub total: i64,
}
///`PaginatedResponseLocationListItemResponseItemsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/LocationResponse"
/// },
/// {
/// "type": "object",
/// "properties": {
/// "is_bound_here": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "is_relevant": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "usage_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseLocationListItemResponseItemsItem {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub city: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub country: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub formatted_address: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub geocoding_provider: ::std::option::Option<GeocodingProviderId>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_bound_here: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_relevant: ::std::option::Option<bool>,
pub kind: LocationKind,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lat: ::std::option::Option<f64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lng: ::std::option::Option<f64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub notes: ::std::option::Option<LocalizedString>,
/**Opaque place id issued by `geocoding_provider`. Both fields are present together or not at
all: a place id cannot be interpreted without knowing who issued it.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub provider_place_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub source: ::std::option::Option<LocationSource>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub usage_count: ::std::option::Option<i64>,
}
///Paginated response body for list endpoints.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Paginated response body for list endpoints.",
/// "type": "object",
/// "required": [
/// "items",
/// "total"
/// ],
/// "properties": {
/// "items": {
/// "type": "array",
/// "items": {
/// "description": "Store membership. `Pending` awaits admin approval; `Removed` keeps the row (history) but\nblocks purchasing.",
/// "type": "object",
/// "required": [
/// "id",
/// "role",
/// "status",
/// "store_id",
/// "user_id"
/// ],
/// "properties": {
/// "billing_account_id": {
/// "description": "Account purchases are charged to. `None` falls back to the member's personal account.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "removed_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "role": {
/// "$ref": "#/components/schemas/StoreMemberRole"
/// },
/// "status": {
/// "$ref": "#/components/schemas/StoreMemberStatus"
/// },
/// "store_id": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "user_id": {
/// "type": "string"
/// }
/// }
/// }
/// },
/// "total": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseStoreMember {
pub items: ::std::vec::Vec<PaginatedResponseStoreMemberItemsItem>,
pub total: i64,
}
/**Store membership. `Pending` awaits admin approval; `Removed` keeps the row (history) but
blocks purchasing.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Store membership. `Pending` awaits admin approval; `Removed` keeps the row (history) but\nblocks purchasing.",
/// "type": "object",
/// "required": [
/// "id",
/// "role",
/// "status",
/// "store_id",
/// "user_id"
/// ],
/// "properties": {
/// "billing_account_id": {
/// "description": "Account purchases are charged to. `None` falls back to the member's personal account.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "removed_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "role": {
/// "$ref": "#/components/schemas/StoreMemberRole"
/// },
/// "status": {
/// "$ref": "#/components/schemas/StoreMemberStatus"
/// },
/// "store_id": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "user_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseStoreMemberItemsItem {
///Account purchases are charged to. `None` falls back to the member's personal account.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub billing_account_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub removed_at: ::std::option::Option<::std::string::String>,
pub role: StoreMemberRole,
pub status: StoreMemberStatus,
pub store_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
pub user_id: ::std::string::String,
}
///Paginated response body for list endpoints.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Paginated response body for list endpoints.",
/// "type": "object",
/// "required": [
/// "items",
/// "total"
/// ],
/// "properties": {
/// "items": {
/// "type": "array",
/// "items": {
/// "description": "Org-scoped catalog product. Soft-deleted products are retained (`purge_at`) so historical\nstatements and audit stay readable.",
/// "type": "object",
/// "required": [
/// "id",
/// "name",
/// "org_id"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "deleted_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "external_url": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "image_media_asset_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "purge_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
/// }
/// },
/// "total": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseStoreProduct {
pub items: ::std::vec::Vec<PaginatedResponseStoreProductItemsItem>,
pub total: i64,
}
/**Org-scoped catalog product. Soft-deleted products are retained (`purge_at`) so historical
statements and audit stay readable.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Org-scoped catalog product. Soft-deleted products are retained (`purge_at`) so historical\nstatements and audit stay readable.",
/// "type": "object",
/// "required": [
/// "id",
/// "name",
/// "org_id"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "deleted_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "external_url": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "image_media_asset_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "purge_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseStoreProductItemsItem {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_url: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_media_asset_id: ::std::option::Option<::std::string::String>,
pub name: LocalizedString,
pub org_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
///Paginated response body for list endpoints.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Paginated response body for list endpoints.",
/// "type": "object",
/// "required": [
/// "items",
/// "total"
/// ],
/// "properties": {
/// "items": {
/// "type": "array",
/// "items": {
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/Zone"
/// }
/// ]
/// }
/// },
/// "total": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginatedResponseZoneResponse {
pub items: ::std::vec::Vec<Zone>,
pub total: i64,
}
/**Pagination query parameters. Flatten into list-endpoint query structs.
When not provided, defaults to first page (limit from config, offset=0).*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Pagination query parameters. Flatten into list-endpoint query structs.\nWhen not provided, defaults to first page (limit from config, offset=0).",
/// "type": "object",
/// "properties": {
/// "limit": {
/// "description": "Number of items per page. Default from config, max 200.",
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "offset": {
/// "description": "Number of items to skip. Default 0.",
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PaginationQuery {
///Number of items per page. Default from config, max 200.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub limit: ::std::option::Option<i32>,
///Number of items to skip. Default 0.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub offset: ::std::option::Option<i32>,
}
impl ::std::default::Default for PaginationQuery {
fn default() -> Self {
Self {
limit: Default::default(),
offset: Default::default(),
}
}
}
///`PalgateLinkedAccountProbeDto`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "can_open_output1",
/// "can_open_output2",
/// "device_id",
/// "is_admin",
/// "linked_device_permitted",
/// "phone",
/// "probed_at",
/// "relay_mode_permitted"
/// ],
/// "properties": {
/// "can_open_output1": {
/// "type": "boolean"
/// },
/// "can_open_output2": {
/// "type": "boolean"
/// },
/// "device_id": {
/// "type": "string"
/// },
/// "is_admin": {
/// "type": "boolean"
/// },
/// "linked_device_permitted": {
/// "type": "boolean"
/// },
/// "phone": {
/// "type": "string"
/// },
/// "probed_at": {
/// "type": "string"
/// },
/// "relay_mode_permitted": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PalgateLinkedAccountProbeDto {
pub can_open_output1: bool,
pub can_open_output2: bool,
pub device_id: ::std::string::String,
pub is_admin: bool,
pub linked_device_permitted: bool,
pub phone: ::std::string::String,
pub probed_at: ::std::string::String,
pub relay_mode_permitted: bool,
}
///Standalone probe for wizard (before integration exists).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Standalone probe for wizard (before integration exists).",
/// "type": "object",
/// "required": [
/// "config",
/// "device_id",
/// "org_id",
/// "secrets"
/// ],
/// "properties": {
/// "config": {},
/// "device_id": {
/// "type": "string"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "secrets": {}
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PalgateProbeLinkedAccountRequest {
pub config: ::serde_json::Value,
pub device_id: ::std::string::String,
pub org_id: ::std::string::String,
pub secrets: ::serde_json::Value,
}
///`PalgateProbeLinkedAccountResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "linked_account_admin_mode",
/// "probe"
/// ],
/// "properties": {
/// "linked_account_admin_mode": {
/// "type": "string"
/// },
/// "probe": {
/// "$ref": "#/components/schemas/PalgateLinkedAccountProbeDto"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PalgateProbeLinkedAccountResponse {
pub linked_account_admin_mode: ::std::string::String,
pub probe: PalgateLinkedAccountProbeDto,
}
///Shallow-merge into existing `entity_metadata` (PATCH). Does not replace the whole map.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Shallow-merge into existing `entity_metadata` (PATCH). Does not replace the whole map.",
/// "type": "object",
/// "required": [
/// "metadata"
/// ],
/// "properties": {
/// "metadata": {
/// "description": "Keys to merge into persisted metadata. Omitted keys are left unchanged.\nJSON `null` removes a key (e.g. clear `floor` when setting `floor_number`).",
/// "type": "object",
/// "additionalProperties": {}
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PatchEntityRequest {
/**Keys to merge into persisted metadata. Omitted keys are left unchanged.
JSON `null` removes a key (e.g. clear `floor` when setting `floor_number`).*/
pub metadata: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
}
///`PatchLocationRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "city": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "country": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "formatted_address": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "geocode": {
/// "type": "boolean"
/// },
/// "geocoding_provider": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/GeocodingProviderId"
/// }
/// ]
/// }
/// ]
/// },
/// "kind": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocationKind"
/// }
/// ]
/// }
/// ]
/// },
/// "lat": {
/// "type": [
/// "number",
/// "null"
/// ],
/// "format": "double"
/// },
/// "lng": {
/// "type": [
/// "number",
/// "null"
/// ],
/// "format": "double"
/// },
/// "locale": {
/// "description": "Preferred locale (app code or BCP-47) for geocoding (see `CreateLocationRequest::locale`).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "notes": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "provider_place_id": {
/// "description": "Replaces the stored place reference. Both fields must be sent together (see\n`CreateLocationRequest::provider_place_id`).",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PatchLocationRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub city: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub country: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub formatted_address: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub geocode: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub geocoding_provider: ::std::option::Option<GeocodingProviderId>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub kind: ::std::option::Option<LocationKind>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lat: ::std::option::Option<f64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lng: ::std::option::Option<f64>,
///Preferred locale (app code or BCP-47) for geocoding (see `CreateLocationRequest::locale`).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub locale: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub notes: ::std::option::Option<LocalizedString>,
/**Replaces the stored place reference. Both fields must be sent together (see
`CreateLocationRequest::provider_place_id`).*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub provider_place_id: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for PatchLocationRequest {
fn default() -> Self {
Self {
city: Default::default(),
country: Default::default(),
formatted_address: Default::default(),
geocode: Default::default(),
geocoding_provider: Default::default(),
kind: Default::default(),
lat: Default::default(),
lng: Default::default(),
locale: Default::default(),
notes: Default::default(),
provider_place_id: Default::default(),
}
}
}
///`PatchMeDndPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "dnd_global": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PatchMeDndPayload {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub dnd_global: ::std::option::Option<bool>,
}
impl ::std::default::Default for PatchMeDndPayload {
fn default() -> Self {
Self {
dnd_global: Default::default(),
}
}
}
///`PatchMeListingDndPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "availability_hours": {},
/// "dnd_enabled": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "quiet_hours": {}
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PatchMeListingDndPayload {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub availability_hours: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub dnd_enabled: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub quiet_hours: ::std::option::Option<::serde_json::Value>,
}
impl ::std::default::Default for PatchMeListingDndPayload {
fn default() -> Self {
Self {
availability_hours: Default::default(),
dnd_enabled: Default::default(),
quiet_hours: Default::default(),
}
}
}
///`PatchMeProfileRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "locale": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "profile_sources": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ProfileSourcePatch"
/// }
/// ]
/// }
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PatchMeProfileRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub locale: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub profile_sources: ::std::option::Option<ProfileSourcePatch>,
}
impl ::std::default::Default for PatchMeProfileRequest {
fn default() -> Self {
Self {
locale: Default::default(),
name: Default::default(),
profile_sources: Default::default(),
}
}
}
///`PatchOrgPrivacySettingsRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "audit_retention_days"
/// ],
/// "properties": {
/// "audit_retention_days": {
/// "type": "integer",
/// "format": "int32"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PatchOrgPrivacySettingsRequest {
pub audit_retention_days: i32,
}
///`PeerJsConfig`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "host",
/// "path",
/// "port",
/// "secure"
/// ],
/// "properties": {
/// "host": {
/// "type": "string"
/// },
/// "path": {
/// "type": "string"
/// },
/// "port": {
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "secure": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PeerJsConfig {
pub host: ::std::string::String,
pub path: ::std::string::String,
pub port: i32,
pub secure: bool,
}
///`PendingSharingApprovalResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "status",
/// "subject_kind"
/// ],
/// "properties": {
/// "id": {
/// "type": "string"
/// },
/// "status": {
/// "type": "string"
/// },
/// "subject_kind": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PendingSharingApprovalResponse {
pub id: ::std::string::String,
pub status: ::std::string::String,
pub subject_kind: ::std::string::String,
}
///`PerceptionActionResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "credential_id",
/// "kind",
/// "result"
/// ],
/// "properties": {
/// "credential_id": {
/// "type": "string"
/// },
/// "kind": {
/// "type": "string"
/// },
/// "result": {}
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PerceptionActionResponse {
pub credential_id: ::std::string::String,
pub kind: ::std::string::String,
pub result: ::serde_json::Value,
}
///`PerceptionLprRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "entity_id",
/// "plate"
/// ],
/// "properties": {
/// "entity_id": {
/// "type": "string"
/// },
/// "evidence": {},
/// "plate": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PerceptionLprRequest {
pub entity_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub evidence: ::std::option::Option<::serde_json::Value>,
pub plate: ::std::string::String,
}
///`PerceptionVisitorRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "entity_id"
/// ],
/// "properties": {
/// "entity_id": {
/// "type": "string"
/// },
/// "evidence": {},
/// "portal_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PerceptionVisitorRequest {
pub entity_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub evidence: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub portal_id: ::std::option::Option<::std::string::String>,
}
///Tristate for nullable string-patch fields: missing (leave alone), null (clear), set (replace).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Tristate for nullable string-patch fields: missing (leave alone), null (clear), set (replace).",
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "type": "string"
/// }
/// ]
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct PhonePatch(pub ::std::option::Option<::std::string::String>);
impl ::std::ops::Deref for PhonePatch {
type Target = ::std::option::Option<::std::string::String>;
fn deref(&self) -> &::std::option::Option<::std::string::String> {
&self.0
}
}
impl ::std::convert::From<PhonePatch> for ::std::option::Option<::std::string::String> {
fn from(value: PhonePatch) -> Self {
value.0
}
}
impl ::std::convert::From<::std::option::Option<::std::string::String>> for PhonePatch {
fn from(value: ::std::option::Option<::std::string::String>) -> Self {
Self(value)
}
}
///`PlanQuotaResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "period",
/// "quota_key",
/// "unit"
/// ],
/// "properties": {
/// "limit_value": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "period": {
/// "type": "string"
/// },
/// "quota_key": {
/// "type": "string"
/// },
/// "unit": {
/// "description": "Machine-readable unit of `limit_value` (e.g. `count`, `seconds`). Empty\nwhen `quota_key` is not a recognized `QuotaKey`.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PlanQuotaResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub limit_value: ::std::option::Option<i64>,
pub period: ::std::string::String,
pub quota_key: ::std::string::String,
/**Machine-readable unit of `limit_value` (e.g. `count`, `seconds`). Empty
when `quota_key` is not a recognized `QuotaKey`.*/
pub unit: ::std::string::String,
}
///`PlanResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "is_default_for_personal",
/// "is_published",
/// "name",
/// "quotas",
/// "slug",
/// "sort_order"
/// ],
/// "properties": {
/// "description": {},
/// "is_default_for_personal": {
/// "type": "boolean"
/// },
/// "is_published": {
/// "type": "boolean"
/// },
/// "name": {},
/// "quotas": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/PlanQuotaResponse"
/// }
/// },
/// "slug": {
/// "type": "string"
/// },
/// "sort_order": {
/// "type": "integer",
/// "format": "int32"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PlanResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::serde_json::Value>,
pub is_default_for_personal: bool,
pub is_published: bool,
pub name: ::serde_json::Value,
pub quotas: ::std::vec::Vec<PlanQuotaResponse>,
pub slug: ::std::string::String,
pub sort_order: i32,
}
///`PlansResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "plans"
/// ],
/// "properties": {
/// "plans": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/PlanResponse"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PlansResponse {
pub plans: ::std::vec::Vec<PlanResponse>,
}
///`PmsInboundPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "event"
/// ],
/// "properties": {
/// "event": {
/// "type": "string"
/// },
/// "reservation_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PmsInboundPayload {
pub event: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reservation_id: ::std::option::Option<::std::string::String>,
}
///`PolicyOutputSelector`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "oneOf": [
/// {
/// "type": "string"
/// },
/// {
/// "type": "integer",
/// "format": "int64"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum PolicyOutputSelector {
String(::std::string::String),
Int64(i64),
}
impl ::std::fmt::Display for PolicyOutputSelector {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match self {
Self::String(x) => x.fmt(f),
Self::Int64(x) => x.fmt(f),
}
}
}
impl ::std::convert::From<i64> for PolicyOutputSelector {
fn from(value: i64) -> Self {
Self::Int64(value)
}
}
///`PolicyPrincipalKind`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "agent",
/// "api_key",
/// "invitation",
/// "member",
/// "resident",
/// "admin",
/// "all"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PolicyPrincipalKind {
#[serde(rename = "agent")]
Agent,
#[serde(rename = "api_key")]
ApiKey,
#[serde(rename = "invitation")]
Invitation,
#[serde(rename = "member")]
Member,
#[serde(rename = "resident")]
Resident,
#[serde(rename = "admin")]
Admin,
#[serde(rename = "all")]
All,
}
impl ::std::fmt::Display for PolicyPrincipalKind {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Agent => f.write_str("agent"),
Self::ApiKey => f.write_str("api_key"),
Self::Invitation => f.write_str("invitation"),
Self::Member => f.write_str("member"),
Self::Resident => f.write_str("resident"),
Self::Admin => f.write_str("admin"),
Self::All => f.write_str("all"),
}
}
}
impl ::std::str::FromStr for PolicyPrincipalKind {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"agent" => Ok(Self::Agent),
"api_key" => Ok(Self::ApiKey),
"invitation" => Ok(Self::Invitation),
"member" => Ok(Self::Member),
"resident" => Ok(Self::Resident),
"admin" => Ok(Self::Admin),
"all" => Ok(Self::All),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PolicyPrincipalKind {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PolicyPrincipalKind {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PolicyPrincipalKind {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`PolicyResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "config",
/// "enabled",
/// "enforcement",
/// "id",
/// "policy_type",
/// "scope"
/// ],
/// "properties": {
/// "capability": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "config": {
/// "type": "object"
/// },
/// "conflict_report": {
/// "description": "Informational: currently valid invites that this curfew will constrain (never mutated).",
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/ConflictingInviteResponse"
/// }
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "created_by": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "enabled": {
/// "type": "boolean"
/// },
/// "enforcement": {
/// "type": "string"
/// },
/// "id": {
/// "type": "string"
/// },
/// "integration_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "org_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "physical_device_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "policy_type": {
/// "type": "string"
/// },
/// "scope": {
/// "description": "`org` | `integration` | `device`.",
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PolicyResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub capability: ::std::option::Option<::std::string::String>,
pub config: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
///Informational: currently valid invites that this curfew will constrain (never mutated).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub conflict_report: ::std::option::Option<::std::vec::Vec<ConflictingInviteResponse>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_by: ::std::option::Option<::std::string::String>,
pub enabled: bool,
pub enforcement: ::std::string::String,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub integration_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub org_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub physical_device_id: ::std::option::Option<::std::string::String>,
pub policy_type: ::std::string::String,
///`org` | `integration` | `device`.
pub scope: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
///`PortalRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "return_url"
/// ],
/// "properties": {
/// "return_url": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PortalRequest {
pub return_url: ::std::string::String,
}
///`PortalResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "url"
/// ],
/// "properties": {
/// "url": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PortalResponse {
pub url: ::std::string::String,
}
///`PostMeCallBlockPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "public_portal_id"
/// ],
/// "properties": {
/// "public_portal_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PostMeCallBlockPayload {
pub public_portal_id: ::std::string::String,
}
///`PostMeCallReportPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "reason",
/// "session_id"
/// ],
/// "properties": {
/// "details": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "public_portal_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "reason": {
/// "type": "string"
/// },
/// "session_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PostMeCallReportPayload {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub details: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub public_portal_id: ::std::option::Option<::std::string::String>,
pub reason: ::std::string::String,
pub session_id: ::std::string::String,
}
///`PostMeDeviceTokenPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "platform",
/// "token"
/// ],
/// "properties": {
/// "platform": {
/// "description": "One of: `ios_voip`, `ios_alert`, `android`.",
/// "type": "string"
/// },
/// "token": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PostMeDeviceTokenPayload {
///One of: `ios_voip`, `ios_alert`, `android`.
pub platform: ::std::string::String,
pub token: ::std::string::String,
}
///`PostMeDeviceTokenResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id"
/// ],
/// "properties": {
/// "id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PostMeDeviceTokenResponse {
pub id: ::std::string::String,
}
///`PostMePushSubscriptionPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "auth",
/// "endpoint",
/// "p256dh"
/// ],
/// "properties": {
/// "auth": {
/// "type": "string"
/// },
/// "endpoint": {
/// "type": "string"
/// },
/// "p256dh": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PostMePushSubscriptionPayload {
pub auth: ::std::string::String,
pub endpoint: ::std::string::String,
pub p256dh: ::std::string::String,
}
///`PowerFailBehavior`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "fail_safe",
/// "fail_secure",
/// "mechanical_always"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PowerFailBehavior {
#[serde(rename = "fail_safe")]
FailSafe,
#[serde(rename = "fail_secure")]
FailSecure,
#[serde(rename = "mechanical_always")]
MechanicalAlways,
}
impl ::std::fmt::Display for PowerFailBehavior {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::FailSafe => f.write_str("fail_safe"),
Self::FailSecure => f.write_str("fail_secure"),
Self::MechanicalAlways => f.write_str("mechanical_always"),
}
}
}
impl ::std::str::FromStr for PowerFailBehavior {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"fail_safe" => Ok(Self::FailSafe),
"fail_secure" => Ok(Self::FailSecure),
"mechanical_always" => Ok(Self::MechanicalAlways),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PowerFailBehavior {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PowerFailBehavior {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PowerFailBehavior {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
/**Effective plan for a create request, produced without persisting anything.
Onboarding an external adapter is the main use: it can check that a desired reservation maps to
portals it is allowed to grant, that the schedule resolves as expected, and which identity
fields organization policy will demand — before any physical access exists.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Effective plan for a create request, produced without persisting anything.\n\nOnboarding an external adapter is the main use: it can check that a desired reservation maps to\nportals it is allowed to grant, that the schedule resolves as expected, and which identity\nfields organization policy will demand — before any physical access exists.",
/// "type": "object",
/// "required": [
/// "granted_portals",
/// "is_enabled",
/// "kind",
/// "pending_approval",
/// "required_identity_fields",
/// "requires_justification",
/// "schedule",
/// "schedule_combined",
/// "schedule_entries",
/// "schedule_kind",
/// "unlinked_portal_ids",
/// "valid",
/// "valid_from",
/// "valid_to"
/// ],
/// "properties": {
/// "curfew_exempt": {
/// "type": "boolean"
/// },
/// "curfew_windows": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/CurfewWindowResponse"
/// }
/// },
/// "external_ref": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ExternalReferenceResponse"
/// }
/// ]
/// }
/// ]
/// },
/// "granted_portals": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/AccessInviteGrantedPortal"
/// }
/// },
/// "is_enabled": {
/// "type": "boolean"
/// },
/// "kind": {
/// "$ref": "#/components/schemas/AccessInviteKind"
/// },
/// "max_devices": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "max_uses": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "pending_approval": {
/// "description": "True when creating this invitation would land disabled awaiting admin approval.",
/// "type": "boolean"
/// },
/// "required_identity_fields": {
/// "description": "Identity fields organization policy requires for this invitation: `pin`, `invitee_phone`,\nand/or `photo`.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "requires_justification": {
/// "description": "Whether policy requires `creation_justification`.",
/// "type": "boolean"
/// },
/// "schedule": {
/// "$ref": "#/components/schemas/InviteScheduleSnapshot"
/// },
/// "schedule_combined": {
/// "$ref": "#/components/schemas/InviteScheduleCombined"
/// },
/// "schedule_entries": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/InviteScheduleEntrySnapshot"
/// }
/// },
/// "schedule_kind": {
/// "$ref": "#/components/schemas/InviteScheduleKind"
/// },
/// "timezone": {
/// "description": "Org IANA timezone used to evaluate invitation curfews.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "unlinked_portal_ids": {
/// "description": "Portals that would be granted but do not currently resolve to a live door device, so the\nguest link would not open them.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "valid": {
/// "description": "Always true on a 200. A request that would be rejected returns the same status, error code,\nand message that create would return.",
/// "type": "boolean"
/// },
/// "valid_from": {
/// "type": "string"
/// },
/// "valid_to": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PreviewAccessInviteResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub curfew_exempt: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub curfew_windows: ::std::option::Option<::std::vec::Vec<CurfewWindowResponse>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_ref: ::std::option::Option<ExternalReferenceResponse>,
pub granted_portals: ::std::vec::Vec<AccessInviteGrantedPortal>,
pub is_enabled: bool,
pub kind: AccessInviteKind,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_devices: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_uses: ::std::option::Option<i32>,
///True when creating this invitation would land disabled awaiting admin approval.
pub pending_approval: bool,
/**Identity fields organization policy requires for this invitation: `pin`, `invitee_phone`,
and/or `photo`.*/
pub required_identity_fields: ::std::vec::Vec<::std::string::String>,
///Whether policy requires `creation_justification`.
pub requires_justification: bool,
pub schedule: InviteScheduleSnapshot,
pub schedule_combined: InviteScheduleCombined,
pub schedule_entries: ::std::vec::Vec<InviteScheduleEntrySnapshot>,
pub schedule_kind: InviteScheduleKind,
///Org IANA timezone used to evaluate invitation curfews.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub timezone: ::std::option::Option<::std::string::String>,
/**Portals that would be granted but do not currently resolve to a live door device, so the
guest link would not open them.*/
pub unlinked_portal_ids: ::std::vec::Vec<::std::string::String>,
/**Always true on a 200. A request that would be rejected returns the same status, error code,
and message that create would return.*/
pub valid: bool,
pub valid_from: ::std::string::String,
pub valid_to: ::std::string::String,
}
///`PrivacyExportResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "account",
/// "device_tokens",
/// "dnd",
/// "eula",
/// "exported_at",
/// "invitations",
/// "listings",
/// "memberships"
/// ],
/// "properties": {
/// "account": {},
/// "device_tokens": {
/// "type": "array",
/// "items": {}
/// },
/// "dnd": {},
/// "eula": {},
/// "exported_at": {
/// "type": "string"
/// },
/// "invitations": {
/// "type": "array",
/// "items": {}
/// },
/// "listings": {
/// "type": "array",
/// "items": {}
/// },
/// "memberships": {
/// "type": "array",
/// "items": {}
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PrivacyExportResponse {
pub account: ::serde_json::Value,
pub device_tokens: ::std::vec::Vec<::serde_json::Value>,
pub dnd: ::serde_json::Value,
pub eula: ::serde_json::Value,
pub exported_at: ::std::string::String,
pub invitations: ::std::vec::Vec<::serde_json::Value>,
pub listings: ::std::vec::Vec<::serde_json::Value>,
pub memberships: ::std::vec::Vec<::serde_json::Value>,
}
///`ProductRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "external_url": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "image_media_asset_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ProductRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_media_asset_id: ::std::option::Option<::std::string::String>,
pub name: LocalizedString,
}
///`ProfileSourcePatch`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "email": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ProfileSourceRequest"
/// }
/// ]
/// }
/// ]
/// },
/// "image": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ProfileSourceRequest"
/// }
/// ]
/// }
/// ]
/// },
/// "locale": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ProfileSourceRequest"
/// }
/// ]
/// }
/// ]
/// },
/// "name": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ProfileSourceRequest"
/// }
/// ]
/// }
/// ]
/// },
/// "phone": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ProfileSourceRequest"
/// }
/// ]
/// }
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ProfileSourcePatch {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub email: ::std::option::Option<ProfileSourceRequest>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image: ::std::option::Option<ProfileSourceRequest>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub locale: ::std::option::Option<ProfileSourceRequest>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<ProfileSourceRequest>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone: ::std::option::Option<ProfileSourceRequest>,
}
impl ::std::default::Default for ProfileSourcePatch {
fn default() -> Self {
Self {
email: Default::default(),
image: Default::default(),
locale: Default::default(),
name: Default::default(),
phone: Default::default(),
}
}
}
///`ProfileSourceRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "idp",
/// "openapp"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ProfileSourceRequest {
#[serde(rename = "idp")]
Idp,
#[serde(rename = "openapp")]
Openapp,
}
impl ::std::fmt::Display for ProfileSourceRequest {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Idp => f.write_str("idp"),
Self::Openapp => f.write_str("openapp"),
}
}
}
impl ::std::str::FromStr for ProfileSourceRequest {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"idp" => Ok(Self::Idp),
"openapp" => Ok(Self::Openapp),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ProfileSourceRequest {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ProfileSourceRequest {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ProfileSourceRequest {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ProfileSourcesResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "email",
/// "image",
/// "locale",
/// "name",
/// "phone"
/// ],
/// "properties": {
/// "email": {
/// "type": "string"
/// },
/// "image": {
/// "type": "string"
/// },
/// "locale": {
/// "type": "string"
/// },
/// "name": {
/// "type": "string"
/// },
/// "phone": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ProfileSourcesResponse {
pub email: ::std::string::String,
pub image: ::std::string::String,
pub locale: ::std::string::String,
pub name: ::std::string::String,
pub phone: ::std::string::String,
}
///Typed `config` shape for `prohibit_master_door_invites`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Typed `config` shape for `prohibit_master_door_invites`.",
/// "type": "object",
/// "required": [
/// "master_door_ids"
/// ],
/// "properties": {
/// "applies_to": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PolicyPrincipalKind"
/// }
/// },
/// "master_door_ids": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ProhibitMasterDoorInvitesPolicyConfig {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub applies_to: ::std::option::Option<::std::vec::Vec<PolicyPrincipalKind>>,
pub master_door_ids: ::std::vec::Vec<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
}
///`ProposeGroupPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "disclosure_acknowledged",
/// "integration_id"
/// ],
/// "properties": {
/// "disclosure_acknowledged": {
/// "type": "boolean"
/// },
/// "integration_id": {
/// "description": "The site (integration) to propose the household to.",
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ProposeGroupPayload {
pub disclosure_acknowledged: bool,
///The site (integration) to propose the household to.
pub integration_id: ::std::string::String,
}
///Integration provider type (e.g. homeassistant, knx, mqtt).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Integration provider type (e.g. homeassistant, knx, mqtt).",
/// "type": "string",
/// "enum": [
/// "go2rtc",
/// "homeassistant",
/// "knx",
/// "mqtt",
/// "palgate_cloud",
/// "shelly_cloud",
/// "shelly_websocket",
/// "virtual_access",
/// "virtual_demo",
/// "waveshare",
/// "tasmota"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ProviderType {
#[serde(rename = "go2rtc")]
Go2rtc,
#[serde(rename = "homeassistant")]
Homeassistant,
#[serde(rename = "knx")]
Knx,
#[serde(rename = "mqtt")]
Mqtt,
#[serde(rename = "palgate_cloud")]
PalgateCloud,
#[serde(rename = "shelly_cloud")]
ShellyCloud,
#[serde(rename = "shelly_websocket")]
ShellyWebsocket,
#[serde(rename = "virtual_access")]
VirtualAccess,
#[serde(rename = "virtual_demo")]
VirtualDemo,
#[serde(rename = "waveshare")]
Waveshare,
#[serde(rename = "tasmota")]
Tasmota,
}
impl ::std::fmt::Display for ProviderType {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Go2rtc => f.write_str("go2rtc"),
Self::Homeassistant => f.write_str("homeassistant"),
Self::Knx => f.write_str("knx"),
Self::Mqtt => f.write_str("mqtt"),
Self::PalgateCloud => f.write_str("palgate_cloud"),
Self::ShellyCloud => f.write_str("shelly_cloud"),
Self::ShellyWebsocket => f.write_str("shelly_websocket"),
Self::VirtualAccess => f.write_str("virtual_access"),
Self::VirtualDemo => f.write_str("virtual_demo"),
Self::Waveshare => f.write_str("waveshare"),
Self::Tasmota => f.write_str("tasmota"),
}
}
}
impl ::std::str::FromStr for ProviderType {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"go2rtc" => Ok(Self::Go2rtc),
"homeassistant" => Ok(Self::Homeassistant),
"knx" => Ok(Self::Knx),
"mqtt" => Ok(Self::Mqtt),
"palgate_cloud" => Ok(Self::PalgateCloud),
"shelly_cloud" => Ok(Self::ShellyCloud),
"shelly_websocket" => Ok(Self::ShellyWebsocket),
"virtual_access" => Ok(Self::VirtualAccess),
"virtual_demo" => Ok(Self::VirtualDemo),
"waveshare" => Ok(Self::Waveshare),
"tasmota" => Ok(Self::Tasmota),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ProviderType {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ProviderType {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ProviderType {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`PublicCatalogItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "inventory_id",
/// "name",
/// "price_cents",
/// "product_id"
/// ],
/// "properties": {
/// "external_url": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "image_media_asset_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "inventory_id": {
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "price_cents": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "product_id": {
/// "type": "string"
/// },
/// "stock_quantity": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicCatalogItem {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_media_asset_id: ::std::option::Option<::std::string::String>,
pub inventory_id: ::std::string::String,
pub name: LocalizedString,
pub price_cents: i64,
pub product_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub stock_quantity: ::std::option::Option<i32>,
}
///`PublicHoldView`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "mode"
/// ],
/// "properties": {
/// "mode": {
/// "$ref": "#/components/schemas/HoldMode"
/// },
/// "reason": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicHoldView {
pub mode: HoldMode,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reason: ::std::option::Option<::std::string::String>,
}
///`PublicInviteExecuteRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "grant_id"
/// ],
/// "properties": {
/// "grant_id": {
/// "type": "string"
/// },
/// "otp_challenge_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "otp_code": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "pin": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PublicInviteExecuteRequest {
pub grant_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub otp_challenge_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub otp_code: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub pin: ::std::option::Option<::std::string::String>,
}
///`PublicInviteExecuteResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "ok"
/// ],
/// "properties": {
/// "degradation": {
/// "description": "Present when an over-capacity org slowed this open; clients show a readable warning."
/// },
/// "door_auto_close_duration": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "door_open_duration_seconds": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "lights_auto_off_duration": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LightsAutoOffDuration"
/// }
/// ]
/// }
/// ]
/// },
/// "message": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "ok": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicInviteExecuteResponse {
///Present when an over-capacity org slowed this open; clients show a readable warning.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub degradation: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub door_auto_close_duration: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub door_open_duration_seconds: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lights_auto_off_duration: ::std::option::Option<LightsAutoOffDuration>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub message: ::std::option::Option<::std::string::String>,
pub ok: bool,
}
///`PublicInviteGrant`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "oneOf": [
/// {
/// "type": "object",
/// "required": [
/// "entry_kind",
/// "has_lights",
/// "id",
/// "kind",
/// "openable",
/// "public_portal_id"
/// ],
/// "properties": {
/// "door_image_thumb_url": {
/// "description": "Presigned URL for the `thumb` rendition of the door image, for avatar-sized\nrenders. Absent when the source is already thumb-sized; fall back to\n`door_image_url`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "door_image_url": {
/// "description": "Presigned URL for door image (loaded asynchronously as card background).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "entry_kind": {
/// "description": "Entry type from linked portal device (`virtual_access.entry_kind`). Default `door`.",
/// "type": "string"
/// },
/// "has_lights": {
/// "description": "Whether the portal has light devices configured (controls light button visibility).",
/// "type": "boolean"
/// },
/// "hold": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PublicHoldView"
/// }
/// ]
/// }
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "kind": {
/// "type": "string",
/// "enum": [
/// "portal_open"
/// ]
/// },
/// "label": {
/// "description": "Localized portal name: string or object { \"en\": \"...\", \"he\": \"...\" }."
/// },
/// "open_rate_limit": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PublicPortalOpenRateLimit"
/// }
/// ]
/// }
/// ]
/// },
/// "openable": {
/// "description": "Whether the portal is linked to a live door device (i.e. can actually be opened).\nWhen false, the invite UI disables the open action (a misconfigured/unlinked portal).",
/// "type": "boolean"
/// },
/// "public_portal_id": {
/// "type": "string"
/// }
/// }
/// },
/// {
/// "type": "object",
/// "required": [
/// "action_id",
/// "entity_id",
/// "id",
/// "kind"
/// ],
/// "properties": {
/// "action_id": {
/// "type": "string"
/// },
/// "entity_id": {
/// "type": "string"
/// },
/// "id": {
/// "type": "string"
/// },
/// "kind": {
/// "type": "string",
/// "enum": [
/// "entity_action"
/// ]
/// },
/// "label": {},
/// "payload": {}
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(tag = "kind")]
pub enum PublicInviteGrant {
#[serde(rename = "portal_open")]
PortalOpen {
/**Presigned URL for the `thumb` rendition of the door image, for avatar-sized
renders. Absent when the source is already thumb-sized; fall back to
`door_image_url`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
door_image_thumb_url: ::std::option::Option<::std::string::String>,
///Presigned URL for door image (loaded asynchronously as card background).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
door_image_url: ::std::option::Option<::std::string::String>,
///Entry type from linked portal device (`virtual_access.entry_kind`). Default `door`.
entry_kind: ::std::string::String,
///Whether the portal has light devices configured (controls light button visibility).
has_lights: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
hold: ::std::option::Option<PublicHoldView>,
id: ::std::string::String,
///Localized portal name: string or object { "en": "...", "he": "..." }.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
label: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
open_rate_limit: ::std::option::Option<PublicPortalOpenRateLimit>,
/**Whether the portal is linked to a live door device (i.e. can actually be opened).
When false, the invite UI disables the open action (a misconfigured/unlinked portal).*/
openable: bool,
public_portal_id: ::std::string::String,
},
#[serde(rename = "entity_action")]
EntityAction {
action_id: ::std::string::String,
entity_id: ::std::string::String,
id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
label: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
payload: ::std::option::Option<::serde_json::Value>,
},
}
///`PublicInviteOtpStartRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "channel": {
/// "description": "`sms` (default) or `email`. The destination is the matching contact on the invitation.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PublicInviteOtpStartRequest {
///`sms` (default) or `email`. The destination is the matching contact on the invitation.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub channel: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for PublicInviteOtpStartRequest {
fn default() -> Self {
Self {
channel: Default::default(),
}
}
}
///`PublicInviteOtpStartResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "challenge_id",
/// "expires_at"
/// ],
/// "properties": {
/// "challenge_id": {
/// "type": "string"
/// },
/// "expires_at": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicInviteOtpStartResponse {
pub challenge_id: ::std::string::String,
pub expires_at: ::std::string::String,
}
///`PublicInviteQuery`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "device_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicInviteQuery {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub device_id: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for PublicInviteQuery {
fn default() -> Self {
Self {
device_id: Default::default(),
}
}
}
///`PublicInviteRenewalRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "note": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PublicInviteRenewalRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub note: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for PublicInviteRenewalRequest {
fn default() -> Self {
Self {
note: Default::default(),
}
}
}
///`PublicInviteRenewalResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "ok"
/// ],
/// "properties": {
/// "already_requested": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "ok": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicInviteRenewalResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub already_requested: ::std::option::Option<bool>,
pub ok: bool,
}
///`PublicInviteResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "audience",
/// "grants",
/// "invite_token",
/// "invite_url",
/// "location_mode",
/// "state"
/// ],
/// "properties": {
/// "access_control": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PublicPortalAccessControl"
/// }
/// ]
/// }
/// ]
/// },
/// "allowed_weekdays": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// }
/// },
/// "already_claimed": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "audience": {
/// "description": "Whether anyone holding the link may use the invitation, or only the named contacts.",
/// "type": "string"
/// },
/// "blackout_dates": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "building": {
/// "description": "Building (integration) summary: `name` (LocalizedString) and optional `location` fields\nfrom integration config (`formatted_address`, `city`, `country`)."
/// },
/// "contact_challenge_required": {
/// "description": "True when the bearer must prove they are one of the named contacts before the invitation\ncan be used. Which contact was matched is never echoed back, so this cannot be used to\nenumerate who an invitation is for.",
/// "type": "boolean"
/// },
/// "contact_display_name": {
/// "description": "The display name of the contact this token resolved to, when it resolved to one.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "curfew_windows": {
/// "description": "Effective forbidden hour windows for invitation access (informational).",
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/CurfewWindowResponse"
/// }
/// },
/// "devices_count": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "event_location": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocationResponse"
/// }
/// ]
/// }
/// ]
/// },
/// "grants": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/PublicInviteGrant"
/// }
/// },
/// "invite_token": {
/// "type": "string"
/// },
/// "invite_url": {
/// "description": "Guest-facing invite URL (shareable link for SMS/email).",
/// "type": "string"
/// },
/// "invitee_message": {},
/// "location_mode": {
/// "$ref": "#/components/schemas/LocationBindingMode"
/// },
/// "max_devices": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "name": {
/// "description": "Optional admin-defined label (management UI \"name\"); exposed for link previews and guests who already know the invite by name.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "photo_url": {
/// "description": "Presigned URL for the invite's main photo (best-effort).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "renewal_requested": {
/// "description": "True when the authenticated requester already submitted a pending renewal request.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "require_pin": {
/// "type": "boolean"
/// },
/// "require_verified_phone": {
/// "type": "boolean"
/// },
/// "schedule": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/InviteScheduleSnapshot"
/// }
/// ]
/// }
/// ]
/// },
/// "schedule_combined": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/InviteScheduleCombined"
/// }
/// ]
/// }
/// ]
/// },
/// "schedule_entries": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/InviteScheduleEntrySnapshot"
/// }
/// },
/// "schedule_kind": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/InviteScheduleKind"
/// }
/// ]
/// }
/// ]
/// },
/// "state": {
/// "$ref": "#/components/schemas/PublicInviteState"
/// },
/// "timezone": {
/// "description": "Org IANA timezone used to evaluate invitation curfews (`UTC` when unset).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "valid_from": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "valid_to": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicInviteResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub access_control: ::std::option::Option<PublicPortalAccessControl>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_weekdays: ::std::option::Option<::std::vec::Vec<i32>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub already_claimed: ::std::option::Option<bool>,
///Whether anyone holding the link may use the invitation, or only the named contacts.
pub audience: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub blackout_dates: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/**Building (integration) summary: `name` (LocalizedString) and optional `location` fields
from integration config (`formatted_address`, `city`, `country`).*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub building: ::std::option::Option<::serde_json::Value>,
/**True when the bearer must prove they are one of the named contacts before the invitation
can be used. Which contact was matched is never echoed back, so this cannot be used to
enumerate who an invitation is for.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub contact_challenge_required: ::std::option::Option<bool>,
///The display name of the contact this token resolved to, when it resolved to one.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub contact_display_name: ::std::option::Option<::std::string::String>,
///Effective forbidden hour windows for invitation access (informational).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub curfew_windows: ::std::option::Option<::std::vec::Vec<CurfewWindowResponse>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub devices_count: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub event_location: ::std::option::Option<LocationResponse>,
pub grants: ::std::vec::Vec<PublicInviteGrant>,
pub invite_token: ::std::string::String,
///Guest-facing invite URL (shareable link for SMS/email).
pub invite_url: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invitee_message: ::std::option::Option<::serde_json::Value>,
pub location_mode: LocationBindingMode,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_devices: ::std::option::Option<i32>,
///Optional admin-defined label (management UI "name"); exposed for link previews and guests who already know the invite by name.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
///Presigned URL for the invite's main photo (best-effort).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub photo_url: ::std::option::Option<::std::string::String>,
///True when the authenticated requester already submitted a pending renewal request.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub renewal_requested: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub require_pin: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub require_verified_phone: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub schedule: ::std::option::Option<InviteScheduleSnapshot>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub schedule_combined: ::std::option::Option<InviteScheduleCombined>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub schedule_entries: ::std::option::Option<::std::vec::Vec<InviteScheduleEntrySnapshot>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub schedule_kind: ::std::option::Option<InviteScheduleKind>,
pub state: PublicInviteState,
///Org IANA timezone used to evaluate invitation curfews (`UTC` when unset).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub timezone: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub valid_from: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub valid_to: ::std::option::Option<::std::string::String>,
}
///`PublicInviteSessionResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "guest_id",
/// "invite_id",
/// "ok"
/// ],
/// "properties": {
/// "guest_id": {
/// "description": "Stable per-device guest fingerprint (ULID). Either the one supplied by the client (cookie\nor `X-Guest-Id`) or a freshly minted one. Echoed so native clients can persist it and send\nit back via `X-Guest-Id` on subsequent public-access calls. Used only for audit\nattribution — it confers no access.",
/// "type": "string"
/// },
/// "invite_id": {
/// "description": "ULID of the invite (= value of the `oa_access_invite` cookie). Echoed\nin the body so non-browser clients can construct the cookie without\nrelying on a platform cookie jar for `HttpOnly` `Set-Cookie` responses.",
/// "type": "string"
/// },
/// "ok": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicInviteSessionResponse {
/**Stable per-device guest fingerprint (ULID). Either the one supplied by the client (cookie
or `X-Guest-Id`) or a freshly minted one. Echoed so native clients can persist it and send
it back via `X-Guest-Id` on subsequent public-access calls. Used only for audit
attribution — it confers no access.*/
pub guest_id: ::std::string::String,
/**ULID of the invite (= value of the `oa_access_invite` cookie). Echoed
in the body so non-browser clients can construct the cookie without
relying on a platform cookie jar for `HttpOnly` `Set-Cookie` responses.*/
pub invite_id: ::std::string::String,
pub ok: bool,
}
///`PublicInviteState`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "active",
/// "expired",
/// "revoked",
/// "scheduled",
/// "disabled",
/// "not_found",
/// "max_devices_reached"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicInviteState {
#[serde(rename = "active")]
Active,
#[serde(rename = "expired")]
Expired,
#[serde(rename = "revoked")]
Revoked,
#[serde(rename = "scheduled")]
Scheduled,
#[serde(rename = "disabled")]
Disabled,
#[serde(rename = "not_found")]
NotFound,
#[serde(rename = "max_devices_reached")]
MaxDevicesReached,
}
impl ::std::fmt::Display for PublicInviteState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Active => f.write_str("active"),
Self::Expired => f.write_str("expired"),
Self::Revoked => f.write_str("revoked"),
Self::Scheduled => f.write_str("scheduled"),
Self::Disabled => f.write_str("disabled"),
Self::NotFound => f.write_str("not_found"),
Self::MaxDevicesReached => f.write_str("max_devices_reached"),
}
}
}
impl ::std::str::FromStr for PublicInviteState {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"active" => Ok(Self::Active),
"expired" => Ok(Self::Expired),
"revoked" => Ok(Self::Revoked),
"scheduled" => Ok(Self::Scheduled),
"disabled" => Ok(Self::Disabled),
"not_found" => Ok(Self::NotFound),
"max_devices_reached" => Ok(Self::MaxDevicesReached),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicInviteState {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicInviteState {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicInviteState {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`PublicPortalAccessControl`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "city": {},
/// "country": {},
/// "formatted_address": {
/// "description": "Normalized street address (localized JSON)."
/// },
/// "geocoding_provider": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/GeocodingProviderId"
/// }
/// ]
/// }
/// ]
/// },
/// "image_thumb_url": {
/// "description": "Presigned URL for the `thumb` rendition of the same photo, for small renders.\nAbsent when the source is already thumb-sized; fall back to `image_url`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "image_url": {
/// "description": "Presigned URL for the integration or location photo.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "lat": {
/// "type": [
/// "number",
/// "null"
/// ],
/// "format": "double"
/// },
/// "lng": {
/// "type": [
/// "number",
/// "null"
/// ],
/// "format": "double"
/// },
/// "message": {
/// "description": "Admin-authored text for `disabled`, as localized JSON."
/// },
/// "name": {
/// "description": "Integration / building name (localized JSON)."
/// },
/// "notes": {},
/// "provider_place_id": {
/// "description": "Opaque place id for the address, when it was resolved by a maps provider, together with the\nprovider that issued it. Clients that recognize the provider can link to the place itself\n(e.g. Google Maps URLs `query_place_id`) instead of a bare coordinate; the rest fall back to\nthe address text. Both fields are present together or not at all.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "status": {
/// "description": "Directory status when this summary describes the visitor directory: one of `ready`,\n`empty`, `not_configured`, `disabled`. Absent for the access-control summary.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicPortalAccessControl {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub city: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub country: ::std::option::Option<::serde_json::Value>,
///Normalized street address (localized JSON).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub formatted_address: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub geocoding_provider: ::std::option::Option<GeocodingProviderId>,
/**Presigned URL for the `thumb` rendition of the same photo, for small renders.
Absent when the source is already thumb-sized; fall back to `image_url`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_thumb_url: ::std::option::Option<::std::string::String>,
///Presigned URL for the integration or location photo.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_url: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lat: ::std::option::Option<f64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lng: ::std::option::Option<f64>,
///Admin-authored text for `disabled`, as localized JSON.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub message: ::std::option::Option<::serde_json::Value>,
///Integration / building name (localized JSON).
pub name: ::serde_json::Value,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub notes: ::std::option::Option<::serde_json::Value>,
/**Opaque place id for the address, when it was resolved by a maps provider, together with the
provider that issued it. Clients that recognize the provider can link to the place itself
(e.g. Google Maps URLs `query_place_id`) instead of a bare coordinate; the rest fall back to
the address text. Both fields are present together or not at all.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub provider_place_id: ::std::option::Option<::std::string::String>,
/**Directory status when this summary describes the visitor directory: one of `ready`,
`empty`, `not_configured`, `disabled`. Absent for the access-control summary.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub status: ::std::option::Option<::std::string::String>,
}
///Map of light entity ULID to auto-off duration in seconds (re-exported for OpenAPI).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Map of light entity ULID to auto-off duration in seconds (re-exported for OpenAPI).",
/// "type": "object",
/// "required": [
/// "mode",
/// "target_entity_id"
/// ],
/// "properties": {
/// "mode": {
/// "type": "string"
/// },
/// "target_entity_id": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PublicPortalCreateSessionRequest {
pub mode: ::std::string::String,
pub target_entity_id: ::std::string::String,
}
///`PublicPortalCreateSessionResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "callee_peer_id",
/// "callees_notified",
/// "caller_peer_id",
/// "caller_token",
/// "expires_at",
/// "peerjs",
/// "session_id"
/// ],
/// "properties": {
/// "callee_peer_id": {
/// "type": "string"
/// },
/// "callees_notified": {
/// "description": "True when at least one callee had a push subscription so notification was sent (or attempted).",
/// "type": "boolean"
/// },
/// "caller_peer_id": {
/// "type": "string"
/// },
/// "caller_token": {
/// "type": "string"
/// },
/// "expires_at": {
/// "type": "string"
/// },
/// "peerjs": {
/// "$ref": "#/components/schemas/PeerJsConfig"
/// },
/// "session_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicPortalCreateSessionResponse {
pub callee_peer_id: ::std::string::String,
///True when at least one callee had a push subscription so notification was sent (or attempted).
pub callees_notified: bool,
pub caller_peer_id: ::std::string::String,
pub caller_token: ::std::string::String,
pub expires_at: ::std::string::String,
pub peerjs: PeerJsConfig,
pub session_id: ::std::string::String,
}
///`PublicPortalLight`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "entity_id"
/// ],
/// "properties": {
/// "effective_auto_off_duration": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "entity_id": {
/// "type": "string"
/// },
/// "label": {}
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicPortalLight {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub effective_auto_off_duration: ::std::option::Option<i64>,
pub entity_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub label: ::std::option::Option<::serde_json::Value>,
}
///`PublicPortalMode`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "guest_directory",
/// "resident_quick_open",
/// "guest_quick_open"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicPortalMode {
#[serde(rename = "guest_directory")]
GuestDirectory,
#[serde(rename = "resident_quick_open")]
ResidentQuickOpen,
#[serde(rename = "guest_quick_open")]
GuestQuickOpen,
}
impl ::std::fmt::Display for PublicPortalMode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::GuestDirectory => f.write_str("guest_directory"),
Self::ResidentQuickOpen => f.write_str("resident_quick_open"),
Self::GuestQuickOpen => f.write_str("guest_quick_open"),
}
}
}
impl ::std::str::FromStr for PublicPortalMode {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"guest_directory" => Ok(Self::GuestDirectory),
"resident_quick_open" => Ok(Self::ResidentQuickOpen),
"guest_quick_open" => Ok(Self::GuestQuickOpen),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicPortalMode {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicPortalMode {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicPortalMode {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`PublicPortalOpenRateLimit`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "integration_id",
/// "min_interval_ms"
/// ],
/// "properties": {
/// "integration_id": {
/// "type": "string"
/// },
/// "min_interval_ms": {
/// "description": "Enforced minimum milliseconds between `switchable.open` calls on this integration.",
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicPortalOpenRateLimit {
pub integration_id: ::std::string::String,
///Enforced minimum milliseconds between `switchable.open` calls on this integration.
pub min_interval_ms: i64,
}
///`PublicPortalReachableResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "reachable"
/// ],
/// "properties": {
/// "reachable": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicPortalReachableResponse {
pub reachable: bool,
}
///`PublicPortalResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "entry_kind",
/// "mode",
/// "public_portal_id"
/// ],
/// "properties": {
/// "access_control": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PublicPortalAccessControl"
/// }
/// ]
/// }
/// ]
/// },
/// "access_directory": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PublicPortalAccessControl"
/// }
/// ]
/// }
/// ]
/// },
/// "branding": {},
/// "door_effective_auto_off_duration": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "door_image_url": {
/// "description": "Image URL for the door (presigned S3 URL from media service).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "entry_kind": {
/// "description": "Entry type from linked portal device (`virtual_access.entry_kind`). Default `door`.",
/// "type": "string"
/// },
/// "hold": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PublicHoldView"
/// }
/// ]
/// }
/// ]
/// },
/// "lights": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PublicPortalLight"
/// }
/// },
/// "mode": {
/// "$ref": "#/components/schemas/PublicPortalMode"
/// },
/// "name": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "open_rate_limit": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PublicPortalOpenRateLimit"
/// }
/// ]
/// }
/// ]
/// },
/// "public_portal_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicPortalResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub access_control: ::std::option::Option<PublicPortalAccessControl>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub access_directory: ::std::option::Option<PublicPortalAccessControl>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub branding: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub door_effective_auto_off_duration: ::std::option::Option<i64>,
///Image URL for the door (presigned S3 URL from media service).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub door_image_url: ::std::option::Option<::std::string::String>,
///Entry type from linked portal device (`virtual_access.entry_kind`). Default `door`.
pub entry_kind: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hold: ::std::option::Option<PublicHoldView>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lights: ::std::option::Option<::std::vec::Vec<PublicPortalLight>>,
pub mode: PublicPortalMode,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub open_rate_limit: ::std::option::Option<PublicPortalOpenRateLimit>,
pub public_portal_id: ::std::string::String,
}
///`PublicPortalTarget`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "allowed_actions",
/// "display_name",
/// "floor",
/// "target_id"
/// ],
/// "properties": {
/// "allowed_actions": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "call_available": {
/// "description": "True when at least one resident (receives_calls) exists. When false, voice/video are excluded from allowed_actions.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "denial_reasons": {
/// "description": "Why this entry cannot be called: `no_callees`, `dnd`, or `guest_disabled`.\n\nThe server already computes each of these to decide `allowed_actions`; publishing them\nmeans the client can explain a greyed-out call button instead of leaving the visitor to\nguess.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "display_name": {},
/// "floor": {},
/// "floor_number": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "image": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "listing_label": {},
/// "listing_number": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64"
/// },
/// "require_video": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "target_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicPortalTarget {
pub allowed_actions: ::std::vec::Vec<::std::string::String>,
///True when at least one resident (receives_calls) exists. When false, voice/video are excluded from allowed_actions.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub call_available: ::std::option::Option<bool>,
/**Why this entry cannot be called: `no_callees`, `dnd`, or `guest_disabled`.
The server already computes each of these to decide `allowed_actions`; publishing them
means the client can explain a greyed-out call button instead of leaving the visitor to
guess.*/
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub denial_reasons: ::std::vec::Vec<::std::string::String>,
pub display_name: ::serde_json::Value,
pub floor: ::serde_json::Value,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub floor_number: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub listing_label: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub listing_number: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub require_video: ::std::option::Option<bool>,
pub target_id: ::std::string::String,
}
///`PublicPortalTargetsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "status",
/// "targets"
/// ],
/// "properties": {
/// "floor_order": {
/// "description": "Building `floor_order` from virtual_access integration config (canonical keys).",
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "message": {
/// "description": "Admin-authored text for `disabled`. Absent for every other status, because the shipped\ncopy for those is owned by the client and must not be duplicated here."
/// },
/// "status": {
/// "description": "One of `ready`, `empty`, `not_configured`, `disabled`. Each carries its own visitor\ncopy, so a building with no occupants reads differently from an intercom that was never\nset up.",
/// "type": "string"
/// },
/// "targets": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/PublicPortalTarget"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicPortalTargetsResponse {
///Building `floor_order` from virtual_access integration config (canonical keys).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub floor_order: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/**Admin-authored text for `disabled`. Absent for every other status, because the shipped
copy for those is owned by the client and must not be duplicated here.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub message: ::std::option::Option<::serde_json::Value>,
/**One of `ready`, `empty`, `not_configured`, `disabled`. Each carries its own visitor
copy, so a building with no occupants reads differently from an intercom that was never
set up.*/
pub status: ::std::string::String,
pub targets: ::std::vec::Vec<PublicPortalTarget>,
}
///`PublicSessionResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "callee_peer_id",
/// "caller_peer_id",
/// "peerjs",
/// "role",
/// "session_id",
/// "state"
/// ],
/// "properties": {
/// "building_display_name": {
/// "description": "Integration / building name (localized JSON)."
/// },
/// "call_target_display_name": {
/// "description": "Localized listing / unit title for call UI (caller/callee)."
/// },
/// "call_target_location_line": {
/// "description": "Single line for listing + floor (e.g. \"3 · Floor 2\").",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "callee_peer_id": {
/// "type": "string"
/// },
/// "callees_notified": {
/// "description": "Whether at least one callee received a push notification. Caller uses this to skip peer-unavailable retries when false.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "caller_peer_id": {
/// "type": "string"
/// },
/// "expires_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "has_lights": {
/// "description": "Whether the portal has light devices configured. Callee-only.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "mode": {
/// "description": "Call mode: \"voice\" or \"video\". Video on by default when mode is \"video\".",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "peerjs": {
/// "$ref": "#/components/schemas/PeerJsConfig"
/// },
/// "portal_camera_device_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "role": {
/// "$ref": "#/components/schemas/PublicSessionRole"
/// },
/// "session_id": {
/// "type": "string"
/// },
/// "state": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicSessionResponse {
///Integration / building name (localized JSON).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub building_display_name: ::std::option::Option<::serde_json::Value>,
///Localized listing / unit title for call UI (caller/callee).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub call_target_display_name: ::std::option::Option<::serde_json::Value>,
///Single line for listing + floor (e.g. "3 · Floor 2").
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub call_target_location_line: ::std::option::Option<::std::string::String>,
pub callee_peer_id: ::std::string::String,
///Whether at least one callee received a push notification. Caller uses this to skip peer-unavailable retries when false.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub callees_notified: ::std::option::Option<bool>,
pub caller_peer_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_at: ::std::option::Option<::std::string::String>,
///Whether the portal has light devices configured. Callee-only.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub has_lights: ::std::option::Option<bool>,
///Call mode: "voice" or "video". Video on by default when mode is "video".
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub mode: ::std::option::Option<::std::string::String>,
pub peerjs: PeerJsConfig,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub portal_camera_device_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub role: PublicSessionRole,
pub session_id: ::std::string::String,
pub state: ::std::string::String,
}
///`PublicSessionRole`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "caller",
/// "callee"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum PublicSessionRole {
#[serde(rename = "caller")]
Caller,
#[serde(rename = "callee")]
Callee,
}
impl ::std::fmt::Display for PublicSessionRole {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Caller => f.write_str("caller"),
Self::Callee => f.write_str("callee"),
}
}
}
impl ::std::str::FromStr for PublicSessionRole {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"caller" => Ok(Self::Caller),
"callee" => Ok(Self::Callee),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for PublicSessionRole {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublicSessionRole {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublicSessionRole {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`PublicSessionStreamsResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "device_ids"
/// ],
/// "properties": {
/// "device_ids": {
/// "description": "Camera device IDs for the portal. Stream URLs resolved client-side or via future API.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicSessionStreamsResponse {
///Camera device IDs for the portal. Stream URLs resolved client-side or via future API.
pub device_ids: ::std::vec::Vec<::std::string::String>,
}
///`PublicStoreResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "currency",
/// "is_member",
/// "items",
/// "name",
/// "public_id",
/// "registration_requested",
/// "store_id"
/// ],
/// "properties": {
/// "currency": {
/// "type": "string"
/// },
/// "is_member": {
/// "description": "Whether the authenticated caller (if any) is already an active member.",
/// "type": "boolean"
/// },
/// "items": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/PublicCatalogItem"
/// }
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "public_id": {
/// "type": "string"
/// },
/// "registration_requested": {
/// "description": "Whether the authenticated caller (if any) already has a pending registration request.",
/// "type": "boolean"
/// },
/// "store_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct PublicStoreResponse {
pub currency: ::std::string::String,
///Whether the authenticated caller (if any) is already an active member.
pub is_member: bool,
pub items: ::std::vec::Vec<PublicCatalogItem>,
pub name: LocalizedString,
pub public_id: ::std::string::String,
///Whether the authenticated caller (if any) already has a pending registration request.
pub registration_requested: bool,
pub store_id: ::std::string::String,
}
///`PurchaseRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "inventory_id"
/// ],
/// "properties": {
/// "billing_account_id": {
/// "description": "Optional billing account to charge (must be chargeable by the buyer). Defaults to the\nmember's account.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "inventory_id": {
/// "type": "string"
/// },
/// "quantity": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PurchaseRequest {
/**Optional billing account to charge (must be chargeable by the buyer). Defaults to the
member's account.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub billing_account_id: ::std::option::Option<::std::string::String>,
pub inventory_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub quantity: ::std::option::Option<i32>,
}
///`PutHoldRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "mode"
/// ],
/// "properties": {
/// "include_lights": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "kind": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "mode": {
/// "type": "string"
/// },
/// "reason": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "recurrence": {
/// "type": [
/// "object",
/// "null"
/// ]
/// },
/// "until": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PutHoldRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub include_lights: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub kind: ::std::option::Option<::std::string::String>,
pub mode: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reason: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub recurrence:
::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub until: ::std::option::Option<::std::string::String>,
}
///`PutLocationBindingRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "mode"
/// ],
/// "properties": {
/// "location_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "mode": {
/// "$ref": "#/components/schemas/LocationBindingMode"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct PutLocationBindingRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub location_id: ::std::option::Option<::std::string::String>,
pub mode: LocationBindingMode,
}
///Typed `config` shape for `quiet_hours`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Typed `config` shape for `quiet_hours`.",
/// "type": "object",
/// "required": [
/// "end",
/// "start"
/// ],
/// "properties": {
/// "applies_to": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PolicyPrincipalKind"
/// }
/// },
/// "end": {
/// "description": "Inclusive local end of the window, in `HH:MM`; a later end wraps midnight.",
/// "type": "string"
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// },
/// "start": {
/// "description": "Inclusive local start of the window, in `HH:MM`.",
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct QuietHoursPolicyConfig {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub applies_to: ::std::option::Option<::std::vec::Vec<PolicyPrincipalKind>>,
///Inclusive local end of the window, in `HH:MM`; a later end wraps midnight.
pub end: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
///Inclusive local start of the window, in `HH:MM`.
pub start: ::std::string::String,
}
/**A metered resource. Lifetime keys count current rows in their source-of-truth
table; temporal keys accumulate via `usage_events` + `quota_counters`.
String form (used in DB columns and JSON responses) is snake_case via `EnumString`.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A metered resource. Lifetime keys count current rows in their source-of-truth\ntable; temporal keys accumulate via `usage_events` + `quota_counters`.\n\nString form (used in DB columns and JSON responses) is snake_case via `EnumString`.",
/// "type": "string",
/// "enum": [
/// "org_users",
/// "organizations",
/// "integrations",
/// "devices",
/// "entities",
/// "zones",
/// "api_keys",
/// "door_opens",
/// "voice_invocations",
/// "portal_views",
/// "video_sessions",
/// "video_session_duration_seconds",
/// "scripting_executions",
/// "ai_requests",
/// "geocoding_requests"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum QuotaKey {
#[serde(rename = "org_users")]
OrgUsers,
#[serde(rename = "organizations")]
Organizations,
#[serde(rename = "integrations")]
Integrations,
#[serde(rename = "devices")]
Devices,
#[serde(rename = "entities")]
Entities,
#[serde(rename = "zones")]
Zones,
#[serde(rename = "api_keys")]
ApiKeys,
#[serde(rename = "door_opens")]
DoorOpens,
#[serde(rename = "voice_invocations")]
VoiceInvocations,
#[serde(rename = "portal_views")]
PortalViews,
#[serde(rename = "video_sessions")]
VideoSessions,
#[serde(rename = "video_session_duration_seconds")]
VideoSessionDurationSeconds,
#[serde(rename = "scripting_executions")]
ScriptingExecutions,
#[serde(rename = "ai_requests")]
AiRequests,
#[serde(rename = "geocoding_requests")]
GeocodingRequests,
}
impl ::std::fmt::Display for QuotaKey {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::OrgUsers => f.write_str("org_users"),
Self::Organizations => f.write_str("organizations"),
Self::Integrations => f.write_str("integrations"),
Self::Devices => f.write_str("devices"),
Self::Entities => f.write_str("entities"),
Self::Zones => f.write_str("zones"),
Self::ApiKeys => f.write_str("api_keys"),
Self::DoorOpens => f.write_str("door_opens"),
Self::VoiceInvocations => f.write_str("voice_invocations"),
Self::PortalViews => f.write_str("portal_views"),
Self::VideoSessions => f.write_str("video_sessions"),
Self::VideoSessionDurationSeconds => f.write_str("video_session_duration_seconds"),
Self::ScriptingExecutions => f.write_str("scripting_executions"),
Self::AiRequests => f.write_str("ai_requests"),
Self::GeocodingRequests => f.write_str("geocoding_requests"),
}
}
}
impl ::std::str::FromStr for QuotaKey {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"org_users" => Ok(Self::OrgUsers),
"organizations" => Ok(Self::Organizations),
"integrations" => Ok(Self::Integrations),
"devices" => Ok(Self::Devices),
"entities" => Ok(Self::Entities),
"zones" => Ok(Self::Zones),
"api_keys" => Ok(Self::ApiKeys),
"door_opens" => Ok(Self::DoorOpens),
"voice_invocations" => Ok(Self::VoiceInvocations),
"portal_views" => Ok(Self::PortalViews),
"video_sessions" => Ok(Self::VideoSessions),
"video_session_duration_seconds" => Ok(Self::VideoSessionDurationSeconds),
"scripting_executions" => Ok(Self::ScriptingExecutions),
"ai_requests" => Ok(Self::AiRequests),
"geocoding_requests" => Ok(Self::GeocodingRequests),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for QuotaKey {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for QuotaKey {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for QuotaKey {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`QuotaOverrideRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "limit_value",
/// "quota_key",
/// "subject_id",
/// "subject_type"
/// ],
/// "properties": {
/// "expires_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "limit_value": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "period": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "quota_key": {
/// "type": "string"
/// },
/// "reason": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "subject_id": {
/// "type": "string"
/// },
/// "subject_type": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct QuotaOverrideRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_at: ::std::option::Option<::std::string::String>,
pub limit_value: i64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub period: ::std::option::Option<::std::string::String>,
pub quota_key: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub reason: ::std::option::Option<::std::string::String>,
pub subject_id: ::std::string::String,
pub subject_type: ::std::string::String,
}
/**Window kind for a quota. `Lifetime` is "ever / right now"; `Day`/`Week`/`Month`
reset on calendar boundaries (UTC); `PerSession` resets per opaque session id.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Window kind for a quota. `Lifetime` is \"ever / right now\"; `Day`/`Week`/`Month`\nreset on calendar boundaries (UTC); `PerSession` resets per opaque session id.",
/// "type": "string",
/// "enum": [
/// "lifetime",
/// "day",
/// "week",
/// "month",
/// "per_session"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum QuotaPeriod {
#[serde(rename = "lifetime")]
Lifetime,
#[serde(rename = "day")]
Day,
#[serde(rename = "week")]
Week,
#[serde(rename = "month")]
Month,
#[serde(rename = "per_session")]
PerSession,
}
impl ::std::fmt::Display for QuotaPeriod {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Lifetime => f.write_str("lifetime"),
Self::Day => f.write_str("day"),
Self::Week => f.write_str("week"),
Self::Month => f.write_str("month"),
Self::PerSession => f.write_str("per_session"),
}
}
}
impl ::std::str::FromStr for QuotaPeriod {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"lifetime" => Ok(Self::Lifetime),
"day" => Ok(Self::Day),
"week" => Ok(Self::Week),
"month" => Ok(Self::Month),
"per_session" => Ok(Self::PerSession),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for QuotaPeriod {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for QuotaPeriod {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for QuotaPeriod {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Full quota report for an org; powers `/dashboard/billing`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Full quota report for an org; powers `/dashboard/billing`.",
/// "type": "object",
/// "required": [
/// "items",
/// "org_id"
/// ],
/// "properties": {
/// "degradation": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/DegradationStatus"
/// }
/// ]
/// }
/// ]
/// },
/// "items": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/QuotaUsage"
/// }
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "tier_slug": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct QuotaReport {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub degradation: ::std::option::Option<DegradationStatus>,
pub items: ::std::vec::Vec<QuotaUsage>,
pub org_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub tier_slug: ::std::option::Option<::std::string::String>,
}
/**Machine-readable unit for a quota quantity. `Count` is a plain integer of the
key's noun (door opens, devices, …); `Seconds` is a duration clients may render
in larger units (e.g. minutes for video chat).*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Machine-readable unit for a quota quantity. `Count` is a plain integer of the\nkey's noun (door opens, devices, …); `Seconds` is a duration clients may render\nin larger units (e.g. minutes for video chat).",
/// "type": "string",
/// "enum": [
/// "count",
/// "seconds"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum QuotaUnit {
#[serde(rename = "count")]
Count,
#[serde(rename = "seconds")]
Seconds,
}
impl ::std::fmt::Display for QuotaUnit {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Count => f.write_str("count"),
Self::Seconds => f.write_str("seconds"),
}
}
}
impl ::std::str::FromStr for QuotaUnit {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"count" => Ok(Self::Count),
"seconds" => Ok(Self::Seconds),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for QuotaUnit {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for QuotaUnit {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for QuotaUnit {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Single (key, period) entry in a usage report.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Single (key, period) entry in a usage report.",
/// "type": "object",
/// "required": [
/// "current",
/// "key",
/// "limit",
/// "period",
/// "period_label",
/// "unit"
/// ],
/// "properties": {
/// "current": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "key": {
/// "$ref": "#/components/schemas/QuotaKey"
/// },
/// "limit": {
/// "$ref": "#/components/schemas/EffectiveLimit"
/// },
/// "period": {
/// "$ref": "#/components/schemas/QuotaPeriod"
/// },
/// "period_end": {
/// "description": "Window end ([RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339)). `null` for `Lifetime`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "period_label": {
/// "description": "Window label (e.g. `lifetime`, `month:2026-04`). Stable across reports.",
/// "type": "string"
/// },
/// "period_start": {
/// "description": "Window start ([RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339)). `null` for `Lifetime`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "unit": {
/// "$ref": "#/components/schemas/QuotaUnit"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct QuotaUsage {
pub current: i64,
pub key: QuotaKey,
pub limit: EffectiveLimit,
pub period: QuotaPeriod,
///Window end ([RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339)). `null` for `Lifetime`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub period_end: ::std::option::Option<::std::string::String>,
///Window label (e.g. `lifetime`, `month:2026-04`). Stable across reports.
pub period_label: ::std::string::String,
///Window start ([RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339)). `null` for `Lifetime`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub period_start: ::std::option::Option<::std::string::String>,
pub unit: QuotaUnit,
}
///`ReadinessIssue`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "code",
/// "severity"
/// ],
/// "properties": {
/// "code": {
/// "$ref": "#/components/schemas/ReadinessIssueCode"
/// },
/// "severity": {
/// "$ref": "#/components/schemas/ReadinessSeverity"
/// },
/// "subject": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ReadinessSubject"
/// }
/// ]
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReadinessIssue {
pub code: ReadinessIssueCode,
pub severity: ReadinessSeverity,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub subject: ::std::option::Option<ReadinessSubject>,
}
///`ReadinessIssueCode`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "site_no_openers",
/// "site_no_doors",
/// "site_no_door_with_opener",
/// "site_no_portals",
/// "site_no_portal_with_usable_door",
/// "site_no_intercom_directory",
/// "door_no_opener",
/// "door_opener_unresolved",
/// "door_life_safety_incomplete",
/// "door_no_portal",
/// "portal_no_door",
/// "portal_door_missing",
/// "portal_door_no_opener",
/// "portal_no_directory",
/// "intercom_no_listings",
/// "listing_no_members",
/// "intercom_directory_draft",
/// "site_multiple_intercom_directories",
/// "site_no_people"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ReadinessIssueCode {
#[serde(rename = "site_no_openers")]
SiteNoOpeners,
#[serde(rename = "site_no_doors")]
SiteNoDoors,
#[serde(rename = "site_no_door_with_opener")]
SiteNoDoorWithOpener,
#[serde(rename = "site_no_portals")]
SiteNoPortals,
#[serde(rename = "site_no_portal_with_usable_door")]
SiteNoPortalWithUsableDoor,
#[serde(rename = "site_no_intercom_directory")]
SiteNoIntercomDirectory,
#[serde(rename = "door_no_opener")]
DoorNoOpener,
#[serde(rename = "door_opener_unresolved")]
DoorOpenerUnresolved,
#[serde(rename = "door_life_safety_incomplete")]
DoorLifeSafetyIncomplete,
#[serde(rename = "door_no_portal")]
DoorNoPortal,
#[serde(rename = "portal_no_door")]
PortalNoDoor,
#[serde(rename = "portal_door_missing")]
PortalDoorMissing,
#[serde(rename = "portal_door_no_opener")]
PortalDoorNoOpener,
#[serde(rename = "portal_no_directory")]
PortalNoDirectory,
#[serde(rename = "intercom_no_listings")]
IntercomNoListings,
#[serde(rename = "listing_no_members")]
ListingNoMembers,
#[serde(rename = "intercom_directory_draft")]
IntercomDirectoryDraft,
#[serde(rename = "site_multiple_intercom_directories")]
SiteMultipleIntercomDirectories,
#[serde(rename = "site_no_people")]
SiteNoPeople,
}
impl ::std::fmt::Display for ReadinessIssueCode {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::SiteNoOpeners => f.write_str("site_no_openers"),
Self::SiteNoDoors => f.write_str("site_no_doors"),
Self::SiteNoDoorWithOpener => f.write_str("site_no_door_with_opener"),
Self::SiteNoPortals => f.write_str("site_no_portals"),
Self::SiteNoPortalWithUsableDoor => f.write_str("site_no_portal_with_usable_door"),
Self::SiteNoIntercomDirectory => f.write_str("site_no_intercom_directory"),
Self::DoorNoOpener => f.write_str("door_no_opener"),
Self::DoorOpenerUnresolved => f.write_str("door_opener_unresolved"),
Self::DoorLifeSafetyIncomplete => f.write_str("door_life_safety_incomplete"),
Self::DoorNoPortal => f.write_str("door_no_portal"),
Self::PortalNoDoor => f.write_str("portal_no_door"),
Self::PortalDoorMissing => f.write_str("portal_door_missing"),
Self::PortalDoorNoOpener => f.write_str("portal_door_no_opener"),
Self::PortalNoDirectory => f.write_str("portal_no_directory"),
Self::IntercomNoListings => f.write_str("intercom_no_listings"),
Self::ListingNoMembers => f.write_str("listing_no_members"),
Self::IntercomDirectoryDraft => f.write_str("intercom_directory_draft"),
Self::SiteMultipleIntercomDirectories => {
f.write_str("site_multiple_intercom_directories")
}
Self::SiteNoPeople => f.write_str("site_no_people"),
}
}
}
impl ::std::str::FromStr for ReadinessIssueCode {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"site_no_openers" => Ok(Self::SiteNoOpeners),
"site_no_doors" => Ok(Self::SiteNoDoors),
"site_no_door_with_opener" => Ok(Self::SiteNoDoorWithOpener),
"site_no_portals" => Ok(Self::SiteNoPortals),
"site_no_portal_with_usable_door" => Ok(Self::SiteNoPortalWithUsableDoor),
"site_no_intercom_directory" => Ok(Self::SiteNoIntercomDirectory),
"door_no_opener" => Ok(Self::DoorNoOpener),
"door_opener_unresolved" => Ok(Self::DoorOpenerUnresolved),
"door_life_safety_incomplete" => Ok(Self::DoorLifeSafetyIncomplete),
"door_no_portal" => Ok(Self::DoorNoPortal),
"portal_no_door" => Ok(Self::PortalNoDoor),
"portal_door_missing" => Ok(Self::PortalDoorMissing),
"portal_door_no_opener" => Ok(Self::PortalDoorNoOpener),
"portal_no_directory" => Ok(Self::PortalNoDirectory),
"intercom_no_listings" => Ok(Self::IntercomNoListings),
"listing_no_members" => Ok(Self::ListingNoMembers),
"intercom_directory_draft" => Ok(Self::IntercomDirectoryDraft),
"site_multiple_intercom_directories" => Ok(Self::SiteMultipleIntercomDirectories),
"site_no_people" => Ok(Self::SiteNoPeople),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ReadinessIssueCode {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ReadinessIssueCode {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ReadinessIssueCode {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ReadinessSection`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "doors",
/// "portals",
/// "virtual_intercom",
/// "people"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ReadinessSection {
#[serde(rename = "doors")]
Doors,
#[serde(rename = "portals")]
Portals,
#[serde(rename = "virtual_intercom")]
VirtualIntercom,
#[serde(rename = "people")]
People,
}
impl ::std::fmt::Display for ReadinessSection {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Doors => f.write_str("doors"),
Self::Portals => f.write_str("portals"),
Self::VirtualIntercom => f.write_str("virtual_intercom"),
Self::People => f.write_str("people"),
}
}
}
impl ::std::str::FromStr for ReadinessSection {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"doors" => Ok(Self::Doors),
"portals" => Ok(Self::Portals),
"virtual_intercom" => Ok(Self::VirtualIntercom),
"people" => Ok(Self::People),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ReadinessSection {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ReadinessSection {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ReadinessSection {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Ordered from least to most severe; `Ord` is used to roll sections up.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Ordered from least to most severe; `Ord` is used to roll sections up.",
/// "type": "string",
/// "enum": [
/// "ok",
/// "incomplete",
/// "partial",
/// "blocking"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ReadinessSeverity {
#[serde(rename = "ok")]
Ok,
#[serde(rename = "incomplete")]
Incomplete,
#[serde(rename = "partial")]
Partial,
#[serde(rename = "blocking")]
Blocking,
}
impl ::std::fmt::Display for ReadinessSeverity {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Ok => f.write_str("ok"),
Self::Incomplete => f.write_str("incomplete"),
Self::Partial => f.write_str("partial"),
Self::Blocking => f.write_str("blocking"),
}
}
}
impl ::std::str::FromStr for ReadinessSeverity {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"ok" => Ok(Self::Ok),
"incomplete" => Ok(Self::Incomplete),
"partial" => Ok(Self::Partial),
"blocking" => Ok(Self::Blocking),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ReadinessSeverity {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ReadinessSeverity {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ReadinessSeverity {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ReadinessSubject`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "kind"
/// ],
/// "properties": {
/// "id": {
/// "type": "string"
/// },
/// "kind": {
/// "$ref": "#/components/schemas/ReadinessSubjectKind"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReadinessSubject {
pub id: ::std::string::String,
pub kind: ReadinessSubjectKind,
}
///`ReadinessSubjectKind`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "door",
/// "portal",
/// "listing",
/// "directory"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ReadinessSubjectKind {
#[serde(rename = "door")]
Door,
#[serde(rename = "portal")]
Portal,
#[serde(rename = "listing")]
Listing,
#[serde(rename = "directory")]
Directory,
}
impl ::std::fmt::Display for ReadinessSubjectKind {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Door => f.write_str("door"),
Self::Portal => f.write_str("portal"),
Self::Listing => f.write_str("listing"),
Self::Directory => f.write_str("directory"),
}
}
}
impl ::std::str::FromStr for ReadinessSubjectKind {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"door" => Ok(Self::Door),
"portal" => Ok(Self::Portal),
"listing" => Ok(Self::Listing),
"directory" => Ok(Self::Directory),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ReadinessSubjectKind {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ReadinessSubjectKind {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ReadinessSubjectKind {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ReconcileAccessInviteRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "external_ref"
/// ],
/// "properties": {
/// "external_ref": {
/// "$ref": "#/components/schemas/ExternalReferenceInput"
/// },
/// "invitation": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/CreateAccessInviteRequest"
/// }
/// ]
/// }
/// ]
/// },
/// "state": {
/// "$ref": "#/components/schemas/ReconcileInviteState"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ReconcileAccessInviteRequest {
pub external_ref: ExternalReferenceInput,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invitation: ::std::option::Option<CreateAccessInviteRequest>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub state: ::std::option::Option<ReconcileInviteState>,
}
///`ReconcileAccessInviteResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "action"
/// ],
/// "properties": {
/// "action": {
/// "$ref": "#/components/schemas/ReconcileAction"
/// },
/// "external_ref": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ExternalReferenceResponse"
/// }
/// ]
/// }
/// ]
/// },
/// "idempotent_replay": {
/// "description": "True when this body is a replay of an earlier reconcile carrying the same\n`Idempotency-Key`; nothing was written by this request.",
/// "type": "boolean"
/// },
/// "invite": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/AccessInviteListItem"
/// }
/// ]
/// }
/// ]
/// },
/// "invite_link_id": {
/// "description": "The invitation serving the external record. Absent only when the desired state is `revoked`\nand no invitation exists for the record.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "invite_token": {
/// "description": "Guest bearer token, returned **once**, only by the call that created the invitation. A\nreplayed reconcile omits it; use `regenerate-token` to obtain a fresh link.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "invite_url": {
/// "description": "Guest-facing invite URL, with the same one-time visibility as `invite_token`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReconcileAccessInviteResponse {
pub action: ReconcileAction,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_ref: ::std::option::Option<ExternalReferenceResponse>,
/**True when this body is a replay of an earlier reconcile carrying the same
`Idempotency-Key`; nothing was written by this request.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub idempotent_replay: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invite: ::std::option::Option<AccessInviteListItem>,
/**The invitation serving the external record. Absent only when the desired state is `revoked`
and no invitation exists for the record.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invite_link_id: ::std::option::Option<::std::string::String>,
/**Guest bearer token, returned **once**, only by the call that created the invitation. A
replayed reconcile omits it; use `regenerate-token` to obtain a fresh link.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invite_token: ::std::option::Option<::std::string::String>,
///Guest-facing invite URL, with the same one-time visibility as `invite_token`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invite_url: ::std::option::Option<::std::string::String>,
}
///What a reconcile actually did.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "What a reconcile actually did.",
/// "type": "string",
/// "enum": [
/// "created",
/// "updated",
/// "restored",
/// "revoked",
/// "unchanged"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ReconcileAction {
#[serde(rename = "created")]
Created,
#[serde(rename = "updated")]
Updated,
#[serde(rename = "restored")]
Restored,
#[serde(rename = "revoked")]
Revoked,
#[serde(rename = "unchanged")]
Unchanged,
}
impl ::std::fmt::Display for ReconcileAction {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Created => f.write_str("created"),
Self::Updated => f.write_str("updated"),
Self::Restored => f.write_str("restored"),
Self::Revoked => f.write_str("revoked"),
Self::Unchanged => f.write_str("unchanged"),
}
}
}
impl ::std::str::FromStr for ReconcileAction {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"created" => Ok(Self::Created),
"updated" => Ok(Self::Updated),
"restored" => Ok(Self::Restored),
"revoked" => Ok(Self::Revoked),
"unchanged" => Ok(Self::Unchanged),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ReconcileAction {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ReconcileAction {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ReconcileAction {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Desired lifecycle state of the invitation that serves an external record.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Desired lifecycle state of the invitation that serves an external record.",
/// "type": "string",
/// "enum": [
/// "active",
/// "revoked"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ReconcileInviteState {
#[serde(rename = "active")]
Active,
#[serde(rename = "revoked")]
Revoked,
}
impl ::std::fmt::Display for ReconcileInviteState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Active => f.write_str("active"),
Self::Revoked => f.write_str("revoked"),
}
}
}
impl ::std::str::FromStr for ReconcileInviteState {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"active" => Ok(Self::Active),
"revoked" => Ok(Self::Revoked),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ReconcileInviteState {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ReconcileInviteState {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ReconcileInviteState {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`RedeemGroupShareOfferPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "token"
/// ],
/// "properties": {
/// "token": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct RedeemGroupShareOfferPayload {
pub token: ::std::string::String,
}
///`RedeemHouseholdInvitationRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "pin",
/// "token"
/// ],
/// "properties": {
/// "pin": {
/// "type": "string"
/// },
/// "token": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct RedeemHouseholdInvitationRequest {
pub pin: ::std::string::String,
pub token: ::std::string::String,
}
///`RedeemHouseholdInvitationResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "group_id"
/// ],
/// "properties": {
/// "group_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RedeemHouseholdInvitationResponse {
pub group_id: ::std::string::String,
}
///`RedeemInvitationRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "pin",
/// "token"
/// ],
/// "properties": {
/// "pin": {
/// "type": "string"
/// },
/// "token": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct RedeemInvitationRequest {
pub pin: ::std::string::String,
pub token: ::std::string::String,
}
///`RedeemInvitationResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "default_roles",
/// "org_id",
/// "user_id"
/// ],
/// "properties": {
/// "default_roles": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "merge": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/MergeOfferDto"
/// }
/// ]
/// }
/// ]
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "user_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RedeemInvitationResponse {
pub default_roles: ::std::vec::Vec<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub merge: ::std::option::Option<MergeOfferDto>,
pub org_id: ::std::string::String,
pub user_id: ::std::string::String,
}
///`RegenerateAccessInviteTokenResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "invite_token",
/// "invite_url",
/// "last_shared_at"
/// ],
/// "properties": {
/// "invite_token": {
/// "type": "string"
/// },
/// "invite_url": {
/// "description": "Guest-facing invite URL (shareable link for SMS/email).",
/// "type": "string"
/// },
/// "last_shared_at": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RegenerateAccessInviteTokenResponse {
pub invite_token: ::std::string::String,
///Guest-facing invite URL (shareable link for SMS/email).
pub invite_url: ::std::string::String,
pub last_shared_at: ::std::string::String,
}
///`RegistrationStatus`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "pending",
/// "approved",
/// "rejected"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum RegistrationStatus {
#[serde(rename = "pending")]
Pending,
#[serde(rename = "approved")]
Approved,
#[serde(rename = "rejected")]
Rejected,
}
impl ::std::fmt::Display for RegistrationStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Pending => f.write_str("pending"),
Self::Approved => f.write_str("approved"),
Self::Rejected => f.write_str("rejected"),
}
}
}
impl ::std::str::FromStr for RegistrationStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"pending" => Ok(Self::Pending),
"approved" => Ok(Self::Approved),
"rejected" => Ok(Self::Rejected),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for RegistrationStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for RegistrationStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for RegistrationStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Typed `config` shape for `require_step_up`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Typed `config` shape for `require_step_up`.",
/// "type": "object",
/// "properties": {
/// "applies_to": {
/// "description": "Principal kinds requiring confirmation; unknown and empty values are rejected.",
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/PolicyPrincipalKind"
/// }
/// },
/// "output": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/PolicyOutputSelector"
/// }
/// ]
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct RequireStepUpPolicyConfig {
///Principal kinds requiring confirmation; unknown and empty values are rejected.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub applies_to: ::std::option::Option<::std::vec::Vec<PolicyPrincipalKind>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub output: ::std::option::Option<PolicyOutputSelector>,
}
impl ::std::default::Default for RequireStepUpPolicyConfig {
fn default() -> Self {
Self {
applies_to: Default::default(),
output: Default::default(),
}
}
}
///`ResolveCandidate`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id",
/// "label",
/// "resource_type",
/// "score"
/// ],
/// "properties": {
/// "entity_type": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "label": {
/// "type": "string"
/// },
/// "resource_type": {
/// "type": "string"
/// },
/// "score": {
/// "type": "number",
/// "format": "double"
/// },
/// "why": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResolveCandidate {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub entity_type: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
pub label: ::std::string::String,
pub resource_type: ::std::string::String,
pub score: f64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub why: ::std::option::Option<::std::string::String>,
}
///`ResolveRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "query"
/// ],
/// "properties": {
/// "query": {
/// "type": "string"
/// },
/// "resource_type": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResolveRequest {
pub query: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub resource_type: ::std::option::Option<::std::string::String>,
}
///`ResolveResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "ambiguous",
/// "candidates",
/// "query"
/// ],
/// "properties": {
/// "ambiguous": {
/// "type": "boolean"
/// },
/// "candidates": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/ResolveCandidate"
/// }
/// },
/// "query": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResolveResponse {
pub ambiguous: bool,
pub candidates: ::std::vec::Vec<ResolveCandidate>,
pub query: ::std::string::String,
}
///`ResolvedLocationResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "binding"
/// ],
/// "properties": {
/// "binding": {
/// "$ref": "#/components/schemas/LocationBindingResponse"
/// },
/// "resolved": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocationResponse"
/// }
/// ]
/// }
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResolvedLocationResponse {
pub binding: LocationBindingResponse,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub resolved: ::std::option::Option<LocationResponse>,
}
/**Resource-scoped image URL response (does not expose asset_id).
When no image is uploaded, returns 204 No Content (not 404).*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Resource-scoped image URL response (does not expose asset_id).\nWhen no image is uploaded, returns 204 No Content (not 404).",
/// "type": "object",
/// "required": [
/// "expires_in_seconds",
/// "url"
/// ],
/// "properties": {
/// "expires_in_seconds": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "url": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResourceImageUrlResponse {
pub expires_in_seconds: i64,
pub url: ::std::string::String,
}
/**Soft-delete and audit timestamps on a persisted resource.
Flattened onto HTTP JSON so `created_at` sits next to `id` / `name`. Absent
fields are omitted (`None`).*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Soft-delete and audit timestamps on a persisted resource.\n\nFlattened onto HTTP JSON so `created_at` sits next to `id` / `name`. Absent\nfields are omitted (`None`).",
/// "type": "object",
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "date-time"
/// },
/// "deleted_at": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "date-time"
/// },
/// "hard_delete_at": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "date-time"
/// },
/// "purge_at": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "date-time"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "date-time"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ResourceLifecycle {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
impl ::std::default::Default for ResourceLifecycle {
fn default() -> Self {
Self {
created_at: Default::default(),
deleted_at: Default::default(),
hard_delete_at: Default::default(),
purge_at: Default::default(),
updated_at: Default::default(),
}
}
}
///Per-resource degradation state (mirrors the `degradation_state` column).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Per-resource degradation state (mirrors the `degradation_state` column).",
/// "type": "string",
/// "enum": [
/// "active",
/// "flagged",
/// "degraded",
/// "marked_for_delete"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum ResourceState {
#[serde(rename = "active")]
Active,
#[serde(rename = "flagged")]
Flagged,
#[serde(rename = "degraded")]
Degraded,
#[serde(rename = "marked_for_delete")]
MarkedForDelete,
}
impl ::std::fmt::Display for ResourceState {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Active => f.write_str("active"),
Self::Flagged => f.write_str("flagged"),
Self::Degraded => f.write_str("degraded"),
Self::MarkedForDelete => f.write_str("marked_for_delete"),
}
}
}
impl ::std::str::FromStr for ResourceState {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"active" => Ok(Self::Active),
"flagged" => Ok(Self::Flagged),
"degraded" => Ok(Self::Degraded),
"marked_for_delete" => Ok(Self::MarkedForDelete),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for ResourceState {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ResourceState {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ResourceState {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`ReverseGeocodeRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "lat",
/// "lng"
/// ],
/// "properties": {
/// "lat": {
/// "type": "number",
/// "format": "double"
/// },
/// "lng": {
/// "type": "number",
/// "format": "double"
/// },
/// "locale": {
/// "description": "Preferred locale (app code or BCP-47) for the resolved text. Defaults to `en`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct ReverseGeocodeRequest {
pub lat: f64,
pub lng: f64,
///Preferred locale (app code or BCP-47) for the resolved text. Defaults to `en`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub locale: ::std::option::Option<::std::string::String>,
}
/**Resolved address for a map-picked point. Text fields are single-locale (the requested
`locale`), ready for the client to wrap under its current locale. Empty strings mean the point
has no address (e.g. open water); the coordinates are always echoed back.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Resolved address for a map-picked point. Text fields are single-locale (the requested\n`locale`), ready for the client to wrap under its current locale. Empty strings mean the point\nhas no address (e.g. open water); the coordinates are always echoed back.",
/// "type": "object",
/// "required": [
/// "city",
/// "country",
/// "formatted_address",
/// "lat",
/// "lng"
/// ],
/// "properties": {
/// "city": {
/// "type": "string"
/// },
/// "country": {
/// "type": "string"
/// },
/// "formatted_address": {
/// "type": "string"
/// },
/// "geocoding_provider": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/GeocodingProviderId"
/// }
/// ]
/// }
/// ]
/// },
/// "lat": {
/// "type": "number",
/// "format": "double"
/// },
/// "lng": {
/// "type": "number",
/// "format": "double"
/// },
/// "provider_place_id": {
/// "description": "Opaque place id issued by `geocoding_provider`, when the point resolved to a known place.\nBoth fields are present together or not at all.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ReverseGeocodeResponse {
pub city: ::std::string::String,
pub country: ::std::string::String,
pub formatted_address: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub geocoding_provider: ::std::option::Option<GeocodingProviderId>,
pub lat: f64,
pub lng: f64,
/**Opaque place id issued by `geocoding_provider`, when the point resolved to a known place.
Both fields are present together or not at all.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub provider_place_id: ::std::option::Option<::std::string::String>,
}
///A role name (e.g. admin, users:read) assigned to a user in an org.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A role name (e.g. admin, users:read) assigned to a user in an org.",
/// "type": "string"
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
)]
#[serde(transparent)]
pub struct Role(pub ::std::string::String);
impl ::std::ops::Deref for Role {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<Role> for ::std::string::String {
fn from(value: Role) -> Self {
value.0
}
}
impl ::std::convert::From<::std::string::String> for Role {
fn from(value: ::std::string::String) -> Self {
Self(value)
}
}
impl ::std::str::FromStr for Role {
type Err = ::std::convert::Infallible;
fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
Ok(Self(value.to_string()))
}
}
impl ::std::fmt::Display for Role {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
self.0.fmt(f)
}
}
///`ScriptingExecution`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "created_at",
/// "id",
/// "status"
/// ],
/// "properties": {
/// "completed_at": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "date-time"
/// },
/// "created_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "error": {
/// "description": "Present only when `status` is `failed` or `canceled`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "result": {
/// "description": "Present only when `status` is `succeeded`."
/// },
/// "started_at": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "date-time"
/// },
/// "status": {
/// "$ref": "#/components/schemas/ExecutionStatus"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ScriptingExecution {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub completed_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
///Present only when `status` is `failed` or `canceled`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub error: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
///Present only when `status` is `succeeded`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub result: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub started_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
pub status: ExecutionStatus,
}
/**List projection: identical to [`ScriptingExecution`] minus `result`, so listing executions
does not pull every stored result body.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "List projection: identical to [`ScriptingExecution`] minus `result`, so listing executions\ndoes not pull every stored result body.",
/// "type": "object",
/// "required": [
/// "created_at",
/// "id",
/// "status"
/// ],
/// "properties": {
/// "completed_at": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "date-time"
/// },
/// "created_at": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "error": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "started_at": {
/// "type": [
/// "string",
/// "null"
/// ],
/// "format": "date-time"
/// },
/// "status": {
/// "$ref": "#/components/schemas/ExecutionStatus"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct ScriptingExecutionSummary {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub completed_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub error: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub started_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
pub status: ExecutionStatus,
}
///`SearchOrgsQuery`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/MultiResourceOutputOptionsQuery"
/// },
/// {
/// "$ref": "#/components/schemas/PaginationQuery"
/// },
/// {
/// "type": "object",
/// "required": [
/// "q"
/// ],
/// "properties": {
/// "q": {
/// "description": "Free-text query matched as a case-insensitive substring of the org name, or as an exact\n(case-insensitive) org ID.",
/// "type": "string"
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SearchOrgsQuery {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub include_deleted: ::std::option::Option<bool>,
///Number of items per page. Default from config, max 200.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub limit: ::std::option::Option<i32>,
///Number of items to skip. Default 0.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub offset: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub only_deleted: ::std::option::Option<bool>,
/**Free-text query matched as a case-insensitive substring of the org name, or as an exact
(case-insensitive) org ID.*/
pub q: ::std::string::String,
}
///`SearchUsersQuery`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "exclude_ids": {
/// "description": "Comma-separated user IDs to exclude",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "limit": {
/// "type": "integer",
/// "minimum": 0.0
/// },
/// "offset": {
/// "type": "integer",
/// "minimum": 0.0
/// },
/// "org_id": {
/// "description": "Filter by org subtree (ignored when `scope=all`).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "q": {
/// "description": "Search text (ILIKE on name and email)",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "scope": {
/// "description": "`all`: search every user in the database (requires `users:list` on the root org). Otherwise org-scoped.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SearchUsersQuery {
///Comma-separated user IDs to exclude
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub exclude_ids: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub limit: ::std::option::Option<u64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub offset: ::std::option::Option<u64>,
///Filter by org subtree (ignored when `scope=all`).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub org_id: ::std::option::Option<::std::string::String>,
///Search text (ILIKE on name and email)
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub q: ::std::option::Option<::std::string::String>,
///`all`: search every user in the database (requires `users:list` on the root org). Otherwise org-scoped.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub scope: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for SearchUsersQuery {
fn default() -> Self {
Self {
exclude_ids: Default::default(),
limit: Default::default(),
offset: Default::default(),
org_id: Default::default(),
q: Default::default(),
scope: Default::default(),
}
}
}
///`SectionReadiness`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "blocking_count",
/// "incomplete_count",
/// "issues",
/// "section",
/// "severity"
/// ],
/// "properties": {
/// "blocking_count": {
/// "description": "Issues whose subject cannot be used, including site-scoped gaps.",
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "incomplete_count": {
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "issues": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/ReadinessIssue"
/// }
/// },
/// "section": {
/// "$ref": "#/components/schemas/ReadinessSection"
/// },
/// "severity": {
/// "$ref": "#/components/schemas/ReadinessSeverity"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SectionReadiness {
///Issues whose subject cannot be used, including site-scoped gaps.
pub blocking_count: i32,
pub incomplete_count: i32,
pub issues: ::std::vec::Vec<ReadinessIssue>,
pub section: ReadinessSection,
pub severity: ReadinessSeverity,
}
///How excess resources are chosen when the admin has not pinned survivors via `quota_keep`.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "How excess resources are chosen when the admin has not pinned survivors via `quota_keep`.",
/// "type": "string",
/// "enum": [
/// "newest_first",
/// "oldest_first",
/// "least_recently_used",
/// "manual"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum SelectionPolicy {
#[serde(rename = "newest_first")]
NewestFirst,
#[serde(rename = "oldest_first")]
OldestFirst,
#[serde(rename = "least_recently_used")]
LeastRecentlyUsed,
#[serde(rename = "manual")]
Manual,
}
impl ::std::fmt::Display for SelectionPolicy {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::NewestFirst => f.write_str("newest_first"),
Self::OldestFirst => f.write_str("oldest_first"),
Self::LeastRecentlyUsed => f.write_str("least_recently_used"),
Self::Manual => f.write_str("manual"),
}
}
}
impl ::std::str::FromStr for SelectionPolicy {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"newest_first" => Ok(Self::NewestFirst),
"oldest_first" => Ok(Self::OldestFirst),
"least_recently_used" => Ok(Self::LeastRecentlyUsed),
"manual" => Ok(Self::Manual),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for SelectionPolicy {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SelectionPolicy {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SelectionPolicy {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`SetDoorRestrictionsPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "listing_entity_ids"
/// ],
/// "properties": {
/// "listing_entity_ids": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct SetDoorRestrictionsPayload {
pub listing_entity_ids: ::std::vec::Vec<::std::string::String>,
}
///`SetOrgTimezoneRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "timezone": {
/// "description": "IANA timezone. Empty or null clears to UTC fallback.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct SetOrgTimezoneRequest {
///IANA timezone. Empty or null clears to UTC fallback.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub timezone: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for SetOrgTimezoneRequest {
fn default() -> Self {
Self {
timezone: Default::default(),
}
}
}
///`SetResourceKeepRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "keep",
/// "resource",
/// "resource_id"
/// ],
/// "properties": {
/// "keep": {
/// "description": "`true` pins the resource (kept within cap); `false` lets it be flagged as excess.",
/// "type": "boolean"
/// },
/// "resource": {
/// "$ref": "#/components/schemas/CapacityResource"
/// },
/// "resource_id": {
/// "description": "The resource id to pin or unpin.",
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct SetResourceKeepRequest {
///`true` pins the resource (kept within cap); `false` lets it be flagged as excess.
pub keep: bool,
pub resource: CapacityResource,
///The resource id to pin or unpin.
pub resource_id: ::std::string::String,
}
///`SetSelectionPolicyRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "policy"
/// ],
/// "properties": {
/// "policy": {
/// "$ref": "#/components/schemas/SelectionPolicy"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct SetSelectionPolicyRequest {
pub policy: SelectionPolicy,
}
/**Options for single-resource operations (get/create/update/delete/restore).
Used when listing/filtering by `only_deleted` is not applicable.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Options for single-resource operations (get/create/update/delete/restore).\nUsed when listing/filtering by `only_deleted` is not applicable.",
/// "type": "object",
/// "required": [
/// "include_deleted"
/// ],
/// "properties": {
/// "include_deleted": {
/// "description": "If true, include soft-deleted items in results.",
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SingleResourceOutputOptions {
///If true, include soft-deleted items in results.
pub include_deleted: bool,
}
/**Query parameters for single-resource operations (get/create/update/delete/restore).
Omits `only_deleted` since it only applies to list endpoints.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Query parameters for single-resource operations (get/create/update/delete/restore).\nOmits `only_deleted` since it only applies to list endpoints.",
/// "type": "object",
/// "properties": {
/// "include_deleted": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SingleResourceOutputOptionsQuery {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub include_deleted: ::std::option::Option<bool>,
}
impl ::std::default::Default for SingleResourceOutputOptionsQuery {
fn default() -> Self {
Self {
include_deleted: Default::default(),
}
}
}
///One device in one section. A device may appear in more than one section.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "One device in one section. A device may appear in more than one section.",
/// "type": "object",
/// "required": [
/// "deleted",
/// "device_id",
/// "doors",
/// "entities",
/// "integration_id",
/// "name"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "deleted": {
/// "description": "True when the device is soft-deleted but still referenced by a door.",
/// "type": "boolean"
/// },
/// "device_id": {
/// "type": "string"
/// },
/// "doors": {
/// "description": "Doors this device serves in this role (union of `entities[].doors`).",
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/SiteAccessDeviceDoor"
/// }
/// },
/// "entities": {
/// "description": "Entities on this device playing this section's role. Empty for cameras.",
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/SiteAccessDeviceEntity"
/// }
/// },
/// "external_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "integration_id": {
/// "description": "Owning integration — usually not the site's own integration.",
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SiteAccessDevice {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
///True when the device is soft-deleted but still referenced by a door.
pub deleted: bool,
pub device_id: ::std::string::String,
///Doors this device serves in this role (union of `entities[].doors`).
pub doors: ::std::vec::Vec<SiteAccessDeviceDoor>,
///Entities on this device playing this section's role. Empty for cameras.
pub entities: ::std::vec::Vec<SiteAccessDeviceEntity>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
///Owning integration — usually not the site's own integration.
pub integration_id: ::std::string::String,
pub name: LocalizedString,
}
///A door (portal device) a device serves.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A door (portal device) a device serves.",
/// "type": "object",
/// "required": [
/// "door_device_id",
/// "name"
/// ],
/// "properties": {
/// "auto_off_config": {
/// "description": "The door's `auto_off_config` for this light entry. Lights only."
/// },
/// "door_device_id": {
/// "type": "string"
/// },
/// "life_safety": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/SiteAccessDoorLifeSafety"
/// }
/// ]
/// }
/// ]
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SiteAccessDeviceDoor {
///The door's `auto_off_config` for this light entry. Lights only.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub auto_off_config: ::std::option::Option<::serde_json::Value>,
pub door_device_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub life_safety: ::std::option::Option<SiteAccessDoorLifeSafety>,
pub name: LocalizedString,
}
///An entity on the device that plays the section's role.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "An entity on the device that plays the section's role.",
/// "type": "object",
/// "required": [
/// "doors",
/// "entity_id",
/// "entity_type",
/// "name"
/// ],
/// "properties": {
/// "doors": {
/// "description": "Doors this entity serves, each carrying that door's light auto-off config.",
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/SiteAccessDeviceDoor"
/// }
/// },
/// "entity_id": {
/// "type": "string"
/// },
/// "entity_type": {
/// "description": "`entity_type` as stored (`switch`, `door`, `light`, …).",
/// "type": "string"
/// },
/// "label": {
/// "description": "The label the door gave this opener/light, when set.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SiteAccessDeviceEntity {
///Doors this entity serves, each carrying that door's light auto-off config.
pub doors: ::std::vec::Vec<SiteAccessDeviceDoor>,
pub entity_id: ::std::string::String,
///`entity_type` as stored (`switch`, `door`, `light`, …).
pub entity_type: ::std::string::String,
///The label the door gave this opener/light, when set.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub label: ::std::option::Option<::std::string::String>,
pub name: ::std::string::String,
}
///Which door-side list put a device in a section.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Which door-side list put a device in a section.",
/// "type": "string",
/// "enum": [
/// "opener",
/// "light",
/// "camera"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum SiteAccessDeviceRole {
#[serde(rename = "opener")]
Opener,
#[serde(rename = "light")]
Light,
#[serde(rename = "camera")]
Camera,
}
impl ::std::fmt::Display for SiteAccessDeviceRole {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Opener => f.write_str("opener"),
Self::Light => f.write_str("light"),
Self::Camera => f.write_str("camera"),
}
}
}
impl ::std::str::FromStr for SiteAccessDeviceRole {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"opener" => Ok(Self::Opener),
"light" => Ok(Self::Light),
"camera" => Ok(Self::Camera),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for SiteAccessDeviceRole {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SiteAccessDeviceRole {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SiteAccessDeviceRole {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`SiteAccessDevicesResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cameras",
/// "lights",
/// "openers",
/// "unresolved"
/// ],
/// "properties": {
/// "cameras": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/SiteAccessDevice"
/// }
/// },
/// "lights": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/SiteAccessDevice"
/// }
/// },
/// "openers": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/SiteAccessDevice"
/// }
/// },
/// "unresolved": {
/// "description": "Door references that resolve to no device. Never empty-by-omission.",
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/SiteAccessUnresolvedRef"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SiteAccessDevicesResponse {
pub cameras: ::std::vec::Vec<SiteAccessDevice>,
pub lights: ::std::vec::Vec<SiteAccessDevice>,
pub openers: ::std::vec::Vec<SiteAccessDevice>,
///Door references that resolve to no device. Never empty-by-omission.
pub unresolved: ::std::vec::Vec<SiteAccessUnresolvedRef>,
}
/**A door's life-safety classification, passed through verbatim.
The open-block rule lives in the dashboard (`lifeSafetyOpenBlock`) and is
already enforced there for entity tables. Returning the raw fields keeps one
rule instead of a second copy of the policy in Rust.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A door's life-safety classification, passed through verbatim.\n\nThe open-block rule lives in the dashboard (`lifeSafetyOpenBlock`) and is\nalready enforced there for entity tables. Returning the raw fields keeps one\nrule instead of a second copy of the policy in Rust.",
/// "type": "object",
/// "properties": {
/// "attestation": {},
/// "class": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SiteAccessDoorLifeSafety {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub attestation: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub class: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for SiteAccessDoorLifeSafety {
fn default() -> Self {
Self {
attestation: Default::default(),
class: Default::default(),
}
}
}
///`SiteAccessOverviewDevices`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "cameras",
/// "lights",
/// "openers",
/// "total",
/// "unresolved"
/// ],
/// "properties": {
/// "cameras": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "lights": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "openers": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "total": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "unresolved": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SiteAccessOverviewDevices {
pub cameras: i64,
pub lights: i64,
pub openers: i64,
pub total: i64,
pub unresolved: i64,
}
///`SiteAccessOverviewPortal`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "id"
/// ],
/// "properties": {
/// "device_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SiteAccessOverviewPortal {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub device_id: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
}
///`SiteAccessOverviewResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "doors_count",
/// "integration",
/// "invitations_count",
/// "listings_count",
/// "people_count",
/// "portals",
/// "portals_count",
/// "visible_listings_count"
/// ],
/// "properties": {
/// "devices": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/SiteAccessOverviewDevices"
/// }
/// ]
/// }
/// ]
/// },
/// "directory_device_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "doors_count": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "integration": {
/// "$ref": "#/components/schemas/Integration"
/// },
/// "invitations_count": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "listings_count": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "people_count": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "policies_count": {
/// "description": "Missing when the requester cannot list policies.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "portals": {
/// "description": "Portal-to-door links are used to scope readiness issues on the hub.",
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/SiteAccessOverviewPortal"
/// }
/// },
/// "portals_count": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "visible_listings_count": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SiteAccessOverviewResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub devices: ::std::option::Option<SiteAccessOverviewDevices>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub directory_device_id: ::std::option::Option<::std::string::String>,
pub doors_count: i64,
pub integration: Integration,
pub invitations_count: i64,
pub listings_count: i64,
pub people_count: i64,
///Missing when the requester cannot list policies.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub policies_count: ::std::option::Option<i64>,
///Portal-to-door links are used to scope readiness issues on the hub.
pub portals: ::std::vec::Vec<SiteAccessOverviewPortal>,
pub portals_count: i64,
pub visible_listings_count: i64,
}
///Why a door's reference has no device to show.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Why a door's reference has no device to show.",
/// "type": "string",
/// "enum": [
/// "entity_missing",
/// "device_missing"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum SiteAccessUnresolvedReason {
#[serde(rename = "entity_missing")]
EntityMissing,
#[serde(rename = "device_missing")]
DeviceMissing,
}
impl ::std::fmt::Display for SiteAccessUnresolvedReason {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::EntityMissing => f.write_str("entity_missing"),
Self::DeviceMissing => f.write_str("device_missing"),
}
}
}
impl ::std::str::FromStr for SiteAccessUnresolvedReason {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"entity_missing" => Ok(Self::EntityMissing),
"device_missing" => Ok(Self::DeviceMissing),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for SiteAccessUnresolvedReason {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for SiteAccessUnresolvedReason {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for SiteAccessUnresolvedReason {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///A door reference with nothing to show.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A door reference with nothing to show.",
/// "type": "object",
/// "required": [
/// "doors",
/// "reason",
/// "reference",
/// "role"
/// ],
/// "properties": {
/// "doors": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/SiteAccessDeviceDoor"
/// }
/// },
/// "reason": {
/// "$ref": "#/components/schemas/SiteAccessUnresolvedReason"
/// },
/// "reference": {
/// "description": "The raw id from the door's metadata (entity id for openers/lights, device id for cameras).",
/// "type": "string"
/// },
/// "role": {
/// "$ref": "#/components/schemas/SiteAccessDeviceRole"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SiteAccessUnresolvedRef {
pub doors: ::std::vec::Vec<SiteAccessDeviceDoor>,
pub reason: SiteAccessUnresolvedReason,
///The raw id from the door's metadata (entity id for openers/lights, device id for cameras).
pub reference: ::std::string::String,
pub role: SiteAccessDeviceRole,
}
///`SiteReadiness`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "sections",
/// "severity",
/// "suppressed_sections",
/// "usable"
/// ],
/// "properties": {
/// "sections": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/SectionReadiness"
/// }
/// },
/// "severity": {
/// "$ref": "#/components/schemas/ReadinessSeverity"
/// },
/// "suppressed_sections": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/ReadinessSection"
/// }
/// },
/// "usable": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SiteReadiness {
pub sections: ::std::vec::Vec<SectionReadiness>,
pub severity: ReadinessSeverity,
pub suppressed_sections: ::std::vec::Vec<ReadinessSection>,
pub usable: bool,
}
///`SkillResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "agent_id",
/// "enabled",
/// "id",
/// "name",
/// "org_id",
/// "steps",
/// "trigger_event_types",
/// "version"
/// ],
/// "properties": {
/// "agent_id": {
/// "type": "string"
/// },
/// "enabled": {
/// "type": "boolean"
/// },
/// "id": {
/// "type": "string"
/// },
/// "name": {
/// "type": "string"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "steps": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/SkillStep"
/// }
/// },
/// "trigger_event_types": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "version": {
/// "type": "integer",
/// "format": "int32"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SkillResponse {
pub agent_id: ::std::string::String,
pub enabled: bool,
pub id: ::std::string::String,
pub name: ::std::string::String,
pub org_id: ::std::string::String,
pub steps: ::std::vec::Vec<SkillStep>,
pub trigger_event_types: ::std::vec::Vec<::std::string::String>,
pub version: i32,
}
///`SkillStep`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "tool"
/// ],
/// "properties": {
/// "args": {},
/// "tool": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SkillStep {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub args: ::std::option::Option<::serde_json::Value>,
pub tool: ::std::string::String,
}
///`StatementResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "currency",
/// "items",
/// "month",
/// "purchase_count",
/// "total_cents"
/// ],
/// "properties": {
/// "currency": {
/// "type": "string"
/// },
/// "items": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/StorePurchase"
/// }
/// },
/// "month": {
/// "type": "string"
/// },
/// "purchase_count": {
/// "type": "integer",
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "total_cents": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct StatementResponse {
pub currency: ::std::string::String,
pub items: ::std::vec::Vec<StorePurchase>,
pub month: ::std::string::String,
pub purchase_count: i64,
pub total_cents: i64,
}
///A storefront. Many stores may exist per org.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A storefront. Many stores may exist per org.",
/// "type": "object",
/// "required": [
/// "currency",
/// "id",
/// "name",
/// "org_id",
/// "timezone"
/// ],
/// "properties": {
/// "branding_overrides": {
/// "type": [
/// "object",
/// "null"
/// ]
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "currency": {
/// "description": "ISO 4217 currency code for prices/statements.",
/// "type": "string"
/// },
/// "deleted_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "timezone": {
/// "description": "IANA timezone used to derive monthly billing cycles.",
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Store {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub branding_overrides:
::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
///ISO 4217 currency code for prices/statements.
pub currency: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
pub name: LocalizedString,
pub org_id: ::std::string::String,
///IANA timezone used to derive monthly billing cycles.
pub timezone: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
/**Per-store listing of a catalog product. `stock_quantity` `None` means untracked (no
enforcement); `Some(n)` is enforced and decremented on purchase.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Per-store listing of a catalog product. `stock_quantity` `None` means untracked (no\nenforcement); `Some(n)` is enforced and decremented on purchase.",
/// "type": "object",
/// "required": [
/// "id",
/// "is_active",
/// "price_cents",
/// "product_id",
/// "store_id"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "deleted_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "is_active": {
/// "type": "boolean"
/// },
/// "price_cents": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "product_id": {
/// "type": "string"
/// },
/// "stock_quantity": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "store_id": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct StoreInventory {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
pub is_active: bool,
pub price_cents: i64,
pub product_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub stock_quantity: ::std::option::Option<i32>,
pub store_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
/**Store membership. `Pending` awaits admin approval; `Removed` keeps the row (history) but
blocks purchasing.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Store membership. `Pending` awaits admin approval; `Removed` keeps the row (history) but\nblocks purchasing.",
/// "type": "object",
/// "required": [
/// "id",
/// "role",
/// "status",
/// "store_id",
/// "user_id"
/// ],
/// "properties": {
/// "billing_account_id": {
/// "description": "Account purchases are charged to. `None` falls back to the member's personal account.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "removed_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "role": {
/// "$ref": "#/components/schemas/StoreMemberRole"
/// },
/// "status": {
/// "$ref": "#/components/schemas/StoreMemberStatus"
/// },
/// "store_id": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "user_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct StoreMember {
///Account purchases are charged to. `None` falls back to the member's personal account.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub billing_account_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub removed_at: ::std::option::Option<::std::string::String>,
pub role: StoreMemberRole,
pub status: StoreMemberStatus,
pub store_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
pub user_id: ::std::string::String,
}
///`StoreMemberRole`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "admin",
/// "member"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum StoreMemberRole {
#[serde(rename = "admin")]
Admin,
#[serde(rename = "member")]
Member,
}
impl ::std::fmt::Display for StoreMemberRole {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Admin => f.write_str("admin"),
Self::Member => f.write_str("member"),
}
}
}
impl ::std::str::FromStr for StoreMemberRole {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"admin" => Ok(Self::Admin),
"member" => Ok(Self::Member),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for StoreMemberRole {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for StoreMemberRole {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for StoreMemberRole {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`StoreMemberStatus`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "pending",
/// "active",
/// "removed"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum StoreMemberStatus {
#[serde(rename = "pending")]
Pending,
#[serde(rename = "active")]
Active,
#[serde(rename = "removed")]
Removed,
}
impl ::std::fmt::Display for StoreMemberStatus {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Pending => f.write_str("pending"),
Self::Active => f.write_str("active"),
Self::Removed => f.write_str("removed"),
}
}
}
impl ::std::str::FromStr for StoreMemberStatus {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"pending" => Ok(Self::Pending),
"active" => Ok(Self::Active),
"removed" => Ok(Self::Removed),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for StoreMemberStatus {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for StoreMemberStatus {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for StoreMemberStatus {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///Logical QR portal for a store (stable for printed QR codes). Mirrors the access portal.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Logical QR portal for a store (stable for printed QR codes). Mirrors the access portal.",
/// "type": "object",
/// "required": [
/// "id",
/// "name",
/// "org_id",
/// "public_id",
/// "store_id"
/// ],
/// "properties": {
/// "branding_overrides": {
/// "type": [
/// "object",
/// "null"
/// ]
/// },
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "deleted_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "public_id": {
/// "type": "string"
/// },
/// "store_id": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct StorePortal {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub branding_overrides:
::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
pub name: LocalizedString,
pub org_id: ::std::string::String,
pub public_id: ::std::string::String,
pub store_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
/**Org-scoped catalog product. Soft-deleted products are retained (`purge_at`) so historical
statements and audit stay readable.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Org-scoped catalog product. Soft-deleted products are retained (`purge_at`) so historical\nstatements and audit stay readable.",
/// "type": "object",
/// "required": [
/// "id",
/// "name",
/// "org_id"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "deleted_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "external_url": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "image_media_asset_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "purge_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct StoreProduct {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_url: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub image_media_asset_id: ::std::option::Option<::std::string::String>,
pub name: LocalizedString,
pub org_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
}
///Immutable purchase ledger row (system of record for billing/statements).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Immutable purchase ledger row (system of record for billing/statements).",
/// "type": "object",
/// "required": [
/// "created_at",
/// "currency",
/// "id",
/// "org_id",
/// "product_name_snapshot",
/// "quantity",
/// "store_id",
/// "total_cents",
/// "unit_price_cents"
/// ],
/// "properties": {
/// "billing_account_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "buyer_user_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "created_at": {
/// "type": "string"
/// },
/// "currency": {
/// "type": "string"
/// },
/// "id": {
/// "type": "string"
/// },
/// "inventory_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "product_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "product_name_snapshot": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "quantity": {
/// "type": "integer",
/// "format": "int32"
/// },
/// "store_id": {
/// "type": "string"
/// },
/// "total_cents": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "unit_price_cents": {
/// "type": "integer",
/// "format": "int64"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct StorePurchase {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub billing_account_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub buyer_user_id: ::std::option::Option<::std::string::String>,
pub created_at: ::std::string::String,
pub currency: ::std::string::String,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub inventory_id: ::std::option::Option<::std::string::String>,
pub org_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub product_id: ::std::option::Option<::std::string::String>,
pub product_name_snapshot: LocalizedString,
pub quantity: i32,
pub store_id: ::std::string::String,
pub total_cents: i64,
pub unit_price_cents: i64,
}
///Pending store registration awaiting admin approval.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Pending store registration awaiting admin approval.",
/// "type": "object",
/// "required": [
/// "id",
/// "org_id",
/// "status",
/// "store_id",
/// "user_id"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "decided_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "decided_by": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": "string"
/// },
/// "note": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "status": {
/// "$ref": "#/components/schemas/RegistrationStatus"
/// },
/// "store_id": {
/// "type": "string"
/// },
/// "user_id": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct StoreRegistrationRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub decided_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub decided_by: ::std::option::Option<::std::string::String>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub note: ::std::option::Option<::std::string::String>,
pub org_id: ::std::string::String,
pub status: RegistrationStatus,
pub store_id: ::std::string::String,
pub user_id: ::std::string::String,
}
///External subscription reference.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "External subscription reference.",
/// "type": "object",
/// "required": [
/// "external_id",
/// "provider",
/// "status",
/// "tier_slug"
/// ],
/// "properties": {
/// "external_id": {
/// "type": "string"
/// },
/// "provider": {
/// "type": "string"
/// },
/// "status": {
/// "type": "string"
/// },
/// "tier_slug": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct SubscriptionRef {
pub external_id: ::std::string::String,
pub provider: ::std::string::String,
pub status: ::std::string::String,
pub tier_slug: ::std::string::String,
}
///`TasmotaConnectionConfig`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "command_topic",
/// "mqtt_client_id",
/// "mqtt_host",
/// "mqtt_password",
/// "mqtt_port",
/// "mqtt_tls",
/// "mqtt_username",
/// "web_password"
/// ],
/// "properties": {
/// "command_topic": {
/// "type": "string"
/// },
/// "mqtt_client_id": {
/// "type": "string"
/// },
/// "mqtt_host": {
/// "type": "string"
/// },
/// "mqtt_password": {
/// "type": "string"
/// },
/// "mqtt_port": {
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "mqtt_tls": {
/// "type": "boolean"
/// },
/// "mqtt_username": {
/// "type": "string"
/// },
/// "power_topics": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/TasmotaPowerTopic"
/// }
/// },
/// "web_password": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TasmotaConnectionConfig {
pub command_topic: ::std::string::String,
pub mqtt_client_id: ::std::string::String,
pub mqtt_host: ::std::string::String,
pub mqtt_password: ::std::string::String,
pub mqtt_port: i32,
pub mqtt_tls: bool,
pub mqtt_username: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub power_topics: ::std::vec::Vec<TasmotaPowerTopic>,
pub web_password: ::std::string::String,
}
///`TasmotaLanProvisionRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "device_host"
/// ],
/// "properties": {
/// "device_host": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TasmotaLanProvisionRequest {
pub device_host: ::std::string::String,
}
///`TasmotaPowerTopic`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "channel_index",
/// "gpio",
/// "topic"
/// ],
/// "properties": {
/// "channel_index": {
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "gpio": {
/// "type": "integer",
/// "format": "int32",
/// "minimum": 0.0
/// },
/// "topic": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TasmotaPowerTopic {
pub channel_index: i32,
pub gpio: i32,
pub topic: ::std::string::String,
}
///`TasmotaProvisioningResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "backlog",
/// "connection"
/// ],
/// "properties": {
/// "backlog": {
/// "type": "string"
/// },
/// "connection": {
/// "$ref": "#/components/schemas/TasmotaConnectionConfig"
/// },
/// "mqtt_ca_pem": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TasmotaProvisioningResponse {
pub backlog: ::std::string::String,
pub connection: TasmotaConnectionConfig,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub mqtt_ca_pem: ::std::option::Option<::std::string::String>,
}
///`TransferIntegrationRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "target_org_id"
/// ],
/// "properties": {
/// "confirm": {
/// "description": "Must be `true` when the preview reports side-effect warnings; otherwise the request is\nrejected with `error_code = \"confirmation_required\"`.",
/// "type": "boolean"
/// },
/// "mode": {
/// "$ref": "#/components/schemas/TransferModeDto"
/// },
/// "target_org_id": {
/// "description": "Destination organization id (must differ from the integration's current org).",
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct TransferIntegrationRequest {
/**Must be `true` when the preview reports side-effect warnings; otherwise the request is
rejected with `error_code = "confirmation_required"`.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub confirm: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub mode: ::std::option::Option<TransferModeDto>,
///Destination organization id (must differ from the integration's current org).
pub target_org_id: ::std::string::String,
}
///`TransferIntegrationResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/IntegrationResponse"
/// },
/// {
/// "type": "object",
/// "required": [
/// "affected",
/// "mode",
/// "source_org_id",
/// "target_org_id",
/// "warnings"
/// ],
/// "properties": {
/// "affected": {
/// "$ref": "#/components/schemas/AffectedCounts"
/// },
/// "mode": {
/// "type": "string"
/// },
/// "source_org_id": {
/// "type": "string"
/// },
/// "target_org_id": {
/// "type": "string"
/// },
/// "warnings": {
/// "description": "Side-effect warning codes that applied to this transfer.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransferIntegrationResponse {
pub affected: AffectedCounts,
///Provider-specific non-secret configuration (JSON).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub config: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Pause switch for hardware connectors. Always true for site providers.
pub enabled: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
pub health: IntegrationHealth,
///Unique identifier (ULID).
pub id: ::std::string::String,
pub mode: ::std::string::String,
pub name: LocalizedString,
///Organization that owns this integration.
pub org_id: ::std::string::String,
pub provider_type: ProviderType,
pub provider_type_name: LocalizedString,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
pub source_org_id: ::std::string::String,
pub target_org_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Side-effect warning codes that applied to this transfer.
pub warnings: ::std::vec::Vec<::std::string::String>,
}
///`TransferModeDto`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "enum": [
/// "move",
/// "duplicate"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
pub enum TransferModeDto {
#[serde(rename = "move")]
Move,
#[serde(rename = "duplicate")]
Duplicate,
}
impl ::std::fmt::Display for TransferModeDto {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::Move => f.write_str("move"),
Self::Duplicate => f.write_str("duplicate"),
}
}
}
impl ::std::str::FromStr for TransferModeDto {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"move" => Ok(Self::Move),
"duplicate" => Ok(Self::Duplicate),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for TransferModeDto {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TransferModeDto {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TransferModeDto {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///`TransferPreviewResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "affected",
/// "mode",
/// "notes",
/// "requires_confirmation",
/// "source_org_id",
/// "warnings"
/// ],
/// "properties": {
/// "affected": {
/// "$ref": "#/components/schemas/AffectedCounts"
/// },
/// "mode": {
/// "type": "string"
/// },
/// "notes": {
/// "description": "Informational notes the dashboard should display before transferring. Unlike `warnings`,\nthese never gate `requires_confirmation` — they inform without requiring a confirm step.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "requires_confirmation": {
/// "description": "When true, `POST /transfer` must be called with `confirm = true`.",
/// "type": "boolean"
/// },
/// "source_org_id": {
/// "type": "string"
/// },
/// "warnings": {
/// "description": "Side-effect warning codes the dashboard should surface before confirming.",
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TransferPreviewResponse {
pub affected: AffectedCounts,
pub mode: ::std::string::String,
/**Informational notes the dashboard should display before transferring. Unlike `warnings`,
these never gate `requires_confirmation` — they inform without requiring a confirm step.*/
pub notes: ::std::vec::Vec<::std::string::String>,
///When true, `POST /transfer` must be called with `confirm = true`.
pub requires_confirmation: bool,
pub source_org_id: ::std::string::String,
///Side-effect warning codes the dashboard should surface before confirming.
pub warnings: ::std::vec::Vec<::std::string::String>,
}
///`TranslateLocaleContentRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "body",
/// "source_locale",
/// "target_locales",
/// "title"
/// ],
/// "properties": {
/// "body": {
/// "type": "string"
/// },
/// "source_locale": {
/// "type": "string"
/// },
/// "target_locales": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "title": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct TranslateLocaleContentRequest {
pub body: ::std::string::String,
pub source_locale: ::std::string::String,
pub target_locales: ::std::vec::Vec<::std::string::String>,
pub title: ::std::string::String,
}
///`TranslateLocaleContentResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "translations"
/// ],
/// "properties": {
/// "translations": {
/// "type": "object",
/// "additionalProperties": {
/// "$ref": "#/components/schemas/LocaleContentTranslation"
/// }
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct TranslateLocaleContentResponse {
pub translations:
::std::collections::HashMap<::std::string::String, LocaleContentTranslation>,
}
///`UpdateAccessInviteRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "audience": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/InviteAudience"
/// }
/// ]
/// }
/// ]
/// },
/// "contacts": {
/// "description": "When set, replaces the invitation's contacts. Omitted leaves them unchanged.",
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/AccessInviteContactInput"
/// }
/// },
/// "creation_justification": {
/// "description": "Why this invitation was created (required when `invitation_require_justification` applies).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "curfew_exempt": {
/// "description": "Admin-only emergency exception: skip invitation curfew at redemption.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "disabled_justification": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "external_ref": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/ExternalReferenceInput"
/// }
/// ]
/// }
/// ]
/// },
/// "invitee_message": {},
/// "is_enabled": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "location_id": {
/// "description": "Only consumed when `location_mode` is `explicit`: the reusable org location id to bind.\nWhen the mode is `explicit` and this is absent, the existing bound location is kept.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "location_mode": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocationBindingMode"
/// }
/// ]
/// }
/// ]
/// },
/// "max_devices": {
/// "description": "Virtual keycard limit: max unique devices allowed. JSON `null` means unlimited.",
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "max_uses": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "pin": {
/// "description": "Omitted leaves the stored PIN unchanged; JSON `null` clears it.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "portal_ids": {
/// "description": "When set, replaces portal grants. Array order is the display order on the public invite page.",
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "schedules": {
/// "description": "When set, replaces all schedule entries. This is the only way to change validity or\nrecurrence.",
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "$ref": "#/components/schemas/InviteScheduleEntryInput"
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateAccessInviteRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub audience: ::std::option::Option<InviteAudience>,
///When set, replaces the invitation's contacts. Omitted leaves them unchanged.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub contacts: ::std::option::Option<::std::vec::Vec<AccessInviteContactInput>>,
///Why this invitation was created (required when `invitation_require_justification` applies).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub creation_justification: ::std::option::Option<::std::string::String>,
///Admin-only emergency exception: skip invitation curfew at redemption.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub curfew_exempt: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub disabled_justification: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_ref: ::std::option::Option<ExternalReferenceInput>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub invitee_message: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_enabled: ::std::option::Option<bool>,
/**Only consumed when `location_mode` is `explicit`: the reusable org location id to bind.
When the mode is `explicit` and this is absent, the existing bound location is kept.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub location_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub location_mode: ::std::option::Option<LocationBindingMode>,
///Virtual keycard limit: max unique devices allowed. JSON `null` means unlimited.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_devices: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub max_uses: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
///Omitted leaves the stored PIN unchanged; JSON `null` clears it.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub pin: ::std::option::Option<::std::string::String>,
///When set, replaces portal grants. Array order is the display order on the public invite page.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub portal_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/**When set, replaces all schedule entries. This is the only way to change validity or
recurrence.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub schedules: ::std::option::Option<::std::vec::Vec<InviteScheduleEntryInput>>,
}
impl ::std::default::Default for UpdateAccessInviteRequest {
fn default() -> Self {
Self {
audience: Default::default(),
contacts: Default::default(),
creation_justification: Default::default(),
curfew_exempt: Default::default(),
disabled_justification: Default::default(),
external_ref: Default::default(),
invitee_message: Default::default(),
is_enabled: Default::default(),
location_id: Default::default(),
location_mode: Default::default(),
max_devices: Default::default(),
max_uses: Default::default(),
name: Default::default(),
pin: Default::default(),
portal_ids: Default::default(),
schedules: Default::default(),
}
}
}
///`UpdateAccessPortalRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "device_id": {
/// "description": "Door device id. Must be a virtual_access_portal device in this integration. Use null to unlink.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "directory_id": {
/// "description": "Directory device id. Must be a virtual_access_directory device in this integration. Use null to unlink.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateAccessPortalRequest {
///Door device id. Must be a virtual_access_portal device in this integration. Use null to unlink.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub device_id: ::std::option::Option<::std::string::String>,
///Directory device id. Must be a virtual_access_directory device in this integration. Use null to unlink.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub directory_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<LocalizedString>,
}
impl ::std::default::Default for UpdateAccessPortalRequest {
fn default() -> Self {
Self {
device_id: Default::default(),
directory_id: Default::default(),
name: Default::default(),
}
}
}
///`UpdateAgentRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "allowed_entity_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "allowed_portal_ids": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "allowed_tool_names": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "confirmation_mode": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_in": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "purpose": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UpdateAgentRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_entity_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_portal_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_tool_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub confirmation_mode: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_in: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purpose: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for UpdateAgentRequest {
fn default() -> Self {
Self {
allowed_entity_ids: Default::default(),
allowed_portal_ids: Default::default(),
allowed_tool_names: Default::default(),
confirmation_mode: Default::default(),
expires_at: Default::default(),
expires_in: Default::default(),
name: Default::default(),
purpose: Default::default(),
}
}
}
///`UpdateApiKeyRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "expires_at": {
/// "description": "[RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) absolute expiration timestamp (UTC). Mutually exclusive with `expires_in`. Optional; if omitted, expiry is unchanged.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_in": {
/// "description": "Duration per [RFC 5545 §3.3.6](https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.6) (ISO 8601 `P1D`, `PT1H`, …; no months/years) or compact tokens `s`/`m`/`h`/`d`/`w` (`M` is minutes). Max 3650d (10 years). `1y` is rejected. Mutually exclusive with `expires_at`. Optional; if omitted, expiry is unchanged.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UpdateApiKeyRequest {
///[RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339) absolute expiration timestamp (UTC). Mutually exclusive with `expires_in`. Optional; if omitted, expiry is unchanged.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_at: ::std::option::Option<::std::string::String>,
///Duration per [RFC 5545 §3.3.6](https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.6) (ISO 8601 `P1D`, `PT1H`, …; no months/years) or compact tokens `s`/`m`/`h`/`d`/`w` (`M` is minutes). Max 3650d (10 years). `1y` is rejected. Mutually exclusive with `expires_at`. Optional; if omitted, expiry is unchanged.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub expires_in: ::std::option::Option<::std::string::String>,
pub name: ::std::string::String,
}
///`UpdateDeviceRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "device_metadata": {},
/// "external_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateDeviceRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub device_metadata: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<LocalizedString>,
}
impl ::std::default::Default for UpdateDeviceRequest {
fn default() -> Self {
Self {
device_metadata: Default::default(),
external_id: Default::default(),
name: Default::default(),
}
}
}
///`UpdateDirectoryConfigPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "allowed_listing_kinds": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "disabled_message": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "naming_patterns": {
/// "type": [
/// "object",
/// "null"
/// ],
/// "additionalProperties": {
/// "type": "string"
/// }
/// },
/// "state": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateDirectoryConfigPayload {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub allowed_listing_kinds: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub disabled_message: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub naming_patterns: ::std::option::Option<
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub state: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for UpdateDirectoryConfigPayload {
fn default() -> Self {
Self {
allowed_listing_kinds: Default::default(),
disabled_message: Default::default(),
naming_patterns: Default::default(),
state: Default::default(),
}
}
}
///`UpdateDirectoryListingMemberPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "date_of_birth": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "is_child": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "receives_calls": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "role": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateDirectoryListingMemberPayload {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub date_of_birth: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_child: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub receives_calls: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub role: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for UpdateDirectoryListingMemberPayload {
fn default() -> Self {
Self {
date_of_birth: Default::default(),
is_child: Default::default(),
receives_calls: Default::default(),
role: Default::default(),
}
}
}
///`UpdateEntityRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "channel_index": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// },
/// "entity_type": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "external_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "metadata": {
/// "description": "Update (replace) persisted entity metadata.\n\n- `None`: no change\n- `Some(None)`: clear metadata\n- `Some(Some(map))`: replace with provided map",
/// "type": [
/// "object",
/// "null"
/// ],
/// "additionalProperties": {}
/// },
/// "name": {
/// "description": "Update entity name.\n\n- `None`: no change\n- `Some(None)`: clear\n- `Some(Some(name))`: set (trimmed; empty becomes clear)",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "zone_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateEntityRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub channel_index: ::std::option::Option<i32>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub entity_type: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
/**Update (replace) persisted entity metadata.
- `None`: no change
- `Some(None)`: clear metadata
- `Some(Some(map))`: replace with provided map*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub metadata:
::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
/**Update entity name.
- `None`: no change
- `Some(None)`: clear
- `Some(Some(name))`: set (trimmed; empty becomes clear)*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub zone_id: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for UpdateEntityRequest {
fn default() -> Self {
Self {
channel_index: Default::default(),
entity_type: Default::default(),
external_id: Default::default(),
metadata: Default::default(),
name: Default::default(),
zone_id: Default::default(),
}
}
}
///`UpdateGroupLinkPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "admission_mode": {
/// "description": "approve waits for each member to be admitted; auto admits them immediately; pinned holds a\nfixed member set until an explicit re-sync.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "resync": {
/// "description": "With pinned mode, re-reads the group's current membership and admits the difference.",
/// "type": [
/// "boolean",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateGroupLinkPayload {
/**approve waits for each member to be admitted; auto admits them immediately; pinned holds a
fixed member set until an explicit re-sync.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub admission_mode: ::std::option::Option<::std::string::String>,
///With pinned mode, re-reads the group's current membership and admits the difference.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub resync: ::std::option::Option<bool>,
}
impl ::std::default::Default for UpdateGroupLinkPayload {
fn default() -> Self {
Self {
admission_mode: Default::default(),
resync: Default::default(),
}
}
}
///`UpdateGroupPayload`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "description": {},
/// "kind": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {},
/// "shareable": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateGroupPayload {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub kind: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub shareable: ::std::option::Option<bool>,
}
impl ::std::default::Default for UpdateGroupPayload {
fn default() -> Self {
Self {
description: Default::default(),
kind: Default::default(),
name: Default::default(),
shareable: Default::default(),
}
}
}
///Payload for renaming a household.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Payload for renaming a household.",
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "name": {
/// "type": "string"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateHouseholdPayload {
pub name: ::std::string::String,
}
///`UpdateIntegrationRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "config": {
/// "description": "Tri-state patch semantics for `config`:\n- field omitted: do not change config\n- `\"config\": null`: clear config (set to None)\n- `\"config\": { ... }`: replace config (do not merge)"
/// },
/// "enabled": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "name": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "provider_type": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "secrets": {
/// "description": "Tri-state patch semantics for `secrets` (stored in Secrets Manager):\n- field omitted: do not change secrets\n- `\"secrets\": null`: clear secrets\n- `\"secrets\": { ... }`: replace secrets"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateIntegrationRequest {
/**Tri-state patch semantics for `config`:
- field omitted: do not change config
- `"config": null`: clear config (set to None)
- `"config": { ... }`: replace config (do not merge)*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub config: ::std::option::Option<::serde_json::Value>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub enabled: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub provider_type: ::std::option::Option<::std::string::String>,
/**Tri-state patch semantics for `secrets` (stored in Secrets Manager):
- field omitted: do not change secrets
- `"secrets": null`: clear secrets
- `"secrets": { ... }`: replace secrets*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub secrets: ::std::option::Option<::serde_json::Value>,
}
impl ::std::default::Default for UpdateIntegrationRequest {
fn default() -> Self {
Self {
config: Default::default(),
enabled: Default::default(),
name: Default::default(),
provider_type: Default::default(),
secrets: Default::default(),
}
}
}
///`UpdateInventoryRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "price_cents"
/// ],
/// "properties": {
/// "is_active": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "price_cents": {
/// "type": "integer",
/// "format": "int64"
/// },
/// "stock_quantity": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateInventoryRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub is_active: ::std::option::Option<bool>,
pub price_cents: i64,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub stock_quantity: ::std::option::Option<i32>,
}
///`UpdateMemberRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "billing_account_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "role": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "status": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateMemberRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub billing_account_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub role: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub status: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for UpdateMemberRequest {
fn default() -> Self {
Self {
billing_account_id: Default::default(),
role: Default::default(),
status: Default::default(),
}
}
}
///`UpdateOrganizationRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "description": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "parent_id": {
/// "description": "Move the org under a new parent (re-parent). When present and different from the current\nparent, the org (and its whole subtree) is moved under `parent_id`. Requires `admin` on the\ndestination parent (or an ancestor) in addition to `update_orgs` on the org being moved.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateOrganizationRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<LocalizedString>,
/**Move the org under a new parent (re-parent). When present and different from the current
parent, the org (and its whole subtree) is moved under `parent_id`. Requires `admin` on the
destination parent (or an ancestor) in addition to `update_orgs` on the org being moved.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub parent_id: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for UpdateOrganizationRequest {
fn default() -> Self {
Self {
description: Default::default(),
name: Default::default(),
parent_id: Default::default(),
}
}
}
///`UpdatePolicyRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "capability": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "config": {
/// "description": "Omitted preserves the current config; explicit JSON null is rejected rather than\nbeing silently treated as an omitted field.",
/// "type": [
/// "object",
/// "null"
/// ]
/// },
/// "enabled": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "enforcement": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdatePolicyRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub capability: ::std::option::Option<::std::string::String>,
/**Omitted preserves the current config; explicit JSON null is rejected rather than
being silently treated as an omitted field.*/
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub config:
::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub enabled: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub enforcement: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for UpdatePolicyRequest {
fn default() -> Self {
Self {
capability: Default::default(),
config: Default::default(),
enabled: Default::default(),
enforcement: Default::default(),
}
}
}
///`UpdateStoreRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "name"
/// ],
/// "properties": {
/// "branding_overrides": {
/// "type": [
/// "object",
/// "null"
/// ]
/// },
/// "currency": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "timezone": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateStoreRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub branding_overrides:
::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub currency: ::std::option::Option<::std::string::String>,
pub name: LocalizedString,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub timezone: ::std::option::Option<::std::string::String>,
}
///`UpdateUserRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "email": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "phone": {
/// "$ref": "#/components/schemas/PhonePatch"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateUserRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub email: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone: ::std::option::Option<PhonePatch>,
}
impl ::std::default::Default for UpdateUserRequest {
fn default() -> Self {
Self {
email: Default::default(),
id: Default::default(),
name: Default::default(),
phone: Default::default(),
}
}
}
///`UpdateWebhookRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "description": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "enabled": {
/// "type": [
/// "boolean",
/// "null"
/// ]
/// },
/// "event_types": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "url": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateWebhookRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub enabled: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub event_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub url: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for UpdateWebhookRequest {
fn default() -> Self {
Self {
description: Default::default(),
enabled: Default::default(),
event_types: Default::default(),
url: Default::default(),
}
}
}
///`UpdateZoneRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "properties": {
/// "external_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LocalizedString"
/// }
/// ]
/// }
/// ]
/// },
/// "parent_zone_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
pub struct UpdateZoneRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub name: ::std::option::Option<LocalizedString>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub parent_zone_id: ::std::option::Option<::std::string::String>,
}
impl ::std::default::Default for UpdateZoneRequest {
fn default() -> Self {
Self {
external_id: Default::default(),
name: Default::default(),
parent_zone_id: Default::default(),
}
}
}
/**The actor behind a usage entry. Registered users and guests are kept in disjoint fields so the
(spoofable) guest fingerprint is never confused with a trusted user identity by the client.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The actor behind a usage entry. Registered users and guests are kept in disjoint fields so the\n(spoofable) guest fingerprint is never confused with a trusted user identity by the client.",
/// "type": "object",
/// "required": [
/// "kind"
/// ],
/// "properties": {
/// "guest_id": {
/// "description": "Per-device guest fingerprint. Present only when `kind == \"guest\"`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "kind": {
/// "description": "`user`, `guest`, `system`, `api_key`, … (mirrors `audit_events.actor_kind`).",
/// "type": "string"
/// },
/// "user_id": {
/// "description": "Trusted registered-user id. Present only when `kind == \"user\"`.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UsageActor {
///Per-device guest fingerprint. Present only when `kind == "guest"`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub guest_id: ::std::option::Option<::std::string::String>,
///`user`, `guest`, `system`, `api_key`, … (mirrors `audit_events.actor_kind`).
pub kind: ::std::string::String,
///Trusted registered-user id. Present only when `kind == "user"`.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub user_id: ::std::option::Option<::std::string::String>,
}
///A provisioned user (identity) in the system.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A provisioned user (identity) in the system.",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ResourceLifecycle"
/// },
/// {
/// "type": "object",
/// "required": [
/// "email",
/// "id",
/// "name"
/// ],
/// "properties": {
/// "email": {
/// "description": "Email address (used for login and provisioning). May be an internal placeholder when no verified email is available.",
/// "type": "string"
/// },
/// "id": {
/// "description": "Unique identifier (ULID).",
/// "type": "string"
/// },
/// "merged_into_user_id": {
/// "description": "When set, this row was absorbed into another user. Follow for live identity.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "phone": {
/// "description": "Verified E.164 phone when set.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "phone_verified_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct User {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Email address (used for login and provisioning). May be an internal placeholder when no verified email is available.
pub email: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Unique identifier (ULID).
pub id: ::std::string::String,
///When set, this row was absorbed into another user. Follow for live identity.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub merged_into_user_id: ::std::option::Option<::std::string::String>,
pub name: LocalizedString,
///Verified E.164 phone when set.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone_verified_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
///`UserInvitationDto`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "channel",
/// "created_at",
/// "default_roles",
/// "expires_at",
/// "id",
/// "invited_by_user_id",
/// "org_id",
/// "sent_count",
/// "status"
/// ],
/// "properties": {
/// "accepted_user_id": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "channel": {
/// "description": "`sms`, `email`, or `both`.",
/// "type": "string"
/// },
/// "created_at": {
/// "type": "string"
/// },
/// "default_roles": {
/// "type": "array",
/// "items": {
/// "type": "string"
/// }
/// },
/// "email": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "expires_at": {
/// "type": "string"
/// },
/// "id": {
/// "type": "string"
/// },
/// "invited_by_user_id": {
/// "type": "string"
/// },
/// "last_sent_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "phone": {
/// "description": "SMS recipient when the invite includes a phone (E.164).",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "sent_count": {
/// "type": "integer",
/// "format": "int32"
/// },
/// "site_access": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/InvitationSiteAccessDto"
/// }
/// ]
/// }
/// ]
/// },
/// "status": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UserInvitationDto {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub accepted_user_id: ::std::option::Option<::std::string::String>,
///`sms`, `email`, or `both`.
pub channel: ::std::string::String,
pub created_at: ::std::string::String,
pub default_roles: ::std::vec::Vec<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub email: ::std::option::Option<::std::string::String>,
pub expires_at: ::std::string::String,
pub id: ::std::string::String,
pub invited_by_user_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_sent_at: ::std::option::Option<::std::string::String>,
pub org_id: ::std::string::String,
///SMS recipient when the invite includes a phone (E.164).
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone: ::std::option::Option<::std::string::String>,
pub sent_count: i32,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub site_access: ::std::option::Option<InvitationSiteAccessDto>,
pub status: ::std::string::String,
}
///`UserResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/User"
/// },
/// {
/// "type": "object",
/// "required": [
/// "email_is_synthetic",
/// "roles"
/// ],
/// "properties": {
/// "email_is_synthetic": {
/// "description": "True when `email` is an internal placeholder (phone-only account or identity-provider merge claimant) and must not be shown as a mailbox.",
/// "type": "boolean"
/// },
/// "roles": {
/// "type": "object",
/// "additionalProperties": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/Role"
/// }
/// }
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct UserResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Email address (used for login and provisioning). May be an internal placeholder when no verified email is available.
pub email: ::std::string::String,
///True when `email` is an internal placeholder (phone-only account or identity-provider merge claimant) and must not be shown as a mailbox.
pub email_is_synthetic: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Unique identifier (ULID).
pub id: ::std::string::String,
///When set, this row was absorbed into another user. Follow for live identity.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub merged_into_user_id: ::std::option::Option<::std::string::String>,
pub name: LocalizedString,
///Verified E.164 phone when set.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub phone_verified_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
pub roles: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<Role>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
///`VirtualAccessOpenResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "ok"
/// ],
/// "properties": {
/// "door_auto_close_duration": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "door_open_duration_seconds": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int64",
/// "minimum": 0.0
/// },
/// "lights_auto_off_duration": {
/// "oneOf": [
/// {
/// "type": "null"
/// },
/// {
/// "oneOf": [
/// {
/// "$ref": "#/components/schemas/LightsAutoOffDuration"
/// }
/// ]
/// }
/// ]
/// },
/// "ok": {
/// "type": "boolean"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct VirtualAccessOpenResponse {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub door_auto_close_duration: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub door_open_duration_seconds: ::std::option::Option<i64>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub lights_auto_off_duration: ::std::option::Option<LightsAutoOffDuration>,
pub ok: bool,
}
///`WaveshareConnectionConfig`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "mqtt_client_id",
/// "mqtt_password",
/// "mqtt_publish_topic",
/// "mqtt_subscribe_topic",
/// "mqtt_username"
/// ],
/// "properties": {
/// "mqtt_client_id": {
/// "type": "string"
/// },
/// "mqtt_password": {
/// "type": "string"
/// },
/// "mqtt_publish_topic": {
/// "type": "string"
/// },
/// "mqtt_subscribe_topic": {
/// "type": "string"
/// },
/// "mqtt_username": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WaveshareConnectionConfig {
pub mqtt_client_id: ::std::string::String,
pub mqtt_password: ::std::string::String,
pub mqtt_publish_topic: ::std::string::String,
pub mqtt_subscribe_topic: ::std::string::String,
pub mqtt_username: ::std::string::String,
}
///`WaveshareProvisioningDiffEntry`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "current",
/// "key",
/// "stored"
/// ],
/// "properties": {
/// "current": {
/// "type": "string"
/// },
/// "key": {
/// "type": "string"
/// },
/// "stored": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WaveshareProvisioningDiffEntry {
pub current: ::std::string::String,
pub key: ::std::string::String,
pub stored: ::std::string::String,
}
///`WaveshareProvisioningStatusResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "current",
/// "diff",
/// "stale",
/// "stored"
/// ],
/// "properties": {
/// "current": {
/// "$ref": "#/components/schemas/WaveshareConnectionConfig"
/// },
/// "diff": {
/// "type": "array",
/// "items": {
/// "$ref": "#/components/schemas/WaveshareProvisioningDiffEntry"
/// }
/// },
/// "stale": {
/// "type": "boolean"
/// },
/// "stored": {
/// "$ref": "#/components/schemas/WaveshareConnectionConfig"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WaveshareProvisioningStatusResponse {
pub current: WaveshareConnectionConfig,
pub diff: ::std::vec::Vec<WaveshareProvisioningDiffEntry>,
pub stale: bool,
pub stored: WaveshareConnectionConfig,
}
///`WebhookEndpoint`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "enabled",
/// "id",
/// "org_id",
/// "url"
/// ],
/// "properties": {
/// "created_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "description": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "enabled": {
/// "type": "boolean"
/// },
/// "event_types": {
/// "type": [
/// "array",
/// "null"
/// ],
/// "items": {
/// "type": "string"
/// }
/// },
/// "id": {
/// "type": "string"
/// },
/// "last_delivery_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "last_delivery_status": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "org_id": {
/// "type": "string"
/// },
/// "updated_at": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "url": {
/// "type": "string"
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookEndpoint {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<::std::string::String>,
pub enabled: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub event_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_delivery_at: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub last_delivery_status: ::std::option::Option<::std::string::String>,
pub org_id: ::std::string::String,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::std::string::String>,
pub url: ::std::string::String,
}
///`WebhookTestResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "delivered"
/// ],
/// "properties": {
/// "delivered": {
/// "type": "boolean"
/// },
/// "error": {
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "status_code": {
/// "type": [
/// "integer",
/// "null"
/// ],
/// "format": "int32",
/// "minimum": 0.0
/// }
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct WebhookTestResponse {
pub delivered: bool,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub error: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub status_code: ::std::option::Option<i32>,
}
/**A logical or physical space (recursive for hierarchy).
Example: Floor 1 > Living Room > TV Nook*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "A logical or physical space (recursive for hierarchy).\n\nExample: Floor 1 > Living Room > TV Nook",
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/ResourceLifecycle"
/// },
/// {
/// "type": "object",
/// "required": [
/// "id",
/// "integration_id",
/// "name"
/// ],
/// "properties": {
/// "external_id": {
/// "description": "External ID from the integration.",
/// "type": [
/// "string",
/// "null"
/// ]
/// },
/// "id": {
/// "description": "Unique identifier (ULID).",
/// "type": "string"
/// },
/// "integration_id": {
/// "description": "Integration this zone belongs to.",
/// "type": "string"
/// },
/// "name": {
/// "$ref": "#/components/schemas/LocalizedString"
/// },
/// "parent_zone_id": {
/// "description": "Parent zone for hierarchy.",
/// "type": [
/// "string",
/// "null"
/// ]
/// }
/// }
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
pub struct Zone {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub created_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub deleted_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///External ID from the integration.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub external_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub hard_delete_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
///Unique identifier (ULID).
pub id: ::std::string::String,
///Integration this zone belongs to.
pub integration_id: ::std::string::String,
pub name: LocalizedString,
///Parent zone for hierarchy.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub parent_zone_id: ::std::option::Option<::std::string::String>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub purge_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub updated_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
}
///`ZoneResponse`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "allOf": [
/// {
/// "$ref": "#/components/schemas/Zone"
/// }
/// ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct ZoneResponse(pub Zone);
impl ::std::ops::Deref for ZoneResponse {
type Target = Zone;
fn deref(&self) -> &Zone {
&self.0
}
}
impl ::std::convert::From<ZoneResponse> for Zone {
fn from(value: ZoneResponse) -> Self {
value.0
}
}
impl ::std::convert::From<Zone> for ZoneResponse {
fn from(value: Zone) -> Self {
Self(value)
}
}
}
#[derive(Clone, Debug)]
/**Client for OpenApp API
IoT Device Management (Gates/Doors/Provisioning) API
Version: v1*/
pub struct Client {
pub(crate) baseurl: String,
pub(crate) client: reqwest::Client,
}
impl Client {
/// Create a new client.
///
/// `baseurl` is the base URL provided to the internal
/// `reqwest::Client`, and should include a scheme and hostname,
/// as well as port and a path stem if applicable.
pub fn new(baseurl: &str) -> Self {
#[cfg(not(target_arch = "wasm32"))]
let client = {
let dur = ::std::time::Duration::from_secs(15u64);
reqwest::ClientBuilder::new()
.connect_timeout(dur)
.timeout(dur)
};
#[cfg(target_arch = "wasm32")]
let client = reqwest::ClientBuilder::new();
Self::new_with_client(baseurl, client.build().unwrap())
}
/// Construct a new client with an existing `reqwest::Client`,
/// allowing more control over its configuration.
///
/// `baseurl` is the base URL provided to the internal
/// `reqwest::Client`, and should include a scheme and hostname,
/// as well as port and a path stem if applicable.
pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self {
Self {
baseurl: baseurl.to_string(),
client,
}
}
}
impl ClientInfo<()> for Client {
fn api_version() -> &'static str {
"v1"
}
fn baseurl(&self) -> &str {
self.baseurl.as_str()
}
fn client(&self) -> &reqwest::Client {
&self.client
}
fn inner(&self) -> &() {
&()
}
}
impl ClientHooks<()> for &Client {}
#[allow(clippy::all)]
impl Client {
/**Sends a `GET` request to `/.well-known/oauth-protected-resource`
*/
pub async fn oauth_protected_resource<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>> {
let url = format!("{}/.well-known/oauth-protected-resource", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.get(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "oauth_protected_resource",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/admin/quota_overrides`
*/
pub async fn get_admin_quota_overrides<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>> {
let url = format!("{}/admin/quota_overrides", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.get(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "get_admin_quota_overrides",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/admin/quota_overrides`
*/
pub async fn post_admin_quota_override<'a>(
&'a self,
body: &'a types::QuotaOverrideRequest,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!("{}/admin/quota_overrides", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_admin_quota_override",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/agents`
Arguments:
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
*/
pub async fn list_agents<'a>(
&'a self,
limit: Option<i32>,
offset: Option<i32>,
) -> Result<ResponseValue<types::PaginatedResponseAgentResponse>, Error<()>> {
let url = format!("{}/agents", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_agents",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/agents`
*/
pub async fn create_agent<'a>(
&'a self,
body: &'a types::CreateAgentRequest,
) -> Result<ResponseValue<types::AgentResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/agents", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_agent",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/agents/{id}`
*/
pub async fn get_agent<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::AgentResponse>, Error<()>> {
let url = format!("{}/agents/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_agent",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/agents/{id}`
*/
pub async fn revoke_agent<'a>(&'a self, id: &'a str) -> Result<ResponseValue<()>, Error<()>> {
let url = format!("{}/agents/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "revoke_agent",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PATCH` request to `/agents/{id}`
*/
pub async fn update_agent<'a>(
&'a self,
id: &'a str,
body: &'a types::UpdateAgentRequest,
) -> Result<ResponseValue<types::AgentResponse>, Error<()>> {
let url = format!("{}/agents/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_agent",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/agents/{id}/credentials`
*/
pub async fn create_agent_credential<'a>(
&'a self,
id: &'a str,
body: &'a types::CreateAgentCredentialRequest,
) -> Result<ResponseValue<types::CreateAgentCredentialResponse>, Error<()>> {
let url = format!(
"{}/agents/{}/credentials",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_agent_credential",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Translate localized content via AI. Quota: consumes 1 from `ai_requests` (unit: count, per day and per month).
Sends a `POST` request to `/ai/translate-locale-content`
*/
pub async fn post_ai_translate_locale_content<'a>(
&'a self,
x_org: &'a str,
body: &'a types::TranslateLocaleContentRequest,
) -> Result<ResponseValue<types::TranslateLocaleContentResponse>, Error<()>> {
let url = format!("{}/ai/translate-locale-content", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_ai_translate_locale_content",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
429u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
502u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
503u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/api-keys`
Arguments:
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
*/
pub async fn list_api_keys<'a>(
&'a self,
limit: Option<i32>,
offset: Option<i32>,
) -> Result<ResponseValue<types::PaginatedResponseApiKeyListItem>, Error<()>> {
let url = format!("{}/api-keys", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_api_keys",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Mint an API key. Quota: consumes 1 from `api_keys` (unit: count, lifetime capacity) — capacity-checked before creation (429 `quota_exceeded` when full).
Sends a `POST` request to `/api-keys`
*/
pub async fn create_api_key<'a>(
&'a self,
body: &'a types::CreateApiKeyRequest,
) -> Result<ResponseValue<types::CreateApiKeyResponse>, Error<()>> {
let url = format!("{}/api-keys", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_api_key",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/api-keys/{id}`
Arguments:
- `id`: API key ID
*/
pub async fn revoke_api_key<'a>(&'a self, id: &'a str) -> Result<ResponseValue<()>, Error<()>> {
let url = format!("{}/api-keys/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "revoke_api_key",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PATCH` request to `/api-keys/{id}`
Arguments:
- `id`: API key ID
- `body`
*/
pub async fn update_api_key<'a>(
&'a self,
id: &'a str,
body: &'a types::UpdateApiKeyRequest,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!("{}/api-keys/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_api_key",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/api-keys/{id}/purge`
Arguments:
- `id`: API key ID
*/
pub async fn purge_api_key<'a>(&'a self, id: &'a str) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/api-keys/{}/purge",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "purge_api_key",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/api-keys/{id}/restore`
Arguments:
- `id`: API key ID
*/
pub async fn restore_api_key<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/api-keys/{}/restore",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.post(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "restore_api_key",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List devices for the organization context (X-Org)
Sends a `GET` request to `/devices`
Arguments:
- `device_kind`: Optional filter: only devices with metadata.kind equal to this value (e.g. virtual_access_portal).
Requires integration_id. Filtering done at SQL level.
- `external_id`: Optional filter: only devices with this external_id. Requires integration_id and device_kind.
Returns at most 1 device. Filtering done at SQL level.
- `has_external_id`: When true, only devices with a non-empty `external_id`. Requires `integration_id`.
- `has_go2rtc_channel`: When true, only devices whose metadata JSON has a non-empty `channel` (go2rtc cameras). Requires `integration_id`.
- `include_deleted`
- `include_stale`: When true with `integration_id`, include `stale` per device when the provider supports it.
- `integration_id`: Optional filter: only devices belonging to this integration.
- `limit`: Number of items per page. Default from config, max 200.
- `locale`: Locale used to resolve the localized `name` when sorting by name (e.g. `en`). Defaults to `en`.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
- `q`: Case-insensitive substring match on localized device name (JSON). Best-effort when `integration_id` is set (SQL ILIKE).
- `sort`: Server-side ordering for org-wide lists: `name:asc`, `name:desc`, `created_at:asc`, `created_at:desc`.
Ignored when `integration_id` is set. Defaults to insertion order when omitted.
- `x_org`
*/
pub async fn list_devices<'a>(
&'a self,
device_kind: Option<&'a str>,
external_id: Option<&'a str>,
has_external_id: Option<bool>,
has_go2rtc_channel: Option<bool>,
include_deleted: Option<bool>,
include_stale: Option<bool>,
integration_id: Option<&'a str>,
limit: Option<i32>,
locale: Option<&'a str>,
offset: Option<i32>,
only_deleted: Option<bool>,
q: Option<&'a str>,
sort: Option<&'a str>,
x_org: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::DeviceResponse>>, Error<types::ApiErrorResponse>>
{
let url = format!("{}/devices", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"device_kind",
&device_kind,
))
.query(&progenitor_client::QueryParam::new(
"external_id",
&external_id,
))
.query(&progenitor_client::QueryParam::new(
"has_external_id",
&has_external_id,
))
.query(&progenitor_client::QueryParam::new(
"has_go2rtc_channel",
&has_go2rtc_channel,
))
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new(
"include_stale",
&include_stale,
))
.query(&progenitor_client::QueryParam::new(
"integration_id",
&integration_id,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("locale", &locale))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new(
"only_deleted",
&only_deleted,
))
.query(&progenitor_client::QueryParam::new("q", &q))
.query(&progenitor_client::QueryParam::new("sort", &sort))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_devices",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Create a device in an organization
Create a device. Quota: consumes 1 from `devices` (unit: count, lifetime capacity) — capacity-checked before creation (429 `quota_exceeded` when full).
Sends a `POST` request to `/devices`
Arguments:
- `include_deleted`
- `x_org`: Organization context (required)
- `body`
*/
pub async fn create_device<'a>(
&'a self,
include_deleted: Option<bool>,
x_org: &'a str,
body: &'a types::CreateDeviceRequest,
) -> Result<ResponseValue<types::DeviceResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/devices", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_device",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Read the directory configuration
Sends a `GET` request to `/devices/{device_id}/directory`
*/
pub async fn get_directory_config<'a>(
&'a self,
device_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::DirectoryConfigResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/directory",
self.baseurl,
encode_path(&device_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_directory_config",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Update the directory configuration. This is the disable switch for the intercom
Sends a `PUT` request to `/devices/{device_id}/directory`
*/
pub async fn update_directory_config<'a>(
&'a self,
device_id: &'a str,
x_org: &'a str,
body: &'a types::UpdateDirectoryConfigPayload,
) -> Result<ResponseValue<types::DirectoryConfigResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/directory",
self.baseurl,
encode_path(&device_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_directory_config",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/devices/{device_id}/directory-floors`
*/
pub async fn list_device_directory_floors<'a>(
&'a self,
device_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::DirectoryFloorListResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/devices/{}/directory-floors",
self.baseurl,
encode_path(&device_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_device_directory_floors",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Apply a generation. Idempotent: re-running converges rather than duplicating
Sends a `POST` request to `/devices/{device_id}/directory-listings/apply`
*/
pub async fn apply_directory_listings<'a>(
&'a self,
device_id: &'a str,
x_org: &'a str,
body: &'a types::GenerateListingsPayload,
) -> Result<ResponseValue<types::GeneratePlanResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/directory-listings/apply",
self.baseurl,
encode_path(&device_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "apply_directory_listings",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Preview a generation without writing anything
Sends a `POST` request to `/devices/{device_id}/directory-listings/plan`
*/
pub async fn plan_directory_listings<'a>(
&'a self,
device_id: &'a str,
x_org: &'a str,
body: &'a types::GenerateListingsPayload,
) -> Result<ResponseValue<types::GeneratePlanResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/directory-listings/plan",
self.baseurl,
encode_path(&device_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "plan_directory_listings",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List entities for a device
Sends a `GET` request to `/devices/{device_id}/entities`
Arguments:
- `device_id`
- `entity_type`: When set, only entities of this type are returned (e.g. `directory_listing`).
- `include_deleted`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
- `x_org`
*/
pub async fn list_device_entities<'a>(
&'a self,
device_id: &'a str,
entity_type: Option<&'a str>,
include_deleted: Option<bool>,
limit: Option<i32>,
offset: Option<i32>,
only_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/devices/{}/entities",
self.baseurl,
encode_path(&device_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"entity_type",
&entity_type,
))
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new(
"only_deleted",
&only_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_device_entities",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get provider-specific JSON schema for `entity_metadata`, for creating a new entity on a device
Sends a `GET` request to `/devices/{device_id}/entities/metadata-definition`
*/
pub async fn get_device_entity_metadata_definition<'a>(
&'a self,
device_id: &'a str,
entity_type: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::EntityMetadataDefinitionResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/entities/metadata-definition",
self.baseurl,
encode_path(&device_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"entity_type",
&entity_type,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_device_entity_metadata_definition",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get a device by ID
Sends a `GET` request to `/devices/{id}`
Arguments:
- `id`: Device ULID
- `include_deleted`
- `include_stale`: When true, include `stale` if the integration provider supports stale device detection.
- `x_org`
*/
pub async fn get_device<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
include_stale: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::DeviceResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/devices/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new(
"include_stale",
&include_stale,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_device",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Update a device
Sends a `PUT` request to `/devices/{id}`
*/
pub async fn update_device<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
body: &'a types::UpdateDeviceRequest,
) -> Result<ResponseValue<types::DeviceResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/devices/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_device",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Soft-delete a device
Sends a `DELETE` request to `/devices/{id}`
Arguments:
- `id`
- `include_deleted`
- `recursive`: If true, delete (or purge) all device entities first.
- `x_org`
*/
pub async fn delete_device<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
recursive: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::DeviceResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/devices/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new("recursive", &recursive))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_device",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Refresh the provider-reported channel count for one linked device
Sends a `POST` request to `/devices/{id}/channel-count/refresh`
*/
pub async fn post_refresh_device_channel_count<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<::serde_json::Value>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/devices/{}/channel-count/refresh",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_refresh_device_channel_count",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
501u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
502u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**GET /devices/{id}/door-restrictions — list listing entity IDs allowed to open this door.
Empty = no restrictions (all building members can open). Only for virtual_access_portal devices
Sends a `GET` request to `/devices/{id}/door-restrictions`
*/
pub async fn get_door_restrictions<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::DoorRestrictionsResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/door-restrictions",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_door_restrictions",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**PUT /devices/{id}/door-restrictions — set which listings can open this door.
Empty array = no restrictions (all building residents). Only for virtual_access_portal devices
Sends a `PUT` request to `/devices/{id}/door-restrictions`
*/
pub async fn put_door_restrictions<'a>(
&'a self,
id: &'a str,
body: &'a types::SetDoorRestrictionsPayload,
) -> Result<ResponseValue<types::DoorRestrictionsResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/door-restrictions",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "put_door_restrictions",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/devices/{id}/hold`
*/
pub async fn get_device_hold<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::DoorHoldResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/devices/{}/hold",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_device_hold",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PUT` request to `/devices/{id}/hold`
*/
pub async fn put_device_hold<'a>(
&'a self,
id: &'a str,
body: &'a types::PutHoldRequest,
) -> Result<ResponseValue<types::DoorHoldResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/devices/{}/hold",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "put_device_hold",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/devices/{id}/image`
*/
pub async fn get_device_image<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_device_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/devices/{id}/image`
*/
pub async fn post_device_image<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_device_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
415u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/devices/{id}/image`
*/
pub async fn delete_device_image<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/devices/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_device_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/devices/{id}/image/copy-from`
*/
pub async fn post_device_image_copy_from<'a>(
&'a self,
id: &'a str,
body: &'a types::CopyDeviceImageRequest,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/image/copy-from",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_device_image_copy_from",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get provider-specific JSON schema for `device_metadata`, for a given device
Sends a `GET` request to `/devices/{id}/metadata-definition`
*/
pub async fn get_device_metadata_definition<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::DeviceMetadataDefinitionResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/metadata-definition",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_device_metadata_definition",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Permanently delete (purge) a device
Sends a `DELETE` request to `/devices/{id}/purge`
Arguments:
- `id`
- `include_deleted`
- `recursive`: If true, delete (or purge) all device entities first.
- `x_org`
*/
pub async fn hard_delete_device<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
recursive: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::DeviceResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/devices/{}/purge",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new("recursive", &recursive))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "hard_delete_device",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Restore a soft-deleted device
Sends a `POST` request to `/devices/{id}/restore`
*/
pub async fn restore_device<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::DeviceResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/devices/{}/restore",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "restore_device",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/devices/{id}/tasmota/provision-lan`
*/
pub async fn post_tasmota_provision_lan<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: &'a types::TasmotaLanProvisionRequest,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/devices/{}/tasmota/provision-lan",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_tasmota_provision_lan",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/devices/{id}/tasmota/provisioning`
*/
pub async fn get_tasmota_provisioning<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::TasmotaProvisioningResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/tasmota/provisioning",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_tasmota_provisioning",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/devices/{id}/tasmota/rotate-credentials`
*/
pub async fn post_tasmota_rotate_credentials<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::TasmotaProvisioningResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/tasmota/rotate-credentials",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_tasmota_rotate_credentials",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**POST /devices/{id}/virtual-access/open — open all configured openers on a portal device
Sends a `POST` request to `/devices/{id}/virtual-access/open`
*/
pub async fn post_virtual_access_open<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::VirtualAccessOpenResponse>, Error<()>> {
let url = format!(
"{}/devices/{}/virtual-access/open",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_virtual_access_open",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
429u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
502u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/entities`
Arguments:
- `include_deleted`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
- `q`: Case-insensitive substring match on entity `name` (plain text). Applies to org-wide lists.
- `sort`: Server-side ordering for org-wide lists: `name:asc`, `name:desc`, `created_at:asc`, `created_at:desc`.
Ignored when `zone_id` is set. Defaults to insertion order when omitted.
- `zone_id`: Optional filter: only entities in this zone.
- `x_org`
*/
pub async fn list_entities<'a>(
&'a self,
include_deleted: Option<bool>,
limit: Option<i32>,
offset: Option<i32>,
only_deleted: Option<bool>,
q: Option<&'a str>,
sort: Option<&'a str>,
zone_id: Option<&'a str>,
x_org: &'a str,
) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/entities", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new(
"only_deleted",
&only_deleted,
))
.query(&progenitor_client::QueryParam::new("q", &q))
.query(&progenitor_client::QueryParam::new("sort", &sort))
.query(&progenitor_client::QueryParam::new("zone_id", &zone_id))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_entities",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Create an entity on a device
Create an entity. Quota: consumes 1 from `entities` (unit: count, lifetime capacity) — capacity-checked before creation, so a full quota returns 429 `quota_exceeded`.
Sends a `POST` request to `/entities`
*/
pub async fn create_entity<'a>(
&'a self,
include_deleted: Option<bool>,
x_org: &'a str,
body: &'a types::CreateEntityRequest,
) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/entities", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_entity",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get an entity by ID
Sends a `GET` request to `/entities/{id}`
*/
pub async fn get_entity<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/entities/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_entity",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Update an entity
Sends a `PUT` request to `/entities/{id}`
*/
pub async fn update_entity<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
body: &'a types::UpdateEntityRequest,
) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/entities/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_entity",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Soft-delete an entity
Sends a `DELETE` request to `/entities/{id}`
*/
pub async fn delete_entity<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/entities/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_entity",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Partially update entity metadata (shallow merge). Other fields (`name`, etc.) are unchanged
Sends a `PATCH` request to `/entities/{id}`
*/
pub async fn patch_entity<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
body: &'a types::PatchEntityRequest,
) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/entities/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "patch_entity",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Execute an entity action using the integration engine
Execute an entity action. Quota: a `switchable.open` (door open) consumes 1 from `door_opens` (unit: count, per day and per month); when invoked via an API key it additionally consumes 1 from `voice_invocations` (unit: count, per day). When the org is over capacity, a degraded open may be delayed (the response carries a `degradation` warning) but is never blocked. An applicable `require_step_up` policy requires a prior authenticated preview or confirmation response; retry the same org, principal, entity, action, and JSON payload with its short-lived, single-use value in `X-OpenApp-Confirm`. The proof expires after 10 minutes and is not a separate second factor. Agents should also send `Idempotency-Key`. Success JSON includes `correlation_id`.
Sends a `POST` request to `/entities/{id}/actions/{action_id}`
*/
pub async fn execute_entity_action<'a>(
&'a self,
id: &'a str,
action_id: &'a str,
body: &'a ::serde_json::Value,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/entities/{}/actions/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&action_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "execute_entity_action",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
429u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
501u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Preview an entity action (Cedar + policies, no hardware call)
Sends a `POST` request to `/entities/{id}/actions/{action_id}/preview`
*/
pub async fn preview_entity_action<'a>(
&'a self,
id: &'a str,
action_id: &'a str,
body: &'a ::serde_json::Value,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/entities/{}/actions/{}/preview",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&action_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "preview_entity_action",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List members for a directory listing
Sends a `GET` request to `/entities/{id}/directory-listing-members`
*/
pub async fn list_directory_listing_members<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<
ResponseValue<::std::vec::Vec<types::DirectoryListingMemberWithUserResponse>>,
Error<()>,
> {
let url = format!(
"{}/entities/{}/directory-listing-members",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_directory_listing_members",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Add a member to a directory listing
Sends a `POST` request to `/entities/{id}/directory-listing-members`
*/
pub async fn add_directory_listing_member<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: &'a types::AddDirectoryListingMemberPayload,
) -> Result<ResponseValue<types::DirectoryListingMemberResponse>, Error<()>> {
let url = format!(
"{}/entities/{}/directory-listing-members",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "add_directory_listing_member",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Update a member's role or receives_calls
Sends a `PUT` request to `/entities/{id}/directory-listing-members/{member_id}`
*/
pub async fn update_directory_listing_member<'a>(
&'a self,
id: &'a str,
member_id: &'a str,
x_org: &'a str,
body: &'a types::UpdateDirectoryListingMemberPayload,
) -> Result<ResponseValue<types::DirectoryListingMemberResponse>, Error<()>> {
let url = format!(
"{}/entities/{}/directory-listing-members/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&member_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_directory_listing_member",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Remove a member from a directory listing
Sends a `DELETE` request to `/entities/{id}/directory-listing-members/{member_id}`
*/
pub async fn delete_directory_listing_member<'a>(
&'a self,
id: &'a str,
member_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/entities/{}/directory-listing-members/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&member_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_directory_listing_member",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/entities/{id}/hold`
*/
pub async fn get_entity_hold<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::HoldView>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/entities/{}/hold",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_entity_hold",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PUT` request to `/entities/{id}/hold`
*/
pub async fn put_entity_hold<'a>(
&'a self,
id: &'a str,
body: &'a types::PutHoldRequest,
) -> Result<ResponseValue<types::HoldView>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/entities/{}/hold",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "put_entity_hold",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/entities/{id}/image`
*/
pub async fn get_entity_image<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/entities/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_entity_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/entities/{id}/image`
*/
pub async fn post_entity_image<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/entities/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_entity_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
415u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/entities/{id}/image`
*/
pub async fn delete_entity_image<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/entities/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_entity_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/entities/{id}/image/copy-from`
*/
pub async fn post_entity_image_copy_from<'a>(
&'a self,
id: &'a str,
body: &'a types::CopyEntityImageRequest,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/entities/{}/image/copy-from",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_entity_image_copy_from",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get provider-specific JSON schema for `entity_metadata`, for a given entity
Sends a `GET` request to `/entities/{id}/metadata-definition`
*/
pub async fn get_entity_metadata_definition<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::EntityMetadataDefinitionResponse>, Error<()>> {
let url = format!(
"{}/entities/{}/metadata-definition",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_entity_metadata_definition",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Permanently delete (purge) an entity
Sends a `DELETE` request to `/entities/{id}/purge`
*/
pub async fn hard_delete_entity<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/entities/{}/purge",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "hard_delete_entity",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Restore a soft-deleted entity
Sends a `POST` request to `/entities/{id}/restore`
*/
pub async fn restore_entity<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::EntityResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/entities/{}/restore",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "restore_entity",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Redeem an offer, creating a pending link into the acting org
The link is pending rather than active: accepting a roster is a decision for the receiving org,
and it must admit the members before any of them grant access.
Sends a `POST` request to `/group-share-offers/redeem`
*/
pub async fn redeem_group_share_offer<'a>(
&'a self,
x_org: &'a str,
body: &'a types::RedeemGroupShareOfferPayload,
) -> Result<ResponseValue<types::GroupShareOfferResponse>, Error<()>> {
let url = format!("{}/group-share-offers/redeem", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "redeem_group_share_offer",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
202u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/groups/{group_id}/household-invitations`
*/
pub async fn list_manager<'a>(
&'a self,
group_id: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::HouseholdInvitationResponse>>, Error<()>> {
let url = format!(
"{}/groups/{}/household-invitations",
self.baseurl,
encode_path(&group_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_manager",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/groups/{group_id}/household-invitations`
*/
pub async fn create<'a>(
&'a self,
group_id: &'a str,
body: &'a types::CreateHouseholdInvitation,
) -> Result<ResponseValue<types::HouseholdInvitationResponse>, Error<()>> {
let url = format!(
"{}/groups/{}/household-invitations",
self.baseurl,
encode_path(&group_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/groups/{group_id}/household-invitations/{id}`
*/
pub async fn cancel<'a>(
&'a self,
group_id: &'a str,
id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/groups/{}/household-invitations/{}",
self.baseurl,
encode_path(&group_id.to_string()),
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "cancel",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/groups/{group_id}/household-invitations/{id}/resend`
*/
pub async fn resend<'a>(
&'a self,
group_id: &'a str,
id: &'a str,
) -> Result<ResponseValue<types::HouseholdInvitationResponse>, Error<()>> {
let url = format!(
"{}/groups/{}/household-invitations/{}/resend",
self.baseurl,
encode_path(&group_id.to_string()),
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "resend",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
429u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Read a group
Sends a `GET` request to `/groups/{id}`
*/
pub async fn get_group<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::GroupResponse>, Error<()>> {
let url = format!("{}/groups/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_group",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Update a group's name, description, kind, or shareable flag
Sends a `PUT` request to `/groups/{id}`
*/
pub async fn update_group<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: &'a types::UpdateGroupPayload,
) -> Result<ResponseValue<types::GroupResponse>, Error<()>> {
let url = format!("{}/groups/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_group",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Soft-delete a group owned by the acting organization
Sends a `DELETE` request to `/groups/{id}`
*/
pub async fn delete_group<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!("{}/groups/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_group",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**The admission ledger for a group in the acting org, including removed members
Sends a `GET` request to `/groups/{id}/admissions`
*/
pub async fn list_group_admissions<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::AdmissionResponse>>, Error<()>> {
let url = format!(
"{}/groups/{}/admissions",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_group_admissions",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Admit or deny one member of a linked group
Sends a `POST` request to `/groups/{id}/admissions/{member_ref}`
*/
pub async fn decide_group_admission<'a>(
&'a self,
id: &'a str,
member_ref: &'a str,
x_org: &'a str,
body: &'a types::AdmissionDecisionPayload,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/groups/{}/admissions/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&member_ref.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "decide_group_admission",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**A presigned URL for a group's photo, or 204 when it has none
Sends a `GET` request to `/groups/{id}/image`
*/
pub async fn get_group_image<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/groups/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_group_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Upload or replace a group's photo
Sends a `POST` request to `/groups/{id}/image`
*/
pub async fn post_group_image<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: String,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/groups/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.header(
::reqwest::header::CONTENT_TYPE,
::reqwest::header::HeaderValue::from_static("text/plain"),
)
.body(body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_group_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Remove a group's photo
Sends a `DELETE` request to `/groups/{id}/image`
*/
pub async fn delete_group_image<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/groups/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_group_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Links for one group, so an owner can see where their roster is in use
Sends a `GET` request to `/groups/{id}/links`
*/
pub async fn list_group_links<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::GroupLinkResponse>>, Error<()>> {
let url = format!(
"{}/groups/{}/links",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_group_links",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Change how this org admits a group's members, or re-sync a pinned link
Sends a `PUT` request to `/groups/{id}/links/{org_id}`
*/
pub async fn update_group_link<'a>(
&'a self,
id: &'a str,
org_id: &'a str,
x_org: &'a str,
body: &'a types::UpdateGroupLinkPayload,
) -> Result<ResponseValue<types::GroupLinkResponse>, Error<()>> {
let url = format!(
"{}/groups/{}/links/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_group_link",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Revoke a link. Either side may do this, so a household and a building can each walk away
Sends a `DELETE` request to `/groups/{id}/links/{org_id}`
*/
pub async fn revoke_group_link<'a>(
&'a self,
id: &'a str,
org_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/groups/{}/links/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "revoke_group_link",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Accept a pending proposal, which is how a resident's household becomes usable at a site
Sends a `POST` request to `/groups/{id}/links/{org_id}/accept`
*/
pub async fn accept_group_link<'a>(
&'a self,
id: &'a str,
org_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::GroupLinkResponse>, Error<()>> {
let url = format!(
"{}/groups/{}/links/{}/accept",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "accept_group_link",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List members as the acting org may see them: only admitted members appear
Sends a `GET` request to `/groups/{id}/members`
*/
pub async fn list_group_members<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::GroupMemberResponse>>, Error<()>> {
let url = format!(
"{}/groups/{}/members",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_group_members",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Add a member. Requires the home org, or being a manager of the group
Sends a `POST` request to `/groups/{id}/members`
*/
pub async fn add_group_member<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: &'a types::AddGroupMemberPayload,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/groups/{}/members",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "add_group_member",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Remove a member. Blocked when it would leave a linked group with no manager
Sends a `DELETE` request to `/groups/{id}/members/{member_ref}`
*/
pub async fn delete_group_member<'a>(
&'a self,
id: &'a str,
member_ref: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/groups/{}/members/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&member_ref.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_group_member",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Offer a group to another organization
Requires the group to be marked shareable, so a roster is never offered by accident. The token
is returned once and stored only as a hash.
Sends a `POST` request to `/groups/{id}/share-offers`
*/
pub async fn create_group_share_offer<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: &'a types::CreateGroupShareOfferPayload,
) -> Result<ResponseValue<types::GroupShareOfferResponse>, Error<()>> {
let url = format!(
"{}/groups/{}/share-offers",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_group_share_offer",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/household-invitations/preview`
*/
pub async fn preview<'a>(
&'a self,
body: &'a types::InvitationTokenRequest,
) -> Result<ResponseValue<types::HouseholdInvitationPreview>, Error<()>> {
let url = format!("{}/household-invitations/preview", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "preview",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/household-invitations/redeem`
*/
pub async fn redeem<'a>(
&'a self,
body: &'a types::RedeemHouseholdInvitationRequest,
) -> Result<ResponseValue<types::RedeemHouseholdInvitationResponse>, Error<()>> {
let url = format!("{}/household-invitations/redeem", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "redeem",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
410u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
422u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/integration-setup/v1/palgate/probe-linked-account`
*/
pub async fn post_palgate_probe_linked_account<'a>(
&'a self,
body: &'a types::PalgateProbeLinkedAccountRequest,
) -> Result<ResponseValue<types::PalgateProbeLinkedAccountResponse>, Error<()>> {
let url = format!(
"{}/integration-setup/v1/palgate/probe-linked-account",
self.baseurl,
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_palgate_probe_linked_account",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List integrations for the organization context (X-Org)
Sends a `GET` request to `/integrations`
Arguments:
- `include_deleted`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
- `provider_type`: Optional filter: only integrations with this provider_type (e.g. virtual_access).
- `q`: Optional case-insensitive substring match on integration `name` (localized JSON), same as devices list.
- `x_org`
*/
pub async fn list_integrations<'a>(
&'a self,
include_deleted: Option<bool>,
limit: Option<i32>,
offset: Option<i32>,
only_deleted: Option<bool>,
provider_type: Option<&'a str>,
q: Option<&'a str>,
x_org: &'a str,
) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/integrations", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new(
"only_deleted",
&only_deleted,
))
.query(&progenitor_client::QueryParam::new(
"provider_type",
&provider_type,
))
.query(&progenitor_client::QueryParam::new("q", &q))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integrations",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Create an integration in an organization
Create an integration. Quota: consumes 1 from `integrations` (unit: count, lifetime capacity) — capacity-checked before creation (429 `quota_exceeded` when full).
Sends a `POST` request to `/integrations`
*/
pub async fn create_integration<'a>(
&'a self,
include_deleted: Option<bool>,
x_org: &'a str,
body: &'a types::CreateIntegrationRequest,
) -> Result<ResponseValue<types::IntegrationResponse>, Error<()>> {
let url = format!("{}/integrations", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_integration",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get an access portal by ID. Resolves the portal's building (integration) for direct links
Sends a `GET` request to `/integrations/access-portals/{portal_id}`
*/
pub async fn get_access_portal_by_id<'a>(
&'a self,
portal_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::GetAccessPortalResponse>, Error<()>> {
let url = format!(
"{}/integrations/access-portals/{}",
self.baseurl,
encode_path(&portal_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_access_portal_by_id",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List supported integration provider types (canonical values)
Sends a `GET` request to `/integrations/provider-types`
*/
pub async fn list_integration_provider_types<'a>(
&'a self,
) -> Result<
ResponseValue<
::std::collections::HashMap<
::std::string::String,
::std::collections::HashMap<::std::string::String, ::std::string::String>,
>,
>,
Error<()>,
> {
let url = format!("{}/integrations/provider-types", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integration_provider_types",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get a provider definition (capabilities, actions, schemas) for UI/CLI
Sends a `GET` request to `/integrations/provider-types/{provider_type}/definition`
*/
pub async fn get_integration_provider_definition<'a>(
&'a self,
provider_type: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/integrations/provider-types/{}/definition",
self.baseurl,
encode_path(&provider_type.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.get(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "get_integration_provider_definition",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/integrations/{id}`
*/
pub async fn get_integration<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::IntegrationResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_integration",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Update an integration
Sends a `PUT` request to `/integrations/{id}`
*/
pub async fn update_integration<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
body: &'a types::UpdateIntegrationRequest,
) -> Result<ResponseValue<types::IntegrationResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_integration",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Hardware inventory for a virtual_access site
Sends a `GET` request to `/integrations/{id}/access-devices`
*/
pub async fn get_site_access_devices<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::SiteAccessDevicesResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/integrations/{}/access-devices",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_site_access_devices",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List access invites for an integration
Supports reconciliation by an external system of record: filtering by external source/record,
computed state, granted portal, and validity window. An `external_source` +
`external_record_id` pair is an indexed lookup, so an adapter that lost its local mapping can
recover a single invitation without scanning.
Sends a `GET` request to `/integrations/{id}/access-invites`
Arguments:
- `id`
- `external_record_id`: External record id to filter on. Requires `external_source`; the pair resolves to at most
one live invitation.
- `external_source`: External system slug to filter on (`external_ref.source`). Served by the external-reference
index, so an adapter can reconcile without keeping its own invite-id mapping.
- `kind`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `portal_id`: Only invitations granting this portal ULID.
- `state`: Computed state: `active`, `scheduled`, `expired`, `disabled`, or `revoked`.
- `valid_from_after`: Only invitations whose window starts at or after this RFC 3339 instant.
- `valid_to_before`: Only invitations whose window ends at or before this RFC 3339 instant.
- `x_org`
*/
pub async fn list_integration_access_invites<'a>(
&'a self,
id: &'a str,
external_record_id: Option<&'a str>,
external_source: Option<&'a str>,
kind: Option<&'a str>,
limit: Option<i32>,
offset: Option<i32>,
portal_id: Option<&'a str>,
state: Option<&'a str>,
valid_from_after: Option<&'a str>,
valid_to_before: Option<&'a str>,
x_org: &'a str,
) -> Result<
ResponseValue<types::PaginatedResponseAccessInviteListItem>,
Error<types::ApiErrorResponse>,
> {
let url = format!(
"{}/integrations/{}/access-invites",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"external_record_id",
&external_record_id,
))
.query(&progenitor_client::QueryParam::new(
"external_source",
&external_source,
))
.query(&progenitor_client::QueryParam::new("kind", &kind))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new("portal_id", &portal_id))
.query(&progenitor_client::QueryParam::new("state", &state))
.query(&progenitor_client::QueryParam::new(
"valid_from_after",
&valid_from_after,
))
.query(&progenitor_client::QueryParam::new(
"valid_to_before",
&valid_to_before,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integration_access_invites",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Create an access invite granting portal_open on one or more portals
Safe for at-least-once delivery from an external system of record:
* `Idempotency-Key` makes a retried create replay the original result instead of creating a
second invitation. The replayed body omits the one-time `invite_token` / `invite_url` and sets
`idempotent_replay`.
* `external_ref` binds the invitation to a record in the calling system. A second create for the
same record is rejected with `external_reference_conflict`; use the reconcile route to make an
existing invitation match a desired state.
* `X-Correlation-Id` (or `X-Request-Id`) is stored with the invitation and on every audit event
for the write, and echoed back on the response.
Sends a `POST` request to `/integrations/{id}/access-invites`
Arguments:
- `id`
- `idempotency_key`: Replay key; a retry with the same key and body returns the original result without creating a second invitation.
- `x_correlation_id`: Caller request id recorded with the invitation and its audit events.
- `x_org`
- `body`
*/
pub async fn create_integration_access_invite<'a>(
&'a self,
id: &'a str,
idempotency_key: Option<&'a str>,
x_correlation_id: Option<&'a str>,
x_org: &'a str,
body: &'a types::CreateAccessInviteRequest,
) -> Result<ResponseValue<types::CreateAccessInviteResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/integrations/{}/access-invites",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(4usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
if let Some(value) = idempotency_key {
header_map.append("Idempotency-Key", value.to_string().try_into()?);
}
if let Some(value) = x_correlation_id {
header_map.append("X-Correlation-Id", value.to_string().try_into()?);
}
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_integration_access_invite",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Validate a desired invitation without creating physical access
Runs exactly the validation, authorization, and policy evaluation that create runs, then stops
before the write. Nothing is persisted: no invitation row, no token, no location binding, and no
idempotency claim.
Sends a `POST` request to `/integrations/{id}/access-invites/preview`
Arguments:
- `id`
- `x_correlation_id`: Caller request id used for tracing this preview.
- `x_org`
- `body`
*/
pub async fn preview_integration_access_invite<'a>(
&'a self,
id: &'a str,
x_correlation_id: Option<&'a str>,
x_org: &'a str,
body: &'a types::CreateAccessInviteRequest,
) -> Result<ResponseValue<types::PreviewAccessInviteResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/integrations/{}/access-invites/preview",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
if let Some(value) = x_correlation_id {
header_map.append("X-Correlation-Id", value.to_string().try_into()?);
}
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "preview_integration_access_invite",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Make the invitation state for an external record equal a desired state
This is the operation a system of record needs: it addresses the invitation by
`external_ref`, so the caller never has to discover or store OpenApp invitation ids, and there is
no create-then-update race window. Behavior:
* `state: active`, no invitation for the record — creates one and returns the one-time token.
* `state: active`, invitation exists — updates it to the desired state (restoring it first when
it was revoked, e.g. a reinstated reservation).
* `state: revoked` — revokes the invitation, or reports `unchanged` when it is already revoked or
was never created. The guest link stops working; history and the external reference survive.
Out-of-order delivery is rejected: when `external_ref.revision` is older than the stored
revision the call fails with `external_revision_stale` and nothing is written. Duplicate
delivery is safe by construction, and `Idempotency-Key` additionally replays the original
response.
Sends a `POST` request to `/integrations/{id}/access-invites/reconcile`
Arguments:
- `id`
- `idempotency_key`: Replay key; a retry with the same key and body returns the original result.
- `x_correlation_id`: Caller request id recorded with the invitation and its audit events.
- `x_org`
- `body`
*/
pub async fn reconcile_integration_access_invite<'a>(
&'a self,
id: &'a str,
idempotency_key: Option<&'a str>,
x_correlation_id: Option<&'a str>,
x_org: &'a str,
body: &'a types::ReconcileAccessInviteRequest,
) -> Result<ResponseValue<types::ReconcileAccessInviteResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/integrations/{}/access-invites/reconcile",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(4usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
if let Some(value) = idempotency_key {
header_map.append("Idempotency-Key", value.to_string().try_into()?);
}
if let Some(value) = x_correlation_id {
header_map.append("X-Correlation-Id", value.to_string().try_into()?);
}
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "reconcile_integration_access_invite",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Update an access invite (portals, validity, max_uses). Only active invites can be updated
The update is a desired-state write and is therefore naturally idempotent: replaying the same
body leaves the same state. Out-of-order delivery is handled by `external_ref.revision` — a
write whose revision is older than the stored one is refused with `external_revision_stale`
instead of restoring an earlier room, window, or portal set.
Sends a `PUT` request to `/integrations/{id}/access-invites/{invite_link_id}`
Arguments:
- `id`
- `invite_link_id`
- `x_correlation_id`: Caller request id recorded with the invitation and its audit events.
- `x_org`
- `body`
*/
pub async fn update_integration_access_invite<'a>(
&'a self,
id: &'a str,
invite_link_id: &'a str,
x_correlation_id: Option<&'a str>,
x_org: &'a str,
body: &'a types::UpdateAccessInviteRequest,
) -> Result<ResponseValue<types::AccessInviteListItem>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/access-invites/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_link_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
if let Some(value) = x_correlation_id {
header_map.append("X-Correlation-Id", value.to_string().try_into()?);
}
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_integration_access_invite",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Delete an access invite (permanently)
Sends a `DELETE` request to `/integrations/{id}/access-invites/{invite_link_id}`
Arguments:
- `id`
- `invite_link_id`
- `x_correlation_id`: Caller request id recorded on the audit event.
- `x_org`
*/
pub async fn delete_integration_access_invite<'a>(
&'a self,
id: &'a str,
invite_link_id: &'a str,
x_correlation_id: Option<&'a str>,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/access-invites/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_link_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
if let Some(value) = x_correlation_id {
header_map.append("X-Correlation-Id", value.to_string().try_into()?);
}
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_integration_access_invite",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/integrations/{id}/access-invites/{invite_link_id}/message-media`
*/
pub async fn post_access_invite_message_media<'a>(
&'a self,
id: &'a str,
invite_link_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::AccessInviteMessageMediaResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/access-invites/{}/message-media",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_link_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_access_invite_message_media",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
429u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/integrations/{id}/access-invites/{invite_link_id}/message-media/{slot}`
*/
pub async fn get_access_invite_message_media<'a>(
&'a self,
id: &'a str,
invite_link_id: &'a str,
slot: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/access-invites/{}/message-media/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_link_id.to_string()),
encode_path(&slot.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_access_invite_message_media",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
429u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/integrations/{id}/access-invites/{invite_link_id}/photo`
*/
pub async fn get_access_invite_photo<'a>(
&'a self,
id: &'a str,
invite_link_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/access-invites/{}/photo",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_link_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_access_invite_photo",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
429u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/integrations/{id}/access-invites/{invite_link_id}/photo`
*/
pub async fn post_access_invite_photo<'a>(
&'a self,
id: &'a str,
invite_link_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/access-invites/{}/photo",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_link_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_access_invite_photo",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
429u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/integrations/{id}/access-invites/{invite_link_id}/photo`
*/
pub async fn delete_access_invite_photo<'a>(
&'a self,
id: &'a str,
invite_link_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/integrations/{}/access-invites/{}/photo",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_link_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_access_invite_photo",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
429u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Regenerate invite token (returns new shareable link; old link stops working)
Rotation is the only way to recover a guest link after the one-time visibility on create: the
previous token is invalidated, so any link already delivered to a guest stops working.
Sends a `POST` request to `/integrations/{id}/access-invites/{invite_link_id}/regenerate-token`
*/
pub async fn regenerate_integration_access_invite_token<'a>(
&'a self,
id: &'a str,
invite_link_id: &'a str,
x_org: &'a str,
) -> Result<
ResponseValue<types::RegenerateAccessInviteTokenResponse>,
Error<types::ApiErrorResponse>,
> {
let url = format!(
"{}/integrations/{}/access-invites/{}/regenerate-token",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_link_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "regenerate_integration_access_invite_token",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List pending renewal requests for an access invite
Sends a `GET` request to `/integrations/{id}/access-invites/{invite_link_id}/renewal-requests`
*/
pub async fn list_integration_access_invite_renewal_requests<'a>(
&'a self,
id: &'a str,
invite_link_id: &'a str,
x_org: &'a str,
) -> Result<
ResponseValue<types::ListAccessInviteRenewalRequestsResponse>,
Error<types::ApiErrorResponse>,
> {
let url = format!(
"{}/integrations/{}/access-invites/{}/renewal-requests",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_link_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integration_access_invite_renewal_requests",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Dismiss a pending renewal request for an access invite
Renewal requests have no binary approve/reject outcome — an admin may adjust
the schedule, issue a new invite, or take no action. Dismissing simply clears
the request from the pending list so it does not linger forever.
Sends a `DELETE` request to `/integrations/{id}/access-invites/{invite_link_id}/renewal-requests/{request_id}`
*/
pub async fn dismiss_integration_access_invite_renewal_request<'a>(
&'a self,
id: &'a str,
invite_link_id: &'a str,
request_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/access-invites/{}/renewal-requests/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_link_id.to_string()),
encode_path(&request_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "dismiss_integration_access_invite_renewal_request",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Restore (un-revoke) an access invite
Sends a `POST` request to `/integrations/{id}/access-invites/{invite_link_id}/restore`
*/
pub async fn restore_integration_access_invite<'a>(
&'a self,
id: &'a str,
invite_link_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::AccessInviteListItem>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/access-invites/{}/restore",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_link_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "restore_integration_access_invite",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Revoke an access invite
Revocation is idempotent: revoking an already revoked invitation returns the same state with the
original `revoked_at`, so a duplicate checkout webhook is safe. It is also reversible through the
restore route, which is what makes a reinstated reservation recoverable; the invitation row,
its history, and its external reference are preserved (unlike delete).
Sends a `POST` request to `/integrations/{id}/access-invites/{invite_link_id}/revoke`
Arguments:
- `id`
- `invite_link_id`
- `x_correlation_id`: Caller request id recorded on the audit event.
- `x_org`
*/
pub async fn revoke_integration_access_invite<'a>(
&'a self,
id: &'a str,
invite_link_id: &'a str,
x_correlation_id: Option<&'a str>,
x_org: &'a str,
) -> Result<ResponseValue<types::AccessInviteListItem>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/access-invites/{}/revoke",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_link_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(3usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
if let Some(value) = x_correlation_id {
header_map.append("X-Correlation-Id", value.to_string().try_into()?);
}
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "revoke_integration_access_invite",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**`GET /integrations/{id}/access-invites/{invite_link_id}/usage`
Sends a `GET` request to `/integrations/{id}/access-invites/{invite_link_id}/usage`
*/
pub async fn list_integration_access_invite_usage<'a>(
&'a self,
id: &'a str,
invite_link_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::AccessUsageResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/access-invites/{}/usage",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_link_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integration_access_invite_usage",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Counts and summaries for a virtual-access site overview
Sends a `GET` request to `/integrations/{id}/access-overview`
*/
pub async fn get_site_access_overview<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::SiteAccessOverviewResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/integrations/{}/access-overview",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_site_access_overview",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List public access portals for an integration (for admin links to public portal pages)
Sends a `GET` request to `/integrations/{id}/access-portals`
*/
pub async fn list_integration_access_portals<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::PaginatedResponseAccessPortalListItem>, Error<()>> {
let url = format!(
"{}/integrations/{}/access-portals",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integration_access_portals",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Create a public access portal for an integration
Sends a `POST` request to `/integrations/{id}/access-portals`
*/
pub async fn create_integration_access_portal<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: &'a types::CreateAccessPortalRequest,
) -> Result<ResponseValue<types::CreateAccessPortalResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/access-portals",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_integration_access_portal",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List soft-deleted public access portals for an integration (restore / trash view)
Sends a `GET` request to `/integrations/{id}/access-portals/deleted`
*/
pub async fn list_deleted_integration_access_portals<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::ListIntegrationAccessPortalsResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/access-portals/deleted",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_deleted_integration_access_portals",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Update a public access portal
Sends a `PUT` request to `/integrations/{id}/access-portals/{portal_id}`
*/
pub async fn update_integration_access_portal<'a>(
&'a self,
id: &'a str,
portal_id: &'a str,
x_org: &'a str,
body: &'a types::UpdateAccessPortalRequest,
) -> Result<ResponseValue<types::AccessPortalListItem>, Error<()>> {
let url = format!(
"{}/integrations/{}/access-portals/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&portal_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_integration_access_portal",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Delete a public access portal
Sends a `DELETE` request to `/integrations/{id}/access-portals/{portal_id}`
*/
pub async fn delete_integration_access_portal<'a>(
&'a self,
id: &'a str,
portal_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/integrations/{}/access-portals/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&portal_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_integration_access_portal",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Restore a soft-deleted public access portal (reactivates its public_id / printed URL)
Sends a `POST` request to `/integrations/{id}/access-portals/{portal_id}/restore`
*/
pub async fn restore_integration_access_portal<'a>(
&'a self,
id: &'a str,
portal_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::AccessPortalListItem>, Error<()>> {
let url = format!(
"{}/integrations/{}/access-portals/{}/restore",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&portal_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "restore_integration_access_portal",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get provider-specific JSON Schema for `device_metadata` for this integration (for generic UI labels)
Sends a `GET` request to `/integrations/{id}/device-metadata-schema`
*/
pub async fn get_integration_device_metadata_schema<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::IntegrationDeviceMetadataSchemaResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/device-metadata-schema",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_integration_device_metadata_schema",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/integrations/{id}/devices/{device_id}/physical-device`
*/
pub async fn get_device_physical_status<'a>(
&'a self,
id: &'a str,
device_id: &'a str,
) -> Result<ResponseValue<types::DevicePhysicalStatusResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/devices/{}/physical-device",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&device_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_device_physical_status",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/integrations/{id}/devices/{device_id}/policies`
*/
pub async fn list_device_policies<'a>(
&'a self,
id: &'a str,
device_id: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::PolicyResponse>>, Error<()>> {
let url = format!(
"{}/integrations/{}/devices/{}/policies",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&device_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_device_policies",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/integrations/{id}/devices/{device_id}/policies`
*/
pub async fn create_device_policy<'a>(
&'a self,
id: &'a str,
device_id: &'a str,
body: &'a types::CreatePolicyRequest,
) -> Result<ResponseValue<types::PolicyResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/devices/{}/policies",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&device_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_device_policy",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/integrations/{id}/devices/{device_id}/policies/{policy_id}`
*/
pub async fn delete_device_policy<'a>(
&'a self,
id: &'a str,
device_id: &'a str,
policy_id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/devices/{}/policies/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&device_id.to_string()),
encode_path(&policy_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_device_policy",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PATCH` request to `/integrations/{id}/devices/{device_id}/policies/{policy_id}`
*/
pub async fn update_device_policy<'a>(
&'a self,
id: &'a str,
device_id: &'a str,
policy_id: &'a str,
body: &'a types::UpdatePolicyRequest,
) -> Result<ResponseValue<types::PolicyResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/devices/{}/policies/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&device_id.to_string()),
encode_path(&policy_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_device_policy",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/integrations/{id}/devices/{device_id}/steward/release`
*/
pub async fn release_steward<'a>(
&'a self,
id: &'a str,
device_id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/devices/{}/steward/release",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&device_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "release_steward",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Batch list members for multiple listing entities (integration-scoped)
Sends a `GET` request to `/integrations/{id}/directory-listing-members`
Arguments:
- `id`
- `entity_ids`: Comma-separated entity IDs
- `x_org`
*/
pub async fn list_integration_directory_listing_members<'a>(
&'a self,
id: &'a str,
entity_ids: Option<&'a str>,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/integrations/{}/directory-listing-members",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.query(&progenitor_client::QueryParam::new(
"entity_ids",
&entity_ids,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integration_directory_listing_members",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List devices discovered from the upstream provider for this integration
Sends a `GET` request to `/integrations/{id}/discovered-devices`
*/
pub async fn get_integration_discovered_devices<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<::serde_json::Value>, Error<()>> {
let url = format!(
"{}/integrations/{}/discovered-devices",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_integration_discovered_devices",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
501u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
502u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Explicitly refresh provider-reported channel counts on linked devices
Sends a `POST` request to `/integrations/{id}/discovered-devices/refresh-channel-counts`
*/
pub async fn post_refresh_integration_device_channel_counts<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<::serde_json::Value>, Error<()>> {
let url = format!(
"{}/integrations/{}/discovered-devices/refresh-channel-counts",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_refresh_integration_device_channel_counts",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
501u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
502u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**`GET /integrations/{id}/doors/{device_id}/usage`
Sends a `GET` request to `/integrations/{id}/doors/{device_id}/usage`
*/
pub async fn list_integration_door_usage<'a>(
&'a self,
id: &'a str,
device_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::AccessUsageResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/doors/{}/usage",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&device_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integration_door_usage",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/integrations/{id}/effective-policies`
*/
pub async fn get_integration_effective_policies<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::EffectivePoliciesResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/effective-policies",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_integration_effective_policies",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List resource entities for devices belonging to an integration
Sends a `GET` request to `/integrations/{id}/entities`
Arguments:
- `id`
- `entity_type`: Comma-separated entity types (e.g. `door,switch`). Omit for all types.
- `include_deleted`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
- `x_org`
*/
pub async fn list_integration_entities<'a>(
&'a self,
id: &'a str,
entity_type: Option<&'a str>,
include_deleted: Option<bool>,
limit: Option<i32>,
offset: Option<i32>,
only_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::PaginatedResponseEntityResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/integrations/{}/entities",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"entity_type",
&entity_type,
))
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new(
"only_deleted",
&only_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integration_entities",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/integrations/{id}/image`
*/
pub async fn get_integration_image<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_integration_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/integrations/{id}/image`
*/
pub async fn post_integration_image<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_integration_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
415u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/integrations/{id}/image`
*/
pub async fn delete_integration_image<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/integrations/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_integration_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/integrations/{id}/image/copy-from`
*/
pub async fn post_integration_image_copy_from<'a>(
&'a self,
id: &'a str,
body: &'a types::CopyIntegrationImageRequest,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/image/copy-from",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_integration_image_copy_from",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**GET `/integrations/{id}/integration-users?device_id=...`
Sends a `GET` request to `/integrations/{id}/integration-users`
Arguments:
- `id`
- `device_id`: Provider device id (when the provider's `users_admin.list_users` op is scoped to a device).
- `x_org`
*/
pub async fn list_integration_users<'a>(
&'a self,
id: &'a str,
device_id: Option<&'a str>,
x_org: &'a str,
) -> Result<ResponseValue<types::IntegrationUsersResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/integration-users",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("device_id", &device_id))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integration_users",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
501u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/integrations/{id}/locations`
Arguments:
- `id`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `search`
*/
pub async fn list_integration_locations<'a>(
&'a self,
id: &'a str,
limit: Option<i32>,
offset: Option<i32>,
search: Option<&'a str>,
) -> Result<
ResponseValue<types::PaginatedResponseLocationListItemResponse>,
Error<types::ApiErrorResponse>,
> {
let url = format!(
"{}/integrations/{}/locations",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new("search", &search))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integration_locations",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List provider-specific ops available for an integration
Sends a `GET` request to `/integrations/{id}/ops`
*/
pub async fn list_integration_ops<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/integrations/{}/ops",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integration_ops",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Execute a provider-specific op for an integration
Sends a `POST` request to `/integrations/{id}/ops/{op_id}`
*/
pub async fn execute_integration_op<'a>(
&'a self,
id: &'a str,
op_id: &'a str,
x_org: &'a str,
body: &'a ::serde_json::Value,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/integrations/{}/ops/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&op_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "execute_integration_op",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
501u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List building users (users with virtual_access:integration:{id}:* role)
Sends a `GET` request to `/integrations/{id}/people`
Arguments:
- `id`
- `locale`: Preferred name locale for stable people ordering
- `x_org`
*/
pub async fn list_people<'a>(
&'a self,
id: &'a str,
locale: Option<&'a str>,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/integrations/{}/people",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.query(&progenitor_client::QueryParam::new("locale", &locale))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_people",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Add user to building (adds org role; creates membership if missing)
Sends a `POST` request to `/integrations/{id}/people`
*/
pub async fn add_person<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: &'a types::AddBuildingUserPayload,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/integrations/{}/people",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "add_person",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Remove user from building (removes org roles and listing assignments)
Sends a `DELETE` request to `/integrations/{id}/people/{user_id}`
*/
pub async fn delete_person<'a>(
&'a self,
id: &'a str,
user_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/integrations/{}/people/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&user_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_person",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/integrations/{id}/policies`
*/
pub async fn list_integration_policies<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::PolicyResponse>>, Error<()>> {
let url = format!(
"{}/integrations/{}/policies",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integration_policies",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/integrations/{id}/policies`
*/
pub async fn create_integration_policy<'a>(
&'a self,
id: &'a str,
body: &'a types::CreatePolicyRequest,
) -> Result<ResponseValue<types::PolicyResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/policies",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_integration_policy",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/integrations/{id}/policies/{policy_id}`
*/
pub async fn delete_integration_policy<'a>(
&'a self,
id: &'a str,
policy_id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/policies/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&policy_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_integration_policy",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PATCH` request to `/integrations/{id}/policies/{policy_id}`
*/
pub async fn update_integration_policy<'a>(
&'a self,
id: &'a str,
policy_id: &'a str,
body: &'a types::UpdatePolicyRequest,
) -> Result<ResponseValue<types::PolicyResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/policies/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&policy_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_integration_policy",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Acknowledge that the device was reprovisioned (store the current connection config snapshot)
Sends a `POST` request to `/integrations/{id}/provisioning/ack`
*/
pub async fn post_waveshare_provisioning_ack<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: &'a ::serde_json::Value,
) -> Result<ResponseValue<types::IntegrationResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/provisioning/ack",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_waveshare_provisioning_ack",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get Waveshare provisioning status for an integration
Sends a `GET` request to `/integrations/{id}/provisioning/status`
*/
pub async fn get_waveshare_provisioning_status<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<
ResponseValue<types::WaveshareProvisioningStatusResponse>,
Error<types::ApiErrorResponse>,
> {
let url = format!(
"{}/integrations/{}/provisioning/status",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_waveshare_provisioning_status",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Permanently delete (purge) an integration
Sends a `DELETE` request to `/integrations/{id}/purge`
*/
pub async fn hard_delete_integration<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::IntegrationResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/purge",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "hard_delete_integration",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Configuration completeness for a virtual_access site
Sends a `GET` request to `/integrations/{id}/readiness`
*/
pub async fn get_site_readiness<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::SiteReadiness>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/readiness",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_site_readiness",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Restore a soft-deleted integration
Sends a `POST` request to `/integrations/{id}/restore`
*/
pub async fn restore_integration<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::IntegrationResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/integrations/{}/restore",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "restore_integration",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Move or duplicate an integration (and its dependents) into another org
Transfer an integration to another org. Quota: the target org's capacity is checked for `integrations` (+1) plus the dependent `devices`, `entities`, and `zones` it brings (unit: count, lifetime capacity); a full target quota returns 429 `quota_exceeded`.
Sends a `POST` request to `/integrations/{id}/transfer`
*/
pub async fn post_integration_transfer<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: &'a types::TransferIntegrationRequest,
) -> Result<ResponseValue<types::TransferIntegrationResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/transfer",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_integration_transfer",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
429u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Read-only preview of a transfer's impact
Sends a `GET` request to `/integrations/{id}/transfer-preview`
Arguments:
- `id`
- `mode`: `move` (default) or `duplicate`; controls which side-effect warnings apply.
- `x_org`
*/
pub async fn get_integration_transfer_preview<'a>(
&'a self,
id: &'a str,
mode: Option<&'a str>,
x_org: &'a str,
) -> Result<ResponseValue<types::TransferPreviewResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/transfer-preview",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("mode", &mode))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_integration_transfer_preview",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**POST /integrations/{id}/lan-agent/task-spec
Sends a `POST` request to `/integrations/{integration_id}/lan-agent/task-spec`
Arguments:
- `integration_id`: Integration ULID
- `x_org`: Organization ULID
- `body`
*/
pub async fn post_integration_lan_agent_task_spec<'a>(
&'a self,
integration_id: &'a str,
x_org: &'a str,
body: &'a types::LanAgentTaskSpecRequest,
) -> Result<ResponseValue<types::LanAgentTaskSpecResponse>, Error<()>> {
let url = format!(
"{}/integrations/{}/lan-agent/task-spec",
self.baseurl,
encode_path(&integration_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_integration_lan_agent_task_spec",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
426u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**GET /integrations/{id}/lan-agent/tasks
Sends a `GET` request to `/integrations/{integration_id}/lan-agent/tasks`
Arguments:
- `integration_id`: Integration ULID
- `x_org`: Organization ULID
*/
pub async fn get_integration_lan_agent_tasks<'a>(
&'a self,
integration_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/integrations/{}/lan-agent/tasks",
self.baseurl,
encode_path(&integration_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.get(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "get_integration_lan_agent_tasks",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List zones for an integration
Sends a `GET` request to `/integrations/{integration_id}/zones`
Arguments:
- `integration_id`
- `include_deleted`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
- `x_org`
*/
pub async fn list_integration_zones<'a>(
&'a self,
integration_id: &'a str,
include_deleted: Option<bool>,
limit: Option<i32>,
offset: Option<i32>,
only_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::PaginatedResponseZoneResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/integrations/{}/zones",
self.baseurl,
encode_path(&integration_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new(
"only_deleted",
&only_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_integration_zones",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**POST `/invitations/preview` — public-ish; returns enough metadata to render the
redeem page without leaking the PIN
Sends a `POST` request to `/invitations/preview`
*/
pub async fn preview_invitation<'a>(
&'a self,
body: &'a types::InvitationPreviewRequest,
) -> Result<ResponseValue<types::InvitationPreviewResponse>, Error<()>> {
let url = format!("{}/invitations/preview", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "preview_invitation",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**POST `/invitations/redeem` — exchange `token` + `pin` for org membership
Requires an authenticated Kratos session (we attach the invite to that user). If the
session's user does not yet match `invite.phone` or `invite.email`, we still attach
— the invite's secrets are themselves the proof of identity for this flow.
Sends a `POST` request to `/invitations/redeem`
*/
pub async fn redeem_invitation<'a>(
&'a self,
body: &'a types::RedeemInvitationRequest,
) -> Result<ResponseValue<types::RedeemInvitationResponse>, Error<()>> {
let url = format!("{}/invitations/redeem", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "redeem_invitation",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
410u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
422u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/locations/{id}`
*/
pub async fn get_location<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::LocationResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/locations/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_location",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Delete a location. Only unused (orphan) locations can be deleted: if the location is referenced by one or more resource bindings, the request is rejected with 409 (rebind those resources first).
Sends a `DELETE` request to `/locations/{id}`
*/
pub async fn delete_location<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/locations/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_location",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Update a location. Locations are immutable once shared: if the location is referenced by more than one resource, the request is rejected with 409 (create a new location or rebind instead). Quota: if the address changes and is re-geocoded, consumes 1 from `geocoding_requests` (unit: count, per day and per month).
Sends a `PATCH` request to `/locations/{id}`
*/
pub async fn patch_location<'a>(
&'a self,
id: &'a str,
body: &'a types::PatchLocationRequest,
) -> Result<ResponseValue<types::LocationResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/locations/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "patch_location",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
503u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Refresh a location's geocode. Locations are immutable once shared: if the location is referenced by more than one resource, the request is rejected with 409 (create a new location or rebind instead). Quota: consumes 1 from `geocoding_requests` (unit: count, per day and per month).
Sends a `POST` request to `/locations/{id}/geocode`
Arguments:
- `id`
- `locale`: Preferred locale (app code or BCP-47) for geocoded text. Defaults to `en`.
*/
pub async fn post_location_geocode<'a>(
&'a self,
id: &'a str,
locale: Option<&'a str>,
) -> Result<ResponseValue<types::LocationResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/locations/{}/geocode",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("locale", &locale))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_location_geocode",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
503u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/mcp`
*/
pub async fn mcp_jsonrpc<'a>(
&'a self,
body: &'a ::serde_json::Value,
) -> Result<ResponseValue<types::JsonRpcResponse>, Error<()>> {
let url = format!("{}/mcp", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "mcp_jsonrpc",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/me/access-invites`
*/
pub async fn get_me_access_invites<'a>(
&'a self,
kind: Option<&'a str>,
) -> Result<ResponseValue<types::MeAccessInvitesResponse>, Error<()>> {
let url = format!("{}/me/access-invites", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("kind", &kind))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_me_access_invites",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/me/access-invites/{invite_id}`
*/
pub async fn delete_me_access_invite<'a>(
&'a self,
invite_id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/me/access-invites/{}",
self.baseurl,
encode_path(&invite_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_me_access_invite",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/me/access-invites/{invite_id}/keep`
*/
pub async fn post_me_access_invite_keep<'a>(
&'a self,
invite_id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/me/access-invites/{}/keep",
self.baseurl,
encode_path(&invite_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.post(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "post_me_access_invite_keep",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/me/call-blocks`
*/
pub async fn get_me_call_blocks<'a>(
&'a self,
) -> Result<ResponseValue<types::MeCallBlocksResponse>, Error<()>> {
let url = format!("{}/me/call-blocks", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_me_call_blocks",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/me/call-blocks`
*/
pub async fn post_me_call_block<'a>(
&'a self,
body: &'a types::PostMeCallBlockPayload,
) -> Result<ResponseValue<types::MeCallSafetyOkResponse>, Error<()>> {
let url = format!("{}/me/call-blocks", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_me_call_block",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/me/call-blocks/{publicPortalId}`
*/
pub async fn delete_me_call_block<'a>(
&'a self,
public_portal_id: &'a str,
) -> Result<ResponseValue<types::MeCallSafetyOkResponse>, Error<()>> {
let url = format!(
"{}/me/call-blocks/{}",
self.baseurl,
encode_path(&public_portal_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_me_call_block",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/me/call-reports`
*/
pub async fn post_me_call_report<'a>(
&'a self,
body: &'a types::PostMeCallReportPayload,
) -> Result<ResponseValue<types::MeCallSafetyOkResponse>, Error<()>> {
let url = format!("{}/me/call-reports", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_me_call_report",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/me/deletion-request`
*/
pub async fn post_me_deletion_request<'a>(
&'a self,
) -> Result<ResponseValue<types::DeletionRequestResponse>, Error<()>> {
let url = format!("{}/me/deletion-request", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_me_deletion_request",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**POST /me/device-tokens — register a native push token for call notifications
Sends a `POST` request to `/me/device-tokens`
*/
pub async fn post_me_device_token<'a>(
&'a self,
body: &'a types::PostMeDeviceTokenPayload,
) -> Result<ResponseValue<types::PostMeDeviceTokenResponse>, Error<()>> {
let url = format!("{}/me/device-tokens", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_me_device_token",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**DELETE /me/device-tokens/{id} — remove a previously registered native token (logout / rotation)
`id` is either the **row id** (ULID) returned from `POST /me/device-tokens`, or the **raw push
token** (URL-encoded if necessary). If the segment parses as a ULID, the row id path is used;
otherwise the value is treated as the opaque provider token string.
Sends a `DELETE` request to `/me/device-tokens/{id}`
Arguments:
- `id`: Row ULID from POST response, or URL-encoded raw device token
*/
pub async fn delete_me_device_token<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/me/device-tokens/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_me_device_token",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**GET /me/directory-listings — returns listings the current user is a member of
Sends a `GET` request to `/me/directory-listings`
*/
pub async fn get_me_directory_listings<'a>(
&'a self,
) -> Result<ResponseValue<types::MeListingsResponse>, Error<()>> {
let url = format!("{}/me/directory-listings", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_me_directory_listings",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**PATCH /me/directory-listings/{entityId}/dnd — update DND state for a listing
Sends a `PATCH` request to `/me/directory-listings/{entityId}/dnd`
*/
pub async fn patch_me_directory_listing_dnd<'a>(
&'a self,
entity_id: &'a str,
body: &'a types::PatchMeListingDndPayload,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/me/directory-listings/{}/dnd",
self.baseurl,
encode_path(&entity_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "patch_me_directory_listing_dnd",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**PATCH /me/dnd — update global DND state
Sends a `PATCH` request to `/me/dnd`
*/
pub async fn patch_me_dnd<'a>(
&'a self,
body: &'a types::PatchMeDndPayload,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!("{}/me/dnd", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "patch_me_dnd",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Proposals and per-member admission status for the households I manage
Sends a `GET` request to `/me/group-proposals`
*/
pub async fn get_me_group_proposals<'a>(
&'a self,
x_org: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::GroupProposalResponse>>, Error<()>> {
let url = format!("{}/me/group-proposals", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_me_group_proposals",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**The groups the caller belongs to, and where each one grants access
Sends a `GET` request to `/me/groups`
*/
pub async fn get_me_groups<'a>(
&'a self,
) -> Result<ResponseValue<::std::vec::Vec<types::MyGroupResponse>>, Error<()>> {
let url = format!("{}/me/groups", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_me_groups",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Create a household
The resident is made a manager so they can add others, and the household is created in the
acting org, which becomes its home org. The name is optional: the implicit flow that adds a
first family member without asking omits it and gets a name derived from the caller.
Sends a `POST` request to `/me/groups`
*/
pub async fn create_me_group<'a>(
&'a self,
x_org: &'a str,
body: &'a types::CreateHouseholdPayload,
) -> Result<ResponseValue<types::GroupResponse>, Error<()>> {
let url = format!("{}/me/groups", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_me_group",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**One household the caller belongs to, with the sites it grants access to
Sends a `GET` request to `/me/groups/{id}`
*/
pub async fn get_me_group<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::MyGroupResponse>, Error<()>> {
let url = format!(
"{}/me/groups/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_me_group",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Rename a household. Managers only: the roster name is shared, not personal
Sends a `PUT` request to `/me/groups/{id}`
*/
pub async fn update_me_group<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: &'a types::UpdateHouseholdPayload,
) -> Result<ResponseValue<types::GroupResponse>, Error<()>> {
let url = format!(
"{}/me/groups/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_me_group",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Delete a household. Managers only
Deletion is transactional and removes every access-bearing relationship (memberships, links,
admissions, share offers, invitations), so nothing outlives the household.
Sends a `DELETE` request to `/me/groups/{id}`
*/
pub async fn delete_me_group<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/me/groups/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_me_group",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Per-organization admission states visible to household managers
Sends a `GET` request to `/me/groups/{id}/admissions`
*/
pub async fn get_me_group_admissions<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::HouseholdAdmissionStatus>>, Error<()>> {
let url = format!(
"{}/me/groups/{}/admissions",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_me_group_admissions",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Revoke a household's access to a site
This is the resident-side counterpart of `propose_me_group`: a household manager decides which
sites their household reaches, without holding the site's `groups:link` permission. The site is
named by integration so the caller identifies it the same way they did when proposing.
Sends a `DELETE` request to `/me/groups/{id}/links/{integration_id}`
*/
pub async fn revoke_me_group_link<'a>(
&'a self,
id: &'a str,
integration_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/me/groups/{}/links/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&integration_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "revoke_me_group_link",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Offer household management to a current, age-eligible member and leave immediately
Sends a `POST` request to `/me/groups/{id}/manager-transfer`
*/
pub async fn create_manager_transfer<'a>(
&'a self,
id: &'a str,
body: &'a types::ManagerTransferPayload,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/me/groups/{}/manager-transfer",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_manager_transfer",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
202u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/me/groups/{id}/manager-transfer/accept`
*/
pub async fn accept_manager_transfer<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/me/groups/{}/manager-transfer/accept",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.post(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "accept_manager_transfer",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/me/groups/{id}/manager-transfer/decline`
*/
pub async fn decline_manager_transfer<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/me/groups/{}/manager-transfer/decline",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.post(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "decline_manager_transfer",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**The members of a household the caller belongs to
Sends a `GET` request to `/me/groups/{id}/members`
*/
pub async fn list_me_group_members<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::HouseholdMemberResponse>>, Error<()>> {
let url = format!(
"{}/me/groups/{}/members",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_me_group_members",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Remove myself from a household
Sends a `DELETE` request to `/me/groups/{id}/members/me`
*/
pub async fn delete_me_group_member<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/me/groups/{}/members/me",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_me_group_member",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Remove another member from a household. Managers only
This is the resident counterpart of the org member endpoint: a household manager decides who is
on the roster without holding the site's `groups:update` permission.
Sends a `DELETE` request to `/me/groups/{id}/members/{user_id}`
*/
pub async fn remove_me_group_member<'a>(
&'a self,
id: &'a str,
user_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/me/groups/{}/members/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&user_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "remove_me_group_member",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
409u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Propose a household to a site the caller belongs to
This is the primary way a roster crosses into an organization: the resident already has access
to the site, so no token is needed. The site's `external_group_sharing` policy decides whether
the option is offered at all, and the link stays pending until the site accepts.
Sends a `POST` request to `/me/groups/{id}/proposals`
*/
pub async fn propose_me_group<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: &'a types::ProposeGroupPayload,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/me/groups/{}/proposals",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "propose_me_group",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
202u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**GET /me/invitations — returns invitations the current user has claimed
Sends a `GET` request to `/me/invitations`
*/
pub async fn get_me_invitations<'a>(
&'a self,
) -> Result<ResponseValue<types::MeInvitationsResponse>, Error<()>> {
let url = format!("{}/me/invitations", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_me_invitations",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/me/privacy-export`
*/
pub async fn get_me_privacy_export<'a>(
&'a self,
) -> Result<ResponseValue<types::PrivacyExportResponse>, Error<()>> {
let url = format!("{}/me/privacy-export", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_me_privacy_export",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/me/profile`
*/
pub async fn get_me_profile<'a>(
&'a self,
) -> Result<ResponseValue<types::MeProfileResponse>, Error<()>> {
let url = format!("{}/me/profile", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_me_profile",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PATCH` request to `/me/profile`
*/
pub async fn patch_me_profile<'a>(
&'a self,
body: &'a types::PatchMeProfileRequest,
) -> Result<ResponseValue<types::MeProfileResponse>, Error<()>> {
let url = format!("{}/me/profile", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "patch_me_profile",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
422u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/me/profile/sync`
*/
pub async fn post_me_profile_sync<'a>(
&'a self,
) -> Result<ResponseValue<types::MeProfileResponse>, Error<()>> {
let url = format!("{}/me/profile/sync", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_me_profile_sync",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
422u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**GET /me/push-subscription-status — returns whether the current user has any push subscription
Sends a `GET` request to `/me/push-subscription-status`
*/
pub async fn get_me_push_subscription_status<'a>(
&'a self,
) -> Result<ResponseValue<types::MePushSubscriptionStatusResponse>, Error<()>> {
let url = format!("{}/me/push-subscription-status", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_me_push_subscription_status",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**POST /me/push-subscriptions — store Web Push subscription for call notifications
Sends a `POST` request to `/me/push-subscriptions`
*/
pub async fn post_me_push_subscription<'a>(
&'a self,
body: &'a types::PostMePushSubscriptionPayload,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!("{}/me/push-subscriptions", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_me_push_subscription",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**GET /me/push-vapid-public-key — returns VAPID public key for client subscription. 404 when not configured
Sends a `GET` request to `/me/push-vapid-public-key`
*/
pub async fn get_me_push_vapid_public_key<'a>(
&'a self,
) -> Result<ResponseValue<types::MePushVapidPublicKeyResponse>, Error<()>> {
let url = format!("{}/me/push-vapid-public-key", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_me_push_vapid_public_key",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/me/share-authoring`
*/
pub async fn get_me_share_authoring<'a>(
&'a self,
integration_id: &'a str,
org_id: &'a str,
) -> Result<ResponseValue<types::MeShareAuthoringResponse>, Error<()>> {
let url = format!("{}/me/share-authoring", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"integration_id",
&integration_id,
))
.query(&progenitor_client::QueryParam::new("org_id", &org_id))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_me_share_authoring",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/me/stores`
*/
pub async fn list_my_stores<'a>(
&'a self,
) -> Result<ResponseValue<::std::vec::Vec<types::Store>>, Error<()>> {
let url = format!("{}/me/stores", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_my_stores",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/me/stores/{store_id}/catalog`
*/
pub async fn my_store_catalog<'a>(
&'a self,
store_id: &'a str,
) -> Result<ResponseValue<types::MemberCatalogResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/me/stores/{}/catalog",
self.baseurl,
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "my_store_catalog",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/me/stores/{store_id}/purchases`
*/
pub async fn create_purchase<'a>(
&'a self,
store_id: &'a str,
body: &'a types::PurchaseRequest,
) -> Result<ResponseValue<types::StorePurchase>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/me/stores/{}/purchases",
self.baseurl,
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_purchase",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/me/stores/{store_id}/statement`
Arguments:
- `store_id`
- `limit`
- `month`: `YYYY-MM`; defaults to current month in the store timezone.
- `offset`
*/
pub async fn my_store_statement<'a>(
&'a self,
store_id: &'a str,
limit: Option<i32>,
month: Option<&'a str>,
offset: Option<i32>,
) -> Result<ResponseValue<types::StatementResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/me/stores/{}/statement",
self.baseurl,
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("month", &month))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "my_store_statement",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List organizations the user has access to
Sends a `GET` request to `/orgs`
Arguments:
- `include_deleted`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
*/
pub async fn list_orgs<'a>(
&'a self,
include_deleted: Option<bool>,
limit: Option<i32>,
offset: Option<i32>,
only_deleted: Option<bool>,
) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/orgs", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new(
"only_deleted",
&only_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_orgs",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Create an organization (body: name, description?, parent_id?)
Requires **`admin`** (or `platform_admin`) on the **parent** org or an ancestor.
Sub-org access is inherited from that parent assignment; the API does not grant
a duplicate **`admin`** role on the new org.
Quota: consumes 1 from the **parent** org's `organizations` (unit: count, lifetime
capacity) — capacity-checked before creation (429 `quota_exceeded` when full).
Sends a `POST` request to `/orgs`
*/
pub async fn create_org<'a>(
&'a self,
include_deleted: Option<bool>,
body: &'a types::CreateOrganizationRequest,
) -> Result<ResponseValue<types::OrganizationResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/orgs", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_org",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List the direct children of an org (or the visible-forest roots) for lazy tree expansion
Each item carries `has_children` so the client can render an expand affordance without fetching
the next level. Visibility matches `GET /orgs`.
Sends a `GET` request to `/orgs/children`
Arguments:
- `include_deleted`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
- `parent_id`: Parent org id. When omitted, returns the roots of the caller's visible org forest.
*/
pub async fn list_org_children<'a>(
&'a self,
include_deleted: Option<bool>,
limit: Option<i32>,
offset: Option<i32>,
only_deleted: Option<bool>,
parent_id: Option<&'a str>,
) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/orgs/children", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new(
"only_deleted",
&only_deleted,
))
.query(&progenitor_client::QueryParam::new("parent_id", &parent_id))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_org_children",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Free-text search across the orgs visible to the caller (flat, paginated)
Results carry `parent_name` and `has_children` so the selector can show each match with its
place in the hierarchy. An empty/blank `q` returns no results.
Sends a `GET` request to `/orgs/search`
Arguments:
- `include_deleted`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
- `q`: Free-text query matched as a case-insensitive substring of the org name, or as an exact
(case-insensitive) org ID.
*/
pub async fn search_orgs<'a>(
&'a self,
include_deleted: Option<bool>,
limit: Option<i32>,
offset: Option<i32>,
only_deleted: Option<bool>,
q: &'a str,
) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/orgs/search", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new(
"only_deleted",
&only_deleted,
))
.query(&progenitor_client::QueryParam::new("q", &q))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "search_orgs",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get an organization by ID
Sends a `GET` request to `/orgs/{id}`
*/
pub async fn get_org<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
) -> Result<ResponseValue<types::OrganizationResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/orgs/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_org",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Update an organization (body: name?, description?, parent_id?)
Supplying `parent_id` moves the org (and its subtree) under a new parent. Moving requires
`admin` on the destination parent (or an ancestor) and is rejected if it would create a cycle
or exceed the max org depth.
Sends a `PUT` request to `/orgs/{id}`
*/
pub async fn update_org<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
body: &'a types::UpdateOrganizationRequest,
) -> Result<ResponseValue<types::OrganizationResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/orgs/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_org",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Soft-delete an organization
Sends a `DELETE` request to `/orgs/{id}`
*/
pub async fn delete_org<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
) -> Result<ResponseValue<types::OrganizationResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/orgs/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_org",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Visible ancestor chain of an org, ordered root-most first (excludes the org itself)
Powers the breadcrumb of the selected org in the selector trigger. Only ancestors that are
themselves visible to the caller are returned, so paths never leak orgs above the caller's reach.
Sends a `GET` request to `/orgs/{id}/ancestors`
Arguments:
- `id`: Organization ID
*/
pub async fn list_org_ancestors<'a>(
&'a self,
id: &'a str,
) -> Result<
ResponseValue<::std::vec::Vec<types::OrganizationResponse>>,
Error<types::ApiErrorResponse>,
> {
let url = format!(
"{}/orgs/{}/ancestors",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_org_ancestors",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{id}/billing/checkout`
*/
pub async fn post_org_billing_checkout<'a>(
&'a self,
id: &'a str,
body: &'a types::CheckoutRequest,
) -> Result<ResponseValue<types::SubscriptionRef>, Error<()>> {
let url = format!(
"{}/orgs/{}/billing/checkout",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_org_billing_checkout",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Read the org's over-capacity remediation snapshot (stage, level, overages, flagged
resources, selection policy). Powers the dashboard degradation panel
Sends a `GET` request to `/orgs/{id}/billing/degradation`
*/
pub async fn get_org_billing_degradation<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::DegradationStatus>, Error<()>> {
let url = format!(
"{}/orgs/{}/billing/degradation",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_org_billing_degradation",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Set the excess-selection policy for an over-capacity org and re-flag accordingly.
Requires `billing:manage`
Sends a `PUT` request to `/orgs/{id}/billing/degradation/policy`
*/
pub async fn put_org_billing_degradation_policy<'a>(
&'a self,
id: &'a str,
body: &'a types::SetSelectionPolicyRequest,
) -> Result<ResponseValue<types::DegradationStatus>, Error<()>> {
let url = format!(
"{}/orgs/{}/billing/degradation/policy",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "put_org_billing_degradation_policy",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Pin or unpin a specific resource so the admin can choose which rows survive a downgrade,
then re-flag the excess. Requires `billing:manage`
Sends a `POST` request to `/orgs/{id}/billing/degradation/resource`
*/
pub async fn post_org_billing_degradation_resource<'a>(
&'a self,
id: &'a str,
body: &'a types::SetResourceKeepRequest,
) -> Result<ResponseValue<types::DegradationStatus>, Error<()>> {
let url = format!(
"{}/orgs/{}/billing/degradation/resource",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_org_billing_degradation_resource",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{id}/billing/plan`
*/
pub async fn get_org_billing_plan<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::BillingPlanResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/billing/plan",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_org_billing_plan",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{id}/billing/portal`
*/
pub async fn post_org_billing_portal<'a>(
&'a self,
id: &'a str,
body: &'a types::PortalRequest,
) -> Result<ResponseValue<types::PortalResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/billing/portal",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_org_billing_portal",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
501u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{id}/billing/upgrade-options`
*/
pub async fn get_org_billing_upgrade_options<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::PlansResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/billing/upgrade-options",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_org_billing_upgrade_options",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{id}/billing/usage`
*/
pub async fn get_org_billing_usage<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::QuotaReport>, Error<()>> {
let url = format!(
"{}/orgs/{}/billing/usage",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_org_billing_usage",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{id}/image`
*/
pub async fn get_org_image<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_org_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{id}/image`
*/
pub async fn post_org_image<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_org_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
415u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/orgs/{id}/image`
*/
pub async fn delete_org_image<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/orgs/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_org_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**GET `/orgs/{id}/invitations` — list all invitations attached to the org (any status)
Sends a `GET` request to `/orgs/{id}/invitations`
*/
pub async fn list_invitations<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::ListInvitationsResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/invitations",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_invitations",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**POST `/orgs/{id}/invitations` — mint an invitation and dispatch its PIN
Sends a `POST` request to `/orgs/{id}/invitations`
*/
pub async fn create_invitation<'a>(
&'a self,
id: &'a str,
body: &'a types::CreateInvitationRequest,
) -> Result<ResponseValue<types::CreateInvitationResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/invitations",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_invitation",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**DELETE `/orgs/{id}/invitations/{invite_id}` — mark invitation cancelled
Sends a `DELETE` request to `/orgs/{id}/invitations/{invite_id}`
*/
pub async fn cancel_invitation<'a>(
&'a self,
id: &'a str,
invite_id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/orgs/{}/invitations/{}",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "cancel_invitation",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
422u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**DELETE `/orgs/{id}/invitations/{invite_id}/purge` — permanently remove any invitation status
Sends a `DELETE` request to `/orgs/{id}/invitations/{invite_id}/purge`
*/
pub async fn hard_delete_invitation<'a>(
&'a self,
id: &'a str,
invite_id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/orgs/{}/invitations/{}/purge",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "hard_delete_invitation",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**POST `/orgs/{id}/invitations/{invite_id}/resend` — re-issue fresh token+PIN
Sends a `POST` request to `/orgs/{id}/invitations/{invite_id}/resend`
*/
pub async fn resend_invitation<'a>(
&'a self,
id: &'a str,
invite_id: &'a str,
) -> Result<ResponseValue<types::UserInvitationDto>, Error<()>> {
let url = format!(
"{}/orgs/{}/invitations/{}/resend",
self.baseurl,
encode_path(&id.to_string()),
encode_path(&invite_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "resend_invitation",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
429u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{id}/locations`
Arguments:
- `id`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `search`
*/
pub async fn list_org_locations<'a>(
&'a self,
id: &'a str,
limit: Option<i32>,
offset: Option<i32>,
search: Option<&'a str>,
) -> Result<
ResponseValue<types::PaginatedResponseLocationListItemResponse>,
Error<types::ApiErrorResponse>,
> {
let url = format!(
"{}/orgs/{}/locations",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new("search", &search))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_org_locations",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Create a location. Quota: if the address is geocoded, consumes 1 from `geocoding_requests` (unit: count, per day and per month).
Sends a `POST` request to `/orgs/{id}/locations`
*/
pub async fn create_org_location<'a>(
&'a self,
id: &'a str,
body: &'a types::CreateLocationRequest,
) -> Result<ResponseValue<types::LocationResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/locations",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_org_location",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
503u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get current user's permissions for an organization
Sends a `GET` request to `/orgs/{id}/permissions`
*/
pub async fn get_org_permissions<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::OrgPermissionsResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/permissions",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_org_permissions",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{id}/privacy`
*/
pub async fn get_org_privacy<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::OrgPrivacySettingsResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/privacy",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_org_privacy",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PATCH` request to `/orgs/{id}/privacy`
*/
pub async fn patch_org_privacy<'a>(
&'a self,
id: &'a str,
body: &'a types::PatchOrgPrivacySettingsRequest,
) -> Result<ResponseValue<types::OrgPrivacySettingsResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/privacy",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "patch_org_privacy",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Permanently delete (purge) an organization
Sends a `DELETE` request to `/orgs/{id}/purge`
*/
pub async fn hard_delete_org<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
) -> Result<ResponseValue<types::OrganizationResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/purge",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "hard_delete_org",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/account-merges`
*/
pub async fn org_propose_account_merge<'a>(
&'a self,
org_id: &'a str,
body: &'a types::OrgProposeMergeRequest,
) -> Result<ResponseValue<types::OrgProposeMergeResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/account-merges",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "org_propose_account_merge",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/aliases`
*/
pub async fn list_aliases<'a>(
&'a self,
org_id: &'a str,
resource_id: Option<&'a str>,
resource_type: Option<&'a str>,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/orgs/{}/aliases",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.query(&progenitor_client::QueryParam::new(
"resource_id",
&resource_id,
))
.query(&progenitor_client::QueryParam::new(
"resource_type",
&resource_type,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_aliases",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/aliases`
*/
pub async fn create_alias<'a>(
&'a self,
org_id: &'a str,
body: &'a types::CreateAliasRequest,
) -> Result<ResponseValue<types::AliasResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/aliases",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_alias",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/orgs/{org_id}/aliases/{id}`
*/
pub async fn delete_alias<'a>(
&'a self,
org_id: &'a str,
id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/orgs/{}/aliases/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_alias",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/audit/events`
Arguments:
- `org_id`
- `actor_guest_id`: Filter to a single guest fingerprint. Disjoint from `actor_user_id`.
- `actor_kind`
- `actor_user_id`
- `correlation_id`
- `cursor`: Opaque cursor from a previous page's `next_cursor`.
- `door_name`: Case-insensitive substring match on the snapshotted door name
(`details.door_name`), e.g. `lobby`. Lets the Activity table answer "who opened
this door" across every event that names it.
- `event_type`
- `limit`: Page size (default 50, max 200).
- `occurred_after`: RFC 3339 lower bound (inclusive). Must be within the 30-day hot window.
- `occurred_before`: RFC 3339 upper bound (inclusive).
- `org_scope`: Organization scope for resource events. Descendants are included by default.
- `outcome`
- `resource_id`
- `resource_name`: Case-insensitive substring match on the resource's snapshotted display name
(`details.resource_name`), e.g. `shelly`.
- `resource_type`
- `target_id`: Exact match against the snapshotted portal target ID (`details.public_portal_id`).
*/
pub async fn list_audit_events<'a>(
&'a self,
org_id: &'a str,
actor_guest_id: Option<&'a str>,
actor_kind: Option<&'a str>,
actor_user_id: Option<&'a str>,
correlation_id: Option<&'a str>,
cursor: Option<&'a str>,
door_name: Option<&'a str>,
event_type: Option<&'a str>,
limit: Option<i32>,
occurred_after: Option<&'a str>,
occurred_before: Option<&'a str>,
org_scope: Option<&'a str>,
outcome: Option<&'a str>,
resource_id: Option<&'a str>,
resource_name: Option<&'a str>,
resource_type: Option<&'a str>,
target_id: Option<&'a str>,
) -> Result<ResponseValue<types::AuditEventsPage>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/audit/events",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"actor_guest_id",
&actor_guest_id,
))
.query(&progenitor_client::QueryParam::new(
"actor_kind",
&actor_kind,
))
.query(&progenitor_client::QueryParam::new(
"actor_user_id",
&actor_user_id,
))
.query(&progenitor_client::QueryParam::new(
"correlation_id",
&correlation_id,
))
.query(&progenitor_client::QueryParam::new("cursor", &cursor))
.query(&progenitor_client::QueryParam::new("door_name", &door_name))
.query(&progenitor_client::QueryParam::new(
"event_type",
&event_type,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new(
"occurred_after",
&occurred_after,
))
.query(&progenitor_client::QueryParam::new(
"occurred_before",
&occurred_before,
))
.query(&progenitor_client::QueryParam::new("org_scope", &org_scope))
.query(&progenitor_client::QueryParam::new("outcome", &outcome))
.query(&progenitor_client::QueryParam::new(
"resource_id",
&resource_id,
))
.query(&progenitor_client::QueryParam::new(
"resource_name",
&resource_name,
))
.query(&progenitor_client::QueryParam::new(
"resource_type",
&resource_type,
))
.query(&progenitor_client::QueryParam::new("target_id", &target_id))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_audit_events",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/audit/exports`
*/
pub async fn list_audit_exports<'a>(
&'a self,
org_id: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::AuditExportJob>>, Error<()>> {
let url = format!(
"{}/orgs/{}/audit/exports",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_audit_exports",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/audit/exports`
*/
pub async fn create_audit_export<'a>(
&'a self,
org_id: &'a str,
body: &'a types::CreateAuditExportRequest,
) -> Result<ResponseValue<types::AuditExportJob>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/audit/exports",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_audit_export",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
202u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/audit/exports/{job_id}`
*/
pub async fn get_audit_export<'a>(
&'a self,
org_id: &'a str,
job_id: &'a str,
) -> Result<ResponseValue<types::AuditExportJob>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/audit/exports/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&job_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_audit_export",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/billing-accounts`
*/
pub async fn list_billing_accounts<'a>(
&'a self,
org_id: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::BillingAccount>>, Error<()>> {
let url = format!(
"{}/orgs/{}/billing-accounts",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_billing_accounts",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/billing-accounts`
*/
pub async fn create_billing_account<'a>(
&'a self,
org_id: &'a str,
body: &'a types::CreateBillingAccountRequest,
) -> Result<ResponseValue<types::BillingAccount>, Error<()>> {
let url = format!(
"{}/orgs/{}/billing-accounts",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_billing_account",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/billing-accounts/{account_id}/members`
*/
pub async fn add_billing_account_member<'a>(
&'a self,
org_id: &'a str,
account_id: &'a str,
body: &'a types::AddBillingMemberRequest,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/billing-accounts/{}/members",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&account_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "add_billing_account_member",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/connectors/pms`
*/
pub async fn create_pms_connector<'a>(
&'a self,
org_id: &'a str,
body: &'a types::CreatePmsConnectorRequest,
) -> Result<ResponseValue<types::CreatePmsConnectorResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/connectors/pms",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_pms_connector",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/copilot/chat`
*/
pub async fn copilot_chat<'a>(
&'a self,
org_id: &'a str,
body: &'a types::CopilotChatRequest,
) -> Result<ResponseValue<types::CopilotChatResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/copilot/chat",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "copilot_chat",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/copilot/commit`
*/
pub async fn copilot_commit<'a>(
&'a self,
org_id: &'a str,
body: &'a types::CopilotCommitRequest,
) -> Result<ResponseValue<types::CopilotCommitResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/copilot/commit",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "copilot_commit",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/effective-policies`
*/
pub async fn get_org_effective_policies<'a>(
&'a self,
org_id: &'a str,
integration_id: Option<&'a str>,
) -> Result<ResponseValue<types::EffectivePoliciesResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/effective-policies",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"integration_id",
&integration_id,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_org_effective_policies",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List groups linked into an org
Sends a `GET` request to `/orgs/{org_id}/groups`
*/
pub async fn list_org_groups<'a>(
&'a self,
org_id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::GroupResponse>>, Error<()>> {
let url = format!(
"{}/orgs/{}/groups",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_org_groups",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Create a group in the acting org, which becomes its home org
Sends a `POST` request to `/orgs/{org_id}/groups`
*/
pub async fn create_group<'a>(
&'a self,
org_id: &'a str,
x_org: &'a str,
body: &'a types::CreateGroupPayload,
) -> Result<ResponseValue<types::GroupResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/groups",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_group",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
500u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/perception/lpr`
*/
pub async fn perception_lpr<'a>(
&'a self,
org_id: &'a str,
body: &'a types::PerceptionLprRequest,
) -> Result<ResponseValue<types::PerceptionActionResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/perception/lpr",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "perception_lpr",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/perception/visitor-present`
*/
pub async fn perception_visitor_present<'a>(
&'a self,
org_id: &'a str,
body: &'a types::PerceptionVisitorRequest,
) -> Result<ResponseValue<types::PerceptionActionResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/perception/visitor-present",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "perception_visitor_present",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/policies`
*/
pub async fn list_org_policies<'a>(
&'a self,
org_id: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::PolicyResponse>>, Error<()>> {
let url = format!(
"{}/orgs/{}/policies",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_org_policies",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/policies`
*/
pub async fn create_org_policy<'a>(
&'a self,
org_id: &'a str,
body: &'a types::CreatePolicyRequest,
) -> Result<ResponseValue<types::PolicyResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/policies",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_org_policy",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/orgs/{org_id}/policies/{id}`
*/
pub async fn delete_org_policy<'a>(
&'a self,
org_id: &'a str,
id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/policies/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_org_policy",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PATCH` request to `/orgs/{org_id}/policies/{id}`
*/
pub async fn update_org_policy<'a>(
&'a self,
org_id: &'a str,
id: &'a str,
body: &'a types::UpdatePolicyRequest,
) -> Result<ResponseValue<types::PolicyResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/policies/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_org_policy",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List pending policy approvals. `required_count` is the effective approval_threshold count (maximum across applicable enforcing org, integration, and device rows; disabled and audit_only rows are ignored).
Sends a `GET` request to `/orgs/{org_id}/policy-approvals`
*/
pub async fn list_policy_approvals<'a>(
&'a self,
org_id: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::ApprovalRequestResponse>>, Error<()>> {
let url = format!(
"{}/orgs/{}/policy-approvals",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_policy_approvals",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/policy-approvals/{id}/approve`
*/
pub async fn approve_policy_approval<'a>(
&'a self,
org_id: &'a str,
id: &'a str,
) -> Result<ResponseValue<types::ApprovalDecisionResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/orgs/{}/policy-approvals/{}/approve",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "approve_policy_approval",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/policy-approvals/{id}/deny`
*/
pub async fn deny_policy_approval<'a>(
&'a self,
org_id: &'a str,
id: &'a str,
) -> Result<ResponseValue<types::ApprovalDecisionResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/orgs/{}/policy-approvals/{}/deny",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "deny_policy_approval",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/resolve`
*/
pub async fn resolve_org_query<'a>(
&'a self,
org_id: &'a str,
body: &'a types::ResolveRequest,
) -> Result<ResponseValue<types::ResolveResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/resolve",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "resolve_org_query",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/skills`
*/
pub async fn list_skills<'a>(
&'a self,
org_id: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/orgs/{}/skills",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self.client.get(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "list_skills",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/skills`
*/
pub async fn create_skill<'a>(
&'a self,
org_id: &'a str,
body: &'a types::CreateSkillRequest,
) -> Result<ResponseValue<types::SkillResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/skills",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_skill",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/store-products`
*/
pub async fn list_products<'a>(
&'a self,
org_id: &'a str,
include_deleted: Option<bool>,
limit: Option<i32>,
offset: Option<i32>,
) -> Result<ResponseValue<types::PaginatedResponseStoreProduct>, Error<()>> {
let url = format!(
"{}/orgs/{}/store-products",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_products",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/store-products`
*/
pub async fn create_product<'a>(
&'a self,
org_id: &'a str,
body: &'a types::ProductRequest,
) -> Result<ResponseValue<types::StoreProduct>, Error<()>> {
let url = format!(
"{}/orgs/{}/store-products",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_product",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/orgs/{org_id}/store-products/{product_id}`
*/
pub async fn delete_product<'a>(
&'a self,
org_id: &'a str,
product_id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/store-products/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&product_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_product",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PATCH` request to `/orgs/{org_id}/store-products/{product_id}`
*/
pub async fn update_product<'a>(
&'a self,
org_id: &'a str,
product_id: &'a str,
body: &'a types::ProductRequest,
) -> Result<ResponseValue<types::StoreProduct>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/store-products/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&product_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_product",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/stores`
*/
pub async fn list_stores<'a>(
&'a self,
org_id: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::Store>>, Error<()>> {
let url = format!(
"{}/orgs/{}/stores",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_stores",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/stores`
*/
pub async fn create_store<'a>(
&'a self,
org_id: &'a str,
body: &'a types::CreateStoreRequest,
) -> Result<ResponseValue<types::Store>, Error<()>> {
let url = format!(
"{}/orgs/{}/stores",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_store",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/stores/{store_id}`
*/
pub async fn get_store<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
) -> Result<ResponseValue<types::Store>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/stores/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_store",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/orgs/{org_id}/stores/{store_id}`
*/
pub async fn delete_store<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/stores/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_store",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PATCH` request to `/orgs/{org_id}/stores/{store_id}`
*/
pub async fn update_store<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
body: &'a types::UpdateStoreRequest,
) -> Result<ResponseValue<types::Store>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/stores/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_store",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/stores/{store_id}/inventory`
*/
pub async fn list_inventory<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::StoreInventory>>, Error<()>> {
let url = format!(
"{}/orgs/{}/stores/{}/inventory",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_inventory",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/stores/{store_id}/inventory`
*/
pub async fn create_inventory<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
body: &'a types::CreateInventoryRequest,
) -> Result<ResponseValue<types::StoreInventory>, Error<()>> {
let url = format!(
"{}/orgs/{}/stores/{}/inventory",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_inventory",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/orgs/{org_id}/stores/{store_id}/inventory/{inventory_id}`
*/
pub async fn delete_inventory<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
inventory_id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/stores/{}/inventory/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
encode_path(&inventory_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_inventory",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PATCH` request to `/orgs/{org_id}/stores/{store_id}/inventory/{inventory_id}`
*/
pub async fn update_inventory<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
inventory_id: &'a str,
body: &'a types::UpdateInventoryRequest,
) -> Result<ResponseValue<types::StoreInventory>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/stores/{}/inventory/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
encode_path(&inventory_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_inventory",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/stores/{store_id}/members`
Arguments:
- `org_id`
- `store_id`
- `descending`
- `limit`
- `offset`
- `order_by`: `created_at` (default) or `status`.
- `role`
- `status`
*/
pub async fn list_members<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
descending: Option<bool>,
limit: Option<i32>,
offset: Option<i32>,
order_by: Option<&'a str>,
role: Option<&'a str>,
status: Option<&'a str>,
) -> Result<ResponseValue<types::PaginatedResponseStoreMember>, Error<()>> {
let url = format!(
"{}/orgs/{}/stores/{}/members",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"descending",
&descending,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new("order_by", &order_by))
.query(&progenitor_client::QueryParam::new("role", &role))
.query(&progenitor_client::QueryParam::new("status", &status))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_members",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/stores/{store_id}/members`
*/
pub async fn add_member<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
body: &'a types::AddMemberRequest,
) -> Result<ResponseValue<types::StoreMember>, Error<()>> {
let url = format!(
"{}/orgs/{}/stores/{}/members",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "add_member",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/orgs/{org_id}/stores/{store_id}/members/{user_id}`
*/
pub async fn remove_member<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
user_id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/stores/{}/members/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
encode_path(&user_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "remove_member",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PATCH` request to `/orgs/{org_id}/stores/{store_id}/members/{user_id}`
*/
pub async fn update_member<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
user_id: &'a str,
body: &'a types::UpdateMemberRequest,
) -> Result<ResponseValue<types::StoreMember>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/stores/{}/members/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
encode_path(&user_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_member",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/stores/{store_id}/portals`
*/
pub async fn list_portals<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::StorePortal>>, Error<()>> {
let url = format!(
"{}/orgs/{}/stores/{}/portals",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_portals",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/stores/{store_id}/portals`
*/
pub async fn create_portal<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
body: &'a types::CreatePortalRequest,
) -> Result<ResponseValue<types::StorePortal>, Error<()>> {
let url = format!(
"{}/orgs/{}/stores/{}/portals",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_portal",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/orgs/{org_id}/stores/{store_id}/portals/{portal_id}`
*/
pub async fn delete_portal<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
portal_id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/stores/{}/portals/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
encode_path(&portal_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_portal",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/stores/{store_id}/registration-requests`
*/
pub async fn list_registration_requests<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::StoreRegistrationRequest>>, Error<()>> {
let url = format!(
"{}/orgs/{}/stores/{}/registration-requests",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_registration_requests",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/stores/{store_id}/registration-requests/{request_id}/decide`
*/
pub async fn decide_registration_request<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
request_id: &'a str,
body: &'a types::DecideRegistrationRequest,
) -> Result<ResponseValue<types::StoreRegistrationRequest>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/orgs/{}/stores/{}/registration-requests/{}/decide",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
encode_path(&request_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "decide_registration_request",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/stores/{store_id}/statement`
Arguments:
- `org_id`
- `store_id`
- `limit`
- `month`: `YYYY-MM`; defaults to current month in the store timezone.
- `offset`
*/
pub async fn store_statement<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
limit: Option<i32>,
month: Option<&'a str>,
offset: Option<i32>,
) -> Result<ResponseValue<types::StatementResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/stores/{}/statement",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("month", &month))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "store_statement",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/stores/{store_id}/statement.csv`
Arguments:
- `org_id`
- `store_id`
- `limit`
- `month`: `YYYY-MM`; defaults to current month in the store timezone.
- `offset`
*/
pub async fn store_statement_csv<'a>(
&'a self,
org_id: &'a str,
store_id: &'a str,
limit: Option<i32>,
month: Option<&'a str>,
offset: Option<i32>,
) -> Result<ResponseValue<ByteStream>, Error<()>> {
let url = format!(
"{}/orgs/{}/stores/{}/statement.csv",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("month", &month))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "store_statement_csv",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::stream(response)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/timezone`
*/
pub async fn get_org_timezone<'a>(
&'a self,
org_id: &'a str,
) -> Result<ResponseValue<types::OrgTimezoneResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/timezone",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_org_timezone",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PATCH` request to `/orgs/{org_id}/timezone`
*/
pub async fn set_org_timezone<'a>(
&'a self,
org_id: &'a str,
body: &'a types::SetOrgTimezoneRequest,
) -> Result<ResponseValue<types::OrgTimezoneResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/timezone",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "set_org_timezone",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List users in an organization (and optionally descendant orgs)
Sends a `GET` request to `/orgs/{org_id}/users`
Arguments:
- `org_id`
- `include_deleted`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
- `recursive`
- `x_org`
*/
pub async fn list_org_users<'a>(
&'a self,
org_id: &'a str,
include_deleted: Option<bool>,
limit: Option<i32>,
offset: Option<i32>,
only_deleted: Option<bool>,
recursive: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/users",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new(
"only_deleted",
&only_deleted,
))
.query(&progenitor_client::QueryParam::new("recursive", &recursive))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_org_users",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/orgs/{org_id}/webhooks`
*/
pub async fn list_webhooks<'a>(
&'a self,
org_id: &'a str,
) -> Result<ResponseValue<::std::vec::Vec<types::WebhookEndpoint>>, Error<()>> {
let url = format!(
"{}/orgs/{}/webhooks",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_webhooks",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/webhooks`
*/
pub async fn create_webhook<'a>(
&'a self,
org_id: &'a str,
body: &'a types::CreateWebhookRequest,
) -> Result<ResponseValue<types::CreateWebhookResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/webhooks",
self.baseurl,
encode_path(&org_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_webhook",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
201u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/orgs/{org_id}/webhooks/{id}`
*/
pub async fn delete_webhook<'a>(
&'a self,
org_id: &'a str,
id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/webhooks/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_webhook",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `PATCH` request to `/orgs/{org_id}/webhooks/{id}`
*/
pub async fn update_webhook<'a>(
&'a self,
org_id: &'a str,
id: &'a str,
body: &'a types::UpdateWebhookRequest,
) -> Result<ResponseValue<types::WebhookEndpoint>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/orgs/{}/webhooks/{}",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.patch(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_webhook",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/orgs/{org_id}/webhooks/{id}/test`
*/
pub async fn test_webhook<'a>(
&'a self,
org_id: &'a str,
id: &'a str,
) -> Result<ResponseValue<types::WebhookTestResponse>, Error<()>> {
let url = format!(
"{}/orgs/{}/webhooks/{}/test",
self.baseurl,
encode_path(&org_id.to_string()),
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "test_webhook",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/plans`
*/
pub async fn get_plans<'a>(&'a self) -> Result<ResponseValue<types::PlansResponse>, Error<()>> {
let url = format!("{}/plans", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_plans",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/pms/{connector_id}/inbound`
*/
pub async fn pms_inbound<'a>(
&'a self,
connector_id: &'a str,
body: &'a types::PmsInboundPayload,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/pms/{}/inbound",
self.baseurl,
encode_path(&connector_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "pms_inbound",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
202u16 => Ok(ResponseValue::empty(response)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/public/access/invites/{inviteToken}`
*/
pub async fn get_public_invite<'a>(
&'a self,
invite_token: &'a str,
device_id: Option<&'a str>,
) -> Result<ResponseValue<types::PublicInviteResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/access/invites/{}",
self.baseurl,
encode_path(&invite_token.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("device_id", &device_id))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_public_invite",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/public/access/invites/{inviteToken}/claim`
*/
pub async fn post_public_invite_claim<'a>(
&'a self,
invite_token: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/access/invites/{}/claim",
self.baseurl,
encode_path(&invite_token.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_public_invite_claim",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Execute an access invite action (e.g. open a door). Quota: a door open consumes 1 from `door_opens` (unit: count, per day and per month). May be delayed (response carries a `degradation` warning) when the org is over capacity, but never blocked.
Sends a `POST` request to `/public/access/invites/{inviteToken}/execute`
*/
pub async fn post_public_invite_execute<'a>(
&'a self,
invite_token: &'a str,
body: &'a types::PublicInviteExecuteRequest,
) -> Result<ResponseValue<types::PublicInviteExecuteResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/public/access/invites/{}/execute",
self.baseurl,
encode_path(&invite_token.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_public_invite_execute",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/public/access/invites/{inviteToken}/otp/start`
*/
pub async fn post_public_invite_otp_start<'a>(
&'a self,
invite_token: &'a str,
body: &'a types::PublicInviteOtpStartRequest,
) -> Result<ResponseValue<types::PublicInviteOtpStartResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/public/access/invites/{}/otp/start",
self.baseurl,
encode_path(&invite_token.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_public_invite_otp_start",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/public/access/invites/{inviteToken}/photo`
*/
pub async fn get_public_invite_photo<'a>(
&'a self,
invite_token: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/access/invites/{}/photo",
self.baseurl,
encode_path(&invite_token.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_public_invite_photo",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/public/access/invites/{inviteToken}/renewal`
*/
pub async fn post_public_invite_renewal<'a>(
&'a self,
invite_token: &'a str,
body: &'a types::PublicInviteRenewalRequest,
) -> Result<ResponseValue<types::PublicInviteRenewalResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/public/access/invites/{}/renewal",
self.baseurl,
encode_path(&invite_token.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_public_invite_renewal",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/public/access/invites/{inviteToken}/session`
*/
pub async fn post_public_invite_session<'a>(
&'a self,
invite_token: &'a str,
) -> Result<ResponseValue<types::PublicInviteSessionResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/public/access/invites/{}/session",
self.baseurl,
encode_path(&invite_token.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_public_invite_session",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Fetch a public portal's config. Quota: consumes 1 from `portal_views` (unit: count, per day).
Sends a `GET` request to `/public/access/portals/{publicPortalId}`
*/
pub async fn get_public_portal<'a>(
&'a self,
public_portal_id: &'a str,
) -> Result<ResponseValue<types::PublicPortalResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/access/portals/{}",
self.baseurl,
encode_path(&public_portal_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_public_portal",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/public/access/portals/{publicPortalId}/lights`
*/
pub async fn post_public_portal_lights<'a>(
&'a self,
public_portal_id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/access/portals/{}/lights",
self.baseurl,
encode_path(&public_portal_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_public_portal_lights",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Open a door via a public portal. Quota: consumes 1 from `door_opens` (unit: count, per day and per month). When the org is over capacity the open may be delayed (response carries a `degradation` warning) but is never blocked.
Sends a `POST` request to `/public/access/portals/{publicPortalId}/open`
*/
pub async fn post_public_portal_open<'a>(
&'a self,
public_portal_id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/access/portals/{}/open",
self.baseurl,
encode_path(&public_portal_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_public_portal_open",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/public/access/portals/{publicPortalId}/reachable`
*/
pub async fn get_public_portal_reachable<'a>(
&'a self,
public_portal_id: &'a str,
) -> Result<ResponseValue<types::PublicPortalReachableResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/public/access/portals/{}/reachable",
self.baseurl,
encode_path(&public_portal_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_public_portal_reachable",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Start a live video access session. Quota: consumes 1 from `video_sessions` (unit: count, per month); session call time accrues against `video_session_duration_seconds` (unit: seconds, per session — shown to users as video chat minutes).
Sends a `POST` request to `/public/access/portals/{publicPortalId}/sessions`
*/
pub async fn post_public_portal_sessions<'a>(
&'a self,
public_portal_id: &'a str,
body: &'a types::PublicPortalCreateSessionRequest,
) -> Result<
ResponseValue<types::PublicPortalCreateSessionResponse>,
Error<types::ApiErrorResponse>,
> {
let url = format!(
"{}/public/access/portals/{}/sessions",
self.baseurl,
encode_path(&public_portal_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_public_portal_sessions",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/public/access/portals/{publicPortalId}/targets`
*/
pub async fn get_public_portal_targets<'a>(
&'a self,
public_portal_id: &'a str,
) -> Result<ResponseValue<types::PublicPortalTargetsResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/public/access/portals/{}/targets",
self.baseurl,
encode_path(&public_portal_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_public_portal_targets",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/public/access/sessions/{sessionId}`
Arguments:
- `session_id`
- `token`: Session token (alternative to Bearer when headers stripped)
*/
pub async fn get_public_session<'a>(
&'a self,
session_id: &'a str,
token: Option<&'a str>,
) -> Result<ResponseValue<types::PublicSessionResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/access/sessions/{}",
self.baseurl,
encode_path(&session_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("token", &token))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_public_session",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Caller hangs up while ringing so callees polling GET session can dismiss incoming UI
Sends a `POST` request to `/public/access/sessions/{sessionId}/cancel`
*/
pub async fn post_public_session_cancel<'a>(
&'a self,
session_id: &'a str,
token: Option<&'a str>,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/access/sessions/{}/cancel",
self.baseurl,
encode_path(&session_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("token", &token))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_public_session_cancel",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Callee rejects the ring before answering; caller can observe `state` via GET session
Sends a `POST` request to `/public/access/sessions/{sessionId}/decline`
*/
pub async fn post_public_session_decline<'a>(
&'a self,
session_id: &'a str,
token: Option<&'a str>,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/access/sessions/{}/decline",
self.baseurl,
encode_path(&session_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("token", &token))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_public_session_decline",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/public/access/sessions/{sessionId}/lights`
*/
pub async fn post_public_session_lights<'a>(
&'a self,
session_id: &'a str,
token: Option<&'a str>,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/access/sessions/{}/lights",
self.baseurl,
encode_path(&session_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("token", &token))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_public_session_lights",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Caller notifies listing members with the chat message text (Web Push)
Sends a `POST` request to `/public/access/sessions/{sessionId}/notify-message`
*/
pub async fn post_public_session_notify_message<'a>(
&'a self,
session_id: &'a str,
token: Option<&'a str>,
body: &'a types::NotifyPortalMessageBody,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/access/sessions/{}/notify-message",
self.baseurl,
encode_path(&session_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new("token", &token))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_public_session_notify_message",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Open a door from within a live session. Quota: consumes 1 from `door_opens` (unit: count, per day and per month). May be delayed (response carries a `degradation` warning) when the org is over capacity, but never blocked.
Sends a `POST` request to `/public/access/sessions/{sessionId}/open`
*/
pub async fn post_public_session_open<'a>(
&'a self,
session_id: &'a str,
token: Option<&'a str>,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/access/sessions/{}/open",
self.baseurl,
encode_path(&session_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("token", &token))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_public_session_open",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/public/access/sessions/{sessionId}/streams`
*/
pub async fn get_public_session_streams<'a>(
&'a self,
session_id: &'a str,
token: Option<&'a str>,
) -> Result<ResponseValue<types::PublicSessionStreamsResponse>, Error<types::ApiErrorResponse>>
{
let url = format!(
"{}/public/access/sessions/{}/streams",
self.baseurl,
encode_path(&session_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("token", &token))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_public_session_streams",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/public/store/{publicStoreId}`
*/
pub async fn get_public_store<'a>(
&'a self,
public_store_id: &'a str,
) -> Result<ResponseValue<types::PublicStoreResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/store/{}",
self.baseurl,
encode_path(&public_store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_public_store",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/public/store/{publicStoreId}/register`
*/
pub async fn register_to_store<'a>(
&'a self,
public_store_id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/public/store/{}/register",
self.baseurl,
encode_path(&public_store_id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "register_to_store",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
202u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Resolve a map-picked coordinate to an address, server-side, through the configured maps provider (so the browser key never needs Geocoding API access). Scoped to the X-Org context. Quota: consumes 1 from `geocoding_requests` (unit: count, per day and per month).
Sends a `POST` request to `/reverse-geocode`
*/
pub async fn post_reverse_geocode<'a>(
&'a self,
body: &'a types::ReverseGeocodeRequest,
) -> Result<ResponseValue<types::ReverseGeocodeResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/reverse-geocode", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_reverse_geocode",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
429u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
502u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
503u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**List the caller's own scripting executions, newest first
Sends a `GET` request to `/scripting/executions`
Arguments:
- `limit`: Maximum number of executions to return (1-100, default 20).
*/
pub async fn list_scripting_executions<'a>(
&'a self,
limit: Option<i64>,
) -> Result<
ResponseValue<::std::vec::Vec<types::ScriptingExecutionSummary>>,
Error<types::ApiErrorResponse>,
> {
let url = format!("{}/scripting/executions", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new("limit", &limit))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "list_scripting_executions",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Submit an OpenApp Scripting program for asynchronous execution
Submit an OpenApp Scripting program for asynchronous execution. Quota: consumes 1 from `scripting_executions` (unit: count, per day).
Sends a `POST` request to `/scripting/executions`
*/
pub async fn create_scripting_execution<'a>(
&'a self,
body: &'a types::CreateScriptingExecutionRequest,
) -> Result<ResponseValue<types::ScriptingExecution>, Error<types::ApiErrorResponse>> {
let url = format!("{}/scripting/executions", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_scripting_execution",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
202u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Read one of the caller's own scripting executions
Sends a `GET` request to `/scripting/executions/{id}`
Arguments:
- `id`: Execution id
*/
pub async fn get_scripting_execution<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<types::ScriptingExecution>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/scripting/executions/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_scripting_execution",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Cancel a pending or running execution
Cancellation is cooperative: the worker notices within a few seconds. Effects the program
already applied are **not** rolled back.
Sends a `DELETE` request to `/scripting/executions/{id}`
Arguments:
- `id`: Execution id
*/
pub async fn cancel_scripting_execution<'a>(
&'a self,
id: &'a str,
) -> Result<ResponseValue<()>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/scripting/executions/{}",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "cancel_scripting_execution",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get backend status and version
Sends a `GET` request to `/status`
*/
pub async fn get_backend_status<'a>(
&'a self,
) -> Result<ResponseValue<types::BackendStatus>, Error<()>> {
let url = format!("{}/status", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_backend_status",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Create a user in the organization context
Create a user. Ordinary organization administrators must use `POST /orgs/{id}/invitations` for email/phone contacts. Direct creation is limited to platform administration and initial provisioning. Quota: each org the user is added to consumes 1 from that org's `org_users` (unit: count, lifetime capacity) — capacity-checked before creation (429 `quota_exceeded` when full).
Sends a `POST` request to `/users`
*/
pub async fn create_user<'a>(
&'a self,
include_deleted: Option<bool>,
only_deleted: Option<bool>,
x_org: &'a str,
body: &'a types::CreateUserRequest,
) -> Result<ResponseValue<types::UserResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/users", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.query(&progenitor_client::QueryParam::new(
"only_deleted",
&only_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_user",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Search users by name/email. Requires `users:list` in the org (`X-Org` or `org_id`), or on the root org when `scope=all`
Sends a `GET` request to `/users/search`
Arguments:
- `exclude_ids`: Comma-separated user IDs to exclude
- `limit`
- `offset`
- `org_id`: Filter by org subtree (ignored when `scope=all`).
- `q`: Search text (ILIKE on name and email)
- `scope`: `all`: search every user in the database (requires `users:list` on the root org). Otherwise org-scoped.
*/
pub async fn search_users<'a>(
&'a self,
exclude_ids: Option<&'a str>,
limit: Option<u64>,
offset: Option<u64>,
org_id: Option<&'a str>,
q: Option<&'a str>,
scope: Option<&'a str>,
) -> Result<ResponseValue<types::PaginatedResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/users/search", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"exclude_ids",
&exclude_ids,
))
.query(&progenitor_client::QueryParam::new("limit", &limit))
.query(&progenitor_client::QueryParam::new("offset", &offset))
.query(&progenitor_client::QueryParam::new("org_id", &org_id))
.query(&progenitor_client::QueryParam::new("q", &q))
.query(&progenitor_client::QueryParam::new("scope", &scope))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "search_users",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get a user by ID
Get a user. `roles` is scoped to the `X-Org` context: the request org, its descendants, and its ancestors. Roles in unrelated orgs are omitted.
Sends a `GET` request to `/users/{id}`
*/
pub async fn get_user<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::UserResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/users/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_user",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Update a user by ID
Sends a `PUT` request to `/users/{id}`
*/
pub async fn update_user<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
body: &'a types::UpdateUserRequest,
) -> Result<ResponseValue<types::UserResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/users/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_user",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Soft-delete a user
Sends a `DELETE` request to `/users/{id}`
*/
pub async fn delete_user<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::UserResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/users/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_user",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `GET` request to `/users/{id}/image`
*/
pub async fn get_user_image<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/users/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_user_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `POST` request to `/users/{id}/image`
*/
pub async fn post_user_image<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<types::ResourceImageUrlResponse>, Error<()>> {
let url = format!(
"{}/users/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_user_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
415u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Sends a `DELETE` request to `/users/{id}/image`
*/
pub async fn delete_user_image<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
) -> Result<ResponseValue<()>, Error<()>> {
let url = format!(
"{}/users/{}/image",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self.client.delete(url).headers(header_map).build()?;
let info = OperationInfo {
operation_id: "delete_user_image",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
204u16 => Ok(ResponseValue::empty(response)),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Permanently delete (purge) a user
Sends a `DELETE` request to `/users/{id}/purge`
*/
pub async fn hard_delete_user<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::UserResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/users/{}/purge",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "hard_delete_user",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
409u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Add roles to a user. Requires users:create (or admin) in each org where roles are added
Grant org roles to a user. Quota: adding a user to a new org consumes 1 from that org's `org_users` (unit: count, lifetime capacity) — capacity-checked first (429 `quota_exceeded` when full).
Sends a `POST` request to `/users/{id}/roles`
*/
pub async fn add_roles<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: &'a types::AddRolesRequest,
) -> Result<ResponseValue<types::UserResponse>, Error<()>> {
let url = format!(
"{}/users/{}/roles",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "add_roles",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Delete roles from a user. Requires users:create (or admin) in each org where roles are deleted
Sends a `DELETE` request to `/users/{id}/roles`
*/
pub async fn delete_roles<'a>(
&'a self,
id: &'a str,
x_org: &'a str,
body: &'a types::DeleteRolesRequest,
) -> Result<ResponseValue<types::UserResponse>, Error<()>> {
let url = format!(
"{}/users/{}/roles",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_roles",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
404u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Enrich directory listing data via AI. Quota: consumes 1 from `ai_requests` (unit: count, per day and per month).
Sends a `POST` request to `/virtual-access/directory-listing-enrich`
*/
pub async fn post_virtual_access_directory_listing_enrich<'a>(
&'a self,
x_org: &'a str,
) -> Result<
ResponseValue<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
Error<()>,
> {
let url = format!("{}/virtual-access/directory-listing-enrich", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "post_virtual_access_directory_listing_enrich",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
401u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
403u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
413u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
415u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
429u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
502u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
503u16 => Err(Error::ErrorResponse(ResponseValue::empty(response))),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Create a zone for an integration
Create a zone. Quota: consumes 1 from `zones` (unit: count, lifetime capacity) — capacity-checked before creation (429 `quota_exceeded` when full).
Sends a `POST` request to `/zones`
*/
pub async fn create_zone<'a>(
&'a self,
include_deleted: Option<bool>,
x_org: &'a str,
body: &'a types::CreateZoneRequest,
) -> Result<ResponseValue<types::ZoneResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/zones", self.baseurl,);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.post(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "create_zone",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Get a zone by ID
Sends a `GET` request to `/zones/{id}`
*/
pub async fn get_zone<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::ZoneResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/zones/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.get(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "get_zone",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Update a zone
Sends a `PUT` request to `/zones/{id}`
*/
pub async fn update_zone<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
body: &'a types::UpdateZoneRequest,
) -> Result<ResponseValue<types::ZoneResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/zones/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.put(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.json(&body)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "update_zone",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Soft-delete a zone
Sends a `DELETE` request to `/zones/{id}`
*/
pub async fn delete_zone<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::ZoneResponse>, Error<types::ApiErrorResponse>> {
let url = format!("{}/zones/{}", self.baseurl, encode_path(&id.to_string()),);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "delete_zone",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
/**Permanently delete (purge) a zone
Sends a `DELETE` request to `/zones/{id}/purge`
*/
pub async fn hard_delete_zone<'a>(
&'a self,
id: &'a str,
include_deleted: Option<bool>,
x_org: &'a str,
) -> Result<ResponseValue<types::ZoneResponse>, Error<types::ApiErrorResponse>> {
let url = format!(
"{}/zones/{}/purge",
self.baseurl,
encode_path(&id.to_string()),
);
let mut header_map = ::reqwest::header::HeaderMap::with_capacity(2usize);
header_map.append(
::reqwest::header::HeaderName::from_static("api-version"),
::reqwest::header::HeaderValue::from_static(Self::api_version()),
);
header_map.append("X-Org", x_org.to_string().try_into()?);
#[allow(unused_mut)]
let mut request = self
.client
.delete(url)
.header(
::reqwest::header::ACCEPT,
::reqwest::header::HeaderValue::from_static("application/json"),
)
.query(&progenitor_client::QueryParam::new(
"include_deleted",
&include_deleted,
))
.headers(header_map)
.build()?;
let info = OperationInfo {
operation_id: "hard_delete_zone",
};
self.pre(&mut request, &info).await?;
let result = self.exec(request, &info).await;
self.post(&result, &info).await?;
let response = result?;
match response.status().as_u16() {
200u16 => ResponseValue::from_response(response).await,
400u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
401u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
403u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
404u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
422u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
500u16 => Err(Error::ErrorResponse(
ResponseValue::from_response(response).await?,
)),
_ => Err(Error::UnexpectedResponse(response)),
}
}
}
/// Items consumers will typically use such as the Client.
pub mod prelude {
#[allow(unused_imports)]
pub use super::Client;
}