aixplain.v1.factories.integration_factory
Integration factory for creating and managing Integration models.
This module provides the IntegrationFactory class which handles the creation, retrieval, and management of Integration models in the aiXplain platform.
IntegrationFactory Objects
class IntegrationFactory(ModelGetterMixin, ModelListMixin)
Factory class for creating and managing Integration models.
This class provides functionality to get and list Integration models using the backend API. It inherits from ModelGetterMixin and ModelListMixin to provide model retrieval and listing capabilities.
Attributes:
backend_url- The URL of the backend API endpoint.
get
@classmethod
def get(cls,
model_id: Optional[Text] = None,
name: Optional[Text] = None,
api_key: Optional[Text] = None,
use_cache: bool = False) -> Integration
Retrieves a specific Integration model by its ID or name.
Arguments:
model_idOptional[Text], optional - The unique identifier of the Integration model.nameOptional[Text], optional - The name of the Integration model.api_keyOptional[Text], optional - API key for authentication. Defaults to None.use_cachebool, optional - Whether to use cached data. Defaults to False.
Returns:
Integration- The retrieved Integration model.
Raises:
AssertionError- If the provided ID/name does not correspond to an Integration model.ValueError- If neither model_id nor name is provided, or if both are provided.Exception- If the integration with the given name is not found.
list
@classmethod
def list(cls,
query: Optional[Text] = "",
suppliers: Optional[Union[Supplier, List[Supplier]]] = None,
ownership: Optional[Tuple[OwnershipType, List[OwnershipType]]] = None,
sort_by: Optional[SortBy] = None,
sort_order: SortOrder = SortOrder.ASCENDING,
page_number: int = 0,
page_size: int = 20,
api_key: Optional[Text] = None) -> List[Integration]
Lists Integration models based on the provided filters and pagination parameters.
Arguments:
queryOptional[Text], optional - Search query string. Defaults to "".suppliersOptional[Union[Supplier, List[Supplier]]], optional - Filter by supplier(s). Defaults to None.ownershipOptional[Tuple[OwnershipType, List[OwnershipType]]], optional - Filter by ownership type. Defaults to None.sort_byOptional[SortBy], optional - Field to sort results by. Defaults to None.sort_orderSortOrder, optional - Sort order (ascending/descending). Defaults to SortOrder.ASCENDING.page_numberint, optional - Page number for pagination. Defaults to 0.page_sizeint, optional - Number of items per page. Defaults to 20.api_keyOptional[Text], optional - API key for authentication. Defaults to None.
Returns:
List[Integration]- A list of Integration models matching the specified criteria.