# Path: netvisor/requests/product.py
# class GetProductRequest(Request):
#     method = 'GET'
#     uri = 'GetProduct.nv'
#     response_cls = GetProductResponse
# 
#     def parse_response(self, response):
#         data = super(GetProductRequest, self).parse_response(response)
#         self.ensure_not_empty(data)
#         return data
# 
#     def ensure_not_empty(self, data):
#         if data is None:
#             raise InvalidData(
#                 'Data form incorrect:. '
#                 'Product not found with Netvisor identifier: {0}'.format(
#                     self.params['id']
#                 )
#             )
# 
# class ProductListRequest(Request):
#     method = 'GET'
#     uri = 'ProductList.nv'
#     response_cls = ProductListResponse
# 
# Path: netvisor/services/base.py
# class Service(object):
#     def __init__(self, client):
#         self.client = client


from ..requests.product import GetProductRequest, ProductListRequest
from .base import Service
# -*- coding: utf-8 -*-
"""
    netvisor.services.product
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    :copyright: (c) 2013-2016 by Fast Monkeys Oy.
    :license: MIT, see LICENSE for more details.
"""


class ProductService(Service):
    def get(self, id):
        request = GetProductRequest(self.client, params={'id': id})
        return request.make_request()

    def list(self):

# Path: netvisor/requests/product.py
# class GetProductRequest(Request):
#     method = 'GET'
#     uri = 'GetProduct.nv'
#     response_cls = GetProductResponse
# 
#     def parse_response(self, response):
#         data = super(GetProductRequest, self).parse_response(response)
#         self.ensure_not_empty(data)
#         return data
# 
#     def ensure_not_empty(self, data):
#         if data is None:
#             raise InvalidData(
#                 'Data form incorrect:. '
#                 'Product not found with Netvisor identifier: {0}'.format(
#                     self.params['id']
#                 )
#             )
# 
# class ProductListRequest(Request):
#     method = 'GET'
#     uri = 'ProductList.nv'
#     response_cls = ProductListResponse
# 
# Path: netvisor/services/base.py
# class Service(object):
#     def __init__(self, client):
#         self.client = client


# Path: netvisor/services/product.py
from ..requests.product import GetProductRequest, ProductListRequest
from .base import Service

# -*- coding: utf-8 -*-
"""
    netvisor.services.product
    ~~~~~~~~~~~~~~~~~~~~~~~~~

    :copyright: (c) 2013-2016 by Fast Monkeys Oy.
    :license: MIT, see LICENSE for more details.
"""


class ProductService(Service):
    def get(self, id):
        request = GetProductRequest(self.client, params={'id': id})
        return request.make_request()

    def list(self):

        request = ProductListRequest(self.client)