thousandeyes-sdk-instant-tests 1.0.0__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.
- thousandeyes_sdk/instant_tests/__init__.py +117 -0
- thousandeyes_sdk/instant_tests/api/__init__.py +17 -0
- thousandeyes_sdk/instant_tests/api/agent_to_agent_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/agent_to_server_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/api_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/dns_security_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/dns_server_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/dns_trace_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/ftp_server_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/http_page_load_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/http_server_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/run_api.py +338 -0
- thousandeyes_sdk/instant_tests/api/sip_server_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/voice_api.py +376 -0
- thousandeyes_sdk/instant_tests/api/web_transaction_api.py +376 -0
- thousandeyes_sdk/instant_tests/models/__init__.py +100 -0
- thousandeyes_sdk/instant_tests/models/agent.py +125 -0
- thousandeyes_sdk/instant_tests/models/agent_base.py +98 -0
- thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test.py +198 -0
- thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test_request.py +176 -0
- thousandeyes_sdk/instant_tests/models/agent_to_agent_properties.py +123 -0
- thousandeyes_sdk/instant_tests/models/agent_to_agent_test_protocol.py +37 -0
- thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test.py +203 -0
- thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test_request.py +181 -0
- thousandeyes_sdk/instant_tests/models/agent_to_server_properties.py +128 -0
- thousandeyes_sdk/instant_tests/models/api_instant_test.py +214 -0
- thousandeyes_sdk/instant_tests/models/api_instant_test_request.py +192 -0
- thousandeyes_sdk/instant_tests/models/api_predefined_variable.py +90 -0
- thousandeyes_sdk/instant_tests/models/api_properties.py +137 -0
- thousandeyes_sdk/instant_tests/models/api_request.py +138 -0
- thousandeyes_sdk/instant_tests/models/api_request_assertion.py +94 -0
- thousandeyes_sdk/instant_tests/models/api_request_assertion_name.py +37 -0
- thousandeyes_sdk/instant_tests/models/api_request_assertion_operator.py +39 -0
- thousandeyes_sdk/instant_tests/models/api_request_auth_type.py +38 -0
- thousandeyes_sdk/instant_tests/models/api_request_header.py +90 -0
- thousandeyes_sdk/instant_tests/models/api_request_method.py +40 -0
- thousandeyes_sdk/instant_tests/models/api_request_variable.py +90 -0
- thousandeyes_sdk/instant_tests/models/cloud_enterprise_agent_type.py +38 -0
- thousandeyes_sdk/instant_tests/models/dns_query_class.py +37 -0
- thousandeyes_sdk/instant_tests/models/dns_sec_instant_test.py +170 -0
- thousandeyes_sdk/instant_tests/models/dns_sec_instant_test_request.py +148 -0
- thousandeyes_sdk/instant_tests/models/dns_sec_properties.py +95 -0
- thousandeyes_sdk/instant_tests/models/dns_server_instant_test.py +208 -0
- thousandeyes_sdk/instant_tests/models/dns_server_instant_test_request.py +178 -0
- thousandeyes_sdk/instant_tests/models/dns_server_properties.py +133 -0
- thousandeyes_sdk/instant_tests/models/dns_servers_request.py +88 -0
- thousandeyes_sdk/instant_tests/models/dns_trace_instant_test.py +173 -0
- thousandeyes_sdk/instant_tests/models/dns_trace_instant_test_request.py +151 -0
- thousandeyes_sdk/instant_tests/models/dns_trace_properties.py +98 -0
- thousandeyes_sdk/instant_tests/models/error.py +96 -0
- thousandeyes_sdk/instant_tests/models/expand.py +38 -0
- thousandeyes_sdk/instant_tests/models/ftp_server_instant_test.py +207 -0
- thousandeyes_sdk/instant_tests/models/ftp_server_properties.py +132 -0
- thousandeyes_sdk/instant_tests/models/ftp_server_request_type.py +38 -0
- thousandeyes_sdk/instant_tests/models/http_server_instant_test.py +246 -0
- thousandeyes_sdk/instant_tests/models/http_server_instant_test_request.py +224 -0
- thousandeyes_sdk/instant_tests/models/http_server_properties.py +171 -0
- thousandeyes_sdk/instant_tests/models/instant_test.py +152 -0
- thousandeyes_sdk/instant_tests/models/instant_test_request.py +100 -0
- thousandeyes_sdk/instant_tests/models/link.py +102 -0
- thousandeyes_sdk/instant_tests/models/page_load_instant_test.py +254 -0
- thousandeyes_sdk/instant_tests/models/page_load_instant_test_request.py +232 -0
- thousandeyes_sdk/instant_tests/models/page_load_properties.py +179 -0
- thousandeyes_sdk/instant_tests/models/server_instant_test_request.py +185 -0
- thousandeyes_sdk/instant_tests/models/shared_with_account.py +90 -0
- thousandeyes_sdk/instant_tests/models/simple_agent.py +122 -0
- thousandeyes_sdk/instant_tests/models/sip_server_instant_test.py +191 -0
- thousandeyes_sdk/instant_tests/models/sip_server_instant_test_request.py +175 -0
- thousandeyes_sdk/instant_tests/models/sip_server_instant_test_request1.py +197 -0
- thousandeyes_sdk/instant_tests/models/sip_server_instant_test_response.py +204 -0
- thousandeyes_sdk/instant_tests/models/sip_server_properties.py +116 -0
- thousandeyes_sdk/instant_tests/models/sip_test_protocol.py +38 -0
- thousandeyes_sdk/instant_tests/models/test_agent.py +90 -0
- thousandeyes_sdk/instant_tests/models/test_auth_type.py +40 -0
- thousandeyes_sdk/instant_tests/models/test_custom_headers.py +92 -0
- thousandeyes_sdk/instant_tests/models/test_direction.py +38 -0
- thousandeyes_sdk/instant_tests/models/test_dns_server.py +90 -0
- thousandeyes_sdk/instant_tests/models/test_dns_transport_protocol.py +37 -0
- thousandeyes_sdk/instant_tests/models/test_dscp_id.py +57 -0
- thousandeyes_sdk/instant_tests/models/test_ipv6_policy.py +39 -0
- thousandeyes_sdk/instant_tests/models/test_label.py +92 -0
- thousandeyes_sdk/instant_tests/models/test_links.py +102 -0
- thousandeyes_sdk/instant_tests/models/test_page_loading_strategy.py +38 -0
- thousandeyes_sdk/instant_tests/models/test_path_trace_mode.py +37 -0
- thousandeyes_sdk/instant_tests/models/test_probe_mode.py +38 -0
- thousandeyes_sdk/instant_tests/models/test_protocol.py +38 -0
- thousandeyes_sdk/instant_tests/models/test_self_link.py +102 -0
- thousandeyes_sdk/instant_tests/models/test_sip_credentials.py +100 -0
- thousandeyes_sdk/instant_tests/models/test_ssl_version_id.py +40 -0
- thousandeyes_sdk/instant_tests/models/test_type.py +48 -0
- thousandeyes_sdk/instant_tests/models/unauthorized_error.py +90 -0
- thousandeyes_sdk/instant_tests/models/unexpanded_instant_test.py +128 -0
- thousandeyes_sdk/instant_tests/models/validation_error.py +111 -0
- thousandeyes_sdk/instant_tests/models/validation_error_item.py +92 -0
- thousandeyes_sdk/instant_tests/models/voice_instant_test.py +189 -0
- thousandeyes_sdk/instant_tests/models/voice_instant_test_request.py +167 -0
- thousandeyes_sdk/instant_tests/models/voice_properties.py +114 -0
- thousandeyes_sdk/instant_tests/models/web_transaction_instant_test.py +258 -0
- thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_request.py +236 -0
- thousandeyes_sdk/instant_tests/models/web_transaction_properties.py +181 -0
- thousandeyes_sdk/instant_tests/py.typed +0 -0
- thousandeyes_sdk_instant_tests-1.0.0.dist-info/LICENSE +176 -0
- thousandeyes_sdk_instant_tests-1.0.0.dist-info/METADATA +423 -0
- thousandeyes_sdk_instant_tests-1.0.0.dist-info/NOTICE +7 -0
- thousandeyes_sdk_instant_tests-1.0.0.dist-info/RECORD +107 -0
- thousandeyes_sdk_instant_tests-1.0.0.dist-info/WHEEL +5 -0
- thousandeyes_sdk_instant_tests-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,214 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Instant Tests API
|
5
|
+
|
6
|
+
The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 7.0.8
|
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 datetime import datetime
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing_extensions import Annotated
|
24
|
+
from thousandeyes_sdk.instant_tests.models.agent import Agent
|
25
|
+
from thousandeyes_sdk.instant_tests.models.api_predefined_variable import ApiPredefinedVariable
|
26
|
+
from thousandeyes_sdk.instant_tests.models.api_request import ApiRequest
|
27
|
+
from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount
|
28
|
+
from thousandeyes_sdk.instant_tests.models.test_label import TestLabel
|
29
|
+
from thousandeyes_sdk.instant_tests.models.test_links import TestLinks
|
30
|
+
from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode
|
31
|
+
from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode
|
32
|
+
from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol
|
33
|
+
from thousandeyes_sdk.instant_tests.models.test_ssl_version_id import TestSslVersionId
|
34
|
+
from typing import Optional, Set
|
35
|
+
from typing_extensions import Self
|
36
|
+
|
37
|
+
class ApiInstantTest(BaseModel):
|
38
|
+
"""
|
39
|
+
ApiInstantTest
|
40
|
+
""" # noqa: E501
|
41
|
+
created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
|
42
|
+
created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
|
43
|
+
description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
|
44
|
+
live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
|
45
|
+
modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
|
46
|
+
modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
|
47
|
+
saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
|
48
|
+
test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId")
|
49
|
+
test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
|
50
|
+
type: Optional[StrictStr] = None
|
51
|
+
links: Optional[TestLinks] = Field(default=None, alias="_links")
|
52
|
+
labels: Optional[List[TestLabel]] = None
|
53
|
+
shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts")
|
54
|
+
follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects")
|
55
|
+
mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements")
|
56
|
+
network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements")
|
57
|
+
num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces")
|
58
|
+
path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
|
59
|
+
predefined_variables: Optional[List[ApiPredefinedVariable]] = Field(default=None, alias="predefinedVariables")
|
60
|
+
probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode")
|
61
|
+
protocol: Optional[TestProtocol] = None
|
62
|
+
requests: List[ApiRequest]
|
63
|
+
ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId")
|
64
|
+
target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior)", alias="targetTime")
|
65
|
+
time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.", alias="timeLimit")
|
66
|
+
url: StrictStr = Field(description="Target for the test.")
|
67
|
+
agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.")
|
68
|
+
credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).")
|
69
|
+
__properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "agents", "credentials"]
|
70
|
+
|
71
|
+
model_config = ConfigDict(
|
72
|
+
populate_by_name=True,
|
73
|
+
validate_assignment=True,
|
74
|
+
protected_namespaces=(),
|
75
|
+
extra="allow",
|
76
|
+
)
|
77
|
+
|
78
|
+
|
79
|
+
def to_str(self) -> str:
|
80
|
+
"""Returns the string representation of the model using alias"""
|
81
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
82
|
+
|
83
|
+
def to_json(self) -> str:
|
84
|
+
"""Returns the JSON representation of the model using alias"""
|
85
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
86
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
|
87
|
+
|
88
|
+
@classmethod
|
89
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
90
|
+
"""Create an instance of ApiInstantTest from a JSON string"""
|
91
|
+
return cls.from_dict(json.loads(json_str))
|
92
|
+
|
93
|
+
def to_dict(self) -> Dict[str, Any]:
|
94
|
+
"""Return the dictionary representation of the model using alias.
|
95
|
+
|
96
|
+
This has the following differences from calling pydantic's
|
97
|
+
`self.model_dump(by_alias=True)`:
|
98
|
+
|
99
|
+
* `None` is only added to the output dict for nullable fields that
|
100
|
+
were set at model initialization. Other fields with value `None`
|
101
|
+
are ignored.
|
102
|
+
* OpenAPI `readOnly` fields are excluded.
|
103
|
+
* OpenAPI `readOnly` fields are excluded.
|
104
|
+
* OpenAPI `readOnly` fields are excluded.
|
105
|
+
* OpenAPI `readOnly` fields are excluded.
|
106
|
+
* OpenAPI `readOnly` fields are excluded.
|
107
|
+
* OpenAPI `readOnly` fields are excluded.
|
108
|
+
* OpenAPI `readOnly` fields are excluded.
|
109
|
+
* OpenAPI `readOnly` fields are excluded.
|
110
|
+
* OpenAPI `readOnly` fields are excluded.
|
111
|
+
* OpenAPI `readOnly` fields are excluded.
|
112
|
+
* OpenAPI `readOnly` fields are excluded.
|
113
|
+
"""
|
114
|
+
excluded_fields: Set[str] = set([
|
115
|
+
"created_by",
|
116
|
+
"created_date",
|
117
|
+
"live_share",
|
118
|
+
"modified_by",
|
119
|
+
"modified_date",
|
120
|
+
"saved_event",
|
121
|
+
"test_id",
|
122
|
+
"type",
|
123
|
+
"labels",
|
124
|
+
"shared_with_accounts",
|
125
|
+
"agents",
|
126
|
+
])
|
127
|
+
|
128
|
+
_dict = self.model_dump(
|
129
|
+
by_alias=True,
|
130
|
+
exclude=excluded_fields,
|
131
|
+
exclude_none=True,
|
132
|
+
)
|
133
|
+
# override the default output from pydantic by calling `to_dict()` of links
|
134
|
+
if self.links:
|
135
|
+
_dict['_links'] = self.links.to_dict()
|
136
|
+
# override the default output from pydantic by calling `to_dict()` of each item in labels (list)
|
137
|
+
_items = []
|
138
|
+
if self.labels:
|
139
|
+
for _item in self.labels:
|
140
|
+
if _item:
|
141
|
+
_items.append(_item.to_dict())
|
142
|
+
_dict['labels'] = _items
|
143
|
+
# override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list)
|
144
|
+
_items = []
|
145
|
+
if self.shared_with_accounts:
|
146
|
+
for _item in self.shared_with_accounts:
|
147
|
+
if _item:
|
148
|
+
_items.append(_item.to_dict())
|
149
|
+
_dict['sharedWithAccounts'] = _items
|
150
|
+
# override the default output from pydantic by calling `to_dict()` of each item in predefined_variables (list)
|
151
|
+
_items = []
|
152
|
+
if self.predefined_variables:
|
153
|
+
for _item in self.predefined_variables:
|
154
|
+
if _item:
|
155
|
+
_items.append(_item.to_dict())
|
156
|
+
_dict['predefinedVariables'] = _items
|
157
|
+
# override the default output from pydantic by calling `to_dict()` of each item in requests (list)
|
158
|
+
_items = []
|
159
|
+
if self.requests:
|
160
|
+
for _item in self.requests:
|
161
|
+
if _item:
|
162
|
+
_items.append(_item.to_dict())
|
163
|
+
_dict['requests'] = _items
|
164
|
+
# override the default output from pydantic by calling `to_dict()` of each item in agents (list)
|
165
|
+
_items = []
|
166
|
+
if self.agents:
|
167
|
+
for _item in self.agents:
|
168
|
+
if _item:
|
169
|
+
_items.append(_item.to_dict())
|
170
|
+
_dict['agents'] = _items
|
171
|
+
return _dict
|
172
|
+
|
173
|
+
@classmethod
|
174
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
175
|
+
"""Create an instance of ApiInstantTest from a dict"""
|
176
|
+
if obj is None:
|
177
|
+
return None
|
178
|
+
|
179
|
+
if not isinstance(obj, dict):
|
180
|
+
return cls.model_validate(obj)
|
181
|
+
|
182
|
+
_obj = cls.model_validate({
|
183
|
+
"createdBy": obj.get("createdBy"),
|
184
|
+
"createdDate": obj.get("createdDate"),
|
185
|
+
"description": obj.get("description"),
|
186
|
+
"liveShare": obj.get("liveShare"),
|
187
|
+
"modifiedBy": obj.get("modifiedBy"),
|
188
|
+
"modifiedDate": obj.get("modifiedDate"),
|
189
|
+
"savedEvent": obj.get("savedEvent"),
|
190
|
+
"testId": obj.get("testId"),
|
191
|
+
"testName": obj.get("testName"),
|
192
|
+
"type": obj.get("type"),
|
193
|
+
"_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
|
194
|
+
"labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None,
|
195
|
+
"sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None,
|
196
|
+
"followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True,
|
197
|
+
"mtuMeasurements": obj.get("mtuMeasurements"),
|
198
|
+
"networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True,
|
199
|
+
"numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
|
200
|
+
"pathTraceMode": obj.get("pathTraceMode"),
|
201
|
+
"predefinedVariables": [ApiPredefinedVariable.from_dict(_item) for _item in obj["predefinedVariables"]] if obj.get("predefinedVariables") is not None else None,
|
202
|
+
"probeMode": obj.get("probeMode"),
|
203
|
+
"protocol": obj.get("protocol"),
|
204
|
+
"requests": [ApiRequest.from_dict(_item) for _item in obj["requests"]] if obj.get("requests") is not None else None,
|
205
|
+
"sslVersionId": obj.get("sslVersionId"),
|
206
|
+
"targetTime": obj.get("targetTime"),
|
207
|
+
"timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30,
|
208
|
+
"url": obj.get("url"),
|
209
|
+
"agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None,
|
210
|
+
"credentials": obj.get("credentials")
|
211
|
+
})
|
212
|
+
return _obj
|
213
|
+
|
214
|
+
|
@@ -0,0 +1,192 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Instant Tests API
|
5
|
+
|
6
|
+
The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 7.0.8
|
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 datetime import datetime
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing_extensions import Annotated
|
24
|
+
from thousandeyes_sdk.instant_tests.models.api_predefined_variable import ApiPredefinedVariable
|
25
|
+
from thousandeyes_sdk.instant_tests.models.api_request import ApiRequest
|
26
|
+
from thousandeyes_sdk.instant_tests.models.test_agent import TestAgent
|
27
|
+
from thousandeyes_sdk.instant_tests.models.test_links import TestLinks
|
28
|
+
from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode
|
29
|
+
from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode
|
30
|
+
from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol
|
31
|
+
from thousandeyes_sdk.instant_tests.models.test_ssl_version_id import TestSslVersionId
|
32
|
+
from typing import Optional, Set
|
33
|
+
from typing_extensions import Self
|
34
|
+
|
35
|
+
class ApiInstantTestRequest(BaseModel):
|
36
|
+
"""
|
37
|
+
ApiInstantTestRequest
|
38
|
+
""" # noqa: E501
|
39
|
+
created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
|
40
|
+
created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
|
41
|
+
description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
|
42
|
+
live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
|
43
|
+
modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
|
44
|
+
modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
|
45
|
+
saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
|
46
|
+
test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId")
|
47
|
+
test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
|
48
|
+
type: Optional[StrictStr] = None
|
49
|
+
links: Optional[TestLinks] = Field(default=None, alias="_links")
|
50
|
+
labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).")
|
51
|
+
shared_with_accounts: Optional[List[StrictStr]] = Field(default=None, description="A list of account group identifiers that the test is shared with (get `aid` from `/account-groups` endpoint).", alias="sharedWithAccounts")
|
52
|
+
follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects")
|
53
|
+
mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements")
|
54
|
+
network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements")
|
55
|
+
num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces")
|
56
|
+
path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
|
57
|
+
predefined_variables: Optional[List[ApiPredefinedVariable]] = Field(default=None, alias="predefinedVariables")
|
58
|
+
probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode")
|
59
|
+
protocol: Optional[TestProtocol] = None
|
60
|
+
requests: List[ApiRequest]
|
61
|
+
ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId")
|
62
|
+
target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior)", alias="targetTime")
|
63
|
+
time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.", alias="timeLimit")
|
64
|
+
url: StrictStr = Field(description="Target for the test.")
|
65
|
+
agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).")
|
66
|
+
credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).")
|
67
|
+
__properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "agents", "credentials"]
|
68
|
+
|
69
|
+
model_config = ConfigDict(
|
70
|
+
populate_by_name=True,
|
71
|
+
validate_assignment=True,
|
72
|
+
protected_namespaces=(),
|
73
|
+
extra="allow",
|
74
|
+
)
|
75
|
+
|
76
|
+
|
77
|
+
def to_str(self) -> str:
|
78
|
+
"""Returns the string representation of the model using alias"""
|
79
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
80
|
+
|
81
|
+
def to_json(self) -> str:
|
82
|
+
"""Returns the JSON representation of the model using alias"""
|
83
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
84
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
|
85
|
+
|
86
|
+
@classmethod
|
87
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
88
|
+
"""Create an instance of ApiInstantTestRequest from a JSON string"""
|
89
|
+
return cls.from_dict(json.loads(json_str))
|
90
|
+
|
91
|
+
def to_dict(self) -> Dict[str, Any]:
|
92
|
+
"""Return the dictionary representation of the model using alias.
|
93
|
+
|
94
|
+
This has the following differences from calling pydantic's
|
95
|
+
`self.model_dump(by_alias=True)`:
|
96
|
+
|
97
|
+
* `None` is only added to the output dict for nullable fields that
|
98
|
+
were set at model initialization. Other fields with value `None`
|
99
|
+
are ignored.
|
100
|
+
* OpenAPI `readOnly` fields are excluded.
|
101
|
+
* OpenAPI `readOnly` fields are excluded.
|
102
|
+
* OpenAPI `readOnly` fields are excluded.
|
103
|
+
* OpenAPI `readOnly` fields are excluded.
|
104
|
+
* OpenAPI `readOnly` fields are excluded.
|
105
|
+
* OpenAPI `readOnly` fields are excluded.
|
106
|
+
* OpenAPI `readOnly` fields are excluded.
|
107
|
+
* OpenAPI `readOnly` fields are excluded.
|
108
|
+
"""
|
109
|
+
excluded_fields: Set[str] = set([
|
110
|
+
"created_by",
|
111
|
+
"created_date",
|
112
|
+
"live_share",
|
113
|
+
"modified_by",
|
114
|
+
"modified_date",
|
115
|
+
"saved_event",
|
116
|
+
"test_id",
|
117
|
+
"type",
|
118
|
+
])
|
119
|
+
|
120
|
+
_dict = self.model_dump(
|
121
|
+
by_alias=True,
|
122
|
+
exclude=excluded_fields,
|
123
|
+
exclude_none=True,
|
124
|
+
)
|
125
|
+
# override the default output from pydantic by calling `to_dict()` of links
|
126
|
+
if self.links:
|
127
|
+
_dict['_links'] = self.links.to_dict()
|
128
|
+
# override the default output from pydantic by calling `to_dict()` of each item in predefined_variables (list)
|
129
|
+
_items = []
|
130
|
+
if self.predefined_variables:
|
131
|
+
for _item in self.predefined_variables:
|
132
|
+
if _item:
|
133
|
+
_items.append(_item.to_dict())
|
134
|
+
_dict['predefinedVariables'] = _items
|
135
|
+
# override the default output from pydantic by calling `to_dict()` of each item in requests (list)
|
136
|
+
_items = []
|
137
|
+
if self.requests:
|
138
|
+
for _item in self.requests:
|
139
|
+
if _item:
|
140
|
+
_items.append(_item.to_dict())
|
141
|
+
_dict['requests'] = _items
|
142
|
+
# override the default output from pydantic by calling `to_dict()` of each item in agents (list)
|
143
|
+
_items = []
|
144
|
+
if self.agents:
|
145
|
+
for _item in self.agents:
|
146
|
+
if _item:
|
147
|
+
_items.append(_item.to_dict())
|
148
|
+
_dict['agents'] = _items
|
149
|
+
return _dict
|
150
|
+
|
151
|
+
@classmethod
|
152
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
153
|
+
"""Create an instance of ApiInstantTestRequest from a dict"""
|
154
|
+
if obj is None:
|
155
|
+
return None
|
156
|
+
|
157
|
+
if not isinstance(obj, dict):
|
158
|
+
return cls.model_validate(obj)
|
159
|
+
|
160
|
+
_obj = cls.model_validate({
|
161
|
+
"createdBy": obj.get("createdBy"),
|
162
|
+
"createdDate": obj.get("createdDate"),
|
163
|
+
"description": obj.get("description"),
|
164
|
+
"liveShare": obj.get("liveShare"),
|
165
|
+
"modifiedBy": obj.get("modifiedBy"),
|
166
|
+
"modifiedDate": obj.get("modifiedDate"),
|
167
|
+
"savedEvent": obj.get("savedEvent"),
|
168
|
+
"testId": obj.get("testId"),
|
169
|
+
"testName": obj.get("testName"),
|
170
|
+
"type": obj.get("type"),
|
171
|
+
"_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
|
172
|
+
"labels": obj.get("labels"),
|
173
|
+
"sharedWithAccounts": obj.get("sharedWithAccounts"),
|
174
|
+
"followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True,
|
175
|
+
"mtuMeasurements": obj.get("mtuMeasurements"),
|
176
|
+
"networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True,
|
177
|
+
"numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
|
178
|
+
"pathTraceMode": obj.get("pathTraceMode"),
|
179
|
+
"predefinedVariables": [ApiPredefinedVariable.from_dict(_item) for _item in obj["predefinedVariables"]] if obj.get("predefinedVariables") is not None else None,
|
180
|
+
"probeMode": obj.get("probeMode"),
|
181
|
+
"protocol": obj.get("protocol"),
|
182
|
+
"requests": [ApiRequest.from_dict(_item) for _item in obj["requests"]] if obj.get("requests") is not None else None,
|
183
|
+
"sslVersionId": obj.get("sslVersionId"),
|
184
|
+
"targetTime": obj.get("targetTime"),
|
185
|
+
"timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30,
|
186
|
+
"url": obj.get("url"),
|
187
|
+
"agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None,
|
188
|
+
"credentials": obj.get("credentials")
|
189
|
+
})
|
190
|
+
return _obj
|
191
|
+
|
192
|
+
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Instant Tests API
|
5
|
+
|
6
|
+
The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 7.0.8
|
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 ApiPredefinedVariable(BaseModel):
|
26
|
+
"""
|
27
|
+
ApiPredefinedVariable
|
28
|
+
""" # noqa: E501
|
29
|
+
name: Optional[StrictStr] = Field(default=None, description="Variable name. Must be unique.")
|
30
|
+
value: Optional[StrictStr] = Field(default=None, description="Variable value, will be treated as string.")
|
31
|
+
__properties: ClassVar[List[str]] = ["name", "value"]
|
32
|
+
|
33
|
+
model_config = ConfigDict(
|
34
|
+
populate_by_name=True,
|
35
|
+
validate_assignment=True,
|
36
|
+
protected_namespaces=(),
|
37
|
+
extra="allow",
|
38
|
+
)
|
39
|
+
|
40
|
+
|
41
|
+
def to_str(self) -> str:
|
42
|
+
"""Returns the string representation of the model using alias"""
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
44
|
+
|
45
|
+
def to_json(self) -> str:
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
48
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
|
49
|
+
|
50
|
+
@classmethod
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
52
|
+
"""Create an instance of ApiPredefinedVariable from a JSON string"""
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
54
|
+
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
57
|
+
|
58
|
+
This has the following differences from calling pydantic's
|
59
|
+
`self.model_dump(by_alias=True)`:
|
60
|
+
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
62
|
+
were set at model initialization. Other fields with value `None`
|
63
|
+
are ignored.
|
64
|
+
"""
|
65
|
+
excluded_fields: Set[str] = set([
|
66
|
+
])
|
67
|
+
|
68
|
+
_dict = self.model_dump(
|
69
|
+
by_alias=True,
|
70
|
+
exclude=excluded_fields,
|
71
|
+
exclude_none=True,
|
72
|
+
)
|
73
|
+
return _dict
|
74
|
+
|
75
|
+
@classmethod
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
77
|
+
"""Create an instance of ApiPredefinedVariable from a dict"""
|
78
|
+
if obj is None:
|
79
|
+
return None
|
80
|
+
|
81
|
+
if not isinstance(obj, dict):
|
82
|
+
return cls.model_validate(obj)
|
83
|
+
|
84
|
+
_obj = cls.model_validate({
|
85
|
+
"name": obj.get("name"),
|
86
|
+
"value": obj.get("value")
|
87
|
+
})
|
88
|
+
return _obj
|
89
|
+
|
90
|
+
|
@@ -0,0 +1,137 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Instant Tests API
|
5
|
+
|
6
|
+
The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 7.0.8
|
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, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from typing_extensions import Annotated
|
23
|
+
from thousandeyes_sdk.instant_tests.models.api_predefined_variable import ApiPredefinedVariable
|
24
|
+
from thousandeyes_sdk.instant_tests.models.api_request import ApiRequest
|
25
|
+
from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode
|
26
|
+
from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode
|
27
|
+
from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol
|
28
|
+
from thousandeyes_sdk.instant_tests.models.test_ssl_version_id import TestSslVersionId
|
29
|
+
from typing import Optional, Set
|
30
|
+
from typing_extensions import Self
|
31
|
+
|
32
|
+
class ApiProperties(BaseModel):
|
33
|
+
"""
|
34
|
+
ApiProperties
|
35
|
+
""" # noqa: E501
|
36
|
+
follow_redirects: Optional[StrictBool] = Field(default=True, description="To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.", alias="followRedirects")
|
37
|
+
mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements")
|
38
|
+
network_measurements: Optional[StrictBool] = Field(default=True, description="Enable or disable network measurements. Set to true to enable or false to disable network measurements.", alias="networkMeasurements")
|
39
|
+
num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces")
|
40
|
+
path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
|
41
|
+
predefined_variables: Optional[List[ApiPredefinedVariable]] = Field(default=None, alias="predefinedVariables")
|
42
|
+
probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode")
|
43
|
+
protocol: Optional[TestProtocol] = None
|
44
|
+
requests: List[ApiRequest]
|
45
|
+
ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId")
|
46
|
+
target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior)", alias="targetTime")
|
47
|
+
time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.", alias="timeLimit")
|
48
|
+
url: StrictStr = Field(description="Target for the test.")
|
49
|
+
type: Optional[StrictStr] = None
|
50
|
+
__properties: ClassVar[List[str]] = ["followRedirects", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pathTraceMode", "predefinedVariables", "probeMode", "protocol", "requests", "sslVersionId", "targetTime", "timeLimit", "url", "type"]
|
51
|
+
|
52
|
+
model_config = ConfigDict(
|
53
|
+
populate_by_name=True,
|
54
|
+
validate_assignment=True,
|
55
|
+
protected_namespaces=(),
|
56
|
+
extra="allow",
|
57
|
+
)
|
58
|
+
|
59
|
+
|
60
|
+
def to_str(self) -> str:
|
61
|
+
"""Returns the string representation of the model using alias"""
|
62
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
63
|
+
|
64
|
+
def to_json(self) -> str:
|
65
|
+
"""Returns the JSON representation of the model using alias"""
|
66
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
67
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
|
68
|
+
|
69
|
+
@classmethod
|
70
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
71
|
+
"""Create an instance of ApiProperties from a JSON string"""
|
72
|
+
return cls.from_dict(json.loads(json_str))
|
73
|
+
|
74
|
+
def to_dict(self) -> Dict[str, Any]:
|
75
|
+
"""Return the dictionary representation of the model using alias.
|
76
|
+
|
77
|
+
This has the following differences from calling pydantic's
|
78
|
+
`self.model_dump(by_alias=True)`:
|
79
|
+
|
80
|
+
* `None` is only added to the output dict for nullable fields that
|
81
|
+
were set at model initialization. Other fields with value `None`
|
82
|
+
are ignored.
|
83
|
+
* OpenAPI `readOnly` fields are excluded.
|
84
|
+
"""
|
85
|
+
excluded_fields: Set[str] = set([
|
86
|
+
"type",
|
87
|
+
])
|
88
|
+
|
89
|
+
_dict = self.model_dump(
|
90
|
+
by_alias=True,
|
91
|
+
exclude=excluded_fields,
|
92
|
+
exclude_none=True,
|
93
|
+
)
|
94
|
+
# override the default output from pydantic by calling `to_dict()` of each item in predefined_variables (list)
|
95
|
+
_items = []
|
96
|
+
if self.predefined_variables:
|
97
|
+
for _item in self.predefined_variables:
|
98
|
+
if _item:
|
99
|
+
_items.append(_item.to_dict())
|
100
|
+
_dict['predefinedVariables'] = _items
|
101
|
+
# override the default output from pydantic by calling `to_dict()` of each item in requests (list)
|
102
|
+
_items = []
|
103
|
+
if self.requests:
|
104
|
+
for _item in self.requests:
|
105
|
+
if _item:
|
106
|
+
_items.append(_item.to_dict())
|
107
|
+
_dict['requests'] = _items
|
108
|
+
return _dict
|
109
|
+
|
110
|
+
@classmethod
|
111
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
112
|
+
"""Create an instance of ApiProperties from a dict"""
|
113
|
+
if obj is None:
|
114
|
+
return None
|
115
|
+
|
116
|
+
if not isinstance(obj, dict):
|
117
|
+
return cls.model_validate(obj)
|
118
|
+
|
119
|
+
_obj = cls.model_validate({
|
120
|
+
"followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True,
|
121
|
+
"mtuMeasurements": obj.get("mtuMeasurements"),
|
122
|
+
"networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True,
|
123
|
+
"numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
|
124
|
+
"pathTraceMode": obj.get("pathTraceMode"),
|
125
|
+
"predefinedVariables": [ApiPredefinedVariable.from_dict(_item) for _item in obj["predefinedVariables"]] if obj.get("predefinedVariables") is not None else None,
|
126
|
+
"probeMode": obj.get("probeMode"),
|
127
|
+
"protocol": obj.get("protocol"),
|
128
|
+
"requests": [ApiRequest.from_dict(_item) for _item in obj["requests"]] if obj.get("requests") is not None else None,
|
129
|
+
"sslVersionId": obj.get("sslVersionId"),
|
130
|
+
"targetTime": obj.get("targetTime"),
|
131
|
+
"timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30,
|
132
|
+
"url": obj.get("url"),
|
133
|
+
"type": obj.get("type")
|
134
|
+
})
|
135
|
+
return _obj
|
136
|
+
|
137
|
+
|