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,90 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Instant Tests API
5
+
6
+ The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test.
7
+
8
+ The version of the OpenAPI document: 7.0.8
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class SharedWithAccount(BaseModel):
26
+ """
27
+ SharedWithAccount
28
+ """ # noqa: E501
29
+ aid: Optional[StrictStr] = Field(default=None, description="Account group ID.")
30
+ name: Optional[StrictStr] = Field(default=None, description="Account group name.")
31
+ __properties: ClassVar[List[str]] = ["aid", "name"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ extra="allow",
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of SharedWithAccount from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of SharedWithAccount from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "aid": obj.get("aid"),
86
+ "name": obj.get("name")
87
+ })
88
+ return _obj
89
+
90
+
@@ -0,0 +1,122 @@
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 import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class SimpleAgent(BaseModel):
26
+ """
27
+ SimpleAgent
28
+ """ # noqa: E501
29
+ ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
30
+ public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
31
+ network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agent’s public IP.")
32
+ agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId")
33
+ agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName")
34
+ location: Optional[StrictStr] = Field(default=None, description="Location of the agent.")
35
+ country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId")
36
+ enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.")
37
+ prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.")
38
+ verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates")
39
+ __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates"]
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ extra="allow",
46
+ )
47
+
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.model_dump(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of SimpleAgent from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ * OpenAPI `readOnly` fields are excluded.
73
+ * OpenAPI `readOnly` fields are excluded.
74
+ * OpenAPI `readOnly` fields are excluded.
75
+ * OpenAPI `readOnly` fields are excluded.
76
+ * OpenAPI `readOnly` fields are excluded.
77
+ * OpenAPI `readOnly` fields are excluded.
78
+ * OpenAPI `readOnly` fields are excluded.
79
+ * OpenAPI `readOnly` fields are excluded.
80
+ """
81
+ excluded_fields: Set[str] = set([
82
+ "ip_addresses",
83
+ "public_ip_addresses",
84
+ "network",
85
+ "agent_id",
86
+ "location",
87
+ "country_id",
88
+ "prefix",
89
+ "verify_ssl_certificates",
90
+ ])
91
+
92
+ _dict = self.model_dump(
93
+ by_alias=True,
94
+ exclude=excluded_fields,
95
+ exclude_none=True,
96
+ )
97
+ return _dict
98
+
99
+ @classmethod
100
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
101
+ """Create an instance of SimpleAgent from a dict"""
102
+ if obj is None:
103
+ return None
104
+
105
+ if not isinstance(obj, dict):
106
+ return cls.model_validate(obj)
107
+
108
+ _obj = cls.model_validate({
109
+ "ipAddresses": obj.get("ipAddresses"),
110
+ "publicIpAddresses": obj.get("publicIpAddresses"),
111
+ "network": obj.get("network"),
112
+ "agentId": obj.get("agentId"),
113
+ "agentName": obj.get("agentName"),
114
+ "location": obj.get("location"),
115
+ "countryId": obj.get("countryId"),
116
+ "enabled": obj.get("enabled"),
117
+ "prefix": obj.get("prefix"),
118
+ "verifySslCertificates": obj.get("verifySslCertificates")
119
+ })
120
+ return _obj
121
+
122
+
@@ -0,0 +1,191 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Instant Tests API
5
+
6
+ The Instant Tests API endpoint lets you create and run new instant tests. You will need to be a regular user or have the following permissions: * `API Access` * `View tests` The response does not include the immediate test results. Use the Test Results endpoints to get test results after creating and executing an instant test. You can find the URLs for these endpoints in the _links section of the test definition that is returned when you create the instant test.
7
+
8
+ The version of the OpenAPI document: 7.0.8
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing_extensions import Annotated
24
+ from thousandeyes_sdk.instant_tests.models.agent import Agent
25
+ from thousandeyes_sdk.instant_tests.models.shared_with_account import SharedWithAccount
26
+ from thousandeyes_sdk.instant_tests.models.test_ipv6_policy import TestIpv6Policy
27
+ from thousandeyes_sdk.instant_tests.models.test_label import TestLabel
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 typing import Optional, Set
32
+ from typing_extensions import Self
33
+
34
+ class SipServerInstantTest(BaseModel):
35
+ """
36
+ SipServerInstantTest
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[TestLabel]] = None
50
+ shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts")
51
+ mtu_measurements: Optional[StrictBool] = Field(default=None, description="Set `true` to measure MTU sizes on network from agents to the target.", alias="mtuMeasurements")
52
+ 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")
53
+ 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")
54
+ options_regex: Optional[StrictStr] = Field(default=None, description="Options regex, this field does not require escaping.", alias="optionsRegex")
55
+ path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
56
+ probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode")
57
+ register_enabled: Optional[StrictBool] = Field(default=False, description="Set to true to perform SIP registration on the test target with the SIP REGISTER command.", alias="registerEnabled")
58
+ sip_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for test completion in milliseconds.", alias="sipTargetTime")
59
+ sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit")
60
+ 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")
61
+ ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy")
62
+ agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.")
63
+ __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy", "agents"]
64
+
65
+ model_config = ConfigDict(
66
+ populate_by_name=True,
67
+ validate_assignment=True,
68
+ protected_namespaces=(),
69
+ extra="allow",
70
+ )
71
+
72
+
73
+ def to_str(self) -> str:
74
+ """Returns the string representation of the model using alias"""
75
+ return pprint.pformat(self.model_dump(by_alias=True))
76
+
77
+ def to_json(self) -> str:
78
+ """Returns the JSON representation of the model using alias"""
79
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
80
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
81
+
82
+ @classmethod
83
+ def from_json(cls, json_str: str) -> Optional[Self]:
84
+ """Create an instance of SipServerInstantTest from a JSON string"""
85
+ return cls.from_dict(json.loads(json_str))
86
+
87
+ def to_dict(self) -> Dict[str, Any]:
88
+ """Return the dictionary representation of the model using alias.
89
+
90
+ This has the following differences from calling pydantic's
91
+ `self.model_dump(by_alias=True)`:
92
+
93
+ * `None` is only added to the output dict for nullable fields that
94
+ were set at model initialization. Other fields with value `None`
95
+ are ignored.
96
+ * OpenAPI `readOnly` fields are excluded.
97
+ * OpenAPI `readOnly` fields are excluded.
98
+ * OpenAPI `readOnly` fields are excluded.
99
+ * OpenAPI `readOnly` fields are excluded.
100
+ * OpenAPI `readOnly` fields are excluded.
101
+ * OpenAPI `readOnly` fields are excluded.
102
+ * OpenAPI `readOnly` fields are excluded.
103
+ * OpenAPI `readOnly` fields are excluded.
104
+ * OpenAPI `readOnly` fields are excluded.
105
+ * OpenAPI `readOnly` fields are excluded.
106
+ * OpenAPI `readOnly` fields are excluded.
107
+ """
108
+ excluded_fields: Set[str] = set([
109
+ "created_by",
110
+ "created_date",
111
+ "live_share",
112
+ "modified_by",
113
+ "modified_date",
114
+ "saved_event",
115
+ "test_id",
116
+ "type",
117
+ "labels",
118
+ "shared_with_accounts",
119
+ "agents",
120
+ ])
121
+
122
+ _dict = self.model_dump(
123
+ by_alias=True,
124
+ exclude=excluded_fields,
125
+ exclude_none=True,
126
+ )
127
+ # override the default output from pydantic by calling `to_dict()` of links
128
+ if self.links:
129
+ _dict['_links'] = self.links.to_dict()
130
+ # override the default output from pydantic by calling `to_dict()` of each item in labels (list)
131
+ _items = []
132
+ if self.labels:
133
+ for _item in self.labels:
134
+ if _item:
135
+ _items.append(_item.to_dict())
136
+ _dict['labels'] = _items
137
+ # override the default output from pydantic by calling `to_dict()` of each item in shared_with_accounts (list)
138
+ _items = []
139
+ if self.shared_with_accounts:
140
+ for _item in self.shared_with_accounts:
141
+ if _item:
142
+ _items.append(_item.to_dict())
143
+ _dict['sharedWithAccounts'] = _items
144
+ # override the default output from pydantic by calling `to_dict()` of each item in agents (list)
145
+ _items = []
146
+ if self.agents:
147
+ for _item in self.agents:
148
+ if _item:
149
+ _items.append(_item.to_dict())
150
+ _dict['agents'] = _items
151
+ return _dict
152
+
153
+ @classmethod
154
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
155
+ """Create an instance of SipServerInstantTest from a dict"""
156
+ if obj is None:
157
+ return None
158
+
159
+ if not isinstance(obj, dict):
160
+ return cls.model_validate(obj)
161
+
162
+ _obj = cls.model_validate({
163
+ "createdBy": obj.get("createdBy"),
164
+ "createdDate": obj.get("createdDate"),
165
+ "description": obj.get("description"),
166
+ "liveShare": obj.get("liveShare"),
167
+ "modifiedBy": obj.get("modifiedBy"),
168
+ "modifiedDate": obj.get("modifiedDate"),
169
+ "savedEvent": obj.get("savedEvent"),
170
+ "testId": obj.get("testId"),
171
+ "testName": obj.get("testName"),
172
+ "type": obj.get("type"),
173
+ "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
174
+ "labels": [TestLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None,
175
+ "sharedWithAccounts": [SharedWithAccount.from_dict(_item) for _item in obj["sharedWithAccounts"]] if obj.get("sharedWithAccounts") is not None else None,
176
+ "mtuMeasurements": obj.get("mtuMeasurements"),
177
+ "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True,
178
+ "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
179
+ "optionsRegex": obj.get("optionsRegex"),
180
+ "pathTraceMode": obj.get("pathTraceMode"),
181
+ "probeMode": obj.get("probeMode"),
182
+ "registerEnabled": obj.get("registerEnabled") if obj.get("registerEnabled") is not None else False,
183
+ "sipTargetTime": obj.get("sipTargetTime"),
184
+ "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5,
185
+ "fixedPacketRate": obj.get("fixedPacketRate"),
186
+ "ipv6Policy": obj.get("ipv6Policy"),
187
+ "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None
188
+ })
189
+ return _obj
190
+
191
+
@@ -0,0 +1,175 @@
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_ipv6_policy import TestIpv6Policy
26
+ from thousandeyes_sdk.instant_tests.models.test_links import TestLinks
27
+ from thousandeyes_sdk.instant_tests.models.test_path_trace_mode import TestPathTraceMode
28
+ from thousandeyes_sdk.instant_tests.models.test_probe_mode import TestProbeMode
29
+ from thousandeyes_sdk.instant_tests.models.test_sip_credentials import TestSipCredentials
30
+ from typing import Optional, Set
31
+ from typing_extensions import Self
32
+
33
+ class SipServerInstantTestRequest(BaseModel):
34
+ """
35
+ SipServerInstantTestRequest
36
+ """ # noqa: E501
37
+ created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
38
+ created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
39
+ description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
40
+ live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
41
+ modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
42
+ modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
43
+ saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
44
+ 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")
45
+ test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
46
+ type: Optional[StrictStr] = None
47
+ links: Optional[TestLinks] = Field(default=None, alias="_links")
48
+ labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).")
49
+ 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")
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
+ options_regex: Optional[StrictStr] = Field(default=None, description="Options regex, this field does not require escaping.", alias="optionsRegex")
54
+ path_trace_mode: Optional[TestPathTraceMode] = Field(default=None, alias="pathTraceMode")
55
+ probe_mode: Optional[TestProbeMode] = Field(default=None, alias="probeMode")
56
+ register_enabled: Optional[StrictBool] = Field(default=False, description="Set to true to perform SIP registration on the test target with the SIP REGISTER command.", alias="registerEnabled")
57
+ sip_target_time: Optional[Annotated[int, Field(le=5000, strict=True, ge=100)]] = Field(default=None, description="Target time for test completion in milliseconds.", alias="sipTargetTime")
58
+ sip_time_limit: Optional[Annotated[int, Field(le=10, strict=True, ge=5)]] = Field(default=5, description="Time limit in milliseconds.", alias="sipTimeLimit")
59
+ 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")
60
+ ipv6_policy: Optional[TestIpv6Policy] = Field(default=None, alias="ipv6Policy")
61
+ agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).")
62
+ target_sip_credentials: TestSipCredentials = Field(alias="targetSipCredentials")
63
+ __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "mtuMeasurements", "networkMeasurements", "numPathTraces", "optionsRegex", "pathTraceMode", "probeMode", "registerEnabled", "sipTargetTime", "sipTimeLimit", "fixedPacketRate", "ipv6Policy", "agents", "targetSipCredentials"]
64
+
65
+ model_config = ConfigDict(
66
+ populate_by_name=True,
67
+ validate_assignment=True,
68
+ protected_namespaces=(),
69
+ extra="allow",
70
+ )
71
+
72
+
73
+ def to_str(self) -> str:
74
+ """Returns the string representation of the model using alias"""
75
+ return pprint.pformat(self.model_dump(by_alias=True))
76
+
77
+ def to_json(self) -> str:
78
+ """Returns the JSON representation of the model using alias"""
79
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
80
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
81
+
82
+ @classmethod
83
+ def from_json(cls, json_str: str) -> Optional[Self]:
84
+ """Create an instance of SipServerInstantTestRequest from a JSON string"""
85
+ return cls.from_dict(json.loads(json_str))
86
+
87
+ def to_dict(self) -> Dict[str, Any]:
88
+ """Return the dictionary representation of the model using alias.
89
+
90
+ This has the following differences from calling pydantic's
91
+ `self.model_dump(by_alias=True)`:
92
+
93
+ * `None` is only added to the output dict for nullable fields that
94
+ were set at model initialization. Other fields with value `None`
95
+ are ignored.
96
+ * OpenAPI `readOnly` fields are excluded.
97
+ * OpenAPI `readOnly` fields are excluded.
98
+ * OpenAPI `readOnly` fields are excluded.
99
+ * OpenAPI `readOnly` fields are excluded.
100
+ * OpenAPI `readOnly` fields are excluded.
101
+ * OpenAPI `readOnly` fields are excluded.
102
+ * OpenAPI `readOnly` fields are excluded.
103
+ * OpenAPI `readOnly` fields are excluded.
104
+ """
105
+ excluded_fields: Set[str] = set([
106
+ "created_by",
107
+ "created_date",
108
+ "live_share",
109
+ "modified_by",
110
+ "modified_date",
111
+ "saved_event",
112
+ "test_id",
113
+ "type",
114
+ ])
115
+
116
+ _dict = self.model_dump(
117
+ by_alias=True,
118
+ exclude=excluded_fields,
119
+ exclude_none=True,
120
+ )
121
+ # override the default output from pydantic by calling `to_dict()` of links
122
+ if self.links:
123
+ _dict['_links'] = self.links.to_dict()
124
+ # override the default output from pydantic by calling `to_dict()` of each item in agents (list)
125
+ _items = []
126
+ if self.agents:
127
+ for _item in self.agents:
128
+ if _item:
129
+ _items.append(_item.to_dict())
130
+ _dict['agents'] = _items
131
+ # override the default output from pydantic by calling `to_dict()` of target_sip_credentials
132
+ if self.target_sip_credentials:
133
+ _dict['targetSipCredentials'] = self.target_sip_credentials.to_dict()
134
+ return _dict
135
+
136
+ @classmethod
137
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
138
+ """Create an instance of SipServerInstantTestRequest from a dict"""
139
+ if obj is None:
140
+ return None
141
+
142
+ if not isinstance(obj, dict):
143
+ return cls.model_validate(obj)
144
+
145
+ _obj = cls.model_validate({
146
+ "createdBy": obj.get("createdBy"),
147
+ "createdDate": obj.get("createdDate"),
148
+ "description": obj.get("description"),
149
+ "liveShare": obj.get("liveShare"),
150
+ "modifiedBy": obj.get("modifiedBy"),
151
+ "modifiedDate": obj.get("modifiedDate"),
152
+ "savedEvent": obj.get("savedEvent"),
153
+ "testId": obj.get("testId"),
154
+ "testName": obj.get("testName"),
155
+ "type": obj.get("type"),
156
+ "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
157
+ "labels": obj.get("labels"),
158
+ "sharedWithAccounts": obj.get("sharedWithAccounts"),
159
+ "mtuMeasurements": obj.get("mtuMeasurements"),
160
+ "networkMeasurements": obj.get("networkMeasurements") if obj.get("networkMeasurements") is not None else True,
161
+ "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
162
+ "optionsRegex": obj.get("optionsRegex"),
163
+ "pathTraceMode": obj.get("pathTraceMode"),
164
+ "probeMode": obj.get("probeMode"),
165
+ "registerEnabled": obj.get("registerEnabled") if obj.get("registerEnabled") is not None else False,
166
+ "sipTargetTime": obj.get("sipTargetTime"),
167
+ "sipTimeLimit": obj.get("sipTimeLimit") if obj.get("sipTimeLimit") is not None else 5,
168
+ "fixedPacketRate": obj.get("fixedPacketRate"),
169
+ "ipv6Policy": obj.get("ipv6Policy"),
170
+ "agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None,
171
+ "targetSipCredentials": TestSipCredentials.from_dict(obj["targetSipCredentials"]) if obj.get("targetSipCredentials") is not None else None
172
+ })
173
+ return _obj
174
+
175
+