vectorize_client.api.uploads_api
Vectorize API
API for Vectorize services (Beta)
The version of the OpenAPI document: 0.1.2 Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
1# coding: utf-8 2 3""" 4 Vectorize API 5 6 API for Vectorize services (Beta) 7 8 The version of the OpenAPI document: 0.1.2 9 Generated by OpenAPI Generator (https://openapi-generator.tech) 10 11 Do not edit the class manually. 12""" # noqa: E501 13 14import warnings 15from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt 16from typing import Any, Dict, List, Optional, Tuple, Union 17from typing_extensions import Annotated 18 19from pydantic import StrictStr 20from vectorize_client.models.delete_file_response import DeleteFileResponse 21from vectorize_client.models.get_upload_files_response import GetUploadFilesResponse 22from vectorize_client.models.start_file_upload_to_connector_request import StartFileUploadToConnectorRequest 23from vectorize_client.models.start_file_upload_to_connector_response import StartFileUploadToConnectorResponse 24 25from vectorize_client.api_client import ApiClient, RequestSerialized 26from vectorize_client.api_response import ApiResponse 27from vectorize_client.rest import RESTResponseType 28 29 30class UploadsApi: 31 """NOTE: This class is auto generated by OpenAPI Generator 32 Ref: https://openapi-generator.tech 33 34 Do not edit the class manually. 35 """ 36 37 def __init__(self, api_client=None) -> None: 38 if api_client is None: 39 api_client = ApiClient.get_default() 40 self.api_client = api_client 41 42 43 @validate_call 44 def delete_file_from_connector( 45 self, 46 organization_id: StrictStr, 47 connector_id: StrictStr, 48 file_name: StrictStr, 49 _request_timeout: Union[ 50 None, 51 Annotated[StrictFloat, Field(gt=0)], 52 Tuple[ 53 Annotated[StrictFloat, Field(gt=0)], 54 Annotated[StrictFloat, Field(gt=0)] 55 ] 56 ] = None, 57 _request_auth: Optional[Dict[StrictStr, Any]] = None, 58 _content_type: Optional[StrictStr] = None, 59 _headers: Optional[Dict[StrictStr, Any]] = None, 60 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 61 ) -> DeleteFileResponse: 62 """Delete a file from a File Upload connector 63 64 Delete a file from a File Upload connector 65 66 :param organization_id: (required) 67 :type organization_id: str 68 :param connector_id: (required) 69 :type connector_id: str 70 :param file_name: (required) 71 :type file_name: str 72 :param _request_timeout: timeout setting for this request. If one 73 number provided, it will be total request 74 timeout. It can also be a pair (tuple) of 75 (connection, read) timeouts. 76 :type _request_timeout: int, tuple(int, int), optional 77 :param _request_auth: set to override the auth_settings for an a single 78 request; this effectively ignores the 79 authentication in the spec for a single request. 80 :type _request_auth: dict, optional 81 :param _content_type: force content-type for the request. 82 :type _content_type: str, Optional 83 :param _headers: set to override the headers for a single 84 request; this effectively ignores the headers 85 in the spec for a single request. 86 :type _headers: dict, optional 87 :param _host_index: set to override the host_index for a single 88 request; this effectively ignores the host_index 89 in the spec for a single request. 90 :type _host_index: int, optional 91 :return: Returns the result object. 92 """ # noqa: E501 93 94 _param = self._delete_file_from_connector_serialize( 95 organization_id=organization_id, 96 connector_id=connector_id, 97 file_name=file_name, 98 _request_auth=_request_auth, 99 _content_type=_content_type, 100 _headers=_headers, 101 _host_index=_host_index 102 ) 103 104 _response_types_map: Dict[str, Optional[str]] = { 105 '200': "DeleteFileResponse", 106 '400': "GetWorkspaces400Response", 107 '401': "GetWorkspaces400Response", 108 '403': "GetWorkspaces400Response", 109 '404': "GetWorkspaces400Response", 110 '500': "GetWorkspaces400Response", 111 } 112 response_data = self.api_client.call_api( 113 *_param, 114 _request_timeout=_request_timeout 115 ) 116 response_data.read() 117 return self.api_client.response_deserialize( 118 response_data=response_data, 119 response_types_map=_response_types_map, 120 ).data 121 122 123 @validate_call 124 def delete_file_from_connector_with_http_info( 125 self, 126 organization_id: StrictStr, 127 connector_id: StrictStr, 128 file_name: StrictStr, 129 _request_timeout: Union[ 130 None, 131 Annotated[StrictFloat, Field(gt=0)], 132 Tuple[ 133 Annotated[StrictFloat, Field(gt=0)], 134 Annotated[StrictFloat, Field(gt=0)] 135 ] 136 ] = None, 137 _request_auth: Optional[Dict[StrictStr, Any]] = None, 138 _content_type: Optional[StrictStr] = None, 139 _headers: Optional[Dict[StrictStr, Any]] = None, 140 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 141 ) -> ApiResponse[DeleteFileResponse]: 142 """Delete a file from a File Upload connector 143 144 Delete a file from a File Upload connector 145 146 :param organization_id: (required) 147 :type organization_id: str 148 :param connector_id: (required) 149 :type connector_id: str 150 :param file_name: (required) 151 :type file_name: str 152 :param _request_timeout: timeout setting for this request. If one 153 number provided, it will be total request 154 timeout. It can also be a pair (tuple) of 155 (connection, read) timeouts. 156 :type _request_timeout: int, tuple(int, int), optional 157 :param _request_auth: set to override the auth_settings for an a single 158 request; this effectively ignores the 159 authentication in the spec for a single request. 160 :type _request_auth: dict, optional 161 :param _content_type: force content-type for the request. 162 :type _content_type: str, Optional 163 :param _headers: set to override the headers for a single 164 request; this effectively ignores the headers 165 in the spec for a single request. 166 :type _headers: dict, optional 167 :param _host_index: set to override the host_index for a single 168 request; this effectively ignores the host_index 169 in the spec for a single request. 170 :type _host_index: int, optional 171 :return: Returns the result object. 172 """ # noqa: E501 173 174 _param = self._delete_file_from_connector_serialize( 175 organization_id=organization_id, 176 connector_id=connector_id, 177 file_name=file_name, 178 _request_auth=_request_auth, 179 _content_type=_content_type, 180 _headers=_headers, 181 _host_index=_host_index 182 ) 183 184 _response_types_map: Dict[str, Optional[str]] = { 185 '200': "DeleteFileResponse", 186 '400': "GetWorkspaces400Response", 187 '401': "GetWorkspaces400Response", 188 '403': "GetWorkspaces400Response", 189 '404': "GetWorkspaces400Response", 190 '500': "GetWorkspaces400Response", 191 } 192 response_data = self.api_client.call_api( 193 *_param, 194 _request_timeout=_request_timeout 195 ) 196 response_data.read() 197 return self.api_client.response_deserialize( 198 response_data=response_data, 199 response_types_map=_response_types_map, 200 ) 201 202 203 @validate_call 204 def delete_file_from_connector_without_preload_content( 205 self, 206 organization_id: StrictStr, 207 connector_id: StrictStr, 208 file_name: StrictStr, 209 _request_timeout: Union[ 210 None, 211 Annotated[StrictFloat, Field(gt=0)], 212 Tuple[ 213 Annotated[StrictFloat, Field(gt=0)], 214 Annotated[StrictFloat, Field(gt=0)] 215 ] 216 ] = None, 217 _request_auth: Optional[Dict[StrictStr, Any]] = None, 218 _content_type: Optional[StrictStr] = None, 219 _headers: Optional[Dict[StrictStr, Any]] = None, 220 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 221 ) -> RESTResponseType: 222 """Delete a file from a File Upload connector 223 224 Delete a file from a File Upload connector 225 226 :param organization_id: (required) 227 :type organization_id: str 228 :param connector_id: (required) 229 :type connector_id: str 230 :param file_name: (required) 231 :type file_name: str 232 :param _request_timeout: timeout setting for this request. If one 233 number provided, it will be total request 234 timeout. It can also be a pair (tuple) of 235 (connection, read) timeouts. 236 :type _request_timeout: int, tuple(int, int), optional 237 :param _request_auth: set to override the auth_settings for an a single 238 request; this effectively ignores the 239 authentication in the spec for a single request. 240 :type _request_auth: dict, optional 241 :param _content_type: force content-type for the request. 242 :type _content_type: str, Optional 243 :param _headers: set to override the headers for a single 244 request; this effectively ignores the headers 245 in the spec for a single request. 246 :type _headers: dict, optional 247 :param _host_index: set to override the host_index for a single 248 request; this effectively ignores the host_index 249 in the spec for a single request. 250 :type _host_index: int, optional 251 :return: Returns the result object. 252 """ # noqa: E501 253 254 _param = self._delete_file_from_connector_serialize( 255 organization_id=organization_id, 256 connector_id=connector_id, 257 file_name=file_name, 258 _request_auth=_request_auth, 259 _content_type=_content_type, 260 _headers=_headers, 261 _host_index=_host_index 262 ) 263 264 _response_types_map: Dict[str, Optional[str]] = { 265 '200': "DeleteFileResponse", 266 '400': "GetWorkspaces400Response", 267 '401': "GetWorkspaces400Response", 268 '403': "GetWorkspaces400Response", 269 '404': "GetWorkspaces400Response", 270 '500': "GetWorkspaces400Response", 271 } 272 response_data = self.api_client.call_api( 273 *_param, 274 _request_timeout=_request_timeout 275 ) 276 return response_data.response 277 278 279 def _delete_file_from_connector_serialize( 280 self, 281 organization_id, 282 connector_id, 283 file_name, 284 _request_auth, 285 _content_type, 286 _headers, 287 _host_index, 288 ) -> RequestSerialized: 289 290 _host = None 291 292 _collection_formats: Dict[str, str] = { 293 } 294 295 _path_params: Dict[str, str] = {} 296 _query_params: List[Tuple[str, str]] = [] 297 _header_params: Dict[str, Optional[str]] = _headers or {} 298 _form_params: List[Tuple[str, str]] = [] 299 _files: Dict[ 300 str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] 301 ] = {} 302 _body_params: Optional[bytes] = None 303 304 # process the path parameters 305 if organization_id is not None: 306 _path_params['organizationId'] = organization_id 307 if connector_id is not None: 308 _path_params['connectorId'] = connector_id 309 if file_name is not None: 310 _path_params['fileName'] = file_name 311 # process the query parameters 312 # process the header parameters 313 # process the form parameters 314 # process the body parameter 315 316 317 # set the HTTP header `Accept` 318 if 'Accept' not in _header_params: 319 _header_params['Accept'] = self.api_client.select_header_accept( 320 [ 321 'application/json' 322 ] 323 ) 324 325 326 # authentication setting 327 _auth_settings: List[str] = [ 328 'bearerAuth' 329 ] 330 331 return self.api_client.param_serialize( 332 method='DELETE', 333 resource_path='/org/{organizationId}/uploads/{connectorId}/files/{fileName}', 334 path_params=_path_params, 335 query_params=_query_params, 336 header_params=_header_params, 337 body=_body_params, 338 post_params=_form_params, 339 files=_files, 340 auth_settings=_auth_settings, 341 collection_formats=_collection_formats, 342 _host=_host, 343 _request_auth=_request_auth 344 ) 345 346 347 348 349 @validate_call 350 def get_upload_files_from_connector( 351 self, 352 organization_id: StrictStr, 353 connector_id: StrictStr, 354 _request_timeout: Union[ 355 None, 356 Annotated[StrictFloat, Field(gt=0)], 357 Tuple[ 358 Annotated[StrictFloat, Field(gt=0)], 359 Annotated[StrictFloat, Field(gt=0)] 360 ] 361 ] = None, 362 _request_auth: Optional[Dict[StrictStr, Any]] = None, 363 _content_type: Optional[StrictStr] = None, 364 _headers: Optional[Dict[StrictStr, Any]] = None, 365 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 366 ) -> GetUploadFilesResponse: 367 """Get uploaded files from a file upload connector 368 369 Get uploaded files from a file upload connector 370 371 :param organization_id: (required) 372 :type organization_id: str 373 :param connector_id: (required) 374 :type connector_id: str 375 :param _request_timeout: timeout setting for this request. If one 376 number provided, it will be total request 377 timeout. It can also be a pair (tuple) of 378 (connection, read) timeouts. 379 :type _request_timeout: int, tuple(int, int), optional 380 :param _request_auth: set to override the auth_settings for an a single 381 request; this effectively ignores the 382 authentication in the spec for a single request. 383 :type _request_auth: dict, optional 384 :param _content_type: force content-type for the request. 385 :type _content_type: str, Optional 386 :param _headers: set to override the headers for a single 387 request; this effectively ignores the headers 388 in the spec for a single request. 389 :type _headers: dict, optional 390 :param _host_index: set to override the host_index for a single 391 request; this effectively ignores the host_index 392 in the spec for a single request. 393 :type _host_index: int, optional 394 :return: Returns the result object. 395 """ # noqa: E501 396 397 _param = self._get_upload_files_from_connector_serialize( 398 organization_id=organization_id, 399 connector_id=connector_id, 400 _request_auth=_request_auth, 401 _content_type=_content_type, 402 _headers=_headers, 403 _host_index=_host_index 404 ) 405 406 _response_types_map: Dict[str, Optional[str]] = { 407 '200': "GetUploadFilesResponse", 408 '400': "GetWorkspaces400Response", 409 '401': "GetWorkspaces400Response", 410 '403': "GetWorkspaces400Response", 411 '404': "GetWorkspaces400Response", 412 '500': "GetWorkspaces400Response", 413 } 414 response_data = self.api_client.call_api( 415 *_param, 416 _request_timeout=_request_timeout 417 ) 418 response_data.read() 419 return self.api_client.response_deserialize( 420 response_data=response_data, 421 response_types_map=_response_types_map, 422 ).data 423 424 425 @validate_call 426 def get_upload_files_from_connector_with_http_info( 427 self, 428 organization_id: StrictStr, 429 connector_id: StrictStr, 430 _request_timeout: Union[ 431 None, 432 Annotated[StrictFloat, Field(gt=0)], 433 Tuple[ 434 Annotated[StrictFloat, Field(gt=0)], 435 Annotated[StrictFloat, Field(gt=0)] 436 ] 437 ] = None, 438 _request_auth: Optional[Dict[StrictStr, Any]] = None, 439 _content_type: Optional[StrictStr] = None, 440 _headers: Optional[Dict[StrictStr, Any]] = None, 441 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 442 ) -> ApiResponse[GetUploadFilesResponse]: 443 """Get uploaded files from a file upload connector 444 445 Get uploaded files from a file upload connector 446 447 :param organization_id: (required) 448 :type organization_id: str 449 :param connector_id: (required) 450 :type connector_id: str 451 :param _request_timeout: timeout setting for this request. If one 452 number provided, it will be total request 453 timeout. It can also be a pair (tuple) of 454 (connection, read) timeouts. 455 :type _request_timeout: int, tuple(int, int), optional 456 :param _request_auth: set to override the auth_settings for an a single 457 request; this effectively ignores the 458 authentication in the spec for a single request. 459 :type _request_auth: dict, optional 460 :param _content_type: force content-type for the request. 461 :type _content_type: str, Optional 462 :param _headers: set to override the headers for a single 463 request; this effectively ignores the headers 464 in the spec for a single request. 465 :type _headers: dict, optional 466 :param _host_index: set to override the host_index for a single 467 request; this effectively ignores the host_index 468 in the spec for a single request. 469 :type _host_index: int, optional 470 :return: Returns the result object. 471 """ # noqa: E501 472 473 _param = self._get_upload_files_from_connector_serialize( 474 organization_id=organization_id, 475 connector_id=connector_id, 476 _request_auth=_request_auth, 477 _content_type=_content_type, 478 _headers=_headers, 479 _host_index=_host_index 480 ) 481 482 _response_types_map: Dict[str, Optional[str]] = { 483 '200': "GetUploadFilesResponse", 484 '400': "GetWorkspaces400Response", 485 '401': "GetWorkspaces400Response", 486 '403': "GetWorkspaces400Response", 487 '404': "GetWorkspaces400Response", 488 '500': "GetWorkspaces400Response", 489 } 490 response_data = self.api_client.call_api( 491 *_param, 492 _request_timeout=_request_timeout 493 ) 494 response_data.read() 495 return self.api_client.response_deserialize( 496 response_data=response_data, 497 response_types_map=_response_types_map, 498 ) 499 500 501 @validate_call 502 def get_upload_files_from_connector_without_preload_content( 503 self, 504 organization_id: StrictStr, 505 connector_id: StrictStr, 506 _request_timeout: Union[ 507 None, 508 Annotated[StrictFloat, Field(gt=0)], 509 Tuple[ 510 Annotated[StrictFloat, Field(gt=0)], 511 Annotated[StrictFloat, Field(gt=0)] 512 ] 513 ] = None, 514 _request_auth: Optional[Dict[StrictStr, Any]] = None, 515 _content_type: Optional[StrictStr] = None, 516 _headers: Optional[Dict[StrictStr, Any]] = None, 517 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 518 ) -> RESTResponseType: 519 """Get uploaded files from a file upload connector 520 521 Get uploaded files from a file upload connector 522 523 :param organization_id: (required) 524 :type organization_id: str 525 :param connector_id: (required) 526 :type connector_id: str 527 :param _request_timeout: timeout setting for this request. If one 528 number provided, it will be total request 529 timeout. It can also be a pair (tuple) of 530 (connection, read) timeouts. 531 :type _request_timeout: int, tuple(int, int), optional 532 :param _request_auth: set to override the auth_settings for an a single 533 request; this effectively ignores the 534 authentication in the spec for a single request. 535 :type _request_auth: dict, optional 536 :param _content_type: force content-type for the request. 537 :type _content_type: str, Optional 538 :param _headers: set to override the headers for a single 539 request; this effectively ignores the headers 540 in the spec for a single request. 541 :type _headers: dict, optional 542 :param _host_index: set to override the host_index for a single 543 request; this effectively ignores the host_index 544 in the spec for a single request. 545 :type _host_index: int, optional 546 :return: Returns the result object. 547 """ # noqa: E501 548 549 _param = self._get_upload_files_from_connector_serialize( 550 organization_id=organization_id, 551 connector_id=connector_id, 552 _request_auth=_request_auth, 553 _content_type=_content_type, 554 _headers=_headers, 555 _host_index=_host_index 556 ) 557 558 _response_types_map: Dict[str, Optional[str]] = { 559 '200': "GetUploadFilesResponse", 560 '400': "GetWorkspaces400Response", 561 '401': "GetWorkspaces400Response", 562 '403': "GetWorkspaces400Response", 563 '404': "GetWorkspaces400Response", 564 '500': "GetWorkspaces400Response", 565 } 566 response_data = self.api_client.call_api( 567 *_param, 568 _request_timeout=_request_timeout 569 ) 570 return response_data.response 571 572 573 def _get_upload_files_from_connector_serialize( 574 self, 575 organization_id, 576 connector_id, 577 _request_auth, 578 _content_type, 579 _headers, 580 _host_index, 581 ) -> RequestSerialized: 582 583 _host = None 584 585 _collection_formats: Dict[str, str] = { 586 } 587 588 _path_params: Dict[str, str] = {} 589 _query_params: List[Tuple[str, str]] = [] 590 _header_params: Dict[str, Optional[str]] = _headers or {} 591 _form_params: List[Tuple[str, str]] = [] 592 _files: Dict[ 593 str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] 594 ] = {} 595 _body_params: Optional[bytes] = None 596 597 # process the path parameters 598 if organization_id is not None: 599 _path_params['organizationId'] = organization_id 600 if connector_id is not None: 601 _path_params['connectorId'] = connector_id 602 # process the query parameters 603 # process the header parameters 604 # process the form parameters 605 # process the body parameter 606 607 608 # set the HTTP header `Accept` 609 if 'Accept' not in _header_params: 610 _header_params['Accept'] = self.api_client.select_header_accept( 611 [ 612 'application/json' 613 ] 614 ) 615 616 617 # authentication setting 618 _auth_settings: List[str] = [ 619 'bearerAuth' 620 ] 621 622 return self.api_client.param_serialize( 623 method='GET', 624 resource_path='/org/{organizationId}/uploads/{connectorId}/files', 625 path_params=_path_params, 626 query_params=_query_params, 627 header_params=_header_params, 628 body=_body_params, 629 post_params=_form_params, 630 files=_files, 631 auth_settings=_auth_settings, 632 collection_formats=_collection_formats, 633 _host=_host, 634 _request_auth=_request_auth 635 ) 636 637 638 639 640 @validate_call 641 def start_file_upload_to_connector( 642 self, 643 organization_id: StrictStr, 644 connector_id: StrictStr, 645 start_file_upload_to_connector_request: StartFileUploadToConnectorRequest, 646 _request_timeout: Union[ 647 None, 648 Annotated[StrictFloat, Field(gt=0)], 649 Tuple[ 650 Annotated[StrictFloat, Field(gt=0)], 651 Annotated[StrictFloat, Field(gt=0)] 652 ] 653 ] = None, 654 _request_auth: Optional[Dict[StrictStr, Any]] = None, 655 _content_type: Optional[StrictStr] = None, 656 _headers: Optional[Dict[StrictStr, Any]] = None, 657 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 658 ) -> StartFileUploadToConnectorResponse: 659 """Upload a file to a file upload connector 660 661 Upload a file to a file upload connector 662 663 :param organization_id: (required) 664 :type organization_id: str 665 :param connector_id: (required) 666 :type connector_id: str 667 :param start_file_upload_to_connector_request: (required) 668 :type start_file_upload_to_connector_request: StartFileUploadToConnectorRequest 669 :param _request_timeout: timeout setting for this request. If one 670 number provided, it will be total request 671 timeout. It can also be a pair (tuple) of 672 (connection, read) timeouts. 673 :type _request_timeout: int, tuple(int, int), optional 674 :param _request_auth: set to override the auth_settings for an a single 675 request; this effectively ignores the 676 authentication in the spec for a single request. 677 :type _request_auth: dict, optional 678 :param _content_type: force content-type for the request. 679 :type _content_type: str, Optional 680 :param _headers: set to override the headers for a single 681 request; this effectively ignores the headers 682 in the spec for a single request. 683 :type _headers: dict, optional 684 :param _host_index: set to override the host_index for a single 685 request; this effectively ignores the host_index 686 in the spec for a single request. 687 :type _host_index: int, optional 688 :return: Returns the result object. 689 """ # noqa: E501 690 691 _param = self._start_file_upload_to_connector_serialize( 692 organization_id=organization_id, 693 connector_id=connector_id, 694 start_file_upload_to_connector_request=start_file_upload_to_connector_request, 695 _request_auth=_request_auth, 696 _content_type=_content_type, 697 _headers=_headers, 698 _host_index=_host_index 699 ) 700 701 _response_types_map: Dict[str, Optional[str]] = { 702 '200': "StartFileUploadToConnectorResponse", 703 '400': "GetWorkspaces400Response", 704 '401': "GetWorkspaces400Response", 705 '403': "GetWorkspaces400Response", 706 '404': "GetWorkspaces400Response", 707 '500': "GetWorkspaces400Response", 708 } 709 response_data = self.api_client.call_api( 710 *_param, 711 _request_timeout=_request_timeout 712 ) 713 response_data.read() 714 return self.api_client.response_deserialize( 715 response_data=response_data, 716 response_types_map=_response_types_map, 717 ).data 718 719 720 @validate_call 721 def start_file_upload_to_connector_with_http_info( 722 self, 723 organization_id: StrictStr, 724 connector_id: StrictStr, 725 start_file_upload_to_connector_request: StartFileUploadToConnectorRequest, 726 _request_timeout: Union[ 727 None, 728 Annotated[StrictFloat, Field(gt=0)], 729 Tuple[ 730 Annotated[StrictFloat, Field(gt=0)], 731 Annotated[StrictFloat, Field(gt=0)] 732 ] 733 ] = None, 734 _request_auth: Optional[Dict[StrictStr, Any]] = None, 735 _content_type: Optional[StrictStr] = None, 736 _headers: Optional[Dict[StrictStr, Any]] = None, 737 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 738 ) -> ApiResponse[StartFileUploadToConnectorResponse]: 739 """Upload a file to a file upload connector 740 741 Upload a file to a file upload connector 742 743 :param organization_id: (required) 744 :type organization_id: str 745 :param connector_id: (required) 746 :type connector_id: str 747 :param start_file_upload_to_connector_request: (required) 748 :type start_file_upload_to_connector_request: StartFileUploadToConnectorRequest 749 :param _request_timeout: timeout setting for this request. If one 750 number provided, it will be total request 751 timeout. It can also be a pair (tuple) of 752 (connection, read) timeouts. 753 :type _request_timeout: int, tuple(int, int), optional 754 :param _request_auth: set to override the auth_settings for an a single 755 request; this effectively ignores the 756 authentication in the spec for a single request. 757 :type _request_auth: dict, optional 758 :param _content_type: force content-type for the request. 759 :type _content_type: str, Optional 760 :param _headers: set to override the headers for a single 761 request; this effectively ignores the headers 762 in the spec for a single request. 763 :type _headers: dict, optional 764 :param _host_index: set to override the host_index for a single 765 request; this effectively ignores the host_index 766 in the spec for a single request. 767 :type _host_index: int, optional 768 :return: Returns the result object. 769 """ # noqa: E501 770 771 _param = self._start_file_upload_to_connector_serialize( 772 organization_id=organization_id, 773 connector_id=connector_id, 774 start_file_upload_to_connector_request=start_file_upload_to_connector_request, 775 _request_auth=_request_auth, 776 _content_type=_content_type, 777 _headers=_headers, 778 _host_index=_host_index 779 ) 780 781 _response_types_map: Dict[str, Optional[str]] = { 782 '200': "StartFileUploadToConnectorResponse", 783 '400': "GetWorkspaces400Response", 784 '401': "GetWorkspaces400Response", 785 '403': "GetWorkspaces400Response", 786 '404': "GetWorkspaces400Response", 787 '500': "GetWorkspaces400Response", 788 } 789 response_data = self.api_client.call_api( 790 *_param, 791 _request_timeout=_request_timeout 792 ) 793 response_data.read() 794 return self.api_client.response_deserialize( 795 response_data=response_data, 796 response_types_map=_response_types_map, 797 ) 798 799 800 @validate_call 801 def start_file_upload_to_connector_without_preload_content( 802 self, 803 organization_id: StrictStr, 804 connector_id: StrictStr, 805 start_file_upload_to_connector_request: StartFileUploadToConnectorRequest, 806 _request_timeout: Union[ 807 None, 808 Annotated[StrictFloat, Field(gt=0)], 809 Tuple[ 810 Annotated[StrictFloat, Field(gt=0)], 811 Annotated[StrictFloat, Field(gt=0)] 812 ] 813 ] = None, 814 _request_auth: Optional[Dict[StrictStr, Any]] = None, 815 _content_type: Optional[StrictStr] = None, 816 _headers: Optional[Dict[StrictStr, Any]] = None, 817 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 818 ) -> RESTResponseType: 819 """Upload a file to a file upload connector 820 821 Upload a file to a file upload connector 822 823 :param organization_id: (required) 824 :type organization_id: str 825 :param connector_id: (required) 826 :type connector_id: str 827 :param start_file_upload_to_connector_request: (required) 828 :type start_file_upload_to_connector_request: StartFileUploadToConnectorRequest 829 :param _request_timeout: timeout setting for this request. If one 830 number provided, it will be total request 831 timeout. It can also be a pair (tuple) of 832 (connection, read) timeouts. 833 :type _request_timeout: int, tuple(int, int), optional 834 :param _request_auth: set to override the auth_settings for an a single 835 request; this effectively ignores the 836 authentication in the spec for a single request. 837 :type _request_auth: dict, optional 838 :param _content_type: force content-type for the request. 839 :type _content_type: str, Optional 840 :param _headers: set to override the headers for a single 841 request; this effectively ignores the headers 842 in the spec for a single request. 843 :type _headers: dict, optional 844 :param _host_index: set to override the host_index for a single 845 request; this effectively ignores the host_index 846 in the spec for a single request. 847 :type _host_index: int, optional 848 :return: Returns the result object. 849 """ # noqa: E501 850 851 _param = self._start_file_upload_to_connector_serialize( 852 organization_id=organization_id, 853 connector_id=connector_id, 854 start_file_upload_to_connector_request=start_file_upload_to_connector_request, 855 _request_auth=_request_auth, 856 _content_type=_content_type, 857 _headers=_headers, 858 _host_index=_host_index 859 ) 860 861 _response_types_map: Dict[str, Optional[str]] = { 862 '200': "StartFileUploadToConnectorResponse", 863 '400': "GetWorkspaces400Response", 864 '401': "GetWorkspaces400Response", 865 '403': "GetWorkspaces400Response", 866 '404': "GetWorkspaces400Response", 867 '500': "GetWorkspaces400Response", 868 } 869 response_data = self.api_client.call_api( 870 *_param, 871 _request_timeout=_request_timeout 872 ) 873 return response_data.response 874 875 876 def _start_file_upload_to_connector_serialize( 877 self, 878 organization_id, 879 connector_id, 880 start_file_upload_to_connector_request, 881 _request_auth, 882 _content_type, 883 _headers, 884 _host_index, 885 ) -> RequestSerialized: 886 887 _host = None 888 889 _collection_formats: Dict[str, str] = { 890 } 891 892 _path_params: Dict[str, str] = {} 893 _query_params: List[Tuple[str, str]] = [] 894 _header_params: Dict[str, Optional[str]] = _headers or {} 895 _form_params: List[Tuple[str, str]] = [] 896 _files: Dict[ 897 str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] 898 ] = {} 899 _body_params: Optional[bytes] = None 900 901 # process the path parameters 902 if organization_id is not None: 903 _path_params['organizationId'] = organization_id 904 if connector_id is not None: 905 _path_params['connectorId'] = connector_id 906 # process the query parameters 907 # process the header parameters 908 # process the form parameters 909 # process the body parameter 910 if start_file_upload_to_connector_request is not None: 911 _body_params = start_file_upload_to_connector_request 912 913 914 # set the HTTP header `Accept` 915 if 'Accept' not in _header_params: 916 _header_params['Accept'] = self.api_client.select_header_accept( 917 [ 918 'application/json' 919 ] 920 ) 921 922 # set the HTTP header `Content-Type` 923 if _content_type: 924 _header_params['Content-Type'] = _content_type 925 else: 926 _default_content_type = ( 927 self.api_client.select_header_content_type( 928 [ 929 'application/json' 930 ] 931 ) 932 ) 933 if _default_content_type is not None: 934 _header_params['Content-Type'] = _default_content_type 935 936 # authentication setting 937 _auth_settings: List[str] = [ 938 'bearerAuth' 939 ] 940 941 return self.api_client.param_serialize( 942 method='PUT', 943 resource_path='/org/{organizationId}/uploads/{connectorId}/files', 944 path_params=_path_params, 945 query_params=_query_params, 946 header_params=_header_params, 947 body=_body_params, 948 post_params=_form_params, 949 files=_files, 950 auth_settings=_auth_settings, 951 collection_formats=_collection_formats, 952 _host=_host, 953 _request_auth=_request_auth 954 )
31class UploadsApi: 32 """NOTE: This class is auto generated by OpenAPI Generator 33 Ref: https://openapi-generator.tech 34 35 Do not edit the class manually. 36 """ 37 38 def __init__(self, api_client=None) -> None: 39 if api_client is None: 40 api_client = ApiClient.get_default() 41 self.api_client = api_client 42 43 44 @validate_call 45 def delete_file_from_connector( 46 self, 47 organization_id: StrictStr, 48 connector_id: StrictStr, 49 file_name: StrictStr, 50 _request_timeout: Union[ 51 None, 52 Annotated[StrictFloat, Field(gt=0)], 53 Tuple[ 54 Annotated[StrictFloat, Field(gt=0)], 55 Annotated[StrictFloat, Field(gt=0)] 56 ] 57 ] = None, 58 _request_auth: Optional[Dict[StrictStr, Any]] = None, 59 _content_type: Optional[StrictStr] = None, 60 _headers: Optional[Dict[StrictStr, Any]] = None, 61 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 62 ) -> DeleteFileResponse: 63 """Delete a file from a File Upload connector 64 65 Delete a file from a File Upload connector 66 67 :param organization_id: (required) 68 :type organization_id: str 69 :param connector_id: (required) 70 :type connector_id: str 71 :param file_name: (required) 72 :type file_name: str 73 :param _request_timeout: timeout setting for this request. If one 74 number provided, it will be total request 75 timeout. It can also be a pair (tuple) of 76 (connection, read) timeouts. 77 :type _request_timeout: int, tuple(int, int), optional 78 :param _request_auth: set to override the auth_settings for an a single 79 request; this effectively ignores the 80 authentication in the spec for a single request. 81 :type _request_auth: dict, optional 82 :param _content_type: force content-type for the request. 83 :type _content_type: str, Optional 84 :param _headers: set to override the headers for a single 85 request; this effectively ignores the headers 86 in the spec for a single request. 87 :type _headers: dict, optional 88 :param _host_index: set to override the host_index for a single 89 request; this effectively ignores the host_index 90 in the spec for a single request. 91 :type _host_index: int, optional 92 :return: Returns the result object. 93 """ # noqa: E501 94 95 _param = self._delete_file_from_connector_serialize( 96 organization_id=organization_id, 97 connector_id=connector_id, 98 file_name=file_name, 99 _request_auth=_request_auth, 100 _content_type=_content_type, 101 _headers=_headers, 102 _host_index=_host_index 103 ) 104 105 _response_types_map: Dict[str, Optional[str]] = { 106 '200': "DeleteFileResponse", 107 '400': "GetWorkspaces400Response", 108 '401': "GetWorkspaces400Response", 109 '403': "GetWorkspaces400Response", 110 '404': "GetWorkspaces400Response", 111 '500': "GetWorkspaces400Response", 112 } 113 response_data = self.api_client.call_api( 114 *_param, 115 _request_timeout=_request_timeout 116 ) 117 response_data.read() 118 return self.api_client.response_deserialize( 119 response_data=response_data, 120 response_types_map=_response_types_map, 121 ).data 122 123 124 @validate_call 125 def delete_file_from_connector_with_http_info( 126 self, 127 organization_id: StrictStr, 128 connector_id: StrictStr, 129 file_name: StrictStr, 130 _request_timeout: Union[ 131 None, 132 Annotated[StrictFloat, Field(gt=0)], 133 Tuple[ 134 Annotated[StrictFloat, Field(gt=0)], 135 Annotated[StrictFloat, Field(gt=0)] 136 ] 137 ] = None, 138 _request_auth: Optional[Dict[StrictStr, Any]] = None, 139 _content_type: Optional[StrictStr] = None, 140 _headers: Optional[Dict[StrictStr, Any]] = None, 141 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 142 ) -> ApiResponse[DeleteFileResponse]: 143 """Delete a file from a File Upload connector 144 145 Delete a file from a File Upload connector 146 147 :param organization_id: (required) 148 :type organization_id: str 149 :param connector_id: (required) 150 :type connector_id: str 151 :param file_name: (required) 152 :type file_name: str 153 :param _request_timeout: timeout setting for this request. If one 154 number provided, it will be total request 155 timeout. It can also be a pair (tuple) of 156 (connection, read) timeouts. 157 :type _request_timeout: int, tuple(int, int), optional 158 :param _request_auth: set to override the auth_settings for an a single 159 request; this effectively ignores the 160 authentication in the spec for a single request. 161 :type _request_auth: dict, optional 162 :param _content_type: force content-type for the request. 163 :type _content_type: str, Optional 164 :param _headers: set to override the headers for a single 165 request; this effectively ignores the headers 166 in the spec for a single request. 167 :type _headers: dict, optional 168 :param _host_index: set to override the host_index for a single 169 request; this effectively ignores the host_index 170 in the spec for a single request. 171 :type _host_index: int, optional 172 :return: Returns the result object. 173 """ # noqa: E501 174 175 _param = self._delete_file_from_connector_serialize( 176 organization_id=organization_id, 177 connector_id=connector_id, 178 file_name=file_name, 179 _request_auth=_request_auth, 180 _content_type=_content_type, 181 _headers=_headers, 182 _host_index=_host_index 183 ) 184 185 _response_types_map: Dict[str, Optional[str]] = { 186 '200': "DeleteFileResponse", 187 '400': "GetWorkspaces400Response", 188 '401': "GetWorkspaces400Response", 189 '403': "GetWorkspaces400Response", 190 '404': "GetWorkspaces400Response", 191 '500': "GetWorkspaces400Response", 192 } 193 response_data = self.api_client.call_api( 194 *_param, 195 _request_timeout=_request_timeout 196 ) 197 response_data.read() 198 return self.api_client.response_deserialize( 199 response_data=response_data, 200 response_types_map=_response_types_map, 201 ) 202 203 204 @validate_call 205 def delete_file_from_connector_without_preload_content( 206 self, 207 organization_id: StrictStr, 208 connector_id: StrictStr, 209 file_name: StrictStr, 210 _request_timeout: Union[ 211 None, 212 Annotated[StrictFloat, Field(gt=0)], 213 Tuple[ 214 Annotated[StrictFloat, Field(gt=0)], 215 Annotated[StrictFloat, Field(gt=0)] 216 ] 217 ] = None, 218 _request_auth: Optional[Dict[StrictStr, Any]] = None, 219 _content_type: Optional[StrictStr] = None, 220 _headers: Optional[Dict[StrictStr, Any]] = None, 221 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 222 ) -> RESTResponseType: 223 """Delete a file from a File Upload connector 224 225 Delete a file from a File Upload connector 226 227 :param organization_id: (required) 228 :type organization_id: str 229 :param connector_id: (required) 230 :type connector_id: str 231 :param file_name: (required) 232 :type file_name: str 233 :param _request_timeout: timeout setting for this request. If one 234 number provided, it will be total request 235 timeout. It can also be a pair (tuple) of 236 (connection, read) timeouts. 237 :type _request_timeout: int, tuple(int, int), optional 238 :param _request_auth: set to override the auth_settings for an a single 239 request; this effectively ignores the 240 authentication in the spec for a single request. 241 :type _request_auth: dict, optional 242 :param _content_type: force content-type for the request. 243 :type _content_type: str, Optional 244 :param _headers: set to override the headers for a single 245 request; this effectively ignores the headers 246 in the spec for a single request. 247 :type _headers: dict, optional 248 :param _host_index: set to override the host_index for a single 249 request; this effectively ignores the host_index 250 in the spec for a single request. 251 :type _host_index: int, optional 252 :return: Returns the result object. 253 """ # noqa: E501 254 255 _param = self._delete_file_from_connector_serialize( 256 organization_id=organization_id, 257 connector_id=connector_id, 258 file_name=file_name, 259 _request_auth=_request_auth, 260 _content_type=_content_type, 261 _headers=_headers, 262 _host_index=_host_index 263 ) 264 265 _response_types_map: Dict[str, Optional[str]] = { 266 '200': "DeleteFileResponse", 267 '400': "GetWorkspaces400Response", 268 '401': "GetWorkspaces400Response", 269 '403': "GetWorkspaces400Response", 270 '404': "GetWorkspaces400Response", 271 '500': "GetWorkspaces400Response", 272 } 273 response_data = self.api_client.call_api( 274 *_param, 275 _request_timeout=_request_timeout 276 ) 277 return response_data.response 278 279 280 def _delete_file_from_connector_serialize( 281 self, 282 organization_id, 283 connector_id, 284 file_name, 285 _request_auth, 286 _content_type, 287 _headers, 288 _host_index, 289 ) -> RequestSerialized: 290 291 _host = None 292 293 _collection_formats: Dict[str, str] = { 294 } 295 296 _path_params: Dict[str, str] = {} 297 _query_params: List[Tuple[str, str]] = [] 298 _header_params: Dict[str, Optional[str]] = _headers or {} 299 _form_params: List[Tuple[str, str]] = [] 300 _files: Dict[ 301 str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] 302 ] = {} 303 _body_params: Optional[bytes] = None 304 305 # process the path parameters 306 if organization_id is not None: 307 _path_params['organizationId'] = organization_id 308 if connector_id is not None: 309 _path_params['connectorId'] = connector_id 310 if file_name is not None: 311 _path_params['fileName'] = file_name 312 # process the query parameters 313 # process the header parameters 314 # process the form parameters 315 # process the body parameter 316 317 318 # set the HTTP header `Accept` 319 if 'Accept' not in _header_params: 320 _header_params['Accept'] = self.api_client.select_header_accept( 321 [ 322 'application/json' 323 ] 324 ) 325 326 327 # authentication setting 328 _auth_settings: List[str] = [ 329 'bearerAuth' 330 ] 331 332 return self.api_client.param_serialize( 333 method='DELETE', 334 resource_path='/org/{organizationId}/uploads/{connectorId}/files/{fileName}', 335 path_params=_path_params, 336 query_params=_query_params, 337 header_params=_header_params, 338 body=_body_params, 339 post_params=_form_params, 340 files=_files, 341 auth_settings=_auth_settings, 342 collection_formats=_collection_formats, 343 _host=_host, 344 _request_auth=_request_auth 345 ) 346 347 348 349 350 @validate_call 351 def get_upload_files_from_connector( 352 self, 353 organization_id: StrictStr, 354 connector_id: StrictStr, 355 _request_timeout: Union[ 356 None, 357 Annotated[StrictFloat, Field(gt=0)], 358 Tuple[ 359 Annotated[StrictFloat, Field(gt=0)], 360 Annotated[StrictFloat, Field(gt=0)] 361 ] 362 ] = None, 363 _request_auth: Optional[Dict[StrictStr, Any]] = None, 364 _content_type: Optional[StrictStr] = None, 365 _headers: Optional[Dict[StrictStr, Any]] = None, 366 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 367 ) -> GetUploadFilesResponse: 368 """Get uploaded files from a file upload connector 369 370 Get uploaded files from a file upload connector 371 372 :param organization_id: (required) 373 :type organization_id: str 374 :param connector_id: (required) 375 :type connector_id: str 376 :param _request_timeout: timeout setting for this request. If one 377 number provided, it will be total request 378 timeout. It can also be a pair (tuple) of 379 (connection, read) timeouts. 380 :type _request_timeout: int, tuple(int, int), optional 381 :param _request_auth: set to override the auth_settings for an a single 382 request; this effectively ignores the 383 authentication in the spec for a single request. 384 :type _request_auth: dict, optional 385 :param _content_type: force content-type for the request. 386 :type _content_type: str, Optional 387 :param _headers: set to override the headers for a single 388 request; this effectively ignores the headers 389 in the spec for a single request. 390 :type _headers: dict, optional 391 :param _host_index: set to override the host_index for a single 392 request; this effectively ignores the host_index 393 in the spec for a single request. 394 :type _host_index: int, optional 395 :return: Returns the result object. 396 """ # noqa: E501 397 398 _param = self._get_upload_files_from_connector_serialize( 399 organization_id=organization_id, 400 connector_id=connector_id, 401 _request_auth=_request_auth, 402 _content_type=_content_type, 403 _headers=_headers, 404 _host_index=_host_index 405 ) 406 407 _response_types_map: Dict[str, Optional[str]] = { 408 '200': "GetUploadFilesResponse", 409 '400': "GetWorkspaces400Response", 410 '401': "GetWorkspaces400Response", 411 '403': "GetWorkspaces400Response", 412 '404': "GetWorkspaces400Response", 413 '500': "GetWorkspaces400Response", 414 } 415 response_data = self.api_client.call_api( 416 *_param, 417 _request_timeout=_request_timeout 418 ) 419 response_data.read() 420 return self.api_client.response_deserialize( 421 response_data=response_data, 422 response_types_map=_response_types_map, 423 ).data 424 425 426 @validate_call 427 def get_upload_files_from_connector_with_http_info( 428 self, 429 organization_id: StrictStr, 430 connector_id: StrictStr, 431 _request_timeout: Union[ 432 None, 433 Annotated[StrictFloat, Field(gt=0)], 434 Tuple[ 435 Annotated[StrictFloat, Field(gt=0)], 436 Annotated[StrictFloat, Field(gt=0)] 437 ] 438 ] = None, 439 _request_auth: Optional[Dict[StrictStr, Any]] = None, 440 _content_type: Optional[StrictStr] = None, 441 _headers: Optional[Dict[StrictStr, Any]] = None, 442 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 443 ) -> ApiResponse[GetUploadFilesResponse]: 444 """Get uploaded files from a file upload connector 445 446 Get uploaded files from a file upload connector 447 448 :param organization_id: (required) 449 :type organization_id: str 450 :param connector_id: (required) 451 :type connector_id: str 452 :param _request_timeout: timeout setting for this request. If one 453 number provided, it will be total request 454 timeout. It can also be a pair (tuple) of 455 (connection, read) timeouts. 456 :type _request_timeout: int, tuple(int, int), optional 457 :param _request_auth: set to override the auth_settings for an a single 458 request; this effectively ignores the 459 authentication in the spec for a single request. 460 :type _request_auth: dict, optional 461 :param _content_type: force content-type for the request. 462 :type _content_type: str, Optional 463 :param _headers: set to override the headers for a single 464 request; this effectively ignores the headers 465 in the spec for a single request. 466 :type _headers: dict, optional 467 :param _host_index: set to override the host_index for a single 468 request; this effectively ignores the host_index 469 in the spec for a single request. 470 :type _host_index: int, optional 471 :return: Returns the result object. 472 """ # noqa: E501 473 474 _param = self._get_upload_files_from_connector_serialize( 475 organization_id=organization_id, 476 connector_id=connector_id, 477 _request_auth=_request_auth, 478 _content_type=_content_type, 479 _headers=_headers, 480 _host_index=_host_index 481 ) 482 483 _response_types_map: Dict[str, Optional[str]] = { 484 '200': "GetUploadFilesResponse", 485 '400': "GetWorkspaces400Response", 486 '401': "GetWorkspaces400Response", 487 '403': "GetWorkspaces400Response", 488 '404': "GetWorkspaces400Response", 489 '500': "GetWorkspaces400Response", 490 } 491 response_data = self.api_client.call_api( 492 *_param, 493 _request_timeout=_request_timeout 494 ) 495 response_data.read() 496 return self.api_client.response_deserialize( 497 response_data=response_data, 498 response_types_map=_response_types_map, 499 ) 500 501 502 @validate_call 503 def get_upload_files_from_connector_without_preload_content( 504 self, 505 organization_id: StrictStr, 506 connector_id: StrictStr, 507 _request_timeout: Union[ 508 None, 509 Annotated[StrictFloat, Field(gt=0)], 510 Tuple[ 511 Annotated[StrictFloat, Field(gt=0)], 512 Annotated[StrictFloat, Field(gt=0)] 513 ] 514 ] = None, 515 _request_auth: Optional[Dict[StrictStr, Any]] = None, 516 _content_type: Optional[StrictStr] = None, 517 _headers: Optional[Dict[StrictStr, Any]] = None, 518 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 519 ) -> RESTResponseType: 520 """Get uploaded files from a file upload connector 521 522 Get uploaded files from a file upload connector 523 524 :param organization_id: (required) 525 :type organization_id: str 526 :param connector_id: (required) 527 :type connector_id: str 528 :param _request_timeout: timeout setting for this request. If one 529 number provided, it will be total request 530 timeout. It can also be a pair (tuple) of 531 (connection, read) timeouts. 532 :type _request_timeout: int, tuple(int, int), optional 533 :param _request_auth: set to override the auth_settings for an a single 534 request; this effectively ignores the 535 authentication in the spec for a single request. 536 :type _request_auth: dict, optional 537 :param _content_type: force content-type for the request. 538 :type _content_type: str, Optional 539 :param _headers: set to override the headers for a single 540 request; this effectively ignores the headers 541 in the spec for a single request. 542 :type _headers: dict, optional 543 :param _host_index: set to override the host_index for a single 544 request; this effectively ignores the host_index 545 in the spec for a single request. 546 :type _host_index: int, optional 547 :return: Returns the result object. 548 """ # noqa: E501 549 550 _param = self._get_upload_files_from_connector_serialize( 551 organization_id=organization_id, 552 connector_id=connector_id, 553 _request_auth=_request_auth, 554 _content_type=_content_type, 555 _headers=_headers, 556 _host_index=_host_index 557 ) 558 559 _response_types_map: Dict[str, Optional[str]] = { 560 '200': "GetUploadFilesResponse", 561 '400': "GetWorkspaces400Response", 562 '401': "GetWorkspaces400Response", 563 '403': "GetWorkspaces400Response", 564 '404': "GetWorkspaces400Response", 565 '500': "GetWorkspaces400Response", 566 } 567 response_data = self.api_client.call_api( 568 *_param, 569 _request_timeout=_request_timeout 570 ) 571 return response_data.response 572 573 574 def _get_upload_files_from_connector_serialize( 575 self, 576 organization_id, 577 connector_id, 578 _request_auth, 579 _content_type, 580 _headers, 581 _host_index, 582 ) -> RequestSerialized: 583 584 _host = None 585 586 _collection_formats: Dict[str, str] = { 587 } 588 589 _path_params: Dict[str, str] = {} 590 _query_params: List[Tuple[str, str]] = [] 591 _header_params: Dict[str, Optional[str]] = _headers or {} 592 _form_params: List[Tuple[str, str]] = [] 593 _files: Dict[ 594 str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] 595 ] = {} 596 _body_params: Optional[bytes] = None 597 598 # process the path parameters 599 if organization_id is not None: 600 _path_params['organizationId'] = organization_id 601 if connector_id is not None: 602 _path_params['connectorId'] = connector_id 603 # process the query parameters 604 # process the header parameters 605 # process the form parameters 606 # process the body parameter 607 608 609 # set the HTTP header `Accept` 610 if 'Accept' not in _header_params: 611 _header_params['Accept'] = self.api_client.select_header_accept( 612 [ 613 'application/json' 614 ] 615 ) 616 617 618 # authentication setting 619 _auth_settings: List[str] = [ 620 'bearerAuth' 621 ] 622 623 return self.api_client.param_serialize( 624 method='GET', 625 resource_path='/org/{organizationId}/uploads/{connectorId}/files', 626 path_params=_path_params, 627 query_params=_query_params, 628 header_params=_header_params, 629 body=_body_params, 630 post_params=_form_params, 631 files=_files, 632 auth_settings=_auth_settings, 633 collection_formats=_collection_formats, 634 _host=_host, 635 _request_auth=_request_auth 636 ) 637 638 639 640 641 @validate_call 642 def start_file_upload_to_connector( 643 self, 644 organization_id: StrictStr, 645 connector_id: StrictStr, 646 start_file_upload_to_connector_request: StartFileUploadToConnectorRequest, 647 _request_timeout: Union[ 648 None, 649 Annotated[StrictFloat, Field(gt=0)], 650 Tuple[ 651 Annotated[StrictFloat, Field(gt=0)], 652 Annotated[StrictFloat, Field(gt=0)] 653 ] 654 ] = None, 655 _request_auth: Optional[Dict[StrictStr, Any]] = None, 656 _content_type: Optional[StrictStr] = None, 657 _headers: Optional[Dict[StrictStr, Any]] = None, 658 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 659 ) -> StartFileUploadToConnectorResponse: 660 """Upload a file to a file upload connector 661 662 Upload a file to a file upload connector 663 664 :param organization_id: (required) 665 :type organization_id: str 666 :param connector_id: (required) 667 :type connector_id: str 668 :param start_file_upload_to_connector_request: (required) 669 :type start_file_upload_to_connector_request: StartFileUploadToConnectorRequest 670 :param _request_timeout: timeout setting for this request. If one 671 number provided, it will be total request 672 timeout. It can also be a pair (tuple) of 673 (connection, read) timeouts. 674 :type _request_timeout: int, tuple(int, int), optional 675 :param _request_auth: set to override the auth_settings for an a single 676 request; this effectively ignores the 677 authentication in the spec for a single request. 678 :type _request_auth: dict, optional 679 :param _content_type: force content-type for the request. 680 :type _content_type: str, Optional 681 :param _headers: set to override the headers for a single 682 request; this effectively ignores the headers 683 in the spec for a single request. 684 :type _headers: dict, optional 685 :param _host_index: set to override the host_index for a single 686 request; this effectively ignores the host_index 687 in the spec for a single request. 688 :type _host_index: int, optional 689 :return: Returns the result object. 690 """ # noqa: E501 691 692 _param = self._start_file_upload_to_connector_serialize( 693 organization_id=organization_id, 694 connector_id=connector_id, 695 start_file_upload_to_connector_request=start_file_upload_to_connector_request, 696 _request_auth=_request_auth, 697 _content_type=_content_type, 698 _headers=_headers, 699 _host_index=_host_index 700 ) 701 702 _response_types_map: Dict[str, Optional[str]] = { 703 '200': "StartFileUploadToConnectorResponse", 704 '400': "GetWorkspaces400Response", 705 '401': "GetWorkspaces400Response", 706 '403': "GetWorkspaces400Response", 707 '404': "GetWorkspaces400Response", 708 '500': "GetWorkspaces400Response", 709 } 710 response_data = self.api_client.call_api( 711 *_param, 712 _request_timeout=_request_timeout 713 ) 714 response_data.read() 715 return self.api_client.response_deserialize( 716 response_data=response_data, 717 response_types_map=_response_types_map, 718 ).data 719 720 721 @validate_call 722 def start_file_upload_to_connector_with_http_info( 723 self, 724 organization_id: StrictStr, 725 connector_id: StrictStr, 726 start_file_upload_to_connector_request: StartFileUploadToConnectorRequest, 727 _request_timeout: Union[ 728 None, 729 Annotated[StrictFloat, Field(gt=0)], 730 Tuple[ 731 Annotated[StrictFloat, Field(gt=0)], 732 Annotated[StrictFloat, Field(gt=0)] 733 ] 734 ] = None, 735 _request_auth: Optional[Dict[StrictStr, Any]] = None, 736 _content_type: Optional[StrictStr] = None, 737 _headers: Optional[Dict[StrictStr, Any]] = None, 738 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 739 ) -> ApiResponse[StartFileUploadToConnectorResponse]: 740 """Upload a file to a file upload connector 741 742 Upload a file to a file upload connector 743 744 :param organization_id: (required) 745 :type organization_id: str 746 :param connector_id: (required) 747 :type connector_id: str 748 :param start_file_upload_to_connector_request: (required) 749 :type start_file_upload_to_connector_request: StartFileUploadToConnectorRequest 750 :param _request_timeout: timeout setting for this request. If one 751 number provided, it will be total request 752 timeout. It can also be a pair (tuple) of 753 (connection, read) timeouts. 754 :type _request_timeout: int, tuple(int, int), optional 755 :param _request_auth: set to override the auth_settings for an a single 756 request; this effectively ignores the 757 authentication in the spec for a single request. 758 :type _request_auth: dict, optional 759 :param _content_type: force content-type for the request. 760 :type _content_type: str, Optional 761 :param _headers: set to override the headers for a single 762 request; this effectively ignores the headers 763 in the spec for a single request. 764 :type _headers: dict, optional 765 :param _host_index: set to override the host_index for a single 766 request; this effectively ignores the host_index 767 in the spec for a single request. 768 :type _host_index: int, optional 769 :return: Returns the result object. 770 """ # noqa: E501 771 772 _param = self._start_file_upload_to_connector_serialize( 773 organization_id=organization_id, 774 connector_id=connector_id, 775 start_file_upload_to_connector_request=start_file_upload_to_connector_request, 776 _request_auth=_request_auth, 777 _content_type=_content_type, 778 _headers=_headers, 779 _host_index=_host_index 780 ) 781 782 _response_types_map: Dict[str, Optional[str]] = { 783 '200': "StartFileUploadToConnectorResponse", 784 '400': "GetWorkspaces400Response", 785 '401': "GetWorkspaces400Response", 786 '403': "GetWorkspaces400Response", 787 '404': "GetWorkspaces400Response", 788 '500': "GetWorkspaces400Response", 789 } 790 response_data = self.api_client.call_api( 791 *_param, 792 _request_timeout=_request_timeout 793 ) 794 response_data.read() 795 return self.api_client.response_deserialize( 796 response_data=response_data, 797 response_types_map=_response_types_map, 798 ) 799 800 801 @validate_call 802 def start_file_upload_to_connector_without_preload_content( 803 self, 804 organization_id: StrictStr, 805 connector_id: StrictStr, 806 start_file_upload_to_connector_request: StartFileUploadToConnectorRequest, 807 _request_timeout: Union[ 808 None, 809 Annotated[StrictFloat, Field(gt=0)], 810 Tuple[ 811 Annotated[StrictFloat, Field(gt=0)], 812 Annotated[StrictFloat, Field(gt=0)] 813 ] 814 ] = None, 815 _request_auth: Optional[Dict[StrictStr, Any]] = None, 816 _content_type: Optional[StrictStr] = None, 817 _headers: Optional[Dict[StrictStr, Any]] = None, 818 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 819 ) -> RESTResponseType: 820 """Upload a file to a file upload connector 821 822 Upload a file to a file upload connector 823 824 :param organization_id: (required) 825 :type organization_id: str 826 :param connector_id: (required) 827 :type connector_id: str 828 :param start_file_upload_to_connector_request: (required) 829 :type start_file_upload_to_connector_request: StartFileUploadToConnectorRequest 830 :param _request_timeout: timeout setting for this request. If one 831 number provided, it will be total request 832 timeout. It can also be a pair (tuple) of 833 (connection, read) timeouts. 834 :type _request_timeout: int, tuple(int, int), optional 835 :param _request_auth: set to override the auth_settings for an a single 836 request; this effectively ignores the 837 authentication in the spec for a single request. 838 :type _request_auth: dict, optional 839 :param _content_type: force content-type for the request. 840 :type _content_type: str, Optional 841 :param _headers: set to override the headers for a single 842 request; this effectively ignores the headers 843 in the spec for a single request. 844 :type _headers: dict, optional 845 :param _host_index: set to override the host_index for a single 846 request; this effectively ignores the host_index 847 in the spec for a single request. 848 :type _host_index: int, optional 849 :return: Returns the result object. 850 """ # noqa: E501 851 852 _param = self._start_file_upload_to_connector_serialize( 853 organization_id=organization_id, 854 connector_id=connector_id, 855 start_file_upload_to_connector_request=start_file_upload_to_connector_request, 856 _request_auth=_request_auth, 857 _content_type=_content_type, 858 _headers=_headers, 859 _host_index=_host_index 860 ) 861 862 _response_types_map: Dict[str, Optional[str]] = { 863 '200': "StartFileUploadToConnectorResponse", 864 '400': "GetWorkspaces400Response", 865 '401': "GetWorkspaces400Response", 866 '403': "GetWorkspaces400Response", 867 '404': "GetWorkspaces400Response", 868 '500': "GetWorkspaces400Response", 869 } 870 response_data = self.api_client.call_api( 871 *_param, 872 _request_timeout=_request_timeout 873 ) 874 return response_data.response 875 876 877 def _start_file_upload_to_connector_serialize( 878 self, 879 organization_id, 880 connector_id, 881 start_file_upload_to_connector_request, 882 _request_auth, 883 _content_type, 884 _headers, 885 _host_index, 886 ) -> RequestSerialized: 887 888 _host = None 889 890 _collection_formats: Dict[str, str] = { 891 } 892 893 _path_params: Dict[str, str] = {} 894 _query_params: List[Tuple[str, str]] = [] 895 _header_params: Dict[str, Optional[str]] = _headers or {} 896 _form_params: List[Tuple[str, str]] = [] 897 _files: Dict[ 898 str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] 899 ] = {} 900 _body_params: Optional[bytes] = None 901 902 # process the path parameters 903 if organization_id is not None: 904 _path_params['organizationId'] = organization_id 905 if connector_id is not None: 906 _path_params['connectorId'] = connector_id 907 # process the query parameters 908 # process the header parameters 909 # process the form parameters 910 # process the body parameter 911 if start_file_upload_to_connector_request is not None: 912 _body_params = start_file_upload_to_connector_request 913 914 915 # set the HTTP header `Accept` 916 if 'Accept' not in _header_params: 917 _header_params['Accept'] = self.api_client.select_header_accept( 918 [ 919 'application/json' 920 ] 921 ) 922 923 # set the HTTP header `Content-Type` 924 if _content_type: 925 _header_params['Content-Type'] = _content_type 926 else: 927 _default_content_type = ( 928 self.api_client.select_header_content_type( 929 [ 930 'application/json' 931 ] 932 ) 933 ) 934 if _default_content_type is not None: 935 _header_params['Content-Type'] = _default_content_type 936 937 # authentication setting 938 _auth_settings: List[str] = [ 939 'bearerAuth' 940 ] 941 942 return self.api_client.param_serialize( 943 method='PUT', 944 resource_path='/org/{organizationId}/uploads/{connectorId}/files', 945 path_params=_path_params, 946 query_params=_query_params, 947 header_params=_header_params, 948 body=_body_params, 949 post_params=_form_params, 950 files=_files, 951 auth_settings=_auth_settings, 952 collection_formats=_collection_formats, 953 _host=_host, 954 _request_auth=_request_auth 955 )
NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech
Do not edit the class manually.
44 @validate_call 45 def delete_file_from_connector( 46 self, 47 organization_id: StrictStr, 48 connector_id: StrictStr, 49 file_name: StrictStr, 50 _request_timeout: Union[ 51 None, 52 Annotated[StrictFloat, Field(gt=0)], 53 Tuple[ 54 Annotated[StrictFloat, Field(gt=0)], 55 Annotated[StrictFloat, Field(gt=0)] 56 ] 57 ] = None, 58 _request_auth: Optional[Dict[StrictStr, Any]] = None, 59 _content_type: Optional[StrictStr] = None, 60 _headers: Optional[Dict[StrictStr, Any]] = None, 61 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 62 ) -> DeleteFileResponse: 63 """Delete a file from a File Upload connector 64 65 Delete a file from a File Upload connector 66 67 :param organization_id: (required) 68 :type organization_id: str 69 :param connector_id: (required) 70 :type connector_id: str 71 :param file_name: (required) 72 :type file_name: str 73 :param _request_timeout: timeout setting for this request. If one 74 number provided, it will be total request 75 timeout. It can also be a pair (tuple) of 76 (connection, read) timeouts. 77 :type _request_timeout: int, tuple(int, int), optional 78 :param _request_auth: set to override the auth_settings for an a single 79 request; this effectively ignores the 80 authentication in the spec for a single request. 81 :type _request_auth: dict, optional 82 :param _content_type: force content-type for the request. 83 :type _content_type: str, Optional 84 :param _headers: set to override the headers for a single 85 request; this effectively ignores the headers 86 in the spec for a single request. 87 :type _headers: dict, optional 88 :param _host_index: set to override the host_index for a single 89 request; this effectively ignores the host_index 90 in the spec for a single request. 91 :type _host_index: int, optional 92 :return: Returns the result object. 93 """ # noqa: E501 94 95 _param = self._delete_file_from_connector_serialize( 96 organization_id=organization_id, 97 connector_id=connector_id, 98 file_name=file_name, 99 _request_auth=_request_auth, 100 _content_type=_content_type, 101 _headers=_headers, 102 _host_index=_host_index 103 ) 104 105 _response_types_map: Dict[str, Optional[str]] = { 106 '200': "DeleteFileResponse", 107 '400': "GetWorkspaces400Response", 108 '401': "GetWorkspaces400Response", 109 '403': "GetWorkspaces400Response", 110 '404': "GetWorkspaces400Response", 111 '500': "GetWorkspaces400Response", 112 } 113 response_data = self.api_client.call_api( 114 *_param, 115 _request_timeout=_request_timeout 116 ) 117 response_data.read() 118 return self.api_client.response_deserialize( 119 response_data=response_data, 120 response_types_map=_response_types_map, 121 ).data
Delete a file from a File Upload connector
Delete a file from a File Upload connector
Parameters
- organization_id: (required)
- connector_id: (required)
- file_name: (required)
- _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.
- _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
- _content_type: force content-type for the request.
- _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
- _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
Returns
Returns the result object.
124 @validate_call 125 def delete_file_from_connector_with_http_info( 126 self, 127 organization_id: StrictStr, 128 connector_id: StrictStr, 129 file_name: StrictStr, 130 _request_timeout: Union[ 131 None, 132 Annotated[StrictFloat, Field(gt=0)], 133 Tuple[ 134 Annotated[StrictFloat, Field(gt=0)], 135 Annotated[StrictFloat, Field(gt=0)] 136 ] 137 ] = None, 138 _request_auth: Optional[Dict[StrictStr, Any]] = None, 139 _content_type: Optional[StrictStr] = None, 140 _headers: Optional[Dict[StrictStr, Any]] = None, 141 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 142 ) -> ApiResponse[DeleteFileResponse]: 143 """Delete a file from a File Upload connector 144 145 Delete a file from a File Upload connector 146 147 :param organization_id: (required) 148 :type organization_id: str 149 :param connector_id: (required) 150 :type connector_id: str 151 :param file_name: (required) 152 :type file_name: str 153 :param _request_timeout: timeout setting for this request. If one 154 number provided, it will be total request 155 timeout. It can also be a pair (tuple) of 156 (connection, read) timeouts. 157 :type _request_timeout: int, tuple(int, int), optional 158 :param _request_auth: set to override the auth_settings for an a single 159 request; this effectively ignores the 160 authentication in the spec for a single request. 161 :type _request_auth: dict, optional 162 :param _content_type: force content-type for the request. 163 :type _content_type: str, Optional 164 :param _headers: set to override the headers for a single 165 request; this effectively ignores the headers 166 in the spec for a single request. 167 :type _headers: dict, optional 168 :param _host_index: set to override the host_index for a single 169 request; this effectively ignores the host_index 170 in the spec for a single request. 171 :type _host_index: int, optional 172 :return: Returns the result object. 173 """ # noqa: E501 174 175 _param = self._delete_file_from_connector_serialize( 176 organization_id=organization_id, 177 connector_id=connector_id, 178 file_name=file_name, 179 _request_auth=_request_auth, 180 _content_type=_content_type, 181 _headers=_headers, 182 _host_index=_host_index 183 ) 184 185 _response_types_map: Dict[str, Optional[str]] = { 186 '200': "DeleteFileResponse", 187 '400': "GetWorkspaces400Response", 188 '401': "GetWorkspaces400Response", 189 '403': "GetWorkspaces400Response", 190 '404': "GetWorkspaces400Response", 191 '500': "GetWorkspaces400Response", 192 } 193 response_data = self.api_client.call_api( 194 *_param, 195 _request_timeout=_request_timeout 196 ) 197 response_data.read() 198 return self.api_client.response_deserialize( 199 response_data=response_data, 200 response_types_map=_response_types_map, 201 )
Delete a file from a File Upload connector
Delete a file from a File Upload connector
Parameters
- organization_id: (required)
- connector_id: (required)
- file_name: (required)
- _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.
- _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
- _content_type: force content-type for the request.
- _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
- _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
Returns
Returns the result object.
204 @validate_call 205 def delete_file_from_connector_without_preload_content( 206 self, 207 organization_id: StrictStr, 208 connector_id: StrictStr, 209 file_name: StrictStr, 210 _request_timeout: Union[ 211 None, 212 Annotated[StrictFloat, Field(gt=0)], 213 Tuple[ 214 Annotated[StrictFloat, Field(gt=0)], 215 Annotated[StrictFloat, Field(gt=0)] 216 ] 217 ] = None, 218 _request_auth: Optional[Dict[StrictStr, Any]] = None, 219 _content_type: Optional[StrictStr] = None, 220 _headers: Optional[Dict[StrictStr, Any]] = None, 221 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 222 ) -> RESTResponseType: 223 """Delete a file from a File Upload connector 224 225 Delete a file from a File Upload connector 226 227 :param organization_id: (required) 228 :type organization_id: str 229 :param connector_id: (required) 230 :type connector_id: str 231 :param file_name: (required) 232 :type file_name: str 233 :param _request_timeout: timeout setting for this request. If one 234 number provided, it will be total request 235 timeout. It can also be a pair (tuple) of 236 (connection, read) timeouts. 237 :type _request_timeout: int, tuple(int, int), optional 238 :param _request_auth: set to override the auth_settings for an a single 239 request; this effectively ignores the 240 authentication in the spec for a single request. 241 :type _request_auth: dict, optional 242 :param _content_type: force content-type for the request. 243 :type _content_type: str, Optional 244 :param _headers: set to override the headers for a single 245 request; this effectively ignores the headers 246 in the spec for a single request. 247 :type _headers: dict, optional 248 :param _host_index: set to override the host_index for a single 249 request; this effectively ignores the host_index 250 in the spec for a single request. 251 :type _host_index: int, optional 252 :return: Returns the result object. 253 """ # noqa: E501 254 255 _param = self._delete_file_from_connector_serialize( 256 organization_id=organization_id, 257 connector_id=connector_id, 258 file_name=file_name, 259 _request_auth=_request_auth, 260 _content_type=_content_type, 261 _headers=_headers, 262 _host_index=_host_index 263 ) 264 265 _response_types_map: Dict[str, Optional[str]] = { 266 '200': "DeleteFileResponse", 267 '400': "GetWorkspaces400Response", 268 '401': "GetWorkspaces400Response", 269 '403': "GetWorkspaces400Response", 270 '404': "GetWorkspaces400Response", 271 '500': "GetWorkspaces400Response", 272 } 273 response_data = self.api_client.call_api( 274 *_param, 275 _request_timeout=_request_timeout 276 ) 277 return response_data.response
Delete a file from a File Upload connector
Delete a file from a File Upload connector
Parameters
- organization_id: (required)
- connector_id: (required)
- file_name: (required)
- _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.
- _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
- _content_type: force content-type for the request.
- _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
- _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
Returns
Returns the result object.
350 @validate_call 351 def get_upload_files_from_connector( 352 self, 353 organization_id: StrictStr, 354 connector_id: StrictStr, 355 _request_timeout: Union[ 356 None, 357 Annotated[StrictFloat, Field(gt=0)], 358 Tuple[ 359 Annotated[StrictFloat, Field(gt=0)], 360 Annotated[StrictFloat, Field(gt=0)] 361 ] 362 ] = None, 363 _request_auth: Optional[Dict[StrictStr, Any]] = None, 364 _content_type: Optional[StrictStr] = None, 365 _headers: Optional[Dict[StrictStr, Any]] = None, 366 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 367 ) -> GetUploadFilesResponse: 368 """Get uploaded files from a file upload connector 369 370 Get uploaded files from a file upload connector 371 372 :param organization_id: (required) 373 :type organization_id: str 374 :param connector_id: (required) 375 :type connector_id: str 376 :param _request_timeout: timeout setting for this request. If one 377 number provided, it will be total request 378 timeout. It can also be a pair (tuple) of 379 (connection, read) timeouts. 380 :type _request_timeout: int, tuple(int, int), optional 381 :param _request_auth: set to override the auth_settings for an a single 382 request; this effectively ignores the 383 authentication in the spec for a single request. 384 :type _request_auth: dict, optional 385 :param _content_type: force content-type for the request. 386 :type _content_type: str, Optional 387 :param _headers: set to override the headers for a single 388 request; this effectively ignores the headers 389 in the spec for a single request. 390 :type _headers: dict, optional 391 :param _host_index: set to override the host_index for a single 392 request; this effectively ignores the host_index 393 in the spec for a single request. 394 :type _host_index: int, optional 395 :return: Returns the result object. 396 """ # noqa: E501 397 398 _param = self._get_upload_files_from_connector_serialize( 399 organization_id=organization_id, 400 connector_id=connector_id, 401 _request_auth=_request_auth, 402 _content_type=_content_type, 403 _headers=_headers, 404 _host_index=_host_index 405 ) 406 407 _response_types_map: Dict[str, Optional[str]] = { 408 '200': "GetUploadFilesResponse", 409 '400': "GetWorkspaces400Response", 410 '401': "GetWorkspaces400Response", 411 '403': "GetWorkspaces400Response", 412 '404': "GetWorkspaces400Response", 413 '500': "GetWorkspaces400Response", 414 } 415 response_data = self.api_client.call_api( 416 *_param, 417 _request_timeout=_request_timeout 418 ) 419 response_data.read() 420 return self.api_client.response_deserialize( 421 response_data=response_data, 422 response_types_map=_response_types_map, 423 ).data
Get uploaded files from a file upload connector
Get uploaded files from a file upload connector
Parameters
- organization_id: (required)
- connector_id: (required)
- _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.
- _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
- _content_type: force content-type for the request.
- _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
- _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
Returns
Returns the result object.
426 @validate_call 427 def get_upload_files_from_connector_with_http_info( 428 self, 429 organization_id: StrictStr, 430 connector_id: StrictStr, 431 _request_timeout: Union[ 432 None, 433 Annotated[StrictFloat, Field(gt=0)], 434 Tuple[ 435 Annotated[StrictFloat, Field(gt=0)], 436 Annotated[StrictFloat, Field(gt=0)] 437 ] 438 ] = None, 439 _request_auth: Optional[Dict[StrictStr, Any]] = None, 440 _content_type: Optional[StrictStr] = None, 441 _headers: Optional[Dict[StrictStr, Any]] = None, 442 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 443 ) -> ApiResponse[GetUploadFilesResponse]: 444 """Get uploaded files from a file upload connector 445 446 Get uploaded files from a file upload connector 447 448 :param organization_id: (required) 449 :type organization_id: str 450 :param connector_id: (required) 451 :type connector_id: str 452 :param _request_timeout: timeout setting for this request. If one 453 number provided, it will be total request 454 timeout. It can also be a pair (tuple) of 455 (connection, read) timeouts. 456 :type _request_timeout: int, tuple(int, int), optional 457 :param _request_auth: set to override the auth_settings for an a single 458 request; this effectively ignores the 459 authentication in the spec for a single request. 460 :type _request_auth: dict, optional 461 :param _content_type: force content-type for the request. 462 :type _content_type: str, Optional 463 :param _headers: set to override the headers for a single 464 request; this effectively ignores the headers 465 in the spec for a single request. 466 :type _headers: dict, optional 467 :param _host_index: set to override the host_index for a single 468 request; this effectively ignores the host_index 469 in the spec for a single request. 470 :type _host_index: int, optional 471 :return: Returns the result object. 472 """ # noqa: E501 473 474 _param = self._get_upload_files_from_connector_serialize( 475 organization_id=organization_id, 476 connector_id=connector_id, 477 _request_auth=_request_auth, 478 _content_type=_content_type, 479 _headers=_headers, 480 _host_index=_host_index 481 ) 482 483 _response_types_map: Dict[str, Optional[str]] = { 484 '200': "GetUploadFilesResponse", 485 '400': "GetWorkspaces400Response", 486 '401': "GetWorkspaces400Response", 487 '403': "GetWorkspaces400Response", 488 '404': "GetWorkspaces400Response", 489 '500': "GetWorkspaces400Response", 490 } 491 response_data = self.api_client.call_api( 492 *_param, 493 _request_timeout=_request_timeout 494 ) 495 response_data.read() 496 return self.api_client.response_deserialize( 497 response_data=response_data, 498 response_types_map=_response_types_map, 499 )
Get uploaded files from a file upload connector
Get uploaded files from a file upload connector
Parameters
- organization_id: (required)
- connector_id: (required)
- _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.
- _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
- _content_type: force content-type for the request.
- _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
- _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
Returns
Returns the result object.
502 @validate_call 503 def get_upload_files_from_connector_without_preload_content( 504 self, 505 organization_id: StrictStr, 506 connector_id: StrictStr, 507 _request_timeout: Union[ 508 None, 509 Annotated[StrictFloat, Field(gt=0)], 510 Tuple[ 511 Annotated[StrictFloat, Field(gt=0)], 512 Annotated[StrictFloat, Field(gt=0)] 513 ] 514 ] = None, 515 _request_auth: Optional[Dict[StrictStr, Any]] = None, 516 _content_type: Optional[StrictStr] = None, 517 _headers: Optional[Dict[StrictStr, Any]] = None, 518 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 519 ) -> RESTResponseType: 520 """Get uploaded files from a file upload connector 521 522 Get uploaded files from a file upload connector 523 524 :param organization_id: (required) 525 :type organization_id: str 526 :param connector_id: (required) 527 :type connector_id: str 528 :param _request_timeout: timeout setting for this request. If one 529 number provided, it will be total request 530 timeout. It can also be a pair (tuple) of 531 (connection, read) timeouts. 532 :type _request_timeout: int, tuple(int, int), optional 533 :param _request_auth: set to override the auth_settings for an a single 534 request; this effectively ignores the 535 authentication in the spec for a single request. 536 :type _request_auth: dict, optional 537 :param _content_type: force content-type for the request. 538 :type _content_type: str, Optional 539 :param _headers: set to override the headers for a single 540 request; this effectively ignores the headers 541 in the spec for a single request. 542 :type _headers: dict, optional 543 :param _host_index: set to override the host_index for a single 544 request; this effectively ignores the host_index 545 in the spec for a single request. 546 :type _host_index: int, optional 547 :return: Returns the result object. 548 """ # noqa: E501 549 550 _param = self._get_upload_files_from_connector_serialize( 551 organization_id=organization_id, 552 connector_id=connector_id, 553 _request_auth=_request_auth, 554 _content_type=_content_type, 555 _headers=_headers, 556 _host_index=_host_index 557 ) 558 559 _response_types_map: Dict[str, Optional[str]] = { 560 '200': "GetUploadFilesResponse", 561 '400': "GetWorkspaces400Response", 562 '401': "GetWorkspaces400Response", 563 '403': "GetWorkspaces400Response", 564 '404': "GetWorkspaces400Response", 565 '500': "GetWorkspaces400Response", 566 } 567 response_data = self.api_client.call_api( 568 *_param, 569 _request_timeout=_request_timeout 570 ) 571 return response_data.response
Get uploaded files from a file upload connector
Get uploaded files from a file upload connector
Parameters
- organization_id: (required)
- connector_id: (required)
- _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.
- _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
- _content_type: force content-type for the request.
- _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
- _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
Returns
Returns the result object.
641 @validate_call 642 def start_file_upload_to_connector( 643 self, 644 organization_id: StrictStr, 645 connector_id: StrictStr, 646 start_file_upload_to_connector_request: StartFileUploadToConnectorRequest, 647 _request_timeout: Union[ 648 None, 649 Annotated[StrictFloat, Field(gt=0)], 650 Tuple[ 651 Annotated[StrictFloat, Field(gt=0)], 652 Annotated[StrictFloat, Field(gt=0)] 653 ] 654 ] = None, 655 _request_auth: Optional[Dict[StrictStr, Any]] = None, 656 _content_type: Optional[StrictStr] = None, 657 _headers: Optional[Dict[StrictStr, Any]] = None, 658 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 659 ) -> StartFileUploadToConnectorResponse: 660 """Upload a file to a file upload connector 661 662 Upload a file to a file upload connector 663 664 :param organization_id: (required) 665 :type organization_id: str 666 :param connector_id: (required) 667 :type connector_id: str 668 :param start_file_upload_to_connector_request: (required) 669 :type start_file_upload_to_connector_request: StartFileUploadToConnectorRequest 670 :param _request_timeout: timeout setting for this request. If one 671 number provided, it will be total request 672 timeout. It can also be a pair (tuple) of 673 (connection, read) timeouts. 674 :type _request_timeout: int, tuple(int, int), optional 675 :param _request_auth: set to override the auth_settings for an a single 676 request; this effectively ignores the 677 authentication in the spec for a single request. 678 :type _request_auth: dict, optional 679 :param _content_type: force content-type for the request. 680 :type _content_type: str, Optional 681 :param _headers: set to override the headers for a single 682 request; this effectively ignores the headers 683 in the spec for a single request. 684 :type _headers: dict, optional 685 :param _host_index: set to override the host_index for a single 686 request; this effectively ignores the host_index 687 in the spec for a single request. 688 :type _host_index: int, optional 689 :return: Returns the result object. 690 """ # noqa: E501 691 692 _param = self._start_file_upload_to_connector_serialize( 693 organization_id=organization_id, 694 connector_id=connector_id, 695 start_file_upload_to_connector_request=start_file_upload_to_connector_request, 696 _request_auth=_request_auth, 697 _content_type=_content_type, 698 _headers=_headers, 699 _host_index=_host_index 700 ) 701 702 _response_types_map: Dict[str, Optional[str]] = { 703 '200': "StartFileUploadToConnectorResponse", 704 '400': "GetWorkspaces400Response", 705 '401': "GetWorkspaces400Response", 706 '403': "GetWorkspaces400Response", 707 '404': "GetWorkspaces400Response", 708 '500': "GetWorkspaces400Response", 709 } 710 response_data = self.api_client.call_api( 711 *_param, 712 _request_timeout=_request_timeout 713 ) 714 response_data.read() 715 return self.api_client.response_deserialize( 716 response_data=response_data, 717 response_types_map=_response_types_map, 718 ).data
Upload a file to a file upload connector
Upload a file to a file upload connector
Parameters
- organization_id: (required)
- connector_id: (required)
- start_file_upload_to_connector_request: (required)
- _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.
- _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
- _content_type: force content-type for the request.
- _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
- _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
Returns
Returns the result object.
721 @validate_call 722 def start_file_upload_to_connector_with_http_info( 723 self, 724 organization_id: StrictStr, 725 connector_id: StrictStr, 726 start_file_upload_to_connector_request: StartFileUploadToConnectorRequest, 727 _request_timeout: Union[ 728 None, 729 Annotated[StrictFloat, Field(gt=0)], 730 Tuple[ 731 Annotated[StrictFloat, Field(gt=0)], 732 Annotated[StrictFloat, Field(gt=0)] 733 ] 734 ] = None, 735 _request_auth: Optional[Dict[StrictStr, Any]] = None, 736 _content_type: Optional[StrictStr] = None, 737 _headers: Optional[Dict[StrictStr, Any]] = None, 738 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 739 ) -> ApiResponse[StartFileUploadToConnectorResponse]: 740 """Upload a file to a file upload connector 741 742 Upload a file to a file upload connector 743 744 :param organization_id: (required) 745 :type organization_id: str 746 :param connector_id: (required) 747 :type connector_id: str 748 :param start_file_upload_to_connector_request: (required) 749 :type start_file_upload_to_connector_request: StartFileUploadToConnectorRequest 750 :param _request_timeout: timeout setting for this request. If one 751 number provided, it will be total request 752 timeout. It can also be a pair (tuple) of 753 (connection, read) timeouts. 754 :type _request_timeout: int, tuple(int, int), optional 755 :param _request_auth: set to override the auth_settings for an a single 756 request; this effectively ignores the 757 authentication in the spec for a single request. 758 :type _request_auth: dict, optional 759 :param _content_type: force content-type for the request. 760 :type _content_type: str, Optional 761 :param _headers: set to override the headers for a single 762 request; this effectively ignores the headers 763 in the spec for a single request. 764 :type _headers: dict, optional 765 :param _host_index: set to override the host_index for a single 766 request; this effectively ignores the host_index 767 in the spec for a single request. 768 :type _host_index: int, optional 769 :return: Returns the result object. 770 """ # noqa: E501 771 772 _param = self._start_file_upload_to_connector_serialize( 773 organization_id=organization_id, 774 connector_id=connector_id, 775 start_file_upload_to_connector_request=start_file_upload_to_connector_request, 776 _request_auth=_request_auth, 777 _content_type=_content_type, 778 _headers=_headers, 779 _host_index=_host_index 780 ) 781 782 _response_types_map: Dict[str, Optional[str]] = { 783 '200': "StartFileUploadToConnectorResponse", 784 '400': "GetWorkspaces400Response", 785 '401': "GetWorkspaces400Response", 786 '403': "GetWorkspaces400Response", 787 '404': "GetWorkspaces400Response", 788 '500': "GetWorkspaces400Response", 789 } 790 response_data = self.api_client.call_api( 791 *_param, 792 _request_timeout=_request_timeout 793 ) 794 response_data.read() 795 return self.api_client.response_deserialize( 796 response_data=response_data, 797 response_types_map=_response_types_map, 798 )
Upload a file to a file upload connector
Upload a file to a file upload connector
Parameters
- organization_id: (required)
- connector_id: (required)
- start_file_upload_to_connector_request: (required)
- _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.
- _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
- _content_type: force content-type for the request.
- _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
- _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
Returns
Returns the result object.
801 @validate_call 802 def start_file_upload_to_connector_without_preload_content( 803 self, 804 organization_id: StrictStr, 805 connector_id: StrictStr, 806 start_file_upload_to_connector_request: StartFileUploadToConnectorRequest, 807 _request_timeout: Union[ 808 None, 809 Annotated[StrictFloat, Field(gt=0)], 810 Tuple[ 811 Annotated[StrictFloat, Field(gt=0)], 812 Annotated[StrictFloat, Field(gt=0)] 813 ] 814 ] = None, 815 _request_auth: Optional[Dict[StrictStr, Any]] = None, 816 _content_type: Optional[StrictStr] = None, 817 _headers: Optional[Dict[StrictStr, Any]] = None, 818 _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, 819 ) -> RESTResponseType: 820 """Upload a file to a file upload connector 821 822 Upload a file to a file upload connector 823 824 :param organization_id: (required) 825 :type organization_id: str 826 :param connector_id: (required) 827 :type connector_id: str 828 :param start_file_upload_to_connector_request: (required) 829 :type start_file_upload_to_connector_request: StartFileUploadToConnectorRequest 830 :param _request_timeout: timeout setting for this request. If one 831 number provided, it will be total request 832 timeout. It can also be a pair (tuple) of 833 (connection, read) timeouts. 834 :type _request_timeout: int, tuple(int, int), optional 835 :param _request_auth: set to override the auth_settings for an a single 836 request; this effectively ignores the 837 authentication in the spec for a single request. 838 :type _request_auth: dict, optional 839 :param _content_type: force content-type for the request. 840 :type _content_type: str, Optional 841 :param _headers: set to override the headers for a single 842 request; this effectively ignores the headers 843 in the spec for a single request. 844 :type _headers: dict, optional 845 :param _host_index: set to override the host_index for a single 846 request; this effectively ignores the host_index 847 in the spec for a single request. 848 :type _host_index: int, optional 849 :return: Returns the result object. 850 """ # noqa: E501 851 852 _param = self._start_file_upload_to_connector_serialize( 853 organization_id=organization_id, 854 connector_id=connector_id, 855 start_file_upload_to_connector_request=start_file_upload_to_connector_request, 856 _request_auth=_request_auth, 857 _content_type=_content_type, 858 _headers=_headers, 859 _host_index=_host_index 860 ) 861 862 _response_types_map: Dict[str, Optional[str]] = { 863 '200': "StartFileUploadToConnectorResponse", 864 '400': "GetWorkspaces400Response", 865 '401': "GetWorkspaces400Response", 866 '403': "GetWorkspaces400Response", 867 '404': "GetWorkspaces400Response", 868 '500': "GetWorkspaces400Response", 869 } 870 response_data = self.api_client.call_api( 871 *_param, 872 _request_timeout=_request_timeout 873 ) 874 return response_data.response
Upload a file to a file upload connector
Upload a file to a file upload connector
Parameters
- organization_id: (required)
- connector_id: (required)
- start_file_upload_to_connector_request: (required)
- _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.
- _request_auth: set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
- _content_type: force content-type for the request.
- _headers: set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
- _host_index: set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
Returns
Returns the result object.