diff options
author | John L. Villalovos <john@sodarock.com> | 2022-05-31 17:54:59 -0700 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2022-05-31 17:54:59 -0700 |
commit | 9d629bb97af1e14ce8eb4679092de2393e1e3a05 (patch) | |
tree | 19c442b982350c63c4077e001562d311062d7180 /gitlab/v4/objects/files.py | |
parent | 0c5a1213ba3bb3ec4ed5874db4588d21969e9e80 (diff) | |
download | gitlab-9d629bb97af1e14ce8eb4679092de2393e1e3a05.tar.gz |
chore: move `utils._validate_attrs` inside `types.RequiredOptional`
Move the `validate_attrs` function to be inside the `RequiredOptional`
class. It makes sense for it to be part of the class as it is working
on data related to the class.
Diffstat (limited to 'gitlab/v4/objects/files.py')
-rw-r--r-- | gitlab/v4/objects/files.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gitlab/v4/objects/files.py b/gitlab/v4/objects/files.py index b80d129..894195c 100644 --- a/gitlab/v4/objects/files.py +++ b/gitlab/v4/objects/files.py @@ -145,7 +145,7 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTMa if TYPE_CHECKING: assert data is not None - utils._validate_attrs(data=data, attributes=self._create_attrs) + self._create_attrs.validate_attrs(data=data) new_data = data.copy() file_path = utils.EncodedId(new_data.pop("file_path")) path = f"{self.path}/{file_path}" @@ -179,7 +179,7 @@ class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTMa file_path = utils.EncodedId(file_path) data["file_path"] = file_path path = f"{self.path}/{file_path}" - utils._validate_attrs(data=data, attributes=self._update_attrs) + self._update_attrs.validate_attrs(data=data) result = self.gitlab.http_put(path, post_data=data, **kwargs) if TYPE_CHECKING: assert isinstance(result, dict) |