# coding: utf-8

"""
    Livoltek API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 1.0.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from pylivoltek.api_client import ApiClient


class DefaultApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def get_device_details(self, user_token, site_id, serial_number, **kwargs):  # noqa: E501
        """Device Details  # noqa: E501

        Query the equipment information of the specified device to obtain the device model, SN, working condition (offline, normal, fault, etc.) and its update time, firmware version, device type and manufacturer.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_device_details(user_token, site_id, serial_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object serial_number: Site ID (required)
        :param object user_type: User Type
        :return: InlineResponse2005
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_device_details_with_http_info(user_token, site_id, serial_number, **kwargs)  # noqa: E501
        else:
            (data) = self.get_device_details_with_http_info(user_token, site_id, serial_number, **kwargs)  # noqa: E501
            return data

    def get_device_details_with_http_info(self, user_token, site_id, serial_number, **kwargs):  # noqa: E501
        """Device Details  # noqa: E501

        Query the equipment information of the specified device to obtain the device model, SN, working condition (offline, normal, fault, etc.) and its update time, firmware version, device type and manufacturer.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_device_details_with_http_info(user_token, site_id, serial_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object serial_number: Site ID (required)
        :param object user_type: User Type
        :return: InlineResponse2005
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_token', 'site_id', 'serial_number', 'user_type']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_device_details" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user_token' is set
        if ('user_token' not in params or
                params['user_token'] is None):
            raise ValueError("Missing the required parameter `user_token` when calling `get_device_details`")  # noqa: E501
        # verify the required parameter 'site_id' is set
        if ('site_id' not in params or
                params['site_id'] is None):
            raise ValueError("Missing the required parameter `site_id` when calling `get_device_details`")  # noqa: E501
        # verify the required parameter 'serial_number' is set
        if ('serial_number' not in params or
                params['serial_number'] is None):
            raise ValueError("Missing the required parameter `serial_number` when calling `get_device_details`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'site_id' in params:
            path_params['siteId'] = params['site_id']  # noqa: E501
        if 'serial_number' in params:
            path_params['serialNumber'] = params['serial_number']  # noqa: E501

        query_params = []
        if 'user_token' in params:
            query_params.append(('userToken', params['user_token']))  # noqa: E501
        if 'user_type' in params:
            query_params.append(('userType', params['user_type']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/hess/api/device/{siteId}/{serialNumber}/details', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2005',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_energy_storage(self, user_token, site_id, **kwargs):  # noqa: E501
        """Energy Storage Information  # noqa: E501

        Query the information of the energy storage battery within the specified site to obtain the BAT capacity, BMS SN, current SOC/voltage, battery type, and power / voltage / SOC in recent 7 days, and daily charge and discharge capacity in the last 7 days.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_energy_storage(user_token, site_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object user_type: User Type
        :return: InlineResponse2007
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_energy_storage_with_http_info(user_token, site_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_energy_storage_with_http_info(user_token, site_id, **kwargs)  # noqa: E501
            return data

    def get_energy_storage_with_http_info(self, user_token, site_id, **kwargs):  # noqa: E501
        """Energy Storage Information  # noqa: E501

        Query the information of the energy storage battery within the specified site to obtain the BAT capacity, BMS SN, current SOC/voltage, battery type, and power / voltage / SOC in recent 7 days, and daily charge and discharge capacity in the last 7 days.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_energy_storage_with_http_info(user_token, site_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object user_type: User Type
        :return: InlineResponse2007
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_token', 'site_id', 'user_type']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_energy_storage" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user_token' is set
        if ('user_token' not in params or
                params['user_token'] is None):
            raise ValueError("Missing the required parameter `user_token` when calling `get_energy_storage`")  # noqa: E501
        # verify the required parameter 'site_id' is set
        if ('site_id' not in params or
                params['site_id'] is None):
            raise ValueError("Missing the required parameter `site_id` when calling `get_energy_storage`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'site_id' in params:
            path_params['siteId'] = params['site_id']  # noqa: E501

        query_params = []
        if 'user_token' in params:
            query_params.append(('userToken', params['user_token']))  # noqa: E501
        if 'user_type' in params:
            query_params.append(('userType', params['user_type']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/hess/api/site/{siteId}/ESS', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2007',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_recent_energy_import_export(self, user_token, site_id, **kwargs):  # noqa: E501
        """Get grid import/export history for the last 3 days.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_recent_energy_import_export(user_token, site_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object user_type: User Type
        :return: GridImportExportApiResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_recent_energy_import_export_with_http_info(user_token, site_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_recent_energy_import_export_with_http_info(user_token, site_id, **kwargs)  # noqa: E501
            return data

    def get_recent_energy_import_export_with_http_info(self, user_token, site_id, **kwargs):  # noqa: E501
        """Get grid import/export history for the last 3 days.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_recent_energy_import_export_with_http_info(user_token, site_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object user_type: User Type
        :return: GridImportExportApiResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_token', 'site_id', 'user_type']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_recent_energy_import_export" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user_token' is set
        if ('user_token' not in params or
                params['user_token'] is None):
            raise ValueError("Missing the required parameter `user_token` when calling `get_recent_energy_import_export`")  # noqa: E501
        # verify the required parameter 'site_id' is set
        if ('site_id' not in params or
                params['site_id'] is None):
            raise ValueError("Missing the required parameter `site_id` when calling `get_recent_energy_import_export`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'site_id' in params:
            path_params['siteId'] = params['site_id']  # noqa: E501

        query_params = []
        if 'user_token' in params:
            query_params.append(('userToken', params['user_token']))  # noqa: E501
        if 'user_type' in params:
            query_params.append(('userType', params['user_type']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/hess/api/site/{siteId}/reissueUtilityEnergy', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GridImportExportApiResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_recent_solar_generated_energy(self, user_token, site_id, **kwargs):  # noqa: E501
        """Get solar generation history for the last 3 days.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_recent_solar_generated_energy(user_token, site_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object user_type: User Type
        :return: SolarGenerationApiResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_recent_solar_generated_energy_with_http_info(user_token, site_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_recent_solar_generated_energy_with_http_info(user_token, site_id, **kwargs)  # noqa: E501
            return data

    def get_recent_solar_generated_energy_with_http_info(self, user_token, site_id, **kwargs):  # noqa: E501
        """Get solar generation history for the last 3 days.  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_recent_solar_generated_energy_with_http_info(user_token, site_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object user_type: User Type
        :return: SolarGenerationApiResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_token', 'site_id', 'user_type']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_recent_solar_generated_energy" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user_token' is set
        if ('user_token' not in params or
                params['user_token'] is None):
            raise ValueError("Missing the required parameter `user_token` when calling `get_recent_solar_generated_energy`")  # noqa: E501
        # verify the required parameter 'site_id' is set
        if ('site_id' not in params or
                params['site_id'] is None):
            raise ValueError("Missing the required parameter `site_id` when calling `get_recent_solar_generated_energy`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'site_id' in params:
            path_params['siteId'] = params['site_id']  # noqa: E501

        query_params = []
        if 'user_token' in params:
            query_params.append(('userToken', params['user_token']))  # noqa: E501
        if 'user_type' in params:
            query_params.append(('userType', params['user_type']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/hess/api/site/{siteId}/reissueSolarEnergy', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SolarGenerationApiResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def hess_api_device_device_id_real_electricity_get(self, user_token, device_id, **kwargs):  # noqa: E501
        """Device Generation or Consumption  # noqa: E501

        Return device lifetime generation or consumption  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hess_api_device_device_id_real_electricity_get(user_token, device_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object device_id: Device ID (required)
        :param object user_type: User Type
        :return: InlineResponse2003
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.hess_api_device_device_id_real_electricity_get_with_http_info(user_token, device_id, **kwargs)  # noqa: E501
        else:
            (data) = self.hess_api_device_device_id_real_electricity_get_with_http_info(user_token, device_id, **kwargs)  # noqa: E501
            return data

    def hess_api_device_device_id_real_electricity_get_with_http_info(self, user_token, device_id, **kwargs):  # noqa: E501
        """Device Generation or Consumption  # noqa: E501

        Return device lifetime generation or consumption  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hess_api_device_device_id_real_electricity_get_with_http_info(user_token, device_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object device_id: Device ID (required)
        :param object user_type: User Type
        :return: InlineResponse2003
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_token', 'device_id', 'user_type']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method hess_api_device_device_id_real_electricity_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user_token' is set
        if ('user_token' not in params or
                params['user_token'] is None):
            raise ValueError("Missing the required parameter `user_token` when calling `hess_api_device_device_id_real_electricity_get`")  # noqa: E501
        # verify the required parameter 'device_id' is set
        if ('device_id' not in params or
                params['device_id'] is None):
            raise ValueError("Missing the required parameter `device_id` when calling `hess_api_device_device_id_real_electricity_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'device_id' in params:
            path_params['deviceId'] = params['device_id']  # noqa: E501

        query_params = []
        if 'user_token' in params:
            query_params.append(('userToken', params['user_token']))  # noqa: E501
        if 'user_type' in params:
            query_params.append(('userType', params['user_type']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/hess/api/device/{deviceId}/realElectricity', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2003',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def hess_api_device_site_id_list_get(self, user_token, site_id, page, size, **kwargs):  # noqa: E501
        """Device List  # noqa: E501

        Return the number of equipment in the specified site, equipment ID, equipment type (inverter, charging pile, electricity meter, etc.), equipment model, equipment SN and equipment manufacturer  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hess_api_device_site_id_list_get(user_token, site_id, page, size, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object page: The first device index to be returned in the results, default=1 (required)
        :param object size: Pagesize of each page (required)
        :param object user_type: User Type
        :return: InlineResponse2006
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.hess_api_device_site_id_list_get_with_http_info(user_token, site_id, page, size, **kwargs)  # noqa: E501
        else:
            (data) = self.hess_api_device_site_id_list_get_with_http_info(user_token, site_id, page, size, **kwargs)  # noqa: E501
            return data

    def hess_api_device_site_id_list_get_with_http_info(self, user_token, site_id, page, size, **kwargs):  # noqa: E501
        """Device List  # noqa: E501

        Return the number of equipment in the specified site, equipment ID, equipment type (inverter, charging pile, electricity meter, etc.), equipment model, equipment SN and equipment manufacturer  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hess_api_device_site_id_list_get_with_http_info(user_token, site_id, page, size, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object page: The first device index to be returned in the results, default=1 (required)
        :param object size: Pagesize of each page (required)
        :param object user_type: User Type
        :return: InlineResponse2006
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_token', 'site_id', 'page', 'size', 'user_type']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method hess_api_device_site_id_list_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user_token' is set
        if ('user_token' not in params or
                params['user_token'] is None):
            raise ValueError("Missing the required parameter `user_token` when calling `hess_api_device_site_id_list_get`")  # noqa: E501
        # verify the required parameter 'site_id' is set
        if ('site_id' not in params or
                params['site_id'] is None):
            raise ValueError("Missing the required parameter `site_id` when calling `hess_api_device_site_id_list_get`")  # noqa: E501
        # verify the required parameter 'page' is set
        if ('page' not in params or
                params['page'] is None):
            raise ValueError("Missing the required parameter `page` when calling `hess_api_device_site_id_list_get`")  # noqa: E501
        # verify the required parameter 'size' is set
        if ('size' not in params or
                params['size'] is None):
            raise ValueError("Missing the required parameter `size` when calling `hess_api_device_site_id_list_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'site_id' in params:
            path_params['siteId'] = params['site_id']  # noqa: E501

        query_params = []
        if 'user_token' in params:
            query_params.append(('userToken', params['user_token']))  # noqa: E501
        if 'user_type' in params:
            query_params.append(('userType', params['user_type']))  # noqa: E501
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501
        if 'size' in params:
            query_params.append(('size', params['size']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/hess/api/device/{siteId}/list', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2006',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def hess_api_login_post(self, body, **kwargs):  # noqa: E501
        """API User Login and Get Token  # noqa: E501

        Get api user token and verify whether the API caller has permission  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hess_api_login_post(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ApiLoginBody body: (required)
        :return: InlineResponse200
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.hess_api_login_post_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.hess_api_login_post_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def hess_api_login_post_with_http_info(self, body, **kwargs):  # noqa: E501
        """API User Login and Get Token  # noqa: E501

        Get api user token and verify whether the API caller has permission  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hess_api_login_post_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param ApiLoginBody body: (required)
        :return: InlineResponse200
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method hess_api_login_post" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or
                params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `hess_api_login_post`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/hess/api/login', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse200',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def hess_api_site_site_id_cur_powerflow_get(self, user_token, site_id, **kwargs):  # noqa: E501
        """Current Power Flow  # noqa: E501

        Query the current energy flow of the specified power station to obtain the last update time, status of each system type, parameter unit (W) and value  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hess_api_site_site_id_cur_powerflow_get(user_token, site_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object user_type: User Type
        :return: InlineResponse2004
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.hess_api_site_site_id_cur_powerflow_get_with_http_info(user_token, site_id, **kwargs)  # noqa: E501
        else:
            (data) = self.hess_api_site_site_id_cur_powerflow_get_with_http_info(user_token, site_id, **kwargs)  # noqa: E501
            return data

    def hess_api_site_site_id_cur_powerflow_get_with_http_info(self, user_token, site_id, **kwargs):  # noqa: E501
        """Current Power Flow  # noqa: E501

        Query the current energy flow of the specified power station to obtain the last update time, status of each system type, parameter unit (W) and value  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hess_api_site_site_id_cur_powerflow_get_with_http_info(user_token, site_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object user_type: User Type
        :return: InlineResponse2004
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_token', 'site_id', 'user_type']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method hess_api_site_site_id_cur_powerflow_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user_token' is set
        if ('user_token' not in params or
                params['user_token'] is None):
            raise ValueError("Missing the required parameter `user_token` when calling `hess_api_site_site_id_cur_powerflow_get`")  # noqa: E501
        # verify the required parameter 'site_id' is set
        if ('site_id' not in params or
                params['site_id'] is None):
            raise ValueError("Missing the required parameter `site_id` when calling `hess_api_site_site_id_cur_powerflow_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'site_id' in params:
            path_params['siteId'] = params['site_id']  # noqa: E501

        query_params = []
        if 'user_token' in params:
            query_params.append(('userToken', params['user_token']))  # noqa: E501
        if 'user_type' in params:
            query_params.append(('userType', params['user_type']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/hess/api/site/{siteId}/curPowerflow', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2004',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def hess_api_site_site_id_overview_get(self, user_token, site_id, **kwargs):  # noqa: E501
        """Site Generation Overview  # noqa: E501

        Return generation review of selected site, including site name，amount of online equipment, latest updated timestamp, power, daily generation, monthly generation, yearly generation, lifetime generation  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hess_api_site_site_id_overview_get(user_token, site_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object user_type: User Type
        :return: InlineResponse2002
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.hess_api_site_site_id_overview_get_with_http_info(user_token, site_id, **kwargs)  # noqa: E501
        else:
            (data) = self.hess_api_site_site_id_overview_get_with_http_info(user_token, site_id, **kwargs)  # noqa: E501
            return data

    def hess_api_site_site_id_overview_get_with_http_info(self, user_token, site_id, **kwargs):  # noqa: E501
        """Site Generation Overview  # noqa: E501

        Return generation review of selected site, including site name，amount of online equipment, latest updated timestamp, power, daily generation, monthly generation, yearly generation, lifetime generation  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hess_api_site_site_id_overview_get_with_http_info(user_token, site_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object site_id: Site ID (required)
        :param object user_type: User Type
        :return: InlineResponse2002
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_token', 'site_id', 'user_type']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method hess_api_site_site_id_overview_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user_token' is set
        if ('user_token' not in params or
                params['user_token'] is None):
            raise ValueError("Missing the required parameter `user_token` when calling `hess_api_site_site_id_overview_get`")  # noqa: E501
        # verify the required parameter 'site_id' is set
        if ('site_id' not in params or
                params['site_id'] is None):
            raise ValueError("Missing the required parameter `site_id` when calling `hess_api_site_site_id_overview_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'site_id' in params:
            path_params['siteId'] = params['site_id']  # noqa: E501

        query_params = []
        if 'user_token' in params:
            query_params.append(('userToken', params['user_token']))  # noqa: E501
        if 'user_type' in params:
            query_params.append(('userType', params['user_type']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/hess/api/site/{siteId}/overview', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2002',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def hess_api_user_sites_list_get(self, user_token, page, size, **kwargs):  # noqa: E501
        """Site List  # noqa: E501

        Returns a list of sites related to the given token, which is the account api_key. This API accepts parameters for convenient search, sort and pagination.Limit: Only support to 2 searh text at once; Only support to 1 sort text at once  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hess_api_user_sites_list_get(user_token, page, size, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object page: The first site index to be returned in the results (required)
        :param object size: Pagesize of each page: - 5 - 10 - 30 (required)
        :param object user_type: User Type
        :param object power_station_type: Power Station Type: 1 - Grid-tied solar system 2 - Solar storage system 3 - EV charging hub 4 - EV charging hub with solar storage
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.hess_api_user_sites_list_get_with_http_info(user_token, page, size, **kwargs)  # noqa: E501
        else:
            (data) = self.hess_api_user_sites_list_get_with_http_info(user_token, page, size, **kwargs)  # noqa: E501
            return data

    def hess_api_user_sites_list_get_with_http_info(self, user_token, page, size, **kwargs):  # noqa: E501
        """Site List  # noqa: E501

        Returns a list of sites related to the given token, which is the account api_key. This API accepts parameters for convenient search, sort and pagination.Limit: Only support to 2 searh text at once; Only support to 1 sort text at once  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.hess_api_user_sites_list_get_with_http_info(user_token, page, size, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param object user_token: User token (required)
        :param object page: The first site index to be returned in the results (required)
        :param object size: Pagesize of each page: - 5 - 10 - 30 (required)
        :param object user_type: User Type
        :param object power_station_type: Power Station Type: 1 - Grid-tied solar system 2 - Solar storage system 3 - EV charging hub 4 - EV charging hub with solar storage
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user_token', 'page', 'size', 'user_type', 'power_station_type']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method hess_api_user_sites_list_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user_token' is set
        if ('user_token' not in params or
                params['user_token'] is None):
            raise ValueError("Missing the required parameter `user_token` when calling `hess_api_user_sites_list_get`")  # noqa: E501
        # verify the required parameter 'page' is set
        if ('page' not in params or
                params['page'] is None):
            raise ValueError("Missing the required parameter `page` when calling `hess_api_user_sites_list_get`")  # noqa: E501
        # verify the required parameter 'size' is set
        if ('size' not in params or
                params['size'] is None):
            raise ValueError("Missing the required parameter `size` when calling `hess_api_user_sites_list_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'user_token' in params:
            query_params.append(('userToken', params['user_token']))  # noqa: E501
        if 'user_type' in params:
            query_params.append(('userType', params['user_type']))  # noqa: E501
        if 'power_station_type' in params:
            query_params.append(('powerStationType', params['power_station_type']))  # noqa: E501
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501
        if 'size' in params:
            query_params.append(('size', params['size']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/hess/api/userSites/list', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse2001',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
