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,224 @@
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.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_ipv6_policy import TestIpv6Policy
28
+ from thousandeyes_sdk.instant_tests.models.test_links import TestLinks
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 HttpServerInstantTestRequest(BaseModel):
37
+ """
38
+ HttpServerInstantTestRequest
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="Content regex, this field does not require escaping.", alias="contentRegex")
57
+ headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.")
58
+ custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders")
59
+ desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode")
60
+ download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit")
61
+ dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride")
62
+ 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")
63
+ http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit")
64
+ 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")
65
+ include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders")
66
+ mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements")
67
+ 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")
68
+ 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")
69
+ password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.")
70
+ path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
71
+ post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody")
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
+ ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy")
83
+ 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")
84
+ 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")
85
+ 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")
86
+ override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId")
87
+ agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).")
88
+ __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "headers", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "postBody", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "ipv6Policy", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "agents"]
89
+
90
+ model_config = ConfigDict(
91
+ populate_by_name=True,
92
+ validate_assignment=True,
93
+ protected_namespaces=(),
94
+ extra="allow",
95
+ )
96
+
97
+
98
+ def to_str(self) -> str:
99
+ """Returns the string representation of the model using alias"""
100
+ return pprint.pformat(self.model_dump(by_alias=True))
101
+
102
+ def to_json(self) -> str:
103
+ """Returns the JSON representation of the model using alias"""
104
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
105
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
106
+
107
+ @classmethod
108
+ def from_json(cls, json_str: str) -> Optional[Self]:
109
+ """Create an instance of HttpServerInstantTestRequest from a JSON string"""
110
+ return cls.from_dict(json.loads(json_str))
111
+
112
+ def to_dict(self) -> Dict[str, Any]:
113
+ """Return the dictionary representation of the model using alias.
114
+
115
+ This has the following differences from calling pydantic's
116
+ `self.model_dump(by_alias=True)`:
117
+
118
+ * `None` is only added to the output dict for nullable fields that
119
+ were set at model initialization. Other fields with value `None`
120
+ are ignored.
121
+ * OpenAPI `readOnly` fields are excluded.
122
+ * OpenAPI `readOnly` fields are excluded.
123
+ * OpenAPI `readOnly` fields are excluded.
124
+ * OpenAPI `readOnly` fields are excluded.
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
+ """
131
+ excluded_fields: Set[str] = set([
132
+ "created_by",
133
+ "created_date",
134
+ "live_share",
135
+ "modified_by",
136
+ "modified_date",
137
+ "saved_event",
138
+ "test_id",
139
+ "type",
140
+ "ssl_version",
141
+ ])
142
+
143
+ _dict = self.model_dump(
144
+ by_alias=True,
145
+ exclude=excluded_fields,
146
+ exclude_none=True,
147
+ )
148
+ # override the default output from pydantic by calling `to_dict()` of links
149
+ if self.links:
150
+ _dict['_links'] = self.links.to_dict()
151
+ # override the default output from pydantic by calling `to_dict()` of custom_headers
152
+ if self.custom_headers:
153
+ _dict['customHeaders'] = self.custom_headers.to_dict()
154
+ # override the default output from pydantic by calling `to_dict()` of each item in agents (list)
155
+ _items = []
156
+ if self.agents:
157
+ for _item in self.agents:
158
+ if _item:
159
+ _items.append(_item.to_dict())
160
+ _dict['agents'] = _items
161
+ return _dict
162
+
163
+ @classmethod
164
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
165
+ """Create an instance of HttpServerInstantTestRequest from a dict"""
166
+ if obj is None:
167
+ return None
168
+
169
+ if not isinstance(obj, dict):
170
+ return cls.model_validate(obj)
171
+
172
+ _obj = cls.model_validate({
173
+ "createdBy": obj.get("createdBy"),
174
+ "createdDate": obj.get("createdDate"),
175
+ "description": obj.get("description"),
176
+ "liveShare": obj.get("liveShare"),
177
+ "modifiedBy": obj.get("modifiedBy"),
178
+ "modifiedDate": obj.get("modifiedDate"),
179
+ "savedEvent": obj.get("savedEvent"),
180
+ "testId": obj.get("testId"),
181
+ "testName": obj.get("testName"),
182
+ "type": obj.get("type"),
183
+ "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
184
+ "labels": obj.get("labels"),
185
+ "sharedWithAccounts": obj.get("sharedWithAccounts"),
186
+ "authType": obj.get("authType"),
187
+ "bandwidthMeasurements": obj.get("bandwidthMeasurements"),
188
+ "clientCertificate": obj.get("clientCertificate"),
189
+ "contentRegex": obj.get("contentRegex"),
190
+ "headers": obj.get("headers"),
191
+ "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None,
192
+ "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200',
193
+ "downloadLimit": obj.get("downloadLimit"),
194
+ "dnsOverride": obj.get("dnsOverride"),
195
+ "httpTargetTime": obj.get("httpTargetTime"),
196
+ "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5,
197
+ "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2,
198
+ "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True,
199
+ "mtuMeasurements": obj.get("mtuMeasurements"),
200
+ "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True,
201
+ "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
202
+ "password": obj.get("password"),
203
+ "pathTraceMode": obj.get("pathTraceMode"),
204
+ "postBody": obj.get("postBody"),
205
+ "probeMode": obj.get("probeMode"),
206
+ "protocol": obj.get("protocol"),
207
+ "sslVersion": obj.get("sslVersion"),
208
+ "sslVersionId": obj.get("sslVersionId"),
209
+ "url": obj.get("url"),
210
+ "useNtlm": obj.get("useNtlm"),
211
+ "userAgent": obj.get("userAgent"),
212
+ "username": obj.get("username"),
213
+ "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False,
214
+ "allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True,
215
+ "ipv6Policy": obj.get("ipv6Policy"),
216
+ "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True,
217
+ "fixedPacketRate": obj.get("fixedPacketRate"),
218
+ "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False,
219
+ "overrideProxyId": obj.get("overrideProxyId"),
220
+ "agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None
221
+ })
222
+ return _obj
223
+
224
+
@@ -0,0 +1,171 @@
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, StrictInt, 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_ipv6_policy import TestIpv6Policy
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 HttpServerProperties(BaseModel):
34
+ """
35
+ HttpServerProperties
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="Content regex, this field does not require escaping.", alias="contentRegex")
41
+ headers: Optional[List[StrictStr]] = Field(default=None, description="HTTP request headers used.")
42
+ custom_headers: Optional[TestCustomHeaders] = Field(default=None, alias="customHeaders")
43
+ desired_status_code: Optional[StrictStr] = Field(default='200', description="Specify the HTTP status code value that indicates a successful response.", alias="desiredStatusCode")
44
+ download_limit: Optional[StrictInt] = Field(default=None, description="Specifies maximum number of bytes to download from the target object.", alias="downloadLimit")
45
+ dns_override: Optional[StrictStr] = Field(default=None, description="IP address to use for DNS override.", alias="dnsOverride")
46
+ 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")
47
+ http_time_limit: Optional[Annotated[int, Field(le=60, strict=True, ge=5)]] = Field(default=5, description="HTTP time limit in seconds.", alias="httpTimeLimit")
48
+ 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")
49
+ include_headers: Optional[StrictBool] = Field(default=True, description="Set to `true` to capture response headers for objects loaded by the test.", alias="includeHeaders")
50
+ mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements")
51
+ 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")
52
+ 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")
53
+ password: Optional[StrictStr] = Field(default=None, description="Password for Basic/NTLM authentication.")
54
+ path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
55
+ post_body: Optional[StrictStr] = Field(default=None, description="Enter the body for the HTTP POST request in this field. No special escaping is necessary. If the post body is provided with content, the `requestMethod` is automatically set to POST.", alias="postBody")
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
+ ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy")
67
+ 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")
68
+ 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")
69
+ 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")
70
+ override_proxy_id: Optional[StrictStr] = Field(default=None, description="ID of the proxy to be used if the default proxy is overridden.", alias="overrideProxyId")
71
+ type: Optional[StrictStr] = None
72
+ __properties: ClassVar[List[str]] = ["authType", "bandwidthMeasurements", "clientCertificate", "contentRegex", "headers", "customHeaders", "desiredStatusCode", "downloadLimit", "dnsOverride", "httpTargetTime", "httpTimeLimit", "httpVersion", "includeHeaders", "mtuMeasurements", "networkMeasurements", "numPathTraces", "password", "pathTraceMode", "postBody", "probeMode", "protocol", "sslVersion", "sslVersionId", "url", "useNtlm", "userAgent", "username", "verifyCertificate", "allowUnsafeLegacyRenegotiation", "ipv6Policy", "followRedirects", "fixedPacketRate", "overrideAgentProxy", "overrideProxyId", "type"]
73
+
74
+ model_config = ConfigDict(
75
+ populate_by_name=True,
76
+ validate_assignment=True,
77
+ protected_namespaces=(),
78
+ extra="allow",
79
+ )
80
+
81
+
82
+ def to_str(self) -> str:
83
+ """Returns the string representation of the model using alias"""
84
+ return pprint.pformat(self.model_dump(by_alias=True))
85
+
86
+ def to_json(self) -> str:
87
+ """Returns the JSON representation of the model using alias"""
88
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
89
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
90
+
91
+ @classmethod
92
+ def from_json(cls, json_str: str) -> Optional[Self]:
93
+ """Create an instance of HttpServerProperties from a JSON string"""
94
+ return cls.from_dict(json.loads(json_str))
95
+
96
+ def to_dict(self) -> Dict[str, Any]:
97
+ """Return the dictionary representation of the model using alias.
98
+
99
+ This has the following differences from calling pydantic's
100
+ `self.model_dump(by_alias=True)`:
101
+
102
+ * `None` is only added to the output dict for nullable fields that
103
+ were set at model initialization. Other fields with value `None`
104
+ are ignored.
105
+ * OpenAPI `readOnly` fields are excluded.
106
+ * OpenAPI `readOnly` fields are excluded.
107
+ """
108
+ excluded_fields: Set[str] = set([
109
+ "ssl_version",
110
+ "type",
111
+ ])
112
+
113
+ _dict = self.model_dump(
114
+ by_alias=True,
115
+ exclude=excluded_fields,
116
+ exclude_none=True,
117
+ )
118
+ # override the default output from pydantic by calling `to_dict()` of custom_headers
119
+ if self.custom_headers:
120
+ _dict['customHeaders'] = self.custom_headers.to_dict()
121
+ return _dict
122
+
123
+ @classmethod
124
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
125
+ """Create an instance of HttpServerProperties from a dict"""
126
+ if obj is None:
127
+ return None
128
+
129
+ if not isinstance(obj, dict):
130
+ return cls.model_validate(obj)
131
+
132
+ _obj = cls.model_validate({
133
+ "authType": obj.get("authType"),
134
+ "bandwidthMeasurements": obj.get("bandwidthMeasurements"),
135
+ "clientCertificate": obj.get("clientCertificate"),
136
+ "contentRegex": obj.get("contentRegex"),
137
+ "headers": obj.get("headers"),
138
+ "customHeaders": TestCustomHeaders.from_dict(obj["customHeaders"]) if obj.get("customHeaders") is not None else None,
139
+ "desiredStatusCode": obj.get("desiredStatusCode") if obj.get("desiredStatusCode") is not None else '200',
140
+ "downloadLimit": obj.get("downloadLimit"),
141
+ "dnsOverride": obj.get("dnsOverride"),
142
+ "httpTargetTime": obj.get("httpTargetTime"),
143
+ "httpTimeLimit": obj.get("httpTimeLimit") if obj.get("httpTimeLimit") is not None else 5,
144
+ "httpVersion": obj.get("httpVersion") if obj.get("httpVersion") is not None else 2,
145
+ "includeHeaders": obj.get("includeHeaders") if obj.get("includeHeaders") is not None else True,
146
+ "mtuMeasurements": obj.get("mtuMeasurements"),
147
+ "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True,
148
+ "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
149
+ "password": obj.get("password"),
150
+ "pathTraceMode": obj.get("pathTraceMode"),
151
+ "postBody": obj.get("postBody"),
152
+ "probeMode": obj.get("probeMode"),
153
+ "protocol": obj.get("protocol"),
154
+ "sslVersion": obj.get("sslVersion"),
155
+ "sslVersionId": obj.get("sslVersionId"),
156
+ "url": obj.get("url"),
157
+ "useNtlm": obj.get("useNtlm"),
158
+ "userAgent": obj.get("userAgent"),
159
+ "username": obj.get("username"),
160
+ "verifyCertificate": obj.get("verifyCertificate") if obj.get("verifyCertificate") is not None else False,
161
+ "allowUnsafeLegacyRenegotiation": obj.get("allowUnsafeLegacyRenegotiation") if obj.get("allowUnsafeLegacyRenegotiation") is not None else True,
162
+ "ipv6Policy": obj.get("ipv6Policy"),
163
+ "followRedirects": obj.get("followRedirects") if obj.get("followRedirects") is not None else True,
164
+ "fixedPacketRate": obj.get("fixedPacketRate"),
165
+ "overrideAgentProxy": obj.get("overrideAgentProxy") if obj.get("overrideAgentProxy") is not None else False,
166
+ "overrideProxyId": obj.get("overrideProxyId"),
167
+ "type": obj.get("type")
168
+ })
169
+ return _obj
170
+
171
+
@@ -0,0 +1,152 @@
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 thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount
24
+ from thousandeyes_sdk.instant_tests.models.test_label import TestLabel
25
+ from thousandeyes_sdk.instant_tests.models.test_links import TestLinks
26
+ from thousandeyes_sdk.instant_tests.models.test_type import TestType
27
+ from typing import Optional, Set
28
+ from typing_extensions import Self
29
+
30
+ class InstantTest(BaseModel):
31
+ """
32
+ InstantTest
33
+ """ # noqa: E501
34
+ created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
35
+ created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
36
+ description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
37
+ live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
38
+ modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
39
+ modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
40
+ saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
41
+ 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")
42
+ test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
43
+ type: Optional[TestType] = None
44
+ links: Optional[TestLinks] = Field(default=None, alias="_links")
45
+ labels: Optional[List[TestLabel]] = None
46
+ shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts")
47
+ __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts"]
48
+
49
+ model_config = ConfigDict(
50
+ populate_by_name=True,
51
+ validate_assignment=True,
52
+ protected_namespaces=(),
53
+ extra="allow",
54
+ )
55
+
56
+
57
+ def to_str(self) -> str:
58
+ """Returns the string representation of the model using alias"""
59
+ return pprint.pformat(self.model_dump(by_alias=True))
60
+
61
+ def to_json(self) -> str:
62
+ """Returns the JSON representation of the model using alias"""
63
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
64
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
65
+
66
+ @classmethod
67
+ def from_json(cls, json_str: str) -> Optional[Self]:
68
+ """Create an instance of InstantTest from a JSON string"""
69
+ return cls.from_dict(json.loads(json_str))
70
+
71
+ def to_dict(self) -> Dict[str, Any]:
72
+ """Return the dictionary representation of the model using alias.
73
+
74
+ This has the following differences from calling pydantic's
75
+ `self.model_dump(by_alias=True)`:
76
+
77
+ * `None` is only added to the output dict for nullable fields that
78
+ were set at model initialization. Other fields with value `None`
79
+ are ignored.
80
+ * OpenAPI `readOnly` fields are excluded.
81
+ * OpenAPI `readOnly` fields are excluded.
82
+ * OpenAPI `readOnly` fields are excluded.
83
+ * OpenAPI `readOnly` fields are excluded.
84
+ * OpenAPI `readOnly` fields are excluded.
85
+ * OpenAPI `readOnly` fields are excluded.
86
+ * OpenAPI `readOnly` fields are excluded.
87
+ * OpenAPI `readOnly` fields are excluded.
88
+ * OpenAPI `readOnly` fields are excluded.
89
+ """
90
+ excluded_fields: Set[str] = set([
91
+ "created_by",
92
+ "created_date",
93
+ "live_share",
94
+ "modified_by",
95
+ "modified_date",
96
+ "saved_event",
97
+ "test_id",
98
+ "labels",
99
+ "shared_with_accounts",
100
+ ])
101
+
102
+ _dict = self.model_dump(
103
+ by_alias=True,
104
+ exclude=excluded_fields,
105
+ exclude_none=True,
106
+ )
107
+ # override the default output from pydantic by calling `to_dict()` of links
108
+ if self.links:
109
+ _dict['_links'] = self.links.to_dict()
110
+ # override the default output from pydantic by calling `to_dict()` of each item in labels (list)
111
+ _items = []
112
+ if self.labels:
113
+ for _item in self.labels:
114
+ if _item:
115
+ _items.append(_item.to_dict())
116
+ _dict['labels'] = _items
117
+ # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list)
118
+ _items = []
119
+ if self.shared_with_accounts:
120
+ for _item in self.shared_with_accounts:
121
+ if _item:
122
+ _items.append(_item.to_dict())
123
+ _dict['sharedWithAccounts'] = _items
124
+ return _dict
125
+
126
+ @classmethod
127
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
128
+ """Create an instance of InstantTest from a dict"""
129
+ if obj is None:
130
+ return None
131
+
132
+ if not isinstance(obj, dict):
133
+ return cls.model_validate(obj)
134
+
135
+ _obj = cls.model_validate({
136
+ "createdBy": obj.get("createdBy"),
137
+ "createdDate": obj.get("createdDate"),
138
+ "description": obj.get("description"),
139
+ "liveShare": obj.get("liveShare"),
140
+ "modifiedBy": obj.get("modifiedBy"),
141
+ "modifiedDate": obj.get("modifiedDate"),
142
+ "savedEvent": obj.get("savedEvent"),
143
+ "testId": obj.get("testId"),
144
+ "testName": obj.get("testName"),
145
+ "type": obj.get("type"),
146
+ "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
147
+ "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None,
148
+ "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None
149
+ })
150
+ return _obj
151
+
152
+