示例#1
0
 def delete(cls, id):
     """
     Deletes an address book by ID
     
     :param id: 
     :return: 
     """
     connection.delete('{}/{}'.format(cls.end_point, id))
     return True
示例#2
0
    def delete_all_contacts(self):
        """
        Deletes all contacts from a given address book

        :return:
        """
        self.validate_id('Sorry, unable to delete all contacts from this '
                         'address book, as no ID value has been defined for '
                         'the address book.')
        connection.delete('{}/{}/contacts'.format(self.end_point, self.id))
        return True
示例#3
0
    def delete(self):
        """
        Deletes a campaign

        :return:
        """
        self.validate_id('Sorry, unable to delete this campaign as no ID value'
                         'is defined.')

        connection.delete('{}/{}'.format(self.end_point, self.id))
        self.id = None
        return self
示例#4
0
    def delete_contact(self, contact):
        """
        Deletes a contact from a given address book

        :param contact:
        :return:
        """
        self.validate_id('Sorry, unable to delete contact from this address '
                         'book, as no ID value has been defined for the '
                         'address book.')

        contact.validate_id('Sorry, unable to delete this contact from the '
                            'address book, as the contact has no ID value.')

        connection.delete('{}/{}/contacts/{}'.format(self.end_point, self.id,
                                                     contact.id))

        return True
示例#5
0
    def delete(self):
        """
        Deletes a contact data field within the account.
        
        This operation can be used to delete a contact data field within your 
        account. You can't delete a reserved contact data field (FIRSTNAME, 
        LASTNAME, ADDRESS, POSTCODE, GENDER) or any that are currently in use 
        elsewhere in the system.

        This operation will return an API dependencies object. This will specify 
        the type of dependency and the ID of the dependency.
        
        :return: 
        """
        if not self.valid_name(self.name):
            raise Exception(self.invalid_name_msg)

        return connection.delete('{}/{}'.format(self.end_point, self.name))
示例#6
0
 def delete(cls, id):
     connection.delete('{}/{}'.format(cls.end_point, id))
     return True