# coding: utf-8

"""
    Secore API

    API for the Seres core platform

    The version of the OpenAPI document: 0.1.0
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from datetime import date
from pydantic import Field, StrictBool, StrictInt, StrictStr
from typing import List, Optional
from typing_extensions import Annotated
from seres_client.models.pad_window_schema import PadWindowSchema

from seres_client.api_client import ApiClient, RequestSerialized
from seres_client.api_response import ApiResponse
from seres_client.rest import RESTResponseType


class PadWindowsApi:
    """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) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client


    @validate_call
    def get_pad_window(
        self,
        window_id: StrictInt,
        future_id: Annotated[Optional[StrictInt], Field(description="Operate in the context of the timeline where this future is the head.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PadWindowSchema:
        """Get Pad Window

        Get the given window

        :param window_id: (required)
        :type window_id: int
        :param future_id: Operate in the context of the timeline where this future is the head.
        :type future_id: int
        :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.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_pad_window_serialize(
            window_id=window_id,
            future_id=future_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PadWindowSchema",
            '401': None,
            '404': None,
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_pad_window_with_http_info(
        self,
        window_id: StrictInt,
        future_id: Annotated[Optional[StrictInt], Field(description="Operate in the context of the timeline where this future is the head.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PadWindowSchema]:
        """Get Pad Window

        Get the given window

        :param window_id: (required)
        :type window_id: int
        :param future_id: Operate in the context of the timeline where this future is the head.
        :type future_id: int
        :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.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_pad_window_serialize(
            window_id=window_id,
            future_id=future_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PadWindowSchema",
            '401': None,
            '404': None,
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_pad_window_without_preload_content(
        self,
        window_id: StrictInt,
        future_id: Annotated[Optional[StrictInt], Field(description="Operate in the context of the timeline where this future is the head.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get Pad Window

        Get the given window

        :param window_id: (required)
        :type window_id: int
        :param future_id: Operate in the context of the timeline where this future is the head.
        :type future_id: int
        :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.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_pad_window_serialize(
            window_id=window_id,
            future_id=future_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PadWindowSchema",
            '401': None,
            '404': None,
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_pad_window_serialize(
        self,
        window_id,
        future_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if window_id is not None:
            _path_params['window_id'] = window_id
        # process the query parameters
        # process the header parameters
        if future_id is not None:
            _header_params['future-id'] = future_id
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyHeader', 
            'APIKeyCookie'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/pad-windows/{window_id}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_pad_windows(
        self,
        dates: Optional[List[date]] = None,
        pad_id: Optional[StrictInt] = None,
        is_launch_window: Optional[StrictBool] = None,
        is_landing_window: Optional[StrictBool] = None,
        available: Annotated[Optional[StrictBool], Field(description="Exclude windows that are unavailable")] = None,
        compatible_resource_assembly_schema_ids: Annotated[Optional[StrictStr], Field(description="A comma seperated list of ids. Filter the windows with pads that are compatible with all of the given resource assembly schema ids.")] = None,
        future_id: Annotated[Optional[StrictInt], Field(description="Operate in the context of the timeline where this future is the head.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[PadWindowSchema]:
        """Get Pad Windows

        List all windows

        :param dates:
        :type dates: List[date]
        :param pad_id:
        :type pad_id: int
        :param is_launch_window:
        :type is_launch_window: bool
        :param is_landing_window:
        :type is_landing_window: bool
        :param available: Exclude windows that are unavailable
        :type available: bool
        :param compatible_resource_assembly_schema_ids: A comma seperated list of ids. Filter the windows with pads that are compatible with all of the given resource assembly schema ids.
        :type compatible_resource_assembly_schema_ids: str
        :param future_id: Operate in the context of the timeline where this future is the head.
        :type future_id: int
        :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.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_pad_windows_serialize(
            dates=dates,
            pad_id=pad_id,
            is_launch_window=is_launch_window,
            is_landing_window=is_landing_window,
            available=available,
            compatible_resource_assembly_schema_ids=compatible_resource_assembly_schema_ids,
            future_id=future_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[PadWindowSchema]",
            '401': None,
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_pad_windows_with_http_info(
        self,
        dates: Optional[List[date]] = None,
        pad_id: Optional[StrictInt] = None,
        is_launch_window: Optional[StrictBool] = None,
        is_landing_window: Optional[StrictBool] = None,
        available: Annotated[Optional[StrictBool], Field(description="Exclude windows that are unavailable")] = None,
        compatible_resource_assembly_schema_ids: Annotated[Optional[StrictStr], Field(description="A comma seperated list of ids. Filter the windows with pads that are compatible with all of the given resource assembly schema ids.")] = None,
        future_id: Annotated[Optional[StrictInt], Field(description="Operate in the context of the timeline where this future is the head.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[PadWindowSchema]]:
        """Get Pad Windows

        List all windows

        :param dates:
        :type dates: List[date]
        :param pad_id:
        :type pad_id: int
        :param is_launch_window:
        :type is_launch_window: bool
        :param is_landing_window:
        :type is_landing_window: bool
        :param available: Exclude windows that are unavailable
        :type available: bool
        :param compatible_resource_assembly_schema_ids: A comma seperated list of ids. Filter the windows with pads that are compatible with all of the given resource assembly schema ids.
        :type compatible_resource_assembly_schema_ids: str
        :param future_id: Operate in the context of the timeline where this future is the head.
        :type future_id: int
        :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.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_pad_windows_serialize(
            dates=dates,
            pad_id=pad_id,
            is_launch_window=is_launch_window,
            is_landing_window=is_landing_window,
            available=available,
            compatible_resource_assembly_schema_ids=compatible_resource_assembly_schema_ids,
            future_id=future_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[PadWindowSchema]",
            '401': None,
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_pad_windows_without_preload_content(
        self,
        dates: Optional[List[date]] = None,
        pad_id: Optional[StrictInt] = None,
        is_launch_window: Optional[StrictBool] = None,
        is_landing_window: Optional[StrictBool] = None,
        available: Annotated[Optional[StrictBool], Field(description="Exclude windows that are unavailable")] = None,
        compatible_resource_assembly_schema_ids: Annotated[Optional[StrictStr], Field(description="A comma seperated list of ids. Filter the windows with pads that are compatible with all of the given resource assembly schema ids.")] = None,
        future_id: Annotated[Optional[StrictInt], Field(description="Operate in the context of the timeline where this future is the head.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get Pad Windows

        List all windows

        :param dates:
        :type dates: List[date]
        :param pad_id:
        :type pad_id: int
        :param is_launch_window:
        :type is_launch_window: bool
        :param is_landing_window:
        :type is_landing_window: bool
        :param available: Exclude windows that are unavailable
        :type available: bool
        :param compatible_resource_assembly_schema_ids: A comma seperated list of ids. Filter the windows with pads that are compatible with all of the given resource assembly schema ids.
        :type compatible_resource_assembly_schema_ids: str
        :param future_id: Operate in the context of the timeline where this future is the head.
        :type future_id: int
        :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.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_pad_windows_serialize(
            dates=dates,
            pad_id=pad_id,
            is_launch_window=is_launch_window,
            is_landing_window=is_landing_window,
            available=available,
            compatible_resource_assembly_schema_ids=compatible_resource_assembly_schema_ids,
            future_id=future_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[PadWindowSchema]",
            '401': None,
            '422': "HTTPValidationError",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_pad_windows_serialize(
        self,
        dates,
        pad_id,
        is_launch_window,
        is_landing_window,
        available,
        compatible_resource_assembly_schema_ids,
        future_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'dates': 'multi',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if dates is not None:
            
            _query_params.append(('dates', dates))
            
        if pad_id is not None:
            
            _query_params.append(('pad_id', pad_id))
            
        if is_launch_window is not None:
            
            _query_params.append(('is_launch_window', is_launch_window))
            
        if is_landing_window is not None:
            
            _query_params.append(('is_landing_window', is_landing_window))
            
        if available is not None:
            
            _query_params.append(('available', available))
            
        if compatible_resource_assembly_schema_ids is not None:
            
            _query_params.append(('compatible_resource_assembly_schema_ids', compatible_resource_assembly_schema_ids))
            
        # process the header parameters
        if future_id is not None:
            _header_params['future-id'] = future_id
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'APIKeyHeader', 
            'APIKeyCookie'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/pad-windows',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


