# coding: utf-8

"""
    Onshape REST API

    The Onshape REST API consumed by all clients.  # noqa: E501

    The version of the OpenAPI document: 1.104
    Contact: api-support@onshape.zendesk.com
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from onshape_client.oas.api_client import ApiClient
from onshape_client.oas.exceptions import (
    ApiTypeError,
    ApiValueError
)


class FeatureStudiosApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

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

    def create_feature_studio(self, did, wid, bt_model_element_params, **kwargs):  # noqa: E501
        """create_feature_studio  # 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_feature_studio(did, wid, bt_model_element_params, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str did: (required)
        :param str wid: (required)
        :param BTModelElementParams bt_model_element_params: (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.create_feature_studio_with_http_info(did, wid, bt_model_element_params, **kwargs)  # noqa: E501

    def create_feature_studio_with_http_info(self, did, wid, bt_model_element_params, **kwargs):  # noqa: E501
        """create_feature_studio  # 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_feature_studio_with_http_info(did, wid, bt_model_element_params, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str did: (required)
        :param str wid: (required)
        :param BTModelElementParams bt_model_element_params: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'wid', 'bt_model_element_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')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method create_feature_studio" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ApiValueError("Missing the required parameter `did` when calling `create_feature_studio`")  # noqa: E501
        # verify the required parameter 'wid' is set
        if ('wid' not in local_var_params or
                local_var_params['wid'] is None):
            raise ApiValueError("Missing the required parameter `wid` when calling `create_feature_studio`")  # noqa: E501
        # verify the required parameter 'bt_model_element_params' is set
        if ('bt_model_element_params' not in local_var_params or
                local_var_params['bt_model_element_params'] is None):
            raise ApiValueError("Missing the required parameter `bt_model_element_params` when calling `create_feature_studio`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'wid' in local_var_params:
            path_params['wid'] = local_var_params['wid']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'bt_model_element_params' in local_var_params:
            body_params = local_var_params['bt_model_element_params']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1', 'application/json;charset=UTF-8; qs=0.09'])  # noqa: E501

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

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

        return self.api_client.call_api(
            '/api/featurestudios/d/{did}/w/{wid}', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_feature_studio_contents(self, did, wvm, wvmid, eid, **kwargs):  # noqa: E501
        """Get Feature Studio Contents.  # 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_feature_studio_contents(did, wvm, wvmid, eid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str did: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str eid: (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: BTFeatureStudioContents
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.get_feature_studio_contents_with_http_info(did, wvm, wvmid, eid, **kwargs)  # noqa: E501

    def get_feature_studio_contents_with_http_info(self, did, wvm, wvmid, eid, **kwargs):  # noqa: E501
        """Get Feature Studio Contents.  # 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_feature_studio_contents_with_http_info(did, wvm, wvmid, eid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str did: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str eid: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(BTFeatureStudioContents, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'wvm', 'wvmid', 'eid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_feature_studio_contents" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ApiValueError("Missing the required parameter `did` when calling `get_feature_studio_contents`")  # noqa: E501
        # verify the required parameter 'wvm' is set
        if ('wvm' not in local_var_params or
                local_var_params['wvm'] is None):
            raise ApiValueError("Missing the required parameter `wvm` when calling `get_feature_studio_contents`")  # noqa: E501
        # verify the required parameter 'wvmid' is set
        if ('wvmid' not in local_var_params or
                local_var_params['wvmid'] is None):
            raise ApiValueError("Missing the required parameter `wvmid` when calling `get_feature_studio_contents`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ApiValueError("Missing the required parameter `eid` when calling `get_feature_studio_contents`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'wvm' in local_var_params:
            path_params['wvm'] = local_var_params['wvm']  # noqa: E501
        if 'wvmid' in local_var_params:
            path_params['wvmid'] = local_var_params['wvmid']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # 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/vnd.onshape.v1+json;charset=UTF-8;qs=0.1', 'application/json;charset=UTF-8; qs=0.09'])  # noqa: E501

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

        return self.api_client.call_api(
            '/api/featurestudios/d/{did}/{wvm}/{wvmid}/e/{eid}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BTFeatureStudioContents',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_feature_studio_specs(self, did, wvm, wvmid, eid, **kwargs):  # noqa: E501
        """get_feature_studio_specs  # 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_feature_studio_specs(did, wvm, wvmid, eid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str did: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str eid: (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.get_feature_studio_specs_with_http_info(did, wvm, wvmid, eid, **kwargs)  # noqa: E501

    def get_feature_studio_specs_with_http_info(self, did, wvm, wvmid, eid, **kwargs):  # noqa: E501
        """get_feature_studio_specs  # 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_feature_studio_specs_with_http_info(did, wvm, wvmid, eid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str did: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str eid: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'wvm', 'wvmid', 'eid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_feature_studio_specs" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ApiValueError("Missing the required parameter `did` when calling `get_feature_studio_specs`")  # noqa: E501
        # verify the required parameter 'wvm' is set
        if ('wvm' not in local_var_params or
                local_var_params['wvm'] is None):
            raise ApiValueError("Missing the required parameter `wvm` when calling `get_feature_studio_specs`")  # noqa: E501
        # verify the required parameter 'wvmid' is set
        if ('wvmid' not in local_var_params or
                local_var_params['wvmid'] is None):
            raise ApiValueError("Missing the required parameter `wvmid` when calling `get_feature_studio_specs`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ApiValueError("Missing the required parameter `eid` when calling `get_feature_studio_specs`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'wvm' in local_var_params:
            path_params['wvm'] = local_var_params['wvm']  # noqa: E501
        if 'wvmid' in local_var_params:
            path_params['wvmid'] = local_var_params['wvmid']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # 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/vnd.onshape.v1+json;charset=UTF-8;qs=0.1', 'application/json;charset=UTF-8; qs=0.09'])  # noqa: E501

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

        return self.api_client.call_api(
            '/api/featurestudios/d/{did}/{wvm}/{wvmid}/e/{eid}/featurespecs', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_feature_studio_contents(self, did, wvm, wvmid, eid, **kwargs):  # noqa: E501
        """update_feature_studio_contents  # 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_feature_studio_contents(did, wvm, wvmid, eid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str did: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str eid: (required)
        :param str body:
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.update_feature_studio_contents_with_http_info(did, wvm, wvmid, eid, **kwargs)  # noqa: E501

    def update_feature_studio_contents_with_http_info(self, did, wvm, wvmid, eid, **kwargs):  # noqa: E501
        """update_feature_studio_contents  # 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_feature_studio_contents_with_http_info(did, wvm, wvmid, eid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str did: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str eid: (required)
        :param str body:
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'wvm', 'wvmid', 'eid', 'body']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method update_feature_studio_contents" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ApiValueError("Missing the required parameter `did` when calling `update_feature_studio_contents`")  # noqa: E501
        # verify the required parameter 'wvm' is set
        if ('wvm' not in local_var_params or
                local_var_params['wvm'] is None):
            raise ApiValueError("Missing the required parameter `wvm` when calling `update_feature_studio_contents`")  # noqa: E501
        # verify the required parameter 'wvmid' is set
        if ('wvmid' not in local_var_params or
                local_var_params['wvmid'] is None):
            raise ApiValueError("Missing the required parameter `wvmid` when calling `update_feature_studio_contents`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ApiValueError("Missing the required parameter `eid` when calling `update_feature_studio_contents`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'wvm' in local_var_params:
            path_params['wvm'] = local_var_params['wvm']  # noqa: E501
        if 'wvmid' in local_var_params:
            path_params['wvmid'] = local_var_params['wvmid']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in local_var_params:
            body_params = local_var_params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1', 'application/json;charset=UTF-8; qs=0.09'])  # noqa: E501

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

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

        return self.api_client.call_api(
            '/api/featurestudios/d/{did}/{wvm}/{wvmid}/e/{eid}', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)
