unity_sds_client package

Subpackages

Submodules

unity_sds_client.unity module

class unity_sds_client.unity.Unity(environment: UnityEnvironments = UnityEnvironments.PROD, config_file_override: str | None = None)

Bases: object

The Unity class is used to create services and resources that facilitate interacting with the Unity Platform. Basic shared configuration items are also saved here. This wraps an underlying unity_session.Session object, which is passed to different services and resources as needed.

client(service_name: UnityServices)

:param service_name - the desired service, such as UnityServices.APPLICATION_SERVICE, UnityServices.DATA_SERVICE, or UnityServices.PROCESS_SERVICE.

set_project(project)
Parameters:

project – the project to use when interacting with venue specific services. Used in building the restful

endpoint.

set_venue(venue)
Parameters:

venue – the venue to use when interacting with venue specific services. Used in building the restful

endpoint.

set_venue_id(venue_id)
Parameters:

venue_id – explicitly name the venue identifier. Useful for legacy or non-hierarchical venue ids. Used in building the restful

endpoint.

unity_sds_client.unity_environments module

class unity_sds_client.unity_environments.UnityEnvironments(value)

Bases: Enum

An enumeration.

DEV = 'DEV'
PROD = 'PROD'
TEST = 'TEST'

unity_sds_client.unity_exception module

exception unity_sds_client.unity_exception.UnityException

Bases: Exception

An exception for Unity specific exceptions. Use python exceptions where it makes more sense (e.g. request.http errors)

unity_sds_client.unity_services module

class unity_sds_client.unity_services.UnityServices(value)

Bases: Enum

The UnityServices class is used to specify a service, when needed, when interacting with the unity_sds_client package.

APPLICATION_SERVICE = 'app_service'
DATA_SERVICE = 'data_service'
HEALTH_SERVICE = 'health_service'
PROCESS_SERVICE = 'process_service'

unity_sds_client.unity_session module

class unity_sds_client.unity_session.UnityAuth(client_id, auth_endpoint)

Bases: object

Unity Auth object for handling cognito authentication on behalf of all service wrappers.

auth_json = '{\n         "AuthParameters" : {\n            "USERNAME" : "",\n            "PASSWORD" : ""\n         },\n         "AuthFlow" : "USER_PASSWORD_AUTH",\n         "ClientId" : ""\n      }'
get_token()

Public convenience method for getting a token. This begins the process of returning an already created token or will create a new token if necessary

Returns:

The token for use in API calls

Return type:

str

class unity_sds_client.unity_session.UnitySession(env: UnityEnvironments, config: ConfigParser)

Bases: object

passable session object containing configuration, auth objects, and environment.

get_auth()

Returns the auth object in use by the session

Returns:

The authentication object which allows access to a “token” for api calls.

Return type:

UnityAuth

get_config()

Returns the configuration being used by the session

Returns:

The configuration object which contains configuration information used for api calls.

Return type:

Config

get_project()
get_service_endpoint(section, setting)

convenience method for getting a configured item from the included configuration.

Parameters:
  • section (str) – The section of the configuration to read.

  • setting (str) – The item within a block to read.

Returns:

the configuration entry

Return type:

str

get_unity_href()

convenience method for getting the unity href.

Parameters:

none

Returns:

the url to the unity top url

Return type:

str

get_venue()
get_venue_id()

Module contents