async def _create_connection_with_credential(
        self,
        uow: UnitOfWork,
        integration_type: IntegrationType,
        short_name: str,
        name: Optional[str],
        integration_name: str,
        auth_type: AuthType,
        encrypted_credentials: str,
        auth_config_class: Optional[str],
        user: schemas.User,
    ) -> schemas.Connection:
        """Create a connection with credentials.

        Args:
            uow: The unit of work
            integration_type: The type of integration
            short_name: The short name of the integration
            name: The name of the connection
            integration_name: The name of the integration
            auth_type: The authentication type
            encrypted_credentials: The encrypted credentials
            auth_config_class: The auth config class name
            user: The current user

        Returns:
            The created connection
        """
        # Create integration credential
        integration_cred_in = schemas.IntegrationCredentialCreateEncrypted(
            name=f"{integration_name} - {user.email}",
            description=f"Credentials for {integration_name} - {user.email}",
            integration_short_name=short_name,
            integration_type=integration_type,
            auth_type=auth_type,
            encrypted_credentials=encrypted_credentials,
            auth_config_class=auth_config_class,
        )

        integration_cred = await crud.integration_credential.create(
            uow.session, obj_in=integration_cred_in, current_user=user, uow=uow
        )
        await uow.session.flush()

        # Create connection
        connection_data = {
            "name": name if name else f"Connection to {integration_name}",
            "integration_type": integration_type,
            "status": ConnectionStatus.ACTIVE,
            "integration_credential_id": integration_cred.id,
            "short_name": short_name,
        }

        connection_in = ConnectionCreate(**connection_data)
        return await crud.connection.create(
            uow.session, obj_in=connection_in, current_user=user, uow=uow
        )
Create a connection with credentials.

        Args:
            uow: The unit of work
            integration_type: The type of integration
            short_name: The short name of the integration
            name: The name of the connection
            integration_name: The name of the integration
            auth_type: The authentication type
            encrypted_credentials: The encrypted credentials
            auth_config_class: The auth config class name
            user: The current user

        Returns:
            The created connection
        
backend/airweave/core/connection_service.py