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.
Files changed (107) hide show
  1. thousandeyes_sdk/instant_tests/__init__.py +117 -0
  2. thousandeyes_sdk/instant_tests/api/__init__.py +17 -0
  3. thousandeyes_sdk/instant_tests/api/agent_to_agent_api.py +376 -0
  4. thousandeyes_sdk/instant_tests/api/agent_to_server_api.py +376 -0
  5. thousandeyes_sdk/instant_tests/api/api_api.py +376 -0
  6. thousandeyes_sdk/instant_tests/api/dns_security_api.py +376 -0
  7. thousandeyes_sdk/instant_tests/api/dns_server_api.py +376 -0
  8. thousandeyes_sdk/instant_tests/api/dns_trace_api.py +376 -0
  9. thousandeyes_sdk/instant_tests/api/ftp_server_api.py +376 -0
  10. thousandeyes_sdk/instant_tests/api/http_page_load_api.py +376 -0
  11. thousandeyes_sdk/instant_tests/api/http_server_api.py +376 -0
  12. thousandeyes_sdk/instant_tests/api/run_api.py +338 -0
  13. thousandeyes_sdk/instant_tests/api/sip_server_api.py +376 -0
  14. thousandeyes_sdk/instant_tests/api/voice_api.py +376 -0
  15. thousandeyes_sdk/instant_tests/api/web_transaction_api.py +376 -0
  16. thousandeyes_sdk/instant_tests/models/__init__.py +100 -0
  17. thousandeyes_sdk/instant_tests/models/agent.py +125 -0
  18. thousandeyes_sdk/instant_tests/models/agent_base.py +98 -0
  19. thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test.py +198 -0
  20. thousandeyes_sdk/instant_tests/models/agent_to_agent_instant_test_request.py +176 -0
  21. thousandeyes_sdk/instant_tests/models/agent_to_agent_properties.py +123 -0
  22. thousandeyes_sdk/instant_tests/models/agent_to_agent_test_protocol.py +37 -0
  23. thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test.py +203 -0
  24. thousandeyes_sdk/instant_tests/models/agent_to_server_instant_test_request.py +181 -0
  25. thousandeyes_sdk/instant_tests/models/agent_to_server_properties.py +128 -0
  26. thousandeyes_sdk/instant_tests/models/api_instant_test.py +214 -0
  27. thousandeyes_sdk/instant_tests/models/api_instant_test_request.py +192 -0
  28. thousandeyes_sdk/instant_tests/models/api_predefined_variable.py +90 -0
  29. thousandeyes_sdk/instant_tests/models/api_properties.py +137 -0
  30. thousandeyes_sdk/instant_tests/models/api_request.py +138 -0
  31. thousandeyes_sdk/instant_tests/models/api_request_assertion.py +94 -0
  32. thousandeyes_sdk/instant_tests/models/api_request_assertion_name.py +37 -0
  33. thousandeyes_sdk/instant_tests/models/api_request_assertion_operator.py +39 -0
  34. thousandeyes_sdk/instant_tests/models/api_request_auth_type.py +38 -0
  35. thousandeyes_sdk/instant_tests/models/api_request_header.py +90 -0
  36. thousandeyes_sdk/instant_tests/models/api_request_method.py +40 -0
  37. thousandeyes_sdk/instant_tests/models/api_request_variable.py +90 -0
  38. thousandeyes_sdk/instant_tests/models/cloud_enterprise_agent_type.py +38 -0
  39. thousandeyes_sdk/instant_tests/models/dns_query_class.py +37 -0
  40. thousandeyes_sdk/instant_tests/models/dns_sec_instant_test.py +170 -0
  41. thousandeyes_sdk/instant_tests/models/dns_sec_instant_test_request.py +148 -0
  42. thousandeyes_sdk/instant_tests/models/dns_sec_properties.py +95 -0
  43. thousandeyes_sdk/instant_tests/models/dns_server_instant_test.py +208 -0
  44. thousandeyes_sdk/instant_tests/models/dns_server_instant_test_request.py +178 -0
  45. thousandeyes_sdk/instant_tests/models/dns_server_properties.py +133 -0
  46. thousandeyes_sdk/instant_tests/models/dns_servers_request.py +88 -0
  47. thousandeyes_sdk/instant_tests/models/dns_trace_instant_test.py +173 -0
  48. thousandeyes_sdk/instant_tests/models/dns_trace_instant_test_request.py +151 -0
  49. thousandeyes_sdk/instant_tests/models/dns_trace_properties.py +98 -0
  50. thousandeyes_sdk/instant_tests/models/error.py +96 -0
  51. thousandeyes_sdk/instant_tests/models/expand.py +38 -0
  52. thousandeyes_sdk/instant_tests/models/ftp_server_instant_test.py +207 -0
  53. thousandeyes_sdk/instant_tests/models/ftp_server_properties.py +132 -0
  54. thousandeyes_sdk/instant_tests/models/ftp_server_request_type.py +38 -0
  55. thousandeyes_sdk/instant_tests/models/http_server_instant_test.py +246 -0
  56. thousandeyes_sdk/instant_tests/models/http_server_instant_test_request.py +224 -0
  57. thousandeyes_sdk/instant_tests/models/http_server_properties.py +171 -0
  58. thousandeyes_sdk/instant_tests/models/instant_test.py +152 -0
  59. thousandeyes_sdk/instant_tests/models/instant_test_request.py +100 -0
  60. thousandeyes_sdk/instant_tests/models/link.py +102 -0
  61. thousandeyes_sdk/instant_tests/models/page_load_instant_test.py +254 -0
  62. thousandeyes_sdk/instant_tests/models/page_load_instant_test_request.py +232 -0
  63. thousandeyes_sdk/instant_tests/models/page_load_properties.py +179 -0
  64. thousandeyes_sdk/instant_tests/models/server_instant_test_request.py +185 -0
  65. thousandeyes_sdk/instant_tests/models/shared_with_account.py +90 -0
  66. thousandeyes_sdk/instant_tests/models/simple_agent.py +122 -0
  67. thousandeyes_sdk/instant_tests/models/sip_server_instant_test.py +191 -0
  68. thousandeyes_sdk/instant_tests/models/sip_server_instant_test_request.py +175 -0
  69. thousandeyes_sdk/instant_tests/models/sip_server_instant_test_request1.py +197 -0
  70. thousandeyes_sdk/instant_tests/models/sip_server_instant_test_response.py +204 -0
  71. thousandeyes_sdk/instant_tests/models/sip_server_properties.py +116 -0
  72. thousandeyes_sdk/instant_tests/models/sip_test_protocol.py +38 -0
  73. thousandeyes_sdk/instant_tests/models/test_agent.py +90 -0
  74. thousandeyes_sdk/instant_tests/models/test_auth_type.py +40 -0
  75. thousandeyes_sdk/instant_tests/models/test_custom_headers.py +92 -0
  76. thousandeyes_sdk/instant_tests/models/test_direction.py +38 -0
  77. thousandeyes_sdk/instant_tests/models/test_dns_server.py +90 -0
  78. thousandeyes_sdk/instant_tests/models/test_dns_transport_protocol.py +37 -0
  79. thousandeyes_sdk/instant_tests/models/test_dscp_id.py +57 -0
  80. thousandeyes_sdk/instant_tests/models/test_ipv6_policy.py +39 -0
  81. thousandeyes_sdk/instant_tests/models/test_label.py +92 -0
  82. thousandeyes_sdk/instant_tests/models/test_links.py +102 -0
  83. thousandeyes_sdk/instant_tests/models/test_page_loading_strategy.py +38 -0
  84. thousandeyes_sdk/instant_tests/models/test_path_trace_mode.py +37 -0
  85. thousandeyes_sdk/instant_tests/models/test_probe_mode.py +38 -0
  86. thousandeyes_sdk/instant_tests/models/test_protocol.py +38 -0
  87. thousandeyes_sdk/instant_tests/models/test_self_link.py +102 -0
  88. thousandeyes_sdk/instant_tests/models/test_sip_credentials.py +100 -0
  89. thousandeyes_sdk/instant_tests/models/test_ssl_version_id.py +40 -0
  90. thousandeyes_sdk/instant_tests/models/test_type.py +48 -0
  91. thousandeyes_sdk/instant_tests/models/unauthorized_error.py +90 -0
  92. thousandeyes_sdk/instant_tests/models/unexpanded_instant_test.py +128 -0
  93. thousandeyes_sdk/instant_tests/models/validation_error.py +111 -0
  94. thousandeyes_sdk/instant_tests/models/validation_error_item.py +92 -0
  95. thousandeyes_sdk/instant_tests/models/voice_instant_test.py +189 -0
  96. thousandeyes_sdk/instant_tests/models/voice_instant_test_request.py +167 -0
  97. thousandeyes_sdk/instant_tests/models/voice_properties.py +114 -0
  98. thousandeyes_sdk/instant_tests/models/web_transaction_instant_test.py +258 -0
  99. thousandeyes_sdk/instant_tests/models/web_transaction_instant_test_request.py +236 -0
  100. thousandeyes_sdk/instant_tests/models/web_transaction_properties.py +181 -0
  101. thousandeyes_sdk/instant_tests/py.typed +0 -0
  102. thousandeyes_sdk_instant_tests-1.0.0.dist-info/LICENSE +176 -0
  103. thousandeyes_sdk_instant_tests-1.0.0.dist-info/METADATA +423 -0
  104. thousandeyes_sdk_instant_tests-1.0.0.dist-info/NOTICE +7 -0
  105. thousandeyes_sdk_instant_tests-1.0.0.dist-info/RECORD +107 -0
  106. thousandeyes_sdk_instant_tests-1.0.0.dist-info/WHEEL +5 -0
  107. thousandeyes_sdk_instant_tests-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,232 @@
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 PageLoadInstantTestRequest(BaseModel):
37
+ """
38
+ PageLoadInstantTestRequest
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
+ page_load_target_time: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`.", alias="pageLoadTargetTime")
69
+ page_load_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=10, description="Page load time limit. Must be larger than the `httpTimeLimit`.", alias="pageLoadTimeLimit")
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
+ url: StrictStr = Field(description="Target for the test.")
77
+ 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")
78
+ user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent")
79
+ username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.")
80
+ verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate")
81
+ 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")
82
+ 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")
83
+ disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot")
84
+ 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")
85
+ allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation")
86
+ 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")
87
+ page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy")
88
+ 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")
89
+ 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")
90
+ override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId")
91
+ agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).")
92
+ __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", "pageLoadTargetTime", "pageLoadTimeLimit", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "agents"]
93
+
94
+ model_config = ConfigDict(
95
+ populate_by_name=True,
96
+ validate_assignment=True,
97
+ protected_namespaces=(),
98
+ extra="allow",
99
+ )
100
+
101
+
102
+ def to_str(self) -> str:
103
+ """Returns the string representation of the model using alias"""
104
+ return pprint.pformat(self.model_dump(by_alias=True))
105
+
106
+ def to_json(self) -> str:
107
+ """Returns the JSON representation of the model using alias"""
108
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
109
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
110
+
111
+ @classmethod
112
+ def from_json(cls, json_str: str) -> Optional[Self]:
113
+ """Create an instance of PageLoadInstantTestRequest from a JSON string"""
114
+ return cls.from_dict(json.loads(json_str))
115
+
116
+ def to_dict(self) -> Dict[str, Any]:
117
+ """Return the dictionary representation of the model using alias.
118
+
119
+ This has the following differences from calling pydantic's
120
+ `self.model_dump(by_alias=True)`:
121
+
122
+ * `None` is only added to the output dict for nullable fields that
123
+ were set at model initialization. Other fields with value `None`
124
+ are ignored.
125
+ * OpenAPI `readOnly` fields are excluded.
126
+ * OpenAPI `readOnly` fields are excluded.
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
+ """
135
+ excluded_fields: Set[str] = set([
136
+ "created_by",
137
+ "created_date",
138
+ "live_share",
139
+ "modified_by",
140
+ "modified_date",
141
+ "saved_event",
142
+ "test_id",
143
+ "type",
144
+ "ssl_version",
145
+ ])
146
+
147
+ _dict = self.model_dump(
148
+ by_alias=True,
149
+ exclude=excluded_fields,
150
+ exclude_none=True,
151
+ )
152
+ # override the default output from pydantic by calling `to_dict()` of links
153
+ if self.links:
154
+ _dict['_links'] = self.links.to_dict()
155
+ # override the default output from pydantic by calling `to_dict()` of custom_headers
156
+ if self.custom_headers:
157
+ _dict['customHeaders'] = self.custom_headers.to_dict()
158
+ # override the default output from pydantic by calling `to_dict()` of each item in agents (list)
159
+ _items = []
160
+ if self.agents:
161
+ for _item in self.agents:
162
+ if _item:
163
+ _items.append(_item.to_dict())
164
+ _dict['agents'] = _items
165
+ return _dict
166
+
167
+ @classmethod
168
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
169
+ """Create an instance of PageLoadInstantTestRequest from a dict"""
170
+ if obj is None:
171
+ return None
172
+
173
+ if not isinstance(obj, dict):
174
+ return cls.model_validate(obj)
175
+
176
+ _obj = cls.model_validate({
177
+ "createdBy": obj.get("createdBy"),
178
+ "createdDate": obj.get("createdDate"),
179
+ "description": obj.get("description"),
180
+ "liveShare": obj.get("liveShare"),
181
+ "modifiedBy": obj.get("modifiedBy"),
182
+ "modifiedDate": obj.get("modifiedDate"),
183
+ "savedEvent": obj.get("savedEvent"),
184
+ "testId": obj.get("testId"),
185
+ "testName": obj.get("testName"),
186
+ "type": obj.get("type"),
187
+ "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
188
+ "labels": obj.get("labels"),
189
+ "sharedWithAccounts": obj.get("sharedWithAccounts"),
190
+ "authType": obj.get("authType"),
191
+ "bandwidthMeasurements": obj.get("bandwidthMeasurements"),
192
+ "clientCertificate": obj.get("clientCertificate"),
193
+ "contentRegex": obj.get("contentRegex"),
194
+ "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None,
195
+ "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200',
196
+ "emulatedDeviceId": obj.get("emulatedDeviceId"),
197
+ "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True,
198
+ "httpTargetTime": obj.get("httpTargetTime"),
199
+ "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5,
200
+ "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2,
201
+ "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True,
202
+ "mtuMeasurements": obj.get("mtuMeasurements"),
203
+ "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True,
204
+ "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
205
+ "pageLoadTargetTime": obj.get("pageLoadTargetTime"),
206
+ "pageLoadTimeLimit": obj.get("pageLoadTimeLimit") if obj.get("pageLoadTimeLimit") is not None else 10,
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
+ "url": obj.get("url"),
214
+ "useNtlm": obj.get("useNtlm"),
215
+ "userAgent": obj.get("userAgent"),
216
+ "username": obj.get("username"),
217
+ "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False,
218
+ "allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True,
219
+ "blockDomains": obj.get("blockDomains"),
220
+ "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False,
221
+ "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False,
222
+ "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False,
223
+ "browserLanguage": obj.get("browserLanguage"),
224
+ "pageLoadingStrategy": obj.get("pageLoadingStrategy"),
225
+ "fixedPacketRate": obj.get("fixedPacketRate"),
226
+ "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False,
227
+ "overrideProxyId": obj.get("overrideProxyId"),
228
+ "agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None
229
+ })
230
+ return _obj
231
+
232
+
@@ -0,0 +1,179 @@
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.test_auth_type import TestAuthType
24
+ from thousandeyes_sdk.instant_tests.models.test_custom_headers import TestCustomHeaders
25
+ from thousandeyes_sdk.instant_tests.models.test_page_loading_strategy import TestPageLoadingStrategy
26
+ from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode
27
+ from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode
28
+ from thousandeyes_sdk.instant_tests.models.test_protocol import TestProtocol
29
+ from thousandeyes_sdk.instant_tests.models.test_ssl_version_id import TestSslVersionId
30
+ from typing import Optional, Set
31
+ from typing_extensions import Self
32
+
33
+ class PageLoadProperties(BaseModel):
34
+ """
35
+ PageLoadProperties
36
+ """ # noqa: E501
37
+ auth_type: Optional[TestAuthType] = Field(default=None, alias="authType")
38
+ 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")
39
+ 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")
40
+ content_regex: Optional[StrictStr] = Field(default=None, description="Verify content using a regular expression. This field does not require escaping.", alias="contentRegex")
41
+ custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders")
42
+ desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode")
43
+ 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")
44
+ 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")
45
+ 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")
46
+ http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit")
47
+ 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")
48
+ include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders")
49
+ mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements")
50
+ 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")
51
+ 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")
52
+ page_load_target_time: Optional[Annotated[int, Field(le=30, strict=True, ge=1)]] = Field(default=None, description="Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`.", alias="pageLoadTargetTime")
53
+ page_load_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=10, description="Page load time limit. Must be larger than the `httpTimeLimit`.", alias="pageLoadTimeLimit")
54
+ password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.")
55
+ path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
56
+ probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode")
57
+ protocol: Optional[TestProtocol] = None
58
+ ssl_version: Optional[StrictStr] = Field(default=None, description="Reflects the verbose SSL protocol version used by a test.", alias="sslVersion")
59
+ ssl_version_id: Optional[TestSslVersionId] = Field(default=None, alias="sslVersionId")
60
+ url: StrictStr = Field(description="Target for the test.")
61
+ 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")
62
+ user_agent: Optional[StrictStr] = Field(default=None, description="User-agent string to be provided during the test.", alias="userAgent")
63
+ username: Optional[StrictStr] = Field(default=None, description="Username for Basic/NTLM authentication.")
64
+ verify_certificate: Optional[StrictBool] = Field(default=False, description="Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.", alias="verifyCertificate")
65
+ 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")
66
+ 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")
67
+ disable_screenshot: Optional[StrictBool] = Field(default=False, description="Enables or disables screenshots on error. Set true to not capture", alias="disableScreenshot")
68
+ 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")
69
+ allow_geolocation: Optional[StrictBool] = Field(default=False, description="Set true to use the agent’s geolocation by the web page.", alias="allowGeolocation")
70
+ 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")
71
+ page_loading_strategy: Optional[TestPageLoadingStrategy] = Field(default=None, alias="pageLoadingStrategy")
72
+ 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")
73
+ type: Optional[StrictStr] = None
74
+ 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")
75
+ override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId")
76
+ __properties: ClassVar[List[str]] = ["authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "customHeaders", "desiredStatusCode", "emulatedDeviceId", "followRedirects", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "pageLoadTargetTime", "pageLoadTimeLimit", "password", "pathTraceMode", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "blockDomains", "disableScreenshot", "allowMicAndCamera", "allowGeolocation", "browserLanguage", "pageLoadingStrategy", "fixedPacketRate", "type", "overrideAgentProxy", "overrideProxyId"]
77
+
78
+ model_config = ConfigDict(
79
+ populate_by_name=True,
80
+ validate_assignment=True,
81
+ protected_namespaces=(),
82
+ extra="allow",
83
+ )
84
+
85
+
86
+ def to_str(self) -> str:
87
+ """Returns the string representation of the model using alias"""
88
+ return pprint.pformat(self.model_dump(by_alias=True))
89
+
90
+ def to_json(self) -> str:
91
+ """Returns the JSON representation of the model using alias"""
92
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
93
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
94
+
95
+ @classmethod
96
+ def from_json(cls, json_str: str) -> Optional[Self]:
97
+ """Create an instance of PageLoadProperties from a JSON string"""
98
+ return cls.from_dict(json.loads(json_str))
99
+
100
+ def to_dict(self) -> Dict[str, Any]:
101
+ """Return the dictionary representation of the model using alias.
102
+
103
+ This has the following differences from calling pydantic's
104
+ `self.model_dump(by_alias=True)`:
105
+
106
+ * `None` is only added to the output dict for nullable fields that
107
+ were set at model initialization. Other fields with value `None`
108
+ are ignored.
109
+ * OpenAPI `readOnly` fields are excluded.
110
+ * OpenAPI `readOnly` fields are excluded.
111
+ """
112
+ excluded_fields: Set[str] = set([
113
+ "ssl_version",
114
+ "type",
115
+ ])
116
+
117
+ _dict = self.model_dump(
118
+ by_alias=True,
119
+ exclude=excluded_fields,
120
+ exclude_none=True,
121
+ )
122
+ # override the default output from pydantic by calling `to_dict()` of custom_headers
123
+ if self.custom_headers:
124
+ _dict['customHeaders'] = self.custom_headers.to_dict()
125
+ return _dict
126
+
127
+ @classmethod
128
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
129
+ """Create an instance of PageLoadProperties from a dict"""
130
+ if obj is None:
131
+ return None
132
+
133
+ if not isinstance(obj, dict):
134
+ return cls.model_validate(obj)
135
+
136
+ _obj = cls.model_validate({
137
+ "authType": obj.get("authType"),
138
+ "bandwidthMeasurements": obj.get("bandwidthMeasurements"),
139
+ "clientCertificate": obj.get("clientCertificate"),
140
+ "contentRegex": obj.get("contentRegex"),
141
+ "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None,
142
+ "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200',
143
+ "emulatedDeviceId": obj.get("emulatedDeviceId"),
144
+ "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True,
145
+ "httpTargetTime": obj.get("httpTargetTime"),
146
+ "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5,
147
+ "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2,
148
+ "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True,
149
+ "mtuMeasurements": obj.get("mtuMeasurements"),
150
+ "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True,
151
+ "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
152
+ "pageLoadTargetTime": obj.get("pageLoadTargetTime"),
153
+ "pageLoadTimeLimit": obj.get("pageLoadTimeLimit") if obj.get("pageLoadTimeLimit") is not None else 10,
154
+ "password": obj.get("password"),
155
+ "pathTraceMode": obj.get("pathTraceMode"),
156
+ "probeMode": obj.get("probeMode"),
157
+ "protocol": obj.get("protocol"),
158
+ "sslVersion": obj.get("sslVersion"),
159
+ "sslVersionId": obj.get("sslVersionId"),
160
+ "url": obj.get("url"),
161
+ "useNtlm": obj.get("useNtlm"),
162
+ "userAgent": obj.get("userAgent"),
163
+ "username": obj.get("username"),
164
+ "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False,
165
+ "allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True,
166
+ "blockDomains": obj.get("blockDomains"),
167
+ "disableScreenshot": obj.get("disableScreenshot") if obj.get("disableScreenshot") is not None else False,
168
+ "allowMicAndCamera": obj.get("allowMicAndCamera") if obj.get("allowMicAndCamera") is not None else False,
169
+ "allowGeolocation": obj.get("allowGeolocation") if obj.get("allowGeolocation") is not None else False,
170
+ "browserLanguage": obj.get("browserLanguage"),
171
+ "pageLoadingStrategy": obj.get("pageLoadingStrategy"),
172
+ "fixedPacketRate": obj.get("fixedPacketRate"),
173
+ "type": obj.get("type"),
174
+ "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False,
175
+ "overrideProxyId": obj.get("overrideProxyId")
176
+ })
177
+ return _obj
178
+
179
+
@@ -0,0 +1,185 @@
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, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing_extensions import Annotated
24
+ from thousandeyes_sdk.instant_tests.models.ftp_server_request_type import FtpServerRequestType
25
+ from thousandeyes_sdk.instant_tests.models.test_agent import TestAgent
26
+ from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy
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 typing import Optional, Set
32
+ from typing_extensions import Self
33
+
34
+ class ServerInstantTestRequest(BaseModel):
35
+ """
36
+ ServerInstantTestRequest
37
+ """ # noqa: E501
38
+ created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
39
+ created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
40
+ description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
41
+ live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
42
+ modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
43
+ modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
44
+ saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
45
+ 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")
46
+ test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
47
+ type: Optional[StrictStr] = None
48
+ links: Optional[TestLinks] = Field(default=None, alias="_links")
49
+ labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).")
50
+ 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")
51
+ 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")
52
+ download_limit: Optional[StrictInt] = Field(default=None, description="Specify maximum number of bytes to download from the target object.", alias="downloadLimit")
53
+ ftp_target_time: Optional[Annotated[int, Field(le=6000, strict=True, ge=1000)]] = Field(default=None, description="Target time for operation completion; specified in milliseconds.", alias="ftpTargetTime")
54
+ ftp_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=10)]] = Field(default=10, description="Set the time limit for the test in seconds.", alias="ftpTimeLimit")
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
+ password: StrictStr = Field(description="Password for Basic/NTLM authentication.")
59
+ path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
60
+ probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode")
61
+ protocol: Optional[TestProtocol] = None
62
+ request_type: FtpServerRequestType = Field(alias="requestType")
63
+ url: StrictStr = Field(description="Target for the test.")
64
+ use_active_ftp: Optional[StrictBool] = Field(default=False, description="Explicitly set the flag to use active FTP.", alias="useActiveFtp")
65
+ use_explicit_ftps: Optional[StrictBool] = Field(default=None, description="Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS.", alias="useExplicitFtps")
66
+ username: StrictStr = Field(description="Username for Basic/NTLM authentication.")
67
+ 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")
68
+ ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy")
69
+ agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).")
70
+ __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "downloadLimit", "ftpTargetTime", "ftpTimeLimit", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "probeMode", "protocol", "requestType", "url", "useActiveFtp", "useExplicitFtps", "username", "fixedPacketRate", "ipv6Policy", "agents"]
71
+
72
+ model_config = ConfigDict(
73
+ populate_by_name=True,
74
+ validate_assignment=True,
75
+ protected_namespaces=(),
76
+ extra="allow",
77
+ )
78
+
79
+
80
+ def to_str(self) -> str:
81
+ """Returns the string representation of the model using alias"""
82
+ return pprint.pformat(self.model_dump(by_alias=True))
83
+
84
+ def to_json(self) -> str:
85
+ """Returns the JSON representation of the model using alias"""
86
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
87
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
88
+
89
+ @classmethod
90
+ def from_json(cls, json_str: str) -> Optional[Self]:
91
+ """Create an instance of ServerInstantTestRequest from a JSON string"""
92
+ return cls.from_dict(json.loads(json_str))
93
+
94
+ def to_dict(self) -> Dict[str, Any]:
95
+ """Return the dictionary representation of the model using alias.
96
+
97
+ This has the following differences from calling pydantic's
98
+ `self.model_dump(by_alias=True)`:
99
+
100
+ * `None` is only added to the output dict for nullable fields that
101
+ were set at model initialization. Other fields with value `None`
102
+ are ignored.
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
+ """
112
+ excluded_fields: Set[str] = set([
113
+ "created_by",
114
+ "created_date",
115
+ "live_share",
116
+ "modified_by",
117
+ "modified_date",
118
+ "saved_event",
119
+ "test_id",
120
+ "type",
121
+ ])
122
+
123
+ _dict = self.model_dump(
124
+ by_alias=True,
125
+ exclude=excluded_fields,
126
+ exclude_none=True,
127
+ )
128
+ # override the default output from pydantic by calling `to_dict()` of links
129
+ if self.links:
130
+ _dict['_links'] = self.links.to_dict()
131
+ # override the default output from pydantic by calling `to_dict()` of each item in agents (list)
132
+ _items = []
133
+ if self.agents:
134
+ for _item in self.agents:
135
+ if _item:
136
+ _items.append(_item.to_dict())
137
+ _dict['agents'] = _items
138
+ return _dict
139
+
140
+ @classmethod
141
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
142
+ """Create an instance of ServerInstantTestRequest from a dict"""
143
+ if obj is None:
144
+ return None
145
+
146
+ if not isinstance(obj, dict):
147
+ return cls.model_validate(obj)
148
+
149
+ _obj = cls.model_validate({
150
+ "createdBy": obj.get("createdBy"),
151
+ "createdDate": obj.get("createdDate"),
152
+ "description": obj.get("description"),
153
+ "liveShare": obj.get("liveShare"),
154
+ "modifiedBy": obj.get("modifiedBy"),
155
+ "modifiedDate": obj.get("modifiedDate"),
156
+ "savedEvent": obj.get("savedEvent"),
157
+ "testId": obj.get("testId"),
158
+ "testName": obj.get("testName"),
159
+ "type": obj.get("type"),
160
+ "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
161
+ "labels": obj.get("labels"),
162
+ "sharedWithAccounts": obj.get("sharedWithAccounts"),
163
+ "bandwidthMeasurements": obj.get("bandwidthMeasurements"),
164
+ "downloadLimit": obj.get("downloadLimit"),
165
+ "ftpTargetTime": obj.get("ftpTargetTime"),
166
+ "ftpTimeLimit": obj.get("ftpTimeLimit") if obj.get("ftpTimeLimit") is not None else 10,
167
+ "mtuMeasurements": obj.get("mtuMeasurements"),
168
+ "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True,
169
+ "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
170
+ "password": obj.get("password"),
171
+ "pathTraceMode": obj.get("pathTraceMode"),
172
+ "probeMode": obj.get("probeMode"),
173
+ "protocol": obj.get("protocol"),
174
+ "requestType": obj.get("requestType"),
175
+ "url": obj.get("url"),
176
+ "useActiveFtp": obj.get("useActiveFtp") if obj.get("useActiveFtp") is not None else False,
177
+ "useExplicitFtps": obj.get("useExplicitFtps"),
178
+ "username": obj.get("username"),
179
+ "fixedPacketRate": obj.get("fixedPacketRate"),
180
+ "ipv6Policy": obj.get("ipv6Policy"),
181
+ "agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None
182
+ })
183
+ return _obj
184
+
185
+