summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects.py
diff options
context:
space:
mode:
authorMax Wittig <max.wittig@siemens.com>2020-01-21 18:46:27 +0100
committerMax Wittig <max.wittig95@gmail.com>2020-01-22 21:19:21 +0100
commit4c4ac5ca1e5cabc4ea4b12734a7b091bc4c224b5 (patch)
tree76f64ea79d1349b904c3eb1e16ff92b770c7ae74 /gitlab/v4/objects.py
parentafdc43f401e20550ed181d4b87829739791d2ee3 (diff)
downloadgitlab-feat/appearance.tar.gz
feat: add appearance APIfeat/appearance
Diffstat (limited to 'gitlab/v4/objects.py')
-rw-r--r--gitlab/v4/objects.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 88ede56..c38a4bf 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -514,6 +514,51 @@ class CurrentUserManager(GetWithoutIdMixin, RESTManager):
_obj_cls = CurrentUser
+class ApplicationAppearance(SaveMixin, RESTObject):
+ _id_attr = None
+
+
+class ApplicationAppearanceManager(GetWithoutIdMixin, UpdateMixin, RESTManager):
+ _path = "/application/appearance"
+ _obj_cls = ApplicationAppearance
+ _update_attrs = (
+ tuple(),
+ (
+ "title",
+ "description",
+ "logo",
+ "header_logo",
+ "favicon",
+ "new_project_guidelines",
+ "header_message",
+ "footer_message",
+ "message_background_color",
+ "message_font_color",
+ "email_header_and_footer_enabled",
+ ),
+ )
+
+ @exc.on_http_error(exc.GitlabUpdateError)
+ def update(self, id=None, new_data=None, **kwargs):
+ """Update an object on the server.
+
+ Args:
+ id: ID of the object to update (can be None if not required)
+ new_data: the update data for the object
+ **kwargs: Extra options to send to the server (e.g. sudo)
+
+ Returns:
+ dict: The new object data (*not* a RESTObject)
+
+ Raises:
+ GitlabAuthenticationError: If authentication is not correct
+ GitlabUpdateError: If the server cannot perform the request
+ """
+ new_data = new_data or {}
+ data = new_data.copy()
+ super(ApplicationAppearanceManager, self).update(id, data, **kwargs)
+
+
class ApplicationSettings(SaveMixin, RESTObject):
_id_attr = None