|
| 1 | +# coding: utf-8 |
| 2 | +""" |
| 3 | +<copyright company="Aspose" file="PostRepairRequest.cs"> |
| 4 | + Copyright (c) 2023 Aspose.Cells Cloud |
| 5 | +</copyright> |
| 6 | +<summary> |
| 7 | + Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | + of this software and associated documentation files (the "Software"), to deal |
| 9 | + in the Software without restriction, including without limitation the rights |
| 10 | + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | + copies of the Software, and to permit persons to whom the Software is |
| 12 | + furnished to do so, subject to the following conditions: |
| 13 | +
|
| 14 | + The above copyright notice and this permission notice shall be included in all |
| 15 | + copies or substantial portions of the Software. |
| 16 | +
|
| 17 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 23 | + SOFTWARE. |
| 24 | +</summary> |
| 25 | +""" |
| 26 | + |
| 27 | +import json |
| 28 | + |
| 29 | +from six import iteritems |
| 30 | +from asposecellscloud import * |
| 31 | +from asposecellscloud.models import * |
| 32 | +from asposecellscloud.requests import * |
| 33 | +from six.moves.urllib.parse import quote |
| 34 | + |
| 35 | +class PostRepairRequest(object): |
| 36 | + |
| 37 | + def __init__(self , file ,format =None ): |
| 38 | + self.file = file |
| 39 | + self.format = format |
| 40 | + def create_http_request(self, api_client): |
| 41 | + |
| 42 | + # verify the required parameter 'file' is set |
| 43 | + if self.file is None: |
| 44 | + raise ValueError("Missing the required parameter `file` when calling `post_repair`") |
| 45 | + |
| 46 | + |
| 47 | + collection_formats = {} |
| 48 | + |
| 49 | + path_params = {} |
| 50 | + query_params = [] |
| 51 | + if self.format is not None: |
| 52 | + query_params.append(('format',self.format )) |
| 53 | + |
| 54 | + header_params = {} |
| 55 | + |
| 56 | + form_params = [] |
| 57 | + local_var_files = {} |
| 58 | + if self.file is not None: |
| 59 | + if isinstance(self.file,dict): |
| 60 | + for filename , filecontext in self.file.items(): |
| 61 | + local_var_files[filename] = filecontext |
| 62 | + else: |
| 63 | + local_var_files['File'] = self.file |
| 64 | + |
| 65 | + body_params = None |
| 66 | + # HTTP header `Accept` |
| 67 | + header_params['Accept'] = api_client.\ |
| 68 | + select_header_accept(['application/json']) |
| 69 | + |
| 70 | + # HTTP header `Content-Type` |
| 71 | + header_params['Content-Type'] = api_client.\ |
| 72 | + select_header_content_type(['multipart/form-data']) |
| 73 | + |
| 74 | + # Authentication setting |
| 75 | + auth_settings = [] |
| 76 | + resource_path = "/cells/repair" |
| 77 | + # path parameters |
| 78 | + if path_params: |
| 79 | + path_params = api_client.sanitize_for_serialization(path_params) |
| 80 | + path_params = api_client.parameters_to_tuples(path_params, collection_formats) |
| 81 | + for k, v in path_params: |
| 82 | + # specified safe chars, encode everything |
| 83 | + resource_path = resource_path.replace('{%s}' % k, quote(str(v), safe='/')) |
| 84 | + return { |
| 85 | + "method": "POST", |
| 86 | + "path":resource_path, |
| 87 | + "query_params": query_params, |
| 88 | + "header_params": header_params, |
| 89 | + "form_params": form_params, |
| 90 | + "files":local_var_files, |
| 91 | + "auth_settings":auth_settings, |
| 92 | + "body": body_params, |
| 93 | + "collection_formats": collection_formats, |
| 94 | + "response_type": 'FilesResult' |
| 95 | + } |
| 96 | + |
0 commit comments