# coding: utf-8

"""
    Zadara VPSA Storage Array REST API

     # Overview  This document outlines the methods available for administrating your Zadara Storage VPSA&#8482;. The Zadara Storage Array REST API   supports form-encoded, JSON, and XML requests, and can return either JSON or XML responses.  ## Usage  The majority of the APIs available require authentication which requires an API token to use. You can retrieve this token through the   Users section of your VPSA, or through the API using the \"Return a user's access key\" API in the Users Section below.  ## Authentication Methods  The authentication token can be passed either through the access_key parameter inside of the body of the REST API request, or   through the X-Access-Key header.  ## Timeouts  By default, all operations that don't complete within five seconds will return a message informing you that the action may take some  time to complete. When using the API, this can cause some actions, such as large volume creation, to be undesirably asynchronous.  You can specify your own timeout with the timeout parameter, in seconds, and a timeout value of -1 specifies an infinite timeout.  ## Specific Fields For Product  Some of the fields/actions used in the API should be used only for a specific product. The following tags are used to mark which   product responds to the fields/actions  VPSA Flash Array  VPSA Storage Array - Hybrid VPSA  ## Questions  If you have any questions or need support involving the REST API, please contact for assistance.   # noqa: E501

    OpenAPI spec version: 23.03-sp1
    Contact: support@zadarastorage.com
    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 Vpsa.api_client import ApiClient


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

        Create a new file lifecycle category with its file extensions.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_category(create_category, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CreateCategory create_category: (required)
        :return: InlineResponse20041
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_category_with_http_info(create_category, **kwargs)  # noqa: E501
        else:
            (data) = self.create_category_with_http_info(create_category, **kwargs)  # noqa: E501
            return data

    def create_category_with_http_info(self, create_category, **kwargs):  # noqa: E501
        """create_category  # noqa: E501

        Create a new file lifecycle category with its file extensions.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_category_with_http_info(create_category, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param CreateCategory create_category: (required)
        :return: InlineResponse20041
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/flc/create_category.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20041',  # 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 delete_category(self, delete_category, **kwargs):  # noqa: E501
        """delete_category  # noqa: E501

        Delete a file lifecycle category.  # 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_category(delete_category, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param DeleteCategory delete_category: (required)
        :return: InlineResponse20044
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.delete_category_with_http_info(delete_category, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_category_with_http_info(delete_category, **kwargs)  # noqa: E501
            return data

    def delete_category_with_http_info(self, delete_category, **kwargs):  # noqa: E501
        """delete_category  # noqa: E501

        Delete a file lifecycle category.  # 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_category_with_http_info(delete_category, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param DeleteCategory delete_category: (required)
        :return: InlineResponse20044
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/flc/delete_category.json', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20044',  # 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_all_categories(self, **kwargs):  # noqa: E501
        """get_all_categories  # noqa: E501

        Show file lifecycle categories and their file extensions.  # 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_all_categories(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: InlineResponse20040
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_all_categories_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_all_categories_with_http_info(**kwargs)  # noqa: E501
            return data

    def get_all_categories_with_http_info(self, **kwargs):  # noqa: E501
        """get_all_categories  # noqa: E501

        Show file lifecycle categories and their file extensions.  # 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_all_categories_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: InlineResponse20040
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []  # 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_all_categories" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        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', 'application/xml'])  # noqa: E501

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

        return self.api_client.call_api(
            '/flc/categories_settings.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20040',  # 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_flc_data(self, resources, **kwargs):  # noqa: E501
        """get_flc_data  # noqa: E501

        get flc data.  # 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_flc_data(resources, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str resources: The resources_str is json string in the format:{chart_name:{name:<name>,type:<type>}} (required)
        :param int interval: The interval between data points, in seconds
        :param int count:
        :return: InlineResponse20045
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_flc_data_with_http_info(resources, **kwargs)  # noqa: E501
        else:
            (data) = self.get_flc_data_with_http_info(resources, **kwargs)  # noqa: E501
            return data

    def get_flc_data_with_http_info(self, resources, **kwargs):  # noqa: E501
        """get_flc_data  # noqa: E501

        get flc data.  # 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_flc_data_with_http_info(resources, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str resources: The resources_str is json string in the format:{chart_name:{name:<name>,type:<type>}} (required)
        :param int interval: The interval between data points, in seconds
        :param int count:
        :return: InlineResponse20045
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['resources', 'interval', 'count']  # 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_flc_data" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'resources' is set
        if self.api_client.client_side_validation and ('resources' not in params or
                                                       params['resources'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `resources` when calling `get_flc_data`")  # noqa: E501

        if self.api_client.client_side_validation and ('interval' in params and params['interval'] < 1):  # noqa: E501
            raise ValueError("Invalid value for parameter `interval` when calling `get_flc_data`, must be a value greater than or equal to `1`")  # noqa: E501
        if self.api_client.client_side_validation and ('count' in params and params['count'] < 1):  # noqa: E501
            raise ValueError("Invalid value for parameter `count` when calling `get_flc_data`, must be a value greater than or equal to `1`")  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'interval' in params:
            query_params.append(('interval', params['interval']))  # noqa: E501
        if 'resources' in params:
            query_params.append(('resources', params['resources']))  # noqa: E501
        if 'count' in params:
            query_params.append(('count', params['count']))  # 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', 'application/xml'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/flc/flc_data.json', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20045',  # 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 rename_category(self, rename_category, **kwargs):  # noqa: E501
        """rename_category  # noqa: E501

        Rename an existing file lifecycle category.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rename_category(rename_category, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param RenameCategory rename_category: (required)
        :return: InlineResponse20043
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.rename_category_with_http_info(rename_category, **kwargs)  # noqa: E501
        else:
            (data) = self.rename_category_with_http_info(rename_category, **kwargs)  # noqa: E501
            return data

    def rename_category_with_http_info(self, rename_category, **kwargs):  # noqa: E501
        """rename_category  # noqa: E501

        Rename an existing file lifecycle category.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.rename_category_with_http_info(rename_category, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param RenameCategory rename_category: (required)
        :return: InlineResponse20043
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/flc/rename_category.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20043',  # 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 update_category(self, update_category, **kwargs):  # noqa: E501
        """update_category  # noqa: E501

        Update an existing file lifecycle category to change its file extensions.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_category(update_category, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param UpdateCategory update_category: (required)
        :return: InlineResponse20042
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_category_with_http_info(update_category, **kwargs)  # noqa: E501
        else:
            (data) = self.update_category_with_http_info(update_category, **kwargs)  # noqa: E501
            return data

    def update_category_with_http_info(self, update_category, **kwargs):  # noqa: E501
        """update_category  # noqa: E501

        Update an existing file lifecycle category to change its file extensions.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_category_with_http_info(update_category, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param UpdateCategory update_category: (required)
        :return: InlineResponse20042
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/flc/update_category.json', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='InlineResponse20042',  # 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)
