summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/users.py
Commit message (Collapse)AuthorAgeFilesLines
* fix: support array types for most resourcesNejc Habjan2022-07-281-1/+2
|
* chore: enable mypy check `strict_equality`John L. Villalovos2022-07-191-5/+13
| | | | Enable the `mypy` `strict_equality` check.
* refactor: remove no-op id argument in GetWithoutIdMixinNejc Habjan2022-06-251-9/+7
|
* feat(users): add approve and reject methods to UserBen Gamari2022-06-251-0/+36
| | | | | | As requested in #1604. Co-authored-by: John Villalovos <john@sodarock.com>
* feat(users): add ban and unban methodsAntoine Auger2022-06-131-0/+42
|
* chore: move `RequiredOptional` to the `gitlab.types` moduleJohn L. Villalovos2022-05-311-1/+2
| | | | | | By having `RequiredOptional` in the `gitlab.base` module it makes it difficult with circular imports. Move it to the `gitlab.types` module which has no dependencies on any other gitlab module.
* chore: update type-hints return signature for GetWithoutIdMixin methodsJohn L. Villalovos2022-05-301-10/+6
| | | | | | | Commit f0152dc3cc9a42aa4dc3c0014b4c29381e9b39d6 removed situation where `get()` in a `GetWithoutIdMixin` based class could return `None` Update the type-hints to no longer return `Optional` AKA `None`
* feat(client): introduce `iterator=True` and deprecate `as_list=False` in ↵John L. Villalovos2022-05-291-2/+2
| | | | | | | | | | | `list()` `as_list=False` is confusing as it doesn't explain what is being returned. Replace it with `iterator=True` which more clearly explains to the user that an iterator/generator will be returned. This maintains backward compatibility with `as_list` but does issue a DeprecationWarning if `as_list` is set.
* feat: display human-readable attribute in `repr()` if presentNejc Habjan2022-05-081-7/+7
|
* feat(user): support getting user SSH key by idNejc Habjan2022-04-011-1/+4
|
* chore: create new ArrayAttribute classJohn L. Villalovos2022-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | Create a new ArrayAttribute class. This is to indicate types which are sent to the GitLab server as arrays https://docs.gitlab.com/ee/api/#array At this stage it is identical to the CommaSeparatedListAttribute class but will be used later to support the array types sent to GitLab. This is the second step in a series of steps of our goal to add full support for the GitLab API data types[1]: * array * hash * array of hashes Step one was: commit 5127b1594c00c7364e9af15e42d2e2f2d909449b [1] https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types Related: #1698
* chore: rename `types.ListAttribute` to `types.CommaSeparatedListAttribute`John L. Villalovos2022-01-221-1/+1
| | | | | | | | | | | This name more accurately describes what the type is. Also this is the first step in a series of steps of our goal to add full support for the GitLab API data types[1]: * array * hash * array of hashes [1] https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types
* chore(objects): use `self.encoded_id` where applicableJohn L. Villalovos2022-01-131-6/+6
| | | | | | | | Updated a few remaining usages of `self.id` to use `self.encoded_id` as for the most part we shouldn't be using `self.id` There are now only a few (4 lines of code) remaining uses of `self.id`, most of which seem that they should stay that way.
* feat: add support for `squash_option` in Projectsjlvillal/squash_optionJohn L. Villalovos2021-12-131-0/+1
| | | | | | | There is an optional `squash_option` parameter which can be used when creating Projects and UserProjects. Closes #1744
* chore: add get() methods for GetWithoutIdMixin based classesjlvillal/get_without_idJohn L. Villalovos2021-12-081-1/+16
| | | | | | | Add the get() methods for the GetWithoutIdMixin based classes. Update the tests/meta/test_ensure_type_hints.py tests to check to ensure that the get methods are defined with the correct return type.
* docs: use annotations for return typesdocs/sphinx-annotationsNejc Habjan2021-12-011-7/+7
|
* docs: only use type annotations for documentationNejc Habjan2021-11-281-4/+4
|
* chore: ensure get() methods have correct type-hintsjlvillal/mypy_ensure_type_hintsJohn L. Villalovos2021-11-151-0/+31
| | | | | | | | Fix classes which don't have correct 'get()' methods for classes derived from GetMixin. Add a unit test which verifies that classes have the correct return type in their 'get()' method.
* refactor: use new-style formatting for named placeholdersNejc Habjan2021-11-081-12/+12
|
* refactor: use f-strings for string formattingNejc Habjan2021-11-051-8/+8
|
* feat(objects): list starred projects of a userNejc Habjan2021-10-141-0/+34
|
* Merge pull request #1515 from JohnVillalovos/jlvillal/mypy_v4_obj_usersNejc Habjan2021-10-061-8/+15
|\ | | | | chore: add type-hints to gitlab/v4/objects/users.py
| * chore: add type-hints to gitlab/v4/objects/users.pyJohn L. Villalovos2021-09-071-8/+15
| | | | | | | | Adding type-hints to gitlab/v4/objects/users.py
* | feat(objects): support Create and Revoke personal access token APINejc Habjan2021-09-131-0/+2
| |
* | chore: convert to using type-annotations for managersJohn L. Villalovos2021-09-081-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Convert our manager usage to be done via type annotations. Now to define a manager to be used in a RESTObject subclass can simply do: class ExampleClass(CRUDMixin, RESTObject): my_manager: MyManager Any type-annotation that annotates it to be of type *Manager (with the exception of RESTManager) will cause the manager to be created on the object.
* | chore: improve type-hinting for managersJohn L. Villalovos2021-09-071-2/+20
|/ | | | | | | | | | | | | | | The 'managers' are dynamically created. This unfortunately means that we don't have any type-hints for them and so editors which understand type-hints won't know that they are valid attributes. * Add the type-hints for the managers we define. * Add a unit test that makes sure that the type-hints and the '_managers' attribute are kept in sync with each other. * Add unit test that makes sure specified managers in '_managers' have a name ending in 'Managers' to keep with current convention. * Make RESTObject._managers always present with a default value of None. * Fix a type-issue revealed now that mypy knows what the type is
* chore: fix import ordering using isortJohn L. Villalovos2021-05-251-3/+3
| | | | | | Fix the import ordering using isort. https://pycqa.github.io/isort/
* fix(objects): allow lists for filters for in all objectsfix/missing-list-attributesNejc Habjan2021-04-271-1/+2
|
* chore: fix F401 errors reported by flake8John L. Villalovos2021-04-181-2/+2
| | | | | | F401: Module imported but unused https://www.flake8rules.com/rules/F401.html
* chore: have _create_attrs & _update_attrs be a namedtupleJohn L. Villalovos2021-04-171-18/+19
| | | | | | Convert _create_attrs and _update_attrs to use a NamedTuple (RequiredOptional) to help with code readability. Update all code to use the NamedTuple.
* Merge pull request #1333 from python-gitlab/feat/user-follow-apiNejc Habjan2021-02-281-0/+50
|\ | | | | feat(users): add follow/unfollow API
| * feat(users): add follow/unfollow APIfeat/user-follow-apiMax Wittig2021-02-271-0/+50
| |
* | fix: remove duplicate class definitions in v4/objects/users.pyJohn L. Villalovos2021-02-251-12/+0
| | | | | | | | | | The classes UserStatus and UserStatusManager were each declared twice. Remove the duplicate declarations.
* | chore: remove usage of 'from ... import *'John L. Villalovos2021-02-231-2/+13
|/ | | | | | | | | | | | | | | | | | In gitlab/v4/objects/*.py remove usage of: * from gitlab.base import * * from gitlab.mixins import * Change them to: * from gitlab.base import CLASS_NAME * from gitlab.mixins import CLASS_NAME Programmatically update code to explicitly import needed classes only. After the change the output of: $ flake8 gitlab/v4/objects/*py | grep 'REST\|Mixin' Is empty. Before many messages about unable to determine if it was a valid name.
* refactor(api): explicitly export classes for star importsrefactor/split-objectsNejc Habjan2021-02-071-0/+37
|
* refactor(v4): split objects and managers per API resourceNejc Habjan2021-02-071-0/+419