"""
hudai.resources.domain
"""
from ..helpers.resource import Resource


class DomainResource(Resource):
    def __init__(self, client):
        Resource.__init__(
            self, client, base_path='/companies/domains')
        self.resource_name = 'Domain'

    def list(self, company_id, page=None):
        query_params = self._set_limit_offset({'page': page})
        query_params['company_id'] = company_id

        return self.http_get('/', query_params=query_params)

    def create(self, company_id, hostname):
        return self.http_post('/', data={'hostname': hostname,'company_id': company_id})

    def fetch(self, entity_id):
        return self.http_get('/{id}',
                             params={'id': entity_id})

    def delete(self, entity_id):
        return self.http_delete('/{id}',
                                params={'id': entity_id})

7736537c0a00f28f9fd9ea227e1bf8b4efa9a272
<mask token>


class DomainResource(Resource):
    <mask token>
    <mask token>

    def create(self, company_id, hostname):
        return self.http_post('/', data={'hostname': hostname, 'company_id':
            company_id})
    <mask token>

    def delete(self, entity_id):
        return self.http_delete('/{id}', params={'id': entity_id})

<mask token>


class DomainResource(Resource):
    <mask token>

    def list(self, company_id, page=None):
        query_params = self._set_limit_offset({'page': page})
        query_params['company_id'] = company_id
        return self.http_get('/', query_params=query_params)

    def create(self, company_id, hostname):
        return self.http_post('/', data={'hostname': hostname, 'company_id':
            company_id})
    <mask token>

    def delete(self, entity_id):
        return self.http_delete('/{id}', params={'id': entity_id})

<mask token>


class DomainResource(Resource):
    <mask token>

    def list(self, company_id, page=None):
        query_params = self._set_limit_offset({'page': page})
        query_params['company_id'] = company_id
        return self.http_get('/', query_params=query_params)

    def create(self, company_id, hostname):
        return self.http_post('/', data={'hostname': hostname, 'company_id':
            company_id})

    def fetch(self, entity_id):
        return self.http_get('/{id}', params={'id': entity_id})

    def delete(self, entity_id):
        return self.http_delete('/{id}', params={'id': entity_id})

<mask token>


class DomainResource(Resource):

    def __init__(self, client):
        Resource.__init__(self, client, base_path='/companies/domains')
        self.resource_name = 'Domain'

    def list(self, company_id, page=None):
        query_params = self._set_limit_offset({'page': page})
        query_params['company_id'] = company_id
        return self.http_get('/', query_params=query_params)

    def create(self, company_id, hostname):
        return self.http_post('/', data={'hostname': hostname, 'company_id':
            company_id})

    def fetch(self, entity_id):
        return self.http_get('/{id}', params={'id': entity_id})

    def delete(self, entity_id):
        return self.http_delete('/{id}', params={'id': entity_id})

"""
hudai.resources.domain
"""
from ..helpers.resource import Resource


class DomainResource(Resource):
    def __init__(self, client):
        Resource.__init__(
            self, client, base_path='/companies/domains')
        self.resource_name = 'Domain'

    def list(self, company_id, page=None):
        query_params = self._set_limit_offset({'page': page})
        query_params['company_id'] = company_id

        return self.http_get('/', query_params=query_params)

    def create(self, company_id, hostname):
        return self.http_post('/', data={'hostname': hostname,'company_id': company_id})

    def fetch(self, entity_id):
        return self.http_get('/{id}',
                             params={'id': entity_id})

    def delete(self, entity_id):
        return self.http_delete('/{id}',
                                params={'id': entity_id})
