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,111 @@
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, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from thousandeyes_sdk.instant_tests.models.validation_error_item import ValidationErrorItem
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ValidationError(BaseModel):
27
+ """
28
+ ValidationError
29
+ """ # noqa: E501
30
+ type: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\".")
31
+ title: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the problem type.")
32
+ status: Optional[StrictInt] = Field(default=None, description="The HTTP status code generated by the origin server for this occurrence of the problem.")
33
+ detail: Optional[StrictStr] = Field(default=None, description="A human-readable explanation specific to this occurrence of the problem.")
34
+ instance: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the specific occurrence of the problem.")
35
+ errors: Optional[List[ValidationErrorItem]] = Field(default=None, description="(Optional) When multiple errors occur, the details for each error are listed.")
36
+ __properties: ClassVar[List[str]] = ["type", "title", "status", "detail", "instance", "errors"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ extra="allow",
43
+ )
44
+
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.model_dump(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
54
+
55
+ @classmethod
56
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
+ """Create an instance of ValidationError from a JSON string"""
58
+ return cls.from_dict(json.loads(json_str))
59
+
60
+ def to_dict(self) -> Dict[str, Any]:
61
+ """Return the dictionary representation of the model using alias.
62
+
63
+ This has the following differences from calling pydantic's
64
+ `self.model_dump(by_alias=True)`:
65
+
66
+ * `None` is only added to the output dict for nullable fields that
67
+ were set at model initialization. Other fields with value `None`
68
+ are ignored.
69
+ """
70
+ excluded_fields: Set[str] = set([
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # override the default output from pydantic by calling `to_dict()` of each item in errors (list)
79
+ _items = []
80
+ if self.errors:
81
+ for _item in self.errors:
82
+ if _item:
83
+ _items.append(_item.to_dict())
84
+ _dict['errors'] = _items
85
+ # set to None if errors (nullable) is None
86
+ # and model_fields_set contains the field
87
+ if self.errors is None and "errors" in self.model_fields_set:
88
+ _dict['errors'] = None
89
+
90
+ return _dict
91
+
92
+ @classmethod
93
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
94
+ """Create an instance of ValidationError from a dict"""
95
+ if obj is None:
96
+ return None
97
+
98
+ if not isinstance(obj, dict):
99
+ return cls.model_validate(obj)
100
+
101
+ _obj = cls.model_validate({
102
+ "type": obj.get("type"),
103
+ "title": obj.get("title"),
104
+ "status": obj.get("status"),
105
+ "detail": obj.get("detail"),
106
+ "instance": obj.get("instance"),
107
+ "errors": [ValidationErrorItem.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None
108
+ })
109
+ return _obj
110
+
111
+
@@ -0,0 +1,92 @@
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 ValidationErrorItem(BaseModel):
26
+ """
27
+ ValidationErrorItem
28
+ """ # noqa: E501
29
+ code: Optional[StrictStr] = Field(default=None, description="(Optional) A unique error type/code that can be referenced in the documentation for further details.")
30
+ var_field: Optional[StrictStr] = Field(default=None, description="Identifies the field that triggered this particular error.", alias="field")
31
+ message: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the error.")
32
+ __properties: ClassVar[List[str]] = ["code", "field", "message"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ extra="allow",
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of ValidationErrorItem from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of ValidationErrorItem from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "code": obj.get("code"),
87
+ "field": obj.get("field"),
88
+ "message": obj.get("message")
89
+ })
90
+ return _obj
91
+
92
+
@@ -0,0 +1,189 @@
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_dscp_id import TestDscpId
27
+ from thousandeyes_sdk.instant_tests.models.test_label import TestLabel
28
+ from thousandeyes_sdk.instant_tests.models.test_links import TestLinks
29
+ from typing import Optional, Set
30
+ from typing_extensions import Self
31
+
32
+ class VoiceInstantTest(BaseModel):
33
+ """
34
+ VoiceInstantTest
35
+ """ # noqa: E501
36
+ created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
37
+ created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
38
+ description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
39
+ live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
40
+ modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
41
+ modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
42
+ saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
43
+ 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")
44
+ test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
45
+ type: Optional[StrictStr] = None
46
+ links: Optional[TestLinks] = Field(default=None, alias="_links")
47
+ labels: Optional[List[TestLabel]] = None
48
+ shared_with_accounts: Optional[List[SharedWithAccount]] = Field(default=None, alias="sharedWithAccounts")
49
+ codec: Optional[StrictStr] = Field(default=None, description="Codec label")
50
+ codec_id: Optional[StrictStr] = Field(default=None, description="Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab)", alias="codecId")
51
+ dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.")
52
+ dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId")
53
+ duration: Optional[Annotated[int, Field(le=30, strict=True, ge=5)]] = Field(default=5, description="Duration of the test in seconds.")
54
+ jitter_buffer: Optional[Annotated[int, Field(le=150, strict=True, ge=0)]] = Field(default=40, description="De-jitter buffer size in seconds.", alias="jitterBuffer")
55
+ num_path_traces: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = Field(default=3, description="Number of path traces executed by the agent.", alias="numPathTraces")
56
+ port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.")
57
+ target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId")
58
+ agents: Optional[List[Agent]] = Field(default=None, description="Contains list of agents.")
59
+ __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId", "agents"]
60
+
61
+ model_config = ConfigDict(
62
+ populate_by_name=True,
63
+ validate_assignment=True,
64
+ protected_namespaces=(),
65
+ extra="allow",
66
+ )
67
+
68
+
69
+ def to_str(self) -> str:
70
+ """Returns the string representation of the model using alias"""
71
+ return pprint.pformat(self.model_dump(by_alias=True))
72
+
73
+ def to_json(self) -> str:
74
+ """Returns the JSON representation of the model using alias"""
75
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
76
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
77
+
78
+ @classmethod
79
+ def from_json(cls, json_str: str) -> Optional[Self]:
80
+ """Create an instance of VoiceInstantTest from a JSON string"""
81
+ return cls.from_dict(json.loads(json_str))
82
+
83
+ def to_dict(self) -> Dict[str, Any]:
84
+ """Return the dictionary representation of the model using alias.
85
+
86
+ This has the following differences from calling pydantic's
87
+ `self.model_dump(by_alias=True)`:
88
+
89
+ * `None` is only added to the output dict for nullable fields that
90
+ were set at model initialization. Other fields with value `None`
91
+ are ignored.
92
+ * OpenAPI `readOnly` fields are excluded.
93
+ * OpenAPI `readOnly` fields are excluded.
94
+ * OpenAPI `readOnly` fields are excluded.
95
+ * OpenAPI `readOnly` fields are excluded.
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
+ """
106
+ excluded_fields: Set[str] = set([
107
+ "created_by",
108
+ "created_date",
109
+ "live_share",
110
+ "modified_by",
111
+ "modified_date",
112
+ "saved_event",
113
+ "test_id",
114
+ "type",
115
+ "labels",
116
+ "shared_with_accounts",
117
+ "codec",
118
+ "dscp",
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 VoiceInstantTest 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
+ "codec": obj.get("codec"),
177
+ "codecId": obj.get("codecId"),
178
+ "dscp": obj.get("dscp"),
179
+ "dscpId": obj.get("dscpId"),
180
+ "duration": obj.get("duration") if obj.get("duration") is not None else 5,
181
+ "jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40,
182
+ "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
183
+ "port": obj.get("port"),
184
+ "targetAgentId": obj.get("targetAgentId"),
185
+ "agents": [Agent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None
186
+ })
187
+ return _obj
188
+
189
+
@@ -0,0 +1,167 @@
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_dscp_id import TestDscpId
26
+ from thousandeyes_sdk.instant_tests.models.test_links import TestLinks
27
+ from typing import Optional, Set
28
+ from typing_extensions import Self
29
+
30
+ class VoiceInstantTestRequest(BaseModel):
31
+ """
32
+ VoiceInstantTestRequest
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[StrictStr] = None
44
+ links: Optional[TestLinks] = Field(default=None, alias="_links")
45
+ labels: Optional[List[StrictStr]] = Field(default=None, description="A list of test label identifiers (get `labelId` from `/labels` endpoint).")
46
+ 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")
47
+ codec: Optional[StrictStr] = Field(default=None, description="Codec label")
48
+ codec_id: Optional[StrictStr] = Field(default=None, description="Coded ID, [see the list of acceptable values](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/working-with-test-settings#rtp-stream-advanced-settings-tab)", alias="codecId")
49
+ dscp: Optional[StrictStr] = Field(default=None, description="DSCP label.")
50
+ dscp_id: Optional[TestDscpId] = Field(default=None, alias="dscpId")
51
+ duration: Optional[Annotated[int, Field(le=30, strict=True, ge=5)]] = Field(default=5, description="Duration of the test in seconds.")
52
+ jitter_buffer: Optional[Annotated[int, Field(le=150, strict=True, ge=0)]] = Field(default=40, description="De-jitter buffer size in seconds.", alias="jitterBuffer")
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
+ port: Optional[Annotated[int, Field(le=65535, strict=True, ge=1024)]] = Field(default=None, description="Port number for the chosen protocol.")
55
+ target_agent_id: StrictStr = Field(description="Agent ID of the target agent for the test.", alias="targetAgentId")
56
+ agents: List[TestAgent] = Field(description="A list of objects with `agentId` (required) and `sourceIpAddress` (optional).")
57
+ __properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "codec", "codecId", "dscp", "dscpId", "duration", "jitterBuffer", "numPathTraces", "port", "targetAgentId", "agents"]
58
+
59
+ model_config = ConfigDict(
60
+ populate_by_name=True,
61
+ validate_assignment=True,
62
+ protected_namespaces=(),
63
+ extra="allow",
64
+ )
65
+
66
+
67
+ def to_str(self) -> str:
68
+ """Returns the string representation of the model using alias"""
69
+ return pprint.pformat(self.model_dump(by_alias=True))
70
+
71
+ def to_json(self) -> str:
72
+ """Returns the JSON representation of the model using alias"""
73
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
74
+ return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)
75
+
76
+ @classmethod
77
+ def from_json(cls, json_str: str) -> Optional[Self]:
78
+ """Create an instance of VoiceInstantTestRequest from a JSON string"""
79
+ return cls.from_dict(json.loads(json_str))
80
+
81
+ def to_dict(self) -> Dict[str, Any]:
82
+ """Return the dictionary representation of the model using alias.
83
+
84
+ This has the following differences from calling pydantic's
85
+ `self.model_dump(by_alias=True)`:
86
+
87
+ * `None` is only added to the output dict for nullable fields that
88
+ were set at model initialization. Other fields with value `None`
89
+ are ignored.
90
+ * OpenAPI `readOnly` fields are excluded.
91
+ * OpenAPI `readOnly` fields are excluded.
92
+ * OpenAPI `readOnly` fields are excluded.
93
+ * OpenAPI `readOnly` fields are excluded.
94
+ * OpenAPI `readOnly` fields are excluded.
95
+ * OpenAPI `readOnly` fields are excluded.
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
+ """
101
+ excluded_fields: Set[str] = set([
102
+ "created_by",
103
+ "created_date",
104
+ "live_share",
105
+ "modified_by",
106
+ "modified_date",
107
+ "saved_event",
108
+ "test_id",
109
+ "type",
110
+ "codec",
111
+ "dscp",
112
+ ])
113
+
114
+ _dict = self.model_dump(
115
+ by_alias=True,
116
+ exclude=excluded_fields,
117
+ exclude_none=True,
118
+ )
119
+ # override the default output from pydantic by calling `to_dict()` of links
120
+ if self.links:
121
+ _dict['_links'] = self.links.to_dict()
122
+ # override the default output from pydantic by calling `to_dict()` of each item in agents (list)
123
+ _items = []
124
+ if self.agents:
125
+ for _item in self.agents:
126
+ if _item:
127
+ _items.append(_item.to_dict())
128
+ _dict['agents'] = _items
129
+ return _dict
130
+
131
+ @classmethod
132
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
133
+ """Create an instance of VoiceInstantTestRequest from a dict"""
134
+ if obj is None:
135
+ return None
136
+
137
+ if not isinstance(obj, dict):
138
+ return cls.model_validate(obj)
139
+
140
+ _obj = cls.model_validate({
141
+ "createdBy": obj.get("createdBy"),
142
+ "createdDate": obj.get("createdDate"),
143
+ "description": obj.get("description"),
144
+ "liveShare": obj.get("liveShare"),
145
+ "modifiedBy": obj.get("modifiedBy"),
146
+ "modifiedDate": obj.get("modifiedDate"),
147
+ "savedEvent": obj.get("savedEvent"),
148
+ "testId": obj.get("testId"),
149
+ "testName": obj.get("testName"),
150
+ "type": obj.get("type"),
151
+ "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None,
152
+ "labels": obj.get("labels"),
153
+ "sharedWithAccounts": obj.get("sharedWithAccounts"),
154
+ "codec": obj.get("codec"),
155
+ "codecId": obj.get("codecId"),
156
+ "dscp": obj.get("dscp"),
157
+ "dscpId": obj.get("dscpId"),
158
+ "duration": obj.get("duration") if obj.get("duration") is not None else 5,
159
+ "jitterBuffer": obj.get("jitterBuffer") if obj.get("jitterBuffer") is not None else 40,
160
+ "numPathTraces": obj.get("numPathTraces") if obj.get("numPathTraces") is not None else 3,
161
+ "port": obj.get("port"),
162
+ "targetAgentId": obj.get("targetAgentId"),
163
+ "agents": [TestAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None
164
+ })
165
+ return _obj
166
+
167
+