def create_translation_with_http_info(self, did, wid, **kwargs): # noqa: E501 """create_translation # 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_translation_with_http_info(did, wid, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str did: (required) :param str wid: (required) :param ContentDisposition content_disposition: :param object entity: :param BodyPartMediaType media_type: :param object message_body_workers: :param MultiPart parent: :param object providers: :param list[BodyPart] body_parts: :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', 'content_disposition', 'entity', 'media_type', 'message_body_workers', 'parent', 'providers', 'body_parts'] # 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_translation" % 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_translation`") # 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_translation`") # 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 = {} if 'content_disposition' in local_var_params: form_params.append(('contentDisposition', local_var_params['content_disposition'])) # noqa: E501 if 'entity' in local_var_params: form_params.append(('entity', local_var_params['entity'])) # noqa: E501 if 'media_type' in local_var_params: form_params.append(('mediaType', local_var_params['media_type'])) # noqa: E501 if 'message_body_workers' in local_var_params: form_params.append(('messageBodyWorkers', local_var_params['message_body_workers'])) # noqa: E501 if 'parent' in local_var_params: form_params.append(('parent', local_var_params['parent'])) # noqa: E501 if 'providers' in local_var_params: form_params.append(('providers', local_var_params['providers'])) # noqa: E501 if 'body_parts' in local_var_params: form_params.append(('bodyParts', local_var_params['body_parts'])) # noqa: E501 collection_formats['bodyParts'] = 'csv' # noqa: E501 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 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['multipart/form-data']) # noqa: E501 # Authentication setting auth_settings = ['OAuth2'] # noqa: E501 return self.api_client.call_api( '/api/translations/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 call_with_http_info(self, **kwargs): try: _host = self.settings['servers'][kwargs['_host_index']] except IndexError: if self.settings['servers']: raise ApiValueError( "Invalid host index. Must be 0 <= index < %s" % len(self.settings['servers'])) _host = None for key, value in six.iteritems(kwargs): if key not in self.params_map['all']: raise ApiTypeError("Got an unexpected parameter '%s'" " to method `%s`" % (key, self.settings['operation_id'])) # only throw this nullable ApiValueError if _check_input_type # is False, if _check_input_type==True we catch this case # in self.__validate_inputs if (key not in self.params_map['nullable'] and value is None and kwargs['_check_input_type'] is False): raise ApiValueError( "Value may not be None for non-nullable parameter `%s`" " when calling `%s`" % (key, self.settings['operation_id'])) for key in self.params_map['required']: if key not in kwargs.keys(): raise ApiValueError( "Missing the required parameter `%s` when calling " "`%s`" % (key, self.settings['operation_id'])) self.__validate_inputs(kwargs) params = self.__gather_params(kwargs) accept_headers_list = self.headers_map['accept'] if accept_headers_list: params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) content_type_headers_list = self.headers_map['content_type'] if content_type_headers_list: header_list = self.api_client.select_header_content_type( content_type_headers_list) params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], params['path'], params['query'], params['header'], body=params['body'], post_params=params['form'], files=params['file'], response_type=self.settings['response_type'], auth_settings=self.settings['auth'], async_req=kwargs['async_req'], _check_type=kwargs['_check_return_type'], _return_http_data_only=kwargs['_return_http_data_only'], _preload_content=kwargs['_preload_content'], _request_timeout=kwargs['_request_timeout'], _host=_host, collection_formats=params['collection_format'])
def call_with_http_info(self, **kwargs): try: _host = self.settings["servers"][kwargs["_host_index"]] except IndexError: if self.settings["servers"]: raise ApiValueError( "Invalid host index. Must be 0 <= index < %s" % len(self.settings["servers"])) _host = None for key, value in six.iteritems(kwargs): if key not in self.params_map["all"]: raise ApiTypeError("Got an unexpected parameter '%s'" " to method `%s`" % (key, self.settings["operation_id"])) # only throw this nullable ApiValueError if _check_input_type # is False, if _check_input_type==True we catch this case # in self.__validate_inputs if (key not in self.params_map["nullable"] and value is None and kwargs["_check_input_type"] is False): raise ApiValueError( "Value may not be None for non-nullable parameter `%s`" " when calling `%s`" % (key, self.settings["operation_id"])) for key in self.params_map["required"]: if key not in kwargs.keys(): raise ApiValueError( "Missing the required parameter `%s` when calling " "`%s`" % (key, self.settings["operation_id"])) self.__validate_inputs(kwargs) params = self.__gather_params(kwargs) accept_headers_list = self.headers_map["accept"] if accept_headers_list: params["header"]["Accept"] = self.api_client.select_header_accept( accept_headers_list) content_type_headers_list = self.headers_map["content_type"] if content_type_headers_list: header_list = self.api_client.select_header_content_type( content_type_headers_list) params["header"]["Content-Type"] = header_list return self.api_client.call_api( self.settings["endpoint_path"], self.settings["http_method"], params["path"], params["query"], params["header"], body=params["body"], post_params=params["form"], files=params["file"], response_type=self.settings["response_type"], auth_settings=self.settings["auth"], async_req=kwargs["async_req"], _check_type=kwargs["_check_return_type"], _return_http_data_only=kwargs["_return_http_data_only"], _preload_content=kwargs["_preload_content"], _request_timeout=kwargs["_request_timeout"], _host=_host, collection_formats=params["collection_format"], )
def get_translator_formats5_with_http_info(self, **kwargs): # noqa: E501 """get_translator_formats5 # 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_translator_formats5_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :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 = [] # 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_translator_formats5" % key ) local_var_params[key] = val del local_var_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/vnd.onshape.v1+json;charset=UTF-8;qs=0.1', 'application/json;charset=UTF-8; qs=0.09']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/api/translations/translationformats', '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 get_parts_wmv_with_http_info(self, did, wvm, wvmid, **kwargs): # noqa: E501 """Get list of parts # 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_parts_wmv_with_http_info(did, wvm, wvmid, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str did: Document ID. (required) :param str wvm: One of w or v or m corresponding to whether a workspace or version or microversion was entered. (required) :param str wvmid: Workspace (w), Version (v) or Microversion (m) ID. (required) :param str element_id: Element ID :param bool with_thumbnails: Whether or not to include thumbnails (not supported for microversion) :param bool include_property_defaults: If true, include metadata schema property defaults in response :param str link_document_id: Id of document that links to the document being accessed. This may provide additional access rights to the document. Allowed only with version (v) path parameter. :param str configuration: Configuration string. :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(list[BTPartMetadataInfo], status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['did', 'wvm', 'wvmid', 'element_id', 'with_thumbnails', 'include_property_defaults', 'link_document_id', 'configuration'] # 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_parts_wmv" % 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_parts_wmv`") # 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_parts_wmv`") # 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_parts_wmv`") # 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 query_params = [] if 'element_id' in local_var_params: query_params.append(('elementId', local_var_params['element_id'])) # noqa: E501 if 'with_thumbnails' in local_var_params: query_params.append(('withThumbnails', local_var_params['with_thumbnails'])) # noqa: E501 if 'include_property_defaults' in local_var_params: query_params.append(('includePropertyDefaults', local_var_params['include_property_defaults'])) # noqa: E501 if 'link_document_id' in local_var_params: query_params.append(('linkDocumentId', local_var_params['link_document_id'])) # noqa: E501 if 'configuration' in local_var_params: query_params.append(('configuration', local_var_params['configuration'])) # 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/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/parts/d/{did}/{wvm}/{wvmid}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='list[BTPartMetadataInfo]', # 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_open_api_with_http_info(self, **kwargs): # noqa: E501 """OpenAPI spec documentation for the Onshape REST API. # 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_open_api_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str file_type: The type of file to return. Defaults to JSON. :param str excluded_tags: If an operation contains an excluded tag, it is not returned from this endpoint. :param str included_tags: Return only operations with tags included in includedTags. :param bool include_deprecated: Include deprecated endpoints. :param list[str] documentation_status: Only return endpoints that have the specified document status. Default is to return all the endpoints the user should have access to. :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(OpenAPI, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = [ 'file_type', 'excluded_tags', 'included_tags', 'include_deprecated', 'documentation_status' ] # 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_open_api" % key) local_var_params[key] = val del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'file_type' in local_var_params: query_params.append( ('fileType', local_var_params['file_type'])) # noqa: E501 if 'excluded_tags' in local_var_params: query_params.append( ('excludedTags', local_var_params['excluded_tags'])) # noqa: E501 if 'included_tags' in local_var_params: query_params.append( ('includedTags', local_var_params['included_tags'])) # noqa: E501 if 'include_deprecated' in local_var_params: query_params.append( ('includeDeprecated', local_var_params['include_deprecated'])) # noqa: E501 if 'documentation_status' in local_var_params: query_params.append( ('documentationStatus', local_var_params['documentation_status'])) # noqa: E501 collection_formats['documentationStatus'] = 'multi' # 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']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/api/openapi', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='OpenAPI', # 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_parts_wmv_with_http_info(self, did, wvm, wvmid, **kwargs): # noqa: E501 """Part metadata batch update. # 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_parts_wmv_with_http_info(did, wvm, wvmid, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str did: Document ID. (required) :param str wvm: One of w or v or m corresponding to whether a workspace or version or microversion was entered. (required) :param str wvmid: Workspace (w), Version (v) or Microversion (m) ID. (required) :param str edit_description: Description of the update (as appear in document history) :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', 'edit_description', '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_parts_wmv" % 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_parts_wmv`") # 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_parts_wmv`") # 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_parts_wmv`") # 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 query_params = [] if 'edit_description' in local_var_params: query_params.append(('editDescription', local_var_params['edit_description'])) # noqa: E501 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/parts/d/{did}/{wvm}/{wvmid}', '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 translate_format4_with_http_info(self, did, wv, wvid, eid, bt_translate_format_params, **kwargs): # noqa: E501 """Create Drawing translation # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.translate_format4_with_http_info(did, wv, wvid, eid, bt_translate_format_params, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str did: (required) :param str wv: (required) :param str wvid: (required) :param str eid: (required) :param BTTranslateFormatParams bt_translate_format_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: tuple(BTTranslationRequestInfo, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['did', 'wv', 'wvid', 'eid', 'bt_translate_format_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 translate_format4" % 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 `translate_format4`") # noqa: E501 # verify the required parameter 'wv' is set if ('wv' not in local_var_params or local_var_params['wv'] is None): raise ApiValueError("Missing the required parameter `wv` when calling `translate_format4`") # noqa: E501 # verify the required parameter 'wvid' is set if ('wvid' not in local_var_params or local_var_params['wvid'] is None): raise ApiValueError("Missing the required parameter `wvid` when calling `translate_format4`") # 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 `translate_format4`") # noqa: E501 # verify the required parameter 'bt_translate_format_params' is set if ('bt_translate_format_params' not in local_var_params or local_var_params['bt_translate_format_params'] is None): raise ApiValueError("Missing the required parameter `bt_translate_format_params` when calling `translate_format4`") # noqa: E501 collection_formats = {} path_params = {} if 'did' in local_var_params: path_params['did'] = local_var_params['did'] # noqa: E501 if 'wv' in local_var_params: path_params['wv'] = local_var_params['wv'] # noqa: E501 if 'wvid' in local_var_params: path_params['wvid'] = local_var_params['wvid'] # 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 'bt_translate_format_params' in local_var_params: body_params = local_var_params['bt_translate_format_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/drawings/d/{did}/{wv}/{wvid}/e/{eid}/translations', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='BTTranslationRequestInfo', # 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 cancel_purchase_new_with_http_info(self, aid, pid, **kwargs): # noqa: E501 """Cancel Recurring Subscription # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.cancel_purchase_new_with_http_info(aid, pid, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str aid: (required) :param str pid: (required) :param bool cancel_immediately: :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 = ['aid', 'pid', 'cancel_immediately'] # 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 cancel_purchase_new" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'aid' is set if ('aid' not in local_var_params or local_var_params['aid'] is None): raise ApiValueError("Missing the required parameter `aid` when calling `cancel_purchase_new`") # noqa: E501 # verify the required parameter 'pid' is set if ('pid' not in local_var_params or local_var_params['pid'] is None): raise ApiValueError("Missing the required parameter `pid` when calling `cancel_purchase_new`") # noqa: E501 collection_formats = {} path_params = {} if 'aid' in local_var_params: path_params['aid'] = local_var_params['aid'] # noqa: E501 if 'pid' in local_var_params: path_params['pid'] = local_var_params['pid'] # noqa: E501 query_params = [] if 'cancel_immediately' in local_var_params: query_params.append(('cancelImmediately', local_var_params['cancel_immediately'])) # 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/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/accounts/{aid}/purchases/{pid}', 'DELETE', 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_plan_purchases_with_http_info(self, plan_id, **kwargs): # noqa: E501 """Get Plan Purchases # 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_plan_purchases_with_http_info(plan_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str plan_id: (required) :param int offset: :param int limit: :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(BTListResponseBTPurchaseInfo, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['plan_id', 'offset', 'limit'] # 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_plan_purchases" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'plan_id' is set if ('plan_id' not in local_var_params or local_var_params['plan_id'] is None): raise ApiValueError("Missing the required parameter `plan_id` when calling `get_plan_purchases`") # noqa: E501 collection_formats = {} path_params = {} if 'plan_id' in local_var_params: path_params['planId'] = local_var_params['plan_id'] # noqa: E501 query_params = [] if 'offset' in local_var_params: query_params.append(('offset', local_var_params['offset'])) # noqa: E501 if 'limit' in local_var_params: query_params.append(('limit', local_var_params['limit'])) # 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/vnd.onshape.v1+json;charset=UTF-8;qs=0.1', 'application/json;charset=UTF-8; qs=0.09']) # noqa: E501 # Authentication setting auth_settings = [] # noqa: E501 return self.api_client.call_api( '/api/accounts/plans/{planId}/purchases', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='BTListResponseBTPurchaseInfo', # 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 download_file_workspace_with_http_info(self, did, wid, eid, **kwargs): # noqa: E501 """download_file_workspace # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.download_file_workspace_with_http_info(did, wid, eid, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str did: (required) :param str wid: (required) :param str eid: (required) :param str content_disposition: :param str if_none_match: :param str link_document_id: :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', 'eid', 'content_disposition', 'if_none_match', 'link_document_id' ] # 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 download_file_workspace" % 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 `download_file_workspace`" ) # 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 `download_file_workspace`" ) # 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 `download_file_workspace`" ) # 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 if 'eid' in local_var_params: path_params['eid'] = local_var_params['eid'] # noqa: E501 query_params = [] if 'content_disposition' in local_var_params: query_params.append( ('contentDisposition', local_var_params['content_disposition'])) # noqa: E501 if 'link_document_id' in local_var_params: query_params.append( ('linkDocumentId', local_var_params['link_document_id'])) # noqa: E501 header_params = {} if 'if_none_match' in local_var_params: header_params['If-None-Match'] = local_var_params[ 'if_none_match'] # noqa: E501 form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept([ 'application/vnd.onshape.v1+octet-stream;charset=UTF-8;qs=0.1', 'application/json;charset=UTF-8; qs=0.09', 'application/octet-stream' ]) # noqa: E501 # Authentication setting auth_settings = ['OAuth2'] # noqa: E501 return self.api_client.call_api( '/api/blobelements/d/{did}/w/{wid}/e/{eid}', '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)