# Path: smc/base/model.py
# @exception
# def prepared_request(*exception, **kwargs):  # @UnusedVariable
#     """
#     Prepared request is a wrapper to allow an exception to
#     be thrown to wrap the SMCResult. Exception is optional.
#     If not provided, the SMCResult object is returned,
#     otherwise it is only thrown if SMC reports an error.
#     """
#     return SMCRequest(**kwargs)
# 
# Path: smc/api/exceptions.py
# class DeleteElementFailed(SMCException):
#     """
#     Used when deletion fails, typically due to dependencies
#     for the target element
#     """


from smc_monitoring.models.query import Query
from smc_monitoring.models.constants import LogField
from smc.base.model import prepared_request
from smc.api.exceptions import DeleteElementFailed
        Fetch the results and return as a VPNSecurityAssoc element.
        The original query is not modified.
        
        :return: generator of elements
        :rtype: :class:`~VPNSecurityAssoc`
        """
        clone = self.copy()
        clone.format.field_format('id')
        for custom_field in ['field_ids', 'field_names']:
            clone.format.data.pop(custom_field, None)

        for list_of_results in clone.fetch_raw(**kw):
            for entry in list_of_results:
                yield VPNSecurityAssoc(**entry)

                       
class VPNSecurityAssoc(object):
    """
    A VPN Security Association represents a currently connected VPN
    endpoint. This is the result of making a :class:`.VPNSAQuery` and
    using :meth:`~VPNSAQuery.fetch_as_element`.
    """
    def __init__(self, **data):
        self.vpn = data

    @property
    def href(self):
        return self.vpn.get('vpn_sa_href')
    
    def delete(self):

# Path: smc/base/model.py
# @exception
# def prepared_request(*exception, **kwargs):  # @UnusedVariable
#     """
#     Prepared request is a wrapper to allow an exception to
#     be thrown to wrap the SMCResult. Exception is optional.
#     If not provided, the SMCResult object is returned,
#     otherwise it is only thrown if SMC reports an error.
#     """
#     return SMCRequest(**kwargs)
# 
# Path: smc/api/exceptions.py
# class DeleteElementFailed(SMCException):
#     """
#     Used when deletion fails, typically due to dependencies
#     for the target element
#     """


# Path: smc-monitoring/smc_monitoring/monitors/vpns.py
from smc_monitoring.models.query import Query
from smc_monitoring.models.constants import LogField
from smc.base.model import prepared_request
from smc.api.exceptions import DeleteElementFailed

        Fetch the results and return as a VPNSecurityAssoc element.
        The original query is not modified.
        
        :return: generator of elements
        :rtype: :class:`~VPNSecurityAssoc`
        """
        clone = self.copy()
        clone.format.field_format('id')
        for custom_field in ['field_ids', 'field_names']:
            clone.format.data.pop(custom_field, None)

        for list_of_results in clone.fetch_raw(**kw):
            for entry in list_of_results:
                yield VPNSecurityAssoc(**entry)

                       
class VPNSecurityAssoc(object):
    """
    A VPN Security Association represents a currently connected VPN
    endpoint. This is the result of making a :class:`.VPNSAQuery` and
    using :meth:`~VPNSAQuery.fetch_as_element`.
    """
    def __init__(self, **data):
        self.vpn = data

    @property
    def href(self):
        return self.vpn.get('vpn_sa_href')
    
    def delete(self):

        return prepared_request(