# Path: muranoclient/common/base.py
# def getid(obj):
#     def __init__(self, api):
#     def _list(self, url, response_key=None, obj_class=None,
#               data=None, headers=None):
#     def _delete(self, url, headers=None):
#     def _update(self, url, data, response_key=None, return_raw=False,
#                 headers=None, method='PUT', content_type='application/json'):
#     def _create(self, url, data=None, response_key=None,
#                 return_raw=False, headers=None):
#     def _get(self, url, response_key=None, return_raw=False, headers=None):
#     def list(self):
#     def find(self, **kwargs):
#     def findall(self, **kwargs):
#     def __init__(self, manager, info, loaded=False):
#     def _add_details(self, info):
#     def __setstate__(self, d):
#     def __getattr__(self, k):
#     def __repr__(self):
#     def get(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def is_loaded(self):
#     def set_loaded(self, val):
#     def to_dict(self):
# class Manager(object):
# class ManagerWithFind(Manager, metaclass=abc.ABCMeta):
# class Resource(object):


from muranoclient.common import base
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.



class InstanceStatistics(base.Resource):
    def __repr__(self):
        return "<Instance statistics %s>" % self._info

    def data(self, **kwargs):
        return self.manager.data(self, **kwargs)


class InstanceStatisticsManager(base.Manager):
    resource_class = InstanceStatistics

    def get(self, environment_id, instance_id=None):
        if instance_id:
            path = '/v1/environments/{id}/instance-statistics/raw/' \
                   '{instance_id}'.format(id=environment_id,
                                          instance_id=instance_id)
        else:
            path = '/v1/environments/{id}/instance-statistics/raw'.format(
                id=environment_id)

# Path: muranoclient/common/base.py
# def getid(obj):
#     def __init__(self, api):
#     def _list(self, url, response_key=None, obj_class=None,
#               data=None, headers=None):
#     def _delete(self, url, headers=None):
#     def _update(self, url, data, response_key=None, return_raw=False,
#                 headers=None, method='PUT', content_type='application/json'):
#     def _create(self, url, data=None, response_key=None,
#                 return_raw=False, headers=None):
#     def _get(self, url, response_key=None, return_raw=False, headers=None):
#     def list(self):
#     def find(self, **kwargs):
#     def findall(self, **kwargs):
#     def __init__(self, manager, info, loaded=False):
#     def _add_details(self, info):
#     def __setstate__(self, d):
#     def __getattr__(self, k):
#     def __repr__(self):
#     def get(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def is_loaded(self):
#     def set_loaded(self, val):
#     def to_dict(self):
# class Manager(object):
# class ManagerWithFind(Manager, metaclass=abc.ABCMeta):
# class Resource(object):


# Path: muranoclient/v1/instance_statistics.py
from muranoclient.common import base

#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.



class InstanceStatistics(base.Resource):
    def __repr__(self):
        return "<Instance statistics %s>" % self._info

    def data(self, **kwargs):
        return self.manager.data(self, **kwargs)


class InstanceStatisticsManager(base.Manager):
    resource_class = InstanceStatistics

    def get(self, environment_id, instance_id=None):
        if instance_id:
            path = '/v1/environments/{id}/instance-statistics/raw/' \
                   '{instance_id}'.format(id=environment_id,
                                          instance_id=instance_id)
        else:
            path = '/v1/environments/{id}/instance-statistics/raw'.format(
                id=environment_id)

        return self._list(path, None)