1Net::CardDAVTalk(3) User Contributed Perl Documentation Net::CardDAVTalk(3)
2
3
4
6 Net::CardDAVTalk - A library for talking to CardDAV servers
7
9 Version 0.09
10
12 This module maps from CardDAV to an old version of the FastMail API.
13 It's mostly useful as an example of how to talk CardDAV and for the
14 Cyrus IMAP test suite Cassandane.
15
16 use Net::CardDAVTalk;
17
18 my $foo = Net::CardDAVTalk->new();
19 ...
20
22 $class->new()
23 Takes the same arguments as Net::DAVTalk and adds the single namespace:
24
25 C => 'urn:ietf:params:xml:ns:carddav'
26
27 $self->NewAddressBook($Path, %Args)
28 Creates a new addressbook collection. Requires the full path (unlike
29 Net::CalDAVTalk, which creates paths by UUID) and takes a single
30 argument, the name:
31
32 e.g.
33
34 $CardDAV->NewAddressBook("Default", name => "Addressbook");
35
36 $self->DeleteAddressBook($Path)
37 Deletes the addressbook at the given path
38
39 e.g.
40
41 $CardDAV->DeleteAddressBook("Shared");
42
43 $self->UpdateAddressBook($Path, %Args)
44 Like 'new', but for an existing addressbook. For now, can only change
45 the name.
46
47 e.g.
48
49 $CardDAV->UpdateAddressBook("Default", name => "My Happy Addressbook");
50
51 $self->GetAddressBook($Path, %Args)
52 Calls 'GetAddressBooks' with the args, and greps for the one with the
53 matching path.
54
55 e.g.
56
57 my $AB = $CardDAV->GetAddressBook("Default");
58
59 $self->GetAddressBooks(%Args)
60 Get all the addressbooks on the server.
61
62 Returns an arrayref of hashrefs
63
64 e.g.
65
66 my $ABs = $CardDAV->GetAddressBooks(Sync => 1);
67 foreach my $AB (@$ABs) {
68 say "$AB->{path}: $AB->{name}";
69 }
70
71 $Self->NewContact($AddressBookPath, $VCard)
72 Create a new contact from the Net::CardDAVTalk::VCard object, either
73 using its uid field or generating a new UUID and appending .vcf for the
74 filename.
75
76 Returns the full path to the card.
77
78 NOTE: can also be used for a kind: group v4 style group.
79
80 $self->DeleteContact($Path)
81 Delete the contact at path $Path.
82
83 $Self->UpdateContact($Path, $VCard)
84 Identical to NewContact, but will fail unless there is an existing
85 contact with that path. Also takes the full path instead of just the
86 addressbook path.
87
88 NOTE: can also be used for a kind: group v4 style group.
89
90 $Self->GetContact($Path)
91 Fetch a specific contact by path. Returns a Net::CardDAVTalk::VCard
92 object.
93
94 $Self->GetContactAndProps($Path, $Props)
95 Use a multiget to fetch the properties in the arrayref as well as the
96 card content.
97
98 Returns the card in scalar context - the card and an array of errors in
99 list context.
100
101 $self->GetContacts($Path, $Props, %Args)
102 Get multiple cards, possibly including props, using both a propfind AND
103 a multiget.
104
105 Returns an arrayref of contact and an arrayref of errors (or just the
106 contacts in scalar context again)
107
108 $self->GetContactLinks($Path)
109 Returns a hash of href => etag for every contact URL (type:
110 text/(x-)?vcard) inside the collection at \$Path.
111
112 $self->GetContactsMulti($Path, $Urls, $Props)
113 Does an addressbook-multiget on the \$Path for all the URLs in \$Urls
114 also fetching \$Props on top of the address-data and getetag.
115
116 $self->SyncContacts($Path, $Props, %Args)
117 uses the argument 'syncToken' to find newly added and removed cards
118 from the server. Returns just the added/changed contacts in scalar
119 context, or a list of array of contacts, array of removed, array of
120 errors and the new syncToken as 4 items in list context.
121
122 $self->SyncContactLinks($Path, %Args)
123 uses the argument 'syncToken' to find newly added and removed cards
124 from the server.
125
126 Returns a list of:
127
128 * Hash of href to etag for added/changed cargs * List of href of
129 removed cards * List of errors * Scalar value of new syncToken
130
131 $self->MoveContact($Path, $NewPath)
132 Move a contact to a new path (usually in a new addressbook) - both
133 paths are card paths.
134
136 Bron Gondwana, "<brong at cpan.org>"
137
139 Please report any bugs or feature requests to "bug-net-carddavtalk at
140 rt.cpan.org", or through the web interface at
141 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-CardDAVTalk>. I
142 will be notified, and then you'll automatically be notified of progress
143 on your bug as I make changes.
144
146 You can find documentation for this module with the perldoc command.
147
148 perldoc Net::CardDAVTalk
149
150 You can also look for information at:
151
152 • RT: CPAN's request tracker (report bugs here)
153
154 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-CardDAVTalk>
155
156 • AnnoCPAN: Annotated CPAN documentation
157
158 <http://annocpan.org/dist/Net-CardDAVTalk>
159
160 • CPAN Ratings
161
162 <http://cpanratings.perl.org/d/Net-CardDAVTalk>
163
164 • Search CPAN
165
166 <http://search.cpan.org/dist/Net-CardDAVTalk/>
167
170 Copyright 2015 FastMail Pty. Ltd.
171
172 This program is free software; you can redistribute it and/or modify it
173 under the terms of the the Artistic License (2.0). You may obtain a
174 copy of the full license at:
175
176 <http://www.perlfoundation.org/artistic_license_2_0>
177
178 Any use, modification, and distribution of the Standard or Modified
179 Versions is governed by this Artistic License. By using, modifying or
180 distributing the Package, you accept this license. Do not use, modify,
181 or distribute the Package, if you do not accept this license.
182
183 If your Modified Version has been derived from a Modified Version made
184 by someone other than you, you are nevertheless required to ensure that
185 your Modified Version complies with the requirements of this license.
186
187 This license does not grant you the right to use any trademark, service
188 mark, tradename, or logo of the Copyright Holder.
189
190 This license includes the non-exclusive, worldwide, free-of-charge
191 patent license to make, have made, use, offer to sell, sell, import and
192 otherwise transfer the Package with respect to any patent claims
193 licensable by the Copyright Holder that are necessarily infringed by
194 the Package. If you institute patent litigation (including a cross-
195 claim or counterclaim) against any party alleging that the Package
196 constitutes direct or contributory patent infringement, then this
197 Artistic License to you shall terminate on the date that such
198 litigation is filed.
199
200 Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
201 AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
202 THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
203 PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
204 YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
205 CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
206 CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
207 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
208
209
210
211perl v5.34.0 2022-01-21 Net::CardDAVTalk(3)