superwise_api.entities.destination
class
DestinationApi(superwise_api.entities.base.BaseApi):
This class provides methods to interact with the Destination API.
Attributes:
- api_client (ApiClient): An instance of the ApiClient to make requests.
- _model_name (str): The name of the model.
- _resource_path (str): The path of the resource.
- _model_class (Destination): The model class.
def
get_by_id(self, destination_id: str, **kwargs) -> dict:
Gets a destination by id.
Arguments:
- destination_id (str): The id of the destination.
- **kwargs: Arbitrary keyword arguments.
Returns:
Destination: The destination.
def
delete(self, destination_id: str, **kwargs) -> None:
Deletes a destination.
Arguments:
- destination_id (str): The id of the destination.
- **kwargs: Arbitrary keyword arguments.
def
create( self, name: str, integration_type: superwise_api.models.destination.destination.DestinationType, params: Union[superwise_api.models.destination.destination.SlackDestinationParams, superwise_api.models.destination.destination.TeamsDestinationParams, superwise_api.models.destination.destination.EmailDestinationParams], integration_id: str | None = None, **kwargs) -> superwise_api.models.destination.destination.Destination:
Creates a new destination.
Arguments:
- name (str): The name of the destination.
- integration_type (str): The type of the integration.
- params (DestinationParams): The parameters of the destination.
- integration_id (str | None): The id of the integration. Required for Slack destinations.
- **kwargs: Arbitrary keyword arguments.
Returns:
Destination: The created destination.
def
get( self, name: Optional[str] = None, integration_id: Optional[str] = None, destination_id: Optional[str] = None, created_by: Optional[str] = None, page: Optional[int] = None, size: Optional[int] = None, **kwargs) -> superwise_api.client.models.page.Page:
Retrieves destinations. Filter if any of the parameters are provided.
Arguments:
- name (str, optional): The name of the destination.
- integration_id (str, optional): The id of the integration.
- destination_id (str, optional): The id of the destination.
- created_by (str, optional): The creator of the destination.
- page (int, optional): The page number.
- size (int, optional): The size of the page.
- **kwargs: Arbitrary keyword arguments.
Returns:
Page: A page of destinations.
def
test_connection( self, request: superwise_api.models.destination.destination.TeamsDestinationTestRequest | superwise_api.models.destination.destination.SlackDestinationTestRequest | superwise_api.models.destination.destination.EmailDestinationTestRequest, **kwargs) -> None:
Test a webhook connection by sending a test notification.
Arguments:
- request (TeamsDestinationTestRequest | SlackDestinationTestRequest | EmailDestinationTestRequest): The test connection request payload.
- **kwargs: Arbitrary keyword arguments.
def
update( self, destination_id: str, *, name: Optional[str] = None, params: Union[superwise_api.models.destination.destination.SlackDestinationParams, superwise_api.models.destination.destination.TeamsDestinationParams, superwise_api.models.destination.destination.EmailDestinationParams, NoneType] = None, **kwargs) -> superwise_api.models.destination.destination.Destination:
Updates a destination.
Arguments:
- destination_id (str): The id of the destination.
- name (str, optional): The new name of the destination.
- params (dict, optional): The new parameters of the destination.
- **kwargs: Arbitrary keyword arguments.
Returns:
Destination: The updated destination.
Inherited Members
- superwise_api.entities.base.BaseApi
- BaseApi
- api_client
- wrap_api_calls
- raise_exception