module KayakoClient::PostClient

Public Instance Methods

attachments(options = {}) click to toggle source
# File lib/kayako_client/mixins/post_client.rb, line 18
def attachments(options = {})
    values = []
    if ticket_id && id
        items = KayakoClient::TicketAttachment.all(ticket_id, options.merge(inherited_options))
        items.each do |item|
            values << item if item.ticket_post_id == id
        end
    end
    values
end
create_attachment(options = {})
Alias for: post_attachment
delete_attachment(attachment, options = {}) click to toggle source
# File lib/kayako_client/mixins/post_client.rb, line 49
def delete_attachment(attachment, options = {})
    KayakoClient::TicketAttachment.delete(ticket_id, attachment, options.merge(inherited_options)) if ticket_id
end
Also aliased as: destroy_attachment
destroy_attachment(attachment, options = {})
Alias for: delete_attachment
find_attachment(attachment, options = {})
Alias for: get_attachment
get_attachment(attachment, options = {}) click to toggle source
# File lib/kayako_client/mixins/post_client.rb, line 29
def get_attachment(attachment, options = {})
    KayakoClient::TicketAttachment.get(ticket_id, attachment, options.merge(inherited_options)) if ticket_id
end
Also aliased as: find_attachment
post_attachment(options = {}) click to toggle source
# File lib/kayako_client/mixins/post_client.rb, line 35
def post_attachment(options = {})
    if ticket_id && id
        if logger
            logger.warn "overwriting :ticket_id"      if options[:ticket_id] && options[:ticket_id].to_i != ticket_id
            logger.warn "overwriting :ticket_post_id" if options[:ticket_post_id] && options[:ticket_post_id].to_i != id
        end
        options[:ticket_id] = ticket_id
        options[:ticket_post_id] = id
        KayakoClient::TicketAttachment.post(options.merge(inherited_options))
    end
end
Also aliased as: create_attachment