# coding: utf-8

"""
    Seeq REST API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

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

from __future__ import absolute_import

import sys
import os
import re

from deprecated import deprecated
# python 2 and python 3 compatibility library
from six import iteritems

from ..configuration import Configuration
from ..api_client import ApiClient
from ..models import *

class HierarchiesApi(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):
        config = Configuration()
        if api_client:
            self.api_client = api_client
        else:
            if not config.api_client:
                config.api_client = ApiClient()
            self.api_client = config.api_client

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def create_hierarchy(self, **kwargs):
        """
        Create a new hierarchy from an Item Table. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.create_hierarchy(body=body_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param HierarchyInputV1 body: (required)
        :return: HierarchyOutputV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyOutputV1
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.create_hierarchy_with_http_info(**kwargs)
        else:
            (data) = self.create_hierarchy_with_http_info(**kwargs)
            return data

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def create_hierarchy_with_http_info(self, **kwargs):
        """
        Create a new hierarchy from an Item Table. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.create_hierarchy_with_http_info(body=body_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param HierarchyInputV1 body: (required)
        :return: HierarchyOutputV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyOutputV1
        """

        all_params = ['body']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        all_params.append('_response_type')
        all_params.append('_custom_headers')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method create_hierarchy" % 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 `create_hierarchy`")


        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        for key, value in params.get('_custom_headers', {}).items():
            header_params[key] = value


        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/vnd.seeq.v1+json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/vnd.seeq.v1+json', ])

        # Authentication setting
        auth_settings = ['api_key']

        return self.api_client.call_api('/hierarchies', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=params.get('_response_type', 'HierarchyOutputV1'),
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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)

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def get_hierarchies(self, **kwargs):
        """
        Get a list of hierarchies. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_hierarchies(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int offset: The pagination offset, the index of the first item that will be returned in this page of results
        :param int limit: The pagination limit, the total number of hierarchies that will be returned in this page of results
        :param str table_definition_id: ID of the table definition that the hierarchy is created from
        :return: HierarchyOutputListV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyOutputListV1
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_hierarchies_with_http_info(**kwargs)
        else:
            (data) = self.get_hierarchies_with_http_info(**kwargs)
            return data

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def get_hierarchies_with_http_info(self, **kwargs):
        """
        Get a list of hierarchies. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_hierarchies_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int offset: The pagination offset, the index of the first item that will be returned in this page of results
        :param int limit: The pagination limit, the total number of hierarchies that will be returned in this page of results
        :param str table_definition_id: ID of the table definition that the hierarchy is created from
        :return: HierarchyOutputListV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyOutputListV1
        """

        all_params = ['offset', 'limit', 'table_definition_id']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        all_params.append('_response_type')
        all_params.append('_custom_headers')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_hierarchies" % key
                )
            params[key] = val
        del params['kwargs']


        collection_formats = {}

        path_params = {}

        query_params = []
        if 'offset' in params:
            query_params.append(('offset', params['offset']))
        if 'limit' in params:
            query_params.append(('limit', params['limit']))
        if 'table_definition_id' in params:
            query_params.append(('tableDefinitionId', params['table_definition_id']))

        header_params = {}

        for key, value in params.get('_custom_headers', {}).items():
            header_params[key] = value


        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/vnd.seeq.v1+json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/vnd.seeq.v1+json', ])

        # Authentication setting
        auth_settings = ['api_key']

        return self.api_client.call_api('/hierarchies', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=params.get('_response_type', 'HierarchyOutputListV1'),
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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)

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def get_hierarchy(self, **kwargs):
        """
        Get a hierarchy by ID. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_hierarchy(id=id_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of the hierarchy (required)
        :return: HierarchyOutputV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyOutputV1
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_hierarchy_with_http_info(**kwargs)
        else:
            (data) = self.get_hierarchy_with_http_info(**kwargs)
            return data

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def get_hierarchy_with_http_info(self, **kwargs):
        """
        Get a hierarchy by ID. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_hierarchy_with_http_info(id=id_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of the hierarchy (required)
        :return: HierarchyOutputV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyOutputV1
        """

        all_params = ['id']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        all_params.append('_response_type')
        all_params.append('_custom_headers')

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


        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = []

        header_params = {}

        for key, value in params.get('_custom_headers', {}).items():
            header_params[key] = value


        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/vnd.seeq.v1+json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/vnd.seeq.v1+json', ])

        # Authentication setting
        auth_settings = ['api_key']

        return self.api_client.call_api('/hierarchies/{id}', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=params.get('_response_type', 'HierarchyOutputV1'),
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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)

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def get_hierarchy_nodes(self, **kwargs):
        """
        Get nodes in a hierarchy by ID. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_hierarchy_nodes(id=id_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of the hierarchy (required)
        :param list[str] column_ids:
        :param list[str] column_values:
        :return: HierarchyNodeOutputListV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyNodeOutputListV1
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_hierarchy_nodes_with_http_info(**kwargs)
        else:
            (data) = self.get_hierarchy_nodes_with_http_info(**kwargs)
            return data

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def get_hierarchy_nodes_with_http_info(self, **kwargs):
        """
        Get nodes in a hierarchy by ID. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_hierarchy_nodes_with_http_info(id=id_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of the hierarchy (required)
        :param list[str] column_ids:
        :param list[str] column_values:
        :return: HierarchyNodeOutputListV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyNodeOutputListV1
        """

        all_params = ['id', 'column_ids', 'column_values']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        all_params.append('_response_type')
        all_params.append('_custom_headers')

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


        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = []
        if 'column_ids' in params:
            query_params.append(('columnIds', params['column_ids']))
            collection_formats['columnIds'] = 'multi'
        if 'column_values' in params:
            query_params.append(('columnValues', params['column_values']))
            collection_formats['columnValues'] = 'multi'

        header_params = {}

        for key, value in params.get('_custom_headers', {}).items():
            header_params[key] = value


        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/vnd.seeq.v1+json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/vnd.seeq.v1+json', ])

        # Authentication setting
        auth_settings = ['api_key']

        return self.api_client.call_api('/hierarchies/{id}/nodes', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=params.get('_response_type', 'HierarchyNodeOutputListV1'),
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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)

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def search_hierarchy_node(self, **kwargs):
        """
        Search for a hierarchy node with path nodes from a scaling table row reference. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.search_hierarchy_node(scaling_table_id=scaling_table_id_value, item_id=item_id_value, row_item_id=row_item_id_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str scaling_table_id: The ID of the Scaling Table being searched (required)
        :param str item_id: The ID of the item being searched for (required)
        :param str row_item_id: The ID the item that identifies the row of a Scaling Table (required)
        :param str row_datum_id: The datum ID that along with 'rowItemId' identifies the row of a Scaling Table
        :return: HierarchyNodeWithPathOutputV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyNodeWithPathOutputV1
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.search_hierarchy_node_with_http_info(**kwargs)
        else:
            (data) = self.search_hierarchy_node_with_http_info(**kwargs)
            return data

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def search_hierarchy_node_with_http_info(self, **kwargs):
        """
        Search for a hierarchy node with path nodes from a scaling table row reference. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.search_hierarchy_node_with_http_info(scaling_table_id=scaling_table_id_value, item_id=item_id_value, row_item_id=row_item_id_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str scaling_table_id: The ID of the Scaling Table being searched (required)
        :param str item_id: The ID of the item being searched for (required)
        :param str row_item_id: The ID the item that identifies the row of a Scaling Table (required)
        :param str row_datum_id: The datum ID that along with 'rowItemId' identifies the row of a Scaling Table
        :return: HierarchyNodeWithPathOutputV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyNodeWithPathOutputV1
        """

        all_params = ['scaling_table_id', 'item_id', 'row_item_id', 'row_datum_id']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        all_params.append('_response_type')
        all_params.append('_custom_headers')

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


        collection_formats = {}

        path_params = {}

        query_params = []
        if 'scaling_table_id' in params:
            query_params.append(('scalingTableId', params['scaling_table_id']))
        if 'item_id' in params:
            query_params.append(('itemId', params['item_id']))
        if 'row_item_id' in params:
            query_params.append(('rowItemId', params['row_item_id']))
        if 'row_datum_id' in params:
            query_params.append(('rowDatumId', params['row_datum_id']))

        header_params = {}

        for key, value in params.get('_custom_headers', {}).items():
            header_params[key] = value


        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/vnd.seeq.v1+json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/vnd.seeq.v1+json', ])

        # Authentication setting
        auth_settings = ['api_key']

        return self.api_client.call_api('/hierarchies/node/search', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=params.get('_response_type', 'HierarchyNodeWithPathOutputV1'),
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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)

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def update_hierarchy(self, **kwargs):
        """
        Update a hierarchy. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.update_hierarchy(body=body_value, id=id_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param HierarchyInputV1 body: (required)
        :param str id: The Seeq ID for the hierarchy (required)
        :return: HierarchyOutputV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyOutputV1
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.update_hierarchy_with_http_info(**kwargs)
        else:
            (data) = self.update_hierarchy_with_http_info(**kwargs)
            return data

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def update_hierarchy_with_http_info(self, **kwargs):
        """
        Update a hierarchy. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.update_hierarchy_with_http_info(body=body_value, id=id_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param HierarchyInputV1 body: (required)
        :param str id: The Seeq ID for the hierarchy (required)
        :return: HierarchyOutputV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyOutputV1
        """

        all_params = ['body', 'id']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        all_params.append('_response_type')
        all_params.append('_custom_headers')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method update_hierarchy" % 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 `update_hierarchy`")
        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `update_hierarchy`")


        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = []

        header_params = {}

        for key, value in params.get('_custom_headers', {}).items():
            header_params[key] = value


        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/vnd.seeq.v1+json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/vnd.seeq.v1+json', ])

        # Authentication setting
        auth_settings = ['api_key']

        return self.api_client.call_api('/hierarchies/{id}', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=params.get('_response_type', 'HierarchyOutputV1'),
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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)

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def validate_hierarchy(self, **kwargs):
        """
        Validate a hierarchy by ID. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.validate_hierarchy(id=id_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of the hierarchy (required)
        :return: HierarchyValidationOutputV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyValidationOutputV1
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.validate_hierarchy_with_http_info(**kwargs)
        else:
            (data) = self.validate_hierarchy_with_http_info(**kwargs)
            return data

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def validate_hierarchy_with_http_info(self, **kwargs):
        """
        Validate a hierarchy by ID. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.validate_hierarchy_with_http_info(id=id_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of the hierarchy (required)
        :return: HierarchyValidationOutputV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyValidationOutputV1
        """

        all_params = ['id']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        all_params.append('_response_type')
        all_params.append('_custom_headers')

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


        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = []

        header_params = {}

        for key, value in params.get('_custom_headers', {}).items():
            header_params[key] = value


        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/vnd.seeq.v1+json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/vnd.seeq.v1+json', ])

        # Authentication setting
        auth_settings = ['api_key']

        return self.api_client.call_api('/hierarchies/{id}/validate', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=params.get('_response_type', 'HierarchyValidationOutputV1'),
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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)

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def validate_hierarchy_input(self, **kwargs):
        """
        Validate a hierarchy configuration. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.validate_hierarchy_input(body=body_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param HierarchyInputV1 body: (required)
        :return: HierarchyValidationOutputV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyValidationOutputV1
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.validate_hierarchy_input_with_http_info(**kwargs)
        else:
            (data) = self.validate_hierarchy_input_with_http_info(**kwargs)
            return data

    @deprecated(reason="This API is experimental and may change or be removed in future releases without prior notice.")
    def validate_hierarchy_input_with_http_info(self, **kwargs):
        """
        Validate a hierarchy configuration. This endpoint is experimental and may change in future releases.
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.validate_hierarchy_input_with_http_info(body=body_value, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param HierarchyInputV1 body: (required)
        :return: HierarchyValidationOutputV1
                 If the method is called asynchronously,
                 returns the request thread.
        :rtype: HierarchyValidationOutputV1
        """

        all_params = ['body']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')
        all_params.append('_response_type')
        all_params.append('_custom_headers')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method validate_hierarchy_input" % 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 `validate_hierarchy_input`")


        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        for key, value in params.get('_custom_headers', {}).items():
            header_params[key] = value


        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/vnd.seeq.v1+json'])

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/vnd.seeq.v1+json', ])

        # Authentication setting
        auth_settings = ['api_key']

        return self.api_client.call_api('/hierarchies/validate', 'POST',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type=params.get('_response_type', 'HierarchyValidationOutputV1'),
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _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)
