diff options
author | Nejc Habjan <nejc.habjan@siemens.com> | 2023-04-07 12:30:04 +0200 |
---|---|---|
committer | John Villalovos <john@sodarock.com> | 2023-04-10 19:41:56 -0700 |
commit | ce84f2e64a640e0d025a7ba3a436f347ad25e88e (patch) | |
tree | 56d964768108a88c1e697b9792369966b31e96bc | |
parent | 511764d2fc4e524eff0d7cf0987d451968e817d3 (diff) | |
download | gitlab-ce84f2e64a640e0d025a7ba3a436f347ad25e88e.tar.gz |
feat(projects): allow importing additional items from GitHub
-rw-r--r-- | gitlab/v4/objects/projects.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py index 6330cc5..a139f31 100644 --- a/gitlab/v4/objects/projects.py +++ b/gitlab/v4/objects/projects.py @@ -1106,6 +1106,8 @@ class ProjectManager(CRUDMixin, RESTManager): repo_id: int, target_namespace: str, new_name: Optional[str] = None, + github_hostname: Optional[str] = None, + optional_stages: Optional[Dict[str, bool]] = None, **kwargs: Any, ) -> Union[Dict[str, Any], requests.Response]: """Import a project from Github to Gitlab (schedule the import) @@ -1126,6 +1128,9 @@ class ProjectManager(CRUDMixin, RESTManager): repo_id: Github repository ID target_namespace: Namespace to import repo into new_name: New repo name (Optional) + github_hostname: Custom GitHub Enterprise hostname. + Do not set for GitHub.com. (Optional) + optional_stages: Additional items to import. (Optional) **kwargs: Extra options to send to the server (e.g. sudo) Raises: @@ -1156,9 +1161,12 @@ class ProjectManager(CRUDMixin, RESTManager): "personal_access_token": personal_access_token, "repo_id": repo_id, "target_namespace": target_namespace, + "new_name": new_name, + "github_hostname": github_hostname, + "optional_stages": optional_stages, } - if new_name: - data["new_name"] = new_name + data = utils.remove_none_from_dict(data) + if ( "timeout" not in kwargs or self.gitlab.timeout is None |