Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GitHub Bot] Generated python SDK #90

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion thousandeyes-sdk-administrative/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This API provides the following operations to manage your organization:

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 7.0.32
- API version: 7.0.34
- Generator version: 7.6.0
- Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator

Expand Down
2 changes: 1 addition & 1 deletion thousandeyes-sdk-agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Manage all agents available to your account in ThousandEyes, including both Clou

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 7.0.32
- API version: 7.0.34
- Generator version: 7.6.0
- Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator

Expand Down
4 changes: 4 additions & 0 deletions thousandeyes-sdk-alerts/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ docs/AlertMetricDetail.md
docs/AlertNotification.md
docs/AlertRoundsViolationMode.md
docs/AlertRulesApi.md
docs/AlertSimpleTest.md
docs/AlertSuppressionWindow.md
docs/AlertSuppressionWindowDetail.md
docs/AlertSuppressionWindowRequest.md
docs/AlertSuppressionWindowState.md
docs/AlertSuppressionWindows.md
docs/AlertSuppressionWindowsApi.md
docs/AlertTestType.md
docs/AlertType.md
docs/Alerts.md
docs/AlertsApi.md
Expand Down Expand Up @@ -76,11 +78,13 @@ src/thousandeyes_sdk/alerts/models/alert_meta.py
src/thousandeyes_sdk/alerts/models/alert_metric_detail.py
src/thousandeyes_sdk/alerts/models/alert_notification.py
src/thousandeyes_sdk/alerts/models/alert_rounds_violation_mode.py
src/thousandeyes_sdk/alerts/models/alert_simple_test.py
src/thousandeyes_sdk/alerts/models/alert_suppression_window.py
src/thousandeyes_sdk/alerts/models/alert_suppression_window_detail.py
src/thousandeyes_sdk/alerts/models/alert_suppression_window_request.py
src/thousandeyes_sdk/alerts/models/alert_suppression_window_state.py
src/thousandeyes_sdk/alerts/models/alert_suppression_windows.py
src/thousandeyes_sdk/alerts/models/alert_test_type.py
src/thousandeyes_sdk/alerts/models/alert_type.py
src/thousandeyes_sdk/alerts/models/alerts.py
src/thousandeyes_sdk/alerts/models/base_alert.py
Expand Down
4 changes: 3 additions & 1 deletion thousandeyes-sdk-alerts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For more information about the alerts, see [Alerts](https://docs.thousandeyes.co

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 7.0.32
- API version: 7.0.34
- Generator version: 7.6.0
- Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator

Expand Down Expand Up @@ -129,11 +129,13 @@ Class | Method | HTTP request | Description
- [AlertMetricDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertMetricDetail.md)
- [AlertNotification](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertNotification.md)
- [AlertRoundsViolationMode](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertRoundsViolationMode.md)
- [AlertSimpleTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertSimpleTest.md)
- [AlertSuppressionWindow](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertSuppressionWindow.md)
- [AlertSuppressionWindowDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertSuppressionWindowDetail.md)
- [AlertSuppressionWindowRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertSuppressionWindowRequest.md)
- [AlertSuppressionWindowState](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertSuppressionWindowState.md)
- [AlertSuppressionWindows](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertSuppressionWindows.md)
- [AlertTestType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertTestType.md)
- [AlertType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/AlertType.md)
- [Alerts](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/Alerts.md)
- [BaseAlert](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-alerts/docs/BaseAlert.md)
Expand Down
43 changes: 43 additions & 0 deletions thousandeyes-sdk-alerts/docs/AlertSimpleTest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# AlertSimpleTest

Each test includes additional fields depending on its `type`. Refer `/tests/{type}` endpoint to know the set of fields returned by a given `type`.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**interval** | [**TestInterval**](TestInterval.md) | | [optional]
**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional]
**enabled** | **bool** | Test is enabled. | [optional] [default to True]
**created_by** | **str** | User that created the test. | [optional] [readonly]
**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly]
**description** | **str** | A description of the test. | [optional]
**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly]
**modified_by** | **str** | User that modified the test. | [optional] [readonly]
**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly]
**saved_event** | **bool** | Indicates if the test is a saved event. | [optional] [readonly]
**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly]
**test_name** | **str** | The name of the test. Test name must be unique. | [optional]
**type** | [**AlertTestType**](AlertTestType.md) | | [optional]
**links** | [**TestLinks**](TestLinks.md) | | [optional]

## Example

```python
from thousandeyes_sdk.alerts.models.alert_simple_test import AlertSimpleTest

# TODO update the JSON string below
json = "{}"
# create an instance of AlertSimpleTest from a JSON string
alert_simple_test_instance = AlertSimpleTest.from_json(json)
# print the JSON string representation of the object
print(AlertSimpleTest.to_json())

# convert the object into a dict
alert_simple_test_dict = alert_simple_test_instance.to_dict()
# create an instance of AlertSimpleTest from a dict
alert_simple_test_from_dict = AlertSimpleTest.from_dict(alert_simple_test_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


12 changes: 12 additions & 0 deletions thousandeyes-sdk-alerts/docs/AlertTestType.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AlertTestType

Valid Alert Types for which to return test links.

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


2 changes: 1 addition & 1 deletion thousandeyes-sdk-alerts/docs/RuleDetail.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Name | Type | Description | Notes
**sensitivity_level** | [**SensitivityLevel**](SensitivityLevel.md) | | [optional]
**severity** | [**Severity**](Severity.md) | | [optional]
**notifications** | [**AlertNotification**](AlertNotification.md) | | [optional]
**tests** | [**List[SimpleTest]**](SimpleTest.md) | | [optional] [readonly]
**tests** | [**List[AlertSimpleTest]**](AlertSimpleTest.md) | | [optional] [readonly]
**links** | [**SelfLinks**](SelfLinks.md) | | [optional]

## Example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@
from thousandeyes_sdk.alerts.models.alert_metric_detail import AlertMetricDetail
from thousandeyes_sdk.alerts.models.alert_notification import AlertNotification
from thousandeyes_sdk.alerts.models.alert_rounds_violation_mode import AlertRoundsViolationMode
from thousandeyes_sdk.alerts.models.alert_simple_test import AlertSimpleTest
from thousandeyes_sdk.alerts.models.alert_suppression_window import AlertSuppressionWindow
from thousandeyes_sdk.alerts.models.alert_suppression_window_detail import AlertSuppressionWindowDetail
from thousandeyes_sdk.alerts.models.alert_suppression_window_request import AlertSuppressionWindowRequest
from thousandeyes_sdk.alerts.models.alert_suppression_window_state import AlertSuppressionWindowState
from thousandeyes_sdk.alerts.models.alert_suppression_windows import AlertSuppressionWindows
from thousandeyes_sdk.alerts.models.alert_test_type import AlertTestType
from thousandeyes_sdk.alerts.models.alert_type import AlertType
from thousandeyes_sdk.alerts.models.alerts import Alerts
from thousandeyes_sdk.alerts.models.base_alert import BaseAlert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
from thousandeyes_sdk.alerts.models.alert_metric_detail import AlertMetricDetail
from thousandeyes_sdk.alerts.models.alert_notification import AlertNotification
from thousandeyes_sdk.alerts.models.alert_rounds_violation_mode import AlertRoundsViolationMode
from thousandeyes_sdk.alerts.models.alert_simple_test import AlertSimpleTest
from thousandeyes_sdk.alerts.models.alert_suppression_window import AlertSuppressionWindow
from thousandeyes_sdk.alerts.models.alert_suppression_window_detail import AlertSuppressionWindowDetail
from thousandeyes_sdk.alerts.models.alert_suppression_window_request import AlertSuppressionWindowRequest
from thousandeyes_sdk.alerts.models.alert_suppression_window_state import AlertSuppressionWindowState
from thousandeyes_sdk.alerts.models.alert_suppression_windows import AlertSuppressionWindows
from thousandeyes_sdk.alerts.models.alert_test_type import AlertTestType
from thousandeyes_sdk.alerts.models.alert_type import AlertType
from thousandeyes_sdk.alerts.models.alerts import Alerts
from thousandeyes_sdk.alerts.models.base_alert import BaseAlert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class AlertGroupType(str, Enum):
"""
allowed enum values
"""
BGP = 'bgp'
BROWSER_MINUS_SESSION = 'browser-session'
CLOUD_MINUS_ENTERPRISE = 'cloud-enterprise'
ENDPOINT = 'endpoint'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# coding: utf-8

"""
Alerts API
You can manage the following alert functionalities on the ThousandEyes platform using the Alerts API: * **Alerts**: Retrieve alert details. Alerts are assigned to tests through alert rules. * **Alert Rules**: Conditions that you configure in order to highlight or be notified of events of interest in your ThousandEyes tests. When an alert rule’s conditions are met, the associated alert is triggered and the alert becomes active. It remains active until the alert is cleared. Alert rules are reusable across multiple tests.. * **Alert Suppression Windows**: Suppress alerts for tests during periods such as planned maintenance. Windows can be one-time events or recurring events to handle periodic occurrences such as monthly downtime for maintenance. For more information about the alerts, see [Alerts](https://docs.thousandeyes.com/product-documentation/alerts).
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import pprint
import re # noqa: F401
import json

from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from thousandeyes_sdk.alerts.models.alert_test_type import AlertTestType
from thousandeyes_sdk.alerts.models.test_interval import TestInterval
from thousandeyes_sdk.alerts.models.test_links import TestLinks
from typing import Optional, Set
from typing_extensions import Self

class AlertSimpleTest(BaseModel):
"""
Each test includes additional fields depending on its `type`. Refer `/tests/{type}` endpoint to know the set of fields returned by a given `type`.
""" # noqa: E501
interval: Optional[TestInterval] = None
alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled")
enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.")
created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
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")
test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
type: Optional[AlertTestType] = None
links: Optional[TestLinks] = Field(default=None, alias="_links")
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links"]

model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
extra="allow",
)


def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True)

@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of AlertSimpleTest from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* Fields in `self.additional_properties` are added to the output dict.
"""
excluded_fields: Set[str] = set([
"created_by",
"created_date",
"live_share",
"modified_by",
"modified_date",
"saved_event",
"test_id",
"additional_properties",
])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of links
if self.links:
_dict['_links'] = self.links.to_dict()
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
_dict[_key] = _value

return _dict

@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AlertSimpleTest from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return cls.model_validate(obj)

_obj = cls.model_validate({
"interval": obj.get("interval"),
"alertsEnabled": obj.get("alertsEnabled"),
"enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
"createdBy": obj.get("createdBy"),
"createdDate": obj.get("createdDate"),
"description": obj.get("description"),
"liveShare": obj.get("liveShare"),
"modifiedBy": obj.get("modifiedBy"),
"modifiedDate": obj.get("modifiedDate"),
"savedEvent": obj.get("savedEvent"),
"testId": obj.get("testId"),
"testName": obj.get("testName"),
"type": obj.get("type"),
"_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None
})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)

return _obj


Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# coding: utf-8

"""
Alerts API
You can manage the following alert functionalities on the ThousandEyes platform using the Alerts API: * **Alerts**: Retrieve alert details. Alerts are assigned to tests through alert rules. * **Alert Rules**: Conditions that you configure in order to highlight or be notified of events of interest in your ThousandEyes tests. When an alert rule’s conditions are met, the associated alert is triggered and the alert becomes active. It remains active until the alert is cleared. Alert rules are reusable across multiple tests.. * **Alert Suppression Windows**: Suppress alerts for tests during periods such as planned maintenance. Windows can be one-time events or recurring events to handle periodic occurrences such as monthly downtime for maintenance. For more information about the alerts, see [Alerts](https://docs.thousandeyes.com/product-documentation/alerts).
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501


from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self


class AlertTestType(str, Enum):
"""
Valid Alert Types for which to return test links.
"""

"""
allowed enum values
"""
API = 'api'
AGENT_MINUS_TO_MINUS_AGENT = 'agent-to-agent'
AGENT_MINUS_TO_MINUS_SERVER = 'agent-to-server'
BGP = 'bgp'
HTTP_MINUS_SERVER = 'http-server'
PAGE_MINUS_LOAD = 'page-load'
WEB_MINUS_TRANSACTIONS = 'web-transactions'
FTP_MINUS_SERVER = 'ftp-server'
DNS_MINUS_TRACE = 'dns-trace'
DNS_MINUS_SERVER = 'dns-server'
DNSSEC = 'dnssec'
SIP_MINUS_SERVER = 'sip-server'
VOICE = 'voice'
ENDPOINT_MINUS_HTTP_MINUS_SERVER = 'endpoint-http-server'
ENDPOINT_MINUS_NETWORK_MINUS_SERVER = 'endpoint-network-server'
ENDPOINT_MINUS_PATH_MINUS_TRACE = 'endpoint-path-trace'
UNKNOWN = 'unknown'

@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AlertTestType from a JSON string"""
return cls(json.loads(json_str))

@classmethod
def _missing_(cls, value):
"""Handle unknown values"""
return cls.UNKNOWN

Loading
Loading