/*
* Hanzo Cloud API
*
* The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use serde::{Deserialize, Serialize, de::Error as _};
use crate::{apis::ResponseContent, models};
use super::{Error, configuration, ContentType};
/// struct for typed errors of method [`add_provider`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AddProviderError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`add_token`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AddTokenError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`add_webauthn_credential`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AddWebauthnCredentialError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`create_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`create_session`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateSessionError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_applications_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamApplicationsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_audit_logs_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamAuditLogsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_certs_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamCertsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_invitations_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamInvitationsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_keys_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamKeysByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_mfa`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamMfaError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_permissions_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamPermissionsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_projects_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamProjectsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_roles_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamRolesByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_scim_v2_users_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamScimV2UsersByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_service_accounts_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamServiceAccountsByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_users_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamUsersByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_users_by_owner_by_name_keys`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamUsersByOwnerByNameKeysError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_iam_workspaces_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteIamWorkspacesByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_provider`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteProviderError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_session`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteSessionError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_token`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteTokenError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`delete_webauthn_credential`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteWebauthnCredentialError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_account`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamAccountError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_applications`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamApplicationsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_applications_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamApplicationsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_audit_logs`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamAuditLogsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_audit_logs_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamAuditLogsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_auth_application`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamAuthApplicationError {
Status400(models::IamPeriodAnswer),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_auth_methods`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamAuthMethodsError {
Status400(models::IamPeriodAnswer),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_certs`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamCertsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_certs_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamCertsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_consent`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamConsentError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_invitations`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamInvitationsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_invitations_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamInvitationsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_keys`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamKeysError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_keys_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamKeysByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_keys_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamKeysOrgError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_keys_principal`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamKeysPrincipalError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_linked_accounts`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamLinkedAccountsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_memberships`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamMembershipsError {
Status400(models::IamPeriodAnswer),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_oauth_authorize`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamOauthAuthorizeError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_oauth_callback`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamOauthCallbackError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_oauth_logout`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamOauthLogoutError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_oauth_userinfo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamOauthUserinfoError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_period_well_known_jwks`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamPeriodWellKnownJwksError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_period_well_known_oauth_authorization_server`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamPeriodWellKnownOauthAuthorizationServerError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_period_well_known_openid_configuration`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamPeriodWellKnownOpenidConfigurationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_permissions`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamPermissionsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_permissions_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamPermissionsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_projects`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamProjectsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_projects_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamProjectsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_registry_jwks`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamRegistryJwksError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_registry_token`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamRegistryTokenError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_roles`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamRolesError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_roles_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamRolesByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_scim_v2_resourcetypes`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamScimV2ResourcetypesError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_scim_v2_resourcetypes_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamScimV2ResourcetypesByNameError {
Status404(serde_json::Value),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_scim_v2_schemas`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamScimV2SchemasError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_scim_v2_schemas_by_id`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamScimV2SchemasByIdError {
Status404(serde_json::Value),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_scim_v2_serviceproviderconfig`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamScimV2ServiceproviderconfigError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_scim_v2_users`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamScimV2UsersError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_scim_v2_users_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamScimV2UsersByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_service_accounts`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamServiceAccountsError {
Status400(models::IamPeriodAnswer),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_users`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamUsersError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_users_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamUsersByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_web3_nonce`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamWeb3NonceError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_webauthn_signin_begin`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamWebauthnSigninBeginError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_webauthn_signup_begin`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamWebauthnSignupBeginError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_whoami`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamWhoamiError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_workspaces`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamWorkspacesError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_iam_workspaces_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetIamWorkspacesByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_provider`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetProviderError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_session`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSessionError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_token`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTokenError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`get_webauthn_credential`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetWebauthnCredentialError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`list_organizations`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListOrganizationsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`list_providers`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListProvidersError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`list_sessions`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListSessionsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`list_tokens`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListTokensError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`list_webauthn_credentials`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListWebauthnCredentialsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`patch_iam_scim_v2_users_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchIamScimV2UsersByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_admin_provision`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamAdminProvisionError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_applications`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamApplicationsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_assume`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamAssumeError {
Status400(models::IamPeriodAnswer),
Status401(models::IamPeriodAnswer),
Status403(models::IamPeriodAnswer),
Status404(models::IamPeriodAnswer),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_audit_logs`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamAuditLogsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_certs`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamCertsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_delete_membership`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamDeleteMembershipError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_invitations`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamInvitationsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_keys`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamKeysError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_link`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamLinkError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_login`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamLoginError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_memberships`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamMembershipsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_mfa_preferred`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamMfaPreferredError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_mfa_setup_enable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamMfaSetupEnableError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_mfa_setup_initiate`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamMfaSetupInitiateError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_oauth_authorize`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamOauthAuthorizeError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_oauth_device`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamOauthDeviceError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_oauth_device_info`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamOauthDeviceInfoError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_oauth_federation_mfa`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamOauthFederationMfaError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_oauth_introspect`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamOauthIntrospectError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_oauth_logout`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamOauthLogoutError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_oauth_revoke`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamOauthRevokeError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_oauth_token`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamOauthTokenError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_oauth_userinfo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamOauthUserinfoError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_onboard`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamOnboardError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_permissions`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamPermissionsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_preferences`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamPreferencesError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_projects`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamProjectsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_registry_token`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamRegistryTokenError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_release`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamReleaseError {
Status400(models::IamPeriodAnswer),
Status401(models::IamPeriodAnswer),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_roles`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamRolesError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_scim_v2_users`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamScimV2UsersError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_service_accounts`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamServiceAccountsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_service_accounts_by_name_keys`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamServiceAccountsByNameKeysError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_signin`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamSigninError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_signup`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamSignupError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_tokens_issue`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamTokensIssueError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_unlink`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamUnlinkError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_users`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamUsersError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_users_by_owner_by_name_keys`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamUsersByOwnerByNameKeysError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_verification_codes`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamVerificationCodesError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_web3_verify`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamWeb3VerifyError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_webauthn_signin_finish`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamWebauthnSigninFinishError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_webauthn_signup_finish`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamWebauthnSignupFinishError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`post_iam_workspaces`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostIamWorkspacesError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_account`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamAccountError {
Status400(models::IamPeriodAnswer),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_applications_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamApplicationsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_audit_logs_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamAuditLogsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_certs_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamCertsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_consent`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamConsentError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_invitations_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamInvitationsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_keys_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamKeysByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_password`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamPasswordError {
Status400(models::IamPeriodAnswer),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_permissions_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamPermissionsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_projects_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamProjectsByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_roles_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamRolesByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_scim_v2_users_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamScimV2UsersByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_users_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamUsersByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`put_iam_workspaces_by_owner_by_name`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutIamWorkspacesByOwnerByNameError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`set_organization_avatar`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SetOrganizationAvatarError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`update_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`update_provider`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateProviderError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`update_session`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateSessionError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`update_token`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateTokenError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`update_webauthn_credential`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateWebauthnCredentialError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`upsert_application`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpsertApplicationError {
Status400(models::IamPeriodReply),
Status401(models::IamPeriodReply),
Status500(models::IamPeriodReply),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`upsert_user`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpsertUserError {
Status400(models::IamPeriodReply),
Status401(models::IamPeriodReply),
Status500(models::IamPeriodReply),
UnknownValue(serde_json::Value),
}
/// Adds an identity provider your people can sign in with, or a service your applications send through — a social or enterprise login, an email or SMS sender, a storage or payment connector. A provider is configured once and then switched on per application, so several applications can share one set of credentials.
pub async fn add_provider(configuration: &configuration::Configuration, iam_period_provider: models::IamPeriodProvider) -> Result<models::IamPeriodProviderResult, Error<AddProviderError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_provider = iam_period_provider;
let uri_str = format!("{}/v1/iam/providers", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_provider);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProviderResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProviderResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AddProviderError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Records an access token — the credential an application or integration presents on a caller's behalf.
pub async fn add_token(configuration: &configuration::Configuration, iam_period_token: models::IamPeriodToken) -> Result<models::IamPeriodTokenResult, Error<AddTokenError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_token = iam_period_token;
let uri_str = format!("{}/v1/iam/tokens", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_token);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodTokenResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodTokenResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AddTokenError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Registers a passkey or security key for a person, so they can sign in with their device instead of a password.
pub async fn add_webauthn_credential(configuration: &configuration::Configuration, iam_period_webauthn_credential: models::IamPeriodWebauthnCredential) -> Result<models::IamPeriodWebauthnCredentialResult, Error<AddWebauthnCredentialError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_webauthn_credential = iam_period_webauthn_credential;
let uri_str = format!("{}/v1/iam/webauthn-credentials", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_webauthn_credential);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AddWebauthnCredentialError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Makes a new organization — the account your users, applications, roles, projects and workspaces are all named inside. It is the first write in a new tenant, and a name already in use is refused rather than taken over.
pub async fn create_organization(configuration: &configuration::Configuration, iam_period_create_organization_input: models::IamPeriodCreateOrganizationInput) -> Result<models::IamPeriodOrganization, Error<CreateOrganizationError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_create_organization_input = iam_period_create_organization_input;
let uri_str = format!("{}/v1/iam/organizations", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_create_organization_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodOrganization`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodOrganization`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateOrganizationError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Records a sign-in. Signing in again from another browser adds to the session rather than replacing it, so one person can be signed in from a laptop and a phone at once. Ask for an exclusive sign-in and the opposite holds: the new sign-in is the only one left and every other browser is signed out. That is the setting to use when one person may hold only one live session at a time.
pub async fn create_session(configuration: &configuration::Configuration, iam_period_create_session_in: models::IamPeriodCreateSessionIn) -> Result<models::IamPeriodSession, Error<CreateSessionError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_create_session_in = iam_period_create_session_in;
let uri_str = format!("{}/v1/iam/sessions", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_create_session_in);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodSession`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodSession`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateSessionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Removes an application. Anyone mid-sign-in through it is turned away and its client credentials stop working, so retire the integration before deleting it.
pub async fn delete_iam_applications_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodDeleteResult, Error<DeleteIamApplicationsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/applications/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodDeleteResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodDeleteResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamApplicationsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Removes an audit entry. Retention policy is normally what should expire a trail; deleting by hand leaves a gap a reviewer will notice.
pub async fn delete_iam_audit_logs_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodDeleteOutput, Error<DeleteIamAuditLogsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/audit-logs/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodDeleteOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodDeleteOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamAuditLogsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Removes a signing certificate. Tokens signed with it can no longer be verified, so retire it only once nothing is still presenting them.
pub async fn delete_iam_certs_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodCertsPeriodDeleteOutput, Error<DeleteIamCertsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/certs/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodCertsPeriodDeleteOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodCertsPeriodDeleteOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamCertsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Withdraws an invitation. It stops being redeemable at once; anyone who already joined through it keeps their account.
pub async fn delete_iam_invitations_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodInvitationsPeriodDeleteOutput, Error<DeleteIamInvitationsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/invitations/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodInvitationsPeriodDeleteOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodInvitationsPeriodDeleteOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamInvitationsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Revokes an API key. Anything still presenting it stops being authorized at once, so roll the replacement out before you revoke.
pub async fn delete_iam_keys_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodDeleteResponse, Error<DeleteIamKeysByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/keys/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodDeleteResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodDeleteResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamKeysByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Turns a factor off, so sign-in stops asking for it. Naming no factor turns off ALL of them — the reset path. People may do this for themselves; doing it for somebody else takes an administrator, which is what makes it the way back in when a phone is lost. The recovery codes go with the last factor: they are the way past a challenge, so keeping them alive for an account with nothing to challenge would leave a standing credential behind.
pub async fn delete_iam_mfa(configuration: &configuration::Configuration, ) -> Result<(), Error<DeleteIamMfaError>> {
let uri_str = format!("{}/v1/iam/mfa", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamMfaError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Revokes a permission. Everyone who held access only through it loses that access immediately; grants they hold by another route are untouched.
pub async fn delete_iam_permissions_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodPermissionPeriodDeleteResponse, Error<DeleteIamPermissionsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/permissions/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodPermissionPeriodDeleteResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodPermissionPeriodDeleteResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamPermissionsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Removes a project. The people and roles in your organization are unchanged; what goes is the scope itself, so move anything addressed by it first.
pub async fn delete_iam_projects_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodProjectsPeriodDeleteOutput, Error<DeleteIamProjectsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/projects/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProjectsPeriodDeleteOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProjectsPeriodDeleteOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamProjectsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Removes a role. Everyone in it loses the access it carried; their accounts, and any other role they hold, are untouched.
pub async fn delete_iam_roles_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodRolesPeriodDeleteOutput, Error<DeleteIamRolesByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/roles/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodRolesPeriodDeleteOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodRolesPeriodDeleteOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamRolesByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Deprovisions a person — how removing someone in your identity provider removes their access here. Their sessions stop working immediately. Takes an administrator.
pub async fn delete_iam_scim_v2_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<(), Error<DeleteIamScimV2UsersByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/scim/v2/Users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamScimV2UsersByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Serves DELETE /v1/iam/service-accounts/:name.
pub async fn delete_iam_service_accounts_by_name(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<DeleteIamServiceAccountsByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_name = name;
let uri_str = format!("{}/v1/iam/service-accounts/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamServiceAccountsByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Removes a person from your organization. Their sessions stop working immediately and the account is gone rather than suspended — to keep the record and only stop sign-in, update the user instead.
pub async fn delete_iam_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodUsersPeriodDeleteOutput, Error<DeleteIamUsersByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodUsersPeriodDeleteOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodUsersPeriodDeleteOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamUsersByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Clears the target user's key of the requested TYPE (immediate revoke). Scoped by the same `?type` field mint takes, so revoking the browser key leaves the server key working. A secret key's stored value is the sk- in its schema.Key row.
pub async fn delete_iam_users_by_owner_by_name_keys(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<(), Error<DeleteIamUsersByOwnerByNameKeysError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/users/{owner}/{name}/keys", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamUsersByOwnerByNameKeysError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Removes a workspace. The people and roles in your organization are unchanged; what goes is the scope itself.
pub async fn delete_iam_workspaces_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodWorkspacesPeriodDeleteOutput, Error<DeleteIamWorkspacesByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/workspaces/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWorkspacesPeriodDeleteOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWorkspacesPeriodDeleteOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteIamWorkspacesByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Removes an organization and everything named inside it. There is no undo, and every session issued under it stops working. The built-in admin organization cannot be deleted — losing it would leave the account with no way back in.
pub async fn delete_organization(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodDeleteOrganizationOutput, Error<DeleteOrganizationError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/organizations/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodDeleteOrganizationOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodDeleteOrganizationOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteOrganizationError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Removes a provider. Sign-in through it stops for every application that used it, so give those applications another method first. A provider that is already gone answers \"nothing changed\" rather than an error, so the call is safe to repeat.
pub async fn delete_provider(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodMutationResult, Error<DeleteProviderError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/providers/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodMutationResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodMutationResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteProviderError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Signs a person out of one application — the session ends and every browser carrying it stops being authenticated. A session that is already gone reports that nothing was deleted rather than an error, so the call is safe to repeat.
pub async fn delete_session(configuration: &configuration::Configuration, owner: &str, name: &str, application: &str) -> Result<models::IamPeriodDeleteSessionOut, Error<DeleteSessionError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_application = application;
let uri_str = format!("{}/v1/iam/sessions/{owner}/{name}/{application}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name), application=crate::apis::urlencode(p_application));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodDeleteSessionOut`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodDeleteSessionOut`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteSessionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Revokes an access token. Whatever was using it stops being authorized at once. A token that is already gone answers \"nothing changed\" rather than an error, so the call is safe to repeat.
pub async fn delete_token(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodTokenMutation, Error<DeleteTokenError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/tokens/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodTokenMutation`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodTokenMutation`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteTokenError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Removes a passkey or security key — what you call when a device is lost. Make sure the person has another way to sign in first. A credential that is already gone answers \"nothing changed\" rather than an error, so the call is safe to repeat.
pub async fn delete_webauthn_credential(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodWebauthnCredentialMutationResult, Error<DeleteWebauthnCredentialError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/webauthn-credentials/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialMutationResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialMutationResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteWebauthnCredentialError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the signed-in person's own account and the organization they belong to — what a console reads to draw the account menu. Passwords, API secrets and MFA material are stripped. It answers for a session cookie or a bearer token alike.
pub async fn get_iam_account(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamAccountError>> {
let uri_str = format!("{}/v1/iam/account", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamAccountError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the applications in one organization, newest first — each product or site your people sign in to, with the sign-in methods and redirect URIs it allows.
pub async fn get_iam_applications(configuration: &configuration::Configuration, owner: &str) -> Result<models::IamPeriodApplicationListResult, Error<GetIamApplicationsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let uri_str = format!("{}/v1/iam/applications", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("owner", &p_owner.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodApplicationListResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodApplicationListResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamApplicationsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one application: its sign-in methods, its allowed redirect URIs and the client credentials your integration authenticates with.
pub async fn get_iam_applications_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodApplication, Error<GetIamApplicationsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/applications/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodApplication`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodApplication`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamApplicationsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns your organization's audit trail, newest first — who did what, when, and from where. It is the record you reach for during a security review or an incident. You see your own organization's audit trail and no one else's; which organization that is comes from your credentials, not from the request.
pub async fn get_iam_audit_logs(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodListOutput, Error<GetIamAuditLogsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let uri_str = format!("{}/v1/iam/audit-logs", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_owner {
req_builder = req_builder.query(&[("owner", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamAuditLogsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one audit entry in full: the action, the person or key behind it, and the request it came in on.
pub async fn get_iam_audit_logs_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodAuditLog, Error<GetIamAuditLogsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/audit-logs/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAuditLog`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAuditLog`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamAuditLogsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns everything a login screen needs to draw itself for one application: its branding, and each sign-in method it offers with the provider details that method needs. The client secret is masked. Read before anyone has signed in, so it carries only what is safe for a browser to see.
pub async fn get_iam_auth_application(configuration: &configuration::Configuration, client_id: Option<&str>, response_type: Option<&str>) -> Result<models::IamPeriodAnswer, Error<GetIamAuthApplicationError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_client_id = client_id;
let p_response_type = response_type;
let uri_str = format!("{}/v1/iam/auth/application", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_client_id {
req_builder = req_builder.query(&[("clientId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_response_type {
req_builder = req_builder.query(&[("responseType", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamAuthApplicationError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the sign-in methods one application actually has switched on, so a login screen can render the right buttons for it without you hard-coding a list that drifts the moment you add a provider. Public by design: it is read before anyone has signed in, and it exposes only which methods exist, never their credentials.
pub async fn get_iam_auth_methods(configuration: &configuration::Configuration, client_id: Option<&str>) -> Result<models::IamPeriodAnswer, Error<GetIamAuthMethodsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_client_id = client_id;
let uri_str = format!("{}/v1/iam/auth/methods", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_client_id {
req_builder = req_builder.query(&[("clientId", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamAuthMethodsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns your organization's signing certificates, newest first — the keys the tokens your applications verify are signed with. Private key material is masked. You see your own organization's certificates and no one else's; which organization that is comes from your credentials, not from the request, so a query parameter can never widen the listing.
pub async fn get_iam_certs(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodCertsPeriodListOutput, Error<GetIamCertsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let uri_str = format!("{}/v1/iam/certs", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_owner {
req_builder = req_builder.query(&[("owner", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodCertsPeriodListOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodCertsPeriodListOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamCertsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one signing certificate — its algorithm, its validity window and its public half. The private key is masked.
pub async fn get_iam_certs_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodCert, Error<GetIamCertsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/certs/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodCert`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodCert`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamCertsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the calling person's own privacy and communication choices. Somebody who has never set them gets the defaults rather than nothing, so a consent screen always has something to show — insights on, and training UNANSWERED, which is the state that means the screen still has to ask.
pub async fn get_iam_consent(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamConsentError>> {
let uri_str = format!("{}/v1/iam/consent", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamConsentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns your organization's invitations, newest first — who has been asked to join, on what terms, and how many seats each invitation still has left. You see your own organization's invitations and no one else's; which organization that is comes from your credentials, not from the request.
pub async fn get_iam_invitations(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodInvitationsPeriodListOutput, Error<GetIamInvitationsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let uri_str = format!("{}/v1/iam/invitations", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_owner {
req_builder = req_builder.query(&[("owner", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodInvitationsPeriodListOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodInvitationsPeriodListOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamInvitationsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one invitation: who it is for, what it grants on acceptance, and when it expires.
pub async fn get_iam_invitations_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodInvitation, Error<GetIamInvitationsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/invitations/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodInvitation`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodInvitation`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamInvitationsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns your organization's API keys, newest first — what each is called, what it may reach, and its publishable half. Secret halves are never listed.
pub async fn get_iam_keys(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodListResponse, Error<GetIamKeysError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let uri_str = format!("{}/v1/iam/keys", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_owner {
req_builder = req_builder.query(&[("owner", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamKeysError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one API key: what it is called, what it may reach, and when it was issued.
pub async fn get_iam_keys_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodKey, Error<GetIamKeysByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/keys/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodKey`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodKey`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamKeysByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Answers which organization a publishable key belongs to — what a service calls to attribute a request that arrived carrying a key shipped in a browser. This is the noun spelling of `/v1/iam/resolve-key`, the same handler at the address that replaces it; both answer while callers migrate. It names an ORGANIZATION and never a person. No path through it loads or returns a user, so a key placed in client code cannot become a way to learn who anyone is — which is the whole reason this is a separate endpoint from the one below. A key that is expired, secret rather than publishable, or simply unknown all answer with the same sentence and a `code` saying which it was. Only a confidential service that has already proved it may resolve keys reads that code — there is no anonymous caller here to probe which keys exist — and telling those apart is what lets a holder be told to re-mint an expired key instead of hunting a configuration error.
pub async fn get_iam_keys_org(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamKeysOrgError>> {
let uri_str = format!("{}/v1/iam/keys/org", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamKeysOrgError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Answers who a secret key belongs to — the owner and name a gateway needs to attribute and bill a request that arrived carrying an `sk-`. This is the noun spelling of `/v1/iam/get-user?accessKey=`, the same handler at the address that replaces it; both answer while callers migrate. It resolves a KEY and nothing else. The verb it replaces also reads a user by `?id=`, and carrying that here would make this a second address for the user read — the exact thing being retired. Ask for a person by name at the user read; ask here only what a credential resolves to. Requires a confidential caller: the resolver authenticates as an app, so a request without that credential resolves nothing rather than falling back to an anonymous lookup. An unresolvable key answers with a `code` distinguishing expired from wrong-endpoint from unknown, so the holder can be told which one cure applies.
pub async fn get_iam_keys_principal(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamKeysPrincipalError>> {
let uri_str = format!("{}/v1/iam/keys/principal", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamKeysPrincipalError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the sign-in identities linked to the calling person's account — every provider they can currently sign in with. It is what a security page lists next to the option to disconnect one.
pub async fn get_iam_linked_accounts(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamLinkedAccountsError>> {
let uri_str = format!("{}/v1/iam/linked-accounts", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamLinkedAccountsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Answers either question about who belongs where: which organizations one person can act in, or who can act in one organization. Both are org-scoped: a non-SuperAdmin may ask about ITS OWN org's roster, or about a user whose home org is its own, and nothing else. The bound comes from the verified credential via authz.Scope, so a request parameter can never widen it — a membership row names who may act and spend in an org, so a cross-tenant read is a customer roster leak.
pub async fn get_iam_memberships(configuration: &configuration::Configuration, user: Option<&str>, org: Option<&str>) -> Result<models::IamPeriodAnswer, Error<GetIamMembershipsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_user = user;
let p_org = org;
let uri_str = format!("{}/v1/iam/memberships", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_user {
req_builder = req_builder.query(&[("user", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_org {
req_builder = req_builder.query(&[("org", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamMembershipsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Starts a sign-in — the address you send a browser to, and the beginning of every OAuth and OpenID Connect flow. If the person is ALREADY signed in here, it does not ask them again: it returns them to the application with a one-time code and they never see this page. Otherwise it shows the right way to sign in for the application they are signing in to, or hands off to another identity provider if that is what they pick. A client can say what it wants with `prompt`: `none` means answer without any screen at all — with the code if a session exists, with an error if not, but never with a page; `login` means ask for the password again even if a session exists; `select_account` means let the person choose which identity to use. It returns only to an address the application has registered. That check happens before anything else, so a request naming an unregistered address is refused where the person can see it rather than being bounced onwards.
pub async fn get_iam_oauth_authorize(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamOauthAuthorizeError>> {
let uri_str = format!("{}/v1/iam/oauth/authorize", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamOauthAuthorizeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Completes the round-trip: it resolves and burns the single-use transaction (checking expiry + browser binding), exchanges and verifies the IdP response, links or provisions the local user, and mints the iam authorization code the relying party expects — then redirects to the original redirect_uri with code + state.
pub async fn get_iam_oauth_callback(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamOauthCallbackError>> {
let uri_str = format!("{}/v1/iam/oauth/callback", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamOauthCallbackError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Ends a sign-in and sends the browser somewhere sensible. Accepts GET or POST, so it works as a plain link. It ACTUALLY signs you out — worth stating, because a logout that computes a redirect and answers {\"status\":\"ok\"} while ending no session and revoking no token is worse than none: the person on the shared machine believes it worked. Three things happen here, in this order: 1. The browser session dies — sid revoked server-side AND the cookie expired (sessions.Clear). Server-side revocation is the load-bearing half: a copy of the cookie taken before logout must not still resolve. 2. The relying party's tokens are revoked when an id_token_hint names it, so the refresh token cannot mint a fresh access token after the human left. Revocation state is authoritative — a JWT's `exp` still reads valid for days, so expiry is necessary but never sufficient. 3. Only then is a redirect considered, and only to a REGISTERED uri. The open-redirect guard is unchanged: a redirect happens only when a VERIFIED id_token_hint identifies the application and that application has registered the target. Anything else refuses to redirect — nobody can turn your logout link into a redirect to a site of their choosing.
pub async fn get_iam_oauth_logout(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamOauthLogoutError>> {
let uri_str = format!("{}/v1/iam/oauth/logout", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamOauthLogoutError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the profile claims for whoever the access token belongs to — the standard OpenID Connect way to find out who is calling you without your application storing anything itself. The token must still be live: revoke it and this stops answering.
pub async fn get_iam_oauth_userinfo(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamOauthUserinfoError>> {
let uri_str = format!("{}/v1/iam/oauth/userinfo", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamOauthUserinfoError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Publishes the public keys that verify the tokens issued here — the one URL you point a service at so it can check a token itself, offline, without calling back and without holding any secret of ours. Keys appear here before they start signing and stay after they stop, so a rotation never leaves a live token unverifiable. Nothing private is ever published.
pub async fn get_iam_period_well_known_jwks(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamPeriodWellKnownJwksError>> {
let uri_str = format!("{}/v1/iam/.well-known/jwks", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamPeriodWellKnownJwksError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the OpenID Connect discovery document — the one URL you point a standards-compliant client at so it can find every other endpoint on its own, instead of you configuring them by hand. It advertises only what is actually implemented, so a client that reads it cannot ask for a flow that will fail: the authorization-code flow, PKCE with S256, the supported grants, and the signing algorithms whose public keys the JWKS really publishes. The issuer is derived from the host you asked on and is the same value the tokens carry, so a client that pins the issuer never sees it change.
pub async fn get_iam_period_well_known_oauth_authorization_server(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamPeriodWellKnownOauthAuthorizationServerError>> {
let uri_str = format!("{}/v1/iam/.well-known/oauth-authorization-server", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamPeriodWellKnownOauthAuthorizationServerError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the OpenID Connect discovery document — the one URL you point a standards-compliant client at so it can find every other endpoint on its own, instead of you configuring them by hand. It advertises only what is actually implemented, so a client that reads it cannot ask for a flow that will fail: the authorization-code flow, PKCE with S256, the supported grants, and the signing algorithms whose public keys the JWKS really publishes. The issuer is derived from the host you asked on and is the same value the tokens carry, so a client that pins the issuer never sees it change.
pub async fn get_iam_period_well_known_openid_configuration(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamPeriodWellKnownOpenidConfigurationError>> {
let uri_str = format!("{}/v1/iam/.well-known/openid-configuration", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamPeriodWellKnownOpenidConfigurationError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the permissions in one organization, newest first — each one a grant saying which people or roles may do what, and to which resources.
pub async fn get_iam_permissions(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodPermissionPeriodListResponse, Error<GetIamPermissionsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let uri_str = format!("{}/v1/iam/permissions", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_owner {
req_builder = req_builder.query(&[("owner", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodPermissionPeriodListResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodPermissionPeriodListResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamPermissionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one permission: who it grants to, what it allows, and the resources it covers.
pub async fn get_iam_permissions_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodPermission, Error<GetIamPermissionsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/permissions/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodPermission`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodPermission`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamPermissionsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns your organization's projects, newest first — the scope people pick between when their work is separated by product or client rather than by team. You see your own organization's projects and no one else's; which organization that is comes from your credentials, not from the request.
pub async fn get_iam_projects(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodProjectsPeriodListOutput, Error<GetIamProjectsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let uri_str = format!("{}/v1/iam/projects", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_owner {
req_builder = req_builder.query(&[("owner", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProjectsPeriodListOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProjectsPeriodListOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamProjectsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one project: what it is called and how it is set up.
pub async fn get_iam_projects_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodProject, Error<GetIamProjectsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/projects/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProject`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProject`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamProjectsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Publishes the public key your registry uses to verify the tokens issued above — the one URL to configure so the registry trusts logins without holding any secret of its own. If no signing key is available it refuses rather than publishing an empty set, because a registry that trusts nothing looks identical to one that trusts everything until somebody tries to push.
pub async fn get_iam_registry_jwks(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamRegistryJwksError>> {
let uri_str = format!("{}/v1/iam/registry/jwks", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamRegistryJwksError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Signs a container client in to your registry. `docker login`, and every build tool that pushes or pulls images, lands here: it exchanges the credential for a short-lived token scoped to exactly the repositories that credential may touch. Both of the shapes container tooling uses are accepted, so the same login works whichever client your pipeline runs.
pub async fn get_iam_registry_token(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamRegistryTokenError>> {
let uri_str = format!("{}/v1/iam/registry/token", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamRegistryTokenError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns your organization's roles, newest first — each a named group of people that permissions are granted to. You see your own organization's roles and no one else's; which organization that is comes from your credentials, not from the request.
pub async fn get_iam_roles(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodRolesPeriodListOutput, Error<GetIamRolesError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let uri_str = format!("{}/v1/iam/roles", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_owner {
req_builder = req_builder.query(&[("owner", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodRolesPeriodListOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodRolesPeriodListOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamRolesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one role: who is in it, and the roles it includes.
pub async fn get_iam_roles_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodRole, Error<GetIamRolesByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/roles/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodRole`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodRole`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamRolesByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the kinds of record this directory provisions and the address of each, so your identity provider discovers them rather than having them configured by hand.
pub async fn get_iam_scim_v2_resourcetypes(configuration: &configuration::Configuration, ) -> Result<models::IamPeriodListResponse, Error<GetIamScimV2ResourcetypesError>> {
let uri_str = format!("{}/v1/iam/scim/v2/ResourceTypes", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamScimV2ResourcetypesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one provisionable record kind in full.
pub async fn get_iam_scim_v2_resourcetypes_by_name(configuration: &configuration::Configuration, name: &str) -> Result<serde_json::Value, Error<GetIamScimV2ResourcetypesByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_name = name;
let uri_str = format!("{}/v1/iam/scim/v2/ResourceTypes/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamScimV2ResourcetypesByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the attribute definitions this directory understands, so your identity provider knows which fields it may send and what they mean before it sends any.
pub async fn get_iam_scim_v2_schemas(configuration: &configuration::Configuration, ) -> Result<models::IamPeriodListResponse, Error<GetIamScimV2SchemasError>> {
let uri_str = format!("{}/v1/iam/scim/v2/Schemas", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamScimV2SchemasError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one attribute definition in full.
pub async fn get_iam_scim_v2_schemas_by_id(configuration: &configuration::Configuration, id: &str) -> Result<serde_json::Value, Error<GetIamScimV2SchemasByIdError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_id = id;
let uri_str = format!("{}/v1/iam/scim/v2/Schemas/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamScimV2SchemasByIdError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Tells your identity provider which parts of SCIM this directory supports, so it configures itself instead of you filling in a form. Filtering and partial updates are supported. Bulk operations, sorting and entity tags are not — an IdP that reads this will not attempt them.
pub async fn get_iam_scim_v2_serviceproviderconfig(configuration: &configuration::Configuration, ) -> Result<models::IamPeriodConfig, Error<GetIamScimV2ServiceproviderconfigError>> {
let uri_str = format!("{}/v1/iam/scim/v2/ServiceProviderConfig", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodConfig`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodConfig`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamScimV2ServiceproviderconfigError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the people in your organization to your identity provider, in the standard SCIM shape, so an IdP can reconcile its directory against ours. Searchable by username or email address, and paged. Reading the whole list takes an administrator; an ordinary person is refused.
pub async fn get_iam_scim_v2_users(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamScimV2UsersError>> {
let uri_str = format!("{}/v1/iam/scim/v2/Users", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamScimV2UsersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one person in the standard SCIM shape. An administrator may read anyone in the organization; everyone else may read only themselves.
pub async fn get_iam_scim_v2_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<(), Error<GetIamScimV2UsersByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/scim/v2/Users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamScimV2UsersByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns your organization's service accounts — what each is called and when it was created. Never their secrets: a key's secret half exists in a response exactly once, when it is minted. Paginated in memory over the already org-scoped slice — the set per org is small, so a dedicated count query is overkill (v1 service_account.go:296-307).
pub async fn get_iam_service_accounts(configuration: &configuration::Configuration, organization: Option<&str>, p: Option<i32>, page_size: Option<i32>) -> Result<models::IamPeriodAnswer, Error<GetIamServiceAccountsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_organization = organization;
let p_p = p;
let p_page_size = page_size;
let uri_str = format!("{}/v1/iam/service-accounts", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_organization {
req_builder = req_builder.query(&[("organization", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_p {
req_builder = req_builder.query(&[("p", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_page_size {
req_builder = req_builder.query(&[("pageSize", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamServiceAccountsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns a page of the people in your organization, with the total so you can page through the rest. Passwords, API secrets and MFA material are stripped from every entry.
pub async fn get_iam_users(configuration: &configuration::Configuration, owner: &str, email: Option<&str>, limit: Option<i32>, offset: Option<i32>) -> Result<models::IamPeriodUsersPeriodListOutput, Error<GetIamUsersError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_email = email;
let p_limit = limit;
let p_offset = offset;
let uri_str = format!("{}/v1/iam/users", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("owner", &p_owner.to_string())]);
if let Some(ref param_value) = p_email {
req_builder = req_builder.query(&[("email", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodUsersPeriodListOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodUsersPeriodListOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamUsersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one person in your organization, addressed by their username or by their email address. Passwords, API secrets and MFA material are stripped from the response. An address that names two accounts names none: the read refuses rather than picking one, and says so instead of reporting \"no such user\". Handing back an arbitrary one of two rows is how somebody gets added to a team under a colleague's identity.
pub async fn get_iam_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, email: Option<&str>) -> Result<models::IamPeriodUser, Error<GetIamUsersByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_email = email;
let uri_str = format!("{}/v1/iam/users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_email {
req_builder = req_builder.query(&[("email", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodUser`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodUser`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamUsersByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Starts a wallet sign-in: it returns a one-time challenge for the wallet to sign. The challenge is good once and is tied to the site that asked for it, so a signature collected elsewhere cannot be replayed here.
pub async fn get_iam_web3_nonce(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamWeb3NonceError>> {
let uri_str = format!("{}/v1/iam/web3/nonce", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamWeb3NonceError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Starts a passkey sign-in: it returns the challenge the person's authenticator signs. The account is named in the query, and the challenge is bound to it, so what may answer is decided here — by the server, from the row — and the finish checks the answer against that decision rather than recomputing it.
pub async fn get_iam_webauthn_signin_begin(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamWebauthnSigninBeginError>> {
let uri_str = format!("{}/v1/iam/webauthn/signin/begin", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamWebauthnSigninBeginError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Starts enrolling a passkey for the signed-in person: it returns the options their browser hands to the authenticator. Passkeys already on the account are EXCLUDED, so a second enrollment on a device that already holds one is refused by the authenticator itself rather than silently producing a duplicate the person cannot tell apart.
pub async fn get_iam_webauthn_signup_begin(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamWebauthnSignupBeginError>> {
let uri_str = format!("{}/v1/iam/webauthn/signup/begin", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamWebauthnSignupBeginError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Tells you who the current caller is — the lightweight check a page makes on load to decide whether to render signed-in or signed-out. It answers for a session cookie or a bearer token alike, and says plainly when nobody is signed in rather than failing.
pub async fn get_iam_whoami(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamWhoamiError>> {
let uri_str = format!("{}/v1/iam/whoami", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<GetIamWhoamiError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns your organization's workspaces, newest first — the scope a team works in, alongside projects rather than instead of them. You see your own organization's workspaces and no one else's; which organization that is comes from your credentials, not from the request.
pub async fn get_iam_workspaces(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodWorkspacesPeriodListOutput, Error<GetIamWorkspacesError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let uri_str = format!("{}/v1/iam/workspaces", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_owner {
req_builder = req_builder.query(&[("owner", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWorkspacesPeriodListOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWorkspacesPeriodListOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamWorkspacesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one workspace: what it is called and how it is set up.
pub async fn get_iam_workspaces_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodWorkspace, Error<GetIamWorkspacesByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/workspaces/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWorkspace`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWorkspace`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetIamWorkspacesByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one organization: its display, its defaults and the sign-in rules everyone in it inherits.
pub async fn get_organization(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodOrganization, Error<GetOrganizationError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/organizations/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodOrganization`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodOrganization`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetOrganizationError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one provider: what it connects to and how it is configured. Its credentials come back masked.
pub async fn get_provider(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodProviderResult, Error<GetProviderError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/providers/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProviderResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProviderResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetProviderError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one person's session in one application — when it began and which browsers or devices are still carrying it.
pub async fn get_session(configuration: &configuration::Configuration, owner: &str, name: &str, application: &str) -> Result<models::IamPeriodSession, Error<GetSessionError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_application = application;
let uri_str = format!("{}/v1/iam/sessions/{owner}/{name}/{application}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name), application=crate::apis::urlencode(p_application));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodSession`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodSession`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetSessionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one access token: who and what it was issued to, and when it expires.
pub async fn get_token(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodTokenResult, Error<GetTokenError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/tokens/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodTokenResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodTokenResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTokenError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns one passkey or security key: whose it is, what device it lives on, and when it was registered.
pub async fn get_webauthn_credential(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodWebauthnCredentialResult, Error<GetWebauthnCredentialError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/webauthn-credentials/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetWebauthnCredentialError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the organizations you can act in, the ones you belong to first and the rest after, newest first, narrowed by an optional query against the name or the display name. Platform operators see every organization; everyone else sees their own. Pass the cursor from the previous page to continue; an empty cursor in the answer means there is nothing more. THE SCOPE IS THE HANDLER'S OWN, so it holds at every endpoint. The Guard refuses a bearerless request before this runs, but the MCP server carries a typed op to its handler with no middleware in front of it — a handler that read no principal would answer such a caller with the whole registry. Reading the principal here is what makes the answer the same one over both.
pub async fn list_organizations(configuration: &configuration::Configuration, x_forwarded_for: Option<&str>, q: Option<&str>, limit: Option<i32>, cursor: Option<&str>) -> Result<models::IamPeriodListOrganizationsOutput, Error<ListOrganizationsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_x_forwarded_for = x_forwarded_for;
let p_q = q;
let p_limit = limit;
let p_cursor = cursor;
let uri_str = format!("{}/v1/iam/organizations", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_q {
req_builder = req_builder.query(&[("q", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_cursor {
req_builder = req_builder.query(&[("cursor", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(param_value) = p_x_forwarded_for {
req_builder = req_builder.header("X-Forwarded-For", param_value.to_string());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListOrganizationsOutput`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListOrganizationsOutput`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListOrganizationsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns your organization's providers, newest first — the identity providers your people sign in with, and the senders and connectors your applications go through. You see your own organization's providers and no one else's; which organization that is comes from your credentials, not from the request.
pub async fn list_providers(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodListProvidersOut, Error<ListProvidersError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let uri_str = format!("{}/v1/iam/providers", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_owner {
req_builder = req_builder.query(&[("owner", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListProvidersOut`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListProvidersOut`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListProvidersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns who is currently signed in to your organization, newest first, and can be narrowed to one person or one application. It is what you read before signing someone out.
pub async fn list_sessions(configuration: &configuration::Configuration, owner: &str, name: Option<&str>, application: Option<&str>) -> Result<models::IamPeriodListSessionsOut, Error<ListSessionsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_application = application;
let uri_str = format!("{}/v1/iam/sessions", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("owner", &p_owner.to_string())]);
if let Some(ref param_value) = p_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_application {
req_builder = req_builder.query(&[("application", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListSessionsOut`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListSessionsOut`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListSessionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the access tokens issued in your organization, newest first, and can be narrowed to one organization. Use it to see what is currently authorized before revoking anything.
pub async fn list_tokens(configuration: &configuration::Configuration, owner: Option<&str>, organization: Option<&str>) -> Result<models::IamPeriodListTokensOut, Error<ListTokensError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_organization = organization;
let uri_str = format!("{}/v1/iam/tokens", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_owner {
req_builder = req_builder.query(&[("owner", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_organization {
req_builder = req_builder.query(&[("organization", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListTokensOut`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListTokensOut`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListTokensError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the passkeys and security keys registered to one person, newest first — which device each lives on and when it was registered. Yours by default. Name somebody else and you get them only if you already administer their account, which is the same authority that governs reading their user record — so this list can never show more people than the surface beside it already does. There is no organization-wide list, by design. Scoping to the ORG would hand an org admin every member's credential rows in one answer and a SuperAdmin every tenant's, while a plain member could not read even their own (an unnamed target fails the Guard's tenant rule). One scope answers both halves cleanly: the answer is a person's, and the caller is that person unless they say otherwise and may.
pub async fn list_webauthn_credentials(configuration: &configuration::Configuration, user: Option<&str>) -> Result<models::IamPeriodListWebauthnCredentialsOut, Error<ListWebauthnCredentialsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_user = user;
let uri_str = format!("{}/v1/iam/webauthn-credentials", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_user {
req_builder = req_builder.query(&[("user", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListWebauthnCredentialsOut`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListWebauthnCredentialsOut`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ListWebauthnCredentialsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Applies a partial change from your identity provider — one attribute moved, not the whole record resent. The change is applied onto the person as they currently are, so everything you did not mention keeps its value, including the parts SCIM does not describe.
pub async fn patch_iam_scim_v2_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<(), Error<PatchIamScimV2UsersByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/scim/v2/Users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PatchIamScimV2UsersByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Sets up an account on someone's behalf — the same onboarding a person gets themselves, driven by one of your own services instead of by them. It authenticates as your service rather than as a person, which is why the person to provision is named in the request. The setup it performs is identical to self-service onboarding; there is one provisioning path, not two that can drift.
pub async fn post_iam_admin_provision(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamAdminProvisionError>> {
let uri_str = format!("{}/v1/iam/admin/provision", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamAdminProvisionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Registers an application in your organization — one product or site your people sign in to, with its own client credentials, sign-in methods and allowed redirect URIs. A name already used in the organization is refused rather than overwritten. Exported so the legacy add-application alias reuses this exact path — one create, two spellings.
pub async fn post_iam_applications(configuration: &configuration::Configuration, iam_period_application: models::IamPeriodApplication) -> Result<models::IamPeriodApplication, Error<PostIamApplicationsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_application = iam_period_application;
let uri_str = format!("{}/v1/iam/applications", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_application);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodApplication`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodApplication`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PostIamApplicationsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Steps a platform operator into an organization: it returns their own access token re-scoped to that tenant, so they see what the tenant sees. The token still names the operator — stepping in is not becoming somebody else — and records the organization it was scoped to, so everything done with it is attributed to the person who did it. Only a platform operator may, and the attempt is recorded whether or not it succeeds.
pub async fn post_iam_assume(configuration: &configuration::Configuration, iam_period_assume_body: models::IamPeriodAssumeBody, authorization: Option<&str>, x_forwarded_for: Option<&str>) -> Result<models::IamPeriodAnswer, Error<PostIamAssumeError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_assume_body = iam_period_assume_body;
let p_authorization = authorization;
let p_x_forwarded_for = x_forwarded_for;
let uri_str = format!("{}/v1/iam/assume", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(param_value) = p_authorization {
req_builder = req_builder.header("Authorization", param_value.to_string());
}
if let Some(param_value) = p_x_forwarded_for {
req_builder = req_builder.header("X-Forwarded-For", param_value.to_string());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_assume_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PostIamAssumeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Records an audit entry, so activity from your own systems lands in the same trail as everything the Hanzo Cloud records for you.
pub async fn post_iam_audit_logs(configuration: &configuration::Configuration, iam_period_input: models::IamPeriodInput) -> Result<models::IamPeriodAuditLog, Error<PostIamAuditLogsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_input = iam_period_input;
let uri_str = format!("{}/v1/iam/audit-logs", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAuditLog`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAuditLog`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PostIamAuditLogsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Adds a signing certificate your applications can verify tokens against — the call you make to stage the next one before a rotation. A name already used in your organization is refused. It registers the certificate's IDENTITY: its name (which is the JWKS `kid`), its algorithm, its expiry. Key material does not travel this way and cannot: the private key is not part of the Cert's JSON, so it is neither served here nor accepted here. It is supplied to the process by the deployment, under the name registered here (internal/keyring). Staging a rotation is therefore two halves — this call names the key, and the deployment provides it.
pub async fn post_iam_certs(configuration: &configuration::Configuration, iam_period_cert: models::IamPeriodCert) -> Result<models::IamPeriodCert, Error<PostIamCertsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_cert = iam_period_cert;
let uri_str = format!("{}/v1/iam/certs", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_cert);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodCert`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodCert`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PostIamCertsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Takes away a person's or an application's right to act in an organization. Their account survives; what ends is their access to that organization. Revoking a membership that is already gone reports that nothing was removed rather than failing, so a retry is safe. It is the mirror of ensure and takes the SAME gate: revoking membership is the org's authority to give or take, so a SuperAdmin, an admin of the org itself, or an org-admin-capable confidential client. Idempotent through the store — deleting an absent membership reports removed=false, never an error — so a retried revoke is safe.
pub async fn post_iam_delete_membership(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamDeleteMembershipError>> {
let uri_str = format!("{}/v1/iam/delete-membership", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamDeleteMembershipError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Issues an invitation to join your organization — the code or link a new member redeems, with the role they arrive holding and the date it stops working. A name already used in the organization is refused.
pub async fn post_iam_invitations(configuration: &configuration::Configuration, iam_period_invitations_period_input: models::IamPeriodInvitationsPeriodInput) -> Result<models::IamPeriodInvitation, Error<PostIamInvitationsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_invitations_period_input = iam_period_invitations_period_input;
let uri_str = format!("{}/v1/iam/invitations", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_invitations_period_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodInvitation`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodInvitation`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PostIamInvitationsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Issues an API key. A standard key comes back as a publishable half you may ship in client code and a secret half you must not — the secret is shown once, at creation, and cannot be retrieved afterwards. A publish-scoped key is issued with the publishable half only, so there is no secret to leak. A name already used in your organization is refused rather than reissued, so creating twice never silently invalidates a key that is in production.
pub async fn post_iam_keys(configuration: &configuration::Configuration, iam_period_key: models::IamPeriodKey) -> Result<models::IamPeriodKey, Error<PostIamKeysError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_key = iam_period_key;
let uri_str = format!("{}/v1/iam/keys", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_key);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodKey`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodKey`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PostIamKeysError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Starts connecting another sign-in identity to the account you are already signed in as. It answers with the provider's URL for the browser to follow; when the provider returns, that identity is attached and you come back to returnUri. Your account is fixed here, from the credential you are already holding, and is carried server-side for the rest of the round-trip — so nothing that happens at the provider can point the link at somebody else.
pub async fn post_iam_link(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamLinkError>> {
let uri_str = format!("{}/v1/iam/link", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamLinkError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Signs a person in with the credential they typed, and — when the request is part of an OAuth flow — hands back the one-time code that finishes it. A second factor, if the account has one, is asked for and required here. The password is compared against a stored one-way hash and is never logged, echoed or stored as typed.
pub async fn post_iam_login(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamLoginError>> {
let uri_str = format!("{}/v1/iam/login", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamLoginError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Lets a person or an application act in an organization. It is the grant behind \"add someone to the team\", and it is safe to repeat — granting a membership that already exists changes nothing. Granting membership IS the org's authority to give, so it takes the same gate a write to that org's own registry row takes: a SuperAdmin, an admin of the org itself, or an org-admin-capable confidential client. One rule, one place (internal/authz).
pub async fn post_iam_memberships(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamMembershipsError>> {
let uri_str = format!("{}/v1/iam/memberships", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamMembershipsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Picks which second factor an account is asked for first when it has more than one. Only a factor the account actually holds: storing an unheld one told the login gate \"MFA is on\" — factor.Enabled reads that column — while leaving it nothing to ask for, so the sign-in required the password alone.
pub async fn post_iam_mfa_preferred(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamMfaPreferredError>> {
let uri_str = format!("{}/v1/iam/mfa/preferred", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamMfaPreferredError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Finishes the enrolment: from here the account's sign-ins ask for this factor. It requires the proof initiate handed out — a passcode from the authenticator, or the code that was sent — and verifies it BEFORE writing anything. Verifying BEFORE writing is what keeps a client that never completed the proof — a skipped verify step, a QR scanned into the wrong app, a bug — from switching on a factor no code can satisfy. That would lock the account out with no self-service way back: the gate holds the sign-in before minting, so the person could not obtain the bearer that disable requires. The recovery codes are minted here and returned ONCE, on the first factor the account adds. Answering with them is the way back in when no factor can be produced, so they are the same value the row's digests were made from — by construction, not by a client echoing them back.
pub async fn post_iam_mfa_setup_enable(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamMfaSetupEnableError>> {
let uri_str = format!("{}/v1/iam/mfa/setup/enable", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamMfaSetupEnableError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Starts enrolling a factor and hands over whatever the person needs to prove they hold it: app a fresh secret and the otpauth:// URL to render as a QR code sms a code texted to the number on the account email a code mailed to the address on the account Nothing is switched on yet, so abandoning this step leaves the account exactly as it was. Response: {status:\"ok\", data:{mfaType, secret, url}} — secret and url only for the authenticator.
pub async fn post_iam_mfa_setup_initiate(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamMfaSetupInitiateError>> {
let uri_str = format!("{}/v1/iam/mfa/setup/initiate", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamMfaSetupInitiateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Starts a sign-in — the address you send a browser to, and the beginning of every OAuth and OpenID Connect flow. If the person is ALREADY signed in here, it does not ask them again: it returns them to the application with a one-time code and they never see this page. Otherwise it shows the right way to sign in for the application they are signing in to, or hands off to another identity provider if that is what they pick. A client can say what it wants with `prompt`: `none` means answer without any screen at all — with the code if a session exists, with an error if not, but never with a page; `login` means ask for the password again even if a session exists; `select_account` means let the person choose which identity to use. It returns only to an address the application has registered. That check happens before anything else, so a request naming an unregistered address is refused where the person can see it rather than being bounced onwards.
pub async fn post_iam_oauth_authorize(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthAuthorizeError>> {
let uri_str = format!("{}/v1/iam/oauth/authorize", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamOauthAuthorizeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Starts a sign-in on a device with no browser and no keyboard — a TV, a CLI, a headless box. It returns a short code to show the person and the address to send them to on a phone or laptop. Nothing is granted until a human approves it there; until then the code is just a pending request.
pub async fn post_iam_oauth_device(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthDeviceError>> {
let uri_str = format!("{}/v1/iam/oauth/device", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamOauthDeviceError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Answers \"what am I approving?\" for a pending device code. The approval page exists to tell a human WHICH application they are authorizing; a page that names any other one defeats the control it implements. The client is a property of the CODE, not of the page or of whatever app the browser happens to be signed in to, so it is read from the code's row here and nowhere else. Requires a signed-in session, and answers with the same ONE opaque refusal approveDevice uses. That is deliberate: the user_code is only 40 bits and is the one secret in this flow, so an unauthenticated lookup — or one that distinguished unknown from expired from already-approved — would be an oracle for hunting live codes. Gated and opaque, it reveals strictly less than the approval the same caller could already attempt.
pub async fn post_iam_oauth_device_info(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthDeviceInfoError>> {
let uri_str = format!("{}/v1/iam/oauth/device/info", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamOauthDeviceInfoError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Completes a sign-in that came in through another identity provider and still owes a second factor. The person supplies the factor here and the login finishes. The account is fixed when the challenge is issued, not by the request, so no one can redirect a half-finished login onto somebody else's account. A wrong factor uses the challenge up: retrying means starting the sign-in again, the same as a mistyped password.
pub async fn post_iam_oauth_federation_mfa(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthFederationMfaError>> {
let uri_str = format!("{}/v1/iam/oauth/federation/mfa", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamOauthFederationMfaError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Answers whether an access token is still good, and what it is good for — the check a resource server of yours makes before honouring a token it did not mint. A token counts as active only if it verifies AND has not been revoked, so a revoked token reads as dead here immediately rather than until it expires. A token that is unknown, expired or revoked answers simply that it is not active, and nothing more — the endpoint is not a way to learn about tokens you were not given.
pub async fn post_iam_oauth_introspect(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthIntrospectError>> {
let uri_str = format!("{}/v1/iam/oauth/introspect", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamOauthIntrospectError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Ends a sign-in and sends the browser somewhere sensible. Accepts GET or POST, so it works as a plain link. It ACTUALLY signs you out — worth stating, because a logout that computes a redirect and answers {\"status\":\"ok\"} while ending no session and revoking no token is worse than none: the person on the shared machine believes it worked. Three things happen here, in this order: 1. The browser session dies — sid revoked server-side AND the cookie expired (sessions.Clear). Server-side revocation is the load-bearing half: a copy of the cookie taken before logout must not still resolve. 2. The relying party's tokens are revoked when an id_token_hint names it, so the refresh token cannot mint a fresh access token after the human left. Revocation state is authoritative — a JWT's `exp` still reads valid for days, so expiry is necessary but never sufficient. 3. Only then is a redirect considered, and only to a REGISTERED uri. The open-redirect guard is unchanged: a redirect happens only when a VERIFIED id_token_hint identifies the application and that application has registered the target. Anything else refuses to redirect — nobody can turn your logout link into a redirect to a site of their choosing.
pub async fn post_iam_oauth_logout(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthLogoutError>> {
let uri_str = format!("{}/v1/iam/oauth/logout", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamOauthLogoutError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Retires a token before it expires — what you call when someone signs out or a credential may have leaked. Revoking an access token kills that token. Revoking a REFRESH token kills the whole chain it belongs to, so no further access tokens can be minted from it and every token already minted from it dies with it. A token that is not yours, or that never existed, answers success and does nothing — so the endpoint cannot be used to discover which tokens are real. PUBLIC clients revoke too, and must: sign-out is the only control a long-lived refresh token has. A native app or CLI is a public PKCE client and holds no secret, so requiring one here would leave signing out as a local delete — forgetting a credential that stays spendable for the rest of its lifetime. Widening authentication does not widen authority. The caller must still POSSESS the token — and possession already permits USE, of which revocation is the strict opposite — and the row must belong to the client that presents it, so a public client_id buys the ability to destroy exactly what its holder could otherwise spend. RFC 6749 §3.2.1 is the same reading: a client with no credentials identifies itself with client_id.
pub async fn post_iam_oauth_revoke(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthRevokeError>> {
let uri_str = format!("{}/v1/iam/oauth/revoke", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamOauthRevokeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Exchanges what your application is holding for the tokens it needs — the one-time code from a finished sign-in, a refresh token, or your own client credentials when the caller is a program rather than a person. A refresh returns a NEW refresh token and retires the one you sent. If a retired one is ever presented again the whole chain is revoked, on the assumption that a token which came back from the dead was copied — so a stolen refresh token buys an attacker one use and costs them the session. Responses are never cached, by any hop.
pub async fn post_iam_oauth_token(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthTokenError>> {
let uri_str = format!("{}/v1/iam/oauth/token", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamOauthTokenError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Returns the profile claims for whoever the access token belongs to — the standard OpenID Connect way to find out who is calling you without your application storing anything itself. The token must still be live: revoke it and this stops answering.
pub async fn post_iam_oauth_userinfo(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthUserinfoError>> {
let uri_str = format!("{}/v1/iam/oauth/userinfo", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamOauthUserinfoError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Finishes setting up the account of whoever is calling — it creates their organization if they have none and puts them in it, so a person who has just signed up lands somewhere they can work. It always acts on the caller and never on somebody named in the request, so there is no way to onboard another person's account through it.
pub async fn post_iam_onboard(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOnboardError>> {
let uri_str = format!("{}/v1/iam/onboard", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamOnboardError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Grants a permission — the call that gives a person or a role the ability to do something. Adding refuses to overwrite a grant that already exists, so widening an existing one is an update, never an accident.
pub async fn post_iam_permissions(configuration: &configuration::Configuration, iam_period_permission: models::IamPeriodPermission) -> Result<models::IamPeriodPermission, Error<PostIamPermissionsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_permission = iam_period_permission;
let uri_str = format!("{}/v1/iam/permissions", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_permission);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodPermission`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodPermission`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PostIamPermissionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Saves the calling person's own settings and returns the full set afterwards. Send only the settings you are changing — the rest are kept, so two screens can save at once without one undoing the other.
pub async fn post_iam_preferences(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamPreferencesError>> {
let uri_str = format!("{}/v1/iam/preferences", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamPreferencesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Makes a project inside your organization — the scope people pick between when their work is separated by product or client rather than by team. A name already used in the organization is refused.
pub async fn post_iam_projects(configuration: &configuration::Configuration, iam_period_projects_period_input: models::IamPeriodProjectsPeriodInput) -> Result<models::IamPeriodProject, Error<PostIamProjectsError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_projects_period_input = iam_period_projects_period_input;
let uri_str = format!("{}/v1/iam/projects", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_projects_period_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProject`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProject`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PostIamProjectsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Signs a container client in to your registry. `docker login`, and every build tool that pushes or pulls images, lands here: it exchanges the credential for a short-lived token scoped to exactly the repositories that credential may touch. Both of the shapes container tooling uses are accepted, so the same login works whichever client your pipeline runs.
pub async fn post_iam_registry_token(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamRegistryTokenError>> {
let uri_str = format!("{}/v1/iam/registry/token", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamRegistryTokenError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Steps a platform operator back out: it returns their own access token with no organization assumed, which is the credential they had before they stepped in. Recorded like the step in.
pub async fn post_iam_release(configuration: &configuration::Configuration, iam_period_assume_body: models::IamPeriodAssumeBody, authorization: Option<&str>, x_forwarded_for: Option<&str>) -> Result<models::IamPeriodAnswer, Error<PostIamReleaseError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_assume_body = iam_period_assume_body;
let p_authorization = authorization;
let p_x_forwarded_for = x_forwarded_for;
let uri_str = format!("{}/v1/iam/release", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(param_value) = p_authorization {
req_builder = req_builder.header("Authorization", param_value.to_string());
}
if let Some(param_value) = p_x_forwarded_for {
req_builder = req_builder.header("X-Forwarded-For", param_value.to_string());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_assume_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PostIamReleaseError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Makes a role — a named group of people that permissions are granted to. Granting to a role rather than to each person is what keeps access correct as your team changes: add someone to the role and they inherit everything it can do. A name already used in your organization is refused.
pub async fn post_iam_roles(configuration: &configuration::Configuration, iam_period_roles_period_input: models::IamPeriodRolesPeriodInput) -> Result<models::IamPeriodRole, Error<PostIamRolesError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_roles_period_input = iam_period_roles_period_input;
let uri_str = format!("{}/v1/iam/roles", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_roles_period_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodRole`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodRole`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PostIamRolesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Provisions a person from your identity provider — how a new hire gets an account here automatically when they are added over there. Takes an administrator. Making someone an administrator takes more than that, so an IdP integration cannot escalate anyone by setting a flag.
pub async fn post_iam_scim_v2_users(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamScimV2UsersError>> {
let uri_str = format!("{}/v1/iam/scim/v2/Users", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamScimV2UsersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Makes a service account — an identity for a program rather than a person, for a script, a bot or a deployment that has to authenticate on its own. It comes back with its first key, and the secret half is shown ONCE, here. There is no way to read it again; if you lose it, rotate.
pub async fn post_iam_service_accounts(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamServiceAccountsError>> {
let uri_str = format!("{}/v1/iam/service-accounts", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamServiceAccountsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Serves POST /v1/iam/service-accounts/:name/keys: mint a fresh key, invalidating the prior one, and return the new raw secret exactly once.
pub async fn post_iam_service_accounts_by_name_keys(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<PostIamServiceAccountsByNameKeysError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_name = name;
let uri_str = format!("{}/v1/iam/service-accounts/{name}/keys", configuration.base_path, name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamServiceAccountsByNameKeysError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Completes a sign-in: it exchanges the one-time code your application was handed at the end of the login flow for a live session, and returns the signed-in account. The code works once. This is the call that turns a finished login into something your application can act on.
pub async fn post_iam_signin(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamSigninError>> {
let uri_str = format!("{}/v1/iam/signin", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamSigninError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Creates an account from the sign-up form and applies the application's own sign-up rules — whether self-service registration is open at all, and which fields it requires. The password is hashed before it is stored and is never returned.
pub async fn post_iam_signup(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamSignupError>> {
let uri_str = format!("{}/v1/iam/signup", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamSignupError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Mints an access token for the `?id=<owner>/<name>` target user (optional `?aud=` resource, RFC 8707), issued by the authenticated + allow-listed confidential client. The token's subject + owner are the TARGET USER's, so a resource server scopes on the validated owner claim to the user's tenant — indistinguishable from a token the user obtained directly. Response is the camelCase `{accessToken, expiresIn}` body identity.ts consumes. Equivalent to the RFC 8693 token-exchange grant, minus the subject_token proof (the console has the user's id, not a token) — the reason this compat shim exists.
pub async fn post_iam_tokens_issue(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamTokensIssueError>> {
let uri_str = format!("{}/v1/iam/tokens/issue", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamTokensIssueError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Disconnects one sign-in identity from an account, so that provider can no longer be used to sign in as that person. Their account and every other way they sign in are untouched. Two principals may do it, and only two: the account holder itself, and a SuperAdmin (a member of the reserved admin org, the one predicate). An ORG ADMIN deliberately may NOT — unlinking is not tenant administration, it is unpicking someone's own sign-in method, so the generic org-admin rule is the wrong answer here. A holder unlinking itself must also be permitted by the application — the provider link's CanUnlink flag — so an organization that mandates federated sign-in cannot have its users strand themselves. A SuperAdmin is not bound by that flag; it is the platform's own recovery path. Fail-closed throughout.
pub async fn post_iam_unlink(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamUnlinkError>> {
let uri_str = format!("{}/v1/iam/unlink", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamUnlinkError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Adds a person to your organization. Send a password and it becomes the one they sign in with; it is hashed before it is stored and never comes back in any response. The username is checked against the same rule every account in the Hanzo Cloud is held to, whichever way it was created — this call, password signup, a social sign-in, or SCIM — so a name accepted here works everywhere. A name already taken in your organization is refused rather than overwritten.
pub async fn post_iam_users(configuration: &configuration::Configuration, iam_period_create_input: models::IamPeriodCreateInput) -> Result<models::IamPeriodUser, Error<PostIamUsersError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_create_input = iam_period_create_input;
let uri_str = format!("{}/v1/iam/users", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_create_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodUser`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodUser`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PostIamUsersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// (re)generates the target user's key of the requested TYPE and returns it once, over the shared authorizeMinter + mintTarget seam. `?type=secret` (the default) yields the confidential sk-; `?type=publishable` yields the pk- that is safe to ship in client JS and resolves to an org, never a principal. It writes the schema.Key row that the resolvers actually read. schema.User.AccessKey is not a credential and nothing resolves it, so a key stamped there would authenticate nobody.
pub async fn post_iam_users_by_owner_by_name_keys(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<(), Error<PostIamUsersByOwnerByNameKeysError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/users/{owner}/{name}/keys", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamUsersByOwnerByNameKeysError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Validates the request and asks otp to get a code to the person. The request fields are read via fiber's FormValue — the escape hatch zip exposes for form bodies (multipart or urlencoded) — since the typed JSON Bind does not apply here. v1 also accepts countryCode/method/checkUser/captchaType; iam ignores them (the captcha/forget/MFA flows those drive are not ported), and CAPTCHA verification is likewise not enforced — iam models no captcha provider — so the code is issued once the destination and application validate.
pub async fn post_iam_verification_codes(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamVerificationCodesError>> {
let uri_str = format!("{}/v1/iam/verification-codes", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamVerificationCodesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Completes a wallet sign-in: it verifies the signed challenge and, if it holds, signs the wallet's owner in. This IS the login — it answers exactly as a password sign-in does, so the rest of your flow does not branch on how somebody arrived.
pub async fn post_iam_web3_verify(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamWeb3VerifyError>> {
let uri_str = format!("{}/v1/iam/web3/verify", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamWeb3VerifyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Verifies the signed challenge and signs the person in. It answers exactly as a password sign-in does — the same envelope, through the same grant — so nothing downstream branches on how somebody arrived.
pub async fn post_iam_webauthn_signin_finish(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamWebauthnSigninFinishError>> {
let uri_str = format!("{}/v1/iam/webauthn/signin/finish", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamWebauthnSigninFinishError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Verifies the newly created passkey and stores it, so the person can sign in with their device from then on.
pub async fn post_iam_webauthn_signup_finish(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamWebauthnSignupFinishError>> {
let uri_str = format!("{}/v1/iam/webauthn/signup/finish", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PostIamWebauthnSignupFinishError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Makes a workspace inside your organization — the scope a team works in, alongside projects rather than instead of them. A name already used in the organization is refused.
pub async fn post_iam_workspaces(configuration: &configuration::Configuration, iam_period_workspaces_period_input: models::IamPeriodWorkspacesPeriodInput) -> Result<models::IamPeriodWorkspace, Error<PostIamWorkspacesError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_workspaces_period_input = iam_period_workspaces_period_input;
let uri_str = format!("{}/v1/iam/workspaces", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_workspaces_period_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWorkspace`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWorkspace`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PostIamWorkspacesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Saves the calling person's own profile — the name they are shown by, their picture, a line about themselves and a link. Only their own: the request names nobody, so it cannot reach another account. Send only what you are changing; a field you leave out keeps the value it had, and a field you send empty is cleared. A picture is an https link or an inline image up to 96 KiB, the same value an organization's mark is (schema.AvatarRef) — one rule for how a subject appears, whether the subject is a person or an organization.
pub async fn put_iam_account(configuration: &configuration::Configuration, iam_period_account_body: models::IamPeriodAccountBody, cookie: Option<&str>, authorization: Option<&str>) -> Result<models::IamPeriodAnswer, Error<PutIamAccountError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_account_body = iam_period_account_body;
let p_cookie = cookie;
let p_authorization = authorization;
let uri_str = format!("{}/v1/iam/account", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(param_value) = p_cookie {
req_builder = req_builder.header("Cookie", param_value.to_string());
}
if let Some(param_value) = p_authorization {
req_builder = req_builder.header("Authorization", param_value.to_string());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_account_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutIamAccountError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Changes an application's display, its sign-in methods and the redirect URIs it may return to — the call that makes login work from a new host. Which organization it belongs to and what it is named are fixed when it is created and are not editable here. Exported so the legacy update-application alias reuses this exact path — one update, two spellings.
pub async fn put_iam_applications_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_application: models::IamPeriodApplication) -> Result<models::IamPeriodApplication, Error<PutIamApplicationsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_application = iam_period_application;
let uri_str = format!("{}/v1/iam/applications/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_application);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodApplication`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodApplication`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutIamApplicationsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Corrects an audit entry. The trail is append-only in normal operation and nothing in the Hanzo Cloud rewrites it — this exists for an administrator to correct an entry their own systems recorded wrongly.
pub async fn put_iam_audit_logs_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_input: models::IamPeriodInput) -> Result<models::IamPeriodAuditLog, Error<PutIamAuditLogsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_input = iam_period_input;
let uri_str = format!("{}/v1/iam/audit-logs/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAuditLog`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAuditLog`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutIamAuditLogsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Changes a signing certificate's settings. What it is called does not change, and neither does when it was added. A PUT here is a METADATA edit — display name, expiry, provider. It overlays only the fields the request actually SET onto the loaded row: a field the JSON omits (or leaves at its zero value) keeps what the row holds, rather than blanking it. That is load-bearing, not a nicety. A read serves the public Certificate (Mask hides only PrivateKey and AccessSecret), so a client that reads a cert, changes one field, and writes it back sends the masked halves empty and every other field it did not touch at its zero value — and the old full-struct overlay wrote all of those blanks back. Blanking CryptoAlgorithm alone drops the cert from the JWKS (oidc.Publishes turns false), so every token under its `kid` stops verifying; blanking Provider/Account/ExpireTime breaks ACME renewal and expiry — all from a request that only meant to rename it. Absent-or-zero means \"unchanged\", so the deployment (key) and a rotation (cert) remain the only way key or published material changes; the metadata API cannot clear it. The overlay is generic — it copies every set field, so a field nobody has added yet is carried without a line here — and leaves three things the request may not move: the bound Model (id, createdAt, key, snapshot), the natural key (owner/name address the row, they do not mutate it), and the creation stamp.
pub async fn put_iam_certs_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_cert: models::IamPeriodCert) -> Result<models::IamPeriodCert, Error<PutIamCertsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_cert = iam_period_cert;
let uri_str = format!("{}/v1/iam/certs/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_cert);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodCert`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodCert`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutIamCertsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Records the calling person's privacy and communication choices. Only their own — there is no way to set consent for somebody else. Send only the answers you are changing. A question you leave out keeps the answer it already had, so a screen that saves one switch never revokes the other, and two screens saving at once do not undo each other. An answer this version does not recognize is refused here rather than stored, so nothing is ever persisted for a later reader to have to interpret.
pub async fn put_iam_consent(configuration: &configuration::Configuration, ) -> Result<(), Error<PutIamConsentError>> {
let uri_str = format!("{}/v1/iam/consent", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PutIamConsentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Changes an invitation's terms — the role it grants, how many may redeem it, or when it expires. What it is called does not change.
pub async fn put_iam_invitations_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_invitations_period_input: models::IamPeriodInvitationsPeriodInput) -> Result<models::IamPeriodInvitation, Error<PutIamInvitationsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_invitations_period_input = iam_period_invitations_period_input;
let uri_str = format!("{}/v1/iam/invitations/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_invitations_period_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodInvitation`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodInvitation`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutIamInvitationsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Changes what a key is called or what it may reach. The credential itself is not reissued — the key in your deployment keeps working.
pub async fn put_iam_keys_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_key: models::IamPeriodKey) -> Result<models::IamPeriodKey, Error<PutIamKeysByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_key = iam_period_key;
let uri_str = format!("{}/v1/iam/keys/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_key);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodKey`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodKey`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutIamKeysByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Replaces the calling person's password. Only their own — there is no shape of this request that writes somebody else's. Prove who you are with the password you are replacing, or — when you cannot sign in at all — with a code sent to the address the account already holds. Exactly one of the two: a request carrying both proves nothing more than either, and answering it would mean deciding which one mattered. A reset also clears the account lockout, in the SAME transaction as the digest. Replacing a credential retires the run of guesses against the old one, and without this a person who reset a forgotten password was still refused for up to fifteen more minutes — with the brand-new password they had just chosen.
pub async fn put_iam_password(configuration: &configuration::Configuration, iam_period_password_body: models::IamPeriodPasswordBody, cookie: Option<&str>, authorization: Option<&str>) -> Result<models::IamPeriodAnswer, Error<PutIamPasswordError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_password_body = iam_period_password_body;
let p_cookie = cookie;
let p_authorization = authorization;
let uri_str = format!("{}/v1/iam/password", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(param_value) = p_cookie {
req_builder = req_builder.header("Cookie", param_value.to_string());
}
if let Some(param_value) = p_authorization {
req_builder = req_builder.header("Authorization", param_value.to_string());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_password_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutIamPasswordError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Changes who a permission grants to, what it allows, or the resources it covers. Access changes as soon as the write lands. What the permission is called does not change, and neither does when it was created.
pub async fn put_iam_permissions_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_permission: models::IamPeriodPermission) -> Result<models::IamPeriodPermission, Error<PutIamPermissionsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_permission = iam_period_permission;
let uri_str = format!("{}/v1/iam/permissions/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_permission);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodPermission`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodPermission`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutIamPermissionsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Changes a project's settings. What it is called does not change, and neither does when it was created.
pub async fn put_iam_projects_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_projects_period_input: models::IamPeriodProjectsPeriodInput) -> Result<models::IamPeriodProject, Error<PutIamProjectsByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_projects_period_input = iam_period_projects_period_input;
let uri_str = format!("{}/v1/iam/projects/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_projects_period_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProject`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProject`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutIamProjectsByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Changes who is in a role, or which roles it includes. Access changes for everyone in it as soon as the write lands. What the role is called does not change, and neither does when it was created.
pub async fn put_iam_roles_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_roles_period_input: models::IamPeriodRolesPeriodInput) -> Result<models::IamPeriodRole, Error<PutIamRolesByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_roles_period_input = iam_period_roles_period_input;
let uri_str = format!("{}/v1/iam/roles/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_roles_period_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodRole`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodRole`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutIamRolesByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Overwrites a person's SCIM attributes with what your identity provider sends — how a change made there lands here. Only the attributes SCIM describes are replaced. Anything the standard does not cover — their multi-factor enrolment above all — survives untouched, so a routine sync from your IdP can never quietly strip someone's second factor or bring a deleted account back.
pub async fn put_iam_scim_v2_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<(), Error<PutIamScimV2UsersByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let uri_str = format!("{}/v1/iam/scim/v2/Users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PutIamScimV2UsersByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Changes a person's profile, their roles, or the credentials they sign in with. Send a password to reset it; leave it out and their current one keeps working. Who they are does not change: their organization, username and the identifier their existing sessions are keyed on all survive the write, so an update never signs anyone out.
pub async fn put_iam_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_update_input: models::IamPeriodUpdateInput) -> Result<models::IamPeriodUser, Error<PutIamUsersByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_update_input = iam_period_update_input;
let uri_str = format!("{}/v1/iam/users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_update_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodUser`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodUser`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutIamUsersByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Changes a workspace's settings. What it is called does not change, and neither does when it was created.
pub async fn put_iam_workspaces_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_workspaces_period_input: models::IamPeriodWorkspacesPeriodInput) -> Result<models::IamPeriodWorkspace, Error<PutIamWorkspacesByOwnerByNameError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_workspaces_period_input = iam_period_workspaces_period_input;
let uri_str = format!("{}/v1/iam/workspaces/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_workspaces_period_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWorkspace`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWorkspace`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutIamWorkspacesByOwnerByNameError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Changes how an organization appears across Hanzo: the square mark beside its name, as an uploaded image or as a single emoji. Sending an image clears the emoji and sending an emoji clears the image — an organization has one mark, not a preference order — and sending neither clears both, which is how it goes back to being drawn as its initial. An image is an https link or the bytes inline as a data URL, up to 96 KiB. Anyone who administers the organization may set this; it is not reserved to the platform. It writes the two fields onto the stored row and touches nothing else, which update cannot do: update replaces the whole record, and a record read back first arrives masked, so a read-modify-write through it would persist the mask over the organization's own credential settings.
pub async fn set_organization_avatar(configuration: &configuration::Configuration, iam_period_set_avatar_input: models::IamPeriodSetAvatarInput) -> Result<models::IamPeriodOrganization, Error<SetOrganizationAvatarError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_set_avatar_input = iam_period_set_avatar_input;
let uri_str = format!("{}/v1/iam/organizations/avatar", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_set_avatar_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodOrganization`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodOrganization`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<SetOrganizationAvatarError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Changes an organization's display, its defaults and the sign-in rules everyone in it inherits. Which organization it is does not change, and neither does when it was created.
pub async fn update_organization(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_update_organization_input: models::IamPeriodUpdateOrganizationInput) -> Result<models::IamPeriodOrganization, Error<UpdateOrganizationError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_update_organization_input = iam_period_update_organization_input;
let uri_str = format!("{}/v1/iam/organizations/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_update_organization_input);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodOrganization`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodOrganization`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateOrganizationError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Changes a provider's settings or rotates the credentials it holds. The change takes effect on the next sign-in through it — sessions already issued are unaffected. A provider that is not there answers \"nothing changed\" rather than an error, so the call is safe to repeat.
pub async fn update_provider(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_provider: models::IamPeriodProvider) -> Result<models::IamPeriodMutationResult, Error<UpdateProviderError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_provider = iam_period_provider;
let uri_str = format!("{}/v1/iam/providers/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_provider);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodMutationResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodMutationResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateProviderError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Replaces the set of browsers a session covers — signing out the ones you leave off while the session itself stays live. A session that does not exist is reported as missing rather than created.
pub async fn update_session(configuration: &configuration::Configuration, owner: &str, name: &str, application: &str, iam_period_update_session_in: models::IamPeriodUpdateSessionIn) -> Result<models::IamPeriodSession, Error<UpdateSessionError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_application = application;
let p_iam_period_update_session_in = iam_period_update_session_in;
let uri_str = format!("{}/v1/iam/sessions/{owner}/{name}/{application}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name), application=crate::apis::urlencode(p_application));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_update_session_in);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodSession`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodSession`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateSessionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Changes an access token's scope or expiry. A token that is not there answers \"nothing changed\" rather than an error, so the call is safe to repeat.
pub async fn update_token(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_token: models::IamPeriodToken) -> Result<models::IamPeriodTokenMutation, Error<UpdateTokenError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_token = iam_period_token;
let uri_str = format!("{}/v1/iam/tokens/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_token);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodTokenMutation`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodTokenMutation`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateTokenError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Renames a registered passkey or security key, so a person can tell their devices apart. A credential that is not there answers \"nothing changed\" rather than an error, so the call is safe to repeat.
pub async fn update_webauthn_credential(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_webauthn_credential: models::IamPeriodWebauthnCredential) -> Result<models::IamPeriodWebauthnCredentialMutationResult, Error<UpdateWebauthnCredentialError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_owner = owner;
let p_name = name;
let p_iam_period_webauthn_credential = iam_period_webauthn_credential;
let uri_str = format!("{}/v1/iam/webauthn-credentials/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_webauthn_credential);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialMutationResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialMutationResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateWebauthnCredentialError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Creates an application or updates it in place, so a deployment can declare the applications it needs and run the same declaration on every environment and on every redeploy. It says which of the two it did. Leave the client secret out and the existing one is kept — so re-running your deployment does not rotate a credential your running services are holding.
pub async fn upsert_application(configuration: &configuration::Configuration, iam_period_registration: models::IamPeriodRegistration, authorization: Option<&str>) -> Result<models::IamPeriodReply, Error<UpsertApplicationError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_registration = iam_period_registration;
let p_authorization = authorization;
let uri_str = format!("{}/v1/iam/admin/applications/upsert", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(param_value) = p_authorization {
req_builder = req_builder.header("Authorization", param_value.to_string());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_registration);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodReply`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodReply`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpsertApplicationError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
/// Creates a person or updates them in place, so a deployment can declare the accounts it needs and re-run that declaration safely. It DESCRIBES an account it meets and GRANTS only to one it creates: org-admin is never raised on a row that already exists, and a machine identity is answered by name rather than adopted. Both are properties of the update itself, so a steady-state reconcile — which changes neither — is unaffected. Passwords are hashed before they are stored. Leave the password out and their current one is kept, so a redeploy never locks somebody out; send the same one again and it is kept too, so a steady-state re-run is not a rotation.
pub async fn upsert_user(configuration: &configuration::Configuration, iam_period_person: models::IamPeriodPerson, authorization: Option<&str>) -> Result<models::IamPeriodReply, Error<UpsertUserError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_iam_period_person = iam_period_person;
let p_authorization = authorization;
let uri_str = format!("{}/v1/iam/admin/users/upsert", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(param_value) = p_authorization {
req_builder = req_builder.header("Authorization", param_value.to_string());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_iam_period_person);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodReply`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodReply`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpsertUserError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}