1RT::Client::REST::AttacUhsmeerntC(o3n)tributed Perl DocuRmTe:n:tCaltiieonnt::REST::Attachment(3)
2
3
4
6 RT::Client::REST::Attachment -- this object represents an attachment.
7
9 my $attachments = $ticket->attachments;
10
11 my $count = $attachments->count;
12 print "There are $count attachments.\n";
13
14 my $iterator = $attachments->get_iterator;
15 while (my $att = &$iterator) {
16 print "Id: ", $att->id, "; Subject: ", $att->subject, "\n";
17 }
18
20 An attachment is a second-class citizen, as it does not exist (at least
21 from the current REST protocol implementation) by itself. At the
22 moment, it is always associated with a ticket (see parent_id
23 attribute). Thus, you will rarely retrieve an attachment by itself;
24 instead, you should use "attachments()" method of
25 RT::Client::REST::Ticket object to get an iterator for all attachments
26 for that ticket.
27
29 id
30 Numeric ID of the attachment.
31
32 creator_id
33 Numeric ID of the user who created the attachment.
34
35 parent_id
36 Numeric ID of the object the attachment is associated with. This is
37 not a proper attribute of the attachment as specified by REST -- it
38 is simply to store the ID of the RT::Client::REST::Ticket object this
39 attachment belongs to.
40
41 subject
42 Subject of the attachment.
43
44 content_type
45 Content type.
46
47 file_name
48 File name (if any).
49
50 transaction_id
51 Numeric ID of the RT::Client::REST::Transaction object this
52 attachment is associated with.
53
54 message_id
55 Message ID.
56
57 created
58 Time when the attachment was created
59
60 content
61 Actual content of the attachment.
62
63 headers
64 Headers (not parsed), if any.
65
66 parent
67 Parent (not sure what this is yet).
68
69 content_encoding
70 Content encoding, if any.
71
73 RT::Client::REST::Attachment is a read-only object, so you cannot
74 "store()" it. Also, because it is a second-class citizen, you cannot
75 "search()" or "count()" it -- use "attachments()" method provided by
76 RT::Client::REST::Ticket.
77
78 retrieve
79 To retrieve an attachment, attributes id and parent_id must be set.
80
82 rt_type
83 Returns 'attachment'.
84
86 RT::Client::REST::Ticket, RT::Client::REST::SearchResult.
87
89 Dmitri Tikhonov <dtikhonov@yahoo.com>
90
92 Perl license with the exception of RT::Client::REST, which is GPLed.
93
94
95
96perl v5.12.0 2007-12-23 RT::Client::REST::Attachment(3)