Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e2b7be

Browse files
authored
Fix intellisense on Auth0 class (auth0#486)
2 parents 3d5b5f1 + a253c2a commit 1e2b7be

File tree

2 files changed

+41
-43
lines changed

2 files changed

+41
-43
lines changed

auth0/management/async_auth0.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import aiohttp
22

33
from ..asyncify import asyncify
4-
from .auth0 import modules
4+
from .auth0 import Auth0
55

66

77
class AsyncAuth0:
@@ -20,8 +20,8 @@ class AsyncAuth0:
2020

2121
def __init__(self, domain, token, rest_options=None):
2222
self._services = []
23-
for name, cls in modules.items():
24-
cls = asyncify(cls)
23+
for name, attr in vars(Auth0(domain, token, rest_options=rest_options)).items():
24+
cls = asyncify(attr.__class__)
2525
service = cls(domain=domain, token=token, rest_options=rest_options)
2626
self._services.append(service)
2727
setattr(

auth0/management/auth0.py

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from ..utils import is_async_available
21
from .actions import Actions
32
from .attack_protection import AttackProtection
43
from .blacklists import Blacklists
@@ -30,39 +29,6 @@
3029
from .users import Users
3130
from .users_by_email import UsersByEmail
3231

33-
modules = {
34-
"actions": Actions,
35-
"attack_protection": AttackProtection,
36-
"blacklists": Blacklists,
37-
"branding": Branding,
38-
"client_credentials": ClientCredentials,
39-
"client_grants": ClientGrants,
40-
"clients": Clients,
41-
"connections": Connections,
42-
"custom_domains": CustomDomains,
43-
"device_credentials": DeviceCredentials,
44-
"email_templates": EmailTemplates,
45-
"emails": Emails,
46-
"grants": Grants,
47-
"guardian": Guardian,
48-
"hooks": Hooks,
49-
"jobs": Jobs,
50-
"log_streams": LogStreams,
51-
"logs": Logs,
52-
"organizations": Organizations,
53-
"prompts": Prompts,
54-
"resource_servers": ResourceServers,
55-
"roles": Roles,
56-
"rules_configs": RulesConfigs,
57-
"rules": Rules,
58-
"stats": Stats,
59-
"tenants": Tenants,
60-
"tickets": Tickets,
61-
"user_blocks": UserBlocks,
62-
"users_by_email": UsersByEmail,
63-
"users": Users,
64-
}
65-
6632

6733
class Auth0:
6834
"""Provides easy access to all endpoint classes
@@ -79,9 +45,41 @@ class Auth0:
7945
"""
8046

8147
def __init__(self, domain, token, rest_options=None):
82-
for name, cls in modules.items():
83-
setattr(
84-
self,
85-
name,
86-
cls(domain=domain, token=token, rest_options=rest_options),
87-
)
48+
self.actions = Actions(domain, token, rest_options=rest_options)
49+
self.attack_protection = AttackProtection(
50+
domain, token, rest_options=rest_options
51+
)
52+
self.blacklists = Blacklists(domain, token, rest_options=rest_options)
53+
self.branding = Branding(domain, token, rest_options=rest_options)
54+
self.client_credentials = ClientCredentials(
55+
domain, token, rest_options=rest_options
56+
)
57+
self.client_grants = ClientGrants(domain, token, rest_options=rest_options)
58+
self.clients = Clients(domain, token, rest_options=rest_options)
59+
self.connections = Connections(domain, token, rest_options=rest_options)
60+
self.custom_domains = CustomDomains(domain, token, rest_options=rest_options)
61+
self.device_credentials = DeviceCredentials(
62+
domain, token, rest_options=rest_options
63+
)
64+
self.email_templates = EmailTemplates(domain, token, rest_options=rest_options)
65+
self.emails = Emails(domain, token, rest_options=rest_options)
66+
self.grants = Grants(domain, token, rest_options=rest_options)
67+
self.guardian = Guardian(domain, token, rest_options=rest_options)
68+
self.hooks = Hooks(domain, token, rest_options=rest_options)
69+
self.jobs = Jobs(domain, token, rest_options=rest_options)
70+
self.log_streams = LogStreams(domain, token, rest_options=rest_options)
71+
self.logs = Logs(domain, token, rest_options=rest_options)
72+
self.organizations = Organizations(domain, token, rest_options=rest_options)
73+
self.prompts = Prompts(domain, token, rest_options=rest_options)
74+
self.resource_servers = ResourceServers(
75+
domain, token, rest_options=rest_options
76+
)
77+
self.roles = Roles(domain, token, rest_options=rest_options)
78+
self.rules_configs = RulesConfigs(domain, token, rest_options=rest_options)
79+
self.rules = Rules(domain, token, rest_options=rest_options)
80+
self.stats = Stats(domain, token, rest_options=rest_options)
81+
self.tenants = Tenants(domain, token, rest_options=rest_options)
82+
self.tickets = Tickets(domain, token, rest_options=rest_options)
83+
self.user_blocks = UserBlocks(domain, token, rest_options=rest_options)
84+
self.users_by_email = UsersByEmail(domain, token, rest_options=rest_options)
85+
self.users = Users(domain, token, rest_options=rest_options)

0 commit comments

Comments
 (0)