# 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 StatusEmbedConfigApi(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 get_pages_page_id_status_embed_config(self, page_id, **kwargs):  # noqa: E501
        """Get status embed config settings  # noqa: E501

        Get status embed config settings  # 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_status_embed_config(page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :return: StatusEmbedConfig
                 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_status_embed_config_with_http_info(page_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_pages_page_id_status_embed_config_with_http_info(page_id, **kwargs)  # noqa: E501
            return data

    def get_pages_page_id_status_embed_config_with_http_info(self, page_id, **kwargs):  # noqa: E501
        """Get status embed config settings  # noqa: E501

        Get status embed config settings  # 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_status_embed_config_with_http_info(page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str page_id: Page identifier (required)
        :return: StatusEmbedConfig
                 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_status_embed_config" % 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_status_embed_config`")  # 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}/status_embed_config', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='StatusEmbedConfig',  # 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_status_embed_config(self, body, page_id, **kwargs):  # noqa: E501
        """Update status embed config settings  # noqa: E501

        Update status embed config settings  # 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_status_embed_config(body, page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PatchPagesPageIdStatusEmbedConfig body: (required)
        :param str page_id: Page identifier (required)
        :return: StatusEmbedConfig
                 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_status_embed_config_with_http_info(body, page_id, **kwargs)  # noqa: E501
        else:
            (data) = self.patch_pages_page_id_status_embed_config_with_http_info(body, page_id, **kwargs)  # noqa: E501
            return data

    def patch_pages_page_id_status_embed_config_with_http_info(self, body, page_id, **kwargs):  # noqa: E501
        """Update status embed config settings  # noqa: E501

        Update status embed config settings  # 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_status_embed_config_with_http_info(body, page_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param PatchPagesPageIdStatusEmbedConfig body: (required)
        :param str page_id: Page identifier (required)
        :return: StatusEmbedConfig
                 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 patch_pages_page_id_status_embed_config" % 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_status_embed_config`")  # 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_status_embed_config`")  # 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}/status_embed_config', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='StatusEmbedConfig',  # 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 put_pages_page_id_status_embed_config(self, body, page_id, **kwargs):  # noqa: E501
        """Update status embed config settings  # noqa: E501

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

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

    def put_pages_page_id_status_embed_config_with_http_info(self, body, page_id, **kwargs):  # noqa: E501
        """Update status embed config settings  # noqa: E501

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

        :param async_req bool
        :param PutPagesPageIdStatusEmbedConfig body: (required)
        :param str page_id: Page identifier (required)
        :return: StatusEmbedConfig
                 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 put_pages_page_id_status_embed_config" % 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 `put_pages_page_id_status_embed_config`")  # 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 `put_pages_page_id_status_embed_config`")  # 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}/status_embed_config', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='StatusEmbedConfig',  # 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)
