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,114 @@
|
|
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_extensions import Annotated
|
23
|
+
from thousandeyes_sdk.instant_tests.models.test_dscp_id import TestDscpId
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class VoiceProperties(BaseModel):
|
28
|
+
"""
|
29
|
+
VoiceProperties
|
30
|
+
""" # noqa: E501
|
31
|
+
codec: Optional[StrictStr] = Field(default=None, description="Codec label")
|
32
|
+
codec_id: Optional[StrictStr] = Field(default=None, description="Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab)", alias="codecId")
|
33
|
+
dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.")
|
34
|
+
dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId")
|
35
|
+
duration: Optional[Annotated[int, Field(le=30, strict=True, ge=5)]] = Field(default=5, description="Duration of the test in seconds.")
|
36
|
+
jitter_buffer: Optional[Annotated[int, Field(le=150, strict=True, ge=0)]] = Field(default=40, description="De-jitter buffer size in seconds.", alias="jitterBuffer")
|
37
|
+
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")
|
38
|
+
port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.")
|
39
|
+
target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId")
|
40
|
+
type: Optional[StrictStr] = None
|
41
|
+
__properties: ClassVar[List[str]] = ["codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId", "type"]
|
42
|
+
|
43
|
+
model_config = ConfigDict(
|
44
|
+
populate_by_name=True,
|
45
|
+
validate_assignment=True,
|
46
|
+
protected_namespaces=(),
|
47
|
+
extra="allow",
|
48
|
+
)
|
49
|
+
|
50
|
+
|
51
|
+
def to_str(self) -> str:
|
52
|
+
"""Returns the string representation of the model using alias"""
|
53
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
54
|
+
|
55
|
+
def to_json(self) -> str:
|
56
|
+
"""Returns the JSON representation of the model using alias"""
|
57
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
58
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
|
59
|
+
|
60
|
+
@classmethod
|
61
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
62
|
+
"""Create an instance of VoiceProperties from a JSON string"""
|
63
|
+
return cls.from_dict(json.loads(json_str))
|
64
|
+
|
65
|
+
def to_dict(self) -> Dict[str, Any]:
|
66
|
+
"""Return the dictionary representation of the model using alias.
|
67
|
+
|
68
|
+
This has the following differences from calling pydantic's
|
69
|
+
`self.model_dump(by_alias=True)`:
|
70
|
+
|
71
|
+
* `None` is only added to the output dict for nullable fields that
|
72
|
+
were set at model initialization. Other fields with value `None`
|
73
|
+
are ignored.
|
74
|
+
* OpenAPI `readOnly` fields are excluded.
|
75
|
+
* OpenAPI `readOnly` fields are excluded.
|
76
|
+
* OpenAPI `readOnly` fields are excluded.
|
77
|
+
"""
|
78
|
+
excluded_fields: Set[str] = set([
|
79
|
+
"codec",
|
80
|
+
"dscp",
|
81
|
+
"type",
|
82
|
+
])
|
83
|
+
|
84
|
+
_dict = self.model_dump(
|
85
|
+
by_alias=True,
|
86
|
+
exclude=excluded_fields,
|
87
|
+
exclude_none=True,
|
88
|
+
)
|
89
|
+
return _dict
|
90
|
+
|
91
|
+
@classmethod
|
92
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
93
|
+
"""Create an instance of VoiceProperties from a dict"""
|
94
|
+
if obj is None:
|
95
|
+
return None
|
96
|
+
|
97
|
+
if not isinstance(obj, dict):
|
98
|
+
return cls.model_validate(obj)
|
99
|
+
|
100
|
+
_obj = cls.model_validate({
|
101
|
+
"codec": obj.get("codec"),
|
102
|
+
"codecId": obj.get("codecId"),
|
103
|
+
"dscp": obj.get("dscp"),
|
104
|
+
"dscpId": obj.get("dscpId"),
|
105
|
+
"duration": obj.get("duration") if obj.get("duration") is not None else 5,
|
106
|
+
"jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40,
|
107
|
+
"numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
|
108
|
+
"port": obj.get("port"),
|
109
|
+
"targetAgentId": obj.get("targetAgentId"),
|
110
|
+
"type": obj.get("type")
|
111
|
+
})
|
112
|
+
return _obj
|
113
|
+
|
114
|
+
|
@@ -0,0 +1,258 @@
|
|
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.shared_with_account import SharedWithAccount
|
26
|
+
from thousandeyes_sdk.instant_tests.models.test_auth_type import TestAuthType
|
27
|
+
from thousandeyes_sdk.instant_tests.models.test_custom_headers import TestCustomHeaders
|
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_page_loading_strategy import TestPageLoadingStrategy
|
31
|
+
from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode
|
32
|
+
from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode
|
33
|
+
from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol
|
34
|
+
from thousandeyes_sdk.instant_tests.models.test_ssl_version_id import TestSslVersionId
|
35
|
+
from typing import Optional, Set
|
36
|
+
from typing_extensions import Self
|
37
|
+
|
38
|
+
class WebTransactionInstantTest(BaseModel):
|
39
|
+
"""
|
40
|
+
WebTransactionInstantTest
|
41
|
+
""" # noqa: E501
|
42
|
+
created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
|
43
|
+
created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
|
44
|
+
description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
|
45
|
+
live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
|
46
|
+
modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
|
47
|
+
modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
|
48
|
+
saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
|
49
|
+
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")
|
50
|
+
test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
|
51
|
+
type: Optional[StrictStr] = None
|
52
|
+
links: Optional[TestLinks] = Field(default=None, alias="_links")
|
53
|
+
labels: Optional[List[TestLabel]] = None
|
54
|
+
shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts")
|
55
|
+
auth_type: Optional[TestAuthType] = Field(default=None, alias="authType")
|
56
|
+
bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements")
|
57
|
+
client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate")
|
58
|
+
content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex")
|
59
|
+
custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders")
|
60
|
+
desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode")
|
61
|
+
emulated_device_id: Optional[StrictStr] = Field(default=None, description="id of the emulated device, if one was given when the test was created", alias="emulatedDeviceId")
|
62
|
+
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")
|
63
|
+
http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime")
|
64
|
+
http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit")
|
65
|
+
http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion")
|
66
|
+
include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders")
|
67
|
+
mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements")
|
68
|
+
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")
|
69
|
+
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")
|
70
|
+
password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.")
|
71
|
+
path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
|
72
|
+
probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode")
|
73
|
+
protocol: Optional[TestProtocol] = None
|
74
|
+
ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion")
|
75
|
+
ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId")
|
76
|
+
target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target time for completion, defaults to 50% of time limit specified in seconds. (0 means default behavior)", alias="targetTime")
|
77
|
+
time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds.", alias="timeLimit")
|
78
|
+
transaction_script: StrictStr = Field(description="JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ).", alias="transactionScript")
|
79
|
+
url: StrictStr = Field(description="Target for the test.")
|
80
|
+
use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm")
|
81
|
+
user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent")
|
82
|
+
username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.")
|
83
|
+
verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate")
|
84
|
+
allow_unsafe_legacy_renegotiation: Optional[StrictBool] = Field(default=True, description="Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.", alias="allowUnsafeLegacyRenegotiation")
|
85
|
+
block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains")
|
86
|
+
disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot")
|
87
|
+
allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera")
|
88
|
+
allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation")
|
89
|
+
browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage")
|
90
|
+
page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy")
|
91
|
+
fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate")
|
92
|
+
override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy")
|
93
|
+
override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId")
|
94
|
+
agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.")
|
95
|
+
credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).")
|
96
|
+
__properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "emulatedDeviceId", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "targetTime", "timeLimit", "transactionScript", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "agents", "credentials"]
|
97
|
+
|
98
|
+
model_config = ConfigDict(
|
99
|
+
populate_by_name=True,
|
100
|
+
validate_assignment=True,
|
101
|
+
protected_namespaces=(),
|
102
|
+
extra="allow",
|
103
|
+
)
|
104
|
+
|
105
|
+
|
106
|
+
def to_str(self) -> str:
|
107
|
+
"""Returns the string representation of the model using alias"""
|
108
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
109
|
+
|
110
|
+
def to_json(self) -> str:
|
111
|
+
"""Returns the JSON representation of the model using alias"""
|
112
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
113
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
|
114
|
+
|
115
|
+
@classmethod
|
116
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
117
|
+
"""Create an instance of WebTransactionInstantTest from a JSON string"""
|
118
|
+
return cls.from_dict(json.loads(json_str))
|
119
|
+
|
120
|
+
def to_dict(self) -> Dict[str, Any]:
|
121
|
+
"""Return the dictionary representation of the model using alias.
|
122
|
+
|
123
|
+
This has the following differences from calling pydantic's
|
124
|
+
`self.model_dump(by_alias=True)`:
|
125
|
+
|
126
|
+
* `None` is only added to the output dict for nullable fields that
|
127
|
+
were set at model initialization. Other fields with value `None`
|
128
|
+
are ignored.
|
129
|
+
* OpenAPI `readOnly` fields are excluded.
|
130
|
+
* OpenAPI `readOnly` fields are excluded.
|
131
|
+
* OpenAPI `readOnly` fields are excluded.
|
132
|
+
* OpenAPI `readOnly` fields are excluded.
|
133
|
+
* OpenAPI `readOnly` fields are excluded.
|
134
|
+
* OpenAPI `readOnly` fields are excluded.
|
135
|
+
* OpenAPI `readOnly` fields are excluded.
|
136
|
+
* OpenAPI `readOnly` fields are excluded.
|
137
|
+
* OpenAPI `readOnly` fields are excluded.
|
138
|
+
* OpenAPI `readOnly` fields are excluded.
|
139
|
+
* OpenAPI `readOnly` fields are excluded.
|
140
|
+
* OpenAPI `readOnly` fields are excluded.
|
141
|
+
"""
|
142
|
+
excluded_fields: Set[str] = set([
|
143
|
+
"created_by",
|
144
|
+
"created_date",
|
145
|
+
"live_share",
|
146
|
+
"modified_by",
|
147
|
+
"modified_date",
|
148
|
+
"saved_event",
|
149
|
+
"test_id",
|
150
|
+
"type",
|
151
|
+
"labels",
|
152
|
+
"shared_with_accounts",
|
153
|
+
"ssl_version",
|
154
|
+
"agents",
|
155
|
+
])
|
156
|
+
|
157
|
+
_dict = self.model_dump(
|
158
|
+
by_alias=True,
|
159
|
+
exclude=excluded_fields,
|
160
|
+
exclude_none=True,
|
161
|
+
)
|
162
|
+
# override the default output from pydantic by calling `to_dict()` of links
|
163
|
+
if self.links:
|
164
|
+
_dict['_links'] = self.links.to_dict()
|
165
|
+
# override the default output from pydantic by calling `to_dict()` of each item in labels (list)
|
166
|
+
_items = []
|
167
|
+
if self.labels:
|
168
|
+
for _item in self.labels:
|
169
|
+
if _item:
|
170
|
+
_items.append(_item.to_dict())
|
171
|
+
_dict['labels'] = _items
|
172
|
+
# override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list)
|
173
|
+
_items = []
|
174
|
+
if self.shared_with_accounts:
|
175
|
+
for _item in self.shared_with_accounts:
|
176
|
+
if _item:
|
177
|
+
_items.append(_item.to_dict())
|
178
|
+
_dict['sharedWithAccounts'] = _items
|
179
|
+
# override the default output from pydantic by calling `to_dict()` of custom_headers
|
180
|
+
if self.custom_headers:
|
181
|
+
_dict['customHeaders'] = self.custom_headers.to_dict()
|
182
|
+
# override the default output from pydantic by calling `to_dict()` of each item in agents (list)
|
183
|
+
_items = []
|
184
|
+
if self.agents:
|
185
|
+
for _item in self.agents:
|
186
|
+
if _item:
|
187
|
+
_items.append(_item.to_dict())
|
188
|
+
_dict['agents'] = _items
|
189
|
+
return _dict
|
190
|
+
|
191
|
+
@classmethod
|
192
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
193
|
+
"""Create an instance of WebTransactionInstantTest from a dict"""
|
194
|
+
if obj is None:
|
195
|
+
return None
|
196
|
+
|
197
|
+
if not isinstance(obj, dict):
|
198
|
+
return cls.model_validate(obj)
|
199
|
+
|
200
|
+
_obj = cls.model_validate({
|
201
|
+
"createdBy": obj.get("createdBy"),
|
202
|
+
"createdDate": obj.get("createdDate"),
|
203
|
+
"description": obj.get("description"),
|
204
|
+
"liveShare": obj.get("liveShare"),
|
205
|
+
"modifiedBy": obj.get("modifiedBy"),
|
206
|
+
"modifiedDate": obj.get("modifiedDate"),
|
207
|
+
"savedEvent": obj.get("savedEvent"),
|
208
|
+
"testId": obj.get("testId"),
|
209
|
+
"testName": obj.get("testName"),
|
210
|
+
"type": obj.get("type"),
|
211
|
+
"_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
|
212
|
+
"labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None,
|
213
|
+
"sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None,
|
214
|
+
"authType": obj.get("authType"),
|
215
|
+
"bandwidthMeasurements": obj.get("bandwidthMeasurements"),
|
216
|
+
"clientCertificate": obj.get("clientCertificate"),
|
217
|
+
"contentRegex": obj.get("contentRegex"),
|
218
|
+
"customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None,
|
219
|
+
"desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200',
|
220
|
+
"emulatedDeviceId": obj.get("emulatedDeviceId"),
|
221
|
+
"followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True,
|
222
|
+
"httpTargetTime": obj.get("httpTargetTime"),
|
223
|
+
"httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5,
|
224
|
+
"httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2,
|
225
|
+
"includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True,
|
226
|
+
"mtuMeasurements": obj.get("mtuMeasurements"),
|
227
|
+
"networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True,
|
228
|
+
"numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
|
229
|
+
"password": obj.get("password"),
|
230
|
+
"pathTraceMode": obj.get("pathTraceMode"),
|
231
|
+
"probeMode": obj.get("probeMode"),
|
232
|
+
"protocol": obj.get("protocol"),
|
233
|
+
"sslVersion": obj.get("sslVersion"),
|
234
|
+
"sslVersionId": obj.get("sslVersionId"),
|
235
|
+
"targetTime": obj.get("targetTime"),
|
236
|
+
"timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30,
|
237
|
+
"transactionScript": obj.get("transactionScript"),
|
238
|
+
"url": obj.get("url"),
|
239
|
+
"useNtlm": obj.get("useNtlm"),
|
240
|
+
"userAgent": obj.get("userAgent"),
|
241
|
+
"username": obj.get("username"),
|
242
|
+
"verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False,
|
243
|
+
"allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True,
|
244
|
+
"blockDomains": obj.get("blockDomains"),
|
245
|
+
"disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False,
|
246
|
+
"allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False,
|
247
|
+
"allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False,
|
248
|
+
"browserLanguage": obj.get("browserLanguage"),
|
249
|
+
"pageLoadingStrategy": obj.get("pageLoadingStrategy"),
|
250
|
+
"fixedPacketRate": obj.get("fixedPacketRate"),
|
251
|
+
"overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False,
|
252
|
+
"overrideProxyId": obj.get("overrideProxyId"),
|
253
|
+
"agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None,
|
254
|
+
"credentials": obj.get("credentials")
|
255
|
+
})
|
256
|
+
return _obj
|
257
|
+
|
258
|
+
|
@@ -0,0 +1,236 @@
|
|
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.test_agent import TestAgent
|
25
|
+
from thousandeyes_sdk.instant_tests.models.test_auth_type import TestAuthType
|
26
|
+
from thousandeyes_sdk.instant_tests.models.test_custom_headers import TestCustomHeaders
|
27
|
+
from thousandeyes_sdk.instant_tests.models.test_links import TestLinks
|
28
|
+
from thousandeyes_sdk.instant_tests.models.test_page_loading_strategy import TestPageLoadingStrategy
|
29
|
+
from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode
|
30
|
+
from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode
|
31
|
+
from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol
|
32
|
+
from thousandeyes_sdk.instant_tests.models.test_ssl_version_id import TestSslVersionId
|
33
|
+
from typing import Optional, Set
|
34
|
+
from typing_extensions import Self
|
35
|
+
|
36
|
+
class WebTransactionInstantTestRequest(BaseModel):
|
37
|
+
"""
|
38
|
+
WebTransactionInstantTestRequest
|
39
|
+
""" # noqa: E501
|
40
|
+
created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
|
41
|
+
created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
|
42
|
+
description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
|
43
|
+
live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
|
44
|
+
modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
|
45
|
+
modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
|
46
|
+
saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
|
47
|
+
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")
|
48
|
+
test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
|
49
|
+
type: Optional[StrictStr] = None
|
50
|
+
links: Optional[TestLinks] = Field(default=None, alias="_links")
|
51
|
+
labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).")
|
52
|
+
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")
|
53
|
+
auth_type: Optional[TestAuthType] = Field(default=None, alias="authType")
|
54
|
+
bandwidth_measurements: Optional[StrictBool] = Field(default=None, description="Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.", alias="bandwidthMeasurements")
|
55
|
+
client_certificate: Optional[StrictStr] = Field(default=None, description="String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.", alias="clientCertificate")
|
56
|
+
content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex")
|
57
|
+
custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders")
|
58
|
+
desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode")
|
59
|
+
emulated_device_id: Optional[StrictStr] = Field(default=None, description="id of the emulated device, if one was given when the test was created", alias="emulatedDeviceId")
|
60
|
+
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")
|
61
|
+
http_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for HTTP server completion, specified in milliseconds.", alias="httpTargetTime")
|
62
|
+
http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit")
|
63
|
+
http_version: Optional[Annotated[int, Field(le=2, strict=True, ge=1)]] = Field(default=2, description="HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.", alias="httpVersion")
|
64
|
+
include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders")
|
65
|
+
mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements")
|
66
|
+
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")
|
67
|
+
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")
|
68
|
+
password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.")
|
69
|
+
path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
|
70
|
+
probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode")
|
71
|
+
protocol: Optional[TestProtocol] = None
|
72
|
+
ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion")
|
73
|
+
ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId")
|
74
|
+
target_time: Optional[Annotated[int, Field(le=60, strict=True, ge=0)]] = Field(default=None, description="Target time for completion, defaults to 50% of time limit specified in seconds. (0 means default behavior)", alias="targetTime")
|
75
|
+
time_limit: Optional[Annotated[int, Field(le=180, strict=True, ge=5)]] = Field(default=30, description="Time limit for transaction in seconds.", alias="timeLimit")
|
76
|
+
transaction_script: StrictStr = Field(description="JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ).", alias="transactionScript")
|
77
|
+
url: StrictStr = Field(description="Target for the test.")
|
78
|
+
use_ntlm: Optional[StrictBool] = Field(default=None, description="Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.", alias="useNtlm")
|
79
|
+
user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent")
|
80
|
+
username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.")
|
81
|
+
verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate")
|
82
|
+
allow_unsafe_legacy_renegotiation: Optional[StrictBool] = Field(default=True, description="Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.", alias="allowUnsafeLegacyRenegotiation")
|
83
|
+
block_domains: Optional[StrictStr] = Field(default=None, description="Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.", alias="blockDomains")
|
84
|
+
disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot")
|
85
|
+
allow_mic_and_camera: Optional[StrictBool] = Field(default=False, description="Set true allow the use of a fake mic and camera in the browser.", alias="allowMicAndCamera")
|
86
|
+
allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation")
|
87
|
+
browser_language: Optional[StrictStr] = Field(default=None, description="Set one of the available browser language that you want to use to configure the browser.", alias="browserLanguage")
|
88
|
+
page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy")
|
89
|
+
fixed_packet_rate: Optional[Annotated[int, Field(le=100, strict=True, ge=0)]] = Field(default=None, description="Sets packets rate sent to measure the network in packets per second.", alias="fixedPacketRate")
|
90
|
+
override_agent_proxy: Optional[StrictBool] = Field(default=False, description="Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.", alias="overrideAgentProxy")
|
91
|
+
override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId")
|
92
|
+
agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).")
|
93
|
+
credentials: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).")
|
94
|
+
__properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "emulatedDeviceId", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "targetTime", "timeLimit", "transactionScript", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "agents", "credentials"]
|
95
|
+
|
96
|
+
model_config = ConfigDict(
|
97
|
+
populate_by_name=True,
|
98
|
+
validate_assignment=True,
|
99
|
+
protected_namespaces=(),
|
100
|
+
extra="allow",
|
101
|
+
)
|
102
|
+
|
103
|
+
|
104
|
+
def to_str(self) -> str:
|
105
|
+
"""Returns the string representation of the model using alias"""
|
106
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
107
|
+
|
108
|
+
def to_json(self) -> str:
|
109
|
+
"""Returns the JSON representation of the model using alias"""
|
110
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
111
|
+
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
|
112
|
+
|
113
|
+
@classmethod
|
114
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
115
|
+
"""Create an instance of WebTransactionInstantTestRequest from a JSON string"""
|
116
|
+
return cls.from_dict(json.loads(json_str))
|
117
|
+
|
118
|
+
def to_dict(self) -> Dict[str, Any]:
|
119
|
+
"""Return the dictionary representation of the model using alias.
|
120
|
+
|
121
|
+
This has the following differences from calling pydantic's
|
122
|
+
`self.model_dump(by_alias=True)`:
|
123
|
+
|
124
|
+
* `None` is only added to the output dict for nullable fields that
|
125
|
+
were set at model initialization. Other fields with value `None`
|
126
|
+
are ignored.
|
127
|
+
* OpenAPI `readOnly` fields are excluded.
|
128
|
+
* OpenAPI `readOnly` fields are excluded.
|
129
|
+
* OpenAPI `readOnly` fields are excluded.
|
130
|
+
* OpenAPI `readOnly` fields are excluded.
|
131
|
+
* OpenAPI `readOnly` fields are excluded.
|
132
|
+
* OpenAPI `readOnly` fields are excluded.
|
133
|
+
* OpenAPI `readOnly` fields are excluded.
|
134
|
+
* OpenAPI `readOnly` fields are excluded.
|
135
|
+
* OpenAPI `readOnly` fields are excluded.
|
136
|
+
"""
|
137
|
+
excluded_fields: Set[str] = set([
|
138
|
+
"created_by",
|
139
|
+
"created_date",
|
140
|
+
"live_share",
|
141
|
+
"modified_by",
|
142
|
+
"modified_date",
|
143
|
+
"saved_event",
|
144
|
+
"test_id",
|
145
|
+
"type",
|
146
|
+
"ssl_version",
|
147
|
+
])
|
148
|
+
|
149
|
+
_dict = self.model_dump(
|
150
|
+
by_alias=True,
|
151
|
+
exclude=excluded_fields,
|
152
|
+
exclude_none=True,
|
153
|
+
)
|
154
|
+
# override the default output from pydantic by calling `to_dict()` of links
|
155
|
+
if self.links:
|
156
|
+
_dict['_links'] = self.links.to_dict()
|
157
|
+
# override the default output from pydantic by calling `to_dict()` of custom_headers
|
158
|
+
if self.custom_headers:
|
159
|
+
_dict['customHeaders'] = self.custom_headers.to_dict()
|
160
|
+
# override the default output from pydantic by calling `to_dict()` of each item in agents (list)
|
161
|
+
_items = []
|
162
|
+
if self.agents:
|
163
|
+
for _item in self.agents:
|
164
|
+
if _item:
|
165
|
+
_items.append(_item.to_dict())
|
166
|
+
_dict['agents'] = _items
|
167
|
+
return _dict
|
168
|
+
|
169
|
+
@classmethod
|
170
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
171
|
+
"""Create an instance of WebTransactionInstantTestRequest from a dict"""
|
172
|
+
if obj is None:
|
173
|
+
return None
|
174
|
+
|
175
|
+
if not isinstance(obj, dict):
|
176
|
+
return cls.model_validate(obj)
|
177
|
+
|
178
|
+
_obj = cls.model_validate({
|
179
|
+
"createdBy": obj.get("createdBy"),
|
180
|
+
"createdDate": obj.get("createdDate"),
|
181
|
+
"description": obj.get("description"),
|
182
|
+
"liveShare": obj.get("liveShare"),
|
183
|
+
"modifiedBy": obj.get("modifiedBy"),
|
184
|
+
"modifiedDate": obj.get("modifiedDate"),
|
185
|
+
"savedEvent": obj.get("savedEvent"),
|
186
|
+
"testId": obj.get("testId"),
|
187
|
+
"testName": obj.get("testName"),
|
188
|
+
"type": obj.get("type"),
|
189
|
+
"_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
|
190
|
+
"labels": obj.get("labels"),
|
191
|
+
"sharedWithAccounts": obj.get("sharedWithAccounts"),
|
192
|
+
"authType": obj.get("authType"),
|
193
|
+
"bandwidthMeasurements": obj.get("bandwidthMeasurements"),
|
194
|
+
"clientCertificate": obj.get("clientCertificate"),
|
195
|
+
"contentRegex": obj.get("contentRegex"),
|
196
|
+
"customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None,
|
197
|
+
"desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200',
|
198
|
+
"emulatedDeviceId": obj.get("emulatedDeviceId"),
|
199
|
+
"followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True,
|
200
|
+
"httpTargetTime": obj.get("httpTargetTime"),
|
201
|
+
"httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5,
|
202
|
+
"httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2,
|
203
|
+
"includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True,
|
204
|
+
"mtuMeasurements": obj.get("mtuMeasurements"),
|
205
|
+
"networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True,
|
206
|
+
"numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
|
207
|
+
"password": obj.get("password"),
|
208
|
+
"pathTraceMode": obj.get("pathTraceMode"),
|
209
|
+
"probeMode": obj.get("probeMode"),
|
210
|
+
"protocol": obj.get("protocol"),
|
211
|
+
"sslVersion": obj.get("sslVersion"),
|
212
|
+
"sslVersionId": obj.get("sslVersionId"),
|
213
|
+
"targetTime": obj.get("targetTime"),
|
214
|
+
"timeLimit": obj.get("timeLimit") if obj.get("timeLimit") is not None else 30,
|
215
|
+
"transactionScript": obj.get("transactionScript"),
|
216
|
+
"url": obj.get("url"),
|
217
|
+
"useNtlm": obj.get("useNtlm"),
|
218
|
+
"userAgent": obj.get("userAgent"),
|
219
|
+
"username": obj.get("username"),
|
220
|
+
"verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False,
|
221
|
+
"allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True,
|
222
|
+
"blockDomains": obj.get("blockDomains"),
|
223
|
+
"disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False,
|
224
|
+
"allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False,
|
225
|
+
"allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False,
|
226
|
+
"browserLanguage": obj.get("browserLanguage"),
|
227
|
+
"pageLoadingStrategy": obj.get("pageLoadingStrategy"),
|
228
|
+
"fixedPacketRate": obj.get("fixedPacketRate"),
|
229
|
+
"overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False,
|
230
|
+
"overrideProxyId": obj.get("overrideProxyId"),
|
231
|
+
"agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None,
|
232
|
+
"credentials": obj.get("credentials")
|
233
|
+
})
|
234
|
+
return _obj
|
235
|
+
|
236
|
+
|