mysolenso.services.me - User Profile
MySolenso user profile service.
Provides the MySolensoMe class, which queries the
/fun_api_1_user_me endpoint and exposes the connected account’s
information as Python properties.
This module is instantiated automatically by MySolenso
and accessible via client.me.
Example
client = MySolenso(username="jdoe", token="tok")
print(client.me.name)
print(client.me.email)
print(client.me.group_name)
- class mysolenso.services.me.MySolensoMe(parent)[source]
Bases:
objectAccess to the connected Solenso user account information.
Queries the API once at instantiation and caches the profile data. Properties are then available without any additional network call.
- Parameters:
parent – Instance of
MySolensoproviding access to theauthsub-module (for session headers).- Raises:
MySolensoException – If the API response is invalid or if a network error occurs during initialisation.
- parent
Reference to the parent
MySolensoobject.
Example
client = MySolenso(username="jdoe", token="tok") me = client.me print(me.username) # "jdoe" print(me.name) # "John DOE" print(me.email) # "jdoe@jdoe.com" print(me.phone) # "+33600000000" print(me.role_ids) # "1" print(me.roles_name) # "Administrator" print(me.group_name) # "Install Solenso" print(me.all_data) # full dict returned by the API
- property username: str
Login identifier (email address or username).
- Returns:
Value of the
user_namefield returned by the API.- Return type:
- property name: str
Full name of the user.
- Returns:
Value of the
namefield returned by the API.- Return type:
- property phone: str
Phone number associated with the account.
- Returns:
Value of the
phonefield returned by the API, or an empty string if not set.- Return type:
- property email: str
Email address of the account.
- Returns:
Value of the
emailfield returned by the API.- Return type:
- property role_ids: str
Raw role identifier(s) assigned to the user.
- Returns:
Value of the
role_idsfield returned by the API.- Return type:
- property roles_name: str
Name of the first role assigned to the user.
- Returns:
Value of the
namefield from the first element ofroles.- Return type:
- property group_name: str
Name of the group the user belongs to.
- Returns:
Value of the
namefield from thegroupobject.- Return type:
- property all_data: dict
Full raw data returned by the API.
Useful for accessing fields not exposed by the other properties.
Example
- {
“id”: 123456, “user_name”: “JDOE”, “type”: 3, “gid”: 234567, “name”: “John Doe”, “phone”: “+33600000000”, “email”: “jdoe@jdoe.com”, “role_ids”: [90], “identity”: 0, “src”: 0, “tid”: 197, “gpath”: “100267.100269.111139.136448”, “dc”: 0, “roles”: [
- {
“name”: “Propriétaire”, “id”: 90, “v”: 0
}
], “group”: {
“id”: 987654, “name”: “Install Solenso”, “type”: 4
}, “services”: [
- {
“gdpr”: 0
}
]
}
- Returns:
Complete dictionary from the
datafield of the response.- Return type: