gitcode-api 1.3.2__py3-none-any.whl → 1.3.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gitcode_api/cli.py +2 -2
- gitcode_api/resources/account/orgs_resource_group.py +178 -18
- gitcode_api/resources/collaboration/issues_resource_group.py +3 -2
- gitcode_api/resources/collaboration/pulls_resource_group.py +25 -7
- gitcode_api/resources/misc/releases_resource_group.py +8 -5
- gitcode_api/resources/misc/webhooks_resource_group.py +144 -17
- gitcode_api/resources/repositories/repos_resource_group.py +422 -67
- gitcode_api/version.txt +1 -1
- {gitcode_api-1.3.2.dist-info → gitcode_api-1.3.3.dist-info}/METADATA +11 -11
- {gitcode_api-1.3.2.dist-info → gitcode_api-1.3.3.dist-info}/RECORD +14 -14
- {gitcode_api-1.3.2.dist-info → gitcode_api-1.3.3.dist-info}/WHEEL +0 -0
- {gitcode_api-1.3.2.dist-info → gitcode_api-1.3.3.dist-info}/entry_points.txt +0 -0
- {gitcode_api-1.3.2.dist-info → gitcode_api-1.3.3.dist-info}/licenses/LICENSE +0 -0
- {gitcode_api-1.3.2.dist-info → gitcode_api-1.3.3.dist-info}/top_level.txt +0 -0
|
@@ -302,22 +302,26 @@ class AbstractReposResource(ABC):
|
|
|
302
302
|
"""
|
|
303
303
|
|
|
304
304
|
@abstractmethod
|
|
305
|
-
def set_org_repo_status(self, *, org: str, repo: str, **
|
|
305
|
+
def set_org_repo_status(self, *, org: str, repo: str, status: int, password: str, **kwargs) -> ApiStatusResponse:
|
|
306
306
|
"""Update organization repository status metadata.
|
|
307
307
|
|
|
308
308
|
:param org: Organization path.
|
|
309
309
|
:param repo: Repository path.
|
|
310
|
-
:param
|
|
310
|
+
:param status: State, 0: open, 2: archived.
|
|
311
|
+
:param password: User password for verification.
|
|
312
|
+
:param kwargs: Additional arguments forwarded directly in request.
|
|
311
313
|
:returns: API response payload.
|
|
312
314
|
"""
|
|
313
315
|
|
|
314
316
|
@abstractmethod
|
|
315
|
-
def transfer_to_org(self, *, org: str, repo: str, **
|
|
317
|
+
def transfer_to_org(self, *, org: str, repo: str, transfer_to: str, password: str, **kwargs) -> ApiStatusResponse:
|
|
316
318
|
"""Transfer a repository to an organization.
|
|
317
319
|
|
|
318
|
-
:param org:
|
|
320
|
+
:param org: Source organization path.
|
|
319
321
|
:param repo: Repository path.
|
|
320
|
-
:param
|
|
322
|
+
:param transfer_to: Target namespace.
|
|
323
|
+
:param password: User password for verification.
|
|
324
|
+
:param kwargs: Additional arguments forwarded directly in request.
|
|
321
325
|
:returns: API response payload.
|
|
322
326
|
"""
|
|
323
327
|
|
|
@@ -332,26 +336,41 @@ class AbstractReposResource(ABC):
|
|
|
332
336
|
|
|
333
337
|
@abstractmethod
|
|
334
338
|
def update_transition(
|
|
335
|
-
self, *, owner: Optional[str] = None, repo: Optional[str] = None, **
|
|
339
|
+
self, *, owner: Optional[str] = None, repo: Optional[str] = None, mode: Optional[int] = None, **kwargs
|
|
336
340
|
) -> ApiStatusResponse:
|
|
337
341
|
"""Update repository transition settings.
|
|
338
342
|
|
|
339
343
|
:param owner: Repository owner path. Uses the client default when omitted.
|
|
340
344
|
:param repo: Repository name. Uses the client default when omitted.
|
|
341
|
-
:param
|
|
345
|
+
:param mode: Permission management mode: 1 (inheritance) or 2 (independent).
|
|
346
|
+
:param kwargs: Additional arguments forwarded directly in request.
|
|
342
347
|
:returns: API response payload.
|
|
343
348
|
"""
|
|
344
349
|
|
|
345
350
|
@abstractmethod
|
|
346
351
|
def update_push_config(
|
|
347
|
-
self,
|
|
352
|
+
self,
|
|
353
|
+
*,
|
|
354
|
+
owner: Optional[str] = None,
|
|
355
|
+
repo: Optional[str] = None,
|
|
356
|
+
reject_not_signed_by_gpg: Optional[bool] = None,
|
|
357
|
+
commit_message_regex: Optional[str] = None,
|
|
358
|
+
max_file_size: Optional[int] = None,
|
|
359
|
+
skip_rule_for_owner: Optional[bool] = None,
|
|
360
|
+
deny_force_push: Optional[bool] = None,
|
|
361
|
+
**kwargs,
|
|
348
362
|
) -> RepositoryPushConfig:
|
|
349
363
|
"""Update repository push configuration.
|
|
350
364
|
|
|
351
365
|
:param owner: Repository owner path. Uses the client default when omitted.
|
|
352
366
|
:param repo: Repository name. Uses the client default when omitted.
|
|
353
|
-
:param
|
|
354
|
-
:
|
|
367
|
+
:param reject_not_signed_by_gpg: Only allow commits with verified GPG signatures.
|
|
368
|
+
:param commit_message_regex: Commit message validation regex.
|
|
369
|
+
:param max_file_size: Commit file size limit in MB.
|
|
370
|
+
:param skip_rule_for_owner: Whether project administrators skip push rules.
|
|
371
|
+
:param deny_force_push: Prohibit force push (including for administrators).
|
|
372
|
+
:param kwargs: Additional arguments forwarded directly in request.
|
|
373
|
+
:returns: Updated push configuration.
|
|
355
374
|
"""
|
|
356
375
|
|
|
357
376
|
@abstractmethod
|
|
@@ -365,38 +384,78 @@ class AbstractReposResource(ABC):
|
|
|
365
384
|
|
|
366
385
|
@abstractmethod
|
|
367
386
|
def upload_image(
|
|
368
|
-
self,
|
|
387
|
+
self,
|
|
388
|
+
*,
|
|
389
|
+
owner: Optional[str] = None,
|
|
390
|
+
repo: Optional[str] = None,
|
|
391
|
+
body: Optional[str] = None,
|
|
392
|
+
file_name: Optional[str] = None,
|
|
393
|
+
**kwargs,
|
|
369
394
|
) -> RepositoryUploadResult:
|
|
370
395
|
"""Upload an image asset for a repository.
|
|
371
396
|
|
|
372
397
|
:param owner: Repository owner path. Uses the client default when omitted.
|
|
373
398
|
:param repo: Repository name. Uses the client default when omitted.
|
|
374
|
-
:param
|
|
399
|
+
:param body: File content in base64 format (limit: 20 MB).
|
|
400
|
+
:param file_name: File name.
|
|
401
|
+
:param kwargs: Additional arguments forwarded directly in request.
|
|
375
402
|
:returns: Uploaded image metadata.
|
|
376
403
|
"""
|
|
377
404
|
|
|
378
405
|
@abstractmethod
|
|
379
406
|
def upload_file(
|
|
380
|
-
self,
|
|
407
|
+
self,
|
|
408
|
+
*,
|
|
409
|
+
owner: Optional[str] = None,
|
|
410
|
+
repo: Optional[str] = None,
|
|
411
|
+
file: Optional[str] = None,
|
|
412
|
+
**kwargs,
|
|
381
413
|
) -> RepositoryUploadResult:
|
|
382
414
|
"""Upload a file asset for a repository.
|
|
383
415
|
|
|
384
416
|
:param owner: Repository owner path. Uses the client default when omitted.
|
|
385
417
|
:param repo: Repository name. Uses the client default when omitted.
|
|
386
|
-
:param
|
|
418
|
+
:param file: File content in base64 format (limit: 20 MB).
|
|
419
|
+
:param kwargs: Additional arguments forwarded directly in request.
|
|
387
420
|
:returns: Uploaded file metadata.
|
|
388
421
|
"""
|
|
389
422
|
|
|
390
423
|
@abstractmethod
|
|
391
424
|
def update_repo_settings(
|
|
392
|
-
self,
|
|
425
|
+
self,
|
|
426
|
+
*,
|
|
427
|
+
owner: Optional[str] = None,
|
|
428
|
+
repo: Optional[str] = None,
|
|
429
|
+
disable_fork: Optional[bool] = None,
|
|
430
|
+
forbidden_developer_create_branch: Optional[bool] = None,
|
|
431
|
+
forbidden_developer_create_tag: Optional[bool] = None,
|
|
432
|
+
forbidden_committer_create_branch: Optional[bool] = None,
|
|
433
|
+
forbidden_developer_create_branch_user_ids: Optional[str] = None,
|
|
434
|
+
branch_name_regex: Optional[str] = None,
|
|
435
|
+
tag_name_regex: Optional[str] = None,
|
|
436
|
+
generate_pre_merge_ref: Optional[bool] = None,
|
|
437
|
+
rebase_disable_trigger_webhook: Optional[bool] = None,
|
|
438
|
+
open_gpg_verified: Optional[bool] = None,
|
|
439
|
+
include_lfs_objects: Optional[bool] = None,
|
|
440
|
+
**kwargs,
|
|
393
441
|
) -> RepositorySettings:
|
|
394
442
|
"""Update repository settings.
|
|
395
443
|
|
|
396
444
|
:param owner: Repository owner path. Uses the client default when omitted.
|
|
397
445
|
:param repo: Repository name. Uses the client default when omitted.
|
|
398
|
-
:param
|
|
399
|
-
:
|
|
446
|
+
:param disable_fork: Disable forking.
|
|
447
|
+
:param forbidden_developer_create_branch: Forbid developers from creating branches.
|
|
448
|
+
:param forbidden_developer_create_tag: Forbid developers from creating tags.
|
|
449
|
+
:param forbidden_committer_create_branch: Forbid committers from creating branches.
|
|
450
|
+
:param forbidden_developer_create_branch_user_ids: User IDs forbidden from creating branches.
|
|
451
|
+
:param branch_name_regex: Branch name validation regex.
|
|
452
|
+
:param tag_name_regex: Tag name validation regex.
|
|
453
|
+
:param generate_pre_merge_ref: Generate pre-merge ref.
|
|
454
|
+
:param rebase_disable_trigger_webhook: Disable webhook trigger on rebase.
|
|
455
|
+
:param open_gpg_verified: Enable GPG verification.
|
|
456
|
+
:param include_lfs_objects: Include LFS objects in ZIP download.
|
|
457
|
+
:param kwargs: Additional arguments forwarded directly in request.
|
|
458
|
+
:returns: Updated repository settings.
|
|
400
459
|
"""
|
|
401
460
|
|
|
402
461
|
@abstractmethod
|
|
@@ -421,14 +480,64 @@ class AbstractReposResource(ABC):
|
|
|
421
480
|
|
|
422
481
|
@abstractmethod
|
|
423
482
|
def update_pull_request_settings(
|
|
424
|
-
self,
|
|
483
|
+
self,
|
|
484
|
+
*,
|
|
485
|
+
owner: Optional[str] = None,
|
|
486
|
+
repo: Optional[str] = None,
|
|
487
|
+
approval_required_reviewers_enable: Optional[bool] = None,
|
|
488
|
+
approval_required_reviewers: Optional[int] = None,
|
|
489
|
+
only_allow_merge_if_all_discussions_are_resolved: Optional[bool] = None,
|
|
490
|
+
only_allow_merge_if_pipeline_succeeds: Optional[bool] = None,
|
|
491
|
+
disable_merge_by_self: Optional[bool] = None,
|
|
492
|
+
can_force_merge: Optional[bool] = None,
|
|
493
|
+
add_notes_after_merged: Optional[bool] = None,
|
|
494
|
+
mark_auto_merged_mr_as_closed: Optional[bool] = None,
|
|
495
|
+
can_reopen: Optional[bool] = None,
|
|
496
|
+
delete_source_branch_when_merged: Optional[bool] = None,
|
|
497
|
+
disable_squash_merge: Optional[bool] = None,
|
|
498
|
+
auto_squash_merge: Optional[bool] = None,
|
|
499
|
+
merge_method: Optional[str] = None,
|
|
500
|
+
squash_merge_with_no_merge_commit: Optional[bool] = None,
|
|
501
|
+
merged_commit_author: Optional[str] = None,
|
|
502
|
+
approval_required_approvers: Optional[int] = None,
|
|
503
|
+
approval_approver_ids: Optional[str] = None,
|
|
504
|
+
approval_tester_ids: Optional[str] = None,
|
|
505
|
+
approval_required_testers: Optional[int] = None,
|
|
506
|
+
is_check_cla: Optional[bool] = None,
|
|
507
|
+
is_allow_lite_merge_request: Optional[bool] = None,
|
|
508
|
+
lite_merge_request_prefix_title: Optional[str] = None,
|
|
509
|
+
close_issue_when_mr_merged: Optional[bool] = None,
|
|
510
|
+
**kwargs,
|
|
425
511
|
) -> PullRequestSettings:
|
|
426
512
|
"""Update pull request settings for a repository.
|
|
427
513
|
|
|
428
514
|
:param owner: Repository owner path. Uses the client default when omitted.
|
|
429
515
|
:param repo: Repository name. Uses the client default when omitted.
|
|
430
|
-
:param
|
|
431
|
-
:
|
|
516
|
+
:param approval_required_reviewers_enable: Enable required reviewers approval.
|
|
517
|
+
:param approval_required_reviewers: Minimum number of required reviewers (1-5, or 0 to disable).
|
|
518
|
+
:param only_allow_merge_if_all_discussions_are_resolved: Require all discussions resolved before merge.
|
|
519
|
+
:param only_allow_merge_if_pipeline_succeeds: Only allow merge when pipeline succeeds.
|
|
520
|
+
:param disable_merge_by_self: Forbid merging self-created pull requests.
|
|
521
|
+
:param can_force_merge: Allow administrators to force merge.
|
|
522
|
+
:param add_notes_after_merged: Allow code review comments after merge.
|
|
523
|
+
:param mark_auto_merged_mr_as_closed: Mark auto-merged MRs as closed.
|
|
524
|
+
:param can_reopen: Allow reopening closed pull requests.
|
|
525
|
+
:param delete_source_branch_when_merged: Delete source branch when merged.
|
|
526
|
+
:param disable_squash_merge: Disable squash merge.
|
|
527
|
+
:param auto_squash_merge: Default enable squash merge for new pull requests.
|
|
528
|
+
:param merge_method: Merge method (``merge``, ``rebase_merge``, or ``ff``).
|
|
529
|
+
:param squash_merge_with_no_merge_commit: Squash merge without producing a merge commit.
|
|
530
|
+
:param merged_commit_author: Merge commit author (``merged_by`` or ``created_by``).
|
|
531
|
+
:param approval_required_approvers: Number of required approvers.
|
|
532
|
+
:param approval_approver_ids: Project reviewer user IDs, comma-separated.
|
|
533
|
+
:param approval_tester_ids: Project tester user IDs, comma-separated.
|
|
534
|
+
:param approval_required_testers: Minimum number of testers that must pass.
|
|
535
|
+
:param is_check_cla: Whether to verify CLA.
|
|
536
|
+
:param is_allow_lite_merge_request: Enable lightweight pull requests.
|
|
537
|
+
:param lite_merge_request_prefix_title: Title prefix for lightweight pull requests.
|
|
538
|
+
:param close_issue_when_mr_merged: Default check "close linked issues on merge".
|
|
539
|
+
:param kwargs: Additional arguments forwarded directly in request.
|
|
540
|
+
:returns: Updated pull request settings.
|
|
432
541
|
"""
|
|
433
542
|
|
|
434
543
|
@abstractmethod
|
|
@@ -450,15 +559,14 @@ class AbstractReposResource(ABC):
|
|
|
450
559
|
"""
|
|
451
560
|
|
|
452
561
|
@abstractmethod
|
|
453
|
-
def transfer(
|
|
454
|
-
self, *, owner: Optional[str] = None, repo: Optional[str] = None, **payload
|
|
455
|
-
) -> RepositoryTransferResult:
|
|
562
|
+
def transfer(self, *, owner: str, repo: str, new_owner: str, **kwargs) -> RepositoryTransferResult:
|
|
456
563
|
"""Transfer a repository to another owner or namespace.
|
|
457
564
|
|
|
458
|
-
:param owner: Repository owner path.
|
|
459
|
-
:param repo: Repository name.
|
|
460
|
-
:param
|
|
461
|
-
:
|
|
565
|
+
:param owner: Repository owner path.
|
|
566
|
+
:param repo: Repository name.
|
|
567
|
+
:param new_owner: Target namespace to transfer the repository to.
|
|
568
|
+
:param kwargs: Additional arguments forwarded directly in request.
|
|
569
|
+
:returns: Transfer result.
|
|
462
570
|
"""
|
|
463
571
|
|
|
464
572
|
@abstractmethod
|
|
@@ -758,14 +866,20 @@ class ReposResource(SyncResource, AbstractReposResource):
|
|
|
758
866
|
json=settings,
|
|
759
867
|
)
|
|
760
868
|
|
|
761
|
-
def set_org_repo_status(self, *, org: str, repo: str, **
|
|
869
|
+
def set_org_repo_status(self, *, org: str, repo: str, status: int, password: str, **kwargs) -> ApiStatusResponse:
|
|
762
870
|
return self._model(
|
|
763
|
-
"PUT",
|
|
871
|
+
"PUT",
|
|
872
|
+
self._client._path("org", org, "repo", repo, "status"),
|
|
873
|
+
ApiStatusResponse,
|
|
874
|
+
json={"status": status, "password": password, **kwargs},
|
|
764
875
|
)
|
|
765
876
|
|
|
766
|
-
def transfer_to_org(self, *, org: str, repo: str, **
|
|
877
|
+
def transfer_to_org(self, *, org: str, repo: str, transfer_to: str, password: str, **kwargs) -> ApiStatusResponse:
|
|
767
878
|
return self._model(
|
|
768
|
-
"POST",
|
|
879
|
+
"POST",
|
|
880
|
+
self._client._path("org", org, "projects", repo, "transfer"),
|
|
881
|
+
ApiStatusResponse,
|
|
882
|
+
json={"transfer_to": transfer_to, "password": password, **kwargs},
|
|
769
883
|
)
|
|
770
884
|
|
|
771
885
|
def get_transition(self, *, owner: Optional[str] = None, repo: Optional[str] = None) -> RepositoryPermissionMode:
|
|
@@ -774,47 +888,111 @@ class ReposResource(SyncResource, AbstractReposResource):
|
|
|
774
888
|
)
|
|
775
889
|
|
|
776
890
|
def update_transition(
|
|
777
|
-
self, *, owner: Optional[str] = None, repo: Optional[str] = None, **
|
|
891
|
+
self, *, owner: Optional[str] = None, repo: Optional[str] = None, mode: Optional[int] = None, **kwargs
|
|
778
892
|
) -> ApiStatusResponse:
|
|
779
893
|
return self._model(
|
|
780
|
-
"PUT",
|
|
894
|
+
"PUT",
|
|
895
|
+
self._client._repo_path("transition", owner=owner, repo=repo),
|
|
896
|
+
ApiStatusResponse,
|
|
897
|
+
json={"mode": mode, **kwargs},
|
|
781
898
|
)
|
|
782
899
|
|
|
783
900
|
def update_push_config(
|
|
784
|
-
self,
|
|
901
|
+
self,
|
|
902
|
+
*,
|
|
903
|
+
owner: Optional[str] = None,
|
|
904
|
+
repo: Optional[str] = None,
|
|
905
|
+
reject_not_signed_by_gpg: Optional[bool] = None,
|
|
906
|
+
commit_message_regex: Optional[str] = None,
|
|
907
|
+
max_file_size: Optional[int] = None,
|
|
908
|
+
skip_rule_for_owner: Optional[bool] = None,
|
|
909
|
+
deny_force_push: Optional[bool] = None,
|
|
910
|
+
**kwargs,
|
|
785
911
|
) -> RepositoryPushConfig:
|
|
786
912
|
return self._model(
|
|
787
|
-
"PUT",
|
|
913
|
+
"PUT",
|
|
914
|
+
self._client._repo_path("push_config", owner=owner, repo=repo),
|
|
915
|
+
RepositoryPushConfig,
|
|
916
|
+
json={
|
|
917
|
+
"reject_not_signed_by_gpg": reject_not_signed_by_gpg,
|
|
918
|
+
"commit_message_regex": commit_message_regex,
|
|
919
|
+
"max_file_size": max_file_size,
|
|
920
|
+
"skip_rule_for_owner": skip_rule_for_owner,
|
|
921
|
+
"deny_force_push": deny_force_push,
|
|
922
|
+
**kwargs,
|
|
923
|
+
},
|
|
788
924
|
)
|
|
789
925
|
|
|
790
926
|
def get_push_config(self, *, owner: Optional[str] = None, repo: Optional[str] = None) -> RepositoryPushConfig:
|
|
791
927
|
return self._model("GET", self._client._repo_path("push_config", owner=owner, repo=repo), RepositoryPushConfig)
|
|
792
928
|
|
|
793
929
|
def upload_image(
|
|
794
|
-
self,
|
|
930
|
+
self,
|
|
931
|
+
*,
|
|
932
|
+
owner: Optional[str] = None,
|
|
933
|
+
repo: Optional[str] = None,
|
|
934
|
+
body: Optional[str] = None,
|
|
935
|
+
file_name: Optional[str] = None,
|
|
936
|
+
**kwargs,
|
|
795
937
|
) -> RepositoryUploadResult:
|
|
796
938
|
return self._model(
|
|
797
939
|
"POST",
|
|
798
940
|
self._client._repo_path("img", "upload", owner=owner, repo=repo),
|
|
799
941
|
RepositoryUploadResult,
|
|
800
|
-
json=
|
|
942
|
+
json={"body": body, "file_name": file_name, **kwargs},
|
|
801
943
|
)
|
|
802
944
|
|
|
803
945
|
def upload_file(
|
|
804
|
-
self,
|
|
946
|
+
self,
|
|
947
|
+
*,
|
|
948
|
+
owner: Optional[str] = None,
|
|
949
|
+
repo: Optional[str] = None,
|
|
950
|
+
file: Optional[str] = None,
|
|
951
|
+
**kwargs,
|
|
805
952
|
) -> RepositoryUploadResult:
|
|
806
953
|
return self._model(
|
|
807
954
|
"POST",
|
|
808
955
|
self._client._repo_path("file", "upload", owner=owner, repo=repo),
|
|
809
956
|
RepositoryUploadResult,
|
|
810
|
-
json=
|
|
957
|
+
json={"file": file, **kwargs},
|
|
811
958
|
)
|
|
812
959
|
|
|
813
960
|
def update_repo_settings(
|
|
814
|
-
self,
|
|
961
|
+
self,
|
|
962
|
+
*,
|
|
963
|
+
owner: Optional[str] = None,
|
|
964
|
+
repo: Optional[str] = None,
|
|
965
|
+
disable_fork: Optional[bool] = None,
|
|
966
|
+
forbidden_developer_create_branch: Optional[bool] = None,
|
|
967
|
+
forbidden_developer_create_tag: Optional[bool] = None,
|
|
968
|
+
forbidden_committer_create_branch: Optional[bool] = None,
|
|
969
|
+
forbidden_developer_create_branch_user_ids: Optional[str] = None,
|
|
970
|
+
branch_name_regex: Optional[str] = None,
|
|
971
|
+
tag_name_regex: Optional[str] = None,
|
|
972
|
+
generate_pre_merge_ref: Optional[bool] = None,
|
|
973
|
+
rebase_disable_trigger_webhook: Optional[bool] = None,
|
|
974
|
+
open_gpg_verified: Optional[bool] = None,
|
|
975
|
+
include_lfs_objects: Optional[bool] = None,
|
|
976
|
+
**kwargs,
|
|
815
977
|
) -> RepositorySettings:
|
|
816
978
|
return self._model(
|
|
817
|
-
"PUT",
|
|
979
|
+
"PUT",
|
|
980
|
+
self._client._repo_path("repo_settings", owner=owner, repo=repo),
|
|
981
|
+
RepositorySettings,
|
|
982
|
+
json={
|
|
983
|
+
"disable_fork": disable_fork,
|
|
984
|
+
"forbidden_developer_create_branch": forbidden_developer_create_branch,
|
|
985
|
+
"forbidden_developer_create_tag": forbidden_developer_create_tag,
|
|
986
|
+
"forbidden_committer_create_branch": forbidden_committer_create_branch,
|
|
987
|
+
"forbidden_developer_create_branch_user_ids": forbidden_developer_create_branch_user_ids,
|
|
988
|
+
"branch_name_regex": branch_name_regex,
|
|
989
|
+
"tag_name_regex": tag_name_regex,
|
|
990
|
+
"generate_pre_merge_ref": generate_pre_merge_ref,
|
|
991
|
+
"rebase_disable_trigger_webhook": rebase_disable_trigger_webhook,
|
|
992
|
+
"open_gpg_verified": open_gpg_verified,
|
|
993
|
+
"include_lfs_objects": include_lfs_objects,
|
|
994
|
+
**kwargs,
|
|
995
|
+
},
|
|
818
996
|
)
|
|
819
997
|
|
|
820
998
|
def get_repo_settings(self, *, owner: Optional[str] = None, repo: Optional[str] = None) -> RepositorySettings:
|
|
@@ -828,13 +1006,65 @@ class ReposResource(SyncResource, AbstractReposResource):
|
|
|
828
1006
|
)
|
|
829
1007
|
|
|
830
1008
|
def update_pull_request_settings(
|
|
831
|
-
self,
|
|
1009
|
+
self,
|
|
1010
|
+
*,
|
|
1011
|
+
owner: Optional[str] = None,
|
|
1012
|
+
repo: Optional[str] = None,
|
|
1013
|
+
approval_required_reviewers_enable: Optional[bool] = None,
|
|
1014
|
+
approval_required_reviewers: Optional[int] = None,
|
|
1015
|
+
only_allow_merge_if_all_discussions_are_resolved: Optional[bool] = None,
|
|
1016
|
+
only_allow_merge_if_pipeline_succeeds: Optional[bool] = None,
|
|
1017
|
+
disable_merge_by_self: Optional[bool] = None,
|
|
1018
|
+
can_force_merge: Optional[bool] = None,
|
|
1019
|
+
add_notes_after_merged: Optional[bool] = None,
|
|
1020
|
+
mark_auto_merged_mr_as_closed: Optional[bool] = None,
|
|
1021
|
+
can_reopen: Optional[bool] = None,
|
|
1022
|
+
delete_source_branch_when_merged: Optional[bool] = None,
|
|
1023
|
+
disable_squash_merge: Optional[bool] = None,
|
|
1024
|
+
auto_squash_merge: Optional[bool] = None,
|
|
1025
|
+
merge_method: Optional[str] = None,
|
|
1026
|
+
squash_merge_with_no_merge_commit: Optional[bool] = None,
|
|
1027
|
+
merged_commit_author: Optional[str] = None,
|
|
1028
|
+
approval_required_approvers: Optional[int] = None,
|
|
1029
|
+
approval_approver_ids: Optional[str] = None,
|
|
1030
|
+
approval_tester_ids: Optional[str] = None,
|
|
1031
|
+
approval_required_testers: Optional[int] = None,
|
|
1032
|
+
is_check_cla: Optional[bool] = None,
|
|
1033
|
+
is_allow_lite_merge_request: Optional[bool] = None,
|
|
1034
|
+
lite_merge_request_prefix_title: Optional[str] = None,
|
|
1035
|
+
close_issue_when_mr_merged: Optional[bool] = None,
|
|
1036
|
+
**kwargs,
|
|
832
1037
|
) -> PullRequestSettings:
|
|
833
1038
|
return self._model(
|
|
834
1039
|
"PUT",
|
|
835
1040
|
self._client._repo_path("pull_request_settings", owner=owner, repo=repo),
|
|
836
1041
|
PullRequestSettings,
|
|
837
|
-
json=
|
|
1042
|
+
json={
|
|
1043
|
+
"approval_required_reviewers_enable": approval_required_reviewers_enable,
|
|
1044
|
+
"approval_required_reviewers": approval_required_reviewers,
|
|
1045
|
+
"only_allow_merge_if_all_discussions_are_resolved": only_allow_merge_if_all_discussions_are_resolved,
|
|
1046
|
+
"only_allow_merge_if_pipeline_succeeds": only_allow_merge_if_pipeline_succeeds,
|
|
1047
|
+
"disable_merge_by_self": disable_merge_by_self,
|
|
1048
|
+
"can_force_merge": can_force_merge,
|
|
1049
|
+
"add_notes_after_merged": add_notes_after_merged,
|
|
1050
|
+
"mark_auto_merged_mr_as_closed": mark_auto_merged_mr_as_closed,
|
|
1051
|
+
"can_reopen": can_reopen,
|
|
1052
|
+
"delete_source_branch_when_merged": delete_source_branch_when_merged,
|
|
1053
|
+
"disable_squash_merge": disable_squash_merge,
|
|
1054
|
+
"auto_squash_merge": auto_squash_merge,
|
|
1055
|
+
"merge_method": merge_method,
|
|
1056
|
+
"squash_merge_with_no_merge_commit": squash_merge_with_no_merge_commit,
|
|
1057
|
+
"merged_commit_author": merged_commit_author,
|
|
1058
|
+
"approval_required_approvers": approval_required_approvers,
|
|
1059
|
+
"approval_approver_ids": approval_approver_ids,
|
|
1060
|
+
"approval_tester_ids": approval_tester_ids,
|
|
1061
|
+
"approval_required_testers": approval_required_testers,
|
|
1062
|
+
"is_check_cla": is_check_cla,
|
|
1063
|
+
"is_allow_lite_merge_request": is_allow_lite_merge_request,
|
|
1064
|
+
"lite_merge_request_prefix_title": lite_merge_request_prefix_title,
|
|
1065
|
+
"close_issue_when_mr_merged": close_issue_when_mr_merged,
|
|
1066
|
+
**kwargs,
|
|
1067
|
+
},
|
|
838
1068
|
)
|
|
839
1069
|
|
|
840
1070
|
def set_member_role(
|
|
@@ -852,11 +1082,12 @@ class ReposResource(SyncResource, AbstractReposResource):
|
|
|
852
1082
|
json={"permission": permission},
|
|
853
1083
|
)
|
|
854
1084
|
|
|
855
|
-
def transfer(
|
|
856
|
-
self, *, owner: Optional[str] = None, repo: Optional[str] = None, **payload
|
|
857
|
-
) -> RepositoryTransferResult:
|
|
1085
|
+
def transfer(self, *, owner: str, repo: str, new_owner: str, **kwargs) -> RepositoryTransferResult:
|
|
858
1086
|
return self._model(
|
|
859
|
-
"POST",
|
|
1087
|
+
"POST",
|
|
1088
|
+
self._client._repo_path("transfer", owner=owner, repo=repo),
|
|
1089
|
+
RepositoryTransferResult,
|
|
1090
|
+
json={"new_owner": new_owner, **kwargs},
|
|
860
1091
|
)
|
|
861
1092
|
|
|
862
1093
|
def list_customized_roles(
|
|
@@ -1145,14 +1376,24 @@ class AsyncReposResource(AsyncResource, AbstractReposResource):
|
|
|
1145
1376
|
json=settings,
|
|
1146
1377
|
)
|
|
1147
1378
|
|
|
1148
|
-
async def set_org_repo_status(
|
|
1379
|
+
async def set_org_repo_status(
|
|
1380
|
+
self, *, org: str, repo: str, status: int, password: str, **kwargs
|
|
1381
|
+
) -> ApiStatusResponse:
|
|
1149
1382
|
return await self._model(
|
|
1150
|
-
"PUT",
|
|
1383
|
+
"PUT",
|
|
1384
|
+
self._client._path("org", org, "repo", repo, "status"),
|
|
1385
|
+
ApiStatusResponse,
|
|
1386
|
+
json={"status": status, "password": password, **kwargs},
|
|
1151
1387
|
)
|
|
1152
1388
|
|
|
1153
|
-
async def transfer_to_org(
|
|
1389
|
+
async def transfer_to_org(
|
|
1390
|
+
self, *, org: str, repo: str, transfer_to: str, password: str, **kwargs
|
|
1391
|
+
) -> ApiStatusResponse:
|
|
1154
1392
|
return await self._model(
|
|
1155
|
-
"POST",
|
|
1393
|
+
"POST",
|
|
1394
|
+
self._client._path("org", org, "projects", repo, "transfer"),
|
|
1395
|
+
ApiStatusResponse,
|
|
1396
|
+
json={"transfer_to": transfer_to, "password": password, **kwargs},
|
|
1156
1397
|
)
|
|
1157
1398
|
|
|
1158
1399
|
async def get_transition(
|
|
@@ -1163,20 +1404,39 @@ class AsyncReposResource(AsyncResource, AbstractReposResource):
|
|
|
1163
1404
|
)
|
|
1164
1405
|
|
|
1165
1406
|
async def update_transition(
|
|
1166
|
-
self, *, owner: Optional[str] = None, repo: Optional[str] = None, **
|
|
1407
|
+
self, *, owner: Optional[str] = None, repo: Optional[str] = None, mode: Optional[int] = None, **kwargs
|
|
1167
1408
|
) -> ApiStatusResponse:
|
|
1168
1409
|
return await self._model(
|
|
1169
|
-
"PUT",
|
|
1410
|
+
"PUT",
|
|
1411
|
+
self._client._repo_path("transition", owner=owner, repo=repo),
|
|
1412
|
+
ApiStatusResponse,
|
|
1413
|
+
json={"mode": mode, **kwargs},
|
|
1170
1414
|
)
|
|
1171
1415
|
|
|
1172
1416
|
async def update_push_config(
|
|
1173
|
-
self,
|
|
1417
|
+
self,
|
|
1418
|
+
*,
|
|
1419
|
+
owner: Optional[str] = None,
|
|
1420
|
+
repo: Optional[str] = None,
|
|
1421
|
+
reject_not_signed_by_gpg: Optional[bool] = None,
|
|
1422
|
+
commit_message_regex: Optional[str] = None,
|
|
1423
|
+
max_file_size: Optional[int] = None,
|
|
1424
|
+
skip_rule_for_owner: Optional[bool] = None,
|
|
1425
|
+
deny_force_push: Optional[bool] = None,
|
|
1426
|
+
**kwargs,
|
|
1174
1427
|
) -> RepositoryPushConfig:
|
|
1175
1428
|
return await self._model(
|
|
1176
1429
|
"PUT",
|
|
1177
1430
|
self._client._repo_path("push_config", owner=owner, repo=repo),
|
|
1178
1431
|
RepositoryPushConfig,
|
|
1179
|
-
json=
|
|
1432
|
+
json={
|
|
1433
|
+
"reject_not_signed_by_gpg": reject_not_signed_by_gpg,
|
|
1434
|
+
"commit_message_regex": commit_message_regex,
|
|
1435
|
+
"max_file_size": max_file_size,
|
|
1436
|
+
"skip_rule_for_owner": skip_rule_for_owner,
|
|
1437
|
+
"deny_force_push": deny_force_push,
|
|
1438
|
+
**kwargs,
|
|
1439
|
+
},
|
|
1180
1440
|
)
|
|
1181
1441
|
|
|
1182
1442
|
async def get_push_config(self, *, owner: Optional[str] = None, repo: Optional[str] = None) -> RepositoryPushConfig:
|
|
@@ -1185,30 +1445,72 @@ class AsyncReposResource(AsyncResource, AbstractReposResource):
|
|
|
1185
1445
|
)
|
|
1186
1446
|
|
|
1187
1447
|
async def upload_image(
|
|
1188
|
-
self,
|
|
1448
|
+
self,
|
|
1449
|
+
*,
|
|
1450
|
+
owner: Optional[str] = None,
|
|
1451
|
+
repo: Optional[str] = None,
|
|
1452
|
+
body: Optional[str] = None,
|
|
1453
|
+
file_name: Optional[str] = None,
|
|
1454
|
+
**kwargs,
|
|
1189
1455
|
) -> RepositoryUploadResult:
|
|
1190
1456
|
return await self._model(
|
|
1191
1457
|
"POST",
|
|
1192
1458
|
self._client._repo_path("img", "upload", owner=owner, repo=repo),
|
|
1193
1459
|
RepositoryUploadResult,
|
|
1194
|
-
json=
|
|
1460
|
+
json={"body": body, "file_name": file_name, **kwargs},
|
|
1195
1461
|
)
|
|
1196
1462
|
|
|
1197
1463
|
async def upload_file(
|
|
1198
|
-
self,
|
|
1464
|
+
self,
|
|
1465
|
+
*,
|
|
1466
|
+
owner: Optional[str] = None,
|
|
1467
|
+
repo: Optional[str] = None,
|
|
1468
|
+
file: Optional[str] = None,
|
|
1469
|
+
**kwargs,
|
|
1199
1470
|
) -> RepositoryUploadResult:
|
|
1200
1471
|
return await self._model(
|
|
1201
1472
|
"POST",
|
|
1202
1473
|
self._client._repo_path("file", "upload", owner=owner, repo=repo),
|
|
1203
1474
|
RepositoryUploadResult,
|
|
1204
|
-
json=
|
|
1475
|
+
json={"file": file, **kwargs},
|
|
1205
1476
|
)
|
|
1206
1477
|
|
|
1207
1478
|
async def update_repo_settings(
|
|
1208
|
-
self,
|
|
1479
|
+
self,
|
|
1480
|
+
*,
|
|
1481
|
+
owner: Optional[str] = None,
|
|
1482
|
+
repo: Optional[str] = None,
|
|
1483
|
+
disable_fork: Optional[bool] = None,
|
|
1484
|
+
forbidden_developer_create_branch: Optional[bool] = None,
|
|
1485
|
+
forbidden_developer_create_tag: Optional[bool] = None,
|
|
1486
|
+
forbidden_committer_create_branch: Optional[bool] = None,
|
|
1487
|
+
forbidden_developer_create_branch_user_ids: Optional[str] = None,
|
|
1488
|
+
branch_name_regex: Optional[str] = None,
|
|
1489
|
+
tag_name_regex: Optional[str] = None,
|
|
1490
|
+
generate_pre_merge_ref: Optional[bool] = None,
|
|
1491
|
+
rebase_disable_trigger_webhook: Optional[bool] = None,
|
|
1492
|
+
open_gpg_verified: Optional[bool] = None,
|
|
1493
|
+
include_lfs_objects: Optional[bool] = None,
|
|
1494
|
+
**kwargs,
|
|
1209
1495
|
) -> RepositorySettings:
|
|
1210
1496
|
return await self._model(
|
|
1211
|
-
"PUT",
|
|
1497
|
+
"PUT",
|
|
1498
|
+
self._client._repo_path("repo_settings", owner=owner, repo=repo),
|
|
1499
|
+
RepositorySettings,
|
|
1500
|
+
json={
|
|
1501
|
+
"disable_fork": disable_fork,
|
|
1502
|
+
"forbidden_developer_create_branch": forbidden_developer_create_branch,
|
|
1503
|
+
"forbidden_developer_create_tag": forbidden_developer_create_tag,
|
|
1504
|
+
"forbidden_committer_create_branch": forbidden_committer_create_branch,
|
|
1505
|
+
"forbidden_developer_create_branch_user_ids": forbidden_developer_create_branch_user_ids,
|
|
1506
|
+
"branch_name_regex": branch_name_regex,
|
|
1507
|
+
"tag_name_regex": tag_name_regex,
|
|
1508
|
+
"generate_pre_merge_ref": generate_pre_merge_ref,
|
|
1509
|
+
"rebase_disable_trigger_webhook": rebase_disable_trigger_webhook,
|
|
1510
|
+
"open_gpg_verified": open_gpg_verified,
|
|
1511
|
+
"include_lfs_objects": include_lfs_objects,
|
|
1512
|
+
**kwargs,
|
|
1513
|
+
},
|
|
1212
1514
|
)
|
|
1213
1515
|
|
|
1214
1516
|
async def get_repo_settings(self, *, owner: Optional[str] = None, repo: Optional[str] = None) -> RepositorySettings:
|
|
@@ -1224,13 +1526,65 @@ class AsyncReposResource(AsyncResource, AbstractReposResource):
|
|
|
1224
1526
|
)
|
|
1225
1527
|
|
|
1226
1528
|
async def update_pull_request_settings(
|
|
1227
|
-
self,
|
|
1529
|
+
self,
|
|
1530
|
+
*,
|
|
1531
|
+
owner: Optional[str] = None,
|
|
1532
|
+
repo: Optional[str] = None,
|
|
1533
|
+
approval_required_reviewers_enable: Optional[bool] = None,
|
|
1534
|
+
approval_required_reviewers: Optional[int] = None,
|
|
1535
|
+
only_allow_merge_if_all_discussions_are_resolved: Optional[bool] = None,
|
|
1536
|
+
only_allow_merge_if_pipeline_succeeds: Optional[bool] = None,
|
|
1537
|
+
disable_merge_by_self: Optional[bool] = None,
|
|
1538
|
+
can_force_merge: Optional[bool] = None,
|
|
1539
|
+
add_notes_after_merged: Optional[bool] = None,
|
|
1540
|
+
mark_auto_merged_mr_as_closed: Optional[bool] = None,
|
|
1541
|
+
can_reopen: Optional[bool] = None,
|
|
1542
|
+
delete_source_branch_when_merged: Optional[bool] = None,
|
|
1543
|
+
disable_squash_merge: Optional[bool] = None,
|
|
1544
|
+
auto_squash_merge: Optional[bool] = None,
|
|
1545
|
+
merge_method: Optional[str] = None,
|
|
1546
|
+
squash_merge_with_no_merge_commit: Optional[bool] = None,
|
|
1547
|
+
merged_commit_author: Optional[str] = None,
|
|
1548
|
+
approval_required_approvers: Optional[int] = None,
|
|
1549
|
+
approval_approver_ids: Optional[str] = None,
|
|
1550
|
+
approval_tester_ids: Optional[str] = None,
|
|
1551
|
+
approval_required_testers: Optional[int] = None,
|
|
1552
|
+
is_check_cla: Optional[bool] = None,
|
|
1553
|
+
is_allow_lite_merge_request: Optional[bool] = None,
|
|
1554
|
+
lite_merge_request_prefix_title: Optional[str] = None,
|
|
1555
|
+
close_issue_when_mr_merged: Optional[bool] = None,
|
|
1556
|
+
**kwargs,
|
|
1228
1557
|
) -> PullRequestSettings:
|
|
1229
1558
|
return await self._model(
|
|
1230
1559
|
"PUT",
|
|
1231
1560
|
self._client._repo_path("pull_request_settings", owner=owner, repo=repo),
|
|
1232
1561
|
PullRequestSettings,
|
|
1233
|
-
json=
|
|
1562
|
+
json={
|
|
1563
|
+
"approval_required_reviewers_enable": approval_required_reviewers_enable,
|
|
1564
|
+
"approval_required_reviewers": approval_required_reviewers,
|
|
1565
|
+
"only_allow_merge_if_all_discussions_are_resolved": only_allow_merge_if_all_discussions_are_resolved,
|
|
1566
|
+
"only_allow_merge_if_pipeline_succeeds": only_allow_merge_if_pipeline_succeeds,
|
|
1567
|
+
"disable_merge_by_self": disable_merge_by_self,
|
|
1568
|
+
"can_force_merge": can_force_merge,
|
|
1569
|
+
"add_notes_after_merged": add_notes_after_merged,
|
|
1570
|
+
"mark_auto_merged_mr_as_closed": mark_auto_merged_mr_as_closed,
|
|
1571
|
+
"can_reopen": can_reopen,
|
|
1572
|
+
"delete_source_branch_when_merged": delete_source_branch_when_merged,
|
|
1573
|
+
"disable_squash_merge": disable_squash_merge,
|
|
1574
|
+
"auto_squash_merge": auto_squash_merge,
|
|
1575
|
+
"merge_method": merge_method,
|
|
1576
|
+
"squash_merge_with_no_merge_commit": squash_merge_with_no_merge_commit,
|
|
1577
|
+
"merged_commit_author": merged_commit_author,
|
|
1578
|
+
"approval_required_approvers": approval_required_approvers,
|
|
1579
|
+
"approval_approver_ids": approval_approver_ids,
|
|
1580
|
+
"approval_tester_ids": approval_tester_ids,
|
|
1581
|
+
"approval_required_testers": approval_required_testers,
|
|
1582
|
+
"is_check_cla": is_check_cla,
|
|
1583
|
+
"is_allow_lite_merge_request": is_allow_lite_merge_request,
|
|
1584
|
+
"lite_merge_request_prefix_title": lite_merge_request_prefix_title,
|
|
1585
|
+
"close_issue_when_mr_merged": close_issue_when_mr_merged,
|
|
1586
|
+
**kwargs,
|
|
1587
|
+
},
|
|
1234
1588
|
)
|
|
1235
1589
|
|
|
1236
1590
|
async def set_member_role(
|
|
@@ -1248,11 +1602,12 @@ class AsyncReposResource(AsyncResource, AbstractReposResource):
|
|
|
1248
1602
|
json={"permission": permission},
|
|
1249
1603
|
)
|
|
1250
1604
|
|
|
1251
|
-
async def transfer(
|
|
1252
|
-
self, *, owner: Optional[str] = None, repo: Optional[str] = None, **payload
|
|
1253
|
-
) -> RepositoryTransferResult:
|
|
1605
|
+
async def transfer(self, *, owner: str, repo: str, new_owner: str, **kwargs) -> RepositoryTransferResult:
|
|
1254
1606
|
return await self._model(
|
|
1255
|
-
"POST",
|
|
1607
|
+
"POST",
|
|
1608
|
+
self._client._repo_path("transfer", owner=owner, repo=repo),
|
|
1609
|
+
RepositoryTransferResult,
|
|
1610
|
+
json={"new_owner": new_owner, **kwargs},
|
|
1256
1611
|
)
|
|
1257
1612
|
|
|
1258
1613
|
async def list_customized_roles(
|