FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-gitlab/gitlab/v4/objects/ldap.py at main · python-gitlab/python-gitlab · GitHub
python-gitlab
python-gitlab
Repository navigation
Code
Issues
16
(16)
Pull requests
15
(15)
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-gitlab
/
gitlab
/
v4
/
objects
/
ldap.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
68 lines (52 loc) · 2.12 KB
Breadcrumbs
python-gitlab
/
gitlab
/
v4
/
objects
/
ldap.py
Copy path
File metadata and controls
68 lines (52 loc) · 2.12 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from
__future__
import
annotations
from
typing
import
Any
,
Literal
,
overload
from
gitlab
import
exceptions
as
exc
from
gitlab
.
base
import
RESTManager
,
RESTObject
,
RESTObjectList
__all__
=
[
"LDAPGroup"
,
"LDAPGroupManager"
]
class
LDAPGroup
(
RESTObject
):
_id_attr
=
None
class
LDAPGroupManager
(
RESTManager
[
LDAPGroup
]):
_path
=
"/ldap/groups"
_obj_cls
=
LDAPGroup
_list_filters
=
(
"search"
,
"provider"
)
@
overload
def
list
(
self
,
*
,
iterator
:
Literal
[
False
]
=
False
,
**
kwargs
:
Any
)
->
list
[
LDAPGroup
]: ...
@
overload
def
list
(
self
,
*
,
iterator
:
Literal
[
True
]
=
True
,
**
kwargs
:
Any
)
->
RESTObjectList
[
LDAPGroup
]: ...
@
overload
def
list
(
self
,
*
,
iterator
:
bool
=
False
,
**
kwargs
:
Any
)
->
list
[
LDAPGroup
]
|
RESTObjectList
[
LDAPGroup
]: ...
@
exc
.
on_http_error
(
exc
.
GitlabListError
)
def
list
(
self
,
*
,
iterator
:
bool
=
False
,
**
kwargs
:
Any
)
->
list
[
LDAPGroup
]
|
RESTObjectList
[
LDAPGroup
]:
"""Retrieve a list of objects.
Args:
get_all: If True, return all the items, without pagination
per_page: Number of items to retrieve per request
page: ID of the page to return (starts with page 1)
iterator: If set to True and no pagination option is
defined, return a generator instead of a list
**kwargs: Extra options to send to the server (e.g. sudo)
Returns:
The list of objects, or a generator if `iterator` is True
Raises:
GitlabAuthenticationError: If authentication is not correct
GitlabListError: If the server cannot perform the request
"""
data
=
kwargs
.
copy
()
if
self
.
gitlab
.
per_page
:
data
.
setdefault
(
"per_page"
,
self
.
gitlab
.
per_page
)
if
"provider"
in
data
:
path
=
f"/ldap/
{
data
[
'provider'
]
}
/groups"
else
:
path
=
self
.
_path
obj
=
self
.
gitlab
.
http_list
(
path
,
iterator
=
iterator
,
**
data
)
if
isinstance
(
obj
,
list
):
return
[
self
.
_obj_cls
(
self
,
item
)
for
item
in
obj
]
return
RESTObjectList
(
self
,
self
.
_obj_cls
,
obj
)
Back
|
FazBrowse Home
|
New Git URL