Skip to content

Commit ad86523

Browse files
committed
rework of the gen process
improve the generation process to pass the tests
1 parent 0a67124 commit ad86523

231 files changed

Lines changed: 10584 additions & 4770 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

generate_from_openapi.py

Lines changed: 687 additions & 406 deletions
Large diffs are not rendered by default.

mist_openapi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit c020e9d2248b6064c0bcec2aea6c20f5b3f94713
1+
Subproject commit 8b2fa496b791c036aa0a75de17d557d000ef06a8

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ exclude_lines = [
108108

109109
# Ruff configuration - exclude autogenerated API code
110110
[tool.ruff]
111-
exclude = ["src/mistapi/api/**/*.py"]
111+
#exclude = ["src/mistapi/api/**/*.py"]
112112

113113
[tool.bandit]
114114
targets = ["src"]

src/mistapi/api/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'''
1+
"""
22
--------------------------------------------------------------------------------
33
------------------------- Mist API Python CLI Session --------------------------
44
@@ -8,6 +8,8 @@
88
This package is licensed under the MIT License.
99
1010
--------------------------------------------------------------------------------
11-
'''
11+
"""
1212

1313
from mistapi.api import v1
14+
15+
__all__ = ["v1"]

src/mistapi/api/v1/__init__.py

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'''
1+
"""
22
--------------------------------------------------------------------------------
33
------------------------- Mist API Python CLI Session --------------------------
44
@@ -8,18 +8,36 @@
88
This package is licensed under the MIT License.
99
1010
--------------------------------------------------------------------------------
11-
'''
11+
"""
1212

13-
from mistapi.api.v1 import const
14-
from mistapi.api.v1 import installer
15-
from mistapi.api.v1 import invite
16-
from mistapi.api.v1 import login
17-
from mistapi.api.v1 import logout
18-
from mistapi.api.v1 import mobile
19-
from mistapi.api.v1 import msps
20-
from mistapi.api.v1 import orgs
21-
from mistapi.api.v1 import recover
22-
from mistapi.api.v1 import register
23-
from mistapi.api.v1 import self
24-
from mistapi.api.v1 import sites
25-
from mistapi.api.v1 import utils
13+
from mistapi.api.v1 import (
14+
const,
15+
installer,
16+
invite,
17+
login,
18+
logout,
19+
mobile,
20+
msps,
21+
orgs,
22+
recover,
23+
register,
24+
self,
25+
sites,
26+
utils,
27+
)
28+
29+
__all__ = [
30+
"const",
31+
"installer",
32+
"invite",
33+
"login",
34+
"logout",
35+
"mobile",
36+
"msps",
37+
"orgs",
38+
"recover",
39+
"register",
40+
"self",
41+
"sites",
42+
"utils",
43+
]
Lines changed: 61 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'''
1+
"""
22
--------------------------------------------------------------------------------
33
------------------------- Mist API Python CLI Session --------------------------
44
@@ -8,32 +8,64 @@
88
This package is licensed under the MIT License.
99
1010
--------------------------------------------------------------------------------
11-
'''
11+
"""
1212

13-
from mistapi.api.v1.const import alarm_defs
14-
from mistapi.api.v1.const import ap_channels
15-
from mistapi.api.v1.const import ap_esl_versions
16-
from mistapi.api.v1.const import ap_led_status
17-
from mistapi.api.v1.const import app_categories
18-
from mistapi.api.v1.const import app_subcategories
19-
from mistapi.api.v1.const import applications
20-
from mistapi.api.v1.const import client_events
21-
from mistapi.api.v1.const import countries
22-
from mistapi.api.v1.const import default_gateway_config
23-
from mistapi.api.v1.const import device_events
24-
from mistapi.api.v1.const import device_models
25-
from mistapi.api.v1.const import fingerprint_types
26-
from mistapi.api.v1.const import gateway_applications
27-
from mistapi.api.v1.const import insight_metrics
28-
from mistapi.api.v1.const import languages
29-
from mistapi.api.v1.const import license_types
30-
from mistapi.api.v1.const import marvisclient_versions
31-
from mistapi.api.v1.const import mxedge_events
32-
from mistapi.api.v1.const import mxedge_models
33-
from mistapi.api.v1.const import nac_events
34-
from mistapi.api.v1.const import otherdevice_events
35-
from mistapi.api.v1.const import otherdevice_models
36-
from mistapi.api.v1.const import states
37-
from mistapi.api.v1.const import system_events
38-
from mistapi.api.v1.const import traffic_types
39-
from mistapi.api.v1.const import webhook_topics
13+
from mistapi.api.v1.const import (
14+
alarm_defs,
15+
ap_channels,
16+
ap_esl_versions,
17+
ap_led_status,
18+
app_categories,
19+
app_subcategories,
20+
applications,
21+
client_events,
22+
countries,
23+
default_gateway_config,
24+
device_events,
25+
device_models,
26+
fingerprint_types,
27+
gateway_applications,
28+
insight_metrics,
29+
languages,
30+
license_types,
31+
marvisclient_versions,
32+
mxedge_events,
33+
mxedge_models,
34+
nac_events,
35+
otherdevice_events,
36+
otherdevice_models,
37+
states,
38+
system_events,
39+
traffic_types,
40+
webhook_topics,
41+
)
42+
43+
__all__ = [
44+
"alarm_defs",
45+
"ap_channels",
46+
"ap_esl_versions",
47+
"ap_led_status",
48+
"app_categories",
49+
"app_subcategories",
50+
"applications",
51+
"client_events",
52+
"countries",
53+
"default_gateway_config",
54+
"device_events",
55+
"device_models",
56+
"fingerprint_types",
57+
"gateway_applications",
58+
"insight_metrics",
59+
"languages",
60+
"license_types",
61+
"marvisclient_versions",
62+
"mxedge_events",
63+
"mxedge_models",
64+
"nac_events",
65+
"otherdevice_events",
66+
"otherdevice_models",
67+
"states",
68+
"system_events",
69+
"traffic_types",
70+
"webhook_topics",
71+
]
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'''
1+
"""
22
--------------------------------------------------------------------------------
33
------------------------- Mist API Python CLI Session --------------------------
44
@@ -8,15 +8,15 @@
88
This package is licensed under the MIT License.
99
1010
--------------------------------------------------------------------------------
11-
'''
11+
"""
1212

1313
from mistapi import APISession as _APISession
1414
from mistapi.__api_response import APIResponse as _APIResponse
15-
import deprecation
1615

17-
def listAlarmDefinitions(mist_session:_APISession) -> _APIResponse:
16+
17+
def listAlarmDefinitions(mist_session: _APISession) -> _APIResponse:
1818
"""
19-
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/constants/definitions/list-alarm-definitions
19+
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/constants/events/list-alarm-definitions
2020
2121
PARAMS
2222
-----------
@@ -28,7 +28,8 @@ def listAlarmDefinitions(mist_session:_APISession) -> _APIResponse:
2828
mistapi.APIResponse
2929
response from the API call
3030
"""
31-
uri = f"/api/v1/const/alarm_defs"
32-
query_params:dict[str, str]={}
31+
32+
uri = "/api/v1/const/alarm_defs"
33+
query_params: dict[str, str] = {}
3334
resp = mist_session.mist_get(uri=uri, query=query_params)
3435
return resp

src/mistapi/api/v1/const/ap_channels.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'''
1+
"""
22
--------------------------------------------------------------------------------
33
------------------------- Mist API Python CLI Session --------------------------
44
@@ -8,13 +8,15 @@
88
This package is licensed under the MIT License.
99
1010
--------------------------------------------------------------------------------
11-
'''
11+
"""
1212

1313
from mistapi import APISession as _APISession
1414
from mistapi.__api_response import APIResponse as _APIResponse
15-
import deprecation
1615

17-
def listApChannels(mist_session:_APISession, country_code:str|None=None) -> _APIResponse:
16+
17+
def listApChannels(
18+
mist_session: _APISession, country_code: str | None = None
19+
) -> _APIResponse:
1820
"""
1921
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/constants/definitions/list-ap-channels
2022
@@ -32,9 +34,10 @@ def listApChannels(mist_session:_APISession, country_code:str|None=None) -> _API
3234
mistapi.APIResponse
3335
response from the API call
3436
"""
35-
uri = f"/api/v1/const/ap_channels"
36-
query_params:dict[str, str]={}
37+
38+
uri = "/api/v1/const/ap_channels"
39+
query_params: dict[str, str] = {}
3740
if country_code:
38-
query_params["country_code"]=str(country_code)
41+
query_params["country_code"] = str(country_code)
3942
resp = mist_session.mist_get(uri=uri, query=query_params)
4043
return resp

src/mistapi/api/v1/const/ap_esl_versions.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'''
1+
"""
22
--------------------------------------------------------------------------------
33
------------------------- Mist API Python CLI Session --------------------------
44
@@ -8,13 +8,13 @@
88
This package is licensed under the MIT License.
99
1010
--------------------------------------------------------------------------------
11-
'''
11+
"""
1212

1313
from mistapi import APISession as _APISession
1414
from mistapi.__api_response import APIResponse as _APIResponse
15-
import deprecation
1615

17-
def listApLEslVersions(mist_session:_APISession) -> _APIResponse:
16+
17+
def listApLEslVersions(mist_session: _APISession) -> _APIResponse:
1818
"""
1919
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/constants/definitions/list-ap-l-esl-versions
2020
@@ -28,7 +28,8 @@ def listApLEslVersions(mist_session:_APISession) -> _APIResponse:
2828
mistapi.APIResponse
2929
response from the API call
3030
"""
31-
uri = f"/api/v1/const/ap_esl_versions"
32-
query_params:dict[str, str]={}
31+
32+
uri = "/api/v1/const/ap_esl_versions"
33+
query_params: dict[str, str] = {}
3334
resp = mist_session.mist_get(uri=uri, query=query_params)
3435
return resp

src/mistapi/api/v1/const/ap_led_status.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'''
1+
"""
22
--------------------------------------------------------------------------------
33
------------------------- Mist API Python CLI Session --------------------------
44
@@ -8,13 +8,13 @@
88
This package is licensed under the MIT License.
99
1010
--------------------------------------------------------------------------------
11-
'''
11+
"""
1212

1313
from mistapi import APISession as _APISession
1414
from mistapi.__api_response import APIResponse as _APIResponse
15-
import deprecation
1615

17-
def listApLedDefinition(mist_session:_APISession) -> _APIResponse:
16+
17+
def listApLedDefinition(mist_session: _APISession) -> _APIResponse:
1818
"""
1919
API doc: https://www.juniper.net/documentation/us/en/software/mist/api/http/api/constants/definitions/list-ap-led-definition
2020
@@ -28,7 +28,8 @@ def listApLedDefinition(mist_session:_APISession) -> _APIResponse:
2828
mistapi.APIResponse
2929
response from the API call
3030
"""
31-
uri = f"/api/v1/const/ap_led_status"
32-
query_params:dict[str, str]={}
31+
32+
uri = "/api/v1/const/ap_led_status"
33+
query_params: dict[str, str] = {}
3334
resp = mist_session.mist_get(uri=uri, query=query_params)
3435
return resp

0 commit comments

Comments
 (0)