# Path: magnumclient/common/apiclient/base.py
# class Resource(object):
#     def __init__(self, manager, info, loaded=False):
#     def __repr__(self):
#     def _add_details(self, info):
#     def __getattr__(self, k):
#     def get(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def is_loaded(self):
#     def set_loaded(self, val):
#     def to_dict(self):


import copy
from urllib import parse as urlparse
from magnumclient.common.apiclient import base
                # NOTE(lucasagomes): We need to edit the URL to remove
                # the scheme and netloc
                url_parts = list(urlparse.urlparse(url))
                url_parts[0] = url_parts[1] = ''
                url = urlparse.urlunparse(url_parts)

        return object_list

    def _list(self, url, response_key=None, obj_class=None, body=None):
        resp, body = self.api.json_request('GET', url)

        if obj_class is None:
            obj_class = self.resource_class

        data = self._format_body_data(body, response_key)
        return [obj_class(self, res, loaded=True) for res in data if res]

    def _update(self, url, body=None, method='PATCH', response_key=None):
        if body:
            resp, resp_body = self.api.json_request(method, url, body=body)
        else:
            resp, resp_body = self.api.raw_request(method, url)
        # PATCH/PUT requests may not return a body
        if resp_body:
            return self.resource_class(self, resp_body)

    def _delete(self, url):
        self.api.raw_request('DELETE', url)



# Path: magnumclient/common/apiclient/base.py
# class Resource(object):
#     def __init__(self, manager, info, loaded=False):
#     def __repr__(self):
#     def _add_details(self, info):
#     def __getattr__(self, k):
#     def get(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def is_loaded(self):
#     def set_loaded(self, val):
#     def to_dict(self):


# Path: magnumclient/common/base.py
import copy
from urllib import parse as urlparse
from magnumclient.common.apiclient import base

                # NOTE(lucasagomes): We need to edit the URL to remove
                # the scheme and netloc
                url_parts = list(urlparse.urlparse(url))
                url_parts[0] = url_parts[1] = ''
                url = urlparse.urlunparse(url_parts)

        return object_list

    def _list(self, url, response_key=None, obj_class=None, body=None):
        resp, body = self.api.json_request('GET', url)

        if obj_class is None:
            obj_class = self.resource_class

        data = self._format_body_data(body, response_key)
        return [obj_class(self, res, loaded=True) for res in data if res]

    def _update(self, url, body=None, method='PATCH', response_key=None):
        if body:
            resp, resp_body = self.api.json_request(method, url, body=body)
        else:
            resp, resp_body = self.api.raw_request(method, url)
        # PATCH/PUT requests may not return a body
        if resp_body:
            return self.resource_class(self, resp_body)

    def _delete(self, url):
        self.api.raw_request('DELETE', url)



class Resource(base.Resource):