10.8.1. Results Abstract Base Class

class pytan3.results.Result[source]

Bases: object

Deserialize API responses from Tanium API.

classmethod from_response(api_objects, response, lvl='info')[source]

Create Result from requests.Response.

Parameters:
Returns:

Result

error_check()[source]

Check for errors in response_body_str.

Raises:
error_text

Get the error text from response_body_str.

Returns:str
api_objects()[source]

Get the API objects container.

Returns:pytan3.api_objects.ApiObjects
url()[source]

Get the URL used in request.

Returns:str
status_code

Get the status code received in response.

Returns:int
method

Get the method used in request.

Returns:str
request_body_str

Get the full request body.

Returns:str
request_body_obj

Get request_body_str deserialized into a python object.

Returns:object
request_object_obj

Get the request objects from request_body_obj.

Returns:dict
response_body_str

Get the full response body.

Returns:str
response_body_obj

Get response_body_str deserialized into a python object.

Returns:object
data_obj

Get the response data from response_body_obj.

Returns:object
data_api(**kwargs)[source]

Get data_obj deserialized into an ApiModel object.

Returns:pytan3.api_models.ApiModel
object_obj

Get the response objects from response_body_obj.

Returns:dict
object_api(**kwargs)[source]

Get object_obj deserialized into an ApiModel object.

Returns:pytan3.api_models.ApiModel
str_to_obj(text, src, **kwargs)[source]

Deserialize string into a python object.

Parameters:
  • text (str) – String to decode into python object
  • src (str) – Where text came from, used in error text.
Raises:

exceptions.TextDeserializeError

Returns:

object

obj_to_api(obj, src)[source]

Deserialize a python object into pytan3.api_models.ApiModel.

Parameters:
  • obj (object) – Python object to deserialize into a PyTan API object.
  • src (str) – Where obj came from, used in error text.
Returns:

pytan3.api_models.ApiModel

_abc_impl = <_abc_data object>