gamebench_api_client.api.requests_retriever.builder package¶
Subpackages¶
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.
-
-
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_method
()[source]¶ Set the proper method for each request.
This can be any valid request method (POST, GET, etc.).
-
-
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.
-
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
-
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.
-