Repository: python-gitlab/python-gitlab

Issue:
Snippets requires deprecated fields 
## Description of the problem, including code/CLI snippet

in `project.snippets.create()` the required attributes were deprecated
```shell
AttributeError: Missing attributes: file_name, content
```
filename and content were deprecated in `files:file_path` and `files:content`

https://docs.gitlab.com/ee/api/snippets.html#create-new-snippet


## Specifications

  - python-gitlab version: 3.15.0 
  - API version you are using (v3/v4): v4
  - Gitlab server version (or gitlab.com): 15.11



Discussion:

Resolving patch:
diff --git a/gitlab/v4/objects/snippets.py b/gitlab/v4/objects/snippets.py
--- a/gitlab/v4/objects/snippets.py
+++ b/gitlab/v4/objects/snippets.py
@@ -70,10 +70,23 @@ class SnippetManager(CRUDMixin, RESTManager):
     _path = "/snippets"
     _obj_cls = Snippet
     _create_attrs = RequiredOptional(
-        required=("title", "file_name", "content"), optional=("lifetime", "visibility")
+        required=("title",),
+        exclusive=("files", "file_name"),
+        optional=(
+            "description",
+            "content",
+            "visibility",
+        ),
     )
     _update_attrs = RequiredOptional(
-        optional=("title", "file_name", "content", "visibility")
+        optional=(
+            "title",
+            "files",
+            "file_name",
+            "content",
+            "visibility",
+            "description",
+        ),
     )
 
     @cli.register_custom_action("SnippetManager")
@@ -151,11 +164,22 @@ class ProjectSnippetManager(CRUDMixin, RESTManager):
     _obj_cls = ProjectSnippet
     _from_parent_attrs = {"project_id": "id"}
     _create_attrs = RequiredOptional(
-        required=("title", "file_name", "content", "visibility"),
-        optional=("description",),
+        required=("title", "visibility"),
+        exclusive=("files", "file_name"),
+        optional=(
+            "description",
+            "content",
+        ),
     )
     _update_attrs = RequiredOptional(
-        optional=("title", "file_name", "content", "visibility", "description"),
+        optional=(
+            "title",
+            "files",
+            "file_name",
+            "content",
+            "visibility",
+            "description",
+        ),
     )
 
     def get(


Test patch:
diff --git a/tests/functional/api/test_snippets.py b/tests/functional/api/test_snippets.py
--- a/tests/functional/api/test_snippets.py
+++ b/tests/functional/api/test_snippets.py
@@ -6,7 +6,10 @@ def test_snippets(gl):
     assert not snippets
 
     snippet = gl.snippets.create(
-        {"title": "snippet1", "file_name": "snippet1.py", "content": "import gitlab"}
+        {
+            "title": "snippet1",
+            "files": [{"file_path": "snippet1.py", "content": "import gitlab"}],
+        }
     )
     snippet = gl.snippets.get(snippet.id)
     snippet.title = "updated_title"
@@ -30,8 +33,7 @@ def test_project_snippets(project):
     snippet = project.snippets.create(
         {
             "title": "snip1",
-            "file_name": "foo.py",
-            "content": "initial content",
+            "files": [{"file_path": "foo.py", "content": "initial content"}],
             "visibility": gitlab.const.VISIBILITY_PRIVATE,
         }
     )