gamebench_api_client.api.requests_retriever.builder package

Submodules

gamebench_api_client.api.requests_retriever.builder.request_builder module

class gamebench_api_client.api.requests_retriever.builder.request_builder.AuthRequest(**request_parameters)[source]

Bases: gamebench_api_client.api.requests_retriever.builder.request_builder.RequestBuilder

Concrete builder that constructs and assembles the auth request object.

Parameters:request_parameters – Dictionary containing information needed to build the request.
__init__(**request_parameters)[source]

Creates an instance of the Request object for construction.

Parameters:request_parameters – session_id - id for the current session metric - specific category of data being requested (cpu, gpu, battery, etc.) auth_token - authorization token necessary for retrieving data. params - parameters appended to certain session requests (pageSize, timePushed, etc.) data - json body appended to certain session requests (example: {“apps” : [], “devices” : [], “manufacturers” : []})
set_data()[source]

Implementation of the abstract set_data method.

Sets the data property for authentication requests.

set_headers()[source]

Implementation of the abstract set_headers method.

Sets the proper headers property for authentication requests.

set_method()[source]

Implementation of the abstract set_method method.

Sets the proper method property for authentication requests.

set_params()[source]

Implementation of the abstract set_params method.

Sets the proper params property for authentication requests (Note - there aren’t any).

set_url(url_director)[source]

Implementation of the abstract set_method method.

Calls the URL Builder methods to build the auth URL and sets the url property.

class gamebench_api_client.api.requests_retriever.builder.request_builder.Request[source]

Bases: object

The request object under construction.

class gamebench_api_client.api.requests_retriever.builder.request_builder.RequestBuilder(**request_parameters)[source]

Bases: abc.ABC

Abstract interface for building requests.

__init__(**request_parameters)[source]

Creates an instance of the Request object for construction.

Parameters:request_parameters – session_id - id for the current session metric - specific category of data being requested (cpu, gpu, battery, etc.) auth_token - authorization token necessary for retrieving data. params - parameters appended to certain session requests (pageSize, timePushed, etc.) data - json body appended to certain session requests (example: {“apps” : [], “devices” : [], “manufacturers” : []})
set_data()[source]

Set any necessary data to send to the API.

This is used for authentication requests, or requesting specific searches back.

set_headers()[source]

Set the correct headers for the request.

set_method()[source]

Set the proper method for each request.

This can be any valid request method (POST, GET, etc.).

set_params()[source]

Set any necessary parameters for the request.

These are items such as searching for a company ID or limiting the number of items returned.

set_url(url_director)[source]

Set the correct url for the request.

This will call the URL Builder methods to build the needed URL.

class gamebench_api_client.api.requests_retriever.builder.request_builder.SessionRequest(**request_parameters)[source]

Bases: gamebench_api_client.api.requests_retriever.builder.request_builder.RequestBuilder

Concrete builder that constructs and assembles the session request object by implementing the RequestBuilder interface.

__init__(**request_parameters)[source]

Creates an instance of the Request object for construction.

Parameters:request_parameters – session_id - id for the current session metric - specific category of data being requested (cpu, gpu, battery, etc.) auth_token - authorization token necessary for retrieving data. params - parameters appended to certain session requests (pageSize, timePushed, etc.) data - json body appended to certain session requests (example: {“apps” : [], “devices” : [], “manufacturers” : []})
set_data()[source]

Implementation of the abstract set_data method.

Sets the proper data property for session requests.

set_headers()[source]

Implementation of the abstract set_headers method.

Sets the proper headers property for session requests.

set_method()[source]

Implementation of the abstract set_method method.

Sets the proper method property for session requests.

set_params()[source]

Implementation of the abstract set_params method.

Sets the proper params property for session requests.

set_url(url_director)[source]

Implementation of the abstract set_method method.

Calls the URL Builder methods to build the session URL and sets the url property.

gamebench_api_client.api.requests_retriever.builder.request_director module

” Director interface for getting requests from the builder.

class gamebench_api_client.api.requests_retriever.builder.request_director.DirectorLoader[source]

Bases: object

set_url_director()[source]
class gamebench_api_client.api.requests_retriever.builder.request_director.RequestDirector(**request_parameters)[source]

Bases: object

Constructs the Request object using the RequestBuilder interface.

__init__(**request_parameters)[source]

Set up the _builder to be used by the constructor.

Parameters:request_parameters – Dictionary containing information needed to build the request.
construct_request(builder)[source]

Constructs a Request objects.

Parameters:builder – object which determines which concrete creator to use.
get_auth_request()[source]

Constructs an authorization request object and returns the properties as a dictionary.

Returns:request - dictionary containing each element of the auth request.
get_session_request()[source]

Constructs and returns a session request object.

Returns:request - dictionary containing each element of the session request.

Module contents