33# Copyright (C) 2020, 2021 Roald Nefs <info@roaldnefs.com>
44#
55# This file is part of python-transip.
6-
6+ #
77# python-transip is free software: you can redistribute it and/or modify
88# it under the terms of the GNU Lesser General Public License as published by
99# the Free Software Foundation, either version 3 of the License, or
1010# (at your option) any later version.
11-
11+ #
1212# python-transip is distributed in the hope that it will be useful,
1313# but WITHOUT ANY WARRANTY; without even the implied warranty of
1414# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515# GNU Lesser General Public License for more details.
16-
16+ #
1717# You should have received a copy of the GNU Lesser General Public License
1818# along with python-transip. If not, see <https://www.gnu.org/licenses/>.
1919
3333
3434
3535class GetMixin :
36- """Retrieve an single ApiObject.
36+ """
37+ Retrieve an single ApiObject.
3738
3839 Derived class must define ``_resp_get_attr``.
3940
@@ -45,7 +46,7 @@ class GetMixin:
4546
4647 _resp_get_attr : Optional [str ] = None
4748
48- def get (self , id : str , ** kwargs ) -> Optional [Type [ApiObject ]]:
49+ def get (self , id : str ) -> Optional [Type [ApiObject ]]:
4950 if self ._obj_cls or self .path or self ._resp_get_attr :
5051 obj : Type [ApiObject ] = self ._obj_cls ( # type: ignore
5152 self ,
@@ -61,7 +62,7 @@ class DeleteMixin:
6162 client : TransIP
6263 path : str
6364
64- def delete (self , id : str , ** kwargs ) -> None :
65+ def delete (self , id : str ) -> None :
6566 if self .path :
6667 self .client .delete (f"{ self .path } /{ id } " )
6768
@@ -77,7 +78,8 @@ def delete(self) -> None:
7778
7879
7980class ListMixin :
80- """Retrieve a list of ApiObjects.
81+ """
82+ Retrieve a list of ApiObjects.
8183
8284 Derived class must define ``_resp_list_attr``.
8385
@@ -89,7 +91,7 @@ class ListMixin:
8991
9092 _resp_list_attr : Optional [str ] = None
9193
92- def list (self , ** kwargs ) -> List [Type [ApiObject ]]:
94+ def list (self ) -> List [Type [ApiObject ]]:
9395 objs : List [Type [ApiObject ]] = []
9496 if self ._obj_cls and self .path and self ._resp_list_attr :
9597 for obj in self .client .get (self .path )[self ._resp_list_attr ]:
@@ -111,8 +113,8 @@ def get_update_attrs(self) -> Tuple[
111113 Union [Tuple [()], Tuple [str , ...]],
112114 Union [Tuple [()], Tuple [str , ...]]
113115 ]:
114- """Return the required and optional attributes for updating a new
115- object.
116+ """
117+ Return the required and optional attributes for updating a new object.
116118
117119 Returns:
118120 tuple: a tuple containing a tuple of required and optional
@@ -124,7 +126,8 @@ def get_update_attrs(self) -> Tuple[
124126 return self ._update_attrs
125127
126128 def _check_update_attrs (self , attrs ) -> None :
127- """Check required attributes.
129+ """
130+ Check required attributes.
128131
129132 Raises:
130133 AttributeError: If any of the required attributes is missing.
@@ -171,7 +174,8 @@ class CreateMixin:
171174 _create_attrs : Optional [CreateAttrsTuple ] = None
172175
173176 def _check_create_attrs (self , attrs ) -> None :
174- """Check required attributes.
177+ """
178+ Check required attributes.
175179
176180 Raises:
177181 AttributeError: If any of the required attributes is missing.
@@ -190,8 +194,8 @@ def get_create_attrs(self) -> Tuple[
190194 Union [Tuple [()], Tuple [str , ...]],
191195 Union [Tuple [()], Tuple [str , ...]]
192196 ]:
193- """Return the required and optional attributes for creating a new
194- object.
197+ """
198+ Return the required and optional attributes for creating a new object.
195199
196200 Returns:
197201 tuple: a tuple containing a tuple of required and optional
@@ -202,7 +206,7 @@ def get_create_attrs(self) -> Tuple[
202206 else :
203207 return self ._create_attrs
204208
205- def create (self , data : Optional [Dict [str , Any ]] = None , ** kwargs ):
209+ def create (self , data : Optional [Dict [str , Any ]] = None ):
206210 if data is None :
207211 data = {}
208212
0 commit comments