# coding: utf-8

"""
    Gitea API.

    This documentation describes the Gitea API.

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

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


import re  # noqa: F401
import io
import warnings

from pydantic import validate_arguments, ValidationError
from typing_extensions import Annotated
from typing import overload, Optional, Union, Awaitable

from datetime import datetime

from pydantic import Field, StrictBool, StrictInt, StrictStr, conlist, validator

from typing import List, Optional

from py_gitea_opensuse_org.models.notification_count import NotificationCount
from py_gitea_opensuse_org.models.notification_thread import NotificationThread

from py_gitea_opensuse_org.api_client import ApiClient
from py_gitea_opensuse_org.api_response import ApiResponse
from py_gitea_opensuse_org.exceptions import (  # noqa: F401
    ApiTypeError,
    ApiValueError
)


class NotificationApi(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.get_default()
        self.api_client = api_client

    @overload
    async def notify_get_list(self, all : Annotated[Optional[StrictBool], Field(description="If true, show notifications marked as read. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned.")] = None, subject_type : Annotated[Optional[conlist(StrictStr)], Field(description="filter notifications by subject type")] = None, since : Annotated[Optional[datetime], Field(description="Only show notifications updated after the given time. This is a timestamp in RFC 3339 format")] = None, before : Annotated[Optional[datetime], Field(description="Only show notifications updated before the given time. This is a timestamp in RFC 3339 format")] = None, page : Annotated[Optional[StrictInt], Field(description="page number of results to return (1-based)")] = None, limit : Annotated[Optional[StrictInt], Field(description="page size of results")] = None, **kwargs) -> List[NotificationThread]:  # noqa: E501
        ...

    @overload
    def notify_get_list(self, all : Annotated[Optional[StrictBool], Field(description="If true, show notifications marked as read. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned.")] = None, subject_type : Annotated[Optional[conlist(StrictStr)], Field(description="filter notifications by subject type")] = None, since : Annotated[Optional[datetime], Field(description="Only show notifications updated after the given time. This is a timestamp in RFC 3339 format")] = None, before : Annotated[Optional[datetime], Field(description="Only show notifications updated before the given time. This is a timestamp in RFC 3339 format")] = None, page : Annotated[Optional[StrictInt], Field(description="page number of results to return (1-based)")] = None, limit : Annotated[Optional[StrictInt], Field(description="page size of results")] = None, async_req: Optional[bool]=True, **kwargs) -> List[NotificationThread]:  # noqa: E501
        ...

    @validate_arguments
    def notify_get_list(self, all : Annotated[Optional[StrictBool], Field(description="If true, show notifications marked as read. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned.")] = None, subject_type : Annotated[Optional[conlist(StrictStr)], Field(description="filter notifications by subject type")] = None, since : Annotated[Optional[datetime], Field(description="Only show notifications updated after the given time. This is a timestamp in RFC 3339 format")] = None, before : Annotated[Optional[datetime], Field(description="Only show notifications updated before the given time. This is a timestamp in RFC 3339 format")] = None, page : Annotated[Optional[StrictInt], Field(description="page number of results to return (1-based)")] = None, limit : Annotated[Optional[StrictInt], Field(description="page size of results")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[List[NotificationThread], Awaitable[List[NotificationThread]]]:  # noqa: E501
        """List users's notification threads  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_get_list(all, status_types, subject_type, since, before, page, limit, async_req=True)
        >>> result = thread.get()

        :param all: If true, show notifications marked as read. Default value is false
        :type all: bool
        :param status_types: Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned.
        :type status_types: List[str]
        :param subject_type: filter notifications by subject type
        :type subject_type: List[str]
        :param since: Only show notifications updated after the given time. This is a timestamp in RFC 3339 format
        :type since: datetime
        :param before: Only show notifications updated before the given time. This is a timestamp in RFC 3339 format
        :type before: datetime
        :param page: page number of results to return (1-based)
        :type page: int
        :param limit: page size of results
        :type limit: int
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: List[NotificationThread]
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the notify_get_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        if async_req is not None:
            kwargs['async_req'] = async_req
        return self.notify_get_list_with_http_info(all, status_types, subject_type, since, before, page, limit, **kwargs)  # noqa: E501

    @validate_arguments
    def notify_get_list_with_http_info(self, all : Annotated[Optional[StrictBool], Field(description="If true, show notifications marked as read. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned.")] = None, subject_type : Annotated[Optional[conlist(StrictStr)], Field(description="filter notifications by subject type")] = None, since : Annotated[Optional[datetime], Field(description="Only show notifications updated after the given time. This is a timestamp in RFC 3339 format")] = None, before : Annotated[Optional[datetime], Field(description="Only show notifications updated before the given time. This is a timestamp in RFC 3339 format")] = None, page : Annotated[Optional[StrictInt], Field(description="page number of results to return (1-based)")] = None, limit : Annotated[Optional[StrictInt], Field(description="page size of results")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """List users's notification threads  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_get_list_with_http_info(all, status_types, subject_type, since, before, page, limit, async_req=True)
        >>> result = thread.get()

        :param all: If true, show notifications marked as read. Default value is false
        :type all: bool
        :param status_types: Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned.
        :type status_types: List[str]
        :param subject_type: filter notifications by subject type
        :type subject_type: List[str]
        :param since: Only show notifications updated after the given time. This is a timestamp in RFC 3339 format
        :type since: datetime
        :param before: Only show notifications updated before the given time. This is a timestamp in RFC 3339 format
        :type before: datetime
        :param page: page number of results to return (1-based)
        :type page: int
        :param limit: page size of results
        :type limit: int
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(List[NotificationThread], status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'all',
            'status_types',
            'subject_type',
            'since',
            'before',
            'page',
            'limit'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method notify_get_list" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        if _params.get('all') is not None:  # noqa: E501
            _query_params.append(('all', _params['all']))

        if _params.get('status_types') is not None:  # noqa: E501
            _query_params.append(('status-types', _params['status_types']))
            _collection_formats['status-types'] = 'multi'

        if _params.get('subject_type') is not None:  # noqa: E501
            _query_params.append(('subject-type', _params['subject_type']))
            _collection_formats['subject-type'] = 'multi'

        if _params.get('since') is not None:  # noqa: E501
            if isinstance(_params['since'], datetime):
                _query_params.append(('since', _params['since'].strftime(self.api_client.configuration.datetime_format)))
            else:
                _query_params.append(('since', _params['since']))

        if _params.get('before') is not None:  # noqa: E501
            if isinstance(_params['before'], datetime):
                _query_params.append(('before', _params['before'].strftime(self.api_client.configuration.datetime_format)))
            else:
                _query_params.append(('before', _params['before']))

        if _params.get('page') is not None:  # noqa: E501
            _query_params.append(('page', _params['page']))

        if _params.get('limit') is not None:  # noqa: E501
            _query_params.append(('limit', _params['limit']))

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['TOTPHeader', 'AuthorizationHeaderToken', 'SudoHeader', 'BasicAuth', 'AccessToken', 'SudoParam', 'Token']  # noqa: E501

        _response_types_map = {
            '200': "List[NotificationThread]",
        }

        return self.api_client.call_api(
            '/notifications', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def notify_get_repo_list(self, owner : Annotated[StrictStr, Field(..., description="owner of the repo")], repo : Annotated[StrictStr, Field(..., description="name of the repo")], all : Annotated[Optional[StrictBool], Field(description="If true, show notifications marked as read. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned")] = None, subject_type : Annotated[Optional[conlist(StrictStr)], Field(description="filter notifications by subject type")] = None, since : Annotated[Optional[datetime], Field(description="Only show notifications updated after the given time. This is a timestamp in RFC 3339 format")] = None, before : Annotated[Optional[datetime], Field(description="Only show notifications updated before the given time. This is a timestamp in RFC 3339 format")] = None, page : Annotated[Optional[StrictInt], Field(description="page number of results to return (1-based)")] = None, limit : Annotated[Optional[StrictInt], Field(description="page size of results")] = None, **kwargs) -> List[NotificationThread]:  # noqa: E501
        ...

    @overload
    def notify_get_repo_list(self, owner : Annotated[StrictStr, Field(..., description="owner of the repo")], repo : Annotated[StrictStr, Field(..., description="name of the repo")], all : Annotated[Optional[StrictBool], Field(description="If true, show notifications marked as read. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned")] = None, subject_type : Annotated[Optional[conlist(StrictStr)], Field(description="filter notifications by subject type")] = None, since : Annotated[Optional[datetime], Field(description="Only show notifications updated after the given time. This is a timestamp in RFC 3339 format")] = None, before : Annotated[Optional[datetime], Field(description="Only show notifications updated before the given time. This is a timestamp in RFC 3339 format")] = None, page : Annotated[Optional[StrictInt], Field(description="page number of results to return (1-based)")] = None, limit : Annotated[Optional[StrictInt], Field(description="page size of results")] = None, async_req: Optional[bool]=True, **kwargs) -> List[NotificationThread]:  # noqa: E501
        ...

    @validate_arguments
    def notify_get_repo_list(self, owner : Annotated[StrictStr, Field(..., description="owner of the repo")], repo : Annotated[StrictStr, Field(..., description="name of the repo")], all : Annotated[Optional[StrictBool], Field(description="If true, show notifications marked as read. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned")] = None, subject_type : Annotated[Optional[conlist(StrictStr)], Field(description="filter notifications by subject type")] = None, since : Annotated[Optional[datetime], Field(description="Only show notifications updated after the given time. This is a timestamp in RFC 3339 format")] = None, before : Annotated[Optional[datetime], Field(description="Only show notifications updated before the given time. This is a timestamp in RFC 3339 format")] = None, page : Annotated[Optional[StrictInt], Field(description="page number of results to return (1-based)")] = None, limit : Annotated[Optional[StrictInt], Field(description="page size of results")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[List[NotificationThread], Awaitable[List[NotificationThread]]]:  # noqa: E501
        """List users's notification threads on a specific repo  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_get_repo_list(owner, repo, all, status_types, subject_type, since, before, page, limit, async_req=True)
        >>> result = thread.get()

        :param owner: owner of the repo (required)
        :type owner: str
        :param repo: name of the repo (required)
        :type repo: str
        :param all: If true, show notifications marked as read. Default value is false
        :type all: bool
        :param status_types: Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned
        :type status_types: List[str]
        :param subject_type: filter notifications by subject type
        :type subject_type: List[str]
        :param since: Only show notifications updated after the given time. This is a timestamp in RFC 3339 format
        :type since: datetime
        :param before: Only show notifications updated before the given time. This is a timestamp in RFC 3339 format
        :type before: datetime
        :param page: page number of results to return (1-based)
        :type page: int
        :param limit: page size of results
        :type limit: int
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: List[NotificationThread]
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the notify_get_repo_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        if async_req is not None:
            kwargs['async_req'] = async_req
        return self.notify_get_repo_list_with_http_info(owner, repo, all, status_types, subject_type, since, before, page, limit, **kwargs)  # noqa: E501

    @validate_arguments
    def notify_get_repo_list_with_http_info(self, owner : Annotated[StrictStr, Field(..., description="owner of the repo")], repo : Annotated[StrictStr, Field(..., description="name of the repo")], all : Annotated[Optional[StrictBool], Field(description="If true, show notifications marked as read. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned")] = None, subject_type : Annotated[Optional[conlist(StrictStr)], Field(description="filter notifications by subject type")] = None, since : Annotated[Optional[datetime], Field(description="Only show notifications updated after the given time. This is a timestamp in RFC 3339 format")] = None, before : Annotated[Optional[datetime], Field(description="Only show notifications updated before the given time. This is a timestamp in RFC 3339 format")] = None, page : Annotated[Optional[StrictInt], Field(description="page number of results to return (1-based)")] = None, limit : Annotated[Optional[StrictInt], Field(description="page size of results")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """List users's notification threads on a specific repo  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_get_repo_list_with_http_info(owner, repo, all, status_types, subject_type, since, before, page, limit, async_req=True)
        >>> result = thread.get()

        :param owner: owner of the repo (required)
        :type owner: str
        :param repo: name of the repo (required)
        :type repo: str
        :param all: If true, show notifications marked as read. Default value is false
        :type all: bool
        :param status_types: Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned
        :type status_types: List[str]
        :param subject_type: filter notifications by subject type
        :type subject_type: List[str]
        :param since: Only show notifications updated after the given time. This is a timestamp in RFC 3339 format
        :type since: datetime
        :param before: Only show notifications updated before the given time. This is a timestamp in RFC 3339 format
        :type before: datetime
        :param page: page number of results to return (1-based)
        :type page: int
        :param limit: page size of results
        :type limit: int
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(List[NotificationThread], status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'owner',
            'repo',
            'all',
            'status_types',
            'subject_type',
            'since',
            'before',
            'page',
            'limit'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method notify_get_repo_list" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['owner']:
            _path_params['owner'] = _params['owner']

        if _params['repo']:
            _path_params['repo'] = _params['repo']


        # process the query parameters
        _query_params = []
        if _params.get('all') is not None:  # noqa: E501
            _query_params.append(('all', _params['all']))

        if _params.get('status_types') is not None:  # noqa: E501
            _query_params.append(('status-types', _params['status_types']))
            _collection_formats['status-types'] = 'multi'

        if _params.get('subject_type') is not None:  # noqa: E501
            _query_params.append(('subject-type', _params['subject_type']))
            _collection_formats['subject-type'] = 'multi'

        if _params.get('since') is not None:  # noqa: E501
            if isinstance(_params['since'], datetime):
                _query_params.append(('since', _params['since'].strftime(self.api_client.configuration.datetime_format)))
            else:
                _query_params.append(('since', _params['since']))

        if _params.get('before') is not None:  # noqa: E501
            if isinstance(_params['before'], datetime):
                _query_params.append(('before', _params['before'].strftime(self.api_client.configuration.datetime_format)))
            else:
                _query_params.append(('before', _params['before']))

        if _params.get('page') is not None:  # noqa: E501
            _query_params.append(('page', _params['page']))

        if _params.get('limit') is not None:  # noqa: E501
            _query_params.append(('limit', _params['limit']))

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['TOTPHeader', 'AuthorizationHeaderToken', 'SudoHeader', 'BasicAuth', 'AccessToken', 'SudoParam', 'Token']  # noqa: E501

        _response_types_map = {
            '200': "List[NotificationThread]",
        }

        return self.api_client.call_api(
            '/repos/{owner}/{repo}/notifications', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def notify_get_thread(self, id : Annotated[StrictStr, Field(..., description="id of notification thread")], **kwargs) -> NotificationThread:  # noqa: E501
        ...

    @overload
    def notify_get_thread(self, id : Annotated[StrictStr, Field(..., description="id of notification thread")], async_req: Optional[bool]=True, **kwargs) -> NotificationThread:  # noqa: E501
        ...

    @validate_arguments
    def notify_get_thread(self, id : Annotated[StrictStr, Field(..., description="id of notification thread")], async_req: Optional[bool]=None, **kwargs) -> Union[NotificationThread, Awaitable[NotificationThread]]:  # noqa: E501
        """Get notification thread by ID  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_get_thread(id, async_req=True)
        >>> result = thread.get()

        :param id: id of notification thread (required)
        :type id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: NotificationThread
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the notify_get_thread_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        if async_req is not None:
            kwargs['async_req'] = async_req
        return self.notify_get_thread_with_http_info(id, **kwargs)  # noqa: E501

    @validate_arguments
    def notify_get_thread_with_http_info(self, id : Annotated[StrictStr, Field(..., description="id of notification thread")], **kwargs) -> ApiResponse:  # noqa: E501
        """Get notification thread by ID  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_get_thread_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param id: id of notification thread (required)
        :type id: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(NotificationThread, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'id'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method notify_get_thread" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['id']:
            _path_params['id'] = _params['id']


        # process the query parameters
        _query_params = []
        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['TOTPHeader', 'AuthorizationHeaderToken', 'SudoHeader', 'BasicAuth', 'AccessToken', 'SudoParam', 'Token']  # noqa: E501

        _response_types_map = {
            '200': "NotificationThread",
            '403': None,
            '404': None,
        }

        return self.api_client.call_api(
            '/notifications/threads/{id}', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def notify_new_available(self, **kwargs) -> NotificationCount:  # noqa: E501
        ...

    @overload
    def notify_new_available(self, async_req: Optional[bool]=True, **kwargs) -> NotificationCount:  # noqa: E501
        ...

    @validate_arguments
    def notify_new_available(self, async_req: Optional[bool]=None, **kwargs) -> Union[NotificationCount, Awaitable[NotificationCount]]:  # noqa: E501
        """Check if unread notifications exist  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_new_available(async_req=True)
        >>> result = thread.get()

        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: NotificationCount
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the notify_new_available_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        if async_req is not None:
            kwargs['async_req'] = async_req
        return self.notify_new_available_with_http_info(**kwargs)  # noqa: E501

    @validate_arguments
    def notify_new_available_with_http_info(self, **kwargs) -> ApiResponse:  # noqa: E501
        """Check if unread notifications exist  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_new_available_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(NotificationCount, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method notify_new_available" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/html'])  # noqa: E501

        # authentication setting
        _auth_settings = ['TOTPHeader', 'AuthorizationHeaderToken', 'SudoHeader', 'BasicAuth', 'AccessToken', 'SudoParam', 'Token']  # noqa: E501

        _response_types_map = {
            '200': "NotificationCount",
        }

        return self.api_client.call_api(
            '/notifications/new', 'GET',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def notify_read_list(self, last_read_at : Annotated[Optional[datetime], Field(description="Describes the last point that notifications were checked. Anything updated since this time will not be updated.")] = None, all : Annotated[Optional[StrictStr], Field(description="If true, mark all notifications on this repo. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.")] = None, to_status : Annotated[Optional[StrictStr], Field(description="Status to mark notifications as, Defaults to read.")] = None, **kwargs) -> List[NotificationThread]:  # noqa: E501
        ...

    @overload
    def notify_read_list(self, last_read_at : Annotated[Optional[datetime], Field(description="Describes the last point that notifications were checked. Anything updated since this time will not be updated.")] = None, all : Annotated[Optional[StrictStr], Field(description="If true, mark all notifications on this repo. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.")] = None, to_status : Annotated[Optional[StrictStr], Field(description="Status to mark notifications as, Defaults to read.")] = None, async_req: Optional[bool]=True, **kwargs) -> List[NotificationThread]:  # noqa: E501
        ...

    @validate_arguments
    def notify_read_list(self, last_read_at : Annotated[Optional[datetime], Field(description="Describes the last point that notifications were checked. Anything updated since this time will not be updated.")] = None, all : Annotated[Optional[StrictStr], Field(description="If true, mark all notifications on this repo. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.")] = None, to_status : Annotated[Optional[StrictStr], Field(description="Status to mark notifications as, Defaults to read.")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[List[NotificationThread], Awaitable[List[NotificationThread]]]:  # noqa: E501
        """Mark notification threads as read, pinned or unread  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_read_list(last_read_at, all, status_types, to_status, async_req=True)
        >>> result = thread.get()

        :param last_read_at: Describes the last point that notifications were checked. Anything updated since this time will not be updated.
        :type last_read_at: datetime
        :param all: If true, mark all notifications on this repo. Default value is false
        :type all: str
        :param status_types: Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.
        :type status_types: List[str]
        :param to_status: Status to mark notifications as, Defaults to read.
        :type to_status: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: List[NotificationThread]
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the notify_read_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        if async_req is not None:
            kwargs['async_req'] = async_req
        return self.notify_read_list_with_http_info(last_read_at, all, status_types, to_status, **kwargs)  # noqa: E501

    @validate_arguments
    def notify_read_list_with_http_info(self, last_read_at : Annotated[Optional[datetime], Field(description="Describes the last point that notifications were checked. Anything updated since this time will not be updated.")] = None, all : Annotated[Optional[StrictStr], Field(description="If true, mark all notifications on this repo. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.")] = None, to_status : Annotated[Optional[StrictStr], Field(description="Status to mark notifications as, Defaults to read.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Mark notification threads as read, pinned or unread  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_read_list_with_http_info(last_read_at, all, status_types, to_status, async_req=True)
        >>> result = thread.get()

        :param last_read_at: Describes the last point that notifications were checked. Anything updated since this time will not be updated.
        :type last_read_at: datetime
        :param all: If true, mark all notifications on this repo. Default value is false
        :type all: str
        :param status_types: Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.
        :type status_types: List[str]
        :param to_status: Status to mark notifications as, Defaults to read.
        :type to_status: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(List[NotificationThread], status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'last_read_at',
            'all',
            'status_types',
            'to_status'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method notify_read_list" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}

        # process the query parameters
        _query_params = []
        if _params.get('last_read_at') is not None:  # noqa: E501
            if isinstance(_params['last_read_at'], datetime):
                _query_params.append(('last_read_at', _params['last_read_at'].strftime(self.api_client.configuration.datetime_format)))
            else:
                _query_params.append(('last_read_at', _params['last_read_at']))

        if _params.get('all') is not None:  # noqa: E501
            _query_params.append(('all', _params['all']))

        if _params.get('status_types') is not None:  # noqa: E501
            _query_params.append(('status-types', _params['status_types']))
            _collection_formats['status-types'] = 'multi'

        if _params.get('to_status') is not None:  # noqa: E501
            _query_params.append(('to-status', _params['to_status']))

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['TOTPHeader', 'AuthorizationHeaderToken', 'SudoHeader', 'BasicAuth', 'AccessToken', 'SudoParam', 'Token']  # noqa: E501

        _response_types_map = {
            '205': "List[NotificationThread]",
        }

        return self.api_client.call_api(
            '/notifications', 'PUT',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def notify_read_repo_list(self, owner : Annotated[StrictStr, Field(..., description="owner of the repo")], repo : Annotated[StrictStr, Field(..., description="name of the repo")], all : Annotated[Optional[StrictStr], Field(description="If true, mark all notifications on this repo. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.")] = None, to_status : Annotated[Optional[StrictStr], Field(description="Status to mark notifications as. Defaults to read.")] = None, last_read_at : Annotated[Optional[datetime], Field(description="Describes the last point that notifications were checked. Anything updated since this time will not be updated.")] = None, **kwargs) -> List[NotificationThread]:  # noqa: E501
        ...

    @overload
    def notify_read_repo_list(self, owner : Annotated[StrictStr, Field(..., description="owner of the repo")], repo : Annotated[StrictStr, Field(..., description="name of the repo")], all : Annotated[Optional[StrictStr], Field(description="If true, mark all notifications on this repo. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.")] = None, to_status : Annotated[Optional[StrictStr], Field(description="Status to mark notifications as. Defaults to read.")] = None, last_read_at : Annotated[Optional[datetime], Field(description="Describes the last point that notifications were checked. Anything updated since this time will not be updated.")] = None, async_req: Optional[bool]=True, **kwargs) -> List[NotificationThread]:  # noqa: E501
        ...

    @validate_arguments
    def notify_read_repo_list(self, owner : Annotated[StrictStr, Field(..., description="owner of the repo")], repo : Annotated[StrictStr, Field(..., description="name of the repo")], all : Annotated[Optional[StrictStr], Field(description="If true, mark all notifications on this repo. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.")] = None, to_status : Annotated[Optional[StrictStr], Field(description="Status to mark notifications as. Defaults to read.")] = None, last_read_at : Annotated[Optional[datetime], Field(description="Describes the last point that notifications were checked. Anything updated since this time will not be updated.")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[List[NotificationThread], Awaitable[List[NotificationThread]]]:  # noqa: E501
        """Mark notification threads as read, pinned or unread on a specific repo  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_read_repo_list(owner, repo, all, status_types, to_status, last_read_at, async_req=True)
        >>> result = thread.get()

        :param owner: owner of the repo (required)
        :type owner: str
        :param repo: name of the repo (required)
        :type repo: str
        :param all: If true, mark all notifications on this repo. Default value is false
        :type all: str
        :param status_types: Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.
        :type status_types: List[str]
        :param to_status: Status to mark notifications as. Defaults to read.
        :type to_status: str
        :param last_read_at: Describes the last point that notifications were checked. Anything updated since this time will not be updated.
        :type last_read_at: datetime
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: List[NotificationThread]
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the notify_read_repo_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        if async_req is not None:
            kwargs['async_req'] = async_req
        return self.notify_read_repo_list_with_http_info(owner, repo, all, status_types, to_status, last_read_at, **kwargs)  # noqa: E501

    @validate_arguments
    def notify_read_repo_list_with_http_info(self, owner : Annotated[StrictStr, Field(..., description="owner of the repo")], repo : Annotated[StrictStr, Field(..., description="name of the repo")], all : Annotated[Optional[StrictStr], Field(description="If true, mark all notifications on this repo. Default value is false")] = None, status_types : Annotated[Optional[conlist(StrictStr)], Field(description="Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.")] = None, to_status : Annotated[Optional[StrictStr], Field(description="Status to mark notifications as. Defaults to read.")] = None, last_read_at : Annotated[Optional[datetime], Field(description="Describes the last point that notifications were checked. Anything updated since this time will not be updated.")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Mark notification threads as read, pinned or unread on a specific repo  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_read_repo_list_with_http_info(owner, repo, all, status_types, to_status, last_read_at, async_req=True)
        >>> result = thread.get()

        :param owner: owner of the repo (required)
        :type owner: str
        :param repo: name of the repo (required)
        :type repo: str
        :param all: If true, mark all notifications on this repo. Default value is false
        :type all: str
        :param status_types: Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread.
        :type status_types: List[str]
        :param to_status: Status to mark notifications as. Defaults to read.
        :type to_status: str
        :param last_read_at: Describes the last point that notifications were checked. Anything updated since this time will not be updated.
        :type last_read_at: datetime
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(List[NotificationThread], status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'owner',
            'repo',
            'all',
            'status_types',
            'to_status',
            'last_read_at'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method notify_read_repo_list" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['owner']:
            _path_params['owner'] = _params['owner']

        if _params['repo']:
            _path_params['repo'] = _params['repo']


        # process the query parameters
        _query_params = []
        if _params.get('all') is not None:  # noqa: E501
            _query_params.append(('all', _params['all']))

        if _params.get('status_types') is not None:  # noqa: E501
            _query_params.append(('status-types', _params['status_types']))
            _collection_formats['status-types'] = 'multi'

        if _params.get('to_status') is not None:  # noqa: E501
            _query_params.append(('to-status', _params['to_status']))

        if _params.get('last_read_at') is not None:  # noqa: E501
            if isinstance(_params['last_read_at'], datetime):
                _query_params.append(('last_read_at', _params['last_read_at'].strftime(self.api_client.configuration.datetime_format)))
            else:
                _query_params.append(('last_read_at', _params['last_read_at']))

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['TOTPHeader', 'AuthorizationHeaderToken', 'SudoHeader', 'BasicAuth', 'AccessToken', 'SudoParam', 'Token']  # noqa: E501

        _response_types_map = {
            '205': "List[NotificationThread]",
        }

        return self.api_client.call_api(
            '/repos/{owner}/{repo}/notifications', 'PUT',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))

    @overload
    async def notify_read_thread(self, id : Annotated[StrictStr, Field(..., description="id of notification thread")], to_status : Annotated[Optional[StrictStr], Field(description="Status to mark notifications as")] = None, **kwargs) -> NotificationThread:  # noqa: E501
        ...

    @overload
    def notify_read_thread(self, id : Annotated[StrictStr, Field(..., description="id of notification thread")], to_status : Annotated[Optional[StrictStr], Field(description="Status to mark notifications as")] = None, async_req: Optional[bool]=True, **kwargs) -> NotificationThread:  # noqa: E501
        ...

    @validate_arguments
    def notify_read_thread(self, id : Annotated[StrictStr, Field(..., description="id of notification thread")], to_status : Annotated[Optional[StrictStr], Field(description="Status to mark notifications as")] = None, async_req: Optional[bool]=None, **kwargs) -> Union[NotificationThread, Awaitable[NotificationThread]]:  # noqa: E501
        """Mark notification thread as read by ID  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_read_thread(id, to_status, async_req=True)
        >>> result = thread.get()

        :param id: id of notification thread (required)
        :type id: str
        :param to_status: Status to mark notifications as
        :type to_status: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :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: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: NotificationThread
        """
        kwargs['_return_http_data_only'] = True
        if '_preload_content' in kwargs:
            raise ValueError("Error! Please call the notify_read_thread_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data")
        if async_req is not None:
            kwargs['async_req'] = async_req
        return self.notify_read_thread_with_http_info(id, to_status, **kwargs)  # noqa: E501

    @validate_arguments
    def notify_read_thread_with_http_info(self, id : Annotated[StrictStr, Field(..., description="id of notification thread")], to_status : Annotated[Optional[StrictStr], Field(description="Status to mark notifications as")] = None, **kwargs) -> ApiResponse:  # noqa: E501
        """Mark notification thread as read by ID  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.notify_read_thread_with_http_info(id, to_status, async_req=True)
        >>> result = thread.get()

        :param id: id of notification thread (required)
        :type id: str
        :param to_status: Status to mark notifications as
        :type to_status: str
        :param async_req: Whether to execute the request asynchronously.
        :type async_req: bool, optional
        :param _preload_content: if False, the ApiResponse.data will
                                 be set to none and raw_data will store the 
                                 HTTP response body without reading/decoding.
                                 Default is True.
        :type _preload_content: bool, optional
        :param _return_http_data_only: response data instead of ApiResponse
                                       object with status code, headers, etc
        :type _return_http_data_only: bool, optional
        :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.
        :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
        :type _content_type: string, optional: force content-type for the request
        :return: Returns the result object.
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: tuple(NotificationThread, status_code(int), headers(HTTPHeaderDict))
        """

        _params = locals()

        _all_params = [
            'id',
            'to_status'
        ]
        _all_params.extend(
            [
                'async_req',
                '_return_http_data_only',
                '_preload_content',
                '_request_timeout',
                '_request_auth',
                '_content_type',
                '_headers'
            ]
        )

        # validate the arguments
        for _key, _val in _params['kwargs'].items():
            if _key not in _all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method notify_read_thread" % _key
                )
            _params[_key] = _val
        del _params['kwargs']

        _collection_formats = {}

        # process the path parameters
        _path_params = {}
        if _params['id']:
            _path_params['id'] = _params['id']


        # process the query parameters
        _query_params = []
        if _params.get('to_status') is not None:  # noqa: E501
            _query_params.append(('to-status', _params['to_status']))

        # process the header parameters
        _header_params = dict(_params.get('_headers', {}))
        # process the form parameters
        _form_params = []
        _files = {}
        # process the body parameter
        _body_params = None
        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # authentication setting
        _auth_settings = ['TOTPHeader', 'AuthorizationHeaderToken', 'SudoHeader', 'BasicAuth', 'AccessToken', 'SudoParam', 'Token']  # noqa: E501

        _response_types_map = {
            '205': "NotificationThread",
            '403': None,
            '404': None,
        }

        return self.api_client.call_api(
            '/notifications/threads/{id}', 'PATCH',
            _path_params,
            _query_params,
            _header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            response_types_map=_response_types_map,
            auth_settings=_auth_settings,
            async_req=_params.get('async_req'),
            _return_http_data_only=_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=_params.get('_preload_content', True),
            _request_timeout=_params.get('_request_timeout'),
            collection_formats=_collection_formats,
            _request_auth=_params.get('_request_auth'))
