use std::collections::HashMap;
#[cfg(any(feature = "rc-str", feature = "rc-vec"))]
use std::sync::Arc;

#[cfg(feature = "schemars")]
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use serde_with::skip_serializing_none;

#[cfg(not(feature = "rc-map"))]
pub type TypeMap<K, V> = HashMap<K, V>;
#[cfg(not(feature = "rc-str"))]
pub type TypeString = String;
#[cfg(not(feature = "rc-val"))]
pub type TypeValue = Value;
#[cfg(not(feature = "rc-vec"))]
pub type TypeVec<I> = Vec<I>;

#[cfg(feature = "rc-map")]
pub type TypeMap<K, V> = Arc<HashMap<K, V>>;
#[cfg(feature = "rc-str")]
pub type TypeString = Arc<str>;
#[cfg(feature = "rc-val")]
pub type TypeValue = Arc<Value>;
#[cfg(feature = "rc-vec")]
pub type TypeVec<I> = Arc<[I]>;

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct AbstractPolicyRepresentation {
    pub decision_strategy: Option<DecisionStrategy>,
    pub description: Option<TypeString>,
    pub id: Option<TypeString>,
    pub logic: Option<Logic>,
    pub name: Option<TypeString>,
    pub owner: Option<TypeString>,
    pub policies: Option<TypeVec<String>>,
    pub resource_type: Option<TypeString>,
    pub resources: Option<TypeVec<String>>,
    pub resources_data: Option<TypeVec<ResourceRepresentation>>,
    pub scopes: Option<TypeVec<String>>,
    pub scopes_data: Option<TypeVec<ScopeRepresentation>>,
    #[serde(rename = "type")]
    pub type_: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct Access {
    pub roles: Option<TypeVec<String>>,
    pub verify_caller: Option<bool>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct AccessToken {
    pub acr: Option<TypeString>,
    #[serde(rename = "allowed-origins")]
    pub allowed_origins: Option<TypeVec<String>>,
    pub at_hash: Option<TypeString>,
    pub auth_time: Option<i64>,
    pub authorization: Option<Authorization>,
    pub authorization_details: Option<TypeVec<AuthorizationDetailsJSONRepresentation>>,
    pub azp: Option<TypeString>,
    pub birthdate: Option<TypeString>,
    pub c_hash: Option<TypeString>,
    pub claims_locales: Option<TypeString>,
    pub cnf: Option<Confirmation>,
    pub email: Option<TypeString>,
    pub email_verified: Option<bool>,
    pub exp: Option<i64>,
    pub family_name: Option<TypeString>,
    pub gender: Option<TypeString>,
    pub given_name: Option<TypeString>,
    pub iat: Option<i64>,
    pub iss: Option<TypeString>,
    pub jti: Option<TypeString>,
    pub locale: Option<TypeString>,
    pub middle_name: Option<TypeString>,
    pub name: Option<TypeString>,
    pub nbf: Option<i64>,
    pub nickname: Option<TypeString>,
    pub nonce: Option<TypeString>,
    #[serde(rename = "otherClaims")]
    pub other_claims: Option<TypeMap<String, Value>>,
    pub phone_number: Option<TypeString>,
    pub phone_number_verified: Option<bool>,
    pub picture: Option<TypeString>,
    pub preferred_username: Option<TypeString>,
    pub profile: Option<TypeString>,
    pub realm_access: Option<Access>,
    pub resource_access: Option<TypeMap<String, Access>>,
    pub s_hash: Option<TypeString>,
    pub scope: Option<TypeString>,
    pub sid: Option<TypeString>,
    pub sub: Option<TypeString>,
    #[serde(rename = "trusted-certs")]
    pub trusted_certs: Option<TypeVec<String>>,
    pub typ: Option<TypeString>,
    pub updated_at: Option<i64>,
    pub website: Option<TypeString>,
    pub zoneinfo: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct AdminEventRepresentation {
    pub auth_details: Option<AuthDetailsRepresentation>,
    pub details: Option<TypeMap<String, TypeString>>,
    pub error: Option<TypeString>,
    pub id: Option<TypeString>,
    pub operation_type: Option<TypeString>,
    pub realm_id: Option<TypeString>,
    pub representation: Option<TypeString>,
    pub resource_path: Option<TypeString>,
    pub resource_type: Option<TypeString>,
    pub time: Option<i64>,
}

#[deprecated]
#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ApplicationRepresentation {
    pub access: Option<TypeMap<String, bool>>,
    pub admin_url: Option<TypeString>,
    pub always_display_in_console: Option<bool>,
    pub attributes: Option<TypeMap<String, TypeString>>,
    pub authentication_flow_binding_overrides: Option<TypeMap<String, TypeString>>,
    pub authorization_services_enabled: Option<bool>,
    pub authorization_settings: Option<ResourceServerRepresentation>,
    pub base_url: Option<TypeString>,
    pub bearer_only: Option<bool>,
    #[deprecated]
    pub claims: Option<ClaimRepresentation>,
    pub client_authenticator_type: Option<TypeString>,
    pub client_id: Option<TypeString>,
    #[deprecated]
    pub client_template: Option<TypeString>,
    pub consent_required: Option<bool>,
    pub default_client_scopes: Option<TypeVec<String>>,
    #[deprecated]
    pub default_roles: Option<TypeVec<String>>,
    pub description: Option<TypeString>,
    pub direct_access_grants_enabled: Option<bool>,
    #[deprecated]
    pub direct_grants_only: Option<bool>,
    pub enabled: Option<bool>,
    pub frontchannel_logout: Option<bool>,
    pub full_scope_allowed: Option<bool>,
    pub id: Option<TypeString>,
    pub implicit_flow_enabled: Option<bool>,
    pub name: Option<TypeString>,
    pub node_re_registration_timeout: Option<i32>,
    pub not_before: Option<i32>,
    pub optional_client_scopes: Option<TypeVec<String>>,
    pub origin: Option<TypeString>,
    pub protocol: Option<TypeString>,
    pub protocol_mappers: Option<TypeVec<ProtocolMapperRepresentation>>,
    pub public_client: Option<bool>,
    pub redirect_uris: Option<TypeVec<String>>,
    pub registered_nodes: Option<TypeMap<String, i32>>,
    pub registration_access_token: Option<TypeString>,
    pub root_url: Option<TypeString>,
    pub secret: Option<TypeString>,
    pub service_accounts_enabled: Option<bool>,
    pub standard_flow_enabled: Option<bool>,
    pub surrogate_auth_required: Option<bool>,
    #[serde(rename = "type")]
    pub type_: Option<TypeString>,
    #[deprecated]
    pub use_template_config: Option<bool>,
    #[deprecated]
    pub use_template_mappers: Option<bool>,
    #[deprecated]
    pub use_template_scope: Option<bool>,
    pub web_origins: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct AuthDetailsRepresentation {
    pub client_id: Option<TypeString>,
    pub ip_address: Option<TypeString>,
    pub realm_id: Option<TypeString>,
    pub user_id: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct AuthenticationExecutionExportRepresentation {
    pub authenticator: Option<TypeString>,
    pub authenticator_config: Option<TypeString>,
    pub authenticator_flow: Option<bool>,
    #[deprecated]
    pub autheticator_flow: Option<bool>,
    pub flow_alias: Option<TypeString>,
    pub priority: Option<i32>,
    pub requirement: Option<TypeString>,
    pub user_setup_allowed: Option<bool>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct AuthenticationExecutionInfoRepresentation {
    pub alias: Option<TypeString>,
    pub authentication_config: Option<TypeString>,
    pub authentication_flow: Option<bool>,
    pub configurable: Option<bool>,
    pub description: Option<TypeString>,
    pub display_name: Option<TypeString>,
    pub flow_id: Option<TypeString>,
    pub id: Option<TypeString>,
    pub index: Option<i32>,
    pub level: Option<i32>,
    pub priority: Option<i32>,
    pub provider_id: Option<TypeString>,
    pub requirement: Option<TypeString>,
    pub requirement_choices: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct AuthenticationExecutionRepresentation {
    pub authenticator: Option<TypeString>,
    pub authenticator_config: Option<TypeString>,
    pub authenticator_flow: Option<bool>,
    #[deprecated]
    pub autheticator_flow: Option<bool>,
    pub flow_id: Option<TypeString>,
    pub id: Option<TypeString>,
    pub parent_flow: Option<TypeString>,
    pub priority: Option<i32>,
    pub requirement: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct AuthenticationFlowRepresentation {
    pub alias: Option<TypeString>,
    pub authentication_executions: Option<TypeVec<AuthenticationExecutionExportRepresentation>>,
    pub built_in: Option<bool>,
    pub description: Option<TypeString>,
    pub id: Option<TypeString>,
    pub provider_id: Option<TypeString>,
    pub top_level: Option<bool>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct AuthenticatorConfigInfoRepresentation {
    pub help_text: Option<TypeString>,
    pub name: Option<TypeString>,
    pub properties: Option<TypeVec<ConfigPropertyRepresentation>>,
    pub provider_id: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct AuthenticatorConfigRepresentation {
    pub alias: Option<TypeString>,
    pub config: Option<TypeMap<String, TypeString>>,
    pub id: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct Authorization {
    pub permissions: Option<TypeVec<Permission>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct AuthorizationDetailsJSONRepresentation {
    pub actions: Option<TypeVec<String>>,
    pub custom_data: Option<TypeMap<String, Value>>,
    pub datatypes: Option<TypeVec<String>>,
    pub identifier: Option<TypeString>,
    pub locations: Option<TypeVec<String>>,
    pub privileges: Option<TypeVec<String>>,
    #[serde(rename = "type")]
    pub type_: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct AuthorizationSchema {
    pub resource_types: Option<TypeMap<String, ResourceType>>,
}

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum BruteForceStrategy {
    Linear,
    Multiple,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct CertificateRepresentation {
    pub certificate: Option<TypeString>,
    pub jwks: Option<TypeString>,
    pub kid: Option<TypeString>,
    pub private_key: Option<TypeString>,
    pub public_key: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct ClaimRepresentation {
    pub address: Option<bool>,
    pub email: Option<bool>,
    pub gender: Option<bool>,
    pub locale: Option<bool>,
    pub name: Option<bool>,
    pub phone: Option<bool>,
    pub picture: Option<bool>,
    pub profile: Option<bool>,
    pub username: Option<bool>,
    pub website: Option<bool>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ClientInitialAccessCreatePresentation {
    pub count: Option<i32>,
    pub expiration: Option<i32>,
    pub web_origins: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ClientInitialAccessPresentation {
    pub count: Option<i32>,
    pub expiration: Option<i32>,
    pub id: Option<TypeString>,
    pub remaining_count: Option<i32>,
    pub timestamp: Option<i32>,
    pub token: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct ClientMappingsRepresentation {
    pub client: Option<TypeString>,
    pub id: Option<TypeString>,
    pub mappings: Option<TypeVec<RoleRepresentation>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ClientPoliciesRepresentation {
    pub global_policies: Option<TypeVec<ClientPolicyRepresentation>>,
    pub policies: Option<TypeVec<ClientPolicyRepresentation>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct ClientPolicyConditionRepresentation {
    pub condition: Option<TypeString>,
    pub configuration: Option<TypeMap<String, TypeValue>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct ClientPolicyExecutorRepresentation {
    pub configuration: Option<TypeMap<String, TypeValue>>,
    pub executor: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct ClientPolicyRepresentation {
    pub conditions: Option<TypeVec<ClientPolicyConditionRepresentation>>,
    pub description: Option<TypeString>,
    pub enabled: Option<bool>,
    pub name: Option<TypeString>,
    pub profiles: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct ClientProfileRepresentation {
    pub description: Option<TypeString>,
    pub executors: Option<TypeVec<ClientPolicyExecutorRepresentation>>,
    pub name: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ClientProfilesRepresentation {
    pub global_profiles: Option<TypeVec<ClientProfileRepresentation>>,
    pub profiles: Option<TypeVec<ClientProfileRepresentation>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ClientRepresentation {
    pub access: Option<TypeMap<String, bool>>,
    pub admin_url: Option<TypeString>,
    pub always_display_in_console: Option<bool>,
    pub attributes: Option<TypeMap<String, TypeString>>,
    pub authentication_flow_binding_overrides: Option<TypeMap<String, TypeString>>,
    pub authorization_services_enabled: Option<bool>,
    pub authorization_settings: Option<ResourceServerRepresentation>,
    pub base_url: Option<TypeString>,
    pub bearer_only: Option<bool>,
    pub client_authenticator_type: Option<TypeString>,
    pub client_id: Option<TypeString>,
    #[deprecated]
    pub client_template: Option<TypeString>,
    pub consent_required: Option<bool>,
    pub default_client_scopes: Option<TypeVec<String>>,
    #[deprecated]
    pub default_roles: Option<TypeVec<String>>,
    pub description: Option<TypeString>,
    pub direct_access_grants_enabled: Option<bool>,
    #[deprecated]
    pub direct_grants_only: Option<bool>,
    pub enabled: Option<bool>,
    pub frontchannel_logout: Option<bool>,
    pub full_scope_allowed: Option<bool>,
    pub id: Option<TypeString>,
    pub implicit_flow_enabled: Option<bool>,
    pub name: Option<TypeString>,
    pub node_re_registration_timeout: Option<i32>,
    pub not_before: Option<i32>,
    pub optional_client_scopes: Option<TypeVec<String>>,
    pub origin: Option<TypeString>,
    pub protocol: Option<TypeString>,
    pub protocol_mappers: Option<TypeVec<ProtocolMapperRepresentation>>,
    pub public_client: Option<bool>,
    pub redirect_uris: Option<TypeVec<String>>,
    pub registered_nodes: Option<TypeMap<String, i32>>,
    pub registration_access_token: Option<TypeString>,
    pub root_url: Option<TypeString>,
    pub secret: Option<TypeString>,
    pub service_accounts_enabled: Option<bool>,
    pub standard_flow_enabled: Option<bool>,
    pub surrogate_auth_required: Option<bool>,
    #[serde(rename = "type")]
    pub type_: Option<TypeString>,
    #[deprecated]
    pub use_template_config: Option<bool>,
    #[deprecated]
    pub use_template_mappers: Option<bool>,
    #[deprecated]
    pub use_template_scope: Option<bool>,
    pub web_origins: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ClientScopeRepresentation {
    pub attributes: Option<TypeMap<String, TypeString>>,
    pub description: Option<TypeString>,
    pub id: Option<TypeString>,
    pub name: Option<TypeString>,
    pub protocol: Option<TypeString>,
    pub protocol_mappers: Option<TypeVec<ProtocolMapperRepresentation>>,
}

#[deprecated]
#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ClientTemplateRepresentation {
    pub attributes: Option<TypeMap<String, TypeString>>,
    pub bearer_only: Option<bool>,
    pub consent_required: Option<bool>,
    pub description: Option<TypeString>,
    pub direct_access_grants_enabled: Option<bool>,
    pub frontchannel_logout: Option<bool>,
    pub full_scope_allowed: Option<bool>,
    pub id: Option<TypeString>,
    pub implicit_flow_enabled: Option<bool>,
    pub name: Option<TypeString>,
    pub protocol: Option<TypeString>,
    pub protocol_mappers: Option<TypeVec<ProtocolMapperRepresentation>>,
    pub public_client: Option<bool>,
    pub service_accounts_enabled: Option<bool>,
    pub standard_flow_enabled: Option<bool>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct ClientTypeRepresentation {
    pub config: Option<TypeMap<String, PropertyConfig>>,
    pub name: Option<TypeString>,
    pub parent: Option<TypeString>,
    pub provider: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct ClientTypesRepresentation {
    #[serde(rename = "client-types")]
    pub client_types: Option<TypeVec<ClientTypeRepresentation>>,
    #[serde(rename = "global-client-types")]
    pub global_client_types: Option<TypeVec<ClientTypeRepresentation>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ComponentExportRepresentation {
    pub config: Option<MultivaluedHashMapStringString>,
    pub id: Option<TypeString>,
    pub name: Option<TypeString>,
    pub provider_id: Option<TypeString>,
    pub sub_components: Option<MultivaluedHashMapStringComponentExportRepresentation>,
    pub sub_type: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ComponentRepresentation {
    pub config: Option<MultivaluedHashMapStringString>,
    pub id: Option<TypeString>,
    pub name: Option<TypeString>,
    pub parent_id: Option<TypeString>,
    pub provider_id: Option<TypeString>,
    pub provider_type: Option<TypeString>,
    pub sub_type: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ComponentTypeRepresentation {
    pub client_properties: Option<TypeVec<ConfigPropertyRepresentation>>,
    pub help_text: Option<TypeString>,
    pub id: Option<TypeString>,
    pub metadata: Option<TypeMap<String, Value>>,
    pub properties: Option<TypeVec<ConfigPropertyRepresentation>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct Composites {
    #[deprecated]
    pub application: Option<TypeMap<String, TypeVec<String>>>,
    pub client: Option<TypeMap<String, TypeVec<String>>>,
    pub realm: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ConfigPropertyRepresentation {
    pub default_value: Option<Value>,
    pub help_text: Option<TypeString>,
    pub label: Option<TypeString>,
    pub name: Option<TypeString>,
    pub options: Option<TypeVec<String>>,
    pub read_only: Option<bool>,
    pub required: Option<bool>,
    pub secret: Option<bool>,
    #[serde(rename = "type")]
    pub type_: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct Confirmation {
    pub jkt: Option<TypeString>,
    #[serde(rename = "x5t#S256")]
    pub x5t_s256: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct CredentialRepresentation {
    #[deprecated]
    pub algorithm: Option<TypeString>,
    #[deprecated]
    pub config: Option<MultivaluedHashMapStringString>,
    #[deprecated]
    pub counter: Option<i32>,
    pub created_date: Option<i64>,
    pub credential_data: Option<TypeString>,
    #[deprecated]
    pub device: Option<TypeString>,
    #[deprecated]
    pub digits: Option<i32>,
    pub federation_link: Option<TypeString>,
    #[deprecated]
    pub hash_iterations: Option<i32>,
    #[deprecated]
    pub hashed_salted_value: Option<TypeString>,
    pub id: Option<TypeString>,
    #[deprecated]
    pub period: Option<i32>,
    pub priority: Option<i32>,
    #[deprecated]
    pub salt: Option<TypeString>,
    pub secret_data: Option<TypeString>,
    pub temporary: Option<bool>,
    #[serde(rename = "type")]
    pub type_: Option<TypeString>,
    pub user_label: Option<TypeString>,
    pub value: Option<TypeString>,
}

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum DecisionEffect {
    Permit,
    Deny,
}

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum DecisionStrategy {
    Affirmative,
    Unanimous,
    Consensus,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ErrorRepresentation {
    pub error_message: Option<TypeString>,
    pub errors: Option<TypeVec<ErrorRepresentation>>,
    pub field: Option<TypeString>,
    pub params: Option<TypeVec<Value>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct EvaluationResultRepresentation {
    pub allowed_scopes: Option<TypeVec<ScopeRepresentation>>,
    pub denied_scopes: Option<TypeVec<ScopeRepresentation>>,
    pub policies: Option<TypeVec<PolicyResultRepresentation>>,
    pub resource: Option<ResourceRepresentation>,
    pub scopes: Option<TypeVec<ScopeRepresentation>>,
    pub status: Option<DecisionEffect>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct EventRepresentation {
    pub client_id: Option<TypeString>,
    pub details: Option<TypeMap<String, TypeString>>,
    pub error: Option<TypeString>,
    pub id: Option<TypeString>,
    pub ip_address: Option<TypeString>,
    pub realm_id: Option<TypeString>,
    pub session_id: Option<TypeString>,
    pub time: Option<i64>,
    #[serde(rename = "type")]
    pub type_: Option<TypeString>,
    pub user_id: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct FederatedIdentityRepresentation {
    pub identity_provider: Option<TypeString>,
    pub user_id: Option<TypeString>,
    pub user_name: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct GlobalRequestResult {
    pub failed_requests: Option<TypeVec<String>>,
    pub success_requests: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct GroupRepresentation {
    pub access: Option<TypeMap<String, bool>>,
    pub attributes: Option<TypeMap<String, TypeVec<String>>>,
    pub client_roles: Option<TypeMap<String, TypeVec<String>>>,
    pub description: Option<TypeString>,
    pub id: Option<TypeString>,
    pub name: Option<TypeString>,
    pub parent_id: Option<TypeString>,
    pub path: Option<TypeString>,
    pub realm_roles: Option<TypeVec<String>>,
    pub sub_group_count: Option<i64>,
    pub sub_groups: Option<TypeVec<GroupRepresentation>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct IDToken {
    pub acr: Option<TypeString>,
    pub at_hash: Option<TypeString>,
    pub auth_time: Option<i64>,
    pub azp: Option<TypeString>,
    pub birthdate: Option<TypeString>,
    pub c_hash: Option<TypeString>,
    pub claims_locales: Option<TypeString>,
    pub email: Option<TypeString>,
    pub email_verified: Option<bool>,
    pub exp: Option<i64>,
    pub family_name: Option<TypeString>,
    pub gender: Option<TypeString>,
    pub given_name: Option<TypeString>,
    pub iat: Option<i64>,
    pub iss: Option<TypeString>,
    pub jti: Option<TypeString>,
    pub locale: Option<TypeString>,
    pub middle_name: Option<TypeString>,
    pub name: Option<TypeString>,
    pub nbf: Option<i64>,
    pub nickname: Option<TypeString>,
    pub nonce: Option<TypeString>,
    #[serde(rename = "otherClaims")]
    pub other_claims: Option<TypeMap<String, Value>>,
    pub phone_number: Option<TypeString>,
    pub phone_number_verified: Option<bool>,
    pub picture: Option<TypeString>,
    pub preferred_username: Option<TypeString>,
    pub profile: Option<TypeString>,
    pub s_hash: Option<TypeString>,
    pub sid: Option<TypeString>,
    pub sub: Option<TypeString>,
    pub typ: Option<TypeString>,
    pub updated_at: Option<i64>,
    pub website: Option<TypeString>,
    pub zoneinfo: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct IdentityProviderMapperRepresentation {
    pub config: Option<TypeMap<String, TypeString>>,
    pub id: Option<TypeString>,
    pub identity_provider_alias: Option<TypeString>,
    pub identity_provider_mapper: Option<TypeString>,
    pub name: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct IdentityProviderMapperTypeRepresentation {
    pub category: Option<TypeString>,
    pub help_text: Option<TypeString>,
    pub id: Option<TypeString>,
    pub name: Option<TypeString>,
    pub properties: Option<TypeVec<ConfigPropertyRepresentation>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct IdentityProviderRepresentation {
    pub add_read_token_role_on_create: Option<bool>,
    pub alias: Option<TypeString>,
    pub authenticate_by_default: Option<bool>,
    pub config: Option<TypeMap<String, TypeString>>,
    pub display_name: Option<TypeString>,
    pub enabled: Option<bool>,
    pub first_broker_login_flow_alias: Option<TypeString>,
    pub hide_on_login: Option<bool>,
    pub internal_id: Option<TypeString>,
    pub link_only: Option<bool>,
    pub organization_id: Option<TypeString>,
    pub post_broker_login_flow_alias: Option<TypeString>,
    pub provider_id: Option<TypeString>,
    pub store_token: Option<bool>,
    pub trust_email: Option<bool>,
    pub types: Option<TypeVec<String>>,
    #[deprecated]
    pub update_profile_first_login: Option<bool>,
    #[deprecated]
    pub update_profile_first_login_mode: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct KeyMetadataRepresentation {
    pub algorithm: Option<TypeString>,
    pub certificate: Option<TypeString>,
    pub kid: Option<TypeString>,
    pub provider_id: Option<TypeString>,
    pub provider_priority: Option<i64>,
    pub public_key: Option<TypeString>,
    pub status: Option<TypeString>,
    #[serde(rename = "type")]
    pub type_: Option<TypeString>,
    #[serde(rename = "use")]
    pub use_: Option<KeyUse>,
    pub valid_to: Option<i64>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct KeyStoreConfig {
    pub format: Option<TypeString>,
    pub key_alias: Option<TypeString>,
    pub key_password: Option<TypeString>,
    pub key_size: Option<i32>,
    pub realm_alias: Option<TypeString>,
    pub realm_certificate: Option<bool>,
    pub store_password: Option<TypeString>,
    pub validity: Option<i32>,
}

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum KeyUse {
    Sig,
    Enc,
    JwtSvid,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct KeysMetadataRepresentation {
    pub active: Option<TypeMap<String, TypeString>>,
    pub keys: Option<TypeVec<KeyMetadataRepresentation>>,
}

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum Logic {
    Positive,
    Negative,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ManagementPermissionReference {
    pub enabled: Option<bool>,
    pub resource: Option<TypeString>,
    pub scope_permissions: Option<TypeMap<String, TypeString>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct MappingsRepresentation {
    pub client_mappings: Option<TypeMap<String, ClientMappingsRepresentation>>,
    pub realm_mappings: Option<TypeVec<RoleRepresentation>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct MemberRepresentation {
    pub access: Option<TypeMap<String, bool>>,
    #[deprecated]
    pub application_roles: Option<TypeMap<String, TypeVec<String>>>,
    pub attributes: Option<TypeMap<String, TypeVec<String>>>,
    pub client_consents: Option<TypeVec<UserConsentRepresentation>>,
    pub client_roles: Option<TypeMap<String, TypeVec<String>>>,
    pub created_timestamp: Option<i64>,
    pub credentials: Option<TypeVec<CredentialRepresentation>>,
    pub disableable_credential_types: Option<TypeVec<String>>,
    pub email: Option<TypeString>,
    pub email_verified: Option<bool>,
    pub enabled: Option<bool>,
    pub federated_identities: Option<TypeVec<FederatedIdentityRepresentation>>,
    pub federation_link: Option<TypeString>,
    pub first_name: Option<TypeString>,
    pub groups: Option<TypeVec<String>>,
    pub id: Option<TypeString>,
    pub last_name: Option<TypeString>,
    pub membership_type: Option<MembershipType>,
    pub not_before: Option<i32>,
    pub origin: Option<TypeString>,
    pub realm_roles: Option<TypeVec<String>>,
    pub required_actions: Option<TypeVec<String>>,
    #[serde(rename = "self")]
    pub self_: Option<TypeString>,
    pub service_account_client_id: Option<TypeString>,
    #[deprecated]
    pub social_links: Option<TypeVec<SocialLinkRepresentation>>,
    pub totp: Option<bool>,
    pub user_profile_metadata: Option<UserProfileMetadata>,
    pub username: Option<TypeString>,
}

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum MembershipType {
    Unmanaged,
    Managed,
}

pub type MultivaluedHashMapStringComponentExportRepresentation =
    TypeMap<String, TypeVec<ComponentExportRepresentation>>;

pub type MultivaluedHashMapStringString = TypeMap<String, TypeVec<String>>;

#[deprecated]
#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct OAuthClientRepresentation {
    pub access: Option<TypeMap<String, bool>>,
    pub admin_url: Option<TypeString>,
    pub always_display_in_console: Option<bool>,
    pub attributes: Option<TypeMap<String, TypeString>>,
    pub authentication_flow_binding_overrides: Option<TypeMap<String, TypeString>>,
    pub authorization_services_enabled: Option<bool>,
    pub authorization_settings: Option<ResourceServerRepresentation>,
    pub base_url: Option<TypeString>,
    pub bearer_only: Option<bool>,
    #[deprecated]
    pub claims: Option<ClaimRepresentation>,
    pub client_authenticator_type: Option<TypeString>,
    pub client_id: Option<TypeString>,
    #[deprecated]
    pub client_template: Option<TypeString>,
    pub consent_required: Option<bool>,
    pub default_client_scopes: Option<TypeVec<String>>,
    #[deprecated]
    pub default_roles: Option<TypeVec<String>>,
    pub description: Option<TypeString>,
    pub direct_access_grants_enabled: Option<bool>,
    #[deprecated]
    pub direct_grants_only: Option<bool>,
    pub enabled: Option<bool>,
    pub frontchannel_logout: Option<bool>,
    pub full_scope_allowed: Option<bool>,
    pub id: Option<TypeString>,
    pub implicit_flow_enabled: Option<bool>,
    pub name: Option<TypeString>,
    pub node_re_registration_timeout: Option<i32>,
    pub not_before: Option<i32>,
    pub optional_client_scopes: Option<TypeVec<String>>,
    pub origin: Option<TypeString>,
    pub protocol: Option<TypeString>,
    pub protocol_mappers: Option<TypeVec<ProtocolMapperRepresentation>>,
    pub public_client: Option<bool>,
    pub redirect_uris: Option<TypeVec<String>>,
    pub registered_nodes: Option<TypeMap<String, i32>>,
    pub registration_access_token: Option<TypeString>,
    pub root_url: Option<TypeString>,
    pub secret: Option<TypeString>,
    pub service_accounts_enabled: Option<bool>,
    pub standard_flow_enabled: Option<bool>,
    pub surrogate_auth_required: Option<bool>,
    #[serde(rename = "type")]
    pub type_: Option<TypeString>,
    #[deprecated]
    pub use_template_config: Option<bool>,
    #[deprecated]
    pub use_template_mappers: Option<bool>,
    #[deprecated]
    pub use_template_scope: Option<bool>,
    pub web_origins: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct OrganizationDomainRepresentation {
    pub name: Option<TypeString>,
    pub verified: Option<bool>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct OrganizationInvitationRepresentation {
    pub email: Option<TypeString>,
    pub expires_at: Option<i32>,
    pub first_name: Option<TypeString>,
    pub id: Option<TypeString>,
    pub invite_link: Option<TypeString>,
    pub last_name: Option<TypeString>,
    pub organization_id: Option<TypeString>,
    pub sent_date: Option<i32>,
    pub status: Option<Status>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct OrganizationRepresentation {
    pub alias: Option<TypeString>,
    pub attributes: Option<TypeMap<String, TypeVec<String>>>,
    pub description: Option<TypeString>,
    pub domains: Option<TypeVec<OrganizationDomainRepresentation>>,
    pub enabled: Option<bool>,
    pub groups: Option<TypeVec<GroupRepresentation>>,
    pub id: Option<TypeString>,
    pub identity_providers: Option<TypeVec<IdentityProviderRepresentation>>,
    pub members: Option<TypeVec<MemberRepresentation>>,
    pub name: Option<TypeString>,
    pub redirect_url: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct Permission {
    pub claims: Option<TypeMap<String, TypeVec<String>>>,
    pub rsid: Option<TypeString>,
    pub rsname: Option<TypeString>,
    pub scopes: Option<TypeVec<String>>,
}

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum PolicyEnforcementMode {
    Enforcing,
    Permissive,
    Disabled,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct PolicyEvaluationRequest {
    pub client_id: Option<TypeString>,
    pub context: Option<TypeMap<String, TypeMap<String, TypeString>>>,
    pub entitlements: Option<bool>,
    pub resource_type: Option<TypeString>,
    pub resources: Option<TypeVec<ResourceRepresentation>>,
    pub role_ids: Option<TypeVec<String>>,
    pub user_id: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct PolicyEvaluationResponse {
    pub entitlements: Option<bool>,
    pub results: Option<TypeVec<EvaluationResultRepresentation>>,
    pub rpt: Option<AccessToken>,
    pub status: Option<DecisionEffect>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct PolicyProviderRepresentation {
    pub code: Option<TypeString>,
    pub description: Option<TypeString>,
    pub group: Option<TypeString>,
    pub name: Option<TypeString>,
    #[serde(rename = "type")]
    pub type_: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct PolicyRepresentation {
    pub config: Option<TypeMap<String, TypeString>>,
    pub decision_strategy: Option<DecisionStrategy>,
    pub description: Option<TypeString>,
    pub id: Option<TypeString>,
    pub logic: Option<Logic>,
    pub name: Option<TypeString>,
    pub owner: Option<TypeString>,
    pub policies: Option<TypeVec<String>>,
    pub resource_type: Option<TypeString>,
    pub resources: Option<TypeVec<String>>,
    pub resources_data: Option<TypeVec<ResourceRepresentation>>,
    pub scopes: Option<TypeVec<String>>,
    pub scopes_data: Option<TypeVec<ScopeRepresentation>>,
    #[serde(rename = "type")]
    pub type_: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct PolicyResultRepresentation {
    pub associated_policies: Option<TypeVec<PolicyResultRepresentation>>,
    pub policy: Option<PolicyRepresentation>,
    pub resource_type: Option<TypeString>,
    pub scopes: Option<TypeVec<String>>,
    pub status: Option<DecisionEffect>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct PropertyConfig {
    pub applicable: Option<bool>,
    pub value: Option<Value>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ProtocolMapperEvaluationRepresentation {
    pub container_id: Option<TypeString>,
    pub container_name: Option<TypeString>,
    pub container_type: Option<TypeString>,
    pub mapper_id: Option<TypeString>,
    pub mapper_name: Option<TypeString>,
    pub protocol_mapper: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ProtocolMapperRepresentation {
    pub config: Option<TypeMap<String, TypeString>>,
    #[deprecated]
    pub consent_required: Option<bool>,
    #[deprecated]
    pub consent_text: Option<TypeString>,
    pub id: Option<TypeString>,
    pub name: Option<TypeString>,
    pub protocol: Option<TypeString>,
    pub protocol_mapper: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct PublishedRealmRepresentation {
    #[serde(rename = "account-service")]
    pub account_service: Option<TypeString>,
    pub public_key: Option<TypeString>,
    pub realm: Option<TypeString>,
    #[serde(rename = "token-service")]
    pub token_service: Option<TypeString>,
    #[serde(rename = "tokens-not-before")]
    pub tokens_not_before: Option<i32>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct RealmEventsConfigRepresentation {
    pub admin_events_details_enabled: Option<bool>,
    pub admin_events_enabled: Option<bool>,
    pub enabled_event_types: Option<TypeVec<String>>,
    pub events_enabled: Option<bool>,
    pub events_expiration: Option<i64>,
    pub events_listeners: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct RealmRepresentation {
    pub access_code_lifespan: Option<i32>,
    pub access_code_lifespan_login: Option<i32>,
    pub access_code_lifespan_user_action: Option<i32>,
    pub access_token_lifespan: Option<i32>,
    pub access_token_lifespan_for_implicit_flow: Option<i32>,
    pub account_theme: Option<TypeString>,
    pub action_token_generated_by_admin_lifespan: Option<i32>,
    pub action_token_generated_by_user_lifespan: Option<i32>,
    pub admin_events_details_enabled: Option<bool>,
    pub admin_events_enabled: Option<bool>,
    pub admin_permissions_client: Option<ClientRepresentation>,
    pub admin_permissions_enabled: Option<bool>,
    pub admin_theme: Option<TypeString>,
    #[deprecated]
    pub application_scope_mappings: Option<TypeMap<String, TypeVec<ScopeMappingRepresentation>>>,
    #[deprecated]
    pub applications: Option<TypeVec<ApplicationRepresentation>>,
    pub attributes: Option<TypeMap<String, TypeString>>,
    pub authentication_flows: Option<TypeVec<AuthenticationFlowRepresentation>>,
    pub authenticator_config: Option<TypeVec<AuthenticatorConfigRepresentation>>,
    pub browser_flow: Option<TypeString>,
    pub browser_security_headers: Option<TypeMap<String, TypeString>>,
    pub brute_force_protected: Option<bool>,
    pub brute_force_strategy: Option<BruteForceStrategy>,
    #[deprecated]
    pub certificate: Option<TypeString>,
    pub client_authentication_flow: Option<TypeString>,
    pub client_offline_session_idle_timeout: Option<i32>,
    pub client_offline_session_max_lifespan: Option<i32>,
    pub client_policies: Option<ClientPoliciesRepresentation>,
    pub client_profiles: Option<ClientProfilesRepresentation>,
    pub client_scope_mappings: Option<TypeMap<String, TypeVec<ScopeMappingRepresentation>>>,
    pub client_scopes: Option<TypeVec<ClientScopeRepresentation>>,
    pub client_session_idle_timeout: Option<i32>,
    pub client_session_max_lifespan: Option<i32>,
    #[deprecated]
    pub client_templates: Option<TypeVec<ClientTemplateRepresentation>>,
    pub clients: Option<TypeVec<ClientRepresentation>>,
    #[deprecated]
    pub code_secret: Option<TypeString>,
    pub components: Option<MultivaluedHashMapStringComponentExportRepresentation>,
    pub default_default_client_scopes: Option<TypeVec<String>>,
    pub default_groups: Option<TypeVec<String>>,
    pub default_locale: Option<TypeString>,
    pub default_optional_client_scopes: Option<TypeVec<String>>,
    pub default_role: Option<RoleRepresentation>,
    #[deprecated]
    pub default_roles: Option<TypeVec<String>>,
    pub default_signature_algorithm: Option<TypeString>,
    pub direct_grant_flow: Option<TypeString>,
    pub display_name: Option<TypeString>,
    pub display_name_html: Option<TypeString>,
    pub docker_authentication_flow: Option<TypeString>,
    pub duplicate_emails_allowed: Option<bool>,
    pub edit_username_allowed: Option<bool>,
    pub email_theme: Option<TypeString>,
    pub enabled: Option<bool>,
    pub enabled_event_types: Option<TypeVec<String>>,
    pub events_enabled: Option<bool>,
    pub events_expiration: Option<i64>,
    pub events_listeners: Option<TypeVec<String>>,
    pub failure_factor: Option<i32>,
    pub federated_users: Option<TypeVec<UserRepresentation>>,
    pub first_broker_login_flow: Option<TypeString>,
    pub groups: Option<TypeVec<GroupRepresentation>>,
    pub id: Option<TypeString>,
    pub identity_provider_mappers: Option<TypeVec<IdentityProviderMapperRepresentation>>,
    pub identity_providers: Option<TypeVec<IdentityProviderRepresentation>>,
    pub internationalization_enabled: Option<bool>,
    pub keycloak_version: Option<TypeString>,
    pub localization_texts: Option<TypeMap<String, TypeMap<String, TypeString>>>,
    pub login_theme: Option<TypeString>,
    pub login_with_email_allowed: Option<bool>,
    pub max_delta_time_seconds: Option<i32>,
    pub max_failure_wait_seconds: Option<i32>,
    pub max_secondary_auth_failures: Option<i32>,
    pub max_temporary_lockouts: Option<i32>,
    pub minimum_quick_login_wait_seconds: Option<i32>,
    pub not_before: Option<i32>,
    pub oauth2_device_code_lifespan: Option<i32>,
    pub oauth2_device_polling_interval: Option<i32>,
    #[deprecated]
    pub oauth_clients: Option<TypeVec<OAuthClientRepresentation>>,
    pub offline_session_idle_timeout: Option<i32>,
    pub offline_session_max_lifespan: Option<i32>,
    pub offline_session_max_lifespan_enabled: Option<bool>,
    pub organizations: Option<TypeVec<OrganizationRepresentation>>,
    pub organizations_enabled: Option<bool>,
    pub otp_policy_algorithm: Option<TypeString>,
    pub otp_policy_code_reusable: Option<bool>,
    pub otp_policy_digits: Option<i32>,
    pub otp_policy_initial_counter: Option<i32>,
    pub otp_policy_look_ahead_window: Option<i32>,
    pub otp_policy_period: Option<i32>,
    pub otp_policy_type: Option<TypeString>,
    pub otp_supported_applications: Option<TypeVec<String>>,
    #[deprecated]
    pub password_credential_grant_allowed: Option<bool>,
    pub password_policy: Option<TypeString>,
    pub permanent_lockout: Option<bool>,
    #[deprecated]
    pub private_key: Option<TypeString>,
    pub protocol_mappers: Option<TypeVec<ProtocolMapperRepresentation>>,
    #[deprecated]
    pub public_key: Option<TypeString>,
    pub quick_login_check_milli_seconds: Option<i64>,
    pub realm: Option<TypeString>,
    #[deprecated]
    pub realm_cache_enabled: Option<bool>,
    pub refresh_token_max_reuse: Option<i32>,
    pub registration_allowed: Option<bool>,
    pub registration_email_as_username: Option<bool>,
    pub registration_flow: Option<TypeString>,
    pub remember_me: Option<bool>,
    pub required_actions: Option<TypeVec<RequiredActionProviderRepresentation>>,
    #[deprecated]
    pub required_credentials: Option<TypeVec<String>>,
    pub reset_credentials_flow: Option<TypeString>,
    pub reset_password_allowed: Option<bool>,
    pub revoke_refresh_token: Option<bool>,
    pub roles: Option<RolesRepresentation>,
    pub scim_api_enabled: Option<bool>,
    pub scope_mappings: Option<TypeVec<ScopeMappingRepresentation>>,
    pub smtp_server: Option<TypeMap<String, TypeString>>,
    #[deprecated]
    pub social: Option<bool>,
    #[deprecated]
    pub social_providers: Option<TypeMap<String, TypeString>>,
    pub ssl_required: Option<TypeString>,
    pub sso_session_idle_timeout: Option<i32>,
    pub sso_session_idle_timeout_remember_me: Option<i32>,
    pub sso_session_max_lifespan: Option<i32>,
    pub sso_session_max_lifespan_remember_me: Option<i32>,
    pub supported_locales: Option<TypeVec<String>>,
    #[deprecated]
    pub update_profile_on_initial_social_login: Option<bool>,
    #[deprecated]
    pub user_cache_enabled: Option<bool>,
    pub user_federation_mappers: Option<TypeVec<UserFederationMapperRepresentation>>,
    pub user_federation_providers: Option<TypeVec<UserFederationProviderRepresentation>>,
    pub user_managed_access_allowed: Option<bool>,
    pub users: Option<TypeVec<UserRepresentation>>,
    pub verifiable_credentials_enabled: Option<bool>,
    pub verify_email: Option<bool>,
    pub wait_increment_seconds: Option<i32>,
    pub web_authn_policy_acceptable_aaguids: Option<TypeVec<String>>,
    pub web_authn_policy_attestation_conveyance_preference: Option<TypeString>,
    pub web_authn_policy_authenticator_attachment: Option<TypeString>,
    pub web_authn_policy_avoid_same_authenticator_register: Option<bool>,
    pub web_authn_policy_create_timeout: Option<i32>,
    pub web_authn_policy_extra_origins: Option<TypeVec<String>>,
    pub web_authn_policy_passwordless_acceptable_aaguids: Option<TypeVec<String>>,
    pub web_authn_policy_passwordless_attestation_conveyance_preference: Option<TypeString>,
    pub web_authn_policy_passwordless_authenticator_attachment: Option<TypeString>,
    pub web_authn_policy_passwordless_avoid_same_authenticator_register: Option<bool>,
    pub web_authn_policy_passwordless_create_timeout: Option<i32>,
    pub web_authn_policy_passwordless_extra_origins: Option<TypeVec<String>>,
    pub web_authn_policy_passwordless_passkeys_enabled: Option<bool>,
    pub web_authn_policy_passwordless_require_resident_key: Option<TypeString>,
    pub web_authn_policy_passwordless_rp_entity_name: Option<TypeString>,
    pub web_authn_policy_passwordless_rp_id: Option<TypeString>,
    pub web_authn_policy_passwordless_signature_algorithms: Option<TypeVec<String>>,
    pub web_authn_policy_passwordless_user_verification_requirement: Option<TypeString>,
    pub web_authn_policy_require_resident_key: Option<TypeString>,
    pub web_authn_policy_rp_entity_name: Option<TypeString>,
    pub web_authn_policy_rp_id: Option<TypeString>,
    pub web_authn_policy_signature_algorithms: Option<TypeVec<String>>,
    pub web_authn_policy_user_verification_requirement: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct RequiredActionConfigInfoRepresentation {
    pub properties: Option<TypeVec<ConfigPropertyRepresentation>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct RequiredActionConfigRepresentation {
    pub config: Option<TypeMap<String, TypeString>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct RequiredActionProviderRepresentation {
    pub alias: Option<TypeString>,
    pub config: Option<TypeMap<String, TypeString>>,
    pub default_action: Option<bool>,
    pub enabled: Option<bool>,
    pub name: Option<TypeString>,
    pub priority: Option<i32>,
    pub provider_id: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct ResourceOwnerRepresentation {
    pub id: Option<TypeString>,
    pub name: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ResourceRepresentation {
    #[serde(rename = "_id")]
    pub id: Option<TypeString>,
    pub attributes: Option<TypeMap<String, TypeVec<String>>>,
    pub display_name: Option<TypeString>,
    #[serde(rename = "icon_uri")]
    pub icon_uri: Option<TypeString>,
    pub name: Option<TypeString>,
    pub owner: Option<ResourceOwnerRepresentation>,
    pub owner_managed_access: Option<bool>,
    pub scopes: Option<TypeVec<ScopeRepresentation>>,
    pub scopes_uma: Option<TypeVec<ScopeRepresentation>>,
    #[serde(rename = "type")]
    pub type_: Option<TypeString>,
    #[deprecated]
    pub uri: Option<TypeString>,
    pub uris: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ResourceServerRepresentation {
    pub allow_remote_resource_management: Option<bool>,
    pub authorization_schema: Option<AuthorizationSchema>,
    pub client_id: Option<TypeString>,
    pub decision_strategy: Option<DecisionStrategy>,
    pub id: Option<TypeString>,
    pub name: Option<TypeString>,
    pub policies: Option<TypeVec<PolicyRepresentation>>,
    pub policy_enforcement_mode: Option<PolicyEnforcementMode>,
    pub resources: Option<TypeVec<ResourceRepresentation>>,
    pub scopes: Option<TypeVec<ScopeRepresentation>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ResourceType {
    pub group_type: Option<TypeString>,
    pub scope_aliases: Option<TypeMap<String, TypeVec<String>>>,
    pub scopes: Option<TypeVec<String>>,
    #[serde(rename = "type")]
    pub type_: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct RoleRepresentation {
    pub attributes: Option<TypeMap<String, TypeVec<String>>>,
    pub client_role: Option<bool>,
    pub composite: Option<bool>,
    pub composites: Option<Composites>,
    pub container_id: Option<TypeString>,
    pub description: Option<TypeString>,
    pub id: Option<TypeString>,
    pub name: Option<TypeString>,
    #[deprecated]
    pub scope_param_required: Option<bool>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct RolesRepresentation {
    #[deprecated]
    pub application: Option<TypeMap<String, TypeVec<RoleRepresentation>>>,
    pub client: Option<TypeMap<String, TypeVec<RoleRepresentation>>>,
    pub realm: Option<TypeVec<RoleRepresentation>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ScopeMappingRepresentation {
    pub client: Option<TypeString>,
    pub client_scope: Option<TypeString>,
    #[deprecated]
    pub client_template: Option<TypeString>,
    pub roles: Option<TypeVec<String>>,
    #[serde(rename = "self")]
    pub self_: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct ScopeRepresentation {
    pub display_name: Option<TypeString>,
    pub icon_uri: Option<TypeString>,
    pub id: Option<TypeString>,
    pub name: Option<TypeString>,
    pub policies: Option<TypeVec<PolicyRepresentation>>,
    pub resources: Option<TypeVec<ResourceRepresentation>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct SocialLinkRepresentation {
    pub social_provider: Option<TypeString>,
    pub social_user_id: Option<TypeString>,
    pub social_username: Option<TypeString>,
}

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum Status {
    Pending,
    Expired,
}

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum StepExecutionStatus {
    Completed,
    Pending,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct UPAttribute {
    pub annotations: Option<TypeMap<String, Value>>,
    pub default_value: Option<TypeString>,
    pub display_name: Option<TypeString>,
    pub group: Option<TypeString>,
    pub multivalued: Option<bool>,
    pub name: Option<TypeString>,
    pub permissions: Option<UPAttributePermissions>,
    pub required: Option<UPAttributeRequired>,
    pub selector: Option<UPAttributeSelector>,
    pub validations: Option<TypeMap<String, TypeMap<String, Value>>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct UPAttributePermissions {
    pub edit: Option<TypeVec<String>>,
    pub view: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct UPAttributeRequired {
    pub roles: Option<TypeVec<String>>,
    pub scopes: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct UPAttributeSelector {
    pub scopes: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct UPConfig {
    pub attributes: Option<TypeVec<UPAttribute>>,
    pub groups: Option<TypeVec<UPGroup>>,
    pub unmanaged_attribute_policy: Option<UnmanagedAttributePolicy>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct UPGroup {
    pub annotations: Option<TypeMap<String, Value>>,
    pub display_description: Option<TypeString>,
    pub display_header: Option<TypeString>,
    pub name: Option<TypeString>,
}

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum UnmanagedAttributePolicy {
    Enabled,
    AdminView,
    AdminEdit,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct UserConsentRepresentation {
    pub client_id: Option<TypeString>,
    pub created_date: Option<i64>,
    pub granted_client_scopes: Option<TypeVec<String>>,
    #[deprecated]
    pub granted_realm_roles: Option<TypeVec<String>>,
    pub last_updated_date: Option<i64>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct UserFederationMapperRepresentation {
    pub config: Option<TypeMap<String, TypeString>>,
    pub federation_mapper_type: Option<TypeString>,
    pub federation_provider_display_name: Option<TypeString>,
    pub id: Option<TypeString>,
    pub name: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct UserFederationProviderRepresentation {
    pub changed_sync_period: Option<i32>,
    pub config: Option<TypeMap<String, TypeString>>,
    pub display_name: Option<TypeString>,
    pub full_sync_period: Option<i32>,
    pub id: Option<TypeString>,
    pub last_sync: Option<i32>,
    pub priority: Option<i32>,
    pub provider_name: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct UserProfileAttributeGroupMetadata {
    pub annotations: Option<TypeMap<String, Value>>,
    pub display_description: Option<TypeString>,
    pub display_header: Option<TypeString>,
    pub name: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct UserProfileAttributeMetadata {
    pub annotations: Option<TypeMap<String, Value>>,
    pub default_value: Option<TypeString>,
    pub display_name: Option<TypeString>,
    pub group: Option<TypeString>,
    pub multivalued: Option<bool>,
    pub name: Option<TypeString>,
    pub read_only: Option<bool>,
    pub required: Option<bool>,
    pub validators: Option<TypeMap<String, TypeMap<String, Value>>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct UserProfileMetadata {
    pub attributes: Option<TypeVec<UserProfileAttributeMetadata>>,
    pub groups: Option<TypeVec<UserProfileAttributeGroupMetadata>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct UserRepresentation {
    pub access: Option<TypeMap<String, bool>>,
    #[deprecated]
    pub application_roles: Option<TypeMap<String, TypeVec<String>>>,
    pub attributes: Option<TypeMap<String, TypeVec<String>>>,
    pub client_consents: Option<TypeVec<UserConsentRepresentation>>,
    pub client_roles: Option<TypeMap<String, TypeVec<String>>>,
    pub created_timestamp: Option<i64>,
    pub credentials: Option<TypeVec<CredentialRepresentation>>,
    pub disableable_credential_types: Option<TypeVec<String>>,
    pub email: Option<TypeString>,
    pub email_verified: Option<bool>,
    pub enabled: Option<bool>,
    pub federated_identities: Option<TypeVec<FederatedIdentityRepresentation>>,
    pub federation_link: Option<TypeString>,
    pub first_name: Option<TypeString>,
    pub groups: Option<TypeVec<String>>,
    pub id: Option<TypeString>,
    pub last_name: Option<TypeString>,
    pub not_before: Option<i32>,
    pub origin: Option<TypeString>,
    pub realm_roles: Option<TypeVec<String>>,
    pub required_actions: Option<TypeVec<String>>,
    #[serde(rename = "self")]
    pub self_: Option<TypeString>,
    pub service_account_client_id: Option<TypeString>,
    #[deprecated]
    pub social_links: Option<TypeVec<SocialLinkRepresentation>>,
    pub totp: Option<bool>,
    pub user_profile_metadata: Option<UserProfileMetadata>,
    pub username: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct UserSessionRepresentation {
    pub clients: Option<TypeMap<String, TypeString>>,
    pub id: Option<TypeString>,
    pub ip_address: Option<TypeString>,
    pub last_access: Option<i64>,
    pub remember_me: Option<bool>,
    pub start: Option<i64>,
    pub transient_user: Option<bool>,
    pub user_id: Option<TypeString>,
    pub username: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct WorkflowConcurrencyRepresentation {
    #[serde(rename = "cancel-in-progress")]
    pub cancel_in_progress: Option<TypeString>,
    #[serde(rename = "restart-in-progress")]
    pub restart_in_progress: Option<TypeString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct WorkflowRepresentation {
    pub cancel_in_progress: Option<TypeString>,
    pub concurrency: Option<WorkflowConcurrencyRepresentation>,
    pub enabled: Option<bool>,
    pub id: Option<TypeString>,
    #[serde(rename = "if")]
    pub if_: Option<TypeString>,
    pub name: Option<TypeString>,
    pub on: Option<TypeString>,
    pub restart_in_progress: Option<TypeString>,
    pub schedule: Option<WorkflowScheduleRepresentation>,
    pub state: Option<WorkflowStateRepresentation>,
    pub steps: Option<TypeVec<WorkflowStepRepresentation>>,
    pub with: Option<MultivaluedHashMapStringString>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct WorkflowScheduleRepresentation {
    pub after: Option<TypeString>,
    #[serde(rename = "batch-size")]
    pub batch_size: Option<i32>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct WorkflowStateRepresentation {
    pub errors: Option<TypeVec<String>>,
}

#[skip_serializing_none]
#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)]
#[cfg_attr(feature = "schemars", derive(JsonSchema))]
pub struct WorkflowStepRepresentation {
    pub after: Option<TypeString>,
    pub config: Option<MultivaluedHashMapStringString>,
    pub id: Option<TypeString>,
    #[serde(rename = "scheduled-at")]
    pub scheduled_at: Option<i64>,
    pub status: Option<StepExecutionStatus>,
    pub uses: Option<TypeString>,
}
