Response¶
-
class
pysnow.response.Response(response, resource, chunk_size=2048, stream=False)[source]¶ Takes a
requests.Responseobject and performs deserialization and validation.Parameters: - response –
requests.Responseobject - resource – parent
resource.Resourceobject - chunk_size – Read and return up to this size (in bytes) in the stream parser
-
all()[source]¶ Returns a chained generator response containing all matching records
Returns: - Iterable response
-
first()[source]¶ Return the first record or raise an exception if the result doesn’t contain any data
Returns: - Dictionary containing the first item in the response content
Raise: - NoResults: If no results were found
-
first_or_none()[source]¶ Return the first record or None
Returns: - Dictionary containing the first item or None
-
one()[source]¶ Return exactly one record or raise an exception.
Returns: - Dictionary containing the only item in the response content
Raise: - MultipleResults: If more than one records are present in the content
- NoResults: If the result is empty
-
one_or_none()[source]¶ Return at most one record or raise an exception.
Returns: - Dictionary containing the matching record or None
Raise: - MultipleResults: If more than one records are present in the content
- response –