Async Settings

This module provides functionality for working with async settings.

class AsyncSystemSettings(api, data={})[source]

Bases: AsyncBase

Parameters:
BASE_ENDPOINT = 'settings/'
__init__(api, data={})[source]

Initialize a System Settings instance.

Parameters:
  • api (AsyncGeoboxClient) – The AsyncGeoboxClient instance for making requests.

  • data (Dict, optional) – The data of the Setting.

property max_log_policy: MaxLogPolicy

Get max log policy

Returns:

max log policy

Return type:

MaxLogPolicy

property invalid_data_policy: InvalidDataPolicy

Get invalid data policy

Returns:

invalid data policy

Return type:

InvalidDataPolicy

property login_failure_policy: LoginFailurePolicy

Get login failure policy

Returns:

login failure policy

Return type:

LoginFailurePolicy

property max_concurrent_session_policy: MaxConcurrentSessionPolicy

Get max concurrent sessions

Returns:

max concurrent sessions

Return type:

MaxConcurrentSessionPolicy

__repr__()[source]

Return a string representation of the system setting instance.

Returns:

A string representation of the system setting instance.

Return type:

str

async classmethod get_system_settings(api)[source]

[async] Get System Settings object (Permission Required).

Parameters:

api (AsyncGeoboxClient) – The AsyncGeoboxClient instance for making requests.

Returns:

the system settings object.

Return type:

AsyncSystemSetting

Example

>>> from geobox.aio import AsyncGeoboxClient
>>> from geobox.aio.setting import AsyncSystemSettings
>>> async with AsyncGeoboxClient() as client:
>>>     setting = await AsyncSystemSettings.get_system_settings(client)
or
>>>     setting = await client.get_system_settings()
async update(**kwargs)[source]

[async] Update the system settings.

Keyword Arguments:
  • brand_name (str)

  • brand_website (str)

  • max_log (int)

  • max_log_policy (MaxLogPolicy)

  • users_can_view_their_own_logs (bool)

  • max_upload_file_size (int)

  • invalid_data_policy (InvalidDataPolicy)

  • max_login_attempts (int)

  • login_failure_policy (LoginFailurePolicy)

  • login_attempts_duration (int)

  • min_password_length (int)

  • max_concurrent_session (int)

  • max_concurrent_session_policy (MaxConcurrentSessionPolicy)

  • session_timeout (int)

  • allowed_ip_addresses (Dict)

  • blocked_ip_addresses (Dict)

Returns:

The updated system settings data.

Return type:

Dict

Raises:

ValidationError – If the system settings data is invalid.

Example

>>> from geobox.aio import AsyncGeoboxClient
>>> from geobox.aio.setting import AsyncSystemSettings
>>> async with AsyncGeoboxClient() as client:
>>>     settings = await AsyncSystemSetting.get_system_settings(client)
or
>>>     settings = await client.get_system_settings()
>>>     await settings.update(max_log=100000)