line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Google::Calendar::Person; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Net::Google::Calendar::Person::VERSION = '1.05'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
1723
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
7
|
1
|
|
|
1
|
|
323
|
use XML::Atom::Person; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use base qw(XML::Atom::Person Net::Google::Calendar::Base); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my %allowed = ( |
11
|
|
|
|
|
|
|
attendeeStatus => [qw(accepted declined invited tentative)], |
12
|
|
|
|
|
|
|
attendeeType => [qw(optional required)], |
13
|
|
|
|
|
|
|
rel => [qw(attendee organizer performer speaker)], |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Net::Google::Calendar::Person - a thin wrapper round XML::Atom::Person |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 METHODS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 new |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub new { |
28
|
|
|
|
|
|
|
my $class = shift; |
29
|
|
|
|
|
|
|
my %opts = @_; |
30
|
|
|
|
|
|
|
$opts{Version} = '1.0' unless exists $opts{Version}; |
31
|
|
|
|
|
|
|
my $self = $class->SUPER::new(%opts); |
32
|
|
|
|
|
|
|
$self->_initialize(); |
33
|
|
|
|
|
|
|
return $self; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 name [name] |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
A simple string value that can be used as a representation of this person. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub name { |
44
|
|
|
|
|
|
|
my $self = shift; |
45
|
|
|
|
|
|
|
return $self->_do('@valueString', @_); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 email [email] |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Get or set the email of the person |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub email { |
55
|
|
|
|
|
|
|
my $self = shift; |
56
|
|
|
|
|
|
|
$self->_do('@email', @_); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 attendee_status [status] |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Get or set the status of event attendee. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
See: |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
http://code.google.com/apis/gdata/elements.html#gdAttendeeStatus |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Takes or returns any of the values C, C, C, C. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=cut |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub attendee_status { |
72
|
|
|
|
|
|
|
my $self = shift; |
73
|
|
|
|
|
|
|
$self->_do('attendeeStatus', @_); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 attendee_type [type] |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Get or set the type of event attendee. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
See: |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
http://code.google.com/apis/gdata/elements.html#gdAttendeeType |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Takes or returns any of the values C, C. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub attendee_type { |
89
|
|
|
|
|
|
|
my $self = shift; |
90
|
|
|
|
|
|
|
$self->_do('attendeeType', @_); |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 rel [relationship] |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub rel { |
99
|
|
|
|
|
|
|
my $self = shift; |
100
|
|
|
|
|
|
|
$self->_do('@rel', @_); |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub _do { |
105
|
|
|
|
|
|
|
my $self = shift; |
106
|
|
|
|
|
|
|
my $name = shift; |
107
|
|
|
|
|
|
|
my $attr = ($name =~ s!^@!!); |
108
|
|
|
|
|
|
|
$name =~ s!^gd:!!; |
109
|
|
|
|
|
|
|
my $vals = $allowed{$name}; |
110
|
|
|
|
|
|
|
my $gd_ns = ''; # $self->{_gd_ns}; |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
my $ns = (defined $vals)? "http://schemas.google.com/g/2005#event." : ""; |
113
|
|
|
|
|
|
|
if (@_) { |
114
|
|
|
|
|
|
|
my $new = shift; |
115
|
|
|
|
|
|
|
$new =~ s!^$ns!!; |
116
|
|
|
|
|
|
|
die "$new is not one of the allowed values for $name (".join(",", @$vals).")" |
117
|
|
|
|
|
|
|
unless !defined $vals || grep { $new eq $_ } @$vals; |
118
|
|
|
|
|
|
|
if ($attr) { |
119
|
|
|
|
|
|
|
#print "Setting attr $name to ${ns}${new}\n"; |
120
|
|
|
|
|
|
|
$self->set_attr($name, "${ns}${new}"); |
121
|
|
|
|
|
|
|
} else { |
122
|
|
|
|
|
|
|
#print "Setting child gd:$name to ${ns}${new}\n"; |
123
|
|
|
|
|
|
|
$self->set($gd_ns, "gd:${name}", '', { value => "${ns}${new}" }); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
my $val; |
127
|
|
|
|
|
|
|
if ($attr) { |
128
|
|
|
|
|
|
|
$val = $self->get_attr($name); |
129
|
|
|
|
|
|
|
} else { |
130
|
|
|
|
|
|
|
my $tmp = $self->_my_get($gd_ns, "gd:${name}"); |
131
|
|
|
|
|
|
|
if (defined $tmp) { |
132
|
|
|
|
|
|
|
$val = $tmp->getAttribute('value'); |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
# else { print "Failed to get gd:${name}\n"; } |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
$val =~ s!^$ns!! if defined $val; |
137
|
|
|
|
|
|
|
return $val; |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
1; |