Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

Client for OpenApp API

IoT Device Management (Gates/Doors/Provisioning) API

Version: v1

Implementations§

Source§

impl Client

Source

pub fn new(baseurl: &str) -> Self

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.

Source

pub fn new_with_client(baseurl: &str, client: Client) -> Self

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.

Source§

impl Client

Source

pub async fn get_admin_quota_overrides<'a>( &'a self, ) -> Result<ResponseValue<()>, Error<()>>

Sends a GET request to /admin/quota_overrides

Source

pub async fn post_admin_quota_override<'a>( &'a self, body: &'a QuotaOverrideRequest, ) -> Result<ResponseValue<()>, Error<()>>

Sends a POST request to /admin/quota_overrides

Source

pub async fn list_api_keys<'a>( &'a self, ) -> Result<ResponseValue<Vec<ApiKeyListItem>>, Error<()>>

Sends a GET request to /api-keys

Source

pub async fn create_api_key<'a>( &'a self, body: &'a CreateApiKeyRequest, ) -> Result<ResponseValue<CreateApiKeyResponse>, Error<()>>

Sends a POST request to /api-keys

Source

pub async fn revoke_api_key<'a>( &'a self, id: &'a str, ) -> Result<ResponseValue<()>, Error<()>>

Sends a DELETE request to /api-keys/{id}

Arguments:
- `id`: API key ID
Source

pub async fn update_api_key<'a>( &'a self, id: &'a str, body: &'a UpdateApiKeyRequest, ) -> Result<ResponseValue<()>, Error<()>>

Sends a PATCH request to /api-keys/{id}

Arguments:
- `id`: API key ID
- `body`
Source

pub async fn purge_api_key<'a>( &'a self, id: &'a str, ) -> Result<ResponseValue<()>, Error<()>>

Sends a DELETE request to /api-keys/{id}/purge

Arguments:
- `id`: API key ID
Source

pub async fn restore_api_key<'a>( &'a self, id: &'a str, ) -> Result<ResponseValue<()>, Error<()>>

Sends a POST request to /api-keys/{id}/restore

Arguments:
- `id`: API key ID
Source

pub async fn get_auth_kratos_identity<'a>( &'a self, ) -> Result<ResponseValue<()>, Error<()>>

Same as [get_auth_session] but under a path that is not stripped by some edge WAF rules (which block URL segments named session or whoami)

Sends a `GET` request to `/auth/kratos-identity`
Source

pub async fn post_auth_logout<'a>( &'a self, ) -> Result<ResponseValue<()>, Error<()>>

Logout: clear session cookie so the browser becomes logged out

Sends a `POST` request to `/auth/logout`
Source

pub async fn get_auth_provisioned<'a>( &'a self, ) -> Result<ResponseValue<()>, Error<()>>

Lightweight provisioning check. Returns 204 if user is provisioned, 401 if not. No DB access; relies on X-User header set by middleware when provisioned

Sends a `GET` request to `/auth/provisioned`
Source

pub async fn get_auth_session<'a>( &'a self, ) -> Result<ResponseValue<()>, Error<()>>

Get current Kratos session if present, otherwise null. Public endpoint (anonymous allowed)

Sends a `GET` request to `/auth/session`
Source

pub async fn post_auth_sign_out<'a>( &'a self, ) -> Result<ResponseValue<()>, Error<()>>

Sends a POST request to /auth/sign-out

Source

pub async fn get_auth_whoami<'a>( &'a self, ) -> Result<ResponseValue<()>, Error<()>>

Sends a GET request to /auth/whoami

Source

pub async fn post_billing_webhook<'a, B: Into<Body>>( &'a self, provider: &'a str, body: B, ) -> Result<ResponseValue<BillingWebhookResponse>, Error<()>>

Sends a POST request to /billing/webhooks/{provider}

Arguments:
- `provider`
- `body`: Raw billing provider webhook payload
Source

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: bool, include_metadata: bool, include_stale: Option<bool>, integration_id: Option<&'a str>, limit: Option<i32>, offset: Option<i32>, only_deleted: bool, q: Option<&'a str>, x_org: &'a str, ) -> Result<ResponseValue<Vec<DeviceResponse>>, Error<ApiErrorResponse>>

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_metadata`
- `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.
- `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).
- `x_org`
Source

pub async fn create_device<'a>( &'a self, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, body: &'a CreateDeviceRequest, ) -> Result<ResponseValue<DeviceResponse>, Error<ApiErrorResponse>>

Create a device in an organization

Sends a `POST` request to `/devices`

Arguments:
- `include_deleted`
- `include_metadata`
- `x_org`: Organization context (required)
- `body`
Source

pub async fn list_device_apartment_floors<'a>( &'a self, device_id: &'a str, x_org: &'a str, ) -> Result<ResponseValue<ApartmentFloorListResponse>, Error<ApiErrorResponse>>

Sends a GET request to /devices/{device_id}/apartment-floors

Source

pub async fn list_device_entities<'a>( &'a self, device_id: &'a str, entity_type: Option<&'a str>, include_deleted: Option<bool>, include_metadata: Option<bool>, limit: Option<i32>, offset: Option<i32>, only_deleted: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<PaginatedResponse>, Error<ApiErrorResponse>>

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. `apartment`).
- `include_deleted`
- `include_metadata`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
- `x_org`
Source

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<EntityMetadataDefinitionResponse>, Error<()>>

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`
Source

pub async fn get_device<'a>( &'a self, id: &'a str, include_deleted: bool, include_metadata: bool, include_stale: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<DeviceResponse>, Error<ApiErrorResponse>>

Get a device by ID

Sends a `GET` request to `/devices/{id}`

Arguments:
- `id`: Device ULID
- `include_deleted`
- `include_metadata`
- `include_stale`: When true, include `stale` if the integration provider supports stale device detection.
- `x_org`
Source

pub async fn update_device<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, body: &'a UpdateDeviceRequest, ) -> Result<ResponseValue<DeviceResponse>, Error<ApiErrorResponse>>

Update a device

Sends a `PUT` request to `/devices/{id}`
Source

pub async fn delete_device<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, recursive: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<DeviceResponse>, Error<ApiErrorResponse>>

Soft-delete a device

Sends a `DELETE` request to `/devices/{id}`

Arguments:
- `id`
- `include_deleted`
- `include_metadata`
- `recursive`: If true, delete (or purge) all device entities first.
- `x_org`
Source

pub async fn get_door_restrictions<'a>( &'a self, id: &'a str, ) -> Result<ResponseValue<DoorRestrictionsResponse>, Error<()>>

GET /devices/{id}/door-restrictions — list apartment entity IDs allowed to open this door. Empty = no restrictions (all building residents can open). Only for virtual_access_portal devices

Sends a `GET` request to `/devices/{id}/door-restrictions`
Source

pub async fn get_device_metadata_definition<'a>( &'a self, id: &'a str, x_org: &'a str, ) -> Result<ResponseValue<DeviceMetadataDefinitionResponse>, Error<()>>

Get provider-specific JSON schema for device_metadata, for a given device

Sends a `GET` request to `/devices/{id}/metadata-definition`
Source

pub async fn hard_delete_device<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, recursive: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<DeviceResponse>, Error<ApiErrorResponse>>

Permanently delete (purge) a device

Sends a `DELETE` request to `/devices/{id}/purge`

Arguments:
- `id`
- `include_deleted`
- `include_metadata`
- `recursive`: If true, delete (or purge) all device entities first.
- `x_org`
Source

pub async fn restore_device<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<DeviceResponse>, Error<ApiErrorResponse>>

Restore a soft-deleted device

Sends a `POST` request to `/devices/{id}/restore`
Source

pub async fn list_entities<'a>( &'a self, include_deleted: bool, include_metadata: bool, limit: Option<i32>, offset: Option<i32>, only_deleted: bool, zone_id: Option<&'a str>, x_org: &'a str, ) -> Result<ResponseValue<PaginatedResponse>, Error<ApiErrorResponse>>

Sends a GET request to /entities

Arguments:
- `include_deleted`
- `include_metadata`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
- `zone_id`: Optional filter: only entities in this zone.
- `x_org`
Source

pub async fn create_entity<'a>( &'a self, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, body: &'a CreateEntityRequest, ) -> Result<ResponseValue<EntityResponse>, Error<ApiErrorResponse>>

Create an entity on a device

Sends a `POST` request to `/entities`
Source

pub async fn get_entity<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<EntityResponse>, Error<ApiErrorResponse>>

Get an entity by ID

Sends a `GET` request to `/entities/{id}`
Source

pub async fn update_entity<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, body: &'a UpdateEntityRequest, ) -> Result<ResponseValue<EntityResponse>, Error<ApiErrorResponse>>

Update an entity

Sends a `PUT` request to `/entities/{id}`
Source

pub async fn delete_entity<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<EntityResponse>, Error<ApiErrorResponse>>

Soft-delete an entity

Sends a `DELETE` request to `/entities/{id}`
Source

pub async fn patch_entity<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, body: &'a PatchEntityRequest, ) -> Result<ResponseValue<EntityResponse>, Error<ApiErrorResponse>>

Partially update entity metadata (shallow merge). Other fields (name, etc.) are unchanged

Sends a `PATCH` request to `/entities/{id}`
Source

pub async fn execute_entity_action<'a>( &'a self, id: &'a str, action_id: &'a str, body: &'a Value, ) -> Result<ResponseValue<()>, Error<()>>

Execute an entity action using the integration engine

Sends a `POST` request to `/entities/{id}/actions/{action_id}`
Source

pub async fn get_entity_metadata_definition<'a>( &'a self, id: &'a str, x_org: &'a str, ) -> Result<ResponseValue<EntityMetadataDefinitionResponse>, Error<()>>

Get provider-specific JSON schema for entity_metadata, for a given entity

Sends a `GET` request to `/entities/{id}/metadata-definition`
Source

pub async fn hard_delete_entity<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<EntityResponse>, Error<ApiErrorResponse>>

Permanently delete (purge) an entity

Sends a `DELETE` request to `/entities/{id}/purge`
Source

pub async fn restore_entity<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<EntityResponse>, Error<ApiErrorResponse>>

Restore a soft-deleted entity

Sends a `POST` request to `/entities/{id}/restore`
Source

pub async fn get_eula<'a>( &'a self, ) -> Result<ResponseValue<EulaResponse>, Error<()>>

Get EULA text. Anonymous GET is allowed at the edge so reading the agreement is never blocked by auth

Sends a `GET` request to `/eula`
Source

pub async fn accept_eula<'a>( &'a self, body: &'a AcceptEulaRequest, ) -> Result<ResponseValue<AcceptEulaResponse>, Error<()>>

Accept EULA and provision user. Requires X-User-Email (set by Oathkeeper cookie_session)

Sends a `POST` request to `/eula/accept`
Source

pub async fn list_integrations<'a>( &'a self, include_deleted: bool, include_metadata: bool, limit: Option<i32>, offset: Option<i32>, only_deleted: bool, provider_type: Option<&'a str>, q: Option<&'a str>, x_org: &'a str, ) -> Result<ResponseValue<PaginatedResponse>, Error<ApiErrorResponse>>

List integrations for the organization context (X-Org)

Sends a `GET` request to `/integrations`

Arguments:
- `include_deleted`
- `include_metadata`
- `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`
Source

pub async fn create_integration<'a>( &'a self, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, body: &'a CreateIntegrationRequest, ) -> Result<ResponseValue<IntegrationResponse>, Error<()>>

Create an integration in an organization

Sends a `POST` request to `/integrations`
Source

pub async fn get_access_portal_by_id<'a>( &'a self, portal_id: &'a str, x_org: &'a str, ) -> Result<ResponseValue<GetAccessPortalResponse>, Error<()>>

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}`
Source

pub async fn list_integration_provider_types<'a>( &'a self, ) -> Result<ResponseValue<HashMap<String, HashMap<String, String>>>, Error<()>>

List supported integration provider types (canonical values)

Sends a `GET` request to `/integrations/provider-types`
Source

pub async fn get_integration_provider_definition<'a>( &'a self, provider_type: &'a str, ) -> Result<ResponseValue<()>, Error<()>>

Get a provider definition (capabilities, actions, schemas) for UI/CLI

Sends a `GET` request to `/integrations/provider-types/{provider_type}/definition`
Source

pub async fn get_integration<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<IntegrationResponse>, Error<ApiErrorResponse>>

Sends a GET request to /integrations/{id}

Source

pub async fn update_integration<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, body: &'a UpdateIntegrationRequest, ) -> Result<ResponseValue<IntegrationResponse>, Error<()>>

Update an integration

Sends a `PUT` request to `/integrations/{id}`
Source

pub async fn list_integration_access_invites<'a>( &'a self, id: &'a str, x_org: &'a str, ) -> Result<ResponseValue<ListIntegrationAccessInvitesResponse>, Error<ApiErrorResponse>>

List access invites for an integration

Sends a `GET` request to `/integrations/{id}/access-invites`
Source

pub async fn create_integration_access_invite<'a>( &'a self, id: &'a str, x_org: &'a str, body: &'a CreateAccessInviteRequest, ) -> Result<ResponseValue<CreateAccessInviteResponse>, Error<ApiErrorResponse>>

Create an access invite granting portal_open on one or more portals

Sends a `POST` request to `/integrations/{id}/access-invites`
Source

pub async fn update_integration_access_invite<'a>( &'a self, id: &'a str, invite_link_id: &'a str, x_org: &'a str, body: &'a UpdateAccessInviteRequest, ) -> Result<ResponseValue<AccessInviteListItem>, Error<ApiErrorResponse>>

Update an access invite (portals, validity, max_uses). Only active invites can be updated

Sends a `PUT` request to `/integrations/{id}/access-invites/{invite_link_id}`
Source

pub async fn delete_integration_access_invite<'a>( &'a self, id: &'a str, invite_link_id: &'a str, x_org: &'a str, ) -> Result<ResponseValue<()>, Error<()>>

Delete an access invite (permanently)

Sends a `DELETE` request to `/integrations/{id}/access-invites/{invite_link_id}`
Source

pub async fn restore_integration_access_invite<'a>( &'a self, id: &'a str, invite_link_id: &'a str, x_org: &'a str, ) -> Result<ResponseValue<AccessInviteListItem>, Error<ApiErrorResponse>>

Restore (un-revoke) an access invite

Sends a `POST` request to `/integrations/{id}/access-invites/{invite_link_id}/restore`
Source

pub async fn list_integration_access_portals<'a>( &'a self, id: &'a str, x_org: &'a str, ) -> Result<ResponseValue<ListIntegrationAccessPortalsResponse>, Error<()>>

List public access portals for an integration (for admin links to public portal pages)

Sends a `GET` request to `/integrations/{id}/access-portals`
Source

pub async fn create_integration_access_portal<'a>( &'a self, id: &'a str, x_org: &'a str, body: &'a CreateAccessPortalRequest, ) -> Result<ResponseValue<CreateAccessPortalResponse>, Error<()>>

Create a public access portal for an integration

Sends a `POST` request to `/integrations/{id}/access-portals`
Source

pub async fn update_integration_access_portal<'a>( &'a self, id: &'a str, portal_id: &'a str, x_org: &'a str, body: &'a UpdateAccessPortalRequest, ) -> Result<ResponseValue<AccessPortalListItem>, Error<()>>

Update a public access portal

Sends a `PUT` request to `/integrations/{id}/access-portals/{portal_id}`
Source

pub async fn delete_integration_access_portal<'a>( &'a self, id: &'a str, portal_id: &'a str, x_org: &'a str, ) -> Result<ResponseValue<()>, Error<()>>

Delete a public access portal

Sends a `DELETE` request to `/integrations/{id}/access-portals/{portal_id}`
Source

pub async fn list_building_users<'a>( &'a self, id: &'a str, x_org: &'a str, ) -> Result<ResponseValue<()>, Error<()>>

List building users (users with virtual_access:integration:{id}:* role)

Sends a `GET` request to `/integrations/{id}/building-users`
Source

pub async fn add_building_user<'a>( &'a self, id: &'a str, x_org: &'a str, body: &'a AddBuildingUserPayload, ) -> Result<ResponseValue<()>, Error<()>>

Add user to building (adds org role; creates membership if missing)

Sends a `POST` request to `/integrations/{id}/building-users`
Source

pub async fn delete_building_user<'a>( &'a self, id: &'a str, user_id: &'a str, x_org: &'a str, ) -> Result<ResponseValue<()>, Error<()>>

Remove user from building (removes org roles and apartment assignments)

Sends a `DELETE` request to `/integrations/{id}/building-users/{user_id}`
Source

pub async fn get_integration_device_metadata_schema<'a>( &'a self, id: &'a str, x_org: &'a str, ) -> Result<ResponseValue<IntegrationDeviceMetadataSchemaResponse>, Error<()>>

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`
Source

pub async fn get_integration_discovered_devices<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<Value>, Error<()>>

List devices discovered from the upstream provider for this integration

Sends a `GET` request to `/integrations/{id}/discovered-devices`
Source

pub async fn list_integration_entities<'a>( &'a self, id: &'a str, entity_type: Option<&'a str>, include_deleted: bool, include_metadata: bool, limit: Option<i32>, offset: Option<i32>, only_deleted: bool, x_org: &'a str, ) -> Result<ResponseValue<PaginatedResponseEntityResponse>, Error<ApiErrorResponse>>

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`
- `include_metadata`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
- `x_org`
Source

pub async fn list_integration_ops<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<()>, Error<()>>

List provider-specific ops available for an integration

Sends a `GET` request to `/integrations/{id}/ops`
Source

pub async fn execute_integration_op<'a>( &'a self, id: &'a str, op_id: &'a str, x_org: &'a str, body: &'a Value, ) -> Result<ResponseValue<()>, Error<()>>

Execute a provider-specific op for an integration

Sends a `POST` request to `/integrations/{id}/ops/{op_id}`
Source

pub async fn hard_delete_integration<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<IntegrationResponse>, Error<ApiErrorResponse>>

Permanently delete (purge) an integration

Sends a `DELETE` request to `/integrations/{id}/purge`
Source

pub async fn restore_integration<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<IntegrationResponse>, Error<ApiErrorResponse>>

Restore a soft-deleted integration

Sends a `POST` request to `/integrations/{id}/restore`
Source

pub async fn post_integration_lan_agent_task_spec<'a>( &'a self, integration_id: &'a str, x_org: &'a str, body: &'a LanAgentTaskSpecRequest, ) -> Result<ResponseValue<LanAgentTaskSpecResponse>, Error<()>>

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`
Source

pub async fn get_integration_lan_agent_tasks<'a>( &'a self, integration_id: &'a str, x_org: &'a str, ) -> Result<ResponseValue<()>, Error<()>>

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
Source

pub async fn list_integration_zones<'a>( &'a self, integration_id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, only_deleted: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<Vec<ZoneResponse>>, Error<ApiErrorResponse>>

List zones for an integration

Sends a `GET` request to `/integrations/{integration_id}/zones`
Source

pub async fn post_lan_agent_cli_bootstrap_token<'a>( &'a self, body: &'a LanAgentBootstrapTokenRequest, ) -> Result<ResponseValue<LanAgentBootstrapTokenResponse>, Error<()>>

POST /lan-agent/cli/bootstrap-token — ULID for bootstrap.sh?key=… (JWT in Redis)

Sends a `POST` request to `/lan-agent/cli/bootstrap-token`
Source

pub async fn get_lan_agent_cli_bootstrap_sh<'a>( &'a self, key: &'a str, ) -> Result<ResponseValue<ByteStream>, Error<()>>

GET /lan-agent/cli/bootstrap.sh?key=… — bash that downloads a versioned binary and runs the task

Sends a `GET` request to `/lan-agent/cli/bootstrap.sh`

Arguments:
- `key`: ULID from `POST /lan-agent/cli/bootstrap-token`.
Source

pub async fn post_lan_agent_cli_token<'a>( &'a self, ) -> Result<ResponseValue<LanAgentCliTokenResponse>, Error<()>>

POST /lan-agent/cli/token — session cookie or Bearer; returns JWT for LAN agent (iss=oathkeeper)

Sends a `POST` request to `/lan-agent/cli/token`
Source

pub async fn get_lan_agent_meta<'a>( &'a self, ) -> Result<ResponseValue<LanAgentMetaResponse>, Error<()>>

GET /lan-agent/meta

Sends a `GET` request to `/lan-agent/meta`
Source

pub async fn get_me_apartments<'a>( &'a self, ) -> Result<ResponseValue<MeApartmentsResponse>, Error<()>>

GET /me/apartments — returns apartments the current user is a resident of

Sends a `GET` request to `/me/apartments`
Source

pub async fn get_me_invitations<'a>( &'a self, ) -> Result<ResponseValue<MeInvitationsResponse>, Error<()>>

GET /me/invitations — returns invitations the current user has claimed

Sends a `GET` request to `/me/invitations`
Source

pub async fn get_me_push_subscription_status<'a>( &'a self, ) -> Result<ResponseValue<MePushSubscriptionStatusResponse>, Error<()>>

GET /me/push-subscription-status — returns whether the current user has any push subscription

Sends a `GET` request to `/me/push-subscription-status`
Source

pub async fn post_me_push_subscription<'a>( &'a self, body: &'a PostMePushSubscriptionPayload, ) -> Result<ResponseValue<()>, Error<()>>

POST /me/push-subscriptions — store Web Push subscription for call notifications

Sends a `POST` request to `/me/push-subscriptions`
Source

pub async fn get_me_push_vapid_public_key<'a>( &'a self, ) -> Result<ResponseValue<MePushVapidPublicKeyResponse>, Error<()>>

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`
Source

pub async fn list_orgs<'a>( &'a self, include_deleted: bool, include_metadata: bool, limit: Option<i32>, offset: Option<i32>, only_deleted: bool, ) -> Result<ResponseValue<PaginatedResponse>, Error<ApiErrorResponse>>

List organizations the user has access to

Sends a `GET` request to `/orgs`

Arguments:
- `include_deleted`
- `include_metadata`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
Source

pub async fn create_org<'a>( &'a self, include_deleted: Option<bool>, include_metadata: Option<bool>, body: &'a CreateOrganizationRequest, ) -> Result<ResponseValue<OrganizationResponse>, Error<ApiErrorResponse>>

Create an organization (body: name, description?, parent_id?)

Sends a `POST` request to `/orgs`
Source

pub async fn get_org<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, ) -> Result<ResponseValue<OrganizationResponse>, Error<ApiErrorResponse>>

Get an organization by ID

Sends a `GET` request to `/orgs/{id}`
Source

pub async fn update_org<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, body: &'a UpdateOrganizationRequest, ) -> Result<ResponseValue<OrganizationResponse>, Error<ApiErrorResponse>>

Update an organization (body: name?, description?)

Sends a `PUT` request to `/orgs/{id}`
Source

pub async fn delete_org<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, ) -> Result<ResponseValue<OrganizationResponse>, Error<ApiErrorResponse>>

Soft-delete an organization

Sends a `DELETE` request to `/orgs/{id}`
Source

pub async fn post_org_billing_checkout<'a>( &'a self, id: &'a str, body: &'a CheckoutRequest, ) -> Result<ResponseValue<SubscriptionRef>, Error<()>>

Sends a POST request to /orgs/{id}/billing/checkout

Source

pub async fn get_org_billing_plan<'a>( &'a self, id: &'a str, ) -> Result<ResponseValue<BillingPlanResponse>, Error<()>>

Sends a GET request to /orgs/{id}/billing/plan

Source

pub async fn post_org_billing_portal<'a>( &'a self, id: &'a str, body: &'a PortalRequest, ) -> Result<ResponseValue<PortalResponse>, Error<()>>

Sends a POST request to /orgs/{id}/billing/portal

Source

pub async fn get_org_billing_upgrade_options<'a>( &'a self, id: &'a str, ) -> Result<ResponseValue<PlansResponse>, Error<()>>

Sends a GET request to /orgs/{id}/billing/upgrade-options

Source

pub async fn get_org_billing_usage<'a>( &'a self, id: &'a str, ) -> Result<ResponseValue<QuotaReport>, Error<()>>

Sends a GET request to /orgs/{id}/billing/usage

Source

pub async fn get_org_permissions<'a>( &'a self, id: &'a str, ) -> Result<ResponseValue<OrgPermissionsResponse>, Error<()>>

Get current user’s permissions for an organization

Sends a `GET` request to `/orgs/{id}/permissions`
Source

pub async fn hard_delete_org<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, ) -> Result<ResponseValue<OrganizationResponse>, Error<ApiErrorResponse>>

Permanently delete (purge) an organization

Sends a `DELETE` request to `/orgs/{id}/purge`
Source

pub async fn list_org_users<'a>( &'a self, org_id: &'a str, include_deleted: bool, include_metadata: bool, limit: Option<i32>, offset: Option<i32>, only_deleted: bool, recursive: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<PaginatedResponse>, Error<ApiErrorResponse>>

List users in an organization (and optionally descendant orgs)

Sends a `GET` request to `/orgs/{org_id}/users`

Arguments:
- `org_id`
- `include_deleted`
- `include_metadata`
- `limit`: Number of items per page. Default from config, max 200.
- `offset`: Number of items to skip. Default 0.
- `only_deleted`
- `recursive`
- `x_org`
Source

pub async fn get_plans<'a>( &'a self, ) -> Result<ResponseValue<PlansResponse>, Error<()>>

Sends a GET request to /plans

Source

pub async fn get_public_invite<'a>( &'a self, invite_token: &'a str, ) -> Result<ResponseValue<PublicInviteResponse>, Error<ApiErrorResponse>>

Sends a GET request to /public/access/invites/{inviteToken}

Source

pub async fn post_public_invite_claim<'a>( &'a self, invite_token: &'a str, ) -> Result<ResponseValue<()>, Error<ApiErrorResponse>>

Sends a POST request to /public/access/invites/{inviteToken}/claim

Source

pub async fn post_public_invite_execute<'a>( &'a self, invite_token: &'a str, body: &'a PublicInviteExecuteRequest, ) -> Result<ResponseValue<PublicInviteExecuteResponse>, Error<ApiErrorResponse>>

Sends a POST request to /public/access/invites/{inviteToken}/execute

Source

pub async fn post_public_invite_session<'a>( &'a self, invite_token: &'a str, ) -> Result<ResponseValue<()>, Error<ApiErrorResponse>>

Sends a POST request to /public/access/invites/{inviteToken}/session

Source

pub async fn get_public_portal<'a>( &'a self, public_portal_id: &'a str, ) -> Result<ResponseValue<PublicPortalResponse>, Error<ApiErrorResponse>>

Sends a GET request to /public/access/portals/{publicPortalId}

Source

pub async fn post_public_portal_lights<'a>( &'a self, public_portal_id: &'a str, ) -> Result<ResponseValue<()>, Error<ApiErrorResponse>>

Sends a POST request to /public/access/portals/{publicPortalId}/lights

Source

pub async fn post_public_portal_open<'a>( &'a self, public_portal_id: &'a str, ) -> Result<ResponseValue<()>, Error<ApiErrorResponse>>

Sends a POST request to /public/access/portals/{publicPortalId}/open

Source

pub async fn get_public_portal_reachable<'a>( &'a self, public_portal_id: &'a str, ) -> Result<ResponseValue<PublicPortalReachableResponse>, Error<ApiErrorResponse>>

Sends a GET request to /public/access/portals/{publicPortalId}/reachable

Source

pub async fn post_public_portal_sessions<'a>( &'a self, public_portal_id: &'a str, body: &'a PublicPortalCreateSessionRequest, ) -> Result<ResponseValue<PublicPortalCreateSessionResponse>, Error<ApiErrorResponse>>

Sends a POST request to /public/access/portals/{publicPortalId}/sessions

Source

pub async fn get_public_portal_targets<'a>( &'a self, public_portal_id: &'a str, ) -> Result<ResponseValue<PublicPortalTargetsResponse>, Error<ApiErrorResponse>>

Sends a GET request to /public/access/portals/{publicPortalId}/targets

Source

pub async fn get_public_session<'a>( &'a self, session_id: &'a str, token: Option<&'a str>, ) -> Result<ResponseValue<PublicSessionResponse>, Error<ApiErrorResponse>>

Sends a GET request to /public/access/sessions/{sessionId}

Arguments:
- `session_id`
- `token`: Session token (alternative to Bearer when headers stripped)
Source

pub async fn post_public_session_cancel<'a>( &'a self, session_id: &'a str, token: Option<&'a str>, ) -> Result<ResponseValue<()>, Error<ApiErrorResponse>>

Caller hangs up while ringing so callees polling GET session can dismiss incoming UI

Sends a `POST` request to `/public/access/sessions/{sessionId}/cancel`
Source

pub async fn post_public_session_decline<'a>( &'a self, session_id: &'a str, token: Option<&'a str>, ) -> Result<ResponseValue<()>, Error<ApiErrorResponse>>

Callee rejects the ring before answering; caller can observe state via GET session

Sends a `POST` request to `/public/access/sessions/{sessionId}/decline`
Source

pub async fn post_public_session_lights<'a>( &'a self, session_id: &'a str, token: Option<&'a str>, ) -> Result<ResponseValue<()>, Error<ApiErrorResponse>>

Sends a POST request to /public/access/sessions/{sessionId}/lights

Source

pub async fn post_public_session_notify_message<'a>( &'a self, session_id: &'a str, token: Option<&'a str>, body: &'a NotifyPortalMessageBody, ) -> Result<ResponseValue<()>, Error<ApiErrorResponse>>

Caller notifies apartment residents with the chat message text (Web Push)

Sends a `POST` request to `/public/access/sessions/{sessionId}/notify-message`
Source

pub async fn post_public_session_open<'a>( &'a self, session_id: &'a str, token: Option<&'a str>, ) -> Result<ResponseValue<()>, Error<ApiErrorResponse>>

Sends a POST request to /public/access/sessions/{sessionId}/open

Source

pub async fn get_public_session_streams<'a>( &'a self, session_id: &'a str, token: Option<&'a str>, ) -> Result<ResponseValue<PublicSessionStreamsResponse>, Error<ApiErrorResponse>>

Sends a GET request to /public/access/sessions/{sessionId}/streams

Source

pub async fn execute_scripting<'a>( &'a self, body: &'a ExecuteScriptingRequest, ) -> Result<ResponseValue<ExecuteScriptingResponse>, Error<()>>

Execute an OpenApp Scripting program. Requires execute permission in at least one org

Sends a `POST` request to `/scripting/execute`
Source

pub async fn get_backend_status<'a>( &'a self, ) -> Result<ResponseValue<BackendStatus>, Error<()>>

Get backend status and version

Sends a `GET` request to `/status`
Source

pub async fn create_user<'a>( &'a self, include_deleted: Option<bool>, include_metadata: Option<bool>, only_deleted: Option<bool>, x_org: &'a str, body: &'a CreateUserRequest, ) -> Result<ResponseValue<UserResponse>, Error<ApiErrorResponse>>

Create a user in the organization context

Sends a `POST` request to `/users`
Source

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<PaginatedResponse>, Error<ApiErrorResponse>>

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.
Source

pub async fn get_user<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<UserResponse>, Error<ApiErrorResponse>>

Get a user by ID

Sends a `GET` request to `/users/{id}`
Source

pub async fn update_user<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, body: &'a UpdateUserRequest, ) -> Result<ResponseValue<UserResponse>, Error<ApiErrorResponse>>

Update a user by ID

Sends a `PUT` request to `/users/{id}`
Source

pub async fn delete_user<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<UserResponse>, Error<ApiErrorResponse>>

Soft-delete a user

Sends a `DELETE` request to `/users/{id}`
Source

pub async fn hard_delete_user<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<UserResponse>, Error<ApiErrorResponse>>

Permanently delete (purge) a user

Sends a `DELETE` request to `/users/{id}/purge`
Source

pub async fn add_roles<'a>( &'a self, id: &'a str, x_org: &'a str, body: &'a AddRolesRequest, ) -> Result<ResponseValue<UserResponse>, Error<()>>

Add roles to a user. Requires users:create (or admin) in each org where roles are added

Sends a `POST` request to `/users/{id}/roles`
Source

pub async fn delete_roles<'a>( &'a self, id: &'a str, x_org: &'a str, body: &'a DeleteRolesRequest, ) -> Result<ResponseValue<UserResponse>, Error<()>>

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`
Source

pub async fn create_zone<'a>( &'a self, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, body: &'a CreateZoneRequest, ) -> Result<ResponseValue<ZoneResponse>, Error<ApiErrorResponse>>

Create a zone for an integration

Sends a `POST` request to `/zones`
Source

pub async fn get_zone<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<ZoneResponse>, Error<ApiErrorResponse>>

Get a zone by ID

Sends a `GET` request to `/zones/{id}`
Source

pub async fn update_zone<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, body: &'a UpdateZoneRequest, ) -> Result<ResponseValue<ZoneResponse>, Error<ApiErrorResponse>>

Update a zone

Sends a `PUT` request to `/zones/{id}`
Source

pub async fn delete_zone<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<ZoneResponse>, Error<ApiErrorResponse>>

Soft-delete a zone

Sends a `DELETE` request to `/zones/{id}`
Source

pub async fn hard_delete_zone<'a>( &'a self, id: &'a str, include_deleted: Option<bool>, include_metadata: Option<bool>, x_org: &'a str, ) -> Result<ResponseValue<ZoneResponse>, Error<ApiErrorResponse>>

Permanently delete (purge) a zone

Sends a `DELETE` request to `/zones/{id}/purge`

Trait Implementations§

Source§

impl ClientHooks for &Client

Source§

async fn pre<E>( &self, request: &mut Request, info: &OperationInfo, ) -> Result<(), Error<E>>

Runs prior to the execution of the request. This may be used to modify the request before it is transmitted.
Source§

async fn post<E>( &self, result: &Result<Response, Error>, info: &OperationInfo, ) -> Result<(), Error<E>>

Runs after completion of the request.
Source§

async fn exec( &self, request: Request, info: &OperationInfo, ) -> Result<Response, Error>

Execute the request. Note that for almost any reasonable implementation this will include code equivalent to this: Read more
Source§

impl ClientInfo<()> for Client

Source§

fn api_version() -> &'static str

Get the version of this API. Read more
Source§

fn baseurl(&self) -> &str

Get the base URL to which requests are made.
Source§

fn client(&self) -> &Client

Get the internal reqwest::Client used to make requests.
Source§

fn inner(&self) -> &()

Get the inner value of type T if one is specified.
Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more