# coding: utf-8

"""
    Statuspage API

    # Code of Conduct Please don't abuse the API, and please report all feature requests and issues to https://support.atlassian.com/contact  # Rate Limiting Each API token is limited to 1 request / second as measured on a 60 second rolling window. To get this limit increased, please contact us at https://support.atlassian.com/contact  Error codes 420 or 429 indicate that you have exceeded the rate limit and the request has been rejected.  # Basics  ## HTTPS It's required  ## URL Prefix In order to maintain version integrity into the future, the API is versioned. All calls currently begin with the following prefix:    https://api.statuspage.io/v1/  ## RESTful Interface Wherever possible, the API seeks to implement repeatable patterns with logical, representative URLs and descriptive HTTP verbs. Below are some examples and conventions you will see throughout the documentation.  * Collections are buckets: https://api.statuspage.io/v1/pages/asdf123/incidents.json * Elements have unique IDs: https://api.statuspage.io/v1/pages/asdf123/incidents/jklm456.json * GET will retrieve information about a collection/element * POST will create an element in a collection * PATCH will update a single element * PUT will replace a single element in a collection (rarely used) * DELETE will destroy a single element  ## Sending Data Information can be sent in the body as form urlencoded or JSON, but make sure the Content-Type header matches the body structure or the server gremlins will be angry.  All examples are provided in JSON format, however they can easily be converted to form encoding if required.  Some examples of how to convert things are below:      // JSON     {       \"incident\": {         \"name\": \"test incident\",         \"components\": [\"8kbf7d35c070\", \"vtnh60py4yd7\"]       }     }      // Form Encoded (using curl as an example):     curl -X POST https://api.statuspage.io/v1/example \\       -d \"incident[name]=test incident\" \\       -d \"incident[components][]=8kbf7d35c070\" \\       -d \"incident[components][]=vtnh60py4yd7\"  # Authentication  <!-- ReDoc-Inject: <security-definitions> -->  # noqa: E501

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

from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from atlassian_statuspage.api_client import ApiClient


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

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

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

    def delete_pages_page_id_subscribers_subscriber_id(self, page_id, subscriber_id, **kwargs):  # noqa: E501
        """Unsubscribe a subscriber  # noqa: E501

        Unsubscribe a subscriber  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_pages_page_id_subscribers_subscriber_id(page_id, subscriber_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :param str subscriber_id: Subscriber Identifier (required)
        :param bool skip_unsubscription_notification: If skip_unsubscription_notification is true, the subscriber does not receive any notifications when they are unsubscribed.
        :return: Subscriber
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.delete_pages_page_id_subscribers_subscriber_id_with_http_info(page_id, subscriber_id, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_pages_page_id_subscribers_subscriber_id_with_http_info(page_id, subscriber_id, **kwargs)  # noqa: E501
            return data

    def delete_pages_page_id_subscribers_subscriber_id_with_http_info(self, page_id, subscriber_id, **kwargs):  # noqa: E501
        """Unsubscribe a subscriber  # noqa: E501

        Unsubscribe a subscriber  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_pages_page_id_subscribers_subscriber_id_with_http_info(page_id, subscriber_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :param str subscriber_id: Subscriber Identifier (required)
        :param bool skip_unsubscription_notification: If skip_unsubscription_notification is true, the subscriber does not receive any notifications when they are unsubscribed.
        :return: Subscriber
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['page_id', 'subscriber_id', 'skip_unsubscription_notification']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'page_id' in params:
            path_params['page_id'] = params['page_id']  # noqa: E501
        if 'subscriber_id' in params:
            path_params['subscriber_id'] = params['subscriber_id']  # noqa: E501

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

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/pages/{page_id}/subscribers/{subscriber_id}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Subscriber',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_pages_page_id_subscribers(self, page_id, **kwargs):  # noqa: E501
        """Get a list of subscribers  # noqa: E501

        Get a list of subscribers  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_pages_page_id_subscribers(page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :param str q: If this is specified, search the contact information (email, endpoint, or phone number) for the provided value. This parameter doesn’t support searching for Slack subscribers.
        :param str type: If specified, only return subscribers of the indicated type.
        :param str state: If this is present, only return subscribers in this state. Specify state \"all\" to find subscribers in any states.
        :param int limit: The maximum number of rows to return. If a text query string is specified (q=), the default and maximum limit is 100. If the text query string is not specified, the default and maximum limit are not set, and not providing a limit will return all the subscribers. Beginning February 28, 2023, a default limit of 100 will be imposed and this endpoint will return paginated data (i.e. will no longer return all subscribers) even if this query parameter is not provided.
        :param int page: The page offset of subscribers. The first page is page 0, the second page 1, etc. This skips page * limit subscribers. Beginning February 28, 2023, this endpoint will return paginated data even if this query parameter is not provided.
        :param str sort_field: The field on which to sort: 'primary' to indicate sorting by the identifying field, 'created_at' for sorting by creation timestamp, 'quarantined_at' for sorting by quarantine timestamp, and 'relevance' which sorts by the relevancy of the search text. 'relevance' is not a valid parameter if no search text is supplied.
        :param str sort_direction: The sort direction of the listing.
        :return: list[Subscriber]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_pages_page_id_subscribers_with_http_info(page_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_pages_page_id_subscribers_with_http_info(page_id, **kwargs)  # noqa: E501
            return data

    def get_pages_page_id_subscribers_with_http_info(self, page_id, **kwargs):  # noqa: E501
        """Get a list of subscribers  # noqa: E501

        Get a list of subscribers  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_pages_page_id_subscribers_with_http_info(page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :param str q: If this is specified, search the contact information (email, endpoint, or phone number) for the provided value. This parameter doesn’t support searching for Slack subscribers.
        :param str type: If specified, only return subscribers of the indicated type.
        :param str state: If this is present, only return subscribers in this state. Specify state \"all\" to find subscribers in any states.
        :param int limit: The maximum number of rows to return. If a text query string is specified (q=), the default and maximum limit is 100. If the text query string is not specified, the default and maximum limit are not set, and not providing a limit will return all the subscribers. Beginning February 28, 2023, a default limit of 100 will be imposed and this endpoint will return paginated data (i.e. will no longer return all subscribers) even if this query parameter is not provided.
        :param int page: The page offset of subscribers. The first page is page 0, the second page 1, etc. This skips page * limit subscribers. Beginning February 28, 2023, this endpoint will return paginated data even if this query parameter is not provided.
        :param str sort_field: The field on which to sort: 'primary' to indicate sorting by the identifying field, 'created_at' for sorting by creation timestamp, 'quarantined_at' for sorting by quarantine timestamp, and 'relevance' which sorts by the relevancy of the search text. 'relevance' is not a valid parameter if no search text is supplied.
        :param str sort_direction: The sort direction of the listing.
        :return: list[Subscriber]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['page_id', 'q', 'type', 'state', 'limit', 'page', 'sort_field', 'sort_direction']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

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

        query_params = []
        if 'q' in params:
            query_params.append(('q', params['q']))  # noqa: E501
        if 'type' in params:
            query_params.append(('type', params['type']))  # noqa: E501
        if 'state' in params:
            query_params.append(('state', params['state']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501
        if 'sort_field' in params:
            query_params.append(('sort_field', params['sort_field']))  # noqa: E501
        if 'sort_direction' in params:
            query_params.append(('sort_direction', params['sort_direction']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/pages/{page_id}/subscribers', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[Subscriber]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_pages_page_id_subscribers_count(self, page_id, **kwargs):  # noqa: E501
        """Get a count of subscribers by type  # noqa: E501

        Get a count of subscribers by type  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_pages_page_id_subscribers_count(page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :param str type: If this is present, only count subscribers of this type.
        :param str state: If this is present, only count subscribers in this state. Specify state \"all\" to count subscribers in any states.
        :return: SubscriberCountByType
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_pages_page_id_subscribers_count_with_http_info(page_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_pages_page_id_subscribers_count_with_http_info(page_id, **kwargs)  # noqa: E501
            return data

    def get_pages_page_id_subscribers_count_with_http_info(self, page_id, **kwargs):  # noqa: E501
        """Get a count of subscribers by type  # noqa: E501

        Get a count of subscribers by type  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_pages_page_id_subscribers_count_with_http_info(page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :param str type: If this is present, only count subscribers of this type.
        :param str state: If this is present, only count subscribers in this state. Specify state \"all\" to count subscribers in any states.
        :return: SubscriberCountByType
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['page_id', 'type', 'state']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

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

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

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/pages/{page_id}/subscribers/count', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubscriberCountByType',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_pages_page_id_subscribers_histogram_by_state(self, page_id, **kwargs):  # noqa: E501
        """Get a histogram of subscribers by type and then state  # noqa: E501

        Get a histogram of subscribers by type and then state  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_pages_page_id_subscribers_histogram_by_state(page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :return: SubscriberCountByTypeAndState
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_pages_page_id_subscribers_histogram_by_state_with_http_info(page_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_pages_page_id_subscribers_histogram_by_state_with_http_info(page_id, **kwargs)  # noqa: E501
            return data

    def get_pages_page_id_subscribers_histogram_by_state_with_http_info(self, page_id, **kwargs):  # noqa: E501
        """Get a histogram of subscribers by type and then state  # noqa: E501

        Get a histogram of subscribers by type and then state  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_pages_page_id_subscribers_histogram_by_state_with_http_info(page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :return: SubscriberCountByTypeAndState
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/pages/{page_id}/subscribers/histogram_by_state', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SubscriberCountByTypeAndState',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_pages_page_id_subscribers_subscriber_id(self, page_id, subscriber_id, **kwargs):  # noqa: E501
        """Get a subscriber  # noqa: E501

        Get a subscriber  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_pages_page_id_subscribers_subscriber_id(page_id, subscriber_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :param str subscriber_id: Subscriber Identifier (required)
        :return: Subscriber
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_pages_page_id_subscribers_subscriber_id_with_http_info(page_id, subscriber_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_pages_page_id_subscribers_subscriber_id_with_http_info(page_id, subscriber_id, **kwargs)  # noqa: E501
            return data

    def get_pages_page_id_subscribers_subscriber_id_with_http_info(self, page_id, subscriber_id, **kwargs):  # noqa: E501
        """Get a subscriber  # noqa: E501

        Get a subscriber  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_pages_page_id_subscribers_subscriber_id_with_http_info(page_id, subscriber_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :param str subscriber_id: Subscriber Identifier (required)
        :return: Subscriber
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'page_id' in params:
            path_params['page_id'] = params['page_id']  # noqa: E501
        if 'subscriber_id' in params:
            path_params['subscriber_id'] = params['subscriber_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/pages/{page_id}/subscribers/{subscriber_id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Subscriber',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_pages_page_id_subscribers_unsubscribed(self, page_id, **kwargs):  # noqa: E501
        """Get a list of unsubscribed subscribers  # noqa: E501

        Get a list of unsubscribed subscribers  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_pages_page_id_subscribers_unsubscribed(page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :param int page: Page offset to fetch. Beginning February 28, 2023, this endpoint will return paginated data even if this query parameter is not provided.
        :param int per_page: Number of results to return per page. Beginning February 28, 2023, a default and maximum limit of 100 will be imposed and this endpoint will return paginated data even if this query parameter is not provided.
        :return: list[Subscriber]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_pages_page_id_subscribers_unsubscribed_with_http_info(page_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_pages_page_id_subscribers_unsubscribed_with_http_info(page_id, **kwargs)  # noqa: E501
            return data

    def get_pages_page_id_subscribers_unsubscribed_with_http_info(self, page_id, **kwargs):  # noqa: E501
        """Get a list of unsubscribed subscribers  # noqa: E501

        Get a list of unsubscribed subscribers  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_pages_page_id_subscribers_unsubscribed_with_http_info(page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :param int page: Page offset to fetch. Beginning February 28, 2023, this endpoint will return paginated data even if this query parameter is not provided.
        :param int per_page: Number of results to return per page. Beginning February 28, 2023, a default and maximum limit of 100 will be imposed and this endpoint will return paginated data even if this query parameter is not provided.
        :return: list[Subscriber]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['page_id', 'page', 'per_page']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

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

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

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/pages/{page_id}/subscribers/unsubscribed', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[Subscriber]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def patch_pages_page_id_subscribers_subscriber_id(self, body, page_id, subscriber_id, **kwargs):  # noqa: E501
        """Update a subscriber  # noqa: E501

        Update a subscriber  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.patch_pages_page_id_subscribers_subscriber_id(body, page_id, subscriber_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PatchPagesPageIdSubscribers body: (required)
        :param str page_id: Page identifier (required)
        :param str subscriber_id: Subscriber Identifier (required)
        :return: Subscriber
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.patch_pages_page_id_subscribers_subscriber_id_with_http_info(body, page_id, subscriber_id, **kwargs)  # noqa: E501
        else:
            (data) = self.patch_pages_page_id_subscribers_subscriber_id_with_http_info(body, page_id, subscriber_id, **kwargs)  # noqa: E501
            return data

    def patch_pages_page_id_subscribers_subscriber_id_with_http_info(self, body, page_id, subscriber_id, **kwargs):  # noqa: E501
        """Update a subscriber  # noqa: E501

        Update a subscriber  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.patch_pages_page_id_subscribers_subscriber_id_with_http_info(body, page_id, subscriber_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PatchPagesPageIdSubscribers body: (required)
        :param str page_id: Page identifier (required)
        :param str subscriber_id: Subscriber Identifier (required)
        :return: Subscriber
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'page_id' in params:
            path_params['page_id'] = params['page_id']  # noqa: E501
        if 'subscriber_id' in params:
            path_params['subscriber_id'] = params['subscriber_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

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

        return self.api_client.call_api(
            '/pages/{page_id}/subscribers/{subscriber_id}', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Subscriber',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def post_pages_page_id_subscribers(self, body, page_id, **kwargs):  # noqa: E501
        """Create a subscriber  # noqa: E501

        Create a subscriber. Not applicable for Slack subscribers.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_pages_page_id_subscribers(body, page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PostPagesPageIdSubscribers body: (required)
        :param str page_id: Page identifier (required)
        :return: Subscriber
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.post_pages_page_id_subscribers_with_http_info(body, page_id, **kwargs)  # noqa: E501
        else:
            (data) = self.post_pages_page_id_subscribers_with_http_info(body, page_id, **kwargs)  # noqa: E501
            return data

    def post_pages_page_id_subscribers_with_http_info(self, body, page_id, **kwargs):  # noqa: E501
        """Create a subscriber  # noqa: E501

        Create a subscriber. Not applicable for Slack subscribers.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_pages_page_id_subscribers_with_http_info(body, page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PostPagesPageIdSubscribers body: (required)
        :param str page_id: Page identifier (required)
        :return: Subscriber
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

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

        return self.api_client.call_api(
            '/pages/{page_id}/subscribers', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Subscriber',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def post_pages_page_id_subscribers_reactivate(self, body, page_id, **kwargs):  # noqa: E501
        """Reactivate a list of subscribers  # noqa: E501

        Reactivate a list of quarantined subscribers  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_pages_page_id_subscribers_reactivate(body, page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PostPagesPageIdSubscribersReactivate body: (required)
        :param str page_id: Page identifier (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.post_pages_page_id_subscribers_reactivate_with_http_info(body, page_id, **kwargs)  # noqa: E501
        else:
            (data) = self.post_pages_page_id_subscribers_reactivate_with_http_info(body, page_id, **kwargs)  # noqa: E501
            return data

    def post_pages_page_id_subscribers_reactivate_with_http_info(self, body, page_id, **kwargs):  # noqa: E501
        """Reactivate a list of subscribers  # noqa: E501

        Reactivate a list of quarantined subscribers  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_pages_page_id_subscribers_reactivate_with_http_info(body, page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PostPagesPageIdSubscribersReactivate body: (required)
        :param str page_id: Page identifier (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

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

        return self.api_client.call_api(
            '/pages/{page_id}/subscribers/reactivate', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def post_pages_page_id_subscribers_resend_confirmation(self, body, page_id, **kwargs):  # noqa: E501
        """Resend confirmations to a list of subscribers  # noqa: E501

        Resend confirmations to a list of subscribers  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_pages_page_id_subscribers_resend_confirmation(body, page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PostPagesPageIdSubscribersResendConfirmation body: (required)
        :param str page_id: Page identifier (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.post_pages_page_id_subscribers_resend_confirmation_with_http_info(body, page_id, **kwargs)  # noqa: E501
        else:
            (data) = self.post_pages_page_id_subscribers_resend_confirmation_with_http_info(body, page_id, **kwargs)  # noqa: E501
            return data

    def post_pages_page_id_subscribers_resend_confirmation_with_http_info(self, body, page_id, **kwargs):  # noqa: E501
        """Resend confirmations to a list of subscribers  # noqa: E501

        Resend confirmations to a list of subscribers  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_pages_page_id_subscribers_resend_confirmation_with_http_info(body, page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PostPagesPageIdSubscribersResendConfirmation body: (required)
        :param str page_id: Page identifier (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

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

        return self.api_client.call_api(
            '/pages/{page_id}/subscribers/resend_confirmation', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def post_pages_page_id_subscribers_subscriber_id_resend_confirmation(self, page_id, subscriber_id, **kwargs):  # noqa: E501
        """Resend confirmation to a subscriber  # noqa: E501

        Resend confirmation to a subscriber  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_pages_page_id_subscribers_subscriber_id_resend_confirmation(page_id, subscriber_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :param str subscriber_id: Subscriber Identifier (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.post_pages_page_id_subscribers_subscriber_id_resend_confirmation_with_http_info(page_id, subscriber_id, **kwargs)  # noqa: E501
        else:
            (data) = self.post_pages_page_id_subscribers_subscriber_id_resend_confirmation_with_http_info(page_id, subscriber_id, **kwargs)  # noqa: E501
            return data

    def post_pages_page_id_subscribers_subscriber_id_resend_confirmation_with_http_info(self, page_id, subscriber_id, **kwargs):  # noqa: E501
        """Resend confirmation to a subscriber  # noqa: E501

        Resend confirmation to a subscriber  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_pages_page_id_subscribers_subscriber_id_resend_confirmation_with_http_info(page_id, subscriber_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :param str subscriber_id: Subscriber Identifier (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

        path_params = {}
        if 'page_id' in params:
            path_params['page_id'] = params['page_id']  # noqa: E501
        if 'subscriber_id' in params:
            path_params['subscriber_id'] = params['subscriber_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/pages/{page_id}/subscribers/{subscriber_id}/resend_confirmation', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def post_pages_page_id_subscribers_unsubscribe(self, body, page_id, **kwargs):  # noqa: E501
        """Unsubscribe a list of subscribers  # noqa: E501

        Unsubscribe a list of subscribers  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_pages_page_id_subscribers_unsubscribe(body, page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PostPagesPageIdSubscribersUnsubscribe body: (required)
        :param str page_id: Page identifier (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.post_pages_page_id_subscribers_unsubscribe_with_http_info(body, page_id, **kwargs)  # noqa: E501
        else:
            (data) = self.post_pages_page_id_subscribers_unsubscribe_with_http_info(body, page_id, **kwargs)  # noqa: E501
            return data

    def post_pages_page_id_subscribers_unsubscribe_with_http_info(self, body, page_id, **kwargs):  # noqa: E501
        """Unsubscribe a list of subscribers  # noqa: E501

        Unsubscribe a list of subscribers  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_pages_page_id_subscribers_unsubscribe_with_http_info(body, page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PostPagesPageIdSubscribersUnsubscribe body: (required)
        :param str page_id: Page identifier (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

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

        return self.api_client.call_api(
            '/pages/{page_id}/subscribers/unsubscribe', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
