zrok2-build-debugging 22.0.2000008__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. test/__init__.py +0 -0
  2. test/test_access201_response.py +52 -0
  3. test/test_access_request.py +54 -0
  4. test/test_access_summary.py +60 -0
  5. test/test_accesses_list.py +63 -0
  6. test/test_account_api.py +79 -0
  7. test/test_add_frontend_grant_request.py +52 -0
  8. test/test_add_namespace_frontend_mapping_request.py +53 -0
  9. test/test_add_namespace_grant_request.py +52 -0
  10. test/test_add_organization_member_request.py +53 -0
  11. test/test_admin_api.py +199 -0
  12. test/test_agent_api.py +85 -0
  13. test/test_auth_user.py +52 -0
  14. test/test_change_password_request.py +53 -0
  15. test/test_client_version_check_request.py +51 -0
  16. test/test_configuration.py +56 -0
  17. test/test_create_frontend201_response.py +51 -0
  18. test/test_create_frontend_request.py +55 -0
  19. test/test_create_identity201_response.py +52 -0
  20. test/test_create_identity_request.py +51 -0
  21. test/test_create_namespace201_response.py +51 -0
  22. test/test_create_namespace_request.py +54 -0
  23. test/test_create_organization201_response.py +51 -0
  24. test/test_create_organization_request.py +51 -0
  25. test/test_create_share_name_request.py +52 -0
  26. test/test_delete_identity_request.py +51 -0
  27. test/test_disable_request.py +51 -0
  28. test/test_enable_request.py +52 -0
  29. test/test_enroll200_response.py +51 -0
  30. test/test_enroll_request.py +51 -0
  31. test/test_environment.py +63 -0
  32. test/test_environment_and_resources.py +96 -0
  33. test/test_environment_api.py +43 -0
  34. test/test_environment_summary.py +60 -0
  35. test/test_environments_list.py +63 -0
  36. test/test_frontend.py +59 -0
  37. test/test_get_sparklines200_response.py +62 -0
  38. test/test_get_sparklines_request.py +57 -0
  39. test/test_invite_request.py +52 -0
  40. test/test_invite_token_generate_request.py +53 -0
  41. test/test_list_frontend_namespace_mappings200_response_inner.py +54 -0
  42. test/test_list_frontends200_response_inner.py +58 -0
  43. test/test_list_memberships200_response.py +56 -0
  44. test/test_list_memberships200_response_memberships_inner.py +53 -0
  45. test/test_list_namespaces200_response_inner.py +56 -0
  46. test/test_list_organization_members200_response.py +55 -0
  47. test/test_list_organization_members200_response_members_inner.py +52 -0
  48. test/test_list_organizations200_response.py +55 -0
  49. test/test_list_organizations200_response_organizations_inner.py +52 -0
  50. test/test_list_share_namespaces200_response_inner.py +53 -0
  51. test/test_login_request.py +52 -0
  52. test/test_metadata_api.py +145 -0
  53. test/test_metrics.py +59 -0
  54. test/test_metrics_sample.py +53 -0
  55. test/test_name.py +56 -0
  56. test/test_name_selection.py +52 -0
  57. test/test_overview.py +110 -0
  58. test/test_overview_names_inner.py +56 -0
  59. test/test_ping200_response.py +51 -0
  60. test/test_principal.py +55 -0
  61. test/test_regenerate_account_token200_response.py +51 -0
  62. test/test_regenerate_account_token_request.py +51 -0
  63. test/test_register_request.py +52 -0
  64. test/test_remote_access_request.py +60 -0
  65. test/test_remote_share200_response.py +54 -0
  66. test/test_remote_share_request.py +74 -0
  67. test/test_remote_status200_response.py +82 -0
  68. test/test_remote_status200_response_accesses_inner.py +62 -0
  69. test/test_remote_status200_response_shares_inner.py +64 -0
  70. test/test_remote_status200_response_shares_inner_failure.py +54 -0
  71. test/test_remote_unaccess_request.py +52 -0
  72. test/test_remote_unshare_request.py +52 -0
  73. test/test_remove_namespace_frontend_mapping_request.py +52 -0
  74. test/test_remove_organization_member_request.py +52 -0
  75. test/test_reset_password_request.py +52 -0
  76. test/test_share.py +67 -0
  77. test/test_share_api.py +103 -0
  78. test/test_share_http_healthcheck200_response.py +52 -0
  79. test/test_share_http_healthcheck_request.py +56 -0
  80. test/test_share_request.py +75 -0
  81. test/test_share_response.py +54 -0
  82. test/test_share_summary.py +62 -0
  83. test/test_shares_list.py +65 -0
  84. test/test_spark_data_sample.py +52 -0
  85. test/test_unaccess_request.py +53 -0
  86. test/test_unshare_request.py +52 -0
  87. test/test_update_access_request.py +53 -0
  88. test/test_update_frontend_request.py +55 -0
  89. test/test_update_namespace_request.py +55 -0
  90. test/test_update_share_name_request.py +53 -0
  91. test/test_update_share_request.py +57 -0
  92. test/test_verify200_response.py +51 -0
  93. test/test_verify_request.py +51 -0
  94. test/test_version_inventory200_response.py +51 -0
  95. zrok/__init__.py +4 -0
  96. zrok/_version.py +21 -0
  97. zrok/access.py +58 -0
  98. zrok/decor.py +33 -0
  99. zrok/dialer.py +10 -0
  100. zrok/environment/__init__.py +1 -0
  101. zrok/environment/dirs.py +32 -0
  102. zrok/environment/root.py +182 -0
  103. zrok/listener.py +29 -0
  104. zrok/model.py +75 -0
  105. zrok/overview.py +77 -0
  106. zrok/proxy.py +203 -0
  107. zrok/share.py +199 -0
  108. zrok2_build_debugging-22.0.2000008.dist-info/METADATA +24 -0
  109. zrok2_build_debugging-22.0.2000008.dist-info/RECORD +213 -0
  110. zrok2_build_debugging-22.0.2000008.dist-info/WHEEL +5 -0
  111. zrok2_build_debugging-22.0.2000008.dist-info/top_level.txt +3 -0
  112. zrok_api/__init__.py +231 -0
  113. zrok_api/api/__init__.py +10 -0
  114. zrok_api/api/account_api.py +2261 -0
  115. zrok_api/api/admin_api.py +7673 -0
  116. zrok_api/api/agent_api.py +2547 -0
  117. zrok_api/api/environment_api.py +589 -0
  118. zrok_api/api/metadata_api.py +5614 -0
  119. zrok_api/api/share_api.py +3321 -0
  120. zrok_api/api_client.py +801 -0
  121. zrok_api/api_response.py +21 -0
  122. zrok_api/configuration.py +602 -0
  123. zrok_api/exceptions.py +216 -0
  124. zrok_api/models/__init__.py +103 -0
  125. zrok_api/models/access201_response.py +89 -0
  126. zrok_api/models/access_request.py +93 -0
  127. zrok_api/models/access_summary.py +105 -0
  128. zrok_api/models/accesses_list.py +95 -0
  129. zrok_api/models/add_frontend_grant_request.py +89 -0
  130. zrok_api/models/add_namespace_frontend_mapping_request.py +91 -0
  131. zrok_api/models/add_namespace_grant_request.py +89 -0
  132. zrok_api/models/add_organization_member_request.py +91 -0
  133. zrok_api/models/auth_user.py +89 -0
  134. zrok_api/models/change_password_request.py +91 -0
  135. zrok_api/models/client_version_check_request.py +87 -0
  136. zrok_api/models/configuration.py +97 -0
  137. zrok_api/models/create_frontend201_response.py +87 -0
  138. zrok_api/models/create_frontend_request.py +105 -0
  139. zrok_api/models/create_identity201_response.py +89 -0
  140. zrok_api/models/create_identity_request.py +87 -0
  141. zrok_api/models/create_namespace201_response.py +87 -0
  142. zrok_api/models/create_namespace_request.py +93 -0
  143. zrok_api/models/create_organization201_response.py +87 -0
  144. zrok_api/models/create_organization_request.py +87 -0
  145. zrok_api/models/create_share_name_request.py +89 -0
  146. zrok_api/models/delete_identity_request.py +87 -0
  147. zrok_api/models/disable_request.py +87 -0
  148. zrok_api/models/enable_request.py +89 -0
  149. zrok_api/models/enroll200_response.py +87 -0
  150. zrok_api/models/enroll_request.py +87 -0
  151. zrok_api/models/environment.py +111 -0
  152. zrok_api/models/environment_and_resources.py +111 -0
  153. zrok_api/models/environment_summary.py +105 -0
  154. zrok_api/models/environments_list.py +95 -0
  155. zrok_api/models/frontend.py +103 -0
  156. zrok_api/models/get_sparklines200_response.py +95 -0
  157. zrok_api/models/get_sparklines_request.py +91 -0
  158. zrok_api/models/invite_request.py +89 -0
  159. zrok_api/models/invite_token_generate_request.py +87 -0
  160. zrok_api/models/list_frontend_namespace_mappings200_response_inner.py +93 -0
  161. zrok_api/models/list_frontends200_response_inner.py +101 -0
  162. zrok_api/models/list_memberships200_response.py +95 -0
  163. zrok_api/models/list_memberships200_response_memberships_inner.py +91 -0
  164. zrok_api/models/list_namespaces200_response_inner.py +97 -0
  165. zrok_api/models/list_organization_members200_response.py +95 -0
  166. zrok_api/models/list_organization_members200_response_members_inner.py +89 -0
  167. zrok_api/models/list_organizations200_response.py +95 -0
  168. zrok_api/models/list_organizations200_response_organizations_inner.py +89 -0
  169. zrok_api/models/list_share_namespaces200_response_inner.py +91 -0
  170. zrok_api/models/login_request.py +89 -0
  171. zrok_api/models/metrics.py +101 -0
  172. zrok_api/models/metrics_sample.py +91 -0
  173. zrok_api/models/name.py +97 -0
  174. zrok_api/models/name_selection.py +89 -0
  175. zrok_api/models/overview.py +117 -0
  176. zrok_api/models/overview_names_inner.py +97 -0
  177. zrok_api/models/ping200_response.py +87 -0
  178. zrok_api/models/principal.py +95 -0
  179. zrok_api/models/regenerate_account_token200_response.py +87 -0
  180. zrok_api/models/regenerate_account_token_request.py +87 -0
  181. zrok_api/models/register_request.py +89 -0
  182. zrok_api/models/remote_access_request.py +102 -0
  183. zrok_api/models/remote_share200_response.py +89 -0
  184. zrok_api/models/remote_share_request.py +141 -0
  185. zrok_api/models/remote_status200_response.py +105 -0
  186. zrok_api/models/remote_status200_response_accesses_inner.py +101 -0
  187. zrok_api/models/remote_status200_response_shares_inner.py +105 -0
  188. zrok_api/models/remote_status200_response_shares_inner_failure.py +93 -0
  189. zrok_api/models/remote_unaccess_request.py +89 -0
  190. zrok_api/models/remote_unshare_request.py +89 -0
  191. zrok_api/models/remove_namespace_frontend_mapping_request.py +89 -0
  192. zrok_api/models/remove_organization_member_request.py +89 -0
  193. zrok_api/models/reset_password_request.py +89 -0
  194. zrok_api/models/share.py +115 -0
  195. zrok_api/models/share_http_healthcheck200_response.py +89 -0
  196. zrok_api/models/share_http_healthcheck_request.py +97 -0
  197. zrok_api/models/share_request.py +157 -0
  198. zrok_api/models/share_response.py +89 -0
  199. zrok_api/models/share_summary.py +105 -0
  200. zrok_api/models/shares_list.py +95 -0
  201. zrok_api/models/spark_data_sample.py +89 -0
  202. zrok_api/models/unaccess_request.py +91 -0
  203. zrok_api/models/unshare_request.py +89 -0
  204. zrok_api/models/update_access_request.py +91 -0
  205. zrok_api/models/update_frontend_request.py +95 -0
  206. zrok_api/models/update_namespace_request.py +95 -0
  207. zrok_api/models/update_share_name_request.py +91 -0
  208. zrok_api/models/update_share_request.py +91 -0
  209. zrok_api/models/verify200_response.py +87 -0
  210. zrok_api/models/verify_request.py +87 -0
  211. zrok_api/models/version_inventory200_response.py +87 -0
  212. zrok_api/py.typed +0 -0
  213. zrok_api/rest.py +258 -0
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ zrok
5
+
6
+ zrok client access
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class Enroll200Response(BaseModel):
26
+ """
27
+ Enroll200Response
28
+ """ # noqa: E501
29
+ token: Optional[StrictStr] = None
30
+ __properties: ClassVar[List[str]] = ["token"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of Enroll200Response from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of Enroll200Response from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "token": obj.get("token")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ zrok
5
+
6
+ zrok client access
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class EnrollRequest(BaseModel):
26
+ """
27
+ EnrollRequest
28
+ """ # noqa: E501
29
+ env_zid: Optional[StrictStr] = Field(default=None, alias="envZId")
30
+ __properties: ClassVar[List[str]] = ["envZId"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of EnrollRequest from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of EnrollRequest from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "envZId": obj.get("envZId")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,111 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ zrok
5
+
6
+ zrok client access
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from zrok_api.models.spark_data_sample import SparkDataSample
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class Environment(BaseModel):
27
+ """
28
+ Environment
29
+ """ # noqa: E501
30
+ description: Optional[StrictStr] = None
31
+ host: Optional[StrictStr] = None
32
+ address: Optional[StrictStr] = None
33
+ z_id: Optional[StrictStr] = Field(default=None, alias="zId")
34
+ remote_agent: Optional[StrictBool] = Field(default=None, alias="remoteAgent")
35
+ activity: Optional[List[SparkDataSample]] = None
36
+ limited: Optional[StrictBool] = None
37
+ created_at: Optional[StrictInt] = Field(default=None, alias="createdAt")
38
+ updated_at: Optional[StrictInt] = Field(default=None, alias="updatedAt")
39
+ __properties: ClassVar[List[str]] = ["description", "host", "address", "zId", "remoteAgent", "activity", "limited", "createdAt", "updatedAt"]
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55
+ return json.dumps(self.to_dict())
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> Optional[Self]:
59
+ """Create an instance of Environment from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self) -> Dict[str, Any]:
63
+ """Return the dictionary representation of the model using alias.
64
+
65
+ This has the following differences from calling pydantic's
66
+ `self.model_dump(by_alias=True)`:
67
+
68
+ * `None` is only added to the output dict for nullable fields that
69
+ were set at model initialization. Other fields with value `None`
70
+ are ignored.
71
+ """
72
+ excluded_fields: Set[str] = set([
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ # override the default output from pydantic by calling `to_dict()` of each item in activity (list)
81
+ _items = []
82
+ if self.activity:
83
+ for _item_activity in self.activity:
84
+ if _item_activity:
85
+ _items.append(_item_activity.to_dict())
86
+ _dict['activity'] = _items
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
+ """Create an instance of Environment from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return cls.model_validate(obj)
97
+
98
+ _obj = cls.model_validate({
99
+ "description": obj.get("description"),
100
+ "host": obj.get("host"),
101
+ "address": obj.get("address"),
102
+ "zId": obj.get("zId"),
103
+ "remoteAgent": obj.get("remoteAgent"),
104
+ "activity": [SparkDataSample.from_dict(_item) for _item in obj["activity"]] if obj.get("activity") is not None else None,
105
+ "limited": obj.get("limited"),
106
+ "createdAt": obj.get("createdAt"),
107
+ "updatedAt": obj.get("updatedAt")
108
+ })
109
+ return _obj
110
+
111
+
@@ -0,0 +1,111 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ zrok
5
+
6
+ zrok client access
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from zrok_api.models.environment import Environment
23
+ from zrok_api.models.frontend import Frontend
24
+ from zrok_api.models.share import Share
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class EnvironmentAndResources(BaseModel):
29
+ """
30
+ EnvironmentAndResources
31
+ """ # noqa: E501
32
+ environment: Optional[Environment] = None
33
+ frontends: Optional[List[Frontend]] = None
34
+ shares: Optional[List[Share]] = None
35
+ __properties: ClassVar[List[str]] = ["environment", "frontends", "shares"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of EnvironmentAndResources from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # override the default output from pydantic by calling `to_dict()` of environment
77
+ if self.environment:
78
+ _dict['environment'] = self.environment.to_dict()
79
+ # override the default output from pydantic by calling `to_dict()` of each item in frontends (list)
80
+ _items = []
81
+ if self.frontends:
82
+ for _item_frontends in self.frontends:
83
+ if _item_frontends:
84
+ _items.append(_item_frontends.to_dict())
85
+ _dict['frontends'] = _items
86
+ # override the default output from pydantic by calling `to_dict()` of each item in shares (list)
87
+ _items = []
88
+ if self.shares:
89
+ for _item_shares in self.shares:
90
+ if _item_shares:
91
+ _items.append(_item_shares.to_dict())
92
+ _dict['shares'] = _items
93
+ return _dict
94
+
95
+ @classmethod
96
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97
+ """Create an instance of EnvironmentAndResources from a dict"""
98
+ if obj is None:
99
+ return None
100
+
101
+ if not isinstance(obj, dict):
102
+ return cls.model_validate(obj)
103
+
104
+ _obj = cls.model_validate({
105
+ "environment": Environment.from_dict(obj["environment"]) if obj.get("environment") is not None else None,
106
+ "frontends": [Frontend.from_dict(_item) for _item in obj["frontends"]] if obj.get("frontends") is not None else None,
107
+ "shares": [Share.from_dict(_item) for _item in obj["shares"]] if obj.get("shares") is not None else None
108
+ })
109
+ return _obj
110
+
111
+
@@ -0,0 +1,105 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ zrok
5
+
6
+ zrok client access
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class EnvironmentSummary(BaseModel):
26
+ """
27
+ EnvironmentSummary
28
+ """ # noqa: E501
29
+ env_zid: Optional[StrictStr] = Field(default=None, alias="envZId")
30
+ description: Optional[StrictStr] = None
31
+ host: Optional[StrictStr] = None
32
+ address: Optional[StrictStr] = None
33
+ remote_agent: Optional[StrictBool] = Field(default=None, alias="remoteAgent")
34
+ share_count: Optional[StrictInt] = Field(default=None, alias="shareCount")
35
+ access_count: Optional[StrictInt] = Field(default=None, alias="accessCount")
36
+ limited: Optional[StrictBool] = None
37
+ created_at: Optional[StrictInt] = Field(default=None, alias="createdAt")
38
+ updated_at: Optional[StrictInt] = Field(default=None, alias="updatedAt")
39
+ __properties: ClassVar[List[str]] = ["envZId", "description", "host", "address", "remoteAgent", "shareCount", "accessCount", "limited", "createdAt", "updatedAt"]
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55
+ return json.dumps(self.to_dict())
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> Optional[Self]:
59
+ """Create an instance of EnvironmentSummary from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self) -> Dict[str, Any]:
63
+ """Return the dictionary representation of the model using alias.
64
+
65
+ This has the following differences from calling pydantic's
66
+ `self.model_dump(by_alias=True)`:
67
+
68
+ * `None` is only added to the output dict for nullable fields that
69
+ were set at model initialization. Other fields with value `None`
70
+ are ignored.
71
+ """
72
+ excluded_fields: Set[str] = set([
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of EnvironmentSummary from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "envZId": obj.get("envZId"),
93
+ "description": obj.get("description"),
94
+ "host": obj.get("host"),
95
+ "address": obj.get("address"),
96
+ "remoteAgent": obj.get("remoteAgent"),
97
+ "shareCount": obj.get("shareCount"),
98
+ "accessCount": obj.get("accessCount"),
99
+ "limited": obj.get("limited"),
100
+ "createdAt": obj.get("createdAt"),
101
+ "updatedAt": obj.get("updatedAt")
102
+ })
103
+ return _obj
104
+
105
+
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ zrok
5
+
6
+ zrok client access
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from zrok_api.models.environment_summary import EnvironmentSummary
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class EnvironmentsList(BaseModel):
27
+ """
28
+ EnvironmentsList
29
+ """ # noqa: E501
30
+ environments: Optional[List[EnvironmentSummary]] = None
31
+ __properties: ClassVar[List[str]] = ["environments"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of EnvironmentsList from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in environments (list)
73
+ _items = []
74
+ if self.environments:
75
+ for _item_environments in self.environments:
76
+ if _item_environments:
77
+ _items.append(_item_environments.to_dict())
78
+ _dict['environments'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of EnvironmentsList from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "environments": [EnvironmentSummary.from_dict(_item) for _item in obj["environments"]] if obj.get("environments") is not None else None
92
+ })
93
+ return _obj
94
+
95
+