# -*- coding: utf-8 -*-
"""
esdc_api.response
~~~~~~~~~~~~~~~~~

This module provides the Response object returned by Danube Cloud API :class:`.Client` request methods.
"""

import json
from collections import namedtuple

from .exceptions import ESAPIRuntimeError, ServerError, ClientError, TaskError, TaskFailure, TaskRevoked

__all__ = (
    'Response',
    'Content'
)

#: Danube Cloud API Response content tuple returned by :attr:`.Response.content` property.
Content = namedtuple('Content', ('result', 'dc', 'task_status', 'task_id'))


class Response(object):
    """
    Danube Cloud API Response (wrapper around :class:`requests.Response <requests.Response>` class).

    :param response: The :class:`requests.Response <requests.Response>` object.
    """
    def __init__(self, response):
        """Initialize the response object."""
        self._response = response
        self._content = None
        self._raw_content = None
        self._status_code = None
        headers = response.headers