"""
    Onshape REST API

    The Onshape REST API consumed by all client. # Authorization The simplest way to authorize and enable the **Try it out** functionality is to sign in to Onshape and use the current session. The **Authorize** button enables other authorization techniques. To ensure the current session isn't used when trying other authentication techniques, make sure to remove the Onshape cookie as per the instructions for your particular browser. Alternatively, a private or incognito window may be used. Here's [how to remove a specific cookie on Chrome](https://support.google.com/chrome/answer/95647#zippy=%2Cdelete-cookies-from-a-site). - **Current Session** authorization is enabled by default if the browser is already signed in to [Onshape](/). - **OAuth2** authorization uses an Onshape OAuth2 app created on the [Onshape Developer Portal](https://dev-portal.onshape.com/oauthApps). The redirect URL field should include `https://cad.onshape.com/glassworks/explorer/oauth2-redirect.html`. - **API Key** authorization using basic authentication is also available. The keys can be generated in the [Onshape Developer Portal](https://dev-portal.onshape.com/keys). In the authentication dialog, enter the access key in the `Username` field, and enter the secret key in the `Password` field. Basic authentication should only be used during the development process since sharing API Keys provides the same level of access as a username and password.  # noqa: E501

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


import re  # noqa: F401
import sys  # noqa: F401

from onshape_client.oas.api_client import ApiClient, Endpoint as _Endpoint
from onshape_client.oas.model_utils import (  # noqa: F401
    check_allowed_values,
    check_validations,
    date,
    datetime,
    file_type,
    none_type,
    validate_and_convert_types
)
from onshape_client.oas.model.bt_list_response_bt_insertable_info import BTListResponseBTInsertableInfo


class InsertableApi(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
        self.get_latest_in_document_endpoint = _Endpoint(
            settings={
                'response_type': (BTListResponseBTInsertableInfo,),
                'auth': [
                    'BasicAuth',
                    'OAuth2'
                ],
                'endpoint_path': '/insertables/d/{did}/latest',
                'operation_id': 'get_latest_in_document',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'did',
                    'beta_capability_ids',
                    'include_parts',
                    'include_surfaces',
                    'include_sketches',
                    'include_reference_features',
                    'include_assemblies',
                    'include_feature_studios',
                    'include_blobs',
                    'allowed_blob_mime_types',
                    'exclude_newer_fs_versions',
                    'max_feature_script_version',
                    'include_part_studios',
                    'include_features',
                    'include_meshes',
                    'include_wires',
                    'include_flattened_bodies',
                    'include_applications',
                    'allowed_application_mime_types',
                    'include_composite_parts',
                    'include_fs_tables',
                    'include_fs_computed_part_property_functions',
                    'include_variables',
                    'include_variable_studios',
                ],
                'required': [
                    'did',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                    'beta_capability_ids',
                ]
            },
            root_map={
                'validations': {
                    ('beta_capability_ids',): {

                    },
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'did':
                        (str,),
                    'beta_capability_ids':
                        ([str],),
                    'include_parts':
                        (bool,),
                    'include_surfaces':
                        (bool,),
                    'include_sketches':
                        (bool,),
                    'include_reference_features':
                        (bool,),
                    'include_assemblies':
                        (bool,),
                    'include_feature_studios':
                        (bool,),
                    'include_blobs':
                        (bool,),
                    'allowed_blob_mime_types':
                        (str,),
                    'exclude_newer_fs_versions':
                        (bool,),
                    'max_feature_script_version':
                        (int,),
                    'include_part_studios':
                        (bool,),
                    'include_features':
                        (bool,),
                    'include_meshes':
                        (bool,),
                    'include_wires':
                        (bool,),
                    'include_flattened_bodies':
                        (bool,),
                    'include_applications':
                        (bool,),
                    'allowed_application_mime_types':
                        (str,),
                    'include_composite_parts':
                        (bool,),
                    'include_fs_tables':
                        (bool,),
                    'include_fs_computed_part_property_functions':
                        (bool,),
                    'include_variables':
                        (bool,),
                    'include_variable_studios':
                        (bool,),
                },
                'attribute_map': {
                    'did': 'did',
                    'beta_capability_ids': 'betaCapabilityIds',
                    'include_parts': 'includeParts',
                    'include_surfaces': 'includeSurfaces',
                    'include_sketches': 'includeSketches',
                    'include_reference_features': 'includeReferenceFeatures',
                    'include_assemblies': 'includeAssemblies',
                    'include_feature_studios': 'includeFeatureStudios',
                    'include_blobs': 'includeBlobs',
                    'allowed_blob_mime_types': 'allowedBlobMimeTypes',
                    'exclude_newer_fs_versions': 'excludeNewerFSVersions',
                    'max_feature_script_version': 'maxFeatureScriptVersion',
                    'include_part_studios': 'includePartStudios',
                    'include_features': 'includeFeatures',
                    'include_meshes': 'includeMeshes',
                    'include_wires': 'includeWires',
                    'include_flattened_bodies': 'includeFlattenedBodies',
                    'include_applications': 'includeApplications',
                    'allowed_application_mime_types': 'allowedApplicationMimeTypes',
                    'include_composite_parts': 'includeCompositeParts',
                    'include_fs_tables': 'includeFSTables',
                    'include_fs_computed_part_property_functions': 'includeFSComputedPartPropertyFunctions',
                    'include_variables': 'includeVariables',
                    'include_variable_studios': 'includeVariableStudios',
                },
                'location_map': {
                    'did': 'path',
                    'beta_capability_ids': 'query',
                    'include_parts': 'query',
                    'include_surfaces': 'query',
                    'include_sketches': 'query',
                    'include_reference_features': 'query',
                    'include_assemblies': 'query',
                    'include_feature_studios': 'query',
                    'include_blobs': 'query',
                    'allowed_blob_mime_types': 'query',
                    'exclude_newer_fs_versions': 'query',
                    'max_feature_script_version': 'query',
                    'include_part_studios': 'query',
                    'include_features': 'query',
                    'include_meshes': 'query',
                    'include_wires': 'query',
                    'include_flattened_bodies': 'query',
                    'include_applications': 'query',
                    'allowed_application_mime_types': 'query',
                    'include_composite_parts': 'query',
                    'include_fs_tables': 'query',
                    'include_fs_computed_part_property_functions': 'query',
                    'include_variables': 'query',
                    'include_variable_studios': 'query',
                },
                'collection_format_map': {
                    'beta_capability_ids': 'multi',
                }
            },
            headers_map={
                'accept': [
                    'application/vnd.onshape.v2+json;charset=UTF-8;qs=0.2'
                ],
                'content_type': [],
            },
            api_client=api_client
        )

    def get_latest_in_document(
        self,
        did,
        **kwargs
    ):
        """Insertables for a document  # 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_latest_in_document(did, async_req=True)
        >>> result = thread.get()

        Args:
            did (str):

        Keyword Args:
            beta_capability_ids ([str]): [optional]
            include_parts (bool): [optional] if omitted the server will use the default value of False
            include_surfaces (bool): [optional] if omitted the server will use the default value of False
            include_sketches (bool): [optional] if omitted the server will use the default value of False
            include_reference_features (bool): [optional] if omitted the server will use the default value of False
            include_assemblies (bool): [optional] if omitted the server will use the default value of False
            include_feature_studios (bool): [optional] if omitted the server will use the default value of False
            include_blobs (bool): [optional] if omitted the server will use the default value of False
            allowed_blob_mime_types (str): [optional] if omitted the server will use the default value of ""
            exclude_newer_fs_versions (bool): [optional] if omitted the server will use the default value of False
            max_feature_script_version (int): [optional]
            include_part_studios (bool): [optional] if omitted the server will use the default value of False
            include_features (bool): [optional] if omitted the server will use the default value of False
            include_meshes (bool): [optional] if omitted the server will use the default value of False
            include_wires (bool): [optional] if omitted the server will use the default value of False
            include_flattened_bodies (bool): [optional] if omitted the server will use the default value of False
            include_applications (bool): [optional] if omitted the server will use the default value of False
            allowed_application_mime_types (str): [optional] if omitted the server will use the default value of ""
            include_composite_parts (bool): [optional] if omitted the server will use the default value of False
            include_fs_tables (bool): [optional] if omitted the server will use the default value of False
            include_fs_computed_part_property_functions (bool): [optional] if omitted the server will use the default value of False
            include_variables (bool): [optional] if omitted the server will use the default value of False
            include_variable_studios (bool): [optional] if omitted the server will use the default value of False
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): 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.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            BTListResponseBTInsertableInfo
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['did'] = \
            did
        return self.get_latest_in_document_endpoint.call_with_http_info(**kwargs)

