github.com/treeverse/lakefs@v1.24.1-0.20240520134607-95648127bfb0/clients/python/lakefs_sdk/api/refs_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 from datetime import datetime 27 28 try: 29 from pydantic.v1 import Field, StrictBool, StrictStr, conint, conlist 30 except ImportError: 31 from pydantic import Field, StrictBool, StrictStr, conint, conlist 32 33 from typing import Optional 34 35 from lakefs_sdk.models.commit_list import CommitList 36 from lakefs_sdk.models.diff_list import DiffList 37 from lakefs_sdk.models.find_merge_base_result import FindMergeBaseResult 38 from lakefs_sdk.models.merge import Merge 39 from lakefs_sdk.models.merge_result import MergeResult 40 41 from lakefs_sdk.api_client import ApiClient 42 from lakefs_sdk.api_response import ApiResponse 43 from lakefs_sdk.exceptions import ( # noqa: F401 44 ApiTypeError, 45 ApiValueError 46 ) 47 48 49 class RefsApi(object): 50 """NOTE: This class is auto generated by OpenAPI Generator 51 Ref: https://openapi-generator.tech 52 53 Do not edit the class manually. 54 """ 55 56 def __init__(self, api_client=None): 57 if api_client is None: 58 api_client = ApiClient.get_default() 59 self.api_client = api_client 60 61 @validate_arguments 62 def diff_refs(self, repository : StrictStr, left_ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], right_ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID) to compare against")], 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, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, delimiter : Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, type : Optional[StrictStr] = None, **kwargs) -> DiffList: # noqa: E501 63 """diff references # noqa: E501 64 65 This method makes a synchronous HTTP request by default. To make an 66 asynchronous HTTP request, please pass async_req=True 67 68 >>> thread = api.diff_refs(repository, left_ref, right_ref, after, amount, prefix, delimiter, type, async_req=True) 69 >>> result = thread.get() 70 71 :param repository: (required) 72 :type repository: str 73 :param left_ref: a reference (could be either a branch or a commit ID) (required) 74 :type left_ref: str 75 :param right_ref: a reference (could be either a branch or a commit ID) to compare against (required) 76 :type right_ref: str 77 :param after: return items after this value 78 :type after: str 79 :param amount: how many items to return 80 :type amount: int 81 :param prefix: return items prefixed with this value 82 :type prefix: str 83 :param delimiter: delimiter used to group common prefixes by 84 :type delimiter: str 85 :param type: 86 :type type: str 87 :param async_req: Whether to execute the request asynchronously. 88 :type async_req: bool, optional 89 :param _request_timeout: timeout setting for this request. If one 90 number provided, it will be total request 91 timeout. It can also be a pair (tuple) of 92 (connection, read) timeouts. 93 :return: Returns the result object. 94 If the method is called asynchronously, 95 returns the request thread. 96 :rtype: DiffList 97 """ 98 kwargs['_return_http_data_only'] = True 99 if '_preload_content' in kwargs: 100 raise ValueError("Error! Please call the diff_refs_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 101 return self.diff_refs_with_http_info(repository, left_ref, right_ref, after, amount, prefix, delimiter, type, **kwargs) # noqa: E501 102 103 @validate_arguments 104 def diff_refs_with_http_info(self, repository : StrictStr, left_ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID)")], right_ref : Annotated[StrictStr, Field(..., description="a reference (could be either a branch or a commit ID) to compare against")], 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, prefix : Annotated[Optional[StrictStr], Field(description="return items prefixed with this value")] = None, delimiter : Annotated[Optional[StrictStr], Field(description="delimiter used to group common prefixes by")] = None, type : Optional[StrictStr] = None, **kwargs) -> ApiResponse: # noqa: E501 105 """diff references # noqa: E501 106 107 This method makes a synchronous HTTP request by default. To make an 108 asynchronous HTTP request, please pass async_req=True 109 110 >>> thread = api.diff_refs_with_http_info(repository, left_ref, right_ref, after, amount, prefix, delimiter, type, async_req=True) 111 >>> result = thread.get() 112 113 :param repository: (required) 114 :type repository: str 115 :param left_ref: a reference (could be either a branch or a commit ID) (required) 116 :type left_ref: str 117 :param right_ref: a reference (could be either a branch or a commit ID) to compare against (required) 118 :type right_ref: str 119 :param after: return items after this value 120 :type after: str 121 :param amount: how many items to return 122 :type amount: int 123 :param prefix: return items prefixed with this value 124 :type prefix: str 125 :param delimiter: delimiter used to group common prefixes by 126 :type delimiter: str 127 :param type: 128 :type type: str 129 :param async_req: Whether to execute the request asynchronously. 130 :type async_req: bool, optional 131 :param _preload_content: if False, the ApiResponse.data will 132 be set to none and raw_data will store the 133 HTTP response body without reading/decoding. 134 Default is True. 135 :type _preload_content: bool, optional 136 :param _return_http_data_only: response data instead of ApiResponse 137 object with status code, headers, etc 138 :type _return_http_data_only: bool, optional 139 :param _request_timeout: timeout setting for this request. If one 140 number provided, it will be total request 141 timeout. It can also be a pair (tuple) of 142 (connection, read) timeouts. 143 :param _request_auth: set to override the auth_settings for an a single 144 request; this effectively ignores the authentication 145 in the spec for a single request. 146 :type _request_auth: dict, optional 147 :type _content_type: string, optional: force content-type for the request 148 :return: Returns the result object. 149 If the method is called asynchronously, 150 returns the request thread. 151 :rtype: tuple(DiffList, status_code(int), headers(HTTPHeaderDict)) 152 """ 153 154 _params = locals() 155 156 _all_params = [ 157 'repository', 158 'left_ref', 159 'right_ref', 160 'after', 161 'amount', 162 'prefix', 163 'delimiter', 164 'type' 165 ] 166 _all_params.extend( 167 [ 168 'async_req', 169 '_return_http_data_only', 170 '_preload_content', 171 '_request_timeout', 172 '_request_auth', 173 '_content_type', 174 '_headers' 175 ] 176 ) 177 178 # validate the arguments 179 for _key, _val in _params['kwargs'].items(): 180 if _key not in _all_params: 181 raise ApiTypeError( 182 "Got an unexpected keyword argument '%s'" 183 " to method diff_refs" % _key 184 ) 185 _params[_key] = _val 186 del _params['kwargs'] 187 188 _collection_formats = {} 189 190 # process the path parameters 191 _path_params = {} 192 if _params['repository']: 193 _path_params['repository'] = _params['repository'] 194 195 if _params['left_ref']: 196 _path_params['leftRef'] = _params['left_ref'] 197 198 if _params['right_ref']: 199 _path_params['rightRef'] = _params['right_ref'] 200 201 202 # process the query parameters 203 _query_params = [] 204 if _params.get('after') is not None: # noqa: E501 205 _query_params.append(('after', _params['after'])) 206 207 if _params.get('amount') is not None: # noqa: E501 208 _query_params.append(('amount', _params['amount'])) 209 210 if _params.get('prefix') is not None: # noqa: E501 211 _query_params.append(('prefix', _params['prefix'])) 212 213 if _params.get('delimiter') is not None: # noqa: E501 214 _query_params.append(('delimiter', _params['delimiter'])) 215 216 if _params.get('type') is not None: # noqa: E501 217 _query_params.append(('type', _params['type'])) 218 219 # process the header parameters 220 _header_params = dict(_params.get('_headers', {})) 221 # process the form parameters 222 _form_params = [] 223 _files = {} 224 # process the body parameter 225 _body_params = None 226 # set the HTTP header `Accept` 227 _header_params['Accept'] = self.api_client.select_header_accept( 228 ['application/json']) # noqa: E501 229 230 # authentication setting 231 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 232 233 _response_types_map = { 234 '200': "DiffList", 235 '401': "Error", 236 '404': "Error", 237 '420': None, 238 } 239 240 return self.api_client.call_api( 241 '/repositories/{repository}/refs/{leftRef}/diff/{rightRef}', 'GET', 242 _path_params, 243 _query_params, 244 _header_params, 245 body=_body_params, 246 post_params=_form_params, 247 files=_files, 248 response_types_map=_response_types_map, 249 auth_settings=_auth_settings, 250 async_req=_params.get('async_req'), 251 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 252 _preload_content=_params.get('_preload_content', True), 253 _request_timeout=_params.get('_request_timeout'), 254 collection_formats=_collection_formats, 255 _request_auth=_params.get('_request_auth')) 256 257 @validate_arguments 258 def find_merge_base(self, repository : StrictStr, source_ref : Annotated[StrictStr, Field(..., description="source ref")], destination_branch : Annotated[StrictStr, Field(..., description="destination branch name")], **kwargs) -> FindMergeBaseResult: # noqa: E501 259 """find the merge base for 2 references # noqa: E501 260 261 This method makes a synchronous HTTP request by default. To make an 262 asynchronous HTTP request, please pass async_req=True 263 264 >>> thread = api.find_merge_base(repository, source_ref, destination_branch, async_req=True) 265 >>> result = thread.get() 266 267 :param repository: (required) 268 :type repository: str 269 :param source_ref: source ref (required) 270 :type source_ref: str 271 :param destination_branch: destination branch name (required) 272 :type destination_branch: str 273 :param async_req: Whether to execute the request asynchronously. 274 :type async_req: bool, optional 275 :param _request_timeout: timeout setting for this request. If one 276 number provided, it will be total request 277 timeout. It can also be a pair (tuple) of 278 (connection, read) timeouts. 279 :return: Returns the result object. 280 If the method is called asynchronously, 281 returns the request thread. 282 :rtype: FindMergeBaseResult 283 """ 284 kwargs['_return_http_data_only'] = True 285 if '_preload_content' in kwargs: 286 raise ValueError("Error! Please call the find_merge_base_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 287 return self.find_merge_base_with_http_info(repository, source_ref, destination_branch, **kwargs) # noqa: E501 288 289 @validate_arguments 290 def find_merge_base_with_http_info(self, repository : StrictStr, source_ref : Annotated[StrictStr, Field(..., description="source ref")], destination_branch : Annotated[StrictStr, Field(..., description="destination branch name")], **kwargs) -> ApiResponse: # noqa: E501 291 """find the merge base for 2 references # noqa: E501 292 293 This method makes a synchronous HTTP request by default. To make an 294 asynchronous HTTP request, please pass async_req=True 295 296 >>> thread = api.find_merge_base_with_http_info(repository, source_ref, destination_branch, async_req=True) 297 >>> result = thread.get() 298 299 :param repository: (required) 300 :type repository: str 301 :param source_ref: source ref (required) 302 :type source_ref: str 303 :param destination_branch: destination branch name (required) 304 :type destination_branch: str 305 :param async_req: Whether to execute the request asynchronously. 306 :type async_req: bool, optional 307 :param _preload_content: if False, the ApiResponse.data will 308 be set to none and raw_data will store the 309 HTTP response body without reading/decoding. 310 Default is True. 311 :type _preload_content: bool, optional 312 :param _return_http_data_only: response data instead of ApiResponse 313 object with status code, headers, etc 314 :type _return_http_data_only: bool, optional 315 :param _request_timeout: timeout setting for this request. If one 316 number provided, it will be total request 317 timeout. It can also be a pair (tuple) of 318 (connection, read) timeouts. 319 :param _request_auth: set to override the auth_settings for an a single 320 request; this effectively ignores the authentication 321 in the spec for a single request. 322 :type _request_auth: dict, optional 323 :type _content_type: string, optional: force content-type for the request 324 :return: Returns the result object. 325 If the method is called asynchronously, 326 returns the request thread. 327 :rtype: tuple(FindMergeBaseResult, status_code(int), headers(HTTPHeaderDict)) 328 """ 329 330 _params = locals() 331 332 _all_params = [ 333 'repository', 334 'source_ref', 335 'destination_branch' 336 ] 337 _all_params.extend( 338 [ 339 'async_req', 340 '_return_http_data_only', 341 '_preload_content', 342 '_request_timeout', 343 '_request_auth', 344 '_content_type', 345 '_headers' 346 ] 347 ) 348 349 # validate the arguments 350 for _key, _val in _params['kwargs'].items(): 351 if _key not in _all_params: 352 raise ApiTypeError( 353 "Got an unexpected keyword argument '%s'" 354 " to method find_merge_base" % _key 355 ) 356 _params[_key] = _val 357 del _params['kwargs'] 358 359 _collection_formats = {} 360 361 # process the path parameters 362 _path_params = {} 363 if _params['repository']: 364 _path_params['repository'] = _params['repository'] 365 366 if _params['source_ref']: 367 _path_params['sourceRef'] = _params['source_ref'] 368 369 if _params['destination_branch']: 370 _path_params['destinationBranch'] = _params['destination_branch'] 371 372 373 # process the query parameters 374 _query_params = [] 375 # process the header parameters 376 _header_params = dict(_params.get('_headers', {})) 377 # process the form parameters 378 _form_params = [] 379 _files = {} 380 # process the body parameter 381 _body_params = None 382 # set the HTTP header `Accept` 383 _header_params['Accept'] = self.api_client.select_header_accept( 384 ['application/json']) # noqa: E501 385 386 # authentication setting 387 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 388 389 _response_types_map = { 390 '200': "FindMergeBaseResult", 391 '400': "Error", 392 '401': "Error", 393 '404': "Error", 394 '420': None, 395 } 396 397 return self.api_client.call_api( 398 '/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}', 'GET', 399 _path_params, 400 _query_params, 401 _header_params, 402 body=_body_params, 403 post_params=_form_params, 404 files=_files, 405 response_types_map=_response_types_map, 406 auth_settings=_auth_settings, 407 async_req=_params.get('async_req'), 408 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 409 _preload_content=_params.get('_preload_content', True), 410 _request_timeout=_params.get('_request_timeout'), 411 collection_formats=_collection_formats, 412 _request_auth=_params.get('_request_auth')) 413 414 @validate_arguments 415 def log_commits(self, repository : StrictStr, ref : StrictStr, 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, objects : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a specific object")] = None, prefixes : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a prefix")] = None, limit : Annotated[Optional[StrictBool], Field(description="limit the number of items in return to 'amount'. Without further indication on actual number of items.")] = None, first_parent : Annotated[Optional[StrictBool], Field(description="if set to true, follow only the first parent upon reaching a merge commit")] = None, since : Annotated[Optional[datetime], Field(description="Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions.")] = None, stop_at : Annotated[Optional[StrictStr], Field(description="A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions.")] = None, **kwargs) -> CommitList: # noqa: E501 416 """get commit log from ref. If both objects and prefixes are empty, return all commits. # noqa: E501 417 418 This method makes a synchronous HTTP request by default. To make an 419 asynchronous HTTP request, please pass async_req=True 420 421 >>> thread = api.log_commits(repository, ref, after, amount, objects, prefixes, limit, first_parent, since, stop_at, async_req=True) 422 >>> result = thread.get() 423 424 :param repository: (required) 425 :type repository: str 426 :param ref: (required) 427 :type ref: str 428 :param after: return items after this value 429 :type after: str 430 :param amount: how many items to return 431 :type amount: int 432 :param objects: list of paths, each element is a path of a specific object 433 :type objects: List[str] 434 :param prefixes: list of paths, each element is a path of a prefix 435 :type prefixes: List[str] 436 :param limit: limit the number of items in return to 'amount'. Without further indication on actual number of items. 437 :type limit: bool 438 :param first_parent: if set to true, follow only the first parent upon reaching a merge commit 439 :type first_parent: bool 440 :param since: Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. 441 :type since: datetime 442 :param stop_at: A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. 443 :type stop_at: str 444 :param async_req: Whether to execute the request asynchronously. 445 :type async_req: bool, optional 446 :param _request_timeout: timeout setting for this request. If one 447 number provided, it will be total request 448 timeout. It can also be a pair (tuple) of 449 (connection, read) timeouts. 450 :return: Returns the result object. 451 If the method is called asynchronously, 452 returns the request thread. 453 :rtype: CommitList 454 """ 455 kwargs['_return_http_data_only'] = True 456 if '_preload_content' in kwargs: 457 raise ValueError("Error! Please call the log_commits_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 458 return self.log_commits_with_http_info(repository, ref, after, amount, objects, prefixes, limit, first_parent, since, stop_at, **kwargs) # noqa: E501 459 460 @validate_arguments 461 def log_commits_with_http_info(self, repository : StrictStr, ref : StrictStr, 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, objects : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a specific object")] = None, prefixes : Annotated[Optional[conlist(StrictStr)], Field(description="list of paths, each element is a path of a prefix")] = None, limit : Annotated[Optional[StrictBool], Field(description="limit the number of items in return to 'amount'. Without further indication on actual number of items.")] = None, first_parent : Annotated[Optional[StrictBool], Field(description="if set to true, follow only the first parent upon reaching a merge commit")] = None, since : Annotated[Optional[datetime], Field(description="Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions.")] = None, stop_at : Annotated[Optional[StrictStr], Field(description="A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions.")] = None, **kwargs) -> ApiResponse: # noqa: E501 462 """get commit log from ref. If both objects and prefixes are empty, return all commits. # noqa: E501 463 464 This method makes a synchronous HTTP request by default. To make an 465 asynchronous HTTP request, please pass async_req=True 466 467 >>> thread = api.log_commits_with_http_info(repository, ref, after, amount, objects, prefixes, limit, first_parent, since, stop_at, async_req=True) 468 >>> result = thread.get() 469 470 :param repository: (required) 471 :type repository: str 472 :param ref: (required) 473 :type ref: str 474 :param after: return items after this value 475 :type after: str 476 :param amount: how many items to return 477 :type amount: int 478 :param objects: list of paths, each element is a path of a specific object 479 :type objects: List[str] 480 :param prefixes: list of paths, each element is a path of a prefix 481 :type prefixes: List[str] 482 :param limit: limit the number of items in return to 'amount'. Without further indication on actual number of items. 483 :type limit: bool 484 :param first_parent: if set to true, follow only the first parent upon reaching a merge commit 485 :type first_parent: bool 486 :param since: Show commits more recent than a specific date-time. In case used with stop_at parameter, will stop at the first commit that meets any of the conditions. 487 :type since: datetime 488 :param stop_at: A reference to stop at. In case used with since parameter, will stop at the first commit that meets any of the conditions. 489 :type stop_at: str 490 :param async_req: Whether to execute the request asynchronously. 491 :type async_req: bool, optional 492 :param _preload_content: if False, the ApiResponse.data will 493 be set to none and raw_data will store the 494 HTTP response body without reading/decoding. 495 Default is True. 496 :type _preload_content: bool, optional 497 :param _return_http_data_only: response data instead of ApiResponse 498 object with status code, headers, etc 499 :type _return_http_data_only: bool, optional 500 :param _request_timeout: timeout setting for this request. If one 501 number provided, it will be total request 502 timeout. It can also be a pair (tuple) of 503 (connection, read) timeouts. 504 :param _request_auth: set to override the auth_settings for an a single 505 request; this effectively ignores the authentication 506 in the spec for a single request. 507 :type _request_auth: dict, optional 508 :type _content_type: string, optional: force content-type for the request 509 :return: Returns the result object. 510 If the method is called asynchronously, 511 returns the request thread. 512 :rtype: tuple(CommitList, status_code(int), headers(HTTPHeaderDict)) 513 """ 514 515 _params = locals() 516 517 _all_params = [ 518 'repository', 519 'ref', 520 'after', 521 'amount', 522 'objects', 523 'prefixes', 524 'limit', 525 'first_parent', 526 'since', 527 'stop_at' 528 ] 529 _all_params.extend( 530 [ 531 'async_req', 532 '_return_http_data_only', 533 '_preload_content', 534 '_request_timeout', 535 '_request_auth', 536 '_content_type', 537 '_headers' 538 ] 539 ) 540 541 # validate the arguments 542 for _key, _val in _params['kwargs'].items(): 543 if _key not in _all_params: 544 raise ApiTypeError( 545 "Got an unexpected keyword argument '%s'" 546 " to method log_commits" % _key 547 ) 548 _params[_key] = _val 549 del _params['kwargs'] 550 551 _collection_formats = {} 552 553 # process the path parameters 554 _path_params = {} 555 if _params['repository']: 556 _path_params['repository'] = _params['repository'] 557 558 if _params['ref']: 559 _path_params['ref'] = _params['ref'] 560 561 562 # process the query parameters 563 _query_params = [] 564 if _params.get('after') is not None: # noqa: E501 565 _query_params.append(('after', _params['after'])) 566 567 if _params.get('amount') is not None: # noqa: E501 568 _query_params.append(('amount', _params['amount'])) 569 570 if _params.get('objects') is not None: # noqa: E501 571 _query_params.append(('objects', _params['objects'])) 572 _collection_formats['objects'] = 'multi' 573 574 if _params.get('prefixes') is not None: # noqa: E501 575 _query_params.append(('prefixes', _params['prefixes'])) 576 _collection_formats['prefixes'] = 'multi' 577 578 if _params.get('limit') is not None: # noqa: E501 579 _query_params.append(('limit', _params['limit'])) 580 581 if _params.get('first_parent') is not None: # noqa: E501 582 _query_params.append(('first_parent', _params['first_parent'])) 583 584 if _params.get('since') is not None: # noqa: E501 585 if isinstance(_params['since'], datetime): 586 _query_params.append(('since', _params['since'].strftime(self.api_client.configuration.datetime_format))) 587 else: 588 _query_params.append(('since', _params['since'])) 589 590 if _params.get('stop_at') is not None: # noqa: E501 591 _query_params.append(('stop_at', _params['stop_at'])) 592 593 # process the header parameters 594 _header_params = dict(_params.get('_headers', {})) 595 # process the form parameters 596 _form_params = [] 597 _files = {} 598 # process the body parameter 599 _body_params = None 600 # set the HTTP header `Accept` 601 _header_params['Accept'] = self.api_client.select_header_accept( 602 ['application/json']) # noqa: E501 603 604 # authentication setting 605 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 606 607 _response_types_map = { 608 '200': "CommitList", 609 '401': "Error", 610 '404': "Error", 611 '420': None, 612 } 613 614 return self.api_client.call_api( 615 '/repositories/{repository}/refs/{ref}/commits', 'GET', 616 _path_params, 617 _query_params, 618 _header_params, 619 body=_body_params, 620 post_params=_form_params, 621 files=_files, 622 response_types_map=_response_types_map, 623 auth_settings=_auth_settings, 624 async_req=_params.get('async_req'), 625 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 626 _preload_content=_params.get('_preload_content', True), 627 _request_timeout=_params.get('_request_timeout'), 628 collection_formats=_collection_formats, 629 _request_auth=_params.get('_request_auth')) 630 631 @validate_arguments 632 def merge_into_branch(self, repository : StrictStr, source_ref : Annotated[StrictStr, Field(..., description="source ref")], destination_branch : Annotated[StrictStr, Field(..., description="destination branch name")], merge : Optional[Merge] = None, **kwargs) -> MergeResult: # noqa: E501 633 """merge references # noqa: E501 634 635 This method makes a synchronous HTTP request by default. To make an 636 asynchronous HTTP request, please pass async_req=True 637 638 >>> thread = api.merge_into_branch(repository, source_ref, destination_branch, merge, async_req=True) 639 >>> result = thread.get() 640 641 :param repository: (required) 642 :type repository: str 643 :param source_ref: source ref (required) 644 :type source_ref: str 645 :param destination_branch: destination branch name (required) 646 :type destination_branch: str 647 :param merge: 648 :type merge: Merge 649 :param async_req: Whether to execute the request asynchronously. 650 :type async_req: bool, optional 651 :param _request_timeout: timeout setting for this request. If one 652 number provided, it will be total request 653 timeout. It can also be a pair (tuple) of 654 (connection, read) timeouts. 655 :return: Returns the result object. 656 If the method is called asynchronously, 657 returns the request thread. 658 :rtype: MergeResult 659 """ 660 kwargs['_return_http_data_only'] = True 661 if '_preload_content' in kwargs: 662 raise ValueError("Error! Please call the merge_into_branch_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") 663 return self.merge_into_branch_with_http_info(repository, source_ref, destination_branch, merge, **kwargs) # noqa: E501 664 665 @validate_arguments 666 def merge_into_branch_with_http_info(self, repository : StrictStr, source_ref : Annotated[StrictStr, Field(..., description="source ref")], destination_branch : Annotated[StrictStr, Field(..., description="destination branch name")], merge : Optional[Merge] = None, **kwargs) -> ApiResponse: # noqa: E501 667 """merge references # noqa: E501 668 669 This method makes a synchronous HTTP request by default. To make an 670 asynchronous HTTP request, please pass async_req=True 671 672 >>> thread = api.merge_into_branch_with_http_info(repository, source_ref, destination_branch, merge, async_req=True) 673 >>> result = thread.get() 674 675 :param repository: (required) 676 :type repository: str 677 :param source_ref: source ref (required) 678 :type source_ref: str 679 :param destination_branch: destination branch name (required) 680 :type destination_branch: str 681 :param merge: 682 :type merge: Merge 683 :param async_req: Whether to execute the request asynchronously. 684 :type async_req: bool, optional 685 :param _preload_content: if False, the ApiResponse.data will 686 be set to none and raw_data will store the 687 HTTP response body without reading/decoding. 688 Default is True. 689 :type _preload_content: bool, optional 690 :param _return_http_data_only: response data instead of ApiResponse 691 object with status code, headers, etc 692 :type _return_http_data_only: bool, optional 693 :param _request_timeout: timeout setting for this request. If one 694 number provided, it will be total request 695 timeout. It can also be a pair (tuple) of 696 (connection, read) timeouts. 697 :param _request_auth: set to override the auth_settings for an a single 698 request; this effectively ignores the authentication 699 in the spec for a single request. 700 :type _request_auth: dict, optional 701 :type _content_type: string, optional: force content-type for the request 702 :return: Returns the result object. 703 If the method is called asynchronously, 704 returns the request thread. 705 :rtype: tuple(MergeResult, status_code(int), headers(HTTPHeaderDict)) 706 """ 707 708 _params = locals() 709 710 _all_params = [ 711 'repository', 712 'source_ref', 713 'destination_branch', 714 'merge' 715 ] 716 _all_params.extend( 717 [ 718 'async_req', 719 '_return_http_data_only', 720 '_preload_content', 721 '_request_timeout', 722 '_request_auth', 723 '_content_type', 724 '_headers' 725 ] 726 ) 727 728 # validate the arguments 729 for _key, _val in _params['kwargs'].items(): 730 if _key not in _all_params: 731 raise ApiTypeError( 732 "Got an unexpected keyword argument '%s'" 733 " to method merge_into_branch" % _key 734 ) 735 _params[_key] = _val 736 del _params['kwargs'] 737 738 _collection_formats = {} 739 740 # process the path parameters 741 _path_params = {} 742 if _params['repository']: 743 _path_params['repository'] = _params['repository'] 744 745 if _params['source_ref']: 746 _path_params['sourceRef'] = _params['source_ref'] 747 748 if _params['destination_branch']: 749 _path_params['destinationBranch'] = _params['destination_branch'] 750 751 752 # process the query parameters 753 _query_params = [] 754 # process the header parameters 755 _header_params = dict(_params.get('_headers', {})) 756 # process the form parameters 757 _form_params = [] 758 _files = {} 759 # process the body parameter 760 _body_params = None 761 if _params['merge'] is not None: 762 _body_params = _params['merge'] 763 764 # set the HTTP header `Accept` 765 _header_params['Accept'] = self.api_client.select_header_accept( 766 ['application/json']) # noqa: E501 767 768 # set the HTTP header `Content-Type` 769 _content_types_list = _params.get('_content_type', 770 self.api_client.select_header_content_type( 771 ['application/json'])) 772 if _content_types_list: 773 _header_params['Content-Type'] = _content_types_list 774 775 # authentication setting 776 _auth_settings = ['basic_auth', 'cookie_auth', 'oidc_auth', 'saml_auth', 'jwt_token'] # noqa: E501 777 778 _response_types_map = { 779 '200': "MergeResult", 780 '400': "Error", 781 '401': "Error", 782 '403': "Error", 783 '404': "Error", 784 '409': "MergeResult", 785 '412': "Error", 786 '420': None, 787 } 788 789 return self.api_client.call_api( 790 '/repositories/{repository}/refs/{sourceRef}/merge/{destinationBranch}', 'POST', 791 _path_params, 792 _query_params, 793 _header_params, 794 body=_body_params, 795 post_params=_form_params, 796 files=_files, 797 response_types_map=_response_types_map, 798 auth_settings=_auth_settings, 799 async_req=_params.get('async_req'), 800 _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 801 _preload_content=_params.get('_preload_content', True), 802 _request_timeout=_params.get('_request_timeout'), 803 collection_formats=_collection_formats, 804 _request_auth=_params.get('_request_auth'))