Skip to content

Commit

Permalink
chore: sync create and update attributes for Projects
Browse files Browse the repository at this point in the history
Sync the create attributes with:
https://docs.gitlab.com/ee/api/projects.html#create-project

Sync the update attributes with documentation at:
https://docs.gitlab.com/ee/api/projects.html#edit-project

As a note the ordering of the attributes was done to match the
ordering of the attributes in the documentation.

Closes: #1497
  • Loading branch information
JohnVillalovos committed Jun 3, 2021
1 parent d3fac50 commit 0044bd2
Showing 1 changed file with 99 additions and 81 deletions.
180 changes: 99 additions & 81 deletions gitlab/v4/objects/projects.py
Expand Up @@ -564,119 +564,137 @@ def artifact(
class ProjectManager(CRUDMixin, RESTManager):
_path = "/projects"
_obj_cls = Project
# Please keep these _create_attrs in same order as they are at:
# https://docs.gitlab.com/ee/api/projects.html#create-project
_create_attrs = RequiredOptional(
optional=(
"name",
"path",
"namespace_id",
"allow_merge_on_skipped_pipeline",
"analytics_access_level",
"approvals_before_merge",
"auto_cancel_pending_pipelines",
"auto_devops_deploy_strategy",
"auto_devops_enabled",
"autoclose_referenced_issues",
"avatar",
"build_coverage_regex",
"build_git_strategy",
"build_timeout",
"builds_access_level",
"ci_config_path",
"container_expiration_policy_attributes",
"container_registry_enabled",
"default_branch",
"description",
"emails_disabled",
"external_authorization_classification_label",
"forking_access_level",
"group_with_project_templates_id",
"import_url",
"initialize_with_readme",
"issues_access_level",
"issues_enabled",
"merge_requests_enabled",
"jobs_enabled",
"wiki_enabled",
"snippets_enabled",
"issues_access_level",
"repository_access_level",
"lfs_enabled",
"merge_method",
"merge_requests_access_level",
"forking_access_level",
"builds_access_level",
"wiki_access_level",
"snippets_access_level",
"merge_requests_enabled",
"mirror_trigger_builds",
"mirror",
"namespace_id",
"operations_access_level",
"only_allow_merge_if_all_discussions_are_resolved",
"only_allow_merge_if_pipeline_succeeds",
"packages_enabled",
"pages_access_level",
"emails_disabled",
"resolve_outdated_diff_discussions",
"container_registry_enabled",
"container_expiration_policy_attributes",
"shared_runners_enabled",
"visibility",
"import_url",
"requirements_access_level",
"printing_merge_request_link_enabled",
"public_builds",
"only_allow_merge_if_pipeline_succeeds",
"only_allow_merge_if_all_discussions_are_resolved",
"merge_method",
"autoclose_referenced_issues",
"remove_source_branch_after_merge",
"lfs_enabled",
"repository_access_level",
"repository_storage",
"request_access_enabled",
"resolve_outdated_diff_discussions",
"shared_runners_enabled",
"show_default_award_emojis",
"snippets_access_level",
"snippets_enabled",
"tag_list",
"avatar",
"printing_merge_request_link_enabled",
"build_git_strategy",
"build_timeout",
"auto_cancel_pending_pipelines",
"build_coverage_regex",
"ci_config_path",
"auto_devops_enabled",
"auto_devops_deploy_strategy",
"repository_storage",
"approvals_before_merge",
"external_authorization_classification_label",
"mirror",
"mirror_trigger_builds",
"initialize_with_readme",
"template_name",
"template_project_id",
"use_custom_template",
"group_with_project_templates_id",
"packages_enabled",
"visibility",
"wiki_access_level",
"wiki_enabled",
),
)
# Please keep these _update_attrs in same order as they are at:
# https://docs.gitlab.com/ee/api/projects.html#edit-project
_update_attrs = RequiredOptional(
optional=(
"name",
"path",
"default_branch",
"description",
"issues_enabled",
"merge_requests_enabled",
"jobs_enabled",
"wiki_enabled",
"snippets_enabled",
"issues_access_level",
"repository_access_level",
"merge_requests_access_level",
"forking_access_level",
"builds_access_level",
"wiki_access_level",
"snippets_access_level",
"pages_access_level",
"emails_disabled",
"resolve_outdated_diff_discussions",
"container_registry_enabled",
"container_expiration_policy_attributes",
"shared_runners_enabled",
"visibility",
"import_url",
"public_builds",
"only_allow_merge_if_pipeline_succeeds",
"only_allow_merge_if_all_discussions_are_resolved",
"merge_method",
"allow_merge_on_skipped_pipeline",
"analytics_access_level",
"approvals_before_merge",
"auto_cancel_pending_pipelines",
"auto_devops_deploy_strategy",
"auto_devops_enabled",
"autoclose_referenced_issues",
"suggestion_commit_message",
"remove_source_branch_after_merge",
"lfs_enabled",
"request_access_enabled",
"tag_list",
"avatar",
"build_coverage_regex",
"build_git_strategy",
"build_timeout",
"auto_cancel_pending_pipelines",
"build_coverage_regex",
"builds_access_level",
"ci_config_path",
"ci_default_git_depth",
"auto_devops_enabled",
"auto_devops_deploy_strategy",
"repository_storage",
"approvals_before_merge",
"ci_forward_deployment_enabled",
"container_expiration_policy_attributes",
"container_registry_enabled",
"default_branch",
"description",
"emails_disabled",
"external_authorization_classification_label",
"mirror",
"mirror_user_id",
"forking_access_level",
"import_url",
"issues_access_level",
"issues_enabled",
"jobs_enabled",
"lfs_enabled",
"merge_method",
"merge_requests_access_level",
"merge_requests_enabled",
"mirror_overwrites_diverged_branches",
"mirror_trigger_builds",
"mirror_user_id",
"mirror",
"name",
"operations_access_level",
"only_allow_merge_if_all_discussions_are_resolved",
"only_allow_merge_if_pipeline_succeeds",
"only_mirror_protected_branches",
"mirror_overwrites_diverged_branches",
"packages_enabled",
"pages_access_level",
"requirements_access_level",
"restrict_user_defined_variables",
"path",
"public_builds",
"remove_source_branch_after_merge",
"repository_access_level",
"repository_storage",
"request_access_enabled",
"resolve_outdated_diff_discussions",
"service_desk_enabled",
"shared_runners_enabled",
"show_default_award_emojis",
"snippets_access_level",
"snippets_enabled",
"suggestion_commit_message",
"tag_list",
"visibility",
"wiki_access_level",
"wiki_enabled",
"issues_template",
"merge_requests_template",
),
)
_list_filters = (
Expand Down

0 comments on commit 0044bd2

Please sign in to comment.