github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python/lakefs_sdk/api/objects_api.py (about) 1 # coding: utf-8 2 3 """ 4 lakeFS API 5 6 lakeFS HTTP API 7 8 The version of the OpenAPI document: 1.0.0 9 Contact: services@treeverse.io 10 Generated by OpenAPI Generator (https://openapi-generator.tech) 11 12 Do not edit the class manually. 13 """ # noqa: E501 14 15 16 import re # noqa: F401 17 import io 18 import warnings 19 20 try: 21 from pydantic.v1 import validate_arguments, ValidationError 22 except ImportError: 23 from pydantic import validate_arguments, ValidationError 24 from typing_extensions import Annotated 25 26 try: 27 from pydantic.v1 import Field, StrictBool, StrictBytes, StrictStr, conint, constr, validator 28 except ImportError: 29 from pydantic import Field, StrictBool, StrictBytes, StrictStr, conint, constr, validator 30 31 from typing import Optional, Union 32 33 from lakefs_sdk.models.object_copy_creation import ObjectCopyCreation 34 from lakefs_sdk.models.object_error_list import ObjectErrorList 35 from lakefs_sdk.models.object_stats import ObjectStats 36 from lakefs_sdk.models.object_stats_list import ObjectStatsList 37 from lakefs_sdk.models.path_list import PathList 38 from lakefs_sdk.models.underlying_object_properties import UnderlyingObjectProperties 39 40 from lakefs_sdk.api_client import ApiClient 41 from lakefs_sdk.api_response import ApiResponse 42 from lakefs_sdk.exceptions import ( # noqa: F401 43 ApiTypeError, 44 ApiValueError 45 ) 46 47 48 class ObjectsApi(object): 49 """NOTE: This class is auto generated by OpenAPI Generator 50 Ref: https://openapi-generator.tech 51 52 Do not edit the class manually. 53 """ 54 55 def __init__(self, api_client=None): 56 if api_client is None: 57 api_client = ApiClient.get_default() 58 self.api_client = api_client 59 60 @validate_arguments 61 def copy_object(self, repository : StrictStr, branch : Annotated[StrictStr, Field(..., description="destination branch for the copy")], dest_path : Annotated[StrictStr, Field(..., description="destination path relative to the branch")], object_copy_creation : ObjectCopyCreation, **kwargs) -> ObjectStats: # noqa: E501 62 """create a copy of an object # noqa: E501 63 64 This method makes a synchronous HTTP request by default. To make an 65 asynchronous HTTP request, please pass async_req=True 66 67 >>> thread = api.copy_object(repository, branch, dest_path, object_copy_creation, async_req=True) 68 >>> result = thread.get() 69 70 :param repository: (required) 71 :type repository: str 72 :param branch: destination branch for the copy (required) 73 :type branch: str 74 :param dest_path: destination path relative to the branch (required) 75 :type dest_path: str 76 :param object_copy_creation: (required) 77 :type object_copy_creation: ObjectCopyCreation 78 :param async_req: Whether to execute the request asynchronously. 79 :type async_req: bool, optional 80 :param _request_timeout: timeout setting for this request. If one 81 number provided, it will be total request 82 timeout. It can also be a pair (tuple) of 83 (connection, read) timeouts. 84 :return: Returns the result object. 85 If the method is called asynchronously, 86 returns the request thread. 87 :rtype: ObjectStats 88 """ 89 kwargs['_return_http_data_only'] = True 90 if '_preload_content' in kwargs: 91 raise ValueError("Error! Please call the copy_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 92 return self.copy_object_with_http_info(repository, branch, dest_path, object_copy_creation, **kwargs) # noqa: E501 93 94 @validate_arguments 95 def copy_object_with_http_info(self, repository : StrictStr, branch : Annotated[StrictStr, Field(..., description="destination branch for the copy")], dest_path : Annotated[StrictStr, Field(..., description="destination path relative to the branch")], object_copy_creation : ObjectCopyCreation, **kwargs) -> ApiResponse: # noqa: E501 96 """create a copy of an object # noqa: E501 97 98 This method makes a synchronous HTTP request by default. To make an 99 asynchronous HTTP request, please pass async_req=True 100 101 >>> thread = api.copy_object_with_http_info(repository, branch, dest_path, object_copy_creation, async_req=True) 102 >>> result = thread.get() 103 104 :param repository: (required) 105 :type repository: str 106 :param branch: destination branch for the copy (required) 107 :type branch: str 108 :param dest_path: destination path relative to the branch (required) 109 :type dest_path: str 110 :param object_copy_creation: (required) 111 :type object_copy_creation: ObjectCopyCreation 112 :param async_req: Whether to execute the request asynchronously. 113 :type async_req: bool, optional 114 :param _preload_content: if False, the ApiResponse.data will 115 be set to none and raw_data will store the 116 HTTP response body without reading/decoding. 117 Default is True. 118 :type _preload_content: bool, optional 119 :param _return_http_data_only: response data instead of ApiResponse 120 object with status code, headers, etc 121 :type _return_http_data_only: bool, optional 122 :param _request_timeout: timeout setting for this request. If one 123 number provided, it will be total request 124 timeout. It can also be a pair (tuple) of 125 (connection, read) timeouts. 126 :param _request_auth: set to override the auth_settings for an a single 127 request; this effectively ignores the authentication 128 in the spec for a single request. 129 :type _request_auth: dict, optional 130 :type _content_type: string, optional: force content-type for the request 131 :return: Returns the result object. 132 If the method is called asynchronously, 133 returns the request thread. 134 :rtype: tuple(ObjectStats, status_code(int), headers(HTTPHeaderDict)) 135 """ 136 137 _params = locals() 138 139 _all_params = [ 140 'repository', 141 'branch', 142 'dest_path', 143 'object_copy_creation' 144 ] 145 _all_params.extend( 146 [ 147 'async_req', 148 '_return_http_data_only', 149 '_preload_content', 150 '_request_timeout', 151 '_request_auth', 152 '_content_type', 153 '_headers' 154 ] 155 ) 156 157 # validate the arguments 158 for _key, _val in _params['kwargs'].items(): 159 if _key not in _all_params: 160 raise ApiTypeError( 161 "Got an unexpected keyword argument '%s'" 162 " to method copy_object" % _key 163 ) 164 _params[_key] = _val 165 del _params['kwargs'] 166 167 _collection_formats = {} 168 169 # process the path parameters 170 _path_params = {} 171 if _params['repository']: 172 _path_params['repository'] = _params['repository'] 173 174 if _params['branch']: 175 _path_params['branch'] = _params['branch'] 176 177 178 # process the query parameters 179 _query_params = [] 180 if _params.get('dest_path') is not None: # noqa: E501 181 _query_params.append(('dest_path', _params['dest_path'])) 182 183 # process the header parameters 184 _header_params = dict(_params.get('_headers', {})) 185 # process the form parameters 186 _form_params = [] 187 _files = {} 188 # process the body parameter 189 _body_params = None 190 if _params['object_copy_creation'] is not None: 191 _body_params = _params['object_copy_creation'] 192 193 # set the HTTP header `Accept` 194 _header_params['Accept'] = self.api_client.select_header_accept( 195 ['application/json']) # noqa: E501 196 197 # set the HTTP header `Content-Type` 198 _content_types_list = _params.get('_content_type', 199 self.api_client.select_header_content_type( 200 ['application/json'])) 201 if _content_types_list: 202 _header_params['Content-Type'] = _content_types_list 203 204 # authentication setting 205 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 206 207 _response_types_map = { 208 '201': "ObjectStats", 209 '400': "Error", 210 '401': "Error", 211 '403': "Error", 212 '404': "Error", 213 '420': None, 214 } 215 216 return self.api_client.call_api( 217 '/repositories/{repository}/branches/{branch}/objects/copy', 'POST', 218 _path_params, 219 _query_params, 220 _header_params, 221 body=_body_params, 222 post_params=_form_params, 223 files=_files, 224 response_types_map=_response_types_map, 225 auth_settings=_auth_settings, 226 async_req=_params.get('async_req'), 227 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 228 _preload_content=_params.get('_preload_content', True), 229 _request_timeout=_params.get('_request_timeout'), 230 collection_formats=_collection_formats, 231 _request_auth=_params.get('_request_auth')) 232 233 @validate_arguments 234 def delete_object(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], force : Optional[StrictBool] = None, **kwargs) -> None: # noqa: E501 235 """delete object. Missing objects will not return a NotFound error. # noqa: E501 236 237 This method makes a synchronous HTTP request by default. To make an 238 asynchronous HTTP request, please pass async_req=True 239 240 >>> thread = api.delete_object(repository, branch, path, force, async_req=True) 241 >>> result = thread.get() 242 243 :param repository: (required) 244 :type repository: str 245 :param branch: (required) 246 :type branch: str 247 :param path: relative to the branch (required) 248 :type path: str 249 :param force: 250 :type force: bool 251 :param async_req: Whether to execute the request asynchronously. 252 :type async_req: bool, optional 253 :param _request_timeout: timeout setting for this request. If one 254 number provided, it will be total request 255 timeout. It can also be a pair (tuple) of 256 (connection, read) timeouts. 257 :return: Returns the result object. 258 If the method is called asynchronously, 259 returns the request thread. 260 :rtype: None 261 """ 262 kwargs['_return_http_data_only'] = True 263 if '_preload_content' in kwargs: 264 raise ValueError("Error! Please call the delete_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 265 return self.delete_object_with_http_info(repository, branch, path, force, **kwargs) # noqa: E501 266 267 @validate_arguments 268 def delete_object_with_http_info(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], force : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 269 """delete object. Missing objects will not return a NotFound error. # noqa: E501 270 271 This method makes a synchronous HTTP request by default. To make an 272 asynchronous HTTP request, please pass async_req=True 273 274 >>> thread = api.delete_object_with_http_info(repository, branch, path, force, async_req=True) 275 >>> result = thread.get() 276 277 :param repository: (required) 278 :type repository: str 279 :param branch: (required) 280 :type branch: str 281 :param path: relative to the branch (required) 282 :type path: str 283 :param force: 284 :type force: bool 285 :param async_req: Whether to execute the request asynchronously. 286 :type async_req: bool, optional 287 :param _preload_content: if False, the ApiResponse.data will 288 be set to none and raw_data will store the 289 HTTP response body without reading/decoding. 290 Default is True. 291 :type _preload_content: bool, optional 292 :param _return_http_data_only: response data instead of ApiResponse 293 object with status code, headers, etc 294 :type _return_http_data_only: bool, optional 295 :param _request_timeout: timeout setting for this request. If one 296 number provided, it will be total request 297 timeout. It can also be a pair (tuple) of 298 (connection, read) timeouts. 299 :param _request_auth: set to override the auth_settings for an a single 300 request; this effectively ignores the authentication 301 in the spec for a single request. 302 :type _request_auth: dict, optional 303 :type _content_type: string, optional: force content-type for the request 304 :return: Returns the result object. 305 If the method is called asynchronously, 306 returns the request thread. 307 :rtype: None 308 """ 309 310 _params = locals() 311 312 _all_params = [ 313 'repository', 314 'branch', 315 'path', 316 'force' 317 ] 318 _all_params.extend( 319 [ 320 'async_req', 321 '_return_http_data_only', 322 '_preload_content', 323 '_request_timeout', 324 '_request_auth', 325 '_content_type', 326 '_headers' 327 ] 328 ) 329 330 # validate the arguments 331 for _key, _val in _params['kwargs'].items(): 332 if _key not in _all_params: 333 raise ApiTypeError( 334 "Got an unexpected keyword argument '%s'" 335 " to method delete_object" % _key 336 ) 337 _params[_key] = _val 338 del _params['kwargs'] 339 340 _collection_formats = {} 341 342 # process the path parameters 343 _path_params = {} 344 if _params['repository']: 345 _path_params['repository'] = _params['repository'] 346 347 if _params['branch']: 348 _path_params['branch'] = _params['branch'] 349 350 351 # process the query parameters 352 _query_params = [] 353 if _params.get('path') is not None: # noqa: E501 354 _query_params.append(('path', _params['path'])) 355 356 if _params.get('force') is not None: # noqa: E501 357 _query_params.append(('force', _params['force'])) 358 359 # process the header parameters 360 _header_params = dict(_params.get('_headers', {})) 361 # process the form parameters 362 _form_params = [] 363 _files = {} 364 # process the body parameter 365 _body_params = None 366 # set the HTTP header `Accept` 367 _header_params['Accept'] = self.api_client.select_header_accept( 368 ['application/json']) # noqa: E501 369 370 # authentication setting 371 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 372 373 _response_types_map = {} 374 375 return self.api_client.call_api( 376 '/repositories/{repository}/branches/{branch}/objects', 'DELETE', 377 _path_params, 378 _query_params, 379 _header_params, 380 body=_body_params, 381 post_params=_form_params, 382 files=_files, 383 response_types_map=_response_types_map, 384 auth_settings=_auth_settings, 385 async_req=_params.get('async_req'), 386 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 387 _preload_content=_params.get('_preload_content', True), 388 _request_timeout=_params.get('_request_timeout'), 389 collection_formats=_collection_formats, 390 _request_auth=_params.get('_request_auth')) 391 392 @validate_arguments 393 def delete_objects(self, repository : StrictStr, branch : StrictStr, path_list : PathList, force : Optional[StrictBool] = None, **kwargs) -> ObjectErrorList: # noqa: E501 394 """delete objects. Missing objects will not return a NotFound error. # noqa: E501 395 396 This method makes a synchronous HTTP request by default. To make an 397 asynchronous HTTP request, please pass async_req=True 398 399 >>> thread = api.delete_objects(repository, branch, path_list, force, async_req=True) 400 >>> result = thread.get() 401 402 :param repository: (required) 403 :type repository: str 404 :param branch: (required) 405 :type branch: str 406 :param path_list: (required) 407 :type path_list: PathList 408 :param force: 409 :type force: bool 410 :param async_req: Whether to execute the request asynchronously. 411 :type async_req: bool, optional 412 :param _request_timeout: timeout setting for this request. If one 413 number provided, it will be total request 414 timeout. It can also be a pair (tuple) of 415 (connection, read) timeouts. 416 :return: Returns the result object. 417 If the method is called asynchronously, 418 returns the request thread. 419 :rtype: ObjectErrorList 420 """ 421 kwargs['_return_http_data_only'] = True 422 if '_preload_content' in kwargs: 423 raise ValueError("Error! Please call the delete_objects_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 424 return self.delete_objects_with_http_info(repository, branch, path_list, force, **kwargs) # noqa: E501 425 426 @validate_arguments 427 def delete_objects_with_http_info(self, repository : StrictStr, branch : StrictStr, path_list : PathList, force : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 428 """delete objects. Missing objects will not return a NotFound error. # noqa: E501 429 430 This method makes a synchronous HTTP request by default. To make an 431 asynchronous HTTP request, please pass async_req=True 432 433 >>> thread = api.delete_objects_with_http_info(repository, branch, path_list, force, async_req=True) 434 >>> result = thread.get() 435 436 :param repository: (required) 437 :type repository: str 438 :param branch: (required) 439 :type branch: str 440 :param path_list: (required) 441 :type path_list: PathList 442 :param force: 443 :type force: bool 444 :param async_req: Whether to execute the request asynchronously. 445 :type async_req: bool, optional 446 :param _preload_content: if False, the ApiResponse.data will 447 be set to none and raw_data will store the 448 HTTP response body without reading/decoding. 449 Default is True. 450 :type _preload_content: bool, optional 451 :param _return_http_data_only: response data instead of ApiResponse 452 object with status code, headers, etc 453 :type _return_http_data_only: bool, optional 454 :param _request_timeout: timeout setting for this request. If one 455 number provided, it will be total request 456 timeout. It can also be a pair (tuple) of 457 (connection, read) timeouts. 458 :param _request_auth: set to override the auth_settings for an a single 459 request; this effectively ignores the authentication 460 in the spec for a single request. 461 :type _request_auth: dict, optional 462 :type _content_type: string, optional: force content-type for the request 463 :return: Returns the result object. 464 If the method is called asynchronously, 465 returns the request thread. 466 :rtype: tuple(ObjectErrorList, status_code(int), headers(HTTPHeaderDict)) 467 """ 468 469 _params = locals() 470 471 _all_params = [ 472 'repository', 473 'branch', 474 'path_list', 475 'force' 476 ] 477 _all_params.extend( 478 [ 479 'async_req', 480 '_return_http_data_only', 481 '_preload_content', 482 '_request_timeout', 483 '_request_auth', 484 '_content_type', 485 '_headers' 486 ] 487 ) 488 489 # validate the arguments 490 for _key, _val in _params['kwargs'].items(): 491 if _key not in _all_params: 492 raise ApiTypeError( 493 "Got an unexpected keyword argument '%s'" 494 " to method delete_objects" % _key 495 ) 496 _params[_key] = _val 497 del _params['kwargs'] 498 499 _collection_formats = {} 500 501 # process the path parameters 502 _path_params = {} 503 if _params['repository']: 504 _path_params['repository'] = _params['repository'] 505 506 if _params['branch']: 507 _path_params['branch'] = _params['branch'] 508 509 510 # process the query parameters 511 _query_params = [] 512 if _params.get('force') is not None: # noqa: E501 513 _query_params.append(('force', _params['force'])) 514 515 # process the header parameters 516 _header_params = dict(_params.get('_headers', {})) 517 # process the form parameters 518 _form_params = [] 519 _files = {} 520 # process the body parameter 521 _body_params = None 522 if _params['path_list'] is not None: 523 _body_params = _params['path_list'] 524 525 # set the HTTP header `Accept` 526 _header_params['Accept'] = self.api_client.select_header_accept( 527 ['application/json']) # noqa: E501 528 529 # set the HTTP header `Content-Type` 530 _content_types_list = _params.get('_content_type', 531 self.api_client.select_header_content_type( 532 ['application/json'])) 533 if _content_types_list: 534 _header_params['Content-Type'] = _content_types_list 535 536 # authentication setting 537 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 538 539 _response_types_map = { 540 '200': "ObjectErrorList", 541 '401': "Error", 542 '403': "Error", 543 '404': "Error", 544 '420': None, 545 } 546 547 return self.api_client.call_api( 548 '/repositories/{repository}/branches/{branch}/objects/delete', 'POST', 549 _path_params, 550 _query_params, 551 _header_params, 552 body=_body_params, 553 post_params=_form_params, 554 files=_files, 555 response_types_map=_response_types_map, 556 auth_settings=_auth_settings, 557 async_req=_params.get('async_req'), 558 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 559 _preload_content=_params.get('_preload_content', True), 560 _request_timeout=_params.get('_request_timeout'), 561 collection_formats=_collection_formats, 562 _request_auth=_params.get('_request_auth')) 563 564 @validate_arguments 565 def get_object(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the ref")], range : Annotated[Optional[constr(strict=True)], Field(description="Byte range to retrieve")] = None, if_none_match : Annotated[Optional[StrictStr], Field(description="Returns response only if the object does not have a matching ETag")] = None, presign : Optional[StrictBool] = None, **kwargs) -> bytearray: # noqa: E501 566 """get object content # noqa: E501 567 568 This method makes a synchronous HTTP request by default. To make an 569 asynchronous HTTP request, please pass async_req=True 570 571 >>> thread = api.get_object(repository, ref, path, range, if_none_match, presign, async_req=True) 572 >>> result = thread.get() 573 574 :param repository: (required) 575 :type repository: str 576 :param ref: a reference (could be either a branch or a commit ID) (required) 577 :type ref: str 578 :param path: relative to the ref (required) 579 :type path: str 580 :param range: Byte range to retrieve 581 :type range: str 582 :param if_none_match: Returns response only if the object does not have a matching ETag 583 :type if_none_match: str 584 :param presign: 585 :type presign: bool 586 :param async_req: Whether to execute the request asynchronously. 587 :type async_req: bool, optional 588 :param _request_timeout: timeout setting for this request. If one 589 number provided, it will be total request 590 timeout. It can also be a pair (tuple) of 591 (connection, read) timeouts. 592 :return: Returns the result object. 593 If the method is called asynchronously, 594 returns the request thread. 595 :rtype: bytearray 596 """ 597 kwargs['_return_http_data_only'] = True 598 if '_preload_content' in kwargs: 599 raise ValueError("Error! Please call the get_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 600 return self.get_object_with_http_info(repository, ref, path, range, if_none_match, presign, **kwargs) # noqa: E501 601 602 @validate_arguments 603 def get_object_with_http_info(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the ref")], range : Annotated[Optional[constr(strict=True)], Field(description="Byte range to retrieve")] = None, if_none_match : Annotated[Optional[StrictStr], Field(description="Returns response only if the object does not have a matching ETag")] = None, presign : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 604 """get object content # noqa: E501 605 606 This method makes a synchronous HTTP request by default. To make an 607 asynchronous HTTP request, please pass async_req=True 608 609 >>> thread = api.get_object_with_http_info(repository, ref, path, range, if_none_match, presign, async_req=True) 610 >>> result = thread.get() 611 612 :param repository: (required) 613 :type repository: str 614 :param ref: a reference (could be either a branch or a commit ID) (required) 615 :type ref: str 616 :param path: relative to the ref (required) 617 :type path: str 618 :param range: Byte range to retrieve 619 :type range: str 620 :param if_none_match: Returns response only if the object does not have a matching ETag 621 :type if_none_match: str 622 :param presign: 623 :type presign: bool 624 :param async_req: Whether to execute the request asynchronously. 625 :type async_req: bool, optional 626 :param _preload_content: if False, the ApiResponse.data will 627 be set to none and raw_data will store the 628 HTTP response body without reading/decoding. 629 Default is True. 630 :type _preload_content: bool, optional 631 :param _return_http_data_only: response data instead of ApiResponse 632 object with status code, headers, etc 633 :type _return_http_data_only: bool, optional 634 :param _request_timeout: timeout setting for this request. If one 635 number provided, it will be total request 636 timeout. It can also be a pair (tuple) of 637 (connection, read) timeouts. 638 :param _request_auth: set to override the auth_settings for an a single 639 request; this effectively ignores the authentication 640 in the spec for a single request. 641 :type _request_auth: dict, optional 642 :type _content_type: string, optional: force content-type for the request 643 :return: Returns the result object. 644 If the method is called asynchronously, 645 returns the request thread. 646 :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict)) 647 """ 648 649 _params = locals() 650 651 _all_params = [ 652 'repository', 653 'ref', 654 'path', 655 'range', 656 'if_none_match', 657 'presign' 658 ] 659 _all_params.extend( 660 [ 661 'async_req', 662 '_return_http_data_only', 663 '_preload_content', 664 '_request_timeout', 665 '_request_auth', 666 '_content_type', 667 '_headers' 668 ] 669 ) 670 671 # validate the arguments 672 for _key, _val in _params['kwargs'].items(): 673 if _key not in _all_params: 674 raise ApiTypeError( 675 "Got an unexpected keyword argument '%s'" 676 " to method get_object" % _key 677 ) 678 _params[_key] = _val 679 del _params['kwargs'] 680 681 _collection_formats = {} 682 683 # process the path parameters 684 _path_params = {} 685 if _params['repository']: 686 _path_params['repository'] = _params['repository'] 687 688 if _params['ref']: 689 _path_params['ref'] = _params['ref'] 690 691 692 # process the query parameters 693 _query_params = [] 694 if _params.get('path') is not None: # noqa: E501 695 _query_params.append(('path', _params['path'])) 696 697 if _params.get('presign') is not None: # noqa: E501 698 _query_params.append(('presign', _params['presign'])) 699 700 # process the header parameters 701 _header_params = dict(_params.get('_headers', {})) 702 if _params['range']: 703 _header_params['Range'] = _params['range'] 704 705 if _params['if_none_match']: 706 _header_params['If-None-Match'] = _params['if_none_match'] 707 708 # process the form parameters 709 _form_params = [] 710 _files = {} 711 # process the body parameter 712 _body_params = None 713 # set the HTTP header `Accept` 714 _header_params['Accept'] = self.api_client.select_header_accept( 715 ['application/octet-stream', 'application/json']) # noqa: E501 716 717 # authentication setting 718 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 719 720 _response_types_map = { 721 '200': "bytearray", 722 '206': "bytearray", 723 '302': None, 724 '304': None, 725 '401': "Error", 726 '404': "Error", 727 '410': "Error", 728 '416': "Error", 729 '420': None, 730 } 731 732 return self.api_client.call_api( 733 '/repositories/{repository}/refs/{ref}/objects', 'GET', 734 _path_params, 735 _query_params, 736 _header_params, 737 body=_body_params, 738 post_params=_form_params, 739 files=_files, 740 response_types_map=_response_types_map, 741 auth_settings=_auth_settings, 742 async_req=_params.get('async_req'), 743 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 744 _preload_content=_params.get('_preload_content', True), 745 _request_timeout=_params.get('_request_timeout'), 746 collection_formats=_collection_formats, 747 _request_auth=_params.get('_request_auth')) 748 749 @validate_arguments 750 def get_underlying_properties(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the branch")], **kwargs) -> UnderlyingObjectProperties: # noqa: E501 751 """get object properties on underlying storage # noqa: E501 752 753 This method makes a synchronous HTTP request by default. To make an 754 asynchronous HTTP request, please pass async_req=True 755 756 >>> thread = api.get_underlying_properties(repository, ref, path, async_req=True) 757 >>> result = thread.get() 758 759 :param repository: (required) 760 :type repository: str 761 :param ref: a reference (could be either a branch or a commit ID) (required) 762 :type ref: str 763 :param path: relative to the branch (required) 764 :type path: str 765 :param async_req: Whether to execute the request asynchronously. 766 :type async_req: bool, optional 767 :param _request_timeout: timeout setting for this request. If one 768 number provided, it will be total request 769 timeout. It can also be a pair (tuple) of 770 (connection, read) timeouts. 771 :return: Returns the result object. 772 If the method is called asynchronously, 773 returns the request thread. 774 :rtype: UnderlyingObjectProperties 775 """ 776 kwargs['_return_http_data_only'] = True 777 if '_preload_content' in kwargs: 778 raise ValueError("Error! Please call the get_underlying_properties_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 779 return self.get_underlying_properties_with_http_info(repository, ref, path, **kwargs) # noqa: E501 780 781 @validate_arguments 782 def get_underlying_properties_with_http_info(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the branch")], **kwargs) -> ApiResponse: # noqa: E501 783 """get object properties on underlying storage # noqa: E501 784 785 This method makes a synchronous HTTP request by default. To make an 786 asynchronous HTTP request, please pass async_req=True 787 788 >>> thread = api.get_underlying_properties_with_http_info(repository, ref, path, async_req=True) 789 >>> result = thread.get() 790 791 :param repository: (required) 792 :type repository: str 793 :param ref: a reference (could be either a branch or a commit ID) (required) 794 :type ref: str 795 :param path: relative to the branch (required) 796 :type path: str 797 :param async_req: Whether to execute the request asynchronously. 798 :type async_req: bool, optional 799 :param _preload_content: if False, the ApiResponse.data will 800 be set to none and raw_data will store the 801 HTTP response body without reading/decoding. 802 Default is True. 803 :type _preload_content: bool, optional 804 :param _return_http_data_only: response data instead of ApiResponse 805 object with status code, headers, etc 806 :type _return_http_data_only: bool, optional 807 :param _request_timeout: timeout setting for this request. If one 808 number provided, it will be total request 809 timeout. It can also be a pair (tuple) of 810 (connection, read) timeouts. 811 :param _request_auth: set to override the auth_settings for an a single 812 request; this effectively ignores the authentication 813 in the spec for a single request. 814 :type _request_auth: dict, optional 815 :type _content_type: string, optional: force content-type for the request 816 :return: Returns the result object. 817 If the method is called asynchronously, 818 returns the request thread. 819 :rtype: tuple(UnderlyingObjectProperties, status_code(int), headers(HTTPHeaderDict)) 820 """ 821 822 _params = locals() 823 824 _all_params = [ 825 'repository', 826 'ref', 827 'path' 828 ] 829 _all_params.extend( 830 [ 831 'async_req', 832 '_return_http_data_only', 833 '_preload_content', 834 '_request_timeout', 835 '_request_auth', 836 '_content_type', 837 '_headers' 838 ] 839 ) 840 841 # validate the arguments 842 for _key, _val in _params['kwargs'].items(): 843 if _key not in _all_params: 844 raise ApiTypeError( 845 "Got an unexpected keyword argument '%s'" 846 " to method get_underlying_properties" % _key 847 ) 848 _params[_key] = _val 849 del _params['kwargs'] 850 851 _collection_formats = {} 852 853 # process the path parameters 854 _path_params = {} 855 if _params['repository']: 856 _path_params['repository'] = _params['repository'] 857 858 if _params['ref']: 859 _path_params['ref'] = _params['ref'] 860 861 862 # process the query parameters 863 _query_params = [] 864 if _params.get('path') is not None: # noqa: E501 865 _query_params.append(('path', _params['path'])) 866 867 # process the header parameters 868 _header_params = dict(_params.get('_headers', {})) 869 # process the form parameters 870 _form_params = [] 871 _files = {} 872 # process the body parameter 873 _body_params = None 874 # set the HTTP header `Accept` 875 _header_params['Accept'] = self.api_client.select_header_accept( 876 ['application/json']) # noqa: E501 877 878 # authentication setting 879 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 880 881 _response_types_map = { 882 '200': "UnderlyingObjectProperties", 883 '401': "Error", 884 '404': "Error", 885 '420': None, 886 } 887 888 return self.api_client.call_api( 889 '/repositories/{repository}/refs/{ref}/objects/underlyingProperties', 'GET', 890 _path_params, 891 _query_params, 892 _header_params, 893 body=_body_params, 894 post_params=_form_params, 895 files=_files, 896 response_types_map=_response_types_map, 897 auth_settings=_auth_settings, 898 async_req=_params.get('async_req'), 899 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 900 _preload_content=_params.get('_preload_content', True), 901 _request_timeout=_params.get('_request_timeout'), 902 collection_formats=_collection_formats, 903 _request_auth=_params.get('_request_auth')) 904 905 @validate_arguments 906 def head_object(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the ref")], range : Annotated[Optional[constr(strict=True)], Field(description="Byte range to retrieve")] = None, **kwargs) -> None: # noqa: E501 907 """check if object exists # noqa: E501 908 909 This method makes a synchronous HTTP request by default. To make an 910 asynchronous HTTP request, please pass async_req=True 911 912 >>> thread = api.head_object(repository, ref, path, range, async_req=True) 913 >>> result = thread.get() 914 915 :param repository: (required) 916 :type repository: str 917 :param ref: a reference (could be either a branch or a commit ID) (required) 918 :type ref: str 919 :param path: relative to the ref (required) 920 :type path: str 921 :param range: Byte range to retrieve 922 :type range: str 923 :param async_req: Whether to execute the request asynchronously. 924 :type async_req: bool, optional 925 :param _request_timeout: timeout setting for this request. If one 926 number provided, it will be total request 927 timeout. It can also be a pair (tuple) of 928 (connection, read) timeouts. 929 :return: Returns the result object. 930 If the method is called asynchronously, 931 returns the request thread. 932 :rtype: None 933 """ 934 kwargs['_return_http_data_only'] = True 935 if '_preload_content' in kwargs: 936 raise ValueError("Error! Please call the head_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 937 return self.head_object_with_http_info(repository, ref, path, range, **kwargs) # noqa: E501 938 939 @validate_arguments 940 def head_object_with_http_info(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the ref")], range : Annotated[Optional[constr(strict=True)], Field(description="Byte range to retrieve")] = None, **kwargs) -> ApiResponse: # noqa: E501 941 """check if object exists # noqa: E501 942 943 This method makes a synchronous HTTP request by default. To make an 944 asynchronous HTTP request, please pass async_req=True 945 946 >>> thread = api.head_object_with_http_info(repository, ref, path, range, async_req=True) 947 >>> result = thread.get() 948 949 :param repository: (required) 950 :type repository: str 951 :param ref: a reference (could be either a branch or a commit ID) (required) 952 :type ref: str 953 :param path: relative to the ref (required) 954 :type path: str 955 :param range: Byte range to retrieve 956 :type range: str 957 :param async_req: Whether to execute the request asynchronously. 958 :type async_req: bool, optional 959 :param _preload_content: if False, the ApiResponse.data will 960 be set to none and raw_data will store the 961 HTTP response body without reading/decoding. 962 Default is True. 963 :type _preload_content: bool, optional 964 :param _return_http_data_only: response data instead of ApiResponse 965 object with status code, headers, etc 966 :type _return_http_data_only: bool, optional 967 :param _request_timeout: timeout setting for this request. If one 968 number provided, it will be total request 969 timeout. It can also be a pair (tuple) of 970 (connection, read) timeouts. 971 :param _request_auth: set to override the auth_settings for an a single 972 request; this effectively ignores the authentication 973 in the spec for a single request. 974 :type _request_auth: dict, optional 975 :type _content_type: string, optional: force content-type for the request 976 :return: Returns the result object. 977 If the method is called asynchronously, 978 returns the request thread. 979 :rtype: None 980 """ 981 982 _params = locals() 983 984 _all_params = [ 985 'repository', 986 'ref', 987 'path', 988 'range' 989 ] 990 _all_params.extend( 991 [ 992 'async_req', 993 '_return_http_data_only', 994 '_preload_content', 995 '_request_timeout', 996 '_request_auth', 997 '_content_type', 998 '_headers' 999 ] 1000 ) 1001 1002 # validate the arguments 1003 for _key, _val in _params['kwargs'].items(): 1004 if _key not in _all_params: 1005 raise ApiTypeError( 1006 "Got an unexpected keyword argument '%s'" 1007 " to method head_object" % _key 1008 ) 1009 _params[_key] = _val 1010 del _params['kwargs'] 1011 1012 _collection_formats = {} 1013 1014 # process the path parameters 1015 _path_params = {} 1016 if _params['repository']: 1017 _path_params['repository'] = _params['repository'] 1018 1019 if _params['ref']: 1020 _path_params['ref'] = _params['ref'] 1021 1022 1023 # process the query parameters 1024 _query_params = [] 1025 if _params.get('path') is not None: # noqa: E501 1026 _query_params.append(('path', _params['path'])) 1027 1028 # process the header parameters 1029 _header_params = dict(_params.get('_headers', {})) 1030 if _params['range']: 1031 _header_params['Range'] = _params['range'] 1032 1033 # process the form parameters 1034 _form_params = [] 1035 _files = {} 1036 # process the body parameter 1037 _body_params = None 1038 # authentication setting 1039 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 1040 1041 _response_types_map = {} 1042 1043 return self.api_client.call_api( 1044 '/repositories/{repository}/refs/{ref}/objects', 'HEAD', 1045 _path_params, 1046 _query_params, 1047 _header_params, 1048 body=_body_params, 1049 post_params=_form_params, 1050 files=_files, 1051 response_types_map=_response_types_map, 1052 auth_settings=_auth_settings, 1053 async_req=_params.get('async_req'), 1054 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 1055 _preload_content=_params.get('_preload_content', True), 1056 _request_timeout=_params.get('_request_timeout'), 1057 collection_formats=_collection_formats, 1058 _request_auth=_params.get('_request_auth')) 1059 1060 @validate_arguments 1061 def list_objects(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], user_metadata : Optional[StrictBool] = None, presign : Optional[StrictBool] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, delimiter : Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, **kwargs) -> ObjectStatsList: # noqa: E501 1062 """list objects under a given prefix # noqa: E501 1063 1064 This method makes a synchronous HTTP request by default. To make an 1065 asynchronous HTTP request, please pass async_req=True 1066 1067 >>> thread = api.list_objects(repository, ref, user_metadata, presign, after, amount, delimiter, prefix, async_req=True) 1068 >>> result = thread.get() 1069 1070 :param repository: (required) 1071 :type repository: str 1072 :param ref: a reference (could be either a branch or a commit ID) (required) 1073 :type ref: str 1074 :param user_metadata: 1075 :type user_metadata: bool 1076 :param presign: 1077 :type presign: bool 1078 :param after: return items after this value 1079 :type after: str 1080 :param amount: how many items to return 1081 :type amount: int 1082 :param delimiter: delimiter used to group common prefixes by 1083 :type delimiter: str 1084 :param prefix: return items prefixed with this value 1085 :type prefix: str 1086 :param async_req: Whether to execute the request asynchronously. 1087 :type async_req: bool, optional 1088 :param _request_timeout: timeout setting for this request. If one 1089 number provided, it will be total request 1090 timeout. It can also be a pair (tuple) of 1091 (connection, read) timeouts. 1092 :return: Returns the result object. 1093 If the method is called asynchronously, 1094 returns the request thread. 1095 :rtype: ObjectStatsList 1096 """ 1097 kwargs['_return_http_data_only'] = True 1098 if '_preload_content' in kwargs: 1099 raise ValueError("Error! Please call the list_objects_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 1100 return self.list_objects_with_http_info(repository, ref, user_metadata, presign, after, amount, delimiter, prefix, **kwargs) # noqa: E501 1101 1102 @validate_arguments 1103 def list_objects_with_http_info(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], user_metadata : Optional[StrictBool] = None, presign : Optional[StrictBool] = None, after : Annotated[Optional[StrictStr], Field(description="return items after this value")] = None, amount : Annotated[Optional[conint(strict=True, le=1000, ge=-1)], Field(description="how many items to return")] = None, delimiter : Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, **kwargs) -> ApiResponse: # noqa: E501 1104 """list objects under a given prefix # noqa: E501 1105 1106 This method makes a synchronous HTTP request by default. To make an 1107 asynchronous HTTP request, please pass async_req=True 1108 1109 >>> thread = api.list_objects_with_http_info(repository, ref, user_metadata, presign, after, amount, delimiter, prefix, async_req=True) 1110 >>> result = thread.get() 1111 1112 :param repository: (required) 1113 :type repository: str 1114 :param ref: a reference (could be either a branch or a commit ID) (required) 1115 :type ref: str 1116 :param user_metadata: 1117 :type user_metadata: bool 1118 :param presign: 1119 :type presign: bool 1120 :param after: return items after this value 1121 :type after: str 1122 :param amount: how many items to return 1123 :type amount: int 1124 :param delimiter: delimiter used to group common prefixes by 1125 :type delimiter: str 1126 :param prefix: return items prefixed with this value 1127 :type prefix: str 1128 :param async_req: Whether to execute the request asynchronously. 1129 :type async_req: bool, optional 1130 :param _preload_content: if False, the ApiResponse.data will 1131 be set to none and raw_data will store the 1132 HTTP response body without reading/decoding. 1133 Default is True. 1134 :type _preload_content: bool, optional 1135 :param _return_http_data_only: response data instead of ApiResponse 1136 object with status code, headers, etc 1137 :type _return_http_data_only: bool, optional 1138 :param _request_timeout: timeout setting for this request. If one 1139 number provided, it will be total request 1140 timeout. It can also be a pair (tuple) of 1141 (connection, read) timeouts. 1142 :param _request_auth: set to override the auth_settings for an a single 1143 request; this effectively ignores the authentication 1144 in the spec for a single request. 1145 :type _request_auth: dict, optional 1146 :type _content_type: string, optional: force content-type for the request 1147 :return: Returns the result object. 1148 If the method is called asynchronously, 1149 returns the request thread. 1150 :rtype: tuple(ObjectStatsList, status_code(int), headers(HTTPHeaderDict)) 1151 """ 1152 1153 _params = locals() 1154 1155 _all_params = [ 1156 'repository', 1157 'ref', 1158 'user_metadata', 1159 'presign', 1160 'after', 1161 'amount', 1162 'delimiter', 1163 'prefix' 1164 ] 1165 _all_params.extend( 1166 [ 1167 'async_req', 1168 '_return_http_data_only', 1169 '_preload_content', 1170 '_request_timeout', 1171 '_request_auth', 1172 '_content_type', 1173 '_headers' 1174 ] 1175 ) 1176 1177 # validate the arguments 1178 for _key, _val in _params['kwargs'].items(): 1179 if _key not in _all_params: 1180 raise ApiTypeError( 1181 "Got an unexpected keyword argument '%s'" 1182 " to method list_objects" % _key 1183 ) 1184 _params[_key] = _val 1185 del _params['kwargs'] 1186 1187 _collection_formats = {} 1188 1189 # process the path parameters 1190 _path_params = {} 1191 if _params['repository']: 1192 _path_params['repository'] = _params['repository'] 1193 1194 if _params['ref']: 1195 _path_params['ref'] = _params['ref'] 1196 1197 1198 # process the query parameters 1199 _query_params = [] 1200 if _params.get('user_metadata') is not None: # noqa: E501 1201 _query_params.append(('user_metadata', _params['user_metadata'])) 1202 1203 if _params.get('presign') is not None: # noqa: E501 1204 _query_params.append(('presign', _params['presign'])) 1205 1206 if _params.get('after') is not None: # noqa: E501 1207 _query_params.append(('after', _params['after'])) 1208 1209 if _params.get('amount') is not None: # noqa: E501 1210 _query_params.append(('amount', _params['amount'])) 1211 1212 if _params.get('delimiter') is not None: # noqa: E501 1213 _query_params.append(('delimiter', _params['delimiter'])) 1214 1215 if _params.get('prefix') is not None: # noqa: E501 1216 _query_params.append(('prefix', _params['prefix'])) 1217 1218 # process the header parameters 1219 _header_params = dict(_params.get('_headers', {})) 1220 # process the form parameters 1221 _form_params = [] 1222 _files = {} 1223 # process the body parameter 1224 _body_params = None 1225 # set the HTTP header `Accept` 1226 _header_params['Accept'] = self.api_client.select_header_accept( 1227 ['application/json']) # noqa: E501 1228 1229 # authentication setting 1230 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 1231 1232 _response_types_map = { 1233 '200': "ObjectStatsList", 1234 '401': "Error", 1235 '404': "Error", 1236 '420': None, 1237 } 1238 1239 return self.api_client.call_api( 1240 '/repositories/{repository}/refs/{ref}/objects/ls', 'GET', 1241 _path_params, 1242 _query_params, 1243 _header_params, 1244 body=_body_params, 1245 post_params=_form_params, 1246 files=_files, 1247 response_types_map=_response_types_map, 1248 auth_settings=_auth_settings, 1249 async_req=_params.get('async_req'), 1250 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 1251 _preload_content=_params.get('_preload_content', True), 1252 _request_timeout=_params.get('_request_timeout'), 1253 collection_formats=_collection_formats, 1254 _request_auth=_params.get('_request_auth')) 1255 1256 @validate_arguments 1257 def stat_object(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the branch")], user_metadata : Optional[StrictBool] = None, presign : Optional[StrictBool] = None, **kwargs) -> ObjectStats: # noqa: E501 1258 """get object metadata # noqa: E501 1259 1260 This method makes a synchronous HTTP request by default. To make an 1261 asynchronous HTTP request, please pass async_req=True 1262 1263 >>> thread = api.stat_object(repository, ref, path, user_metadata, presign, async_req=True) 1264 >>> result = thread.get() 1265 1266 :param repository: (required) 1267 :type repository: str 1268 :param ref: a reference (could be either a branch or a commit ID) (required) 1269 :type ref: str 1270 :param path: relative to the branch (required) 1271 :type path: str 1272 :param user_metadata: 1273 :type user_metadata: bool 1274 :param presign: 1275 :type presign: bool 1276 :param async_req: Whether to execute the request asynchronously. 1277 :type async_req: bool, optional 1278 :param _request_timeout: timeout setting for this request. If one 1279 number provided, it will be total request 1280 timeout. It can also be a pair (tuple) of 1281 (connection, read) timeouts. 1282 :return: Returns the result object. 1283 If the method is called asynchronously, 1284 returns the request thread. 1285 :rtype: ObjectStats 1286 """ 1287 kwargs['_return_http_data_only'] = True 1288 if '_preload_content' in kwargs: 1289 raise ValueError("Error! Please call the stat_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 1290 return self.stat_object_with_http_info(repository, ref, path, user_metadata, presign, **kwargs) # noqa: E501 1291 1292 @validate_arguments 1293 def stat_object_with_http_info(self, repository : StrictStr, ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], path : Annotated[StrictStr, Field(..., description="relative to the branch")], user_metadata : Optional[StrictBool] = None, presign : Optional[StrictBool] = None, **kwargs) -> ApiResponse: # noqa: E501 1294 """get object metadata # noqa: E501 1295 1296 This method makes a synchronous HTTP request by default. To make an 1297 asynchronous HTTP request, please pass async_req=True 1298 1299 >>> thread = api.stat_object_with_http_info(repository, ref, path, user_metadata, presign, async_req=True) 1300 >>> result = thread.get() 1301 1302 :param repository: (required) 1303 :type repository: str 1304 :param ref: a reference (could be either a branch or a commit ID) (required) 1305 :type ref: str 1306 :param path: relative to the branch (required) 1307 :type path: str 1308 :param user_metadata: 1309 :type user_metadata: bool 1310 :param presign: 1311 :type presign: bool 1312 :param async_req: Whether to execute the request asynchronously. 1313 :type async_req: bool, optional 1314 :param _preload_content: if False, the ApiResponse.data will 1315 be set to none and raw_data will store the 1316 HTTP response body without reading/decoding. 1317 Default is True. 1318 :type _preload_content: bool, optional 1319 :param _return_http_data_only: response data instead of ApiResponse 1320 object with status code, headers, etc 1321 :type _return_http_data_only: bool, optional 1322 :param _request_timeout: timeout setting for this request. If one 1323 number provided, it will be total request 1324 timeout. It can also be a pair (tuple) of 1325 (connection, read) timeouts. 1326 :param _request_auth: set to override the auth_settings for an a single 1327 request; this effectively ignores the authentication 1328 in the spec for a single request. 1329 :type _request_auth: dict, optional 1330 :type _content_type: string, optional: force content-type for the request 1331 :return: Returns the result object. 1332 If the method is called asynchronously, 1333 returns the request thread. 1334 :rtype: tuple(ObjectStats, status_code(int), headers(HTTPHeaderDict)) 1335 """ 1336 1337 _params = locals() 1338 1339 _all_params = [ 1340 'repository', 1341 'ref', 1342 'path', 1343 'user_metadata', 1344 'presign' 1345 ] 1346 _all_params.extend( 1347 [ 1348 'async_req', 1349 '_return_http_data_only', 1350 '_preload_content', 1351 '_request_timeout', 1352 '_request_auth', 1353 '_content_type', 1354 '_headers' 1355 ] 1356 ) 1357 1358 # validate the arguments 1359 for _key, _val in _params['kwargs'].items(): 1360 if _key not in _all_params: 1361 raise ApiTypeError( 1362 "Got an unexpected keyword argument '%s'" 1363 " to method stat_object" % _key 1364 ) 1365 _params[_key] = _val 1366 del _params['kwargs'] 1367 1368 _collection_formats = {} 1369 1370 # process the path parameters 1371 _path_params = {} 1372 if _params['repository']: 1373 _path_params['repository'] = _params['repository'] 1374 1375 if _params['ref']: 1376 _path_params['ref'] = _params['ref'] 1377 1378 1379 # process the query parameters 1380 _query_params = [] 1381 if _params.get('path') is not None: # noqa: E501 1382 _query_params.append(('path', _params['path'])) 1383 1384 if _params.get('user_metadata') is not None: # noqa: E501 1385 _query_params.append(('user_metadata', _params['user_metadata'])) 1386 1387 if _params.get('presign') is not None: # noqa: E501 1388 _query_params.append(('presign', _params['presign'])) 1389 1390 # process the header parameters 1391 _header_params = dict(_params.get('_headers', {})) 1392 # process the form parameters 1393 _form_params = [] 1394 _files = {} 1395 # process the body parameter 1396 _body_params = None 1397 # set the HTTP header `Accept` 1398 _header_params['Accept'] = self.api_client.select_header_accept( 1399 ['application/json']) # noqa: E501 1400 1401 # authentication setting 1402 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 1403 1404 _response_types_map = { 1405 '200': "ObjectStats", 1406 '401': "Error", 1407 '404': "Error", 1408 '400': "Error", 1409 '410': None, 1410 '420': None, 1411 } 1412 1413 return self.api_client.call_api( 1414 '/repositories/{repository}/refs/{ref}/objects/stat', 'GET', 1415 _path_params, 1416 _query_params, 1417 _header_params, 1418 body=_body_params, 1419 post_params=_form_params, 1420 files=_files, 1421 response_types_map=_response_types_map, 1422 auth_settings=_auth_settings, 1423 async_req=_params.get('async_req'), 1424 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 1425 _preload_content=_params.get('_preload_content', True), 1426 _request_timeout=_params.get('_request_timeout'), 1427 collection_formats=_collection_formats, 1428 _request_auth=_params.get('_request_auth')) 1429 1430 @validate_arguments 1431 def upload_object(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], if_none_match : Annotated[Optional[StrictStr], Field(description="Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported.")] = None, storage_class : Annotated[Optional[StrictStr], Field(description="Deprecated, this capability will not be supported in future releases.")] = None, force : Optional[StrictBool] = None, content : Annotated[Optional[Union[StrictBytes, StrictStr]], Field(description="Only a single file per upload which must be named \\\"content\\\".")] = None, **kwargs) -> ObjectStats: # noqa: E501 1432 """upload_object # noqa: E501 1433 1434 This method makes a synchronous HTTP request by default. To make an 1435 asynchronous HTTP request, please pass async_req=True 1436 1437 >>> thread = api.upload_object(repository, branch, path, if_none_match, storage_class, force, content, async_req=True) 1438 >>> result = thread.get() 1439 1440 :param repository: (required) 1441 :type repository: str 1442 :param branch: (required) 1443 :type branch: str 1444 :param path: relative to the branch (required) 1445 :type path: str 1446 :param if_none_match: Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. 1447 :type if_none_match: str 1448 :param storage_class: Deprecated, this capability will not be supported in future releases. 1449 :type storage_class: str 1450 :param force: 1451 :type force: bool 1452 :param content: Only a single file per upload which must be named \\\"content\\\". 1453 :type content: bytearray 1454 :param async_req: Whether to execute the request asynchronously. 1455 :type async_req: bool, optional 1456 :param _request_timeout: timeout setting for this request. If one 1457 number provided, it will be total request 1458 timeout. It can also be a pair (tuple) of 1459 (connection, read) timeouts. 1460 :return: Returns the result object. 1461 If the method is called asynchronously, 1462 returns the request thread. 1463 :rtype: ObjectStats 1464 """ 1465 kwargs['_return_http_data_only'] = True 1466 if '_preload_content' in kwargs: 1467 raise ValueError("Error! Please call the upload_object_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 1468 return self.upload_object_with_http_info(repository, branch, path, if_none_match, storage_class, force, content, **kwargs) # noqa: E501 1469 1470 @validate_arguments 1471 def upload_object_with_http_info(self, repository : StrictStr, branch : StrictStr, path : Annotated[StrictStr, Field(..., description="relative to the branch")], if_none_match : Annotated[Optional[StrictStr], Field(description="Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported.")] = None, storage_class : Annotated[Optional[StrictStr], Field(description="Deprecated, this capability will not be supported in future releases.")] = None, force : Optional[StrictBool] = None, content : Annotated[Optional[Union[StrictBytes, StrictStr]], Field(description="Only a single file per upload which must be named \\\"content\\\".")] = None, **kwargs) -> ApiResponse: # noqa: E501 1472 """upload_object # noqa: E501 1473 1474 This method makes a synchronous HTTP request by default. To make an 1475 asynchronous HTTP request, please pass async_req=True 1476 1477 >>> thread = api.upload_object_with_http_info(repository, branch, path, if_none_match, storage_class, force, content, async_req=True) 1478 >>> result = thread.get() 1479 1480 :param repository: (required) 1481 :type repository: str 1482 :param branch: (required) 1483 :type branch: str 1484 :param path: relative to the branch (required) 1485 :type path: str 1486 :param if_none_match: Set to \"*\" to atomically allow the upload only if the key has no object yet. Other values are not supported. 1487 :type if_none_match: str 1488 :param storage_class: Deprecated, this capability will not be supported in future releases. 1489 :type storage_class: str 1490 :param force: 1491 :type force: bool 1492 :param content: Only a single file per upload which must be named \\\"content\\\". 1493 :type content: bytearray 1494 :param async_req: Whether to execute the request asynchronously. 1495 :type async_req: bool, optional 1496 :param _preload_content: if False, the ApiResponse.data will 1497 be set to none and raw_data will store the 1498 HTTP response body without reading/decoding. 1499 Default is True. 1500 :type _preload_content: bool, optional 1501 :param _return_http_data_only: response data instead of ApiResponse 1502 object with status code, headers, etc 1503 :type _return_http_data_only: bool, optional 1504 :param _request_timeout: timeout setting for this request. If one 1505 number provided, it will be total request 1506 timeout. It can also be a pair (tuple) of 1507 (connection, read) timeouts. 1508 :param _request_auth: set to override the auth_settings for an a single 1509 request; this effectively ignores the authentication 1510 in the spec for a single request. 1511 :type _request_auth: dict, optional 1512 :type _content_type: string, optional: force content-type for the request 1513 :return: Returns the result object. 1514 If the method is called asynchronously, 1515 returns the request thread. 1516 :rtype: tuple(ObjectStats, status_code(int), headers(HTTPHeaderDict)) 1517 """ 1518 1519 _params = locals() 1520 1521 _all_params = [ 1522 'repository', 1523 'branch', 1524 'path', 1525 'if_none_match', 1526 'storage_class', 1527 'force', 1528 'content' 1529 ] 1530 _all_params.extend( 1531 [ 1532 'async_req', 1533 '_return_http_data_only', 1534 '_preload_content', 1535 '_request_timeout', 1536 '_request_auth', 1537 '_content_type', 1538 '_headers' 1539 ] 1540 ) 1541 1542 # validate the arguments 1543 for _key, _val in _params['kwargs'].items(): 1544 if _key not in _all_params: 1545 raise ApiTypeError( 1546 "Got an unexpected keyword argument '%s'" 1547 " to method upload_object" % _key 1548 ) 1549 _params[_key] = _val 1550 del _params['kwargs'] 1551 1552 _collection_formats = {} 1553 1554 # process the path parameters 1555 _path_params = {} 1556 if _params['repository']: 1557 _path_params['repository'] = _params['repository'] 1558 1559 if _params['branch']: 1560 _path_params['branch'] = _params['branch'] 1561 1562 1563 # process the query parameters 1564 _query_params = [] 1565 if _params.get('path') is not None: # noqa: E501 1566 _query_params.append(('path', _params['path'])) 1567 1568 if _params.get('storage_class') is not None: # noqa: E501 1569 _query_params.append(('storageClass', _params['storage_class'])) 1570 1571 if _params.get('force') is not None: # noqa: E501 1572 _query_params.append(('force', _params['force'])) 1573 1574 # process the header parameters 1575 _header_params = dict(_params.get('_headers', {})) 1576 if _params['if_none_match']: 1577 _header_params['If-None-Match'] = _params['if_none_match'] 1578 1579 # process the form parameters 1580 _form_params = [] 1581 _files = {} 1582 if _params['content']: 1583 _files['content'] = _params['content'] 1584 1585 # process the body parameter 1586 _body_params = None 1587 # set the HTTP header `Accept` 1588 _header_params['Accept'] = self.api_client.select_header_accept( 1589 ['application/json']) # noqa: E501 1590 1591 # set the HTTP header `Content-Type` 1592 _content_types_list = _params.get('_content_type', 1593 self.api_client.select_header_content_type( 1594 ['multipart/form-data', 'application/octet-stream'])) 1595 if _content_types_list: 1596 _header_params['Content-Type'] = _content_types_list 1597 1598 # authentication setting 1599 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 1600 1601 _response_types_map = { 1602 '201': "ObjectStats", 1603 '400': "Error", 1604 '401': "Error", 1605 '403': "Error", 1606 '404': "Error", 1607 '412': "Error", 1608 '420': None, 1609 } 1610 1611 return self.api_client.call_api( 1612 '/repositories/{repository}/branches/{branch}/objects', 'POST', 1613 _path_params, 1614 _query_params, 1615 _header_params, 1616 body=_body_params, 1617 post_params=_form_params, 1618 files=_files, 1619 response_types_map=_response_types_map, 1620 auth_settings=_auth_settings, 1621 async_req=_params.get('async_req'), 1622 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 1623 _preload_content=_params.get('_preload_content', True), 1624 _request_timeout=_params.get('_request_timeout'), 1625 collection_formats=_collection_formats, 1626 _request_auth=_params.get('_request_auth'))