1RT::Client::REST::AttacUhsmeerntC(o3n)tributed Perl DocuRmTe:n:tCaltiieonnt::REST::Attachment(3)
2
3
4

NAME

6       RT::Client::REST::Attachment - attachment object representation.
7

VERSION

9       version 0.60
10

SYNOPSIS

12         my $attachments = $ticket->attachments;
13
14         my $count = $attachments->count;
15         print "There are $count attachments.\n";
16
17         my $iterator = $attachments->get_iterator;
18         while (my $att = &$iterator) {
19             print "Id: ", $att->id, "; Subject: ", $att->subject, "\n";
20         }
21

DESCRIPTION

23       An attachment is a second-class citizen, as it does not exist (at least
24       from the current REST protocol implementation) by itself.  At the
25       moment, it is always associated with a ticket (see parent_id
26       attribute).  Thus, you will rarely retrieve an attachment by itself;
27       instead, you should use "attachments()" method of
28       RT::Client::REST::Ticket object to get an iterator for all attachments
29       for that ticket.
30

ATTRIBUTES

32       id
33         Numeric ID of the attachment.
34
35       creator_id
36         Numeric ID of the user who created the attachment.
37
38       parent_id
39         Numeric ID of the object the attachment is associated with.  This is
40         not a proper attribute of the attachment as specified by REST -- it
41         is simply to store the ID of the RT::Client::REST::Ticket object this
42         attachment belongs to.
43
44       subject
45         Subject of the attachment.
46
47       content_type
48         Content type.
49
50       file_name
51         File name (if any).
52
53       transaction_id
54         Numeric ID of the RT::Client::REST::Transaction object this
55         attachment is associated with.
56
57       message_id
58         Message ID.
59
60       created
61         Time when the attachment was created
62
63       content
64         Actual content of the attachment.
65
66       headers
67         Headers (not parsed), if any.
68
69       parent
70         Parent (not sure what this is yet).
71
72       content_encoding
73         Content encoding, if any.
74

METHODS

76       RT::Client::REST::Attachment is a read-only object, so you cannot
77       "store()" it.  Also, because it is a second-class citizen, you cannot
78       "search()" or "count()" it -- use "attachments()" method provided by
79       RT::Client::REST::Ticket.
80
81       retrieve
82         To retrieve an attachment, attributes id and parent_id must be set.
83

INTERNAL METHODS

85       can
86         Wraps the normal can() call, to exclude unsupported methods from
87         parent.
88
89       rt_type
90         Returns 'attachment'.
91

CREATING ATTACHMENTS

93       Currently RT does not allow creating attachments via their API.
94
95       See <https://rt-wiki.bestpractical.com/wiki/REST#Ticket_Attachment>
96

SEE ALSO

98       RT::Client::REST::Ticket, RT::Client::REST::SearchResult.
99

AUTHOR

101       Dmitri Tikhonov
102
104       This software is copyright (c) 2020, 2018 by Dmitri Tikhonov.
105
106       This is free software; you can redistribute it and/or modify it under
107       the same terms as the Perl 5 programming language system itself.
108
109
110
111perl v5.32.1                      2021-01-27   RT::Client::REST::Attachment(3)
Impressum