# coding: utf-8

"""
    Abstract API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # 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 enigma.swagger_client.api_client import ApiClient


class SnapshotApi(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 api_snapshots_snapshot_id_delete(self, snapshot_id, **kwargs):  # noqa: E501
        """api_snapshots_snapshot_id_delete  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_=True
        >>> thread = api.api_snapshots_snapshot_id_delete(snapshot_id, async_=True)
        >>> result = thread.get()

        :param async_ bool
        :param str snapshot_id: (required)
        :return: Snapshot
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_'):
            return self.api_snapshots_snapshot_id_delete_with_http_info(snapshot_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_snapshots_snapshot_id_delete_with_http_info(snapshot_id, **kwargs)  # noqa: E501
            return data

    def api_snapshots_snapshot_id_delete_with_http_info(self, snapshot_id, **kwargs):  # noqa: E501
        """api_snapshots_snapshot_id_delete  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_=True
        >>> thread = api.api_snapshots_snapshot_id_delete_with_http_info(snapshot_id, async_=True)
        >>> result = thread.get()

        :param async_ bool
        :param str snapshot_id: (required)
        :return: Snapshot
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['snapshot_id']  # noqa: E501
        all_params.append('async_')
        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 api_snapshots_snapshot_id_delete" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'snapshot_id' is set
        if ('snapshot_id' not in params or
                params['snapshot_id'] is None):
            raise ValueError("Missing the required parameter `snapshot_id` when calling `api_snapshots_snapshot_id_delete`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/snapshots/{snapshot_id}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Snapshot',  # noqa: E501
            auth_settings=auth_settings,
            async_=params.get('async_'),
            _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 api_snapshots_snapshot_id_get(self, snapshot_id, **kwargs):  # noqa: E501
        """api_snapshots_snapshot_id_get  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_=True
        >>> thread = api.api_snapshots_snapshot_id_get(snapshot_id, async_=True)
        >>> result = thread.get()

        :param async_ bool
        :param str snapshot_id: (required)
        :param str geo_query:
        :param bool highlight:
        :param bool include_serialids:
        :param int phrase_distance:
        :param str query:
        :param str query_mode:
        :param int row_limit:
        :param int row_offset:
        :param str row_sort:
        :param bool stats:
        :return: Snapshot
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_'):
            return self.api_snapshots_snapshot_id_get_with_http_info(snapshot_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_snapshots_snapshot_id_get_with_http_info(snapshot_id, **kwargs)  # noqa: E501
            return data

    def api_snapshots_snapshot_id_get_with_http_info(self, snapshot_id, **kwargs):  # noqa: E501
        """api_snapshots_snapshot_id_get  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_=True
        >>> thread = api.api_snapshots_snapshot_id_get_with_http_info(snapshot_id, async_=True)
        >>> result = thread.get()

        :param async_ bool
        :param str snapshot_id: (required)
        :param str geo_query:
        :param bool highlight:
        :param bool include_serialids:
        :param int phrase_distance:
        :param str query:
        :param str query_mode:
        :param int row_limit:
        :param int row_offset:
        :param str row_sort:
        :param bool stats:
        :return: Snapshot
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['snapshot_id', 'geo_query', 'highlight', 'include_serialids', 'phrase_distance', 'query', 'query_mode', 'row_limit', 'row_offset', 'row_sort', 'stats']  # noqa: E501
        all_params.append('async_')
        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 api_snapshots_snapshot_id_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'snapshot_id' is set
        if ('snapshot_id' not in params or
                params['snapshot_id'] is None):
            raise ValueError("Missing the required parameter `snapshot_id` when calling `api_snapshots_snapshot_id_get`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'geo_query' in params:
            query_params.append(('geo_query', params['geo_query']))  # noqa: E501
        if 'highlight' in params:
            query_params.append(('highlight', params['highlight']))  # noqa: E501
        if 'include_serialids' in params:
            query_params.append(('include_serialids', params['include_serialids']))  # noqa: E501
        if 'phrase_distance' in params:
            query_params.append(('phrase_distance', params['phrase_distance']))  # noqa: E501
        if 'query' in params:
            query_params.append(('query', params['query']))  # noqa: E501
        if 'query_mode' in params:
            query_params.append(('query_mode', params['query_mode']))  # noqa: E501
        if 'row_limit' in params:
            query_params.append(('row_limit', params['row_limit']))  # noqa: E501
        if 'row_offset' in params:
            query_params.append(('row_offset', params['row_offset']))  # noqa: E501
        if 'row_sort' in params:
            query_params.append(('row_sort', params['row_sort']))  # noqa: E501
        if 'stats' in params:
            query_params.append(('stats', params['stats']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/snapshots/{snapshot_id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Snapshot',  # noqa: E501
            auth_settings=auth_settings,
            async_=params.get('async_'),
            _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 api_snapshots_snapshot_id_put(self, snapshot_id, **kwargs):  # noqa: E501
        """api_snapshots_snapshot_id_put  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_=True
        >>> thread = api.api_snapshots_snapshot_id_put(snapshot_id, async_=True)
        >>> result = thread.get()

        :param async_ bool
        :param str snapshot_id: (required)
        :param Body9 body:
        :return: Snapshot
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_'):
            return self.api_snapshots_snapshot_id_put_with_http_info(snapshot_id, **kwargs)  # noqa: E501
        else:
            (data) = self.api_snapshots_snapshot_id_put_with_http_info(snapshot_id, **kwargs)  # noqa: E501
            return data

    def api_snapshots_snapshot_id_put_with_http_info(self, snapshot_id, **kwargs):  # noqa: E501
        """api_snapshots_snapshot_id_put  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_=True
        >>> thread = api.api_snapshots_snapshot_id_put_with_http_info(snapshot_id, async_=True)
        >>> result = thread.get()

        :param async_ bool
        :param str snapshot_id: (required)
        :param Body9 body:
        :return: Snapshot
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['snapshot_id', 'body']  # noqa: E501
        all_params.append('async_')
        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 api_snapshots_snapshot_id_put" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'snapshot_id' is set
        if ('snapshot_id' not in params or
                params['snapshot_id'] is None):
            raise ValueError("Missing the required parameter `snapshot_id` when calling `api_snapshots_snapshot_id_put`")  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/snapshots/{snapshot_id}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Snapshot',  # noqa: E501
            auth_settings=auth_settings,
            async_=params.get('async_'),
            _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)
