# coding: utf-8

"""
    result-analysis-service

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 1.0.0
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from dhicn_result_analysis_service.api_client import ApiClient
from dhicn_result_analysis_service.exceptions import (  # noqa: F401
    ApiTypeError,
    ApiValueError
)


class M2DApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

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

    def api_v1_result2d_by_range_time_post(self, **kwargs):  # noqa: E501
        """获取时间段内的二维动态结果 Get 2D dynamic results for a specified time range  # noqa: E501

        获取特定时间段内的二维动态结果，其中ElementIds用于进一步过滤结果，单次查询不能超过1000个网格，以减少单次访问返回的数据量 Get 2D dynamic results for a specified time range, and ElementIds must be used to filter the result to no more than 1000 elements, thus reduce the data amount returned one time  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_v1_result2d_by_range_time_post(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param M2DByRangeTimeInput m2_d_by_range_time_input:
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: BaseDynamicOutput
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.api_v1_result2d_by_range_time_post_with_http_info(**kwargs)  # noqa: E501

    def api_v1_result2d_by_range_time_post_with_http_info(self, **kwargs):  # noqa: E501
        """获取时间段内的二维动态结果 Get 2D dynamic results for a specified time range  # noqa: E501

        获取特定时间段内的二维动态结果，其中ElementIds用于进一步过滤结果，单次查询不能超过1000个网格，以减少单次访问返回的数据量 Get 2D dynamic results for a specified time range, and ElementIds must be used to filter the result to no more than 1000 elements, thus reduce the data amount returned one time  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_v1_result2d_by_range_time_post_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param M2DByRangeTimeInput m2_d_by_range_time_input:
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(BaseDynamicOutput, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'm2_d_by_range_time_input'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method api_v1_result2d_by_range_time_post" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'm2_d_by_range_time_input' in local_var_params:
            body_params = local_var_params['m2_d_by_range_time_input']
        # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/result/2d/by-range-time', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BaseDynamicOutput',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def api_v1_result2d_by_range_time_with_elements_post(self, **kwargs):  # noqa: E501
        """获取时间段内的二维动态结果 Get 2D dynamic results for a specified time range  # noqa: E501

        获取特定时间段内的二维动态结果，其中ElementIds用于进一步过滤结果，单次查询不能超过1000个网格，以减少单次访问返回的数据量 Get 2D dynamic results for a specified time range, and ElementIds must be used to filter the result to no more than 1000 elements, thus reduce the data amount returned one time  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_v1_result2d_by_range_time_with_elements_post(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param M2DByRangeTimeInput m2_d_by_range_time_input:
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: BaseDynamicOutput
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.api_v1_result2d_by_range_time_with_elements_post_with_http_info(**kwargs)  # noqa: E501

    def api_v1_result2d_by_range_time_with_elements_post_with_http_info(self, **kwargs):  # noqa: E501
        """获取时间段内的二维动态结果 Get 2D dynamic results for a specified time range  # noqa: E501

        获取特定时间段内的二维动态结果，其中ElementIds用于进一步过滤结果，单次查询不能超过1000个网格，以减少单次访问返回的数据量 Get 2D dynamic results for a specified time range, and ElementIds must be used to filter the result to no more than 1000 elements, thus reduce the data amount returned one time  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_v1_result2d_by_range_time_with_elements_post_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param M2DByRangeTimeInput m2_d_by_range_time_input:
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(BaseDynamicOutput, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'm2_d_by_range_time_input'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method api_v1_result2d_by_range_time_with_elements_post" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'm2_d_by_range_time_input' in local_var_params:
            body_params = local_var_params['m2_d_by_range_time_input']
        # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/result/2d/by-range-time-with-elements', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BaseDynamicOutput',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def api_v1_result2d_by_time_get(self, time, scenario_id, **kwargs):  # noqa: E501
        """获取单个时刻的二维动态结果 Get 2D dynamic results of a single time step  # noqa: E501

        获取单个时刻的二维动态结果，其中ElementIds可用于进一步过滤结果以减少单次访问返回的数据量 Get 2D dynamic results of a single time step, meanwhile element ids can be used to filter the result and reduce the data amount returned one time  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_v1_result2d_by_time_get(time, scenario_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str time: 结果查询的时刻 time used to get result (required)
        :param str scenario_id: 方案的ID scenario’s ID (required)
        :param list[str] element_ids: 搜索的网格编号列表 search element ids or grid ids
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: BaseDynamicOutput
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.api_v1_result2d_by_time_get_with_http_info(time, scenario_id, **kwargs)  # noqa: E501

    def api_v1_result2d_by_time_get_with_http_info(self, time, scenario_id, **kwargs):  # noqa: E501
        """获取单个时刻的二维动态结果 Get 2D dynamic results of a single time step  # noqa: E501

        获取单个时刻的二维动态结果，其中ElementIds可用于进一步过滤结果以减少单次访问返回的数据量 Get 2D dynamic results of a single time step, meanwhile element ids can be used to filter the result and reduce the data amount returned one time  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_v1_result2d_by_time_get_with_http_info(time, scenario_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str time: 结果查询的时刻 time used to get result (required)
        :param str scenario_id: 方案的ID scenario’s ID (required)
        :param list[str] element_ids: 搜索的网格编号列表 search element ids or grid ids
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(BaseDynamicOutput, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'time',
            'scenario_id',
            'element_ids'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method api_v1_result2d_by_time_get" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'time' is set
        if self.api_client.client_side_validation and ('time' not in local_var_params or  # noqa: E501
                                                        local_var_params['time'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `time` when calling `api_v1_result2d_by_time_get`")  # noqa: E501
        # verify the required parameter 'scenario_id' is set
        if self.api_client.client_side_validation and ('scenario_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['scenario_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `scenario_id` when calling `api_v1_result2d_by_time_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'time' in local_var_params and local_var_params['time'] is not None:  # noqa: E501
            query_params.append(('Time', local_var_params['time']))  # noqa: E501
        if 'element_ids' in local_var_params and local_var_params['element_ids'] is not None:  # noqa: E501
            query_params.append(('ElementIds', local_var_params['element_ids']))  # noqa: E501
            collection_formats['ElementIds'] = 'multi'  # noqa: E501
        if 'scenario_id' in local_var_params and local_var_params['scenario_id'] is not None:  # noqa: E501
            query_params.append(('ScenarioId', local_var_params['scenario_id']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/result/2d/by-time', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BaseDynamicOutput',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def api_v1_result2d_by_time_stream_get(self, time, scenario_id, **kwargs):  # noqa: E501
        """获取单个时刻的二维动态结果 Get 2D dynamic results of a single time step  # noqa: E501

        获取单个时刻的二维动态结果，其中ElementIds可用于进一步过滤结果以减少单次访问返回的数据量，结果以文件流的形式返回 Get 2D dynamic results of a single time step, meanwhile element ids can be used to filter the result and reduce the data amount returned one time. Result will be returned as file 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.api_v1_result2d_by_time_stream_get(time, scenario_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str time: 结果查询的时刻 time used to get result (required)
        :param str scenario_id: 方案的ID scenario’s ID (required)
        :param list[str] element_ids: 搜索的网格编号列表 search element ids or grid ids
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.api_v1_result2d_by_time_stream_get_with_http_info(time, scenario_id, **kwargs)  # noqa: E501

    def api_v1_result2d_by_time_stream_get_with_http_info(self, time, scenario_id, **kwargs):  # noqa: E501
        """获取单个时刻的二维动态结果 Get 2D dynamic results of a single time step  # noqa: E501

        获取单个时刻的二维动态结果，其中ElementIds可用于进一步过滤结果以减少单次访问返回的数据量，结果以文件流的形式返回 Get 2D dynamic results of a single time step, meanwhile element ids can be used to filter the result and reduce the data amount returned one time. Result will be returned as file 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.api_v1_result2d_by_time_stream_get_with_http_info(time, scenario_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str time: 结果查询的时刻 time used to get result (required)
        :param str scenario_id: 方案的ID scenario’s ID (required)
        :param list[str] element_ids: 搜索的网格编号列表 search element ids or grid ids
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'time',
            'scenario_id',
            'element_ids'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method api_v1_result2d_by_time_stream_get" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'time' is set
        if self.api_client.client_side_validation and ('time' not in local_var_params or  # noqa: E501
                                                        local_var_params['time'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `time` when calling `api_v1_result2d_by_time_stream_get`")  # noqa: E501
        # verify the required parameter 'scenario_id' is set
        if self.api_client.client_side_validation and ('scenario_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['scenario_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `scenario_id` when calling `api_v1_result2d_by_time_stream_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'time' in local_var_params and local_var_params['time'] is not None:  # noqa: E501
            query_params.append(('Time', local_var_params['time']))  # noqa: E501
        if 'element_ids' in local_var_params and local_var_params['element_ids'] is not None:  # noqa: E501
            query_params.append(('ElementIds', local_var_params['element_ids']))  # noqa: E501
            collection_formats['ElementIds'] = 'multi'  # noqa: E501
        if 'scenario_id' in local_var_params and local_var_params['scenario_id'] is not None:  # noqa: E501
            query_params.append(('ScenarioId', local_var_params['scenario_id']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/result/2d/by-time/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=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def api_v1_result2d_dynamic_get(self, m2_d_data_type, frequency, start_time, end_time, scenario_id, **kwargs):  # noqa: E501
        """获取二维动态结果 Get 2D dynamic results  # noqa: E501

        已弃用，可使用by-time或by-range-time来替代 Use by-time or by-range-time instead.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_v1_result2d_dynamic_get(m2_d_data_type, frequency, start_time, end_time, scenario_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str m2_d_data_type: 二维结果类型 2D result type:  0-WaterDepth (required)
        :param int frequency: 查询结果的时间频率 time frequency used to get result (required)
        :param str start_time: 查询结果的开始时间 start time used to get result (required)
        :param str end_time: 查询结果的结束时间 end time used to get result (required)
        :param str scenario_id: 方案的ID scenario’s ID (required)
        :param list[str] element_ids: 搜索的网格编号列表 search element ids or grid ids
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: BaseDynamicOutput
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.api_v1_result2d_dynamic_get_with_http_info(m2_d_data_type, frequency, start_time, end_time, scenario_id, **kwargs)  # noqa: E501

    def api_v1_result2d_dynamic_get_with_http_info(self, m2_d_data_type, frequency, start_time, end_time, scenario_id, **kwargs):  # noqa: E501
        """获取二维动态结果 Get 2D dynamic results  # noqa: E501

        已弃用，可使用by-time或by-range-time来替代 Use by-time or by-range-time instead.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_v1_result2d_dynamic_get_with_http_info(m2_d_data_type, frequency, start_time, end_time, scenario_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str m2_d_data_type: 二维结果类型 2D result type:  0-WaterDepth (required)
        :param int frequency: 查询结果的时间频率 time frequency used to get result (required)
        :param str start_time: 查询结果的开始时间 start time used to get result (required)
        :param str end_time: 查询结果的结束时间 end time used to get result (required)
        :param str scenario_id: 方案的ID scenario’s ID (required)
        :param list[str] element_ids: 搜索的网格编号列表 search element ids or grid ids
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(BaseDynamicOutput, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'm2_d_data_type',
            'frequency',
            'start_time',
            'end_time',
            'scenario_id',
            'element_ids'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method api_v1_result2d_dynamic_get" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'm2_d_data_type' is set
        if self.api_client.client_side_validation and ('m2_d_data_type' not in local_var_params or  # noqa: E501
                                                        local_var_params['m2_d_data_type'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `m2_d_data_type` when calling `api_v1_result2d_dynamic_get`")  # noqa: E501
        # verify the required parameter 'frequency' is set
        if self.api_client.client_side_validation and ('frequency' not in local_var_params or  # noqa: E501
                                                        local_var_params['frequency'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `frequency` when calling `api_v1_result2d_dynamic_get`")  # noqa: E501
        # verify the required parameter 'start_time' is set
        if self.api_client.client_side_validation and ('start_time' not in local_var_params or  # noqa: E501
                                                        local_var_params['start_time'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `start_time` when calling `api_v1_result2d_dynamic_get`")  # noqa: E501
        # verify the required parameter 'end_time' is set
        if self.api_client.client_side_validation and ('end_time' not in local_var_params or  # noqa: E501
                                                        local_var_params['end_time'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `end_time` when calling `api_v1_result2d_dynamic_get`")  # noqa: E501
        # verify the required parameter 'scenario_id' is set
        if self.api_client.client_side_validation and ('scenario_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['scenario_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `scenario_id` when calling `api_v1_result2d_dynamic_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'm2_d_data_type' in local_var_params and local_var_params['m2_d_data_type'] is not None:  # noqa: E501
            query_params.append(('M2DDataType', local_var_params['m2_d_data_type']))  # noqa: E501
        if 'frequency' in local_var_params and local_var_params['frequency'] is not None:  # noqa: E501
            query_params.append(('Frequency', local_var_params['frequency']))  # noqa: E501
        if 'start_time' in local_var_params and local_var_params['start_time'] is not None:  # noqa: E501
            query_params.append(('StartTime', local_var_params['start_time']))  # noqa: E501
        if 'end_time' in local_var_params and local_var_params['end_time'] is not None:  # noqa: E501
            query_params.append(('EndTime', local_var_params['end_time']))  # noqa: E501
        if 'element_ids' in local_var_params and local_var_params['element_ids'] is not None:  # noqa: E501
            query_params.append(('ElementIds', local_var_params['element_ids']))  # noqa: E501
            collection_formats['ElementIds'] = 'multi'  # noqa: E501
        if 'scenario_id' in local_var_params and local_var_params['scenario_id'] is not None:  # noqa: E501
            query_params.append(('ScenarioId', local_var_params['scenario_id']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/result/2d/dynamic', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BaseDynamicOutput',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def api_v1_result2d_muids_get(self, scenario_id, **kwargs):  # noqa: E501
        """获取有积水的二维网格的ID列表 Get 2d result model feature ids  # noqa: E501

        获取所有有出现积水的网格ID列表（三角网格dfsu文件返回的是elementid，正交网格dfs2文件返回的是j,k）Get all element ids(for dfsu) or grid ids (for dfs2,format:j,k), water depth of which are above 0  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_v1_result2d_muids_get(scenario_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str scenario_id: 方案的ID scenario’s ID (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: list[str]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.api_v1_result2d_muids_get_with_http_info(scenario_id, **kwargs)  # noqa: E501

    def api_v1_result2d_muids_get_with_http_info(self, scenario_id, **kwargs):  # noqa: E501
        """获取有积水的二维网格的ID列表 Get 2d result model feature ids  # noqa: E501

        获取所有有出现积水的网格ID列表（三角网格dfsu文件返回的是elementid，正交网格dfs2文件返回的是j,k）Get all element ids(for dfsu) or grid ids (for dfs2,format:j,k), water depth of which are above 0  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_v1_result2d_muids_get_with_http_info(scenario_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str scenario_id: 方案的ID scenario’s ID (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(list[str], status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'scenario_id'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method api_v1_result2d_muids_get" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'scenario_id' is set
        if self.api_client.client_side_validation and ('scenario_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['scenario_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `scenario_id` when calling `api_v1_result2d_muids_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'scenario_id' in local_var_params and local_var_params['scenario_id'] is not None:  # noqa: E501
            query_params.append(('ScenarioId', local_var_params['scenario_id']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/result/2d/muids', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[str]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def api_v1_result2d_static_stream_get(self, m2_d_statistic_type, scenario_id, **kwargs):  # noqa: E501
        """获取二维统计结果 Get 2D statistic results  # noqa: E501

        获取二维网格上的统计结果，包括最大积水深度（单位：米）、积水历时（单位：小时）、最大内涝风险等，结果以文件流的形式返回 Get 2D statistic results including max water depth (unit: m), waterlogging duration (unit: hour), max flood risk, of a flood scenario, return statistic value for each grid. Result will be returned as file 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.api_v1_result2d_static_stream_get(m2_d_statistic_type, scenario_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str m2_d_statistic_type: 二维统计结果类型 2D statistic type:  0-MaxWaterDepth;  1-FloodDuration;  2-FloodRisk; (required)
        :param str scenario_id: 方案的ID scenario’s ID (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.api_v1_result2d_static_stream_get_with_http_info(m2_d_statistic_type, scenario_id, **kwargs)  # noqa: E501

    def api_v1_result2d_static_stream_get_with_http_info(self, m2_d_statistic_type, scenario_id, **kwargs):  # noqa: E501
        """获取二维统计结果 Get 2D statistic results  # noqa: E501

        获取二维网格上的统计结果，包括最大积水深度（单位：米）、积水历时（单位：小时）、最大内涝风险等，结果以文件流的形式返回 Get 2D statistic results including max water depth (unit: m), waterlogging duration (unit: hour), max flood risk, of a flood scenario, return statistic value for each grid. Result will be returned as file 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.api_v1_result2d_static_stream_get_with_http_info(m2_d_statistic_type, scenario_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str m2_d_statistic_type: 二维统计结果类型 2D statistic type:  0-MaxWaterDepth;  1-FloodDuration;  2-FloodRisk; (required)
        :param str scenario_id: 方案的ID scenario’s ID (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'm2_d_statistic_type',
            'scenario_id'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method api_v1_result2d_static_stream_get" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'm2_d_statistic_type' is set
        if self.api_client.client_side_validation and ('m2_d_statistic_type' not in local_var_params or  # noqa: E501
                                                        local_var_params['m2_d_statistic_type'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `m2_d_statistic_type` when calling `api_v1_result2d_static_stream_get`")  # noqa: E501
        # verify the required parameter 'scenario_id' is set
        if self.api_client.client_side_validation and ('scenario_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['scenario_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `scenario_id` when calling `api_v1_result2d_static_stream_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'm2_d_statistic_type' in local_var_params and local_var_params['m2_d_statistic_type'] is not None:  # noqa: E501
            query_params.append(('M2DStatisticType', local_var_params['m2_d_statistic_type']))  # noqa: E501
        if 'scenario_id' in local_var_params and local_var_params['scenario_id'] is not None:  # noqa: E501
            query_params.append(('ScenarioId', local_var_params['scenario_id']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/result/2d/static/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=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def api_v1_result2d_timeseries_get(self, m2_d_data_type, element_id, scenario_id, **kwargs):  # noqa: E501
        """获取单个网格的时间序列结果 Get time series result on a single cell  # noqa: E501

        获取单个网格上的水深时间序列结果数据 Get water depth time series result on a single mesh cell of a scenario.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_v1_result2d_timeseries_get(m2_d_data_type, element_id, scenario_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str m2_d_data_type: 二维结果类型 2D result type:  0-WaterDepth (required)
        :param str element_id: 网格编号 element id or grid id (required)
        :param str scenario_id: 方案的ID scenario’s ID (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: BaseTimeseriesOutput
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.api_v1_result2d_timeseries_get_with_http_info(m2_d_data_type, element_id, scenario_id, **kwargs)  # noqa: E501

    def api_v1_result2d_timeseries_get_with_http_info(self, m2_d_data_type, element_id, scenario_id, **kwargs):  # noqa: E501
        """获取单个网格的时间序列结果 Get time series result on a single cell  # noqa: E501

        获取单个网格上的水深时间序列结果数据 Get water depth time series result on a single mesh cell of a scenario.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.api_v1_result2d_timeseries_get_with_http_info(m2_d_data_type, element_id, scenario_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str m2_d_data_type: 二维结果类型 2D result type:  0-WaterDepth (required)
        :param str element_id: 网格编号 element id or grid id (required)
        :param str scenario_id: 方案的ID scenario’s ID (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(BaseTimeseriesOutput, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'm2_d_data_type',
            'element_id',
            'scenario_id'
        ]
        all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout'
            ]
        )

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method api_v1_result2d_timeseries_get" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'm2_d_data_type' is set
        if self.api_client.client_side_validation and ('m2_d_data_type' not in local_var_params or  # noqa: E501
                                                        local_var_params['m2_d_data_type'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `m2_d_data_type` when calling `api_v1_result2d_timeseries_get`")  # noqa: E501
        # verify the required parameter 'element_id' is set
        if self.api_client.client_side_validation and ('element_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['element_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `element_id` when calling `api_v1_result2d_timeseries_get`")  # noqa: E501
        # verify the required parameter 'scenario_id' is set
        if self.api_client.client_side_validation and ('scenario_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['scenario_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `scenario_id` when calling `api_v1_result2d_timeseries_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'm2_d_data_type' in local_var_params and local_var_params['m2_d_data_type'] is not None:  # noqa: E501
            query_params.append(('M2DDataType', local_var_params['m2_d_data_type']))  # noqa: E501
        if 'element_id' in local_var_params and local_var_params['element_id'] is not None:  # noqa: E501
            query_params.append(('ElementID', local_var_params['element_id']))  # noqa: E501
        if 'scenario_id' in local_var_params and local_var_params['scenario_id'] is not None:  # noqa: E501
            query_params.append(('ScenarioId', local_var_params['scenario_id']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/result/2d/timeseries', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BaseTimeseriesOutput',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)
