User Models
User models for the ACPortal API.
- class ab.api.models.users.User(*, id=None, username=None, email=None, roles=None, company=None, login=None, fullName=None, contactId=None, contactDisplayId=None, contactCompanyName=None, contactCompanyId=None, contactCompanyDisplayId=None, emailConfirmed=None, contactPhone=None, contactEmail=None, password=None, lockoutDateUtc=None, lockoutEnabled=None, role=None, isActive=None, legacyId=None, additionalUserCompanies=None, additionalUserCompaniesNames=None, crmContactId=None, **extra_data)[source]
Bases:
ResponseModel,IdentifiedModelUser record — POST /users/list.
- Parameters:
username (str | None)
email (str | None)
company (dict | None)
login (str | None)
fullName (str | None)
contactId (int | None)
contactDisplayId (str | None)
contactCompanyName (str | None)
contactCompanyId (str | None)
contactCompanyDisplayId (str | None)
emailConfirmed (bool | None)
contactPhone (str | None)
contactEmail (str | None)
password (str | None)
lockoutDateUtc (str | None)
lockoutEnabled (bool | None)
role (str | None)
isActive (bool | None)
legacyId (str | None)
crmContactId (int | None)
extra_data (Any)
- model_config = {'alias_generator': <function _to_camel>, 'extra': 'allow', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ab.api.models.users.UserRole(*, id=None, name=None, **extra_data)[source]
Bases:
ResponseModelDeprecated — the live API returns roles as plain strings, not objects.
The
GET /users/rolesendpoint returnsList[str](e.g.["CorporateAccounting", "Admin"]), notList[{id, name}]objects as the Swagger spec originally implied. The route now usesresponse_model="List[str]"and this class is retained only for backward compatibility.- model_config = {'alias_generator': <function _to_camel>, 'extra': 'allow', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ab.api.models.users.UserCreateRequest(*, username=None, email=None, roles=None)[source]
Bases:
RequestModelBody for POST /users/user.
- model_config = {'alias_generator': <function _to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ab.api.models.users.UserUpdateRequest(*, id=None, username=None, email=None, roles=None)[source]
Bases:
RequestModelBody for PUT /users/user.
- model_config = {'alias_generator': <function _to_camel>, 'extra': 'forbid', 'populate_by_name': True, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].