def send(self, api, force_send):
        """
        Send this item using api.
        :param api: D4S2Api sends messages to D4S2
        :param force_send: bool should we send even if the item already exists
        """
        item_id = self.get_existing_item_id(api)
        if not item_id:
            item_id = self.create_item_returning_id(api)
            api.send_item(self.destination, item_id, force_send)
        else:
            if force_send:
                api.send_item(self.destination, item_id, force_send)
            else:
                item_type = D4S2Api.DEST_TO_NAME.get(self.destination, "Item")
                msg = "{} already sent. Run with --resend argument to resend."
                raise D4S2Error(msg.format(item_type), warning=True)
def send ( self , api , force_send ) : item_id = self . get_existing_item_id ( api ) if not item_id : item_id = self . create_item_returning_id ( api ) api . send_item ( self . destination , item_id , force_send ) else : if force_send : api . send_item ( self . destination , item_id , force_send ) else : item_type = D4S2Api . DEST_TO_NAME . get ( self . destination , "Item" ) msg = "{} already sent. Run with --resend argument to resend." raise D4S2Error ( msg . format ( item_type ) , warning = True )
Send this item using api.
        :param api: D4S2Api sends messages to D4S2
        :param force_send: bool should we send even if the item already exists