Response

class pysnow.response.Response(response, chunk_size=2048)[source]

Takes a requests.Response object and performs deserialization and validation.

Parameters:
  • responserequest.Response object
  • 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