# coding: utf-8

"""
    Insights.Api

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

    OpenAPI spec version: 1.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 elexonpy.api_client import ApiClient


class DemandApi(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 demand_actual_total_get(self, _from, to, **kwargs):  # noqa: E501
        """Actual total load (ATL/B0610)  # noqa: E501

        This endpoint provides actual total load data per bidding zone.  It can be filtered by settlement period dates.                This API endpoint has a maximum range of 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.demand_actual_total_get(_from, to, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param datetime _from: (required)
        :param datetime to: (required)
        :param int settlement_period_from:
        :param int settlement_period_to:
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesTransparencyActualTotalLoadPerBiddingZone
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_actual_total_get_with_http_info(_from, to, **kwargs)  # noqa: E501
        else:
            (data) = self.demand_actual_total_get_with_http_info(_from, to, **kwargs)  # noqa: E501
            return data

    def demand_actual_total_get_with_http_info(self, _from, to, **kwargs):  # noqa: E501
        """Actual total load (ATL/B0610)  # noqa: E501

        This endpoint provides actual total load data per bidding zone.  It can be filtered by settlement period dates.                This API endpoint has a maximum range of 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.demand_actual_total_get_with_http_info(_from, to, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param datetime _from: (required)
        :param datetime to: (required)
        :param int settlement_period_from:
        :param int settlement_period_to:
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesTransparencyActualTotalLoadPerBiddingZone
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['_from', 'to', 'settlement_period_from', 'settlement_period_to', 'format']  # 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 demand_actual_total_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter '_from' is set
        if ('_from' not in params or
                params['_from'] is None):
            raise ValueError("Missing the required parameter `_from` when calling `demand_actual_total_get`")  # noqa: E501
        # verify the required parameter 'to' is set
        if ('to' not in params or
                params['to'] is None):
            raise ValueError("Missing the required parameter `to` when calling `demand_actual_total_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if '_from' in params:
            query_params.append(('from', params['_from']))  # noqa: E501
        if 'to' in params:
            query_params.append(('to', params['to']))  # noqa: E501
        if 'settlement_period_from' in params:
            query_params.append(('settlementPeriodFrom', params['settlement_period_from']))  # noqa: E501
        if 'settlement_period_to' in params:
            query_params.append(('settlementPeriodTo', params['settlement_period_to']))  # noqa: E501
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/actual/total', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesTransparencyActualTotalLoadPerBiddingZone',  # 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 demand_get(self, **kwargs):  # noqa: E501
        """This endpoint is obsolete, and this location may be removed with no further notice.   # noqa: E501

        This endpoint has been moved to demand/outturn.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str format: Response data format. Use json/xml to include metadata.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.demand_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def demand_get_with_http_info(self, **kwargs):  # noqa: E501
        """This endpoint is obsolete, and this location may be removed with no further notice.   # noqa: E501

        This endpoint has been moved to demand/outturn.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str format: Response data format. Use json/xml to include metadata.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format']  # 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 demand_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # 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 demand_outturn_daily_get(self, **kwargs):  # noqa: E501
        """Initial National Demand outturn per day (INDOD)  # noqa: E501

        This endpoint provides initial National Demand outturn data per day. The total daily energy volume is the total  demand volume for the previous day expressed on an initial National Demand outturn (INDO) basis, i.e. excluding  station transformer, pumping and interconnector export demand. It is calculated from summing the half hourly  INDO demands (divided by two to convert to MWh).                If no date window is chosen, the search will default to results from the last 31 days.    This API endpoint has a maximum range of 2 years (731 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.demand_outturn_daily_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param date settlement_date_from:
        :param date settlement_date_to:
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndodRow
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_outturn_daily_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.demand_outturn_daily_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def demand_outturn_daily_get_with_http_info(self, **kwargs):  # noqa: E501
        """Initial National Demand outturn per day (INDOD)  # noqa: E501

        This endpoint provides initial National Demand outturn data per day. The total daily energy volume is the total  demand volume for the previous day expressed on an initial National Demand outturn (INDO) basis, i.e. excluding  station transformer, pumping and interconnector export demand. It is calculated from summing the half hourly  INDO demands (divided by two to convert to MWh).                If no date window is chosen, the search will default to results from the last 31 days.    This API endpoint has a maximum range of 2 years (731 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.demand_outturn_daily_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param date settlement_date_from:
        :param date settlement_date_to:
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndodRow
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['settlement_date_from', 'settlement_date_to', 'format']  # 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 demand_outturn_daily_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'settlement_date_from' in params:
            query_params.append(('settlementDateFrom', params['settlement_date_from']))  # noqa: E501
        if 'settlement_date_to' in params:
            query_params.append(('settlementDateTo', params['settlement_date_to']))  # noqa: E501
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/outturn/daily', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndodRow',  # 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 demand_outturn_daily_stream_get(self, **kwargs):  # noqa: E501
        """Initial National Demand outturn per day (INDOD) stream  # noqa: E501

        This endpoint provides initial National Demand outturn daily data. The total daily energy volume is the total  demand volume for the previous day expressed on an initial National Demand outturn (INDO) basis, i.e. excluding  station transformer, pumping and interconnector export demand. It is calculated from summing the half hourly  INDO demands (divided by two to convert to MWh).                If no date window is chosen, the search will default to results from the last 31 days.    This endpoint has an optimised JSON payload and is aimed at frequent requests for the data.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_outturn_daily_stream_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param date settlement_date_from:
        :param date settlement_date_to:
        :return: list[InsightsApiModelsResponsesDemandOutturnIndodRow]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_outturn_daily_stream_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.demand_outturn_daily_stream_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def demand_outturn_daily_stream_get_with_http_info(self, **kwargs):  # noqa: E501
        """Initial National Demand outturn per day (INDOD) stream  # noqa: E501

        This endpoint provides initial National Demand outturn daily data. The total daily energy volume is the total  demand volume for the previous day expressed on an initial National Demand outturn (INDO) basis, i.e. excluding  station transformer, pumping and interconnector export demand. It is calculated from summing the half hourly  INDO demands (divided by two to convert to MWh).                If no date window is chosen, the search will default to results from the last 31 days.    This endpoint has an optimised JSON payload and is aimed at frequent requests for the data.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_outturn_daily_stream_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param date settlement_date_from:
        :param date settlement_date_to:
        :return: list[InsightsApiModelsResponsesDemandOutturnIndodRow]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['settlement_date_from', 'settlement_date_to']  # 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 demand_outturn_daily_stream_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'settlement_date_from' in params:
            query_params.append(('settlementDateFrom', params['settlement_date_from']))  # noqa: E501
        if 'settlement_date_to' in params:
            query_params.append(('settlementDateTo', params['settlement_date_to']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/outturn/daily/stream', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[InsightsApiModelsResponsesDemandOutturnIndodRow]',  # 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 demand_outturn_get(self, **kwargs):  # noqa: E501
        """Initial National Demand outturn (INDO)  # noqa: E501

        This endpoint provides data for Initial National Demand Outturn, which measures the  half-hour average MW demand metered by the Transmission Company based on its operational metering.  The data is updated every 30 minutes and within 15 minutes of the end of the effective settlement period. The data is represented with:  - INDO (initial National Demand outturn) which takes into account transmission losses but does not include station transformer load, pumped storage demand or interconnector demand.  - ITSDO (initial Transmission System Demand outturn) which takes into account transmission losses, station transformer load, pumped storage demand and interconnector demand.                This endpoint is useful for ad-hoc querying of the data.                Settlement date parameters must be provided in the exact format yyyy-MM-dd.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_outturn_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param date settlement_date_from: The settlement date from for the filter. This must be in the format yyyy-MM-dd.
        :param date settlement_date_to: The settlement date to for the filter. This must be in the format yyyy-MM-dd.
        :param list[int] settlement_period:
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnDemandOutturn
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_outturn_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.demand_outturn_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def demand_outturn_get_with_http_info(self, **kwargs):  # noqa: E501
        """Initial National Demand outturn (INDO)  # noqa: E501

        This endpoint provides data for Initial National Demand Outturn, which measures the  half-hour average MW demand metered by the Transmission Company based on its operational metering.  The data is updated every 30 minutes and within 15 minutes of the end of the effective settlement period. The data is represented with:  - INDO (initial National Demand outturn) which takes into account transmission losses but does not include station transformer load, pumped storage demand or interconnector demand.  - ITSDO (initial Transmission System Demand outturn) which takes into account transmission losses, station transformer load, pumped storage demand and interconnector demand.                This endpoint is useful for ad-hoc querying of the data.                Settlement date parameters must be provided in the exact format yyyy-MM-dd.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_outturn_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param date settlement_date_from: The settlement date from for the filter. This must be in the format yyyy-MM-dd.
        :param date settlement_date_to: The settlement date to for the filter. This must be in the format yyyy-MM-dd.
        :param list[int] settlement_period:
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnDemandOutturn
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['settlement_date_from', 'settlement_date_to', 'settlement_period', 'format']  # 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 demand_outturn_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'settlement_date_from' in params:
            query_params.append(('settlementDateFrom', params['settlement_date_from']))  # noqa: E501
        if 'settlement_date_to' in params:
            query_params.append(('settlementDateTo', params['settlement_date_to']))  # noqa: E501
        if 'settlement_period' in params:
            query_params.append(('settlementPeriod', params['settlement_period']))  # noqa: E501
            collection_formats['settlementPeriod'] = 'multi'  # noqa: E501
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/outturn', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnDemandOutturn',  # 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 demand_outturn_stream_get(self, **kwargs):  # noqa: E501
        """Initial National Demand outturn (INDO) stream  # noqa: E501

        This endpoint provides data for initial National Demand outturn, which measures the  half-hour average MW demand metered by the Transmission Company based on its operational metering.  The data is updated every 30 minutes and within 15 minutes of the end of the effective settlement period. The data is represented with:  - INDO (initial National Demand outturn) which takes into account transmission losses but does not include station transformer load, pumped storage demand or interconnector demand.  - ITSDO (initial Transmission System Demand outturn) which takes into account transmission losses, station transformer load, pumped storage demand and interconnector demand.                This endpoint has an optimised JSON payload and is aimed at frequent requests for the data.                Settlement date parameters must be provided in the exact format yyyy-MM-dd.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_outturn_stream_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param date settlement_date_from: The settlement date from for the filter. This must be in the format yyyy-MM-dd.
        :param date settlement_date_to: The settlement date to for the filter. This must be in the format yyyy-MM-dd.
        :param list[int] settlement_period:
        :return: list[InsightsApiModelsResponsesDemandOutturnDemandOutturn]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_outturn_stream_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.demand_outturn_stream_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def demand_outturn_stream_get_with_http_info(self, **kwargs):  # noqa: E501
        """Initial National Demand outturn (INDO) stream  # noqa: E501

        This endpoint provides data for initial National Demand outturn, which measures the  half-hour average MW demand metered by the Transmission Company based on its operational metering.  The data is updated every 30 minutes and within 15 minutes of the end of the effective settlement period. The data is represented with:  - INDO (initial National Demand outturn) which takes into account transmission losses but does not include station transformer load, pumped storage demand or interconnector demand.  - ITSDO (initial Transmission System Demand outturn) which takes into account transmission losses, station transformer load, pumped storage demand and interconnector demand.                This endpoint has an optimised JSON payload and is aimed at frequent requests for the data.                Settlement date parameters must be provided in the exact format yyyy-MM-dd.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_outturn_stream_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param date settlement_date_from: The settlement date from for the filter. This must be in the format yyyy-MM-dd.
        :param date settlement_date_to: The settlement date to for the filter. This must be in the format yyyy-MM-dd.
        :param list[int] settlement_period:
        :return: list[InsightsApiModelsResponsesDemandOutturnDemandOutturn]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['settlement_date_from', 'settlement_date_to', 'settlement_period']  # 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 demand_outturn_stream_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'settlement_date_from' in params:
            query_params.append(('settlementDateFrom', params['settlement_date_from']))  # noqa: E501
        if 'settlement_date_to' in params:
            query_params.append(('settlementDateTo', params['settlement_date_to']))  # noqa: E501
        if 'settlement_period' in params:
            query_params.append(('settlementPeriod', params['settlement_period']))  # noqa: E501
            collection_formats['settlementPeriod'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/outturn/stream', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[InsightsApiModelsResponsesDemandOutturnDemandOutturn]',  # 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 demand_outturn_summary_get(self, **kwargs):  # noqa: E501
        """System demand summary (FUELINST)  # noqa: E501

        ⚠ This endpoint provides a down-sampled data summary intended for visualisation purposes.  Use datasets endpoints for full dataset access.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_outturn_summary_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param datetime _from:
        :param datetime to:
        :param str format: Response data format. Use json/xml to include metadata.
        :return: list[InsightsApiModelsResponsesDemandOutturnRollingSystemDemand]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_outturn_summary_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.demand_outturn_summary_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def demand_outturn_summary_get_with_http_info(self, **kwargs):  # noqa: E501
        """System demand summary (FUELINST)  # noqa: E501

        ⚠ This endpoint provides a down-sampled data summary intended for visualisation purposes.  Use datasets endpoints for full dataset access.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_outturn_summary_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param datetime _from:
        :param datetime to:
        :param str format: Response data format. Use json/xml to include metadata.
        :return: list[InsightsApiModelsResponsesDemandOutturnRollingSystemDemand]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['_from', 'to', 'format']  # 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 demand_outturn_summary_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if '_from' in params:
            query_params.append(('from', params['_from']))  # noqa: E501
        if 'to' in params:
            query_params.append(('to', params['to']))  # noqa: E501
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/outturn/summary', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[InsightsApiModelsResponsesDemandOutturnRollingSystemDemand]',  # 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 demand_peak_get(self, **kwargs):  # noqa: E501
        """Peak demand per day (ITSDO)  # noqa: E501

        This endpoint allows for retrieving peak ITSDO demand for each day from National Grid ESO.  Results are filtered by a range of Date parameters.  Results default to yesterday's peak if no parameters are supplied.                Date parameters must be provided in the exact format yyyy-MM-dd.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_peak_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param date _from: The start of the requested date range.
        :param date to: The end of the requested date range.
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnDemandOutturnPeak
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_peak_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.demand_peak_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def demand_peak_get_with_http_info(self, **kwargs):  # noqa: E501
        """Peak demand per day (ITSDO)  # noqa: E501

        This endpoint allows for retrieving peak ITSDO demand for each day from National Grid ESO.  Results are filtered by a range of Date parameters.  Results default to yesterday's peak if no parameters are supplied.                Date parameters must be provided in the exact format yyyy-MM-dd.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_peak_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param date _from: The start of the requested date range.
        :param date to: The end of the requested date range.
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnDemandOutturnPeak
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['_from', 'to', 'format']  # 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 demand_peak_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if '_from' in params:
            query_params.append(('from', params['_from']))  # noqa: E501
        if 'to' in params:
            query_params.append(('to', params['to']))  # noqa: E501
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/peak', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnDemandOutturnPeak',  # 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 demand_peak_indicative_get(self, data, **kwargs):  # noqa: E501
        """Indicative peak demand per day (S0142, ITSDO, FUELHH)  # noqa: E501

        Indicative demand peaks using operational metering data are daily maxima values determined from  ITSDO and FUELHH data used to determine and visualise Triad.                Indicative demand peaks using settlement metering data are daily maxima values determined from  metered volume data from the S0142_bpi file. These peaks are not used for Triad visualisation as  they are always calculated based on the latest run type. Triads for settlement data  remain static after the National Grid report posted at the beginning of April after the Triad season has ended.                 If no filters are supplied, results default to the latest or current Triad season.  To specify a custom filter, you can supplier EITHER a Triad season start year, OR a date range, but not both.  If a Triad Season Start year is supplied, data for the Triad season beginning on 1 November  of the specified year will be returned.  If a date range is supplied, data will be returned for settlement dates within the date range inclusively.                Date parameters must be provided in the exact format yyyy-MM-dd.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_peak_indicative_get(data, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str data: The type of data. Supports values of 'operational' or 'settlement'. (required)
        :param int triad_season_start_year: A year indicating the Triad season starting on 1 November of the given year, e.g. 2021.
        :param date _from: The start of the requested date range.
        :param date to: The end of the requested date range.
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndicativeDemandPeak
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_peak_indicative_get_with_http_info(data, **kwargs)  # noqa: E501
        else:
            (data) = self.demand_peak_indicative_get_with_http_info(data, **kwargs)  # noqa: E501
            return data

    def demand_peak_indicative_get_with_http_info(self, data, **kwargs):  # noqa: E501
        """Indicative peak demand per day (S0142, ITSDO, FUELHH)  # noqa: E501

        Indicative demand peaks using operational metering data are daily maxima values determined from  ITSDO and FUELHH data used to determine and visualise Triad.                Indicative demand peaks using settlement metering data are daily maxima values determined from  metered volume data from the S0142_bpi file. These peaks are not used for Triad visualisation as  they are always calculated based on the latest run type. Triads for settlement data  remain static after the National Grid report posted at the beginning of April after the Triad season has ended.                 If no filters are supplied, results default to the latest or current Triad season.  To specify a custom filter, you can supplier EITHER a Triad season start year, OR a date range, but not both.  If a Triad Season Start year is supplied, data for the Triad season beginning on 1 November  of the specified year will be returned.  If a date range is supplied, data will be returned for settlement dates within the date range inclusively.                Date parameters must be provided in the exact format yyyy-MM-dd.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_peak_indicative_get_with_http_info(data, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str data: The type of data. Supports values of 'operational' or 'settlement'. (required)
        :param int triad_season_start_year: A year indicating the Triad season starting on 1 November of the given year, e.g. 2021.
        :param date _from: The start of the requested date range.
        :param date to: The end of the requested date range.
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndicativeDemandPeak
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['data', 'triad_season_start_year', '_from', 'to', 'format']  # 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 demand_peak_indicative_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'data' is set
        if ('data' not in params or
                params['data'] is None):
            raise ValueError("Missing the required parameter `data` when calling `demand_peak_indicative_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'data' in params:
            query_params.append(('data', params['data']))  # noqa: E501
        if 'triad_season_start_year' in params:
            query_params.append(('triadSeasonStartYear', params['triad_season_start_year']))  # noqa: E501
        if '_from' in params:
            query_params.append(('from', params['_from']))  # noqa: E501
        if 'to' in params:
            query_params.append(('to', params['to']))  # noqa: E501
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/peak/indicative', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndicativeDemandPeak',  # 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 demand_peak_indicative_operational_triad_season_get(self, triad_season, **kwargs):  # noqa: E501
        """Operational data demand peaks for a Triad season (ITSDO, FUELHH)  # noqa: E501

        Provides indicative demand peak data for a Triad season ITSDO and FUELHH files over a Triad season. For non-Triad  season dates please use the `peak/indicative` endpoint.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_peak_indicative_operational_triad_season_get(triad_season, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int triad_season: A year indicating the Triad season starting on 1 November of the given year (required)
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndicativeDemandPeak
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_peak_indicative_operational_triad_season_get_with_http_info(triad_season, **kwargs)  # noqa: E501
        else:
            (data) = self.demand_peak_indicative_operational_triad_season_get_with_http_info(triad_season, **kwargs)  # noqa: E501
            return data

    def demand_peak_indicative_operational_triad_season_get_with_http_info(self, triad_season, **kwargs):  # noqa: E501
        """Operational data demand peaks for a Triad season (ITSDO, FUELHH)  # noqa: E501

        Provides indicative demand peak data for a Triad season ITSDO and FUELHH files over a Triad season. For non-Triad  season dates please use the `peak/indicative` endpoint.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_peak_indicative_operational_triad_season_get_with_http_info(triad_season, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int triad_season: A year indicating the Triad season starting on 1 November of the given year (required)
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndicativeDemandPeak
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['triad_season', 'format']  # 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 demand_peak_indicative_operational_triad_season_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'triad_season' is set
        if ('triad_season' not in params or
                params['triad_season'] is None):
            raise ValueError("Missing the required parameter `triad_season` when calling `demand_peak_indicative_operational_triad_season_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'triad_season' in params:
            path_params['triadSeason'] = params['triad_season']  # noqa: E501

        query_params = []
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/peak/indicative/operational/{triadSeason}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndicativeDemandPeak',  # 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 demand_peak_indicative_settlement_triad_season_get(self, triad_season, **kwargs):  # noqa: E501
        """Settlement data demand peaks for a Triad season (S0142)  # noqa: E501

        Provides indicative demand peak data for a Triad season from S0142_bpi files that were calculated  during the Triad season. For the data from the latest settlement runs for the Triad season use the  `peak/indicative` endpoint.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_peak_indicative_settlement_triad_season_get(triad_season, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int triad_season: A year indicating the Triad season starting on 1 November of the given year (required)
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndicativeDemandPeak
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_peak_indicative_settlement_triad_season_get_with_http_info(triad_season, **kwargs)  # noqa: E501
        else:
            (data) = self.demand_peak_indicative_settlement_triad_season_get_with_http_info(triad_season, **kwargs)  # noqa: E501
            return data

    def demand_peak_indicative_settlement_triad_season_get_with_http_info(self, triad_season, **kwargs):  # noqa: E501
        """Settlement data demand peaks for a Triad season (S0142)  # noqa: E501

        Provides indicative demand peak data for a Triad season from S0142_bpi files that were calculated  during the Triad season. For the data from the latest settlement runs for the Triad season use the  `peak/indicative` endpoint.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_peak_indicative_settlement_triad_season_get_with_http_info(triad_season, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int triad_season: A year indicating the Triad season starting on 1 November of the given year (required)
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndicativeDemandPeak
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['triad_season', 'format']  # 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 demand_peak_indicative_settlement_triad_season_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'triad_season' is set
        if ('triad_season' not in params or
                params['triad_season'] is None):
            raise ValueError("Missing the required parameter `triad_season` when calling `demand_peak_indicative_settlement_triad_season_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'triad_season' in params:
            path_params['triadSeason'] = params['triad_season']  # noqa: E501

        query_params = []
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/peak/indicative/settlement/{triadSeason}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndicativeDemandPeak',  # 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 demand_peak_triad_get(self, data, **kwargs):  # noqa: E501
        """Triad demand peaks (S0142, ITSDO, FUELHH)  # noqa: E501

        Operational Triad peaks are calculated from the indicative demand peaks data.    Settlement Triad Peaks are calculated from the latest metered volume data available at the point one month following the Triad season's end.  For any Triad season still in progress, the latest run type data is used.                All Triad peaks are at least 10 days clear of one another.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_peak_triad_get(data, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str data: The type of data. Supports values of 'operational' or 'settlement'. (required)
        :param int triad_season_start_year: A year indicating the Triad season starting on 1 November of the given year.
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndicativeDemandPeak
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_peak_triad_get_with_http_info(data, **kwargs)  # noqa: E501
        else:
            (data) = self.demand_peak_triad_get_with_http_info(data, **kwargs)  # noqa: E501
            return data

    def demand_peak_triad_get_with_http_info(self, data, **kwargs):  # noqa: E501
        """Triad demand peaks (S0142, ITSDO, FUELHH)  # noqa: E501

        Operational Triad peaks are calculated from the indicative demand peaks data.    Settlement Triad Peaks are calculated from the latest metered volume data available at the point one month following the Triad season's end.  For any Triad season still in progress, the latest run type data is used.                All Triad peaks are at least 10 days clear of one another.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_peak_triad_get_with_http_info(data, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str data: The type of data. Supports values of 'operational' or 'settlement'. (required)
        :param int triad_season_start_year: A year indicating the Triad season starting on 1 November of the given year.
        :param str format: Response data format. Use json/xml to include metadata.
        :return: InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndicativeDemandPeak
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['data', 'triad_season_start_year', 'format']  # 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 demand_peak_triad_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'data' is set
        if ('data' not in params or
                params['data'] is None):
            raise ValueError("Missing the required parameter `data` when calling `demand_peak_triad_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'data' in params:
            query_params.append(('data', params['data']))  # noqa: E501
        if 'triad_season_start_year' in params:
            query_params.append(('triadSeasonStartYear', params['triad_season_start_year']))  # noqa: E501
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/peak/triad', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InsightsApiModelsResponsesResponseWithMetadata1InsightsApiModelsResponsesDemandOutturnIndicativeDemandPeak',  # 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 demand_rolling_system_demand_get(self, **kwargs):  # noqa: E501
        """This endpoint is obsolete, and this location may be removed with no further notice.   # noqa: E501

        This endpoint has been moved to generation/outturn.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_rolling_system_demand_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str format: Response data format. Use json/xml to include metadata.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_rolling_system_demand_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.demand_rolling_system_demand_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def demand_rolling_system_demand_get_with_http_info(self, **kwargs):  # noqa: E501
        """This endpoint is obsolete, and this location may be removed with no further notice.   # noqa: E501

        This endpoint has been moved to generation/outturn.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_rolling_system_demand_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str format: Response data format. Use json/xml to include metadata.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format']  # 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 demand_rolling_system_demand_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/rollingSystemDemand', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # 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 demand_stream_get(self, **kwargs):  # noqa: E501
        """This endpoint is obsolete, and this location may be removed with no further notice.   # noqa: E501

        This endpoint has been moved to demand/outturn/stream.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_stream_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str format: Response data format. Use json/xml to include metadata.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_stream_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.demand_stream_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def demand_stream_get_with_http_info(self, **kwargs):  # noqa: E501
        """This endpoint is obsolete, and this location may be removed with no further notice.   # noqa: E501

        This endpoint has been moved to demand/outturn/stream.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_stream_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str format: Response data format. Use json/xml to include metadata.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format']  # 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 demand_stream_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/stream', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # 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 demand_summary_get(self, **kwargs):  # noqa: E501
        """This endpoint is obsolete, and this location may be removed with no further notice.   # noqa: E501

        This endpoint has been moved to demand/outturn/summary.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_summary_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str format: Response data format. Use json/xml to include metadata.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_summary_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.demand_summary_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def demand_summary_get_with_http_info(self, **kwargs):  # noqa: E501
        """This endpoint is obsolete, and this location may be removed with no further notice.   # noqa: E501

        This endpoint has been moved to demand/outturn/summary.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_summary_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str format: Response data format. Use json/xml to include metadata.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format']  # 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 demand_summary_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/summary', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # 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 demand_total_actual_get(self, **kwargs):  # noqa: E501
        """This endpoint is obsolete, and this location may be removed with no further notice.   # noqa: E501

        This endpoint has been moved to demand/actual/total.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_total_actual_get(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str format: Response data format. Use json/xml to include metadata.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.demand_total_actual_get_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.demand_total_actual_get_with_http_info(**kwargs)  # noqa: E501
            return data

    def demand_total_actual_get_with_http_info(self, **kwargs):  # noqa: E501
        """This endpoint is obsolete, and this location may be removed with no further notice.   # noqa: E501

        This endpoint has been moved to demand/actual/total.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.demand_total_actual_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str format: Response data format. Use json/xml to include metadata.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['format']  # 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 demand_total_actual_get" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'format' in params:
            query_params.append(('format', params['format']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/demand/total/actual', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # 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)
